-
Notifications
You must be signed in to change notification settings - Fork 418
[BugFix] Fix boundary check in loop layout #1732
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
base: main
Are you sure you want to change the base?
Conversation
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
📝 WalkthroughWalkthroughAdd a bounds_match parity check to loop-partition guard logic and make need_guard depend on inverse-map bijectivity or bounds mismatch; emit IfThenElse guards when required. Add loop-extent safety predicates in ParallelOp::InferLayout. Make DetectIterMap iterative with level escalation. Add/adjust TileLang transform tests. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(240,248,255,0.5)
participant TL as TileLang Transform
participant LP as LoopPartition
participant LD as LayoutDetector
participant RG as Guard/PredicateGen
participant PL as ParallelOp::InferLayout
end
TL->>LP: run loop-partition transform
LP->>LD: DetectIterMap / compute inverse layout
LD-->>LP: inverse map + level/result
LP->>LP: compute bounds_match (inner extents vs inverse inputs)
alt need_guard (not bijective OR bounds mismatch)
LP->>RG: emit IfThenElse guard (runtime bound checks)
RG-->>TL: guarded transformed loop
else bijective & bounds_match
LP-->>TL: emit unguarded transformed loop
end
TL->>PL: InferLayout (with loop_layout_)
PL->>LD: compute inverse logical indices from synthetic thread index
PL->>RG: emit LT predicates (logical_i < original_extent) as needed
RG-->>PL: predicates attached to layout inference
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
… guard in partition loop
As title
Summary by CodeRabbit
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.