[DispatchCreation] CollapseDimensions patch#18424
Merged
IanWood1 merged 6 commits intoiree-org:mainfrom Sep 30, 2024
Merged
Conversation
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
f549a54 to
16964b8
Compare
hanhanW
requested changes
Sep 25, 2024
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
hanhanW
reviewed
Sep 26, 2024
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
Comment on lines
516
to
519
| } | ||
|
|
||
| if (collapseIntoIdx != kUninitialized && | ||
| consumerCollapseMap.at(index) != collapseIntoIdx) { |
Contributor
There was a problem hiding this comment.
If I read it correctly, can we just use else here?
Suggested change
| } | |
| if (collapseIntoIdx != kUninitialized && | |
| consumerCollapseMap.at(index) != collapseIntoIdx) { | |
| } else { |
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
hanhanW
reviewed
Sep 27, 2024
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
compiler/src/iree/compiler/DispatchCreation/CollapseDimensions.cpp
Outdated
Show resolved
Hide resolved
| continue; | ||
| } else if (collapseIntoIdx == kUninitialized) { | ||
| collapseIntoIdx = consumerCollapseMap.at(index); | ||
| } else if (consumerCollapseMap.at(index) != collapseIntoIdx) { |
Contributor
There was a problem hiding this comment.
Correct me if I'm wrong. I think the indices in the ReassociationIndices should be all different. To be more specific, they are just a sequence from 0 to rank-1 if we flatten it. So this can just be else?
Suggested change
| } else if (consumerCollapseMap.at(index) != collapseIntoIdx) { | |
| } else { |
Contributor
Author
There was a problem hiding this comment.
Okay I added some comments and also tried to clean up the if statement logic a bit. That was meant to handle the case where index is collapsible but current loops.
Contributor
Author
There was a problem hiding this comment.
see the added testcase where there is an elementwise -> generic (2 parallel + 2 reduction).
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
5c95499 to
14540d8
Compare
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.
Fixes CI compilation failures for 9971653 but NOT the correctness issues
The added test is a minimal repro of the failing IR.
This needs some cleanup as the logic is getting pretty confusing/convoluted