[Build] Fix CUDA arch detection producing kernel-less builds on SM121 - #49904
Merged
Merged
Conversation
ayush1399
requested review from
Harry-Chen,
LucasWilkinson and
tlrmchlsmth
as code owners
July 26, 2026 21:52
Harry-Chen
approved these changes
Jul 27, 2026
Harry-Chen
left a comment
Member
There was a problem hiding this comment.
Good catch! This reminds me of the story of why Windows 9 was not released 🤦
Member
|
@ayush1399 Please finish the DCO requirement before we can get this merged. |
… (GB10) Signed-off-by: Ayushman Singh <40520701+ayush1399@users.noreply.github.com>
ayush1399
force-pushed
the
fix-cuda-arch-detect-sm121
branch
from
July 27, 2026 12:21
64fa6d8 to
404f218
Compare
Contributor
Author
|
@Harry-Chen updated my commit with a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
On GB10 / DGX Spark (compute capability 12.1, CUDA 13), this shows up on the default source-build path from the docs,
uv pip install -e .withTORCH_CUDA_ARCH_LISTunset. No special flags or custom arch list needed. The build looks fine but has no CUTLASS kernels in it. The.soonly containssm_75cubins. Serving any FP8 model then fails at startup:The cause is an old line in torch's vendored
select_compute_arch.cmake:It was written for Fermi . The string
12.1contains2.1, so torch rewrites it to12.1(2.0)and emits-gencode arch=compute_20,code=sm_121.vLLM's
extract_unique_cuda_archs_ascending()reads thearch=compute_*part of that flag, so it sees arch2.0. Nothing inCUDA_SUPPORTED_ARCHSmatches2.0, so every arch-gated kernel is skipped. The rest of the sources build at nvcc's defaultsm_75, and the build reports success.There is an upstream fix in progress (pytorch/pytorch#185993), but every torch release up to 2.11 has the bug so there should be a fix in vLLM as well.
Changes
cmake/utils.cmake: read thecode=sm_*part of each gencode flag instead ofarch=compute_*, since that is the real SASS target. Fall back toarch=compute_*for PTX-only entries. This gets12.1back, andcuda_archs_loose_intersection()maps it to the12.0ffamily target.CMakeLists.txt: if no supported arch matches, stop with an error instead of building a binary with no kernels.Not a duplicate
12.0ffamily fallback already handles SM121. The bug here happens before that logic runs.AI assistance disclosure
AI assistance was used for root-cause analysis, and drafting this description. The code changes were made and tested by me, reviewed with AI.
Test Plan
On GB10: rebuild with
TORCH_CUDA_ARCH_LISTunset, check the compiled archs withcuobjdump --list-elf, then serve the FP8 model from the issue.Test Result
GB10 (aarch64, CUDA 13.0.88, torch 2.11.0+cu130),
uv pip install -e ., noTORCH_CUDA_ARCH_LISTset.Before:
_C_stable_libtorch.abi3.sohas onlysm_75cubins.vllm serve RedHatAI/gemma-4-31B-it-FP8-blockcrashes inprofile_run.After:
The rebuild works and the same model serves fine (
Application startup complete).I am attaching the full
vllm servestartup logs for both cases, the crash before the fix and the clean startup after it.FP8_SM121_bug_startup_logs.md
FP8_SM121_bugfix_startup_logs.md
This only changes the build system and touches no numerics, so I did not run evals.
Essential Elements of an Effective PR Description Checklist
supported_models.mdand examples for a new model. No documentation update is required for this build-only fix.