Skip to content
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

Enable scatter fusion with index operand. #19198

Merged

Conversation

MaheshRavishankar
Copy link
Contributor

@MaheshRavishankar MaheshRavishankar commented Nov 19, 2024

This drops a pessimistic check during analysis of the indexing maps of
the fused OpOperand in the producer and consumer that was preventing
fusion of the scatter operation with its index operand producer.

Signed-off-by: MaheshRavishankar mahesh.ravishankar@gmail.com

@MaheshRavishankar MaheshRavishankar changed the title [WIP] Enable scatter fusion. Enable scatter fusion with index operand. Dec 18, 2024
@MaheshRavishankar MaheshRavishankar marked this pull request as ready for review December 18, 2024 06:35
This drops a pessimistic check during analysis of the indexing maps of
the fused `OpOperand` in the producer and consumer that was preventing
fusion of the scatter operation with its index operand producer.

Signed-off-by: MaheshRavishankar <mahesh.ravishankar@gmail.com>
@MaheshRavishankar
Copy link
Contributor Author

This drops number of LLaMa dispatch invocations from 714 -> 650.

@MaheshRavishankar MaheshRavishankar merged commit 4c00a22 into iree-org:main Dec 18, 2024
40 checks passed
MaheshRavishankar added a commit to MaheshRavishankar/iree that referenced this pull request Dec 20, 2024
MaheshRavishankar added a commit to MaheshRavishankar/iree that referenced this pull request Dec 20, 2024
This reverts commit 4c00a22.

Signed-off-by: MaheshRavishankar <mravisha@amd.com>
MaheshRavishankar added a commit that referenced this pull request Dec 20, 2024
IanWood1 added a commit to IanWood1/iree that referenced this pull request Jan 22, 2025
…9198)" (iree-org#19535)"

This reverts commit 07f81f0.

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
IanWood1 added a commit to IanWood1/iree that referenced this pull request Jan 22, 2025
…9198)" (iree-org#19535)"

This reverts commit 07f81f0.

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
IanWood1 added a commit to IanWood1/iree that referenced this pull request Jan 22, 2025
…9198)" (iree-org#19535)"

This reverts commit 07f81f0.

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
IanWood1 added a commit to IanWood1/iree that referenced this pull request Jan 23, 2025
…9198)" (iree-org#19535)"

This reverts commit 07f81f0.

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
IanWood1 added a commit to IanWood1/iree that referenced this pull request Jan 24, 2025
…9198)" (iree-org#19535)"

This reverts commit 07f81f0.

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
IanWood1 added a commit that referenced this pull request Jan 27, 2025
These changes enable fusion of scatter with its producers. Relands
#19198 which fixes logic to allow fusing scatter 
with `indices` and fully enables fusion with scatter as a producer.

Testing with 8b unsharded, these changes result in [fused rope + index
computation](https://gist.github.com/IanWood1/5b0b0d73f0d76dabd7669b714f066b3c)
as well as [fused index
computation](https://gist.github.com/IanWood1/d62452d2a2940784ff6ada711483c981).
In the second case, the `updates` operand was unable to fuse because
work is needed to bubble reshapes through contractions (see first bullet
in this issue #19752).

---------

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
ita9naiwa pushed a commit to ita9naiwa/iree that referenced this pull request Feb 4, 2025
These changes enable fusion of scatter with its producers. Relands
iree-org#19198 which fixes logic to allow fusing scatter
with `indices` and fully enables fusion with scatter as a producer.

Testing with 8b unsharded, these changes result in [fused rope + index
computation](https://gist.github.com/IanWood1/5b0b0d73f0d76dabd7669b714f066b3c)
as well as [fused index
computation](https://gist.github.com/IanWood1/d62452d2a2940784ff6ada711483c981).
In the second case, the `updates` operand was unable to fuse because
work is needed to bubble reshapes through contractions (see first bullet
in this issue iree-org#19752).

---------

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Signed-off-by: Hyunsung Lee <ita9naiwa@gmail.com>
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