@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 4a76ad12e0
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 6, 00:45 UTC

[Bugfix] Preserve CUDA arch suffix (a/f) for SM12x — fixes NVFP4 NaN on desktop Blackwell (#37725)

Signed-off-by: Rob Tand <robert.tand@icloud.com> Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>

RobTand committed Mar 25, 2026 at 11:18 UTC 4a76ad12e00109f3bb06ccbd7089fc3612564e31
2 files changed +6 -4
CMakeLists.txt
+2 -2
@@ -94,10 +94,10 @@ find_package(Torch REQUIRED)
94 # This check must happen after find_package(Torch) because that's when CMAKE_CUDA_COMPILER_VERSION gets defined
95 if(DEFINED CMAKE_CUDA_COMPILER_VERSION AND
96 CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
97 - set(CUDA_SUPPORTED_ARCHS "7.5;8.0;8.6;8.7;8.9;9.0;10.0;11.0;12.0")
97 + set(CUDA_SUPPORTED_ARCHS "7.5;8.0;8.6;8.7;8.9;9.0;10.0;11.0;12.0;12.1")
98 elseif(DEFINED CMAKE_CUDA_COMPILER_VERSION AND
99 CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8)
100 - set(CUDA_SUPPORTED_ARCHS "7.0;7.2;7.5;8.0;8.6;8.7;8.9;9.0;10.0;10.1;12.0")
100 + set(CUDA_SUPPORTED_ARCHS "7.0;7.2;7.5;8.0;8.6;8.7;8.9;9.0;10.0;10.1;12.0;12.1")
101 else()
102 set(CUDA_SUPPORTED_ARCHS "7.0;7.2;7.5;8.0;8.6;8.7;8.9;9.0")
103 endif()
cmake/utils.cmake
+4 -2
@@ -173,8 +173,10 @@ print(candidates[0] if candidates else '')
173 endfunction()
174
175 # Macro for converting a `gencode` version number to a cmake version number.
176 +# Preserves architecture-specific suffixes (a/f) needed for correct
177 +# __CUDA_ARCH_FAMILY_SPECIFIC__ definition. E.g. "121a" -> "12.1a".
178 macro(string_to_ver OUT_VER IN_STR)
177 - string(REGEX REPLACE "\([0-9]+\)\([0-9]\)" "\\1.\\2" ${OUT_VER} ${IN_STR})
179 + string(REGEX REPLACE "\([0-9]+\)\([0-9][af]?\)" "\\1.\\2" ${OUT_VER} ${IN_STR})
180 endmacro()
181
182 #
@@ -211,7 +213,7 @@ endmacro()
213 function(extract_unique_cuda_archs_ascending OUT_ARCHES CUDA_ARCH_FLAGS)
214 set(_CUDA_ARCHES)
215 foreach(_ARCH ${CUDA_ARCH_FLAGS})
214 - string(REGEX MATCH "arch=compute_\([0-9]+a?\)" _COMPUTE ${_ARCH})
216 + string(REGEX MATCH "arch=compute_\([0-9]+[af]?\)" _COMPUTE ${_ARCH})
217 if (_COMPUTE)
218 set(_COMPUTE ${CMAKE_MATCH_1})
219 endif()