feat(codegen): codegen support for system.bar_{all,v,m} - #2240
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe change adds PTO code generation for ChangesPTO barrier lowering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8def295d9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| register_pipe_barrier("system.bar_v", "PIPE_V"); | ||
| register_pipe_barrier("system.bar_m", "PIPE_M"); |
There was a problem hiding this comment.
Set core affinity for pipe-specific barriers
When these newly lowered ops appear in mixed InCore kernels, the split pass still sees system.bar_v/system.bar_m as no-arg ops with no explicit IR core affinity, so ClassifyCallAffinity falls through to SHARED and BuildCoreBody keeps the statement on both AIC and AIV lanes. That means pl.system.bar_m() can emit pto.barrier <PIPE_M> in the AIV function, and pl.system.bar_v() can be duplicated into the AIC function; set the IR op entries to CoreAffinity::VECTOR/CoreAffinity::CUBE (or classify them specially) before exposing the PTO lowering.
Useful? React with 👍 / 👎.
Summary
This PR adds PTO codegen support for the sync ops below:
system.bar_all->pto.barrier <PIPE_ALL>system.bar_v->pto.barrier <PIPE_V>system.bar_m->pto.barrier <PIPE_M>It also adds unit tests to verify the emitted MLIR and updates the IR operator docs to describe the exact PTO lowering.
Motivation
system.bar_all,system.bar_v, andsystem.bar_mare already exposed at the IR / Python API level, but PTO backend codegen did not yet register these ops.This change closes that gap so these sync ops lower cleanly during PTO codegen and have explicit test coverage.
Changes
system.bar_all,system.bar_v, andsystem.bar_min PTO backend codegenpto.barrier <PIPE_ALL>pto.barrier <PIPE_V>pto.barrier <PIPE_M>Testing
Added unit tests covering:
pl.system.bar_all()emitspto.barrier <PIPE_ALL>pl.system.bar_v()emitspto.barrier <PIPE_V>pl.system.bar_m()emitspto.barrier <PIPE_M>