mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #429] [BUG] Fix sm90 grouped multicast deadlock #438
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#438
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/429
Author: @baptiste-bt
Created: 9/8/2026
Status: 🔄 Open
Base:
main← Head:fix/sm90-k-grouped-multicast-deadlock📝 Commits (1)
acc504dFix sm90 grouped multicast deadlock📊 Changes
2 files changed (+10 additions, -4 deletions)
View changed files
📝
csrc/jit_kernels/heuristics/sm90.hpp(+8 -3)📝
tests/generators.py(+2 -1)📄 Description
I noticed a bug on sm90,
k_grouped_bf16_gemmcan deadlock when the number of output tiles per group is not divisible by the CTA cluster size.Repro:
Setup: H100 with DeepGEMM 2.6.1 (
559d79f), pytorch2.11+ CUDA13.2With debug output enabled, the unpatched heuristic selects
Layout(swap_ab=0, block_m=128, block_n=128, block_k=64, cluster_m=1, cluster_n=2)and hangs after:This gives
11 * 11 = 121tiles per group for a cluster size of 2. One CTA pair can therefore straddle two groups with different K-loop lengths and deadlock on the distributed barriers.With
-G -O0appended to the JIT NVCC command, CUDA-GDB shows the two CTAs spanning the group boundary:CTA 120's TMA producer is still processing group 0 at
empty_barriers[stage_idx]->wait(phase ^ 1)on line 169. CTA 121's producer has reached the final cleanup wait on line 205, while its consumers are waiting onfull_barriers[stage_idx]->wait(phase)on line 249 for group 1. The matching peer arrival never happens.This change rejects K-grouped layouts unless the tile count per group is divisible by the cluster size. For this case, the heuristic selects
Layout(swap_ab=0, block_m=64, block_n=256, block_k=64, cluster_m=2, cluster_n=1)and completes:🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.