-
Notifications
You must be signed in to change notification settings - Fork 836
[Codegen] Implement reshape propagation by expansion for inner_tiled #23118
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
Merged
Max191
merged 2 commits into
iree-org:main
from
Max191:inner-tiled-reshape-propagation-by-expansion
Jan 15, 2026
Merged
[Codegen] Implement reshape propagation by expansion for inner_tiled #23118
Max191
merged 2 commits into
iree-org:main
from
Max191:inner-tiled-reshape-propagation-by-expansion
Jan 15, 2026
Conversation
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
eee8783 to
cee8f73
Compare
compiler/src/iree/compiler/Codegen/Dialect/Codegen/Transforms/ReshapeFusion.cpp
Show resolved
Hide resolved
nirvedhmeshram
approved these changes
Jan 14, 2026
Contributor
nirvedhmeshram
left a comment
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.
LGTM
Adds support for propagating tensor.collapse_shape and tensor.expand_shape
operations through iree_codegen.inner_tiled ops. This enables reshape fusion
to work with GPU MMA operations that use the inner_tiled abstraction.
Two patterns are introduced:
- FoldProducerCollapseShapeWithInnerTiled: Propagates collapse_shape through
inner_tiled by expanding the operation and inserting a collapse on the result.
- FoldConsumerExpandShapeWithInnerTiled: Propagates expand_shape back through
inner_tiled by expanding all operands.
Only outer (iteration) dimensions can be reshaped; inner dimensions that depend
on the MMA layout are preserved. Dynamic shapes are handled correctly.
Signed-off-by: Max Dawkins <[email protected]>
Signed-off-by: Max Dawkins <[email protected]>
cee8f73 to
4826434
Compare
Max191
added a commit
that referenced
this pull request
Jan 15, 2026
…ops (#22860)" (#23137) Reapply #22723 now that the torch model failures were fixed by #23118. ci-extra: test_torch Signed-off-by: Max Dawkins <[email protected]>
keshavvinayak01
pushed a commit
that referenced
this pull request
Jan 27, 2026
…23118) Adds support for propagating tensor.collapse_shape and tensor.expand_shape operations through iree_codegen.inner_tiled ops. This enables reshape fusion to work with GPU MMA operations that use the inner_tiled abstraction. Two patterns are introduced: - FoldProducerCollapseShapeWithInnerTiled: Propagates collapse_shape through inner_tiled by expanding the operation and inserting a collapse on the result. - FoldConsumerExpandShapeWithInnerTiled: Propagates expand_shape back through inner_tiled by expanding all operands. Only outer (iteration) dimensions can be reshaped; inner dimensions that depend on the MMA layout are preserved. Also adds the patterns to the BlockDynamicDimensions pass and the PropagateReshapesByExpansion pass. --------- Signed-off-by: Max Dawkins <[email protected]> Signed-off-by: Keshav Vinayak Jha <[email protected]>
keshavvinayak01
pushed a commit
that referenced
this pull request
Jan 27, 2026
…ops (#22860)" (#23137) Reapply #22723 now that the torch model failures were fixed by #23118. ci-extra: test_torch Signed-off-by: Max Dawkins <[email protected]> Signed-off-by: Keshav Vinayak Jha <[email protected]>
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 support for propagating tensor.collapse_shape and tensor.expand_shape
operations through iree_codegen.inner_tiled ops. This enables reshape fusion
to work with GPU MMA operations that use the inner_tiled abstraction.
Two patterns are introduced:
Only outer (iteration) dimensions can be reshaped; inner dimensions that depend
on the MMA layout are preserved.
Also adds the patterns to the BlockDynamicDimensions pass and the PropagateReshapesByExpansion pass.