Repository navigation
[Perf] dsv4: Gather V4.1 index-K slots once per prefill graph replay - #45741
Merged
Merged
Conversation
…eplay-context test
hnyls2002
requested review from
Fridge003,
HaiShaw,
Qiaolin-Yu,
hebiao064,
ispobock and
merrymercy
as code owners
October 22, 2026 05:02
…atch's forward mode
Collaborator
Author
|
/rerun-test test_dsv41_late_layer_tail_readers.py test_dsv41_candidate_blocks.py test_dsv4_nonpaged_indexer.py test_encoder_swa_replay.py test_deepseek_v4.py test_dsv41_prefill_sparse_indexer.py test_dense_prefill_indexer.py test_deepseek_v41_flash_gb300_encoder_bcg.py test_deepseek_v41_flash_gb300_trtllm_bounded_bcg.py |
Collaborator
Author
|
/tag-and-rerun-ci |
Contributor
|
🚀 🚀 🚀 🚀 |
…inherits it and replay refresh carries it; graph metadata publishes no source rows
Open
5 tasks
chaohu2000
added a commit
to flytiger-eco/sglang-for-sail
that referenced
this pull request
Oct 27, 2026
…gl-project#45741) (cherry picked from commit 7d43eeb75cd0aa4e99ac5c383e3531e3afb62895)
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.
prepare_forward_metadata_for_breakable_cuda_graph_replaycalls_snapshot_low_ratio_k_slotsafter refreshing the full and tail metadata, so the full top-k and low-ratio source breaks readlow_ratio_k_slotsand onePrefillIndexPlanper ratio instead of gathering fromreq_to_tokenand rebuilding the plan in every layer. The snapshot's condition moves into the helper, so both callers make the same one-line call; only the capture pass still gathers per layer._share_low_ratio_k_slotshands it the same snapshot with its own plan cache, as_snapshot_low_ratio_k_slotsalready does for the tail metadata of an eager extend.No behavior change: the snapshot holds the same slots and plans the per-layer path builds, which assertions confirmed on every layer, tail included, of 639 prefill graph replays of DeepSeek-V4.1-Flash (DEP4 with MegaMoE on GB300, 4,096 and 8,192 tokens per rank). At 4,096 tokens per rank the scheduler thread spends about 3.4 ms less per step (sampled), with the index-K gather down from 4.0 to 0.9 ms.
CI States
Latest PR Test (Base): 🚫 Run #39734244451
Latest PR Test (Extra): ❌ Run #39734244329
Latest PR Test (AMD ROCm 10): 🚫 Run #39734244523