[Build] Skip spinloop extension on Python < 3.11 (#44783)
Signed-off-by: Jasen2201 <yajizhan@amd.com>
This commit is contained in:
+15
-12
@@ -114,20 +114,23 @@ endif()
|
|||||||
# CPU builds define the target before the early return)
|
# CPU builds define the target before the early return)
|
||||||
# This extension requires SABI 3.11 since it relies on Py_buffer support. Loading
|
# This extension requires SABI 3.11 since it relies on Py_buffer support. Loading
|
||||||
# failure is handled gracefully on vLLM side for lower Python versions.
|
# failure is handled gracefully on vLLM side for lower Python versions.
|
||||||
|
# Skip the target entirely on Python < 3.11 so the build doesn't break.
|
||||||
#
|
#
|
||||||
set(VLLM_SPINLOOP_EXT_SRC "csrc/spinloop.cpp")
|
if(Python_VERSION VERSION_GREATER_EQUAL "3.11")
|
||||||
set(SPINLOOP_COMPILE_FLAGS "")
|
set(VLLM_SPINLOOP_EXT_SRC "csrc/spinloop.cpp")
|
||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
|
set(SPINLOOP_COMPILE_FLAGS "")
|
||||||
list(APPEND SPINLOOP_COMPILE_FLAGS "-mmwaitx")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
|
||||||
|
list(APPEND SPINLOOP_COMPILE_FLAGS "-mmwaitx")
|
||||||
|
endif()
|
||||||
|
define_extension_target(
|
||||||
|
spinloop
|
||||||
|
DESTINATION vllm
|
||||||
|
LANGUAGE CXX
|
||||||
|
SOURCES ${VLLM_SPINLOOP_EXT_SRC}
|
||||||
|
COMPILE_FLAGS ${SPINLOOP_COMPILE_FLAGS}
|
||||||
|
USE_SABI 3.11
|
||||||
|
WITH_SOABI)
|
||||||
endif()
|
endif()
|
||||||
define_extension_target(
|
|
||||||
spinloop
|
|
||||||
DESTINATION vllm
|
|
||||||
LANGUAGE CXX
|
|
||||||
SOURCES ${VLLM_SPINLOOP_EXT_SRC}
|
|
||||||
COMPILE_FLAGS ${SPINLOOP_COMPILE_FLAGS}
|
|
||||||
USE_SABI 3.11
|
|
||||||
WITH_SOABI)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Forward the non-CUDA device extensions to external CMake scripts.
|
# Forward the non-CUDA device extensions to external CMake scripts.
|
||||||
|
|||||||
@@ -1086,7 +1086,8 @@ if _is_cuda() or _is_hip():
|
|||||||
# copying the relevant .py files from the source repository.
|
# copying the relevant .py files from the source repository.
|
||||||
ext_modules.append(CMakeExtension(name="vllm.triton_kernels", optional=True))
|
ext_modules.append(CMakeExtension(name="vllm.triton_kernels", optional=True))
|
||||||
|
|
||||||
ext_modules.append(CMakeExtension(name="vllm.spinloop"))
|
if sys.version_info >= (3, 11):
|
||||||
|
ext_modules.append(CMakeExtension(name="vllm.spinloop"))
|
||||||
|
|
||||||
if _is_hip():
|
if _is_hip():
|
||||||
ext_modules.append(CMakeExtension(name="vllm._rocm_C"))
|
ext_modules.append(CMakeExtension(name="vllm._rocm_C"))
|
||||||
|
|||||||
Reference in New Issue
Block a user