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

[Flow] Fold flow reshape with mismatching dyn dims #18680

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

IanWood1
Copy link
Contributor

@IanWood1 IanWood1 commented Oct 3, 2024

flow.tensor.reshape is foldable when there is a single mismatching dynamic dimension (unequal SSA values) because they must be the same.

Cleans up pattern found in migx_bert-large-uncased

`flow.tensor.reshape` is foldable when there is a single mismatching
dynamic dimension (unequal SSA values) because they must be the same.

Signed-off-by: Ian Wood <[email protected]>
@IanWood1 IanWood1 marked this pull request as ready for review October 3, 2024 16:44
Copy link
Contributor

@MaheshRavishankar MaheshRavishankar left a comment

Choose a reason for hiding this comment

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

Am I missing something here. The test added here does not seem to be an example of what is described in the PR description?

@IanWood1
Copy link
Contributor Author

IanWood1 commented Oct 3, 2024

Are you looking at foldReshapeChain? The diff is a bit confusing. flattenReshapeChain was the old test to combine multiple reshapes, but because it only has 1 dynamic dim it got completely folded away. foldReshapeChain is the new test (which uses the old mlir input), but the difference is that it checks that all reshape ops get folded. But I could be wrong

@MaheshRavishankar
Copy link
Contributor

Are you looking at foldReshapeChain? The diff is a bit confusing. flattenReshapeChain was the old test to combine multiple reshapes, but because it only has 1 dynamic dim it got completely folded away. foldReshapeChain is the new test (which uses the old mlir input), but the difference is that it checks that all reshape ops get folded. But I could be wrong

Ah interesting. I did miss that, I see now. I dont know how this change made flatterReshapeChain work.

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.

3 participants