mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #353] [MERGED] Fix OOB in paged MQA logits metadata scheduler #386
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#386
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/353
Author: @Barry-Delaney
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @RayWang96
Base:
nv_dev← Head:fix/paged-mqa-metadata-oob📝 Commits (1)
07a044cFix OOB in paged MQA logits metadata scheduler📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
deep_gemm/include/deep_gemm/scheduler/paged_mqa_logits.cuh(+1 -1)📄 Description
When all context_lens are zero (e.g. warmup decode with kv_lens=1 and indexer_compress_ratio=4 giving gen_seq_lens=0), the binary search pushes lo to batch_size. The subsequent prefix_sum[q_idx] access is OOB when q_idx == batch_size == kAlignedBatchSize, since prefix_sum only has indices [0, batch_size).
Fix: clamp q_idx to batch_size - 1. When the binary search lands past all queries (total work = 0), num_segs_q correctly evaluates to 0, and the existing guards (num_segs_q > 0 ? ...) produce the sentinel values (atom_idx=0, kv_split_idx=0).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.