From de9fb4bef8bb1f62d425dd44533810d838908df6 Mon Sep 17 00:00:00 2001 From: Lucas Wilkinson Date: Fri, 11 Oct 2024 15:57:39 -0400 Subject: [PATCH] [Bugfix][CI/Build] Fix docker build where CUDA archs < 7.0 are being detected (#9254) --- CMakeLists.txt | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4be52480..3a424ad7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,27 +144,32 @@ else() endif() -# -# For cuda we want to be able to control which architectures we compile for on -# a per-file basis in order to cut down on compile time. So here we extract -# the set of architectures we want to compile for and remove the from the -# CMAKE_CUDA_FLAGS so that they are not applied globally. -# if(VLLM_GPU_LANG STREQUAL "CUDA") + # + # For cuda we want to be able to control which architectures we compile for on + # a per-file basis in order to cut down on compile time. So here we extract + # the set of architectures we want to compile for and remove the from the + # CMAKE_CUDA_FLAGS so that they are not applied globally. + # clear_cuda_arches(CUDA_ARCH_FLAGS) extract_unique_cuda_archs_ascending(CUDA_ARCHS "${CUDA_ARCH_FLAGS}") message(STATUS "CUDA target architectures: ${CUDA_ARCHS}") + # Filter the target architectures by the supported supported archs + # since for some files we will build for all CUDA_ARCHS. + cuda_archs_loose_intersection(CUDA_ARCHS + "${CUDA_SUPPORTED_ARCHS}" "${CUDA_ARCHS}") + message(STATUS "CUDA supported target architectures: ${CUDA_ARCHS}") +else() + # + # For other GPU targets override the GPU architectures detected by cmake/torch + # and filter them by the supported versions for the current language. + # The final set of arches is stored in `VLLM_GPU_ARCHES`. + # + override_gpu_arches(VLLM_GPU_ARCHES + ${VLLM_GPU_LANG} + "${${VLLM_GPU_LANG}_SUPPORTED_ARCHS}") endif() -# -# Override the GPU architectures detected by cmake/torch and filter them by -# the supported versions for the current language. -# The final set of arches is stored in `VLLM_GPU_ARCHES`. -# -override_gpu_arches(VLLM_GPU_ARCHES - ${VLLM_GPU_LANG} - "${${VLLM_GPU_LANG}_SUPPORTED_ARCHS}") - # # Query torch for additional GPU compilation flags for the given # `VLLM_GPU_LANG`.