Skip to content

[DeepSeek V4] Enable FlashMLA sparse prefill by default - #29775

Merged
Fridge003 merged 3 commits into
sgl-project:mainfrom
YAMY1234:yamy1234/dsv4-flashmla-sparse-prefill-default-on
Jul 1, 2026
Merged

Fridge003 merged 3 commits into
sgl-project:mainfrom
YAMY1234:yamy1234/dsv4-flashmla-sparse-prefill-default-on

Conversation

@YAMY1234

@YAMY1234 YAMY1234 commented Jun 30, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

FlashMLA sparse prefill improves DeepSeek V4 server-side prefill throughput across the tested input lengths under saturated serving load. Enable the existing path by default while preserving the existing size-based selection policy when the flag is explicitly disabled.

Modifications

Change the default value of SGLANG_OPT_FLASHMLA_SPARSE_PREFILL from false to true. Setting it to 0 restores the existing size-based selector; queries above the existing threshold continue to select sparse prefill as before.

Accuracy Tests

No kernel or model-forward implementation is changed. Verified that the flag resolves to true when unset and still resolves to false when explicitly disabled.

Speed Tests and Profiling

Measured on GB300 with TP4 / DP4 / EP4 prefill, DP attention, FP8 KV cache, an 8,192-token prefill chunk per rank, and persistent request backlog. Each 1K–16K arm uses a fixed 300-second measurement window with zero failed requests and zero cached tokens.

Nominal ISL Global concurrency OFF TPS/rank ON TPS/rank Gain Replay gain
1K 128 15,818.18 16,485.28 +4.217% +4.242%
8K 64 13,870.58 14,813.02 +6.795% +6.883%
16K 64 13,464.29 14,545.99 +8.034% +7.914%
128K 8 10,493 11,792 +12.4% —

The maximum difference between the primary and replay gains for the 1K–16K measurements is 0.12 percentage points. The performance claim is scoped to the validated GB300 serving configurations shown above. This remains a draft while underfilled batches, SM120, and prefill context parallelism are outside the current safety-validation scope.

Checklist

  • pre-commit run --files python/sglang/srt/environ.py
  • Verified default-on and explicit-false flag behavior.
  • No documentation update is required; the existing flag remains unchanged.

CI States

Latest PR Test (Base): ❌ Run #28544931569
Latest PR Test (Extra): ⏳ Run #28546902349

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@YAMY1234
YAMY1234 marked this pull request as ready for review June 30, 2026 17:08
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@Fridge003

Copy link
Copy Markdown
Collaborator

/rerun-test test/registered/models_e2e/test_deepseek_v4_flash_fp4_b200.py test/registered/models_e2e/test_deepseek_v4_flash_fp4_megamoe_b200.py test/registered/models_e2e/test_deepseek_v4_flash_fp4_h200.py test/registered/models_e2e/test_deepseek_v4_flash_fp4_h200.py

@github-actions

github-actions Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/models_e2e/test_deepseek_v4_flash_fp4_b200.py test/registered/models_e2e/test_deepseek_v4_flash_fp4_megamoe_b200.py test/registered/models_e2e/test_deepseek_v4_flash_fp4_h200.py test/registered/models_e2e/test_deepseek_v4_flash_fp4_h200.py:

🚀 4-gpu-b200 (2 tests): ❌ View workflow run

cd test/ && python3 registered/models_e2e/test_deepseek_v4_flash_fp4_b200.py
cd test/ && python3 registered/models_e2e/test_deepseek_v4_flash_fp4_megamoe_b200.py

🚀 8-gpu-h200 (1 test): ✅ View workflow run

cd test/ && python3 registered/models_e2e/test_deepseek_v4_flash_fp4_h200.py

@YAMY1234

YAMY1234 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/models_e2e/test_deepseek_v4_flash_fp4_b200.py

@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/models_e2e/test_deepseek_v4_flash_fp4_b200.py:

🚀 4-gpu-b200 (1 test): ✅ View workflow run

cd test/ && python3 registered/models_e2e/test_deepseek_v4_flash_fp4_b200.py

@Fridge003

Copy link
Copy Markdown
Collaborator

/rerun-test test/registered/cp/test_deepseek_v4_flash_fp4_b200_cp.py

@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/cp/test_deepseek_v4_flash_fp4_b200_cp.py:

🚀 4-gpu-b200 (1 test): ❌ View workflow run

cd test/ && python3 registered/cp/test_deepseek_v4_flash_fp4_b200_cp.py

@Fridge003

Copy link
Copy Markdown
Collaborator

/rerun-test test/registered/cp/test_deepseek_v4_flash_fp4_b200_cp.py

@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/cp/test_deepseek_v4_flash_fp4_b200_cp.py:

🚀 4-gpu-b200 (1 test): ✅ View workflow run

cd test/ && python3 registered/cp/test_deepseek_v4_flash_fp4_b200_cp.py

@Fridge003
Fridge003 merged commit c865347 into sgl-project:main Jul 1, 2026
90 of 104 checks passed
@Fridge003 Fridge003 added the release-highlight Candidate PR for release note highlight label Jul 1, 2026
vstone-w pushed a commit to ClownBin/sglang that referenced this pull request Jul 2, 2026
…29775)

Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek release-highlight Candidate PR for release note highlight

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants