Fix sparse MQA merge partitions with repeated block indices - #16
Closed
WoosukKwon wants to merge 1 commit into
Closed
WoosukKwon wants to merge 1 commit into
WoosukKwon wants to merge 1 commit into
Conversation
Pair only the last Q0 duplicate with the first Q1 duplicate so stable merge partitions preserve sparse slot order and coverage. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
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.
Sparse MQA metadata can assert when sorted candidate rows contain repeated block IDs. vLLM emits repeated padding despite the previous native API requirement for unique indices. In a real DeepSeek-V4.1 TP4 startup, two rows containing 389 copies of block 388 (context lengths 3105/3106) trigger a sparse-slot assertion: the merge consumes Q1 entries too early, then the next merge-path partition resumes at an earlier slot, underflowing the unsigned offset.
Pair only the last equal Q0 slot with the first Q1 slot, and skip only that carried match at a partition boundary. This preserves output slots and supports repeated indices without removing bounds checks. Update the API contract and add regression coverage to the existing attention suite.
Validation on GB200, commit
2a95b271c7decb99a4773d17299f393167ab0a01:Test commands executed from the vLLM worktree, using its virtualenv and an isolated copy of the pinned DeepGEMM runtime with the changed JIT header (unchanged native extension):
Local reproduction artifacts, serving argv and logs are recorded in
/home/woosuk/.cache/v41-dspark-opt/indexer-assert/REPORT.mdandfixed-command.json. Default vendored-import GPU replay also passes after integrating the fixed header.Duplicate-work check: reviewed all four open PRs in vllm-project/DeepGEMM and searched sparse metadata / duplicate merge; none addresses this fix. No linked issue. This is separate from vllm-project/vllm#57432, which fixes FlashInfer DSpark attention metadata.
AI assistance: implemented and validated with OpenAI Codex.