Repository navigation
Build sm_107a with CUTLASS 4.8.1 and restore the >160-split sparse decode combine - #20
Merged
Merged
Conversation
The wheel only carries sm_100a/sm_103a, which 10.7 devices cannot run. Add sm_107a to both kernel sets when nvcc lists compute_107, and patch the CUTLASS arch lists (arch/config.h, arch/reg_reconfig.h, arch/grid_dependency_control.h) that do not know SM107 yet; without the patch sm_107a compiles but loses the SM100 MMA/TMA paths, setmaxnreg and PDL. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The combine kernel synced from upstream csrc/ stops at 160 splits and asserts beyond it, so sparse decode fails on GPUs whose num_sm_parts exceeds 160. csrc_legacy still carries these cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 22, 2026
CUTLASS v4.8.0+ supports SM107 natively (arch/config.h SM107A/F, reg_reconfig.h, grid_dependency_control.h), so drop the header patch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CUTLASS 4.8 replaced TMEM::MAX_CAPACITY_BITS with per-arch TMEM::TargetTmemCapacityBits (SM107 has 576 TMEM columns), and the SM100 F8F6F4 UMMA op is now a class template used directly as the MMA_Atom op. Follow CuTe's own allocator assert and upstream's examples/77_blackwell_fmha/collective/fmha_common.hpp. Co-Authored-By: Claude Opus 5.5 <[email protected]>
zcnrex
marked this pull request as ready for review
October 22, 2026 20:33
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.
Motivation
Two problems block FlashMLA on CC 10.7 devices.
sm_100a/sm_103a(plussm_90afor the legacy set), which a 10.7 device cannot run. The pinned CUTLASS (4.3.5) has no SM107 support either. CUTLASS v4.8.0+ supports SM107 natively, but buildingsm_107aagainst older CUTLASS compiles and silently loses the SM100 MMA/TMA paths,setmaxnregand PDL.csrc/stops itsNUM_SPLITSswitch at 160 (combine.cu:213,KU_ASSERT(false)). So sparse decode fails on any GPU whosenum_sm_partsexceeds 160, whatever arch it was built for.csrc_legacystill has the 192/224/256 cases.Modifications
CUTLASS submodule → v4.8.1 (
2c85f49). Two source updates come with it, both following upstream CUTLASS:TMEM::TargetTmemCapacityBits, as CuTe's own allocator now does.TMEM::MAX_CAPACITY_BITSis gone because SM107's TMEM capacity differs from SM100's.fmha_common.hpp(csrc/andcsrc_legacy/): the F8F6F4to_tiled_mma_sm100_tsoverload uses the op template directly as theMMA_Atomop. This matches upstreamexamples/77_blackwell_fmha/collective/fmha_common.hppat v4.8.1.For CUTLASS headers, v4.8.0 and v4.8.1 differ only in
version.h.setup.py: whennvcc --list-gpu-archreportscompute_107,sm_107ais added toCUDA_ARCHSandLEGACY_CUDA_ARCHS. The sglang release build (scripts/build_sgl_flash_mla.sh, CUDA 13.4) picks it up with no further change. Builds with an nvcc that lackscompute_107are unchanged.combine.cu: restores the 192/224/256 cases.smem_bufisBLOCK_SIZE_M x MAX_SPLITSfloats, so 8 KB at 256.Tests
On a CC 10.7 device, wheel built from this branch with
FLASH_MLA_BUILD_DENSE_PREFILL=1 pip wheel --no-build-isolation:sm_100a/sm_103a/sm_107abinaries, with the sameUSETMAXREGcount (208) in each.tests/test-sparse-decode.py: 1534/1534 pass. Before the combine fix it asserted atcombine.cu:213.tests/test-sparse-prefill.py: all 316 pass.tests/test_fmha_sm100.py: passes.tests/test-fused-norm-rope-attn-rope-cast.py: not run; it needstile_kernels.Not yet tested: SM100 / SM103 hardware with the CUTLASS bump. The
sm_100a/sm_103abinaries were compiled and their SASS inspected, but not run.Native
sm_107abeats thesm_100fbinary on the fusedcore_attndecode and prefill kernels, measured with per-kernel serving profiles. Numbers are available on request.Related: sgl-project/sglang#45635 moves DSv4.1's FlashMLA kernels to the
sgl-flash-mlawheel. sgl-project/sglang#45884 will bump the wheel version once this lands. sgl-project/DeepGEMM#113 makes the same CUTLASS bump for DeepGEMM.🤖 Generated with Claude Code