Fix default-build for SM120/121 block-scaled GEMM: keep largest tile first - #3438
Open
krauqen wants to merge 1 commit into
Open
Fix default-build for SM120/121 block-scaled GEMM: keep largest tile first#3438krauqen wants to merge 1 commit into
krauqen wants to merge 1 commit into
Conversation
…p largest tile first
With an empty CUTLASS_LIBRARY_KERNELS, CreateGemmUniversal3xOperator prunes
each family's tile list to tile_descriptions[0] ("only generate the largest
tile"). The SM120 block-scaled generators list their tiles smallest-first,
so a default sm_120a/121a library build instantiates the family exclusively
at 128x8x128 (cooperative) / 128x16x128 (pingpong), crossed with output
variants that only compile at larger tile N (narrow-byte D epilogue smem
atom, FP6 ElementD contiguous-extent constraint, SFVecSize divisibility,
FP6-B operand copy atom). The build fails with static asserts before any
block-scaled kernel is usable.
Reorder the tile lists largest-first so the default set selects
128x128x128, which compiles for every generated dtype/output combination.
The small-N tiles remain available to non-empty CUTLASS_LIBRARY_KERNELS
builds. Add a regression test asserting the default-set tile selection.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mtx93NPwq8NLy7pqUB7oMs
krauqen
force-pushed
the
sm121-default-build-fix
branch
from
August 6, 2026 17:50
ce7212f to
a822a84
Compare
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.
Problem
A default CUTLASS library / profiler build for SM120-class GPUs — including SM121 (DGX Spark), using the flag set suggested in the Quick Start Guide —
fails with static asserts in every SM120 block-scaled (
bstensorop) GEMM shard whose data types touch FP4/FP6 or block-scale-factor output. Representative failures (CUDA 13.0,sm_121a):The consequence is that no NVFP4/MXFP4/FP6 block-scaled GEMM is buildable through the library on SM120/SM121 without hand-maintained
CUTLASS_LIBRARY_EXCLUDE_KERNELSpatterns, even though the underlying kernels are fully functional at larger tiles.Root cause
With an empty
CUTLASS_LIBRARY_KERNELS,CreateGemmUniversal3xOperatorprunes each family's tile list totile_descriptions[0]:This relies on tile lists being ordered largest-first. The SM120 block-scaled generators (
GenerateSM120_TensorOp_mixed_8bits_UMMA_gemm_with_block_scaled,GenerateSM120_TensorOp_fp4_UMMA_gemm_with_block_scaled) list their tiles smallest-first, so the default set instantiates the family exclusively at128x8x128(cooperative) /128x16x128(pingpong), crossed with every output variant the generators emit. Several of those combinations cannot compile at small tile N:ElementD(e5m2,e2m1) — no valid epilogue smem atom at N=8 (and N=16 pingpong fore2m1+SFD)ElementD— requires a contiguous CTA extent that is a multiple of 128SFVecSizeSM100_SU6_DU8x16_x4_LDSM_Nneeds per-MMA-atom N ≥ 16 (fails at N=8 cooperative and N=16 pingpong)The same combinations compile at
128x128x128, which wastile_descriptions[0]before the small-N tiles were added.Fix
Reorder
tile_sizes_cooperative/tile_sizes_pingpongin the two SM120 block-scaled generator functions to largest-first, restoring thetile_descriptions[0]convention. The default set then selects128x128x128, which compiles for every generated dtype/output combination. No tiles are removed: builds with a non-emptyCUTLASS_LIBRARY_KERNELSstill instantiate the full lists, including the small-N tiles for skinny-N problems.Add a regression test,
test/python/cutlass_library/test_sm120_blockscaled_default_tiles.py(pure Python, no GPU required):main(TileN=8 selected), passes with this change;Validation
Tested on NVIDIA DGX Spark (GB10, SM121) with CUDA 13.0.88.
121a, empty kernel filter, no excludes: 500bstensoropkernels emitted, all128x128x128(previously: all128x8x128/128x16x128, of which large subsets fail to compile).cutlass_profilerbuild for121awith noCUTLASS_LIBRARY_EXCLUDE_KERNELS: completes with 0 errors (previously fails in every FP4/FP6-touching shard).m=n=k=1024, one process per kernel: 484/484 passed, including NVFP4×NVFP4 with FP4-requantization output (LinCombBlockScaleFactor) and grouped variants.main(4 failures, default set selects TileN=8).git diff --checkpasses.