[NVIDIA][CuTe,Fwd,sm120] Fix use_tma_O crash on SM120 (issue #2649) - #2655
Closed
johnnynunez wants to merge 2 commits into
Closed
johnnynunez wants to merge 2 commits into
johnnynunez wants to merge 2 commits into
Conversation
This was referenced Jun 15, 2026
Contributor
|
#2634 disables the broken SM80-base TMA-O path for SM120, though with a broader self.use_tma_O = False approach in the SM80-base path. |
v0i0
approved these changes
Jun 22, 2026
On SM120 (Blackwell GeForce / RTX PRO 6000 / DGX Spark) the forward kernel set
`use_tma_O = self.arch >= Arch.sm_90`, enabling the TMA-based O-store epilogue.
But SM120 does not build the TMA store atom (tma_atom_O is None), so any forward
call crashes in cpasync.tma_partition with:
AttributeError: 'NoneType' object has no attribute '_trait'
This makes the CuTe-DSL forward unusable on every SM120 GPU.
Restrict the TMA O-store to sm_90..sm_119, which is where the WGMMA-era epilogue
path is actually available:
self.use_tma_O = Arch.sm_90 <= self.arch < Arch.sm_120
SM120 falls back to the non-TMA register->gmem O store (already used for the
SM80 path), which is correct and what the CpAsync SM120 kernel expects.
Verified on RTX PRO 6000 Blackwell (sm_120, cc 12.0), torch 2.12.0+cu130,
nvidia-cutlass-dsl 4.5.2: forward now runs and matches PyTorch SDPA reference
for hdim 64/96/128, causal and non-causal (max abs err <= 8e-3 in bf16). Before
this fix every SM120 forward call raised the AttributeError above.
johnnynunez
force-pushed
the
fix/sm120-use-tma-o-2649
branch
from
June 28, 2026 18:08
61fa553 to
e1e9ed0
Compare
The functional use_tma_O guard already landed via Dao-AILab#2656; this branch now carries only the explanatory comment for the sm_120 TMA-O restriction (issue Dao-AILab#2649).
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.
Summary
Fixes #2649. On SM120 (Blackwell GeForce / RTX PRO 6000 / DGX Spark) the CuTe-DSL forward kernel is currently unusable — every call crashes with:
Root cause
FlashAttentionForwardSm120inherits the forward__call__, which sets:This enables the TMA-based O-store epilogue for SM120. But SM120 does not build the TMA store atom (
tma_atom_OisNone), because it lacks the WGMMA-era TMA-store epilogue path. The firsttma_partitionon the null atom raises theAttributeError.Fix
Restrict the TMA O-store to
sm_90 .. sm_119:SM120 then falls back to the register→gmem O store already used by the SM80 path, which is what the CpAsync SM120 kernel expects.
Testing
Verified on RTX PRO 6000 Blackwell (sm_120, cc 12.0), torch 2.12.0+cu130, nvidia-cutlass-dsl 4.5.2:
AttributeErrorabove.One-line behavioral change; no effect on sm80/sm90/sm100 paths.