Repository navigation
Conversation
yuyu5333
requested review from
DarkSharpness,
HaiShaw,
HydraQYH,
celve and
yuan-luo
as code owners
September 14, 2026 13:23
yuyu5333
requested review from
BBuf,
Fridge003,
Qiaolin-Yu,
hebiao064,
ispobock and
merrymercy
as code owners
September 15, 2026 07:03
hnyls2002
requested review from
Edwardf0t1,
FlamingoPg,
JustinTong0323,
Ying1123,
alphabetc1,
ch-wan,
fzyzcjy,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
mickqian,
stmatengss,
xiezhq-hermann,
yctseng0211,
yhyang201 and
yizhang2077
September 15, 2026 21:22
hnyls2002
force-pushed
the
dsv4.1
branch
21 times, most recently
from
September 16, 2026 05:47
c81d5c2 to
660722f
Compare
yuyu5333
force-pushed
the
feature/dsv41-deepselect-sm90
branch
from
September 16, 2026 09:33
3fc1ce3 to
a0d85cb
Compare
5 tasks
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
DeepSeek V4.1 candidate indexing performs an FP32 block-level Top-K selection before publishing the candidate mask. On NVIDIA Hopper SM90, this selection can use the optimized DeepSelect kernel to reduce the latency of candidate publication for long-context decode workloads.
This integration depends on the SM90 implementation from deepseek-ai/DeepSelect#14.
Modifications
SGLANG_OPT_DSV41_DEEPSELECT_CANDIDATE_TOPKenvironment switch. It is disabled by default, preserving the existingtorch.topkpath.deep_select.topkfor candidate-block FP32 Top-K when the switch is enabled on SM90.Enable the path with:
export SGLANG_OPT_DSV41_DEEPSELECT_CANDIDATE_TOPK=1Accuracy Tests
The candidate logits and published masks were compared against the existing
torch.topkimplementation on an NVIDIA H20.test_dsv4_indexer_postprocess.pypassed.topk_blocksvalues of 1, 513, and 2048, padded output strides, and finite tied scores.Speed Tests and Profiling
Benchmarks were run on an NVIDIA H20 (SM90) with FP32 candidate scores,
topk_blocks=2048, cold-cache flushing, 20 warmup iterations, and the median of 100 measured iterations. The measured region includes candidate block score reduction, candidate-mask publication, and the downstream fused paged Top-K.Final Top-K 512
torch.topkFinal Top-K 2048
torch.topkAcross the tested shapes, the complete candidate publication and final Top-K path is
1.25xto2.01xfaster. The candidate block Top-K and mask-publication region alone is1.34xto2.19xfaster.Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #35080145279
Latest PR Test (Extra): ❌ Run #35080144980
Latest PR Test (AMD ROCm 10): ❌ Run #35080145194