Repository navigation
[Fix] dsv41: Bound MoE routing to live SWA graph-tail rows - #44347
Merged
kpham-sgl merged 5 commits intoOct 15, 2026
Merged
Conversation
kpham-sgl
requested review from
Fridge003,
HaiShaw,
Qiaolin-Yu,
hebiao064,
ispobock and
merrymercy
as code owners
October 14, 2026 22:48
Collaborator
Author
|
/rerun-test test/registered/e2e/models/test_deepseek_v41_flash_gb300.py |
Contributor
|
🚀 |
This was referenced Oct 15, 2026
listar2000
pushed a commit
to listar2000/miles
that referenced
this pull request
Oct 30, 2026
…e rows [fork fix-065] Inside the prefill CUDA graph the late-layer tail block is padded to a fixed capacity. The tail switch pointed only the CPU non-padded count at the real tail rows, so MoE dispatch still read the GPU counts and routed the padding rows. SGLang's fix (#44347) clamps the GPU counts to the tail's real rows while the late layers run and restores them after. It also drops a duplicated block of tail fields in __init__. Patch page: fork/patches/fix-065-sglang-swa-fixes.md Fork-Fix: fix-065 Touches: sglang:python/sglang/srt/layers/attention/deepseek_v4_backend.py Evidence: sgl-project/sglang#44347 (main d4daf5236); the 1-node A/B on this branch's image Upstream-Status: merged in sgl-project/sglang main 80afdc128 (d4daf5236, #44347); not on sglang-miles 5403606db9 Remove-When: SGLANG_COMMIT includes sgl-project/sglang d4daf5236 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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
During DeepSeek V4.1 bounded decoder SWA replay inside a breakable prefill graph, attention switches to the live tail while MoE can retain the full-prefill GPU row bound. A 128-row tail can therefore expose a routing bound of 16,384 rows.
Modifications
Bind the global and local GPU routing counts to a persistent tail scalar while the late layers run. Clamp the existing count so an idle DP peer stays at zero, then restore the original CPU count and GPU tensor references on exit. Reuse the scalar across replays so captured MoE kernels retain a stable address.
This is an independent fix against main, separated from the MegaAttention integration in #43922.
Accuracy Tests
Speed Tests and Profiling
A separate end-to-end throughput benefit has not been measured for this fix alone. The earlier AgentX comparison combined it with the Mega query-layout optimization. Eager tails already use compact tensors; this fix addresses the padded graph-tail path.
CI States
Latest PR Test (Base): ❌ Run #38680117421
Latest PR Test (Extra): ❌ Run #38680117400
Latest PR Test (AMD ROCm 10): ❌ Run #38680117454