-
Notifications
You must be signed in to change notification settings - Fork 88
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
Fix MLIR input fusion non-std shapes from squeeze, flatten and unsqueeze #2313
Conversation
Currently, we see MLIR partition candidates recieving non-standard shape due to not fusing in squeeze, flatten and unsqueeze ops. These ops could be canonicalized to reshape without introducing additional ops as long as MLIR backend is concerned.
Codecov Report
@@ Coverage Diff @@
## develop #2313 +/- ##
========================================
Coverage 91.45% 91.45%
========================================
Files 433 433
Lines 16174 16174
========================================
Hits 14792 14792
Misses 1382 1382 |
This build is OK for merge ✅ |
🔴bert_base_cased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output🔴distilgpt2_fp16: FAILED: MIGraphX is not within tolerance - check verbose output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine to me, but I want to confirm that squeeze, unsqueeze, and flatten can all be replaced by reshape
correctly like this
Also, can you add a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that the tests are passing on mi200: http://rocmhead.amd.com:8080/blue/organizations/jenkins/MLIR%2Ftest/detail/test/30/pipeline/54
… into fix-mlir-reshape-like-ops-non-std-shape
They are special cases of 'reshape' where as in reshape just work all that out by just knowing the output shape. I ve added tests now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, it would be to make these transformation when we are generating MLIR.
Yeah, but that'll be more possible once we have MIGraphX shapes in the MIGraphX dialect |
Currently, we see MLIR partition candidates recieving non-standard shape due to not fusing in squeeze, flatten and unsqueeze ops. These ops could be canonicalized to reshape without introducing additional ops as long as MLIR backend is concerned.