Auto schedule - #7
Conversation
📝 WalkthroughWalkthroughThis PR introduces shared-memory liveness boundary tracking by adding a new attribute constant, enhancing IR structure nodes with variable substitution capabilities and task-node integration, refactoring warpgroup partitioning logic to use segmented control flow with liveness boundaries, and updating shared-memory allocation analysis to recognize the new boundary attribute. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/transform/auto_schedule/ir_structure.h`:
- Around line 512-519: SubstituteVar currently updates child and task but does
not rewrite wrapper, leaving wrapper->wrapper with stale references; update the
SubstituteVar override to also visit/replace occurrences inside wrapper (e.g.,
call wrapper->SubstituteVar or directly update wrapper->wrapper) so that
WrapperNode's inner pointer is rewritten consistently; ensure the replacement
uses the same old_var/new_var pair and preserves wrapper identity expected by
ConvertIRStructureToStmt (so subsequent LetStmt/AttrStmt reconstruction sees the
updated variables).
In `@src/transform/merge_shared_memory_allocations.cc`:
- Around line 283-286: The visitor currently unwraps AttrStmtNodes inside
VisitWarpSpecializationBody which causes kSharedMemoryLivenessBoundary markers
to be skipped; update VisitWarpSpecializationBody so that when it encounters an
AttrStmtNode whose attr_key == "kSharedMemoryLivenessBoundary" it calls
VisitNewScope(op) (or otherwise dispatches to the same handling as the outer
visitor) instead of recursing directly into attr->body, ensuring the liveness
boundary attr is processed; reference VisitWarpSpecializationBody,
VisitNewScope, and AttrStmtNode to locate and change the unwrap logic so attrs
with key "kSharedMemoryLivenessBoundary" invoke VisitNewScope.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b0d3e013-a1b9-4dc8-b3ee-27c7ff6e6fd6
📒 Files selected for processing (4)
src/op/builtin.hsrc/transform/auto_schedule.ccsrc/transform/auto_schedule/ir_structure.hsrc/transform/merge_shared_memory_allocations.cc
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary by CodeRabbit
New Features
Improvements