Tune SM90 small-M FP4 schedules - #58
Merged
Merged
Conversation
Signed-off-by: mgoin <mgoin64@gmail.com> Assisted-by: AI
mgoin
marked this pull request as ready for review
August 18, 2026 19:38
This was referenced Aug 21, 2026
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
Tune the SM90 scheduler for the small-M FP4 paths exercised by MXFP4/NVFP4 A16 and grouped-FP8 activations.
This keeps the existing weight layouts and changes only launch scheduling.
Root cause
The grouped-scale SM90 path selected block
(M, 128, 256)with warp(M, 16, 128), producing a 512-thread CTA. On the reported Kimi projections this caused very low eligible-warp activity and a large latency cliff.The A16/B4 paths had separate small-M issues: insufficient resident CTAs, excessive routed-row padding, stale warp K after divisibility fitting, and output grids that did not always justify wide N tiles or Stream-K.
H200 performance
Grouped FP8 + MXFP4, E=12/top-8 balanced routing:
The new geometry is neutral at M=1-4 and about 8x faster at M=256. A block-K128 ablation regressed the small endpoints, so this change does not copy a blanket block-K cap.
Matched BF16 FP4 expert-GEMM sweeps versus Marlin:
The remaining NVFP4 down gap is dominated by E4M3 scale application rather than GEMM scheduling and is intentionally outside this draft.
Validation
../.venv/bin/python -m pytest tests/test_sm90_heuristics.py -q: 11 passedchg run --gpus 1 --timeout 45m -- ... test_mxfp4.py test_special_paths.py -v: 18 passed, 1 skippedchg run --gpus 1 --timeout 45m -- ... humming/tests/kernels/humming -q: 248 passed, 84 skippedScope and known limitations
This draft does not claim that FP16 NVFP4 is uniformly ahead of Marlin; several FP16 points remain 10-14% behind. It also does not add vLLM dispatch or DeepEP plumbing for MXFP4 + block-FP8 group128, and it does not claim NVFP4 grouped block-FP8 or MXFP8 activation support.
The longer-term proposal is to replace the ordered SM90 mutations with bounded schedule candidates, one shared legality/resource analyzer, and sparse offline tuning records. This draft stages the measured schedules and regression fixtures that proposal must preserve.
Duplicate-work check
No open
inclusionAI/hummingPR matched SM90 A16/FP4 heuristics, H200/Marlin, or indexed A16.This is not a duplicate of merged Humming #57: that change is already in the base and provides the general indexed-A16 foundation. This draft adds FP4-specific small-M residency/tile selection, dense FP4 scheduling, and grouped-A8 geometry. vLLM #51332 covers application-side block-FP8 dispatch and DeepEP plumbing and is not duplicated here.
Disclosure
AI assistance was used in developing and validating this change.