Repository navigation
[LinalgExt] Add decomposition for vector map_scatter - #21116
Merged
Max191 merged 6 commits intoJul 14, 2025
Merged
Conversation
hanhanW
reviewed
Jun 18, 2025
Max191
force-pushed
the
map-scatter-vector-decomposition
branch
from
July 8, 2025 20:50
f700c8d to
2fe5b75
Compare
Max191
marked this pull request as ready for review
July 8, 2025 20:50
hanhanW
approved these changes
Jul 11, 2025
Comment on lines
+30
to
+34
| auto inputType = cast<VectorType>(mapScatterOp.getInputType()); | ||
| if (!inputType.hasStaticShape()) { | ||
| return rewriter.notifyMatchFailure(mapScatterOp, | ||
| "expected static input shape"); | ||
| } |
Contributor
There was a problem hiding this comment.
Doesn't VectorType always have static shape?
Contributor
Author
There was a problem hiding this comment.
I thought it did, but I wasn't 100% sure if it's not legal to have dynamic shape, so I added the check to be safe. Maybe it is better as an assert instead.
Contributor
There was a problem hiding this comment.
You can add an assertion, but it should always be static shape IIRC. The scalable flag is the other array of boolean.
Contributor
Author
There was a problem hiding this comment.
Actually, I removed the assert, because I found that dynamic shapes do not pass the verifier.
Max191
force-pushed
the
map-scatter-vector-decomposition
branch
from
July 11, 2025 19:22
2fe5b75 to
42b5e2a
Compare
Max191
enabled auto-merge (squash)
July 11, 2025 19:27
Max191
disabled auto-merge
July 11, 2025 23:15
Signed-off-by: Max Dawkins <[email protected]>
Signed-off-by: Max Dawkins <[email protected]>
Signed-off-by: Max Dawkins <[email protected]>
Signed-off-by: Max Dawkins <[email protected]>
Signed-off-by: Max Dawkins <[email protected]>
Signed-off-by: Max Dawkins <[email protected]>
Max191
force-pushed
the
map-scatter-vector-decomposition
branch
from
July 14, 2025 13:36
99d3c13 to
758cbcb
Compare
AWoloszyn
pushed a commit
that referenced
this pull request
Dec 1, 2025
Adds a decomposition pass for `iree_linalg_ext.map_scatter` with a vector input and a memref output. The decomposition lowers the op into a series of vector ops to compute the index vector, and a vector.scatter op. This transformation completes the lowering of a vectorized map_scatter op. The map_scatter op does not implement the `AggregatedOpInterface`, because the interface uses an `OpBuilder` to decompose operations, but the decomposition for map_scatter needs a `RewriterBase`, so it does not work with the current interface. --------- Signed-off-by: Max Dawkins <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a decomposition pass for
iree_linalg_ext.map_scatterwith a vector input and a memref output. The decomposition lowers the op into a series of vector ops to compute the index vector, and a vector.scatter op. This transformation completes the lowering of a vectorized map_scatter op.The map_scatter op does not implement the
AggregatedOpInterface, because the interface uses anOpBuilderto decompose operations, but the decomposition for map_scatter needs aRewriterBase, so it does not work with the current interface.