[DeepSeek-V4] Support Batched and Round-Robin CP Prefill in the Non-Paged Indexer - #33570
Open
YMbmzy wants to merge 5 commits into
Open
[DeepSeek-V4] Support Batched and Round-Robin CP Prefill in the Non-Paged Indexer#33570YMbmzy wants to merge 5 commits into
YMbmzy wants to merge 5 commits into
Conversation
YMbmzy
requested review from
Fridge003,
HaiShaw,
Qiaolin-Yu,
hebiao064,
ispobock and
merrymercy
as code owners
August 4, 2026 15:50
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
41 tasks
Collaborator
|
/tag-and-rerun-ci |
Contributor
Author
|
/rerun-failed-ci |
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
PR #29619 introduced the non-paged DeepSeek-V4 C4 indexer for long-context prefill, and PR #30140 enabled it by default when the local query length is at least 8,192 tokens per rank. The benchmarks in those PRs showed that, once the fixed KV-gather cost is amortized at this scale, gathering the indexer KV cache into contiguous storage and using the non-paged DeepGEMM kernel can improve prefill throughput.
However, the existing fast path is restricted to
CP=1andbatch_size=1, which excludes two important serving scenarios:--chunked-prefill-size. Suchbatch_size>1batches should also benefit from the non-paged path when their aggregate local query length reaches the threshold.This PR extends the non-paged indexer to batched prefill and round-robin context-parallel prefill while preserving the existing query-length threshold and fail-closed fallbacks for unsupported configurations.
Modifications
interleave(round-robin) strategy. Other CP strategies, such aszigzag, explicitly fall back to the paged indexer; support for additional CP layouts is left to follow-up work.[ks, ke)ranges to DeepGEMM.Accuracy Tests
Test design
SGLANG_OPT_DSV4_NONPAGED_INDEXER=0SGLANG_OPT_DSV4_NONPAGED_INDEXER=1The two configurations used the same model, server arguments, dataset, and evaluation parameters. The environment variable above was the only difference between them.
Reproduction commands
Run the server once for each configuration, changing only
SGLANG_OPT_DSV4_NONPAGED_INDEXER:Run the same evaluation against each server:
Runtime (NONPAGED=1)
Results
NONPAGED=0)NONPAGED=1)The paged and non-paged configurations achieved comparable GSM8K scores. The optimized run's mean score was
+0.0010(+0.10percentage points) above the baseline, which is within the observed run-to-run variation. No accuracy regression was observed.Checklist
CI States
Latest PR Test (Base): Not run yet⚠️ Not enabled -- add
Latest PR Test (Extra):
run-ci-extralabel to opt in.