Skip to content

[DispatchCreation] CollapseDimensions patch#18424

Merged
IanWood1 merged 6 commits intoiree-org:mainfrom
IanWood1:collapse_dims_patch
Sep 30, 2024
Merged

[DispatchCreation] CollapseDimensions patch#18424
IanWood1 merged 6 commits intoiree-org:mainfrom
IanWood1:collapse_dims_patch

Conversation

@IanWood1
Copy link
Contributor

@IanWood1 IanWood1 commented Sep 3, 2024

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

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
@IanWood1 IanWood1 force-pushed the collapse_dims_patch branch from f549a54 to 16964b8 Compare September 6, 2024 15:26
@IanWood1 IanWood1 marked this pull request as ready for review September 6, 2024 16:11
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Comment on lines 516 to 519
}

if (collapseIntoIdx != kUninitialized &&
consumerCollapseMap.at(index) != collapseIntoIdx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Contributor

@hanhanW hanhanW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just few nits

continue;
} else if (collapseIntoIdx == kUninitialized) {
collapseIntoIdx = consumerCollapseMap.at(index);
} else if (consumerCollapseMap.at(index) != collapseIntoIdx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@IanWood1 IanWood1 Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the added testcase where there is an elementwise -> generic (2 parallel + 2 reduction).

Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Copy link
Contributor

@hanhanW hanhanW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@IanWood1 IanWood1 merged commit f5dc573 into iree-org:main Sep 30, 2024
@IanWood1 IanWood1 deleted the collapse_dims_patch branch September 30, 2024 16:00
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

Comments