-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[mlir][linalg] set inbounds on xfer_read/writes for assumeDynamicDimsMatchVecSizes
#160839
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -524,6 +524,23 @@ VectorizationState::maskOperation(RewriterBase &rewriter, Operation *opToMask, | |||||
|
|
||||||
| if (!mask) { | ||||||
| LDBG() << "No mask required"; | ||||||
| if (assumeDynamicDimsMatchVecSizes) { | ||||||
| LDBG() << "Assuming dynamic dimensions match vector sizes!"; | ||||||
| // Set inbounds to all-true. | ||||||
|
||||||
| // Set inbounds to all-true. | |
| For vector.transfer_read and vector.transfer_write, there is also the `in-bounds` attribute that we need to set explicitly. Otherwise, "out-of-bounds" access will be assumed and masks will be generated. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, assumeDynamicDimsMatchVecSizes only applies to dynamic sizes ;-) Static should remain "out-of-bounds". IIRC, something else will later infer that it's in fact "in bounds" 🤞🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, completely missed that 🥲 Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the logic to only set the attribute to true for dynamic dims, tested downstream with IREE that something else later infers that it's in fact "in-bounds" :) WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this inside the lambda. Otherwise it will be printed for every Op, which could be noise, no?