mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #478] [MERGED] Fix mega_mhc split barriers under CUDA graph replay #478
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#478
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/478
Author: @lightseek-bot
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @zheanxu
Base:
main← Head:bot/mega-mhc-split-barrier-epoch📝 Commits (1)
dd9cd5fFix mega_mhc split barriers under CUDA graph replay📊 Changes
3 files changed (+48 additions, -8 deletions)
View changed files
📝
deep_gemm/include/deep_gemm/impls/sm100_mega_mhc.cuh(+3 -0)📝
deep_gemm/include/deep_gemm/layout/mega_mhc.cuh(+6 -0)📝
deep_gemm/include/deep_gemm/scheduler/mega_mhc.cuh(+39 -8)📄 Description
A CUDA graph kernel node keeps the same
%grididon every replay. Themega_mhcsplit barriers tag executions with%gridid, so after a replay a barrier line still holdsencode_state(grid_idx, kNumSplits)— exactly what the next replay waits for. A Mix or Norm waiter whose m-block init CTA has not started yet proceeds at once and reads the previous replay's split partials (the graph-pool scratch is the same memory).wait_initonly protects producers.This tags each execution with an epoch instead of
%gridid. The epoch and an exit count live in the unused tail of the first barrier line, so the host-side barrier buffer and the compiled extension are unchanged (JIT headers only). Every CTA reads the epoch aftercudaGridDependencySynchronize(); the last CTA to retire resets the exit count and advances the epoch.The MegaMoE combine readiness has the same stale-tag problem and is addressed separately in #451.
Validation on B200: one graph node is replayed while alternating two input sets, and every replay is compared bit for bit with eager results (fresh JIT cache per run). Measured on
66081d4, whose versions of these headers differ frommainonly by an added#include.Eager calls, and graph replays preceded by an eager launch that rewrites the tag, were 0/200 before the fix as well.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.