[Fix] dsv4: Write idle SWA stores to an idle request-window layout by hnyls2002 · Pull Request #45586 · sgl-project/sglang · GitHub
Skip to content

[Fix] dsv4: Write idle SWA stores to an idle request-window layout - #45586

Merged
hnyls2002 merged 4 commits into
mainfrom
lsyin/dspark-idle-verify-rw
Oct 21, 2026
Merged

hnyls2002 merged 4 commits into
mainfrom
lsyin/dspark-idle-verify-rw

Conversation

@hnyls2002

@hnyls2002 hnyls2002 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator
  • DeepseekV4AttnBackend.get_swa_out_cache_loc no longer reads attention metadata on an idle forward under --enable-encoder-swa-bounded-replay. It returns the write locations of RequestWindow.activate_idle, a cached layout whose rows land in the workspace past an empty history.
  • Under speculative decoding, a padded idle forward (a DP-attention rank with no requests, padded to the busy ranks' token count) skips init_forward_metadata. The store then read the previous forward's request-window layout, or None after an unpadded idle. The result was either a TensorMatcher failure in fused_k_norm_rope_flashmla (the stale write_loc length does not match the padded rows) or AttributeError: 'NoneType' object has no attribute 'core_attn_metadata'.
  • Repro: DeepSeek-V4.1-Flash, DEP4 on 4x GB300, --moe-a2a-backend megamoe --speculative-algorithm DSPARK --enable-encoder-swa-bounded-replay, GSM8K through sgl-eval (200 examples, 64 threads, max tokens 4096, temperature 0, no thinking). The server crashed at 197/200 when one rank ran an idle verify. With this change the run completes 200/200 at 97.50%, the same score as without encoder replay.
  • The repro above ran with the Engram idle fix of [Fix] dsv4: Skip DP-attention pad rows in the engram hasher and low-ratio sources #40424 applied, since main then failed first with engram serves extend, target-verify and decode, not 4 on the same idle forward; [Fix] dsv4: Skip DP-attention pad rows in the engram hasher and low-ratio sources #40424 has since merged.

No behavior change outside idle forwards with --enable-encoder-swa-bounded-replay; idle rows were already discarded and never committed.


CI States

Latest PR Test (Base): 🚫 Run #39683121972
Latest PR Test (Extra): ❌ Run #39683122015
Latest PR Test (AMD ROCm 10): 🚫 Run #39683121706

@hnyls2002

Copy link
Copy Markdown
Collaborator Author

@hnyls2002

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Oct 21, 2026
@hnyls2002
hnyls2002 merged commit 99cf403 into main Oct 21, 2026
110 of 169 checks passed
@hnyls2002
hnyls2002 deleted the lsyin/dspark-idle-verify-rw branch October 21, 2026 22:18
kkHuang-amd pushed a commit to HaiShaw/sglang that referenced this pull request Oct 22, 2026
Resolve conflicts with sgl-project#45579 (history_src precomputed in the layout:
drop the HIP history-row cache, pass zero_row, add history_src to the
direct layout) and sgl-project#45586 (idle request-window layout). Gate the direct
window branches on _is_hip, move the direct test to AMD CI, and give the
HIP floor test mock a zero_row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant