Repository navigation
[Perf] dsv4: Map V4.1 prefill index selections to pool slots in one kernel - #45938
Merged
Merged
Conversation
hnyls2002
requested review from
BBuf,
DarkSharpness,
Fridge003,
HaiShaw,
HydraQYH,
Qiaolin-Yu,
celve,
hebiao064,
ispobock,
merrymercy and
yuan-luo
as code owners
October 23, 2026 02:02
Collaborator
Author
|
/rerun-test test_dense_prefill_indexer.py test_dsv41_prefill_sparse_indexer.py test_deepseek_v41_flash_gb300_tp2ep2.py |
Contributor
|
🚀 🚀 |
Collaborator
Author
|
/tag-and-rerun-ci |
Open
5 tasks
chaohu2000
added a commit
to flytiger-eco/sglang-for-sail
that referenced
this pull request
Oct 27, 2026
…ernel (sgl-project#45938) (cherry picked from commit 7507c69a811a1960bb37a49dd48f34994dd2d34c)
Juhyun-Kim-Memphis
added a commit
to vessl-ai/sglang
that referenced
this pull request
Oct 28, 2026
…he torch prefill indexer (adapted from sgl-project#45794) Adaptation of upstream sgl-project#45794 (65f19fc) to this branch, which lacks the later index-plan refactors (sgl-project#45251, sgl-project#45577, sgl-project#45938), so the upstream patch does not apply as is. - Under prefill CP the caller passes req_rows=None with rank-local rows; rebuild the row-to-request map from req_pool_indices and rows_per_request instead of asserting. Without this, prefill CP on SM90 (torch indexer) dies at the first prefill. - Pad the dequantized index K to a multiple of 64 rows when it is BF16 on CUDA and lc >= 1024, size query chunks on the padded width, and slice scores back to lc before masking and top-k. Here index_k comes from req_to_token slots instead of upstream's k_slots. The padding is on the key axis only, so the #88 row shard (which splits query rows) and its max-merge are unchanged.
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.
DeepGEMMPrefillData.write_page_indicesturned the request-local selections into index-K pool slots with torch: an add, a clamp, an int64 gather, a compare, awhereand an int32 copy into the output, each a full pass over the[rows, topk]selection.flat_selection_slotsdoes the same mapping in one Triton kernel that reads each selection once and writes the int32 slot, or -1 for an unselected entry.Output is bitwise identical to before.
Verification:
CI States
Latest PR Test (Base): 🚫 Run #39887362480
Latest PR Test (Extra): ❌ Run #39887362607
Latest PR Test (AMD ROCm 10): ⏳ Run #39887362454