You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reuse the completion barrier across masked UMMA phases - #142
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.initon a valid barrier as undefined behavior. PTX ISA, mbarrier.initReuse 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