Repository navigation
[DSV4] Fix draft SWA transfer for disaggregated MTP - #30461
Merged
ShangmingCai merged 1 commit intoJul 9, 2026
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! |
weireweire
marked this pull request as ready for review
July 8, 2026 03:26
weireweire
requested review from
ByronHsu,
Duyi-Wang,
HaiShaw,
ShangmingCai,
Ying1123,
alphabetc1,
billishyahao,
hanming-lu,
hnyls2002,
hzh0425,
ispobock,
kkHuang-amd,
merrymercy,
sogalin,
xiezhq-hermann and
yizhang2077
as code owners
July 8, 2026 03:26
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
weireweire
force-pushed
the
fix/dsv4-disagg-draft-swa-transfer
branch
2 times, most recently
from
July 8, 2026 05:15
1fb7796 to
fe4dbf4
Compare
Root cause: the DSV4 draft NextN layer stores prompt state in its ratio-0 SWA pool, but that pool was omitted from disaggregated state registration. Decode therefore began with missing draft prompt state until generated tokens refilled the sliding window. Register the draft pool as one trailing positional component using the existing SWA or SWA_RING transport type, after validating the shared target/draft indexing invariants. This reuses the existing state wire format and transfer backends without adding draft-specific backend handling. Validation: 24 focused CPU tests and pre-commit pass. A parallel 1P1D GPU A/B improves request-weighted acceptance length from 2.8054 to 2.9139; the patched 20-sample GSM8K smoke test reaches 90% strict and 95% flexible match.
weireweire
force-pushed
the
fix/dsv4-disagg-draft-swa-transfer
branch
from
July 8, 2026 05:29
fe4dbf4 to
7ca94bb
Compare
Contributor
Author
|
@ShangmingCai Hi, could you help to review this disagg MTP bug fixing? |
Contributor
Author
|
/tag-and-rerun-ci |
ShangmingCai
reviewed
Jul 9, 2026
| # reusing the existing SWA transport dispatch. NPU has a different paged | ||
| # state layout and is intentionally left unchanged. | ||
| if ( | ||
| not is_npu() |
Collaborator
There was a problem hiding this comment.
NPU uses NPUMLATokenToKVPool, this could be redundant.
Collaborator
|
Since CI has passed, let me merge first; the redundant is_npu could be fixed when NPU also looks into this problem. |
4 tasks
Chronostasys
pushed a commit
to MindLab-Research/sglang
that referenced
this pull request
Aug 24, 2026
Co-authored-by: weireweire <20922698+weireweire@users.noreply.github.com>
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
When both prefill and decode enable EAGLE for DeepSeek V4, prefill builds prompt SWA state for the draft NextN layer. Disaggregation already registers the draft pool's contiguous KV buffers, but the DSV4 NextN layer has compression ratio 0 and stores its state in the paged SWA pool, or in the SWA-ring prefix of the unified KV pool. Those buffers were not registered, so decode started with missing or stale draft prompt state until newly generated tokens refilled the sliding window.
This is the DSV4/SWA counterpart of #23539. The draft worker shares the target request pool and SWA allocator mapping; unified mode also uses matching ring geometry. Therefore the draft buffers can reuse the existing SWA transport types. They are registered as a separate positional component so they do not become part of the target model's heterogeneous DSV4 state layout. This change is limited to the non-NPU DSV4 path.
Modifications
StateType.SWAcomponent and unified draft ring buffers as an additionalStateType.SWA_RINGcomponent.Accuracy Tests
Speed Tests and Profiling
With EAGLE top-k 1, 3 speculative steps, and 4 draft tokens:
The strongest improvement appears in the early decode window, before locally generated tokens replace the transferred 128-token draft SWA prompt state. After aligning each DP rank at its first stable decode batch:
This time-segmented result directly matches the failure mode: the missing prompt SWA state hurts draft proposals most at the beginning, and its impact decays as newly generated tokens fill the local SWA window.
Across the full requests, the improvement is diluted by later decode steps after the local SWA window has been refilled:
The workload is intentionally small, so these numbers validate the expected direction rather than establish an end-to-end throughput claim.
Validation
python -m pytest -q test/registered/unit/disaggregation/test_disaggregation_wire.py test/registered/unit/disaggregation/test_minimax_sparse_disagg_state_kv_args.py(18 passed, 2 subtests passed)pre-commit run --all-files --show-diff-on-failureChecklist
CI States
Latest PR Test (Base): ✅ Run #28919874867
Latest PR Test (Extra): ❌ Run #28919874782