[GH-ISSUE #368] question about tmem barrier #177

Open
opened 2026-10-26 21:14:14 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @wukong1992 on GitHub (Jun 26, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/368

I have a question about the comment here:

github.com/deepseek-ai/DeepGEMM@54e2261240/deep_gemm/include/deep_gemm/impls/sm100_fp8_fp4_mega_moe.cuh (L269)

Since TMEM is consumed by both CTAs, the next line uses 2 * kNumEpilogueThreads. Shouldn't this barrier therefore use arrive at all CTAs instead?

Conversely, for tmem_full_barrier above, it seems that only the leader CTA calls arrive. Is my understanding correct?

Originally created by @wukong1992 on GitHub (Jun 26, 2026). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/368 I have a question about the comment here: https://github.com/deepseek-ai/DeepGEMM/blob/54e22612409371d6364144b69086735beb54e98b/deep_gemm/include/deep_gemm/impls/sm100_fp8_fp4_mega_moe.cuh#L269 Since TMEM is consumed by both CTAs, the next line uses 2 * kNumEpilogueThreads. Shouldn't this barrier therefore use arrive at all CTAs instead? Conversely, for tmem_full_barrier above, it seems that only the leader CTA calls arrive. Is my understanding correct?
Author
Owner

@Rachmanino commented on GitHub (Jun 29, 2026):

When both CTA complete tcgen05_ld from TMEM, they arrive on leader CTA's tmem_empty_barrier to signal that their TMEM are both free, and is ready for next tcgen05mma.
When leader CTA's mma warp issues tcgen05mma, it issues tcgen05 commit on both CTA's tmem_empty_barrier, so that they can wait on their own mbarrier for tcgen05mma completion.

<!-- gh-comment-id:4834518991 --> @Rachmanino commented on GitHub (Jun 29, 2026): When both CTA complete tcgen05_ld from TMEM, they arrive on leader CTA's tmem_empty_barrier to signal that their TMEM are both free, and is ready for next tcgen05mma. When leader CTA's mma warp issues tcgen05mma, it issues tcgen05 commit on both CTA's tmem_empty_barrier, so that they can wait on their own mbarrier for tcgen05mma completion.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepGEMM#177
No description provided.