Repository navigation
[None][fix] Order TMEM dealloc and split-K mailbox reads in the GLM-5.2 high-throughput split-K GEMM #22714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[None][fix] Order TMEM dealloc and split-K mailbox reads in the GLM-5.2 high-throughput split-K GEMM #22714
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1813,6 +1813,11 @@ def mma_warp( | |
|
|
||
| with cute.arch.elect_one(): | ||
| tcgen05.commit(bar_mma_epilog, None, self.cta_group) | ||
| # Phase 0 (this warp's first arrival plus the epilogue's) must be complete | ||
| # before this warp arrives again: otherwise the parity-1 wait below names | ||
| # the phase before phase 0, returns at once, and the dealloc races the | ||
| # epilogue's tcgen05.ld. | ||
| cute.arch.mbarrier_wait(bar_tmem_alloc, 0) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a regression test for the phase-0 wait on The MMA warp now waits for phase 0 of Add a compile-output test under
The test should fail when the wait at line 1820 is removed. The check reads the generated code, so it does not depend on execution timing.
|
||
| cute.arch.mbarrier_arrive(bar_tmem_alloc) | ||
| cute.arch.mbarrier_wait(bar_tmem_alloc, 1) | ||
| cute.arch.dealloc_tmem(tmem_ptr, num_tmem_cols, is_two_cta=False) | ||
|
|
@@ -2006,7 +2011,10 @@ def epilog_warp( | |
| cute.arch.mbarrier_arrive_and_expect_tx( | ||
| bar_reduce, self.expected_transaction_bytes | ||
| ) | ||
| cute.arch.mbarrier_wait(bar_reduce, 0) | ||
| # The peers' st.async complete-tx releases at cluster scope; the | ||
| # mailbox reads below need a cluster-scope acquire, not the CTA-scope | ||
| # one of cute.arch.mbarrier_wait. | ||
| _wait_parity_cluster(bar_reduce, Int32(0)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a regression test for the mailbox acquire scope. No added test protects the cluster-scope acquire before mailbox reads. Existing numerical model tests can miss a return to CTA scope when execution timing hides the visibility defect. Add a compile-output test under As per path instructions, flag “a bug fix without a practical regression test that would have failed before the fix.”
|
||
| for peer in cutlass.range_constexpr(self.split_k - 1): | ||
| if cutlass.const_expr(self.mailbox_interleaved): | ||
| for vec in cutlass.range_constexpr(values_per_thread // 4): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked perf and accuracy on Rubin?