Skip to content

[LinalgExt] Add gather reshape propagation - #20916

Merged
IanWood1 merged 2 commits into
iree-org:mainfrom
IanWood1:gather_fuse_reshapes
May 29, 2025
Merged

IanWood1 merged 2 commits into
iree-org:mainfrom
IanWood1:gather_fuse_reshapes

Conversation

@IanWood1

@IanWood1 IanWood1 commented May 28, 2025 •

Copy link
Copy Markdown
Member

This change extends ReshapeFusion.cpp to support propagating reshapes through iree_linalg_ext.gather. The logic is very similar to scatter but with the 0th and 2nd operands flipped. Additionally, the LinalgExt reshape propagation tests were moved out of DispatchCreation. A test pass was created in LinalgExt to run the reshape propagation patterns.

This change improves paged attention fusion by going from 1/2 of the gathers fused to all of the gathers.

@IanWood1
IanWood1 merged commit d0bfb5d into iree-org:main May 29, 2025
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
This change extends `ReshapeFusion.cpp` to support propagating reshapes
through `iree_linalg_ext.gather`. The logic is very similar to `scatter`
but with the 0th and 2nd operands flipped. Additionally, the `LinalgExt`
reshape propagation tests were moved out of `DispatchCreation`. A test
pass was created in `LinalgExt` to run the reshape propagation patterns.

---------

Signed-off-by: Ian Wood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants