[Kernel] Fix SM90 FP8 decode regression with benchmarked M/K/N routing - #37018
Merged
Merged
Conversation
RunFMe
requested review from
BBuf,
DarkSharpness,
HaiShaw,
HydraQYH,
celve and
yuan-luo
as code owners
August 29, 2026 10:49
BBuf
approved these changes
Aug 29, 2026
BBuf
left a comment
Collaborator
There was a problem hiding this comment.
It seems resonable, approved!
Collaborator
|
/tag-run-ci-label extra |
Collaborator
|
/rerun-test test/registered/quant/test_w8a8_quantization.py |
Contributor
|
Results for 🚀 |
kediwu0331
pushed a commit
to Zhylkaaa/sglang
that referenced
this pull request
Aug 30, 2026
sgl-project#37018) Co-authored-by: John Doe <johndoe@example.com> Co-authored-by: BBuf <1182563586@qq.com>
This was referenced Sep 10, 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.
Motivation
The SM90 row/column-scaled FP8 selector introduced by #34318 can route decode GEMMs to
torch._scaled_mmbased on K/N alone. The reported H100 W8A8 regression is:Llama-3.1-8B-Instruct-FP8-dynamictest/registered/quant/test_w8a8_quantization.py::TestW8A8Fp8.test_throughputM=1, K=14336, N=4096Direct profiling of that shape on both H200 and H100 showed that the AOT kernel is substantially faster at decode M, even though K and N are large.
Modifications
Constrain Torch/NVJet routing to the benchmarked large-prefill envelope (doing m >= 6144 is not really worth the gain from my measurements):
This keeps the following on AOT:
M < 8192K=14336, N=4096Llama down projectionK=5376, N=3584andK=3584, N=5376Torch remains selected for stable large-prefill wins: wide QKV/gate/up projections and broad down projections.
Speed Tests and Profiling
Common software:
70d99e998b4955e0049d13a98d77ae1b14db1f45)sgl_kernel==0.4.4The broad grid used 11 projection families and 12 M values (132 cases): 1, 16, 64, 256, 1024, 2048, 4096, 6144, 8192, 8320, 12288, and 16384. Percentages below are Torch speedups over AOT.
H200 (SM90)
Protocol:
Reported regression shape:
Routing boundary:
Across the H200 broad grid, every one of the 32 measurements selected by the new predicate favored Torch. Their median speedup was 2.50%, with a measured range of 0.17–5.97%. Two independent randomized boundary passes added 48 repeated routed measurements, all of which also favored Torch.
H100 80 GB HBM3 (SM90)
Protocol:
Reported regression shape:
Routing boundary:
Across the H100 broad grid, every one of the 32 measurements selected by the new predicate favored Torch. Their median speedup was 19.48%, with a measured range of 1.36–56.53%. The stronger randomized boundary pass added 24 repeated routed measurements, all favoring Torch, with a 21.02% median and a 2.72–57.38% range.
On both GPUs, the excluded Llama down and narrow TP8 families had weak large-M results that were near parity or changed sign across passes, so this change deliberately leaves them on AOT rather than routing on noise.
CI States
Latest PR Test (Base): ✅ Run #33259017128
Latest PR Test (Extra): ❌ Run #33259145867
Latest PR Test (AMD ROCm 7.2): ❌ Run #33259017192