fix: Use is_family_of() for SM12x arch guard in MmaSM120BlockScaledOp - #3082
fix: Use is_family_of() for SM12x arch guard in MmaSM120BlockScaledOp#3082blake-snc wants to merge 1 commit into
Conversation
The arch check in MmaSM120BlockScaledOp.__post_init__ uses a hardcoded equality check against Arch.sm_120a, which rejects sm_121a (DGX Spark) even though the block-scaled MMA instruction set is identical across the SM12x family. The error message already references admissible_archs, showing the intent was to support multiple archs. Replace `arch == Arch.sm_120a` with `arch.is_family_of(Arch.sm_120a)` so that sm_121a (and any future sm12x variants) are accepted. Also add "sm_121a" to the admissible_archs list for consistency with the error message. Contributed by Second Nature Computing (https://joinsecondnature.com) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3047d61 to
e85cc91
Compare
Replace hardcoded `arch == Arch.sm_90a` with `arch.is_family_of(Arch.sm_90a)` in warpgroup/mma.py's MmaOp for consistency with the warp-level MMA fix in NVIDIA#3082. While functionally equivalent today (sm_90a is the only Hopper "a"-suffix arch in practice), this makes the arch guard consistent with the is_family_of() pattern and future-proofs against potential Hopper variants. Validated: - is_family_of(Arch.sm_90a) returns True for sm_90a - is_family_of(Arch.sm_90a) returns False for sm_120a, sm_100a Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Ping for review — small fix to use |
|
cc @depaulmillz |
|
This PR has been labeled |
|
Still relevant on current main ( 135: def __post_init__(self) -> None:
136: # Verify arch
137: arch = BaseDSL._get_dsl().get_arch_enum()
138: if not arch == Arch.sm_120a:
139: raise OpError(
140: self,
141: f"expects arch to be one of {self.admissible_archs}, but got {arch}",
Note: commenting to reset the |
|
Runtime confirmation on cutlass-dsl 4.4.2 / NVIDIA GB10 (sm_121a) today: Same line 138 of |
As of the current main branch, the admissible architectures for the MmaSM120BlockScaledOp operator are limited to sm_120a. This restriction prevents devices with the sm_121 architecture from utilizing the corresponding MMA atoms. This PR addresses the issue by replacing the strict architecture check with is_family_of(), allowing proper support for SM12x-family GPUs. I would appreciate it if you could consider merging this PR :) |
|
There will be a fix for this in the next 4.5-wheel release. |
|
Closing this — it's been superseded by main. |
Summary
arch == Arch.sm_120aequality check witharch.is_family_of(Arch.sm_120a)inMmaSM120BlockScaledOp.__post_init__"sm_121a"toadmissible_archslist for consistency with the error messageProblem
MmaSM120BlockScaledOpguards its arch check withif not arch == Arch.sm_120a, which rejectssm_121a(DGX Spark / GB10) even though the block-scaled MMA instruction set (mma.sync.aligned.block_scale) is identical across the SM12x family. The error message already referencesadmissible_archs, showing the intent was to support multiple archs, but the guard ignores the list entirely:Fix
Use the existing
is_family_of()method which was designed for exactly this purpose:This accepts
sm_120a,sm_120f,sm_121a,sm_121f— all SM12x family members that share the same block-scaled MMA instructions.Validation (DGX Spark, SM121a)
Tested on NVIDIA GB10 (sm_121a) by patching the installed
nvidia-cutlass-dslpackage and running each test in a separate process (the DSL caches arch at init):Before fix — sm_121a rejected:
After fix — all tests pass:
Contributed by Second Nature Computing (https://joinsecondnature.com)