[Build] Skip spinloop extension on Python < 3.11#44783
Conversation
|
This issue was introduced by #36517 |
|
I think it is fixed by #43659? |
Not exactly. #43659 only fixed the runtime side (added try/except ImportError in Python). The build itself still fails on Python 3.10 because spinloop.cpp uses Py_buffer which is unavailable under Py_LIMITED_API. You never get a wheel, so the runtime fallback never gets a chance to run. This PR adds the missing build-time guard. |
|
@Jasen2201 Please add sign-off to your commits |
fff4f02 to
a18cddd
Compare
The spinloop extension uses Py_buffer, PyBuffer_Release, and the "y*" format code in PyArg_ParseTupleAndKeywords — none of which are available in the Python Limited/Stable API. Combined with USE_SABI 3.11, this causes compilation to fail on Python 3.10 because the Limited API headers do not declare these symbols. Guard the spinloop target in both CMakeLists.txt (Python_VERSION check) and setup.py (sys.version_info check) so the build skips it on older interpreters. This aligns build-time behavior with the existing runtime fallback (try/except import in vllm/_spinloop.py) and keeps vLLM buildable on Python 3.10, which is still within the declared requires-python range (>=3.10,<3.15). Signed-off-by: Jasen2201 <yajizhan@amd.com>
a18cddd to
abaaf20
Compare
Done, rebased onto the latest origin/main and added Signed-off-by. |
|
The CI failure is unrelated to this PR @Harry-Chen |
|
Hi @zhyajie, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
https://github.com/vllm-project/vllm/actions/runs/27285824805/job/80592869532?pr=44783 The update-dockerfile-graph hook failure is unrelated to this PR. It's caused by a pre-existing mismatch between docker/Dockerfile and docs/assets/contributing/dockerfile-stages-dependency.png on main. This PR only modifies CMakeLists.txt — no Dockerfile changes involved. |
|
Thanks for fixing this! |
Signed-off-by: Jasen2201 <yajizhan@amd.com>
Signed-off-by: Jasen2201 <yajizhan@amd.com>
Signed-off-by: Jasen2201 <yajizhan@amd.com> Signed-off-by: divineearthly <divineearthly@gmail.com>
Signed-off-by: Jasen2201 <yajizhan@amd.com>
Signed-off-by: Jasen2201 <yajizhan@amd.com>
The spinloop extension uses Py_buffer, PyBuffer_Release, and the "y*" format code in PyArg_ParseTupleAndKeywords — none of which are available in the Python Limited/Stable API. Combined with USE_SABI 3.11, this causes compilation to fail on Python 3.10 because the Limited API headers do not declare these symbols.
Guard the spinloop target in both CMakeLists.txt (Python_VERSION check) and setup.py (sys.version_info check) so the build skips it on older interpreters. This aligns build-time behavior with the existing runtime fallback (try/except import in vllm/_spinloop.py) and keeps vLLM buildable on Python 3.10, which is still within the declared requires-python range (>=3.10,<3.15).
Purpose
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.