Repository navigation
Allow dispatch region formation to fuse producer and consumer when producer has multiple uses. - #8970
Merged
MaheshRavishankar merged 1 commit intoMay 23, 2022
Conversation
okkwon
approved these changes
Apr 22, 2022
okkwon
left a comment
Member
There was a problem hiding this comment.
Added some minor comments. LGTM! Thanks.
| /// For all uses of an operation, finds the use that dominates all other uses. | ||
| static Optional<OpOperand *> getFusableUse(Operation *op, | ||
| DominanceInfo &dominanceInfo) { | ||
| for (auto &use : op->getUses()) { |
Member
There was a problem hiding this comment.
I wonder if we can simply use getUsers()?
Collaborator
Author
There was a problem hiding this comment.
The method returns the use. So iterating over uses makes more sense.
Collaborator
Author
|
Thanks for the reviews! It seems like this is hitting some issues downstream. Couple of ways to fix it that I am going to take a look at once I get back after break (in a week). So not going to land this for now. |
MaheshRavishankar
force-pushed
the
fuse_multiuse_producer
branch
from
May 20, 2022 03:35
81c4bc1 to
fb384a2
Compare
MaheshRavishankar
requested review from
GMNGeoffrey,
ScottTodd and
stellaraccident
as code owners
May 20, 2022 03:35
MaheshRavishankar
force-pushed
the
fuse_multiuse_producer
branch
from
May 23, 2022 01:40
fb384a2 to
a0e86c3
Compare
Contributor
…oducer has multiple uses. Current heuristic to create dispatch regions has checks to fuse producer with consumer only when the producer has a single use. This is pessimizing. The only real requirement is that the consumer dominates all the producers users. Use dominance info to relax this requirement. All the models we track currently though dont seem to benefit with this change (they dont degrade either). The MobileBertInt8 model has number of dispatches reduce from 1520 -> 1496.
MaheshRavishankar
force-pushed
the
fuse_multiuse_producer
branch
from
May 23, 2022 03:41
a0e86c3 to
c8d16d7
Compare
Contributor
Abbreviated x86_64 Benchmark Summary (experimental)@ commit c8d16d72d63e520190873a4f987912ea111b1809 (vs. base 4030a5d33d05d537832fbb1f4dc9fd4a697693b7) Improved Benchmarks 🎉
For more information: |
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.
Current heuristic to create dispatch regions has checks to fuse
producer with consumer only when the producer has a single use. This
is pessimizing. The only real requirement is that the consumer
dominates all the producers users. Use dominance info to relax this
requirement.
All the models we track currently though dont seem to benefit with
this change (they dont degrade either). The MobileBertInt8 model has
number of dispatches reduce from 1520 -> 1496.