Handle compute capability with letter at end#20
Open
sempervictus wants to merge 1 commit into
Open
Conversation
Cutlass needs to know about SM120a to properly build certain code such sa block-scaled MMA and FP4 relates components ( NVIDIA/cutlass#2820 pytorch/pytorch#172807 ). Attempt to remedy this by allowing the parser to detect the digits of the compute cap returned by smi or taken from the env when the default parse fails by dropping the last char of the parsed string. Record the provided cap in the environment variable target to pass it downstream but retain the usize datatype for this library for now.
Narsil
reviewed
Jan 26, 2026
| compute_cap_str | ||
| .parse::<usize>() | ||
| .expect("Could not parse code") | ||
| match compute_cap_str.parse::<usize>() { |
Owner
There was a problem hiding this comment.
Maybe we should just parse into its own type ?
Author
There was a problem hiding this comment.
Yes that would be the proper fix, I did a quick grep for users and didn't quite have time to validate interface sanity for such a change so threw this up as a quickie "fix"
jagan-nuvai
added a commit
to Nuvai/cuda-bindgen
that referenced
this pull request
Mar 28, 2026
…ffix caps - Add multi-gencode / fat binary support (CUDA_COMPUTE_CAPS env, compute_caps() builder) - build_lib uses -gencode flags for multiple architectures, build_ptx targets lowest CC - Builder is now Clone; build_lib/build_ptx take &self for reuse (build lib then ptx) - Add CUDA_HOME env var, versioned /usr/local/cuda-* paths, more Windows paths - Handle letter-suffixed compute caps (e.g. 120a for Blackwell SM_120a) - Add Windows MSVC nvcc flags (#[cfg(windows)] -Xcompiler /Zc:preprocessor -DNOGDI) - build_lib returns Result instead of panicking - cuda_root() now follows builder pattern (returns Self) - Remove spurious #[allow(unused)] on include_options - Add cargo:rerun-if-env-changed for all CUDA env vars Addresses upstream: Narsil#11 (multi compute_cap), Narsil#5 (reusable builder), Narsil#15 (env vars/paths), Narsil#20 (letter caps), Narsil#21 (Windows MSVC), Narsil#1 (error handling), Narsil#9 (format expect) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Cutlass needs to know about SM120a to properly build certain code such sa block-scaled MMA and FP4 related components ( NVIDIA/cutlass#2820
pytorch/pytorch#172807
).
Attempt to remedy this by allowing the parser to detect the digits of the compute cap returned by smi or taken from the env when the default parse fails by dropping the last char of the parsed string. Record the provided cap in the environment variable target to pass it downstream but retain the usize datatype for this library for now.