[GH-ISSUE #51] Why is the initial value of barrier related to multicast? #33

Closed
opened 2026-10-26 21:10:55 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @dajunHuang on GitHub (Mar 9, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/51

Thank you for your amazing work!

I'm trying to understand your implemeatation and find the following mbarrier initialization code:

github.com/deepseek-ai/DeepGEMM@4d4f2342fe/deep_gemm/include/deep_gemm/fp8_gemm.cuh (L118)

Can you help me explain why the initial value of empty barrier is kNumTMAMulticast * kNumMathThreads / 32,instead of a more intuitive value like kNumMathThreads / 32? why a single arrive operation of empty barrier should be distrubuted to kNumTMAMulticast different ctas like below? When I set the initial value to kNumMathThreads / 32 and remove the arugment of arrive(), program gets stuck forever.

github.com/deepseek-ai/DeepGEMM@4d4f2342fe/deep_gemm/include/deep_gemm/fp8_gemm.cuh (L240)

I'm not very familiar with the relationship between barrier and its multicast feature. I'd appreciate it If you can give me some ideas for understanding.

Originally created by @dajunHuang on GitHub (Mar 9, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/51 Thank you for your amazing work! I'm trying to understand your implemeatation and find the following mbarrier initialization code: https://github.com/deepseek-ai/DeepGEMM/blob/4d4f2342febb829e88f9cc7cbf4b955823b395fc/deep_gemm/include/deep_gemm/fp8_gemm.cuh#L118 Can you help me explain why the initial value of empty barrier is `kNumTMAMulticast * kNumMathThreads / 32`,instead of a more intuitive value like `kNumMathThreads / 32`? why a single arrive operation of empty barrier should be distrubuted to `kNumTMAMulticast` different ctas like below? When I set the initial value to `kNumMathThreads / 32` and remove the arugment of `arrive()`, program gets stuck forever. https://github.com/deepseek-ai/DeepGEMM/blob/4d4f2342febb829e88f9cc7cbf4b955823b395fc/deep_gemm/include/deep_gemm/fp8_gemm.cuh#L240 I'm not very familiar with the relationship between barrier and its multicast feature. I'd appreciate it If you can give me some ideas for understanding.
Author
Owner

@soundOfDestiny commented on GitHub (Mar 9, 2025):

Multicast will rewrite shared memory in two CTAs so we cannot issue a multicast until neither of the corresponding shared memory part in the CTA is in use. That's why both CTAs need to issue an empty barrier.

<!-- gh-comment-id:2708769836 --> @soundOfDestiny commented on GitHub (Mar 9, 2025): Multicast will rewrite shared memory in two CTAs so we cannot issue a multicast until neither of the corresponding shared memory part in the CTA is in use. That's why both CTAs need to issue an empty barrier.
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#33
No description provided.