✨ Implement "drive-by" Method for Layout Conciliation - #2060
Conversation
|
@coderabbitai full review |
✅ Action performedFull review finished. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe index-switch mapper now computes a compromise layout with iterative forward and reverse happy SWAP-chain passes. It restores each child layout to that compromise before inserting SWAPs. The related test now expects six SWAP operations. ChangesIndex-switch layout mapping
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant IndexSwitch
participant driveby
participant ChildLayouts
participant SWAPInsertion
IndexSwitch->>driveby: provide child layouts
driveby->>ChildLayouts: apply forward and reverse happy SWAP chains
driveby-->>IndexSwitch: return compromise layout
IndexSwitch->>ChildLayouts: restore each layout to compromise
IndexSwitch->>SWAPInsertion: insert required SWAP operations
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches✨ Simplify code
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 `@mlir/lib/Dialect/QCO/Transforms/Mapping/Mapping.cpp`:
- Around line 1477-1485: Update the driveby call in the IndexSwitch compromise
mapping flow to pass the configured niterations value as its second argument,
ensuring convergence uses the requested iteration count instead of driveby’s
default.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: faae55a0-8a5c-4d43-9dd1-c770d47a0b43
📒 Files selected for processing (2)
mlir/lib/Dialect/QCO/Transforms/Mapping/Mapping.cppmlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…h-quantum-toolkit/core into enh/better-voting-strategy
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
Description
This function is a follow-up to the discussion had in #1951. Particularly, it removes the Borda rank method to find an "average" layout and replaces it with a "drive-by" strategy, which is significantly less computationally expensive than a mediod approach (especially for many cases) but respects the hardware-topology. Furthermore, it's rather trivial to implement.
Preliminary benchmarks (based on our very, very trivial unit-tests; average of 16 runs) show that the proposed method requires 5% less SWAPs than the "restore-to-parent" method and 98% than the Borda rank method1.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).Footnotes
Highlighting the unsuitability of the Borda rank for this particular problem. ↩