-
Notifications
You must be signed in to change notification settings - Fork 90
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
Fuse reshapes on pointwise inputs for mlir output fusion #3569
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3569 +/- ##
========================================
Coverage 92.20% 92.20%
========================================
Files 513 513
Lines 21658 21658
========================================
Hits 19970 19970
Misses 1688 1688 ☔ View full report in Codecov by Sentry. |
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.
Approving, comment is probably a topic for another PR if its even an issue
|
||
bool gemm_has_multi_outs = gemm_based_op->outputs().size() > 1; |
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.
Might be tangential to this PR, but what happens if one of the reshape ops has multi outputs? ie. something like:
dot -> reshape -> pointwise -> .... -> dot
|_____________________________|
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.
The loop below checks that all the reshapes between dot and pointwise have only one output, and it will output both if any reshape is used more than once. For the aux inputs to pointwise, it doesnt really matter:
┌───┐┌─┐
│dot││x│
└┬──┘└┬┘
│┌───▽──────┐
││reshape │
│└┬───────┬─┘
┌▽─▽──────┐│
│pointwise││
└┬────────┘│
┌▽─────────▽┐
│convolution│
└───────────┘
After mlir fusion it just becomes:
┌──────────┐
│x │
└┬────────┬┘
┌▽──────┐┌▽─────────────────────────┐
│reshape││mlir_dot_reshape_pointwise│
└┬──────┘└┬─────────────────────────┘
┌▽────────▽─┐
│convolution│
└───────────┘
DCE wont remove the reshape
since its used, and the duplicated reshape
doesnt really matter since it is potentially an aliasing-like operator.
Check results before merge 🔆 |
🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output |
No description provided.