REFACTOR: tiler reads VariableBuffer.alias_of instead of legacy _alias - #203
REFACTOR: tiler reads VariableBuffer.alias_of instead of legacy _alias#203mert-ogul wants to merge 1 commit into
Conversation
Wire TilerExtension, MemoryScheduler, and dealiasBuffer to directed alias_of so Reshape no longer needs the _alias workaround. Fixes pulp-platform#201.
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change replaces legacy ChangesDirected alias ancestry
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Deeploy/DeeployTypes.py`:
- Around line 570-576: Define a canonical storage-root resolution rule across
all alias consumers: in Deeploy/DeeployTypes.py lines 570-576, update the
alias-resolution logic to traverse all parent paths and accept only one
canonical root or reject conflicting roots; in
Deeploy/TilingExtension/MemoryScheduler.py lines 658-661, use that canonical
parent or verify all eligible parents share its address; in
Deeploy/TilingExtension/TilerExtension.py lines 337-345, resolve the parent
selected by the current pattern rather than choosing an unrelated lexicographic
parent; and in DeeployTest/testTypes.py lines 227-252, add coverage where the
in-pattern parent is not lexicographically first.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a4e067bc-d689-49fe-8eb4-ad2fda7b0fce
📒 Files selected for processing (8)
CHANGELOG.mdDeeploy/DeeployTypes.pyDeeploy/Targets/Generic/Templates/ReshapeTemplate.pyDeeploy/Targets/PULPOpen/Templates/ReshapeTemplate.pyDeeploy/TilingExtension/MemoryScheduler.pyDeeploy/TilingExtension/TilerExtension.pyDeeployTest/testSchedulingExtension.pyDeeployTest/testTypes.py
💤 Files with no reviewable changes (1)
- Deeploy/Targets/PULPOpen/Templates/ReshapeTemplate.py
| while alias.alias_of: | ||
| seenAliases.add(alias.name) | ||
| alias = self.lookup(alias._alias) | ||
| # Reshape and other current aliasers have a single storage parent. | ||
| # Pick a deterministic parent if multiple are ever present. | ||
| parentName = sorted(alias.alias_of)[0] | ||
| alias = self.lookup(parentName) | ||
| assert isinstance(alias, VariableBuffer) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Define one valid storage resolution rule for multi-parent aliases.
alias_of now permits multiple parents, but these consumers select a parent by name order. This can assign an arbitrary address. In Deeploy/TilingExtension/TilerExtension.py, an in-pattern parent can satisfy line 340 while dealiasBuffer() selects another root that is absent from nodeList; line 345 then fails.
Deeploy/DeeployTypes.py#L570-L576: resolve all parent paths and require one canonical storage root, or reject conflicting roots.Deeploy/TilingExtension/MemoryScheduler.py#L658-L661: use the canonical storage parent or verify that all eligible parents have the same address.Deeploy/TilingExtension/TilerExtension.py#L337-L345: resolve the parent selected from the current pattern instead of an unrelated lexicographic parent.DeeployTest/testTypes.py#L227-L252: add a multi-parent case where the in-pattern parent is not the lexicographically first parent.
📍 Affects 4 files
Deeploy/DeeployTypes.py#L570-L576(this comment)Deeploy/TilingExtension/MemoryScheduler.py#L658-L661Deeploy/TilingExtension/TilerExtension.py#L337-L345DeeployTest/testTypes.py#L227-L252
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Deeploy/DeeployTypes.py` around lines 570 - 576, Define a canonical
storage-root resolution rule across all alias consumers: in
Deeploy/DeeployTypes.py lines 570-576, update the alias-resolution logic to
traverse all parent paths and accept only one canonical root or reject
conflicting roots; in Deeploy/TilingExtension/MemoryScheduler.py lines 658-661,
use that canonical parent or verify all eligible parents share its address; in
Deeploy/TilingExtension/TilerExtension.py lines 337-345, resolve the parent
selected by the current pattern rather than choosing an unrelated lexicographic
parent; and in DeeployTest/testTypes.py lines 227-252, add coverage where the
in-pattern parent is not lexicographically first.
Wire TilerExtension, MemoryScheduler, and dealiasBuffer to directed alias_of so Reshape no longer needs the _alias workaround. Fixes #201 (duplicate of #130).
Describe the intent of your PR here.
Added
VariableBuffer.alias_of: Set[str]for directed storage-parent edges used by tiling.testDealiasBufferUsesAliasOfinDeeployTest/testTypes.py.Changed
NetworkContext.dealiasBuffer,TilerExtension, andMemorySchedulerreadalias_ofinstead of legacy_alias.ReshapeTemplatesetsbufferOut.alias_of(keeps bidirectionalaliasesfor liveness).testSchedulingExtension.pyusesalias_of.CHANGELOG.mdupdated under Unreleased.Fixed
_aliasattribute that templates had to set as a workaround.Removed
_aliasworkaround from Generic/PULPOpenReshapeTemplate.PR Merge Checklist
develcommit and pointing todevel.CHANGELOG.mdfile has been updated.