mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #344] [CLOSED] Fix an OOB access in the the paged MQA logits kernel #376
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#376
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/344
Author: @tirthasheshpatel
Created: 5/29/2026
Status: ❌ Closed
Base:
main← Head:fix-paged-mqa-logits-oob-context-lens📝 Commits (1)
a8cf3fafix(paged_mqa_logits): guard get_num_kv against out-of-batch q indices📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
deep_gemm/include/deep_gemm/scheduler/paged_mqa_logits.cuh(+2 -0)📄 Description
The
fp8_paged_mqa_logitskernel splits work across SMs. When there's less work than the number of SMs, some SMs get no work and are handed a past-the-end sentinel index (batch_size). The scheduler constructor ends up readingcontext_lens[batch_size]inget_num_kvwhich is an OOB read. Usually harmless (lands in padded memory), but ifcontext_lenssits at a page edge and the read hits unmapped memory, we run into an IMA.Observed the IMA here: https://github.com/sgl-project/sglang/issues/26541
Bisected to
7f2a703(#304, "Mega MoE + FP4 Indexer release"), which introduced the new scheduler and out-of-batch atom emission.A standalone repro:
cc @mattteochen @nvjullin @nvpohanh
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.