Skip to content

Reuse the completion barrier across masked UMMA phases - #142

Open
bastianhagedorn wants to merge 1 commit into
inclusionAI:mainfrom
bastianhagedorn:bhagedorn/reuse-umma-barrier-phase
Open

bastianhagedorn wants to merge 1 commit into
inclusionAI:mainfrom
bastianhagedorn:bhagedorn/reuse-umma-barrier-phase

Conversation

@bastianhagedorn

@bastianhagedorn bastianhagedorn commented Dec 3, 2026 •

Copy link
Copy Markdown

Description

The masked UMMA test initializes the same barrier twice. The first wait observes phase 0 completing. At that point the barrier is valid and ready to track the next MMA. PTX defines an explicit mbarrier.init on a valid barrier as undefined behavior. PTX ISA, mbarrier.init

Reuse the barrier across both MMAs. Keep the first wait and CTA synchronization, remove the second initialization and its fence, and wait on parity 1 after the second commit.

GPU tests

Ran the mask0, mask1, and single-phase unmasked cases on B200 with CuTe DSL 4.8.0, before and after the change. All six runs passed the numerical checks and Compute Sanitizer synccheck. The original cases also passed, so the motivation is the PTX lifetime rule. Disassembly of both masked cases confirms that the second initialization is gone. The unmasked kernel's executable bytes were identical.

Summary by CodeRabbit

  • Tests
    • Updated validation of masked matrix operations to check synchronization across both phases. Coverage also confirms that the single-phase, unmasked path remains unchanged. These updates reflect the current behavior for phase transitions and help ensure that masked operations continue to be checked consistently.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The two-phase masked MMA test no longer reinitializes the mbarrier between phases. Its second-phase completion wait now uses phase 1. The single-phase no-mask path is unchanged.

Changes: Two-Phase Masked MMA

Layer / File(s) Summary
Second-phase barrier handling
tests/test_ptx_umma_masked.py
The test removes the second-phase mbarrier reinitialization and fence. The second-phase completion wait now uses barrier phase 1.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: kevinzeng08

Merge Risk: Minimal · up to d238f

This is a test-only change that reuses the completion barrier across the two masked MMA phases. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Reuse the completion barrier across masked UMMA phases" matches the main change: the masked two-phase UMMA path stops reinitializing the mbarrier and waits on parity 1 for the second phase.…
Description check Passed The description states the motivation (the PTX rule that mbarrier.init on a valid barrier is undefined behavior), the specific change (reuse the barrier, remove the second init and its fence, wait on …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Reuse the completion barrier across masked UMMA phases" matches the main change: the masked two-phase UMMA path stops reinitializing the mbarrier and waits on parity 1 for the second phase. It is specific, concise, and does not describe unrelated work.

Full details: Description check

Explanation

The description states the motivation (the PTX rule that mbarrier.init on a valid barrier is undefined behavior), the specific change (reuse the barrier, remove the second init and its fence, wait on parity 1), and the test evidence (mask0, mask1, and single-phase cases on B200 with CuTe DSL 4.8.0, plus Compute Sanitizer synccheck and disassembly). It does not fill in the template's Related Issues section, and the pre-commit and test checklist items are not marked. The core content is complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a09d3f7 and d238f83.

Files selected for processing: 1

  • tests/test_ptx_umma_masked.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant