Repository navigation
perf(sm100): small-M single-wave 1D1D GEMM heuristic - #175
Merged
Merged
Conversation
Account for cluster_m B-multicast (ceil_div(num_m_blocks, cluster_m)) when scoring single-wave small-M (64 <= expected_m <= 256, expected_n >= 4096) Normal 1D1D GEMMs, prioritizing fewer effective M-blocks and then higher last_wave_util. Gate num_effective_m_blocks on num_waves == 1 (and expected_m >= 64, expected_n >= 4096) so tiny-M (M <= 32) and small-N (N <= 2048) retain swap_ab=1 16x128 c=1x2 without epilogue/SF_B regressions, and LayoutInfo::operator<< only prints num_effective_m_blocks when the heuristic is active.
zcnrex
force-pushed
the
chunan/sm100-1d1d-small-m-heuristic
branch
from
December 1, 2026 07:14
2ce87e2 to
05792b5
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.
Summary
Split out from #165 (
csrc/jit_kernels/heuristics/config.hpp,csrc/jit_kernels/heuristics/sm100.hpp):cluster_mB-multicast (ceil_div(num_m_blocks, cluster_m)) when computing effective B weight reads (num_effective_m_blocks) for single-wave small-M (num_waves == 1,64 <= get_expected_m() <= 256,get_expected_n() >= 4096)NormalKernel1D1DGEMMs.num_effective_m_blocksand then higherlast_wave_utilbefore cluster-size tie-breaking when active.M <= 32) and small-N (N <= 2048) ondev'sswap_ab=1 16x128 c=1x2layout to avoid 1-warp epilogue (STORE_BLOCK_M=32) and 8× UTCCPSF_Boverfetch (block_n=16) regressions.num_effective_m_blocksinLayoutInfo::operator<<when active (> 0), keeping SM90/SM120/large-M/multi-waveDG_PRINT_CONFIGSoutput unchanged.Verification & Performance
bench_kineto256 MB flush) — rebased ondev, tested 82 cases across FP8 (1×128/128×128), MXFP4 (32×32), and FP8×FP4 (128×32) forM ∈ {8, 16, 32, 64, 128, 192, 256, 512},N ∈ {1024, 2048, 4096, 5120, 7168, 12288},K ∈ {4096, 7168, 16384}:calc_diffwithin dtype tolerances).M=64, 128,N >= 4096(e.g.,mxfp4 M=128 N=12288 K=4096:9.39 → 8.25 us(1.14×);fp8 M=128 N=12288 K=4096:13.66 → 12.42 us(1.10×);fp8 M=64 N=4096 K=16384:19.74 → 17.85 us(1.11×);mxfp4 M=128 N=7168 K=4096: 1.05×).M <= 32(0.84× → 1.00×) andN <= 2048(0.94×–0.96× → 1.00×) regressions.