-
Notifications
You must be signed in to change notification settings - Fork 331
[Bugfix] Enable code lowering with producer‑copy‑only program #1168
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3717ec3
bugfix
LeiWang1999 9d10de9
lint fix
LeiWang1999 c3212aa
Enhance warp group register allocation to handle missing consumer bod…
LeiWang1999 1cb0c43
Refactor VisitExpr_ method in inject_tma_barrier.cc for improved read…
LeiWang1999 0e5f014
Update barrier handling in inject_tma_barrier.cc to accommodate newly…
LeiWang1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
🧩 Analysis chain
Verify that only constant barrier IDs are used in practice.
The
GetMbarrierMaxIdxCollectoronly captures constant integer barrier IDs (line 439). If the codebase uses dynamic barrier IDs—computed from variables or loop indices—those won't be counted, potentially leading to insufficient barrier creation.Run the following script to check for non-constant barrier ID usage:
🏁 Script executed:
Length of output: 9092
The script output reveals critical findings: dynamic barrier IDs ARE used in practice.
🏁 Script executed:
Length of output: 303
🏁 Script executed:
Length of output: 1847
🏁 Script executed:
Length of output: 3343
Fix
GetMbarrierMaxIdxCollectorto handle dynamic barrier ID expressions.The collector currently only recognizes constant integer barrier IDs via
as<IntImmNode>()at line 439. However, test files demonstrate widespread use of dynamic barrier IDs likek % 3andk % 3 + 3within loops (seetest_tilelang_transform_warp_specialized.pylines 83, 85, 89, etc.). These dynamic expressions are notIntImmNodeand are therefore not counted, causingensure_min_countto be underestimated. This results increate_list_of_mbarrier()allocating fewer barriers than actually needed, leading to runtime access violations.You must enhance the collector to compute bounds on dynamic expressions (using
arith::Analyzerwhich is already available asanalyzer) to determine the maximum possible barrier ID, ensuring sufficient barrier allocation.🤖 Prompt for AI Agents