Repository navigation
Add FP4 Indexer for DeepSeek V4 on SM120 - #27059
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
liz-badada
marked this pull request as ready for review
June 9, 2026 09:39
liz-badada
requested review from
BBuf,
DarkSharpness,
HydraQYH,
celve and
yuan-luo
as code owners
June 9, 2026 09:39
liz-badada
added a commit
to liz-badada/DeepGEMM
that referenced
this pull request
Jun 30, 2026
Extract only the paged FP4 MQA path required by sgl-project/sglang#27059 from deepseek-ai#324. The upstream feature commit 9160119 is not independently cherry-pickable because it relies on earlier SM120 JIT, MMA, and scheduler refactors, so this commit carries only the leaf support missing from sgl/dev.\n\nThe supported contract is intentionally limited to next_n=1, 64 query heads, head_dim=128, block_kv=64, FP32 logits, 2-D context lengths, and no varlen indices. Dense MQA, FP8 MQA, BF16 logits, wider shape support, and SM121 family reuse are deliberately excluded.
liz-badada
added a commit
to liz-badada/DeepGEMM
that referenced
this pull request
Jun 30, 2026
Extract only the paged FP4 MQA path required by sgl-project/sglang#27059 from deepseek-ai#324. The upstream feature commit 9160119 is not independently cherry-pickable because it relies on earlier SM120 JIT, MMA, and scheduler refactors, so this commit carries only the leaf support missing from sgl/dev. The supported contract is intentionally limited to next_n=1, 64 query heads, head_dim=128, block_kv=64, FP32 logits, 2-D context lengths, and no varlen indices. Dense MQA, FP8 MQA, BF16 logits, wider shape support, and SM121 family reuse are deliberately excluded.
liz-badada
added a commit
to liz-badada/DeepGEMM
that referenced
this pull request
Jul 1, 2026
Extract only the paged FP4 MQA path required by sgl-project/sglang#27059 from deepseek-ai#324. The upstream feature commit 9160119 is not independently cherry-pickable because it relies on earlier SM120 JIT, MMA, and scheduler refactors, so this commit carries only the leaf support missing from sgl/dev. The supported contract is intentionally limited to next_n=1, 64 query heads, head_dim=128, block_kv=64, FP32 logits, 2-D context lengths, and no varlen indices. Dense MQA, FP8 MQA, BF16 logits, wider shape support, and SM121 family reuse are deliberately excluded.
liz-badada
force-pushed
the
sm12x-fp4-indexer-upstream
branch
from
July 13, 2026 03:18
5453e93 to
9f100e6
Compare
liz-badada
requested review from
Fridge003,
HaiShaw,
Qiaolin-Yu,
hebiao064,
ispobock and
merrymercy
as code owners
July 13, 2026 03:18
Collaborator
Author
|
/tag-run-ci-label |
Collaborator
Author
|
/rerun-failed-ci |
1 similar comment
Collaborator
Author
|
/rerun-failed-ci |
Fridge003
reviewed
Jul 23, 2026
Collaborator
There was a problem hiding this comment.
Can we skip this for now. We can reenable it after deepgemm is ready
liz-badada
force-pushed
the
sm12x-fp4-indexer-upstream
branch
from
July 23, 2026 06:23
9f100e6 to
90398a6
Compare
Collaborator
|
/rerun-test test_dsv4_nonpaged_indexer.py |
Contributor
|
Results for 🚀 |
ch-wan
approved these changes
Jul 24, 2026
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
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
Follow-up to #26209, extends the FP4 Indexer to SM120 (depends on sgl-project/DeepGEMM#56).
Accuracy
DeepSeek V4 Flash GSM8K
Performance
Two sets of results are reported because they were collected on different SGLang software stacks. They use the same model, workload, and FP8-versus-FP4 indexer comparison, but different SM120 main-attention backends. Therefore, each table is a valid within-stack A/B comparison, while the absolute numbers across the two tables are not directly comparable as a regression test.
Test configurations
5453e93c50245a47444c; tree identical to current squashed PR head9f100e6e27The latest validation explicitly selected the supported SM120 FlashInfer paged-attention path:
SGLANG_OPT_DSV4_NONPAGED_INDEXER=0ensures that the paged indexer path covered by DeepGEMM PR #55 is exercised. Sparse prefill was disabled to isolate the supported FlashInfer paged path on SM120.Latest validation: FlashInfer attention
SGLang tested commit:
245a47444cCurrent PR head:
9f100e6e27Both commits have the same Git tree:
dce05ad8fc61e17e0062bbafa376fc54cd8f95ae.Both cases completed all 8 requests successfully.
The latest server command was:
For the FP4 case, the same command was used with:
The current benchmark entry point has moved from
sglang.bench_servingtosglang.benchmark.serving:Although
--skip-server-warmupwas used in the latest run, the benchmark client performed its default warmup request before starting the timed region.Original measurement: Triton attention
SGLang commit:
5453e93c50At this revision, the SM120 attention implementation selected Triton by default through
SGLANG_SM120_TRITON_FLASHMLA=1.The original server command was:
For the FP4 case, the same command was used with:
The benchmark command was:
Why the percentage improvement changed
The two result sets are not contradictory. The following decomposition shows what changed:
FP8 - FP4)The FP8 indexer adds approximately 31 seconds in both measurements. The major change is that the FP4 path, which represents the rest of the model plus the faster indexer, decreased from 410.49 seconds to 20.53 seconds on the newer stack.
On the original stack, the approximately 30.48-second saving was small relative to the 440.97-second total, so E2E latency improved by only 6.91%. On the latest stack, the surrounding model path became much faster while the FP8-indexer overhead remained approximately 31 seconds. Removing that overhead reduced E2E latency from 51.45 seconds to 20.53 seconds, or 60.09%.
For the fixed-concurrency workload, benchmark duration decreased from approximately 51.57 seconds to 20.56 seconds. Throughput is inversely proportional to duration for a fixed amount of work, so this is a
51.57 / 20.56 = 2.508xthroughput ratio, reported as a 150.83% increase.Therefore, the larger percentage does not mean that the FP4 indexer itself suddenly became several times faster. Its absolute E2E benefit remained approximately 31 seconds. The newer SGLang stack made the surrounding SM120 attention and model-execution path much faster, exposing the FP8 indexer as the dominant remaining bottleneck.
The full cross-run speedup should not be attributed solely to FlashInfer because the SGLang revisions also differ by roughly six weeks of development. A backend-only experiment on one fixed SGLang revision would be required to isolate the exact contribution of the attention backend.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #29984983462
Latest PR Test (Extra): ❌ Run #29984983412