Repository navigation
Enable multi-use fusion for cases where the shapes of the two ops are the same. - #13747
Conversation
4d84548 to
d89a099
Compare
941a1e7 to
4574f81
Compare
4574f81 to
fad3e00
Compare
|
We're discussing the test failures (logs here) in a thread on Discord. Looks like just |
14753d2 to
b13deb4
Compare
| return; | ||
| Operation *fusableProducer = nullptr; | ||
| for (OpOperand &operand : genericOp->getOpOperands()) { | ||
| // 2. Only fuse with `linalg.generic` producers that arent |
There was a problem hiding this comment.
nit:
| // 2. Only fuse with `linalg.generic` producers that arent | |
| // 2. Only fuse with `linalg.generic` producers that aren't |
d6c3425 to
75af266
Compare
65bffd9 to
fa0f589
Compare
|
@KoolJBlack This is the PR I am seeing a regression on.... If you see the metrics the number of dispatches reduces by 10% on average. |
|
I took a look at profiles with and without your 3 commit on BertLargefp16PTBatch1. Bear in mind its hard to point out %100 all the changes here right away since there are a different arrangement of dispatches between the two models. I benchmarked these on my local machine with a 3080ti (recompiling on the a100 machines takes hours). There is still roughly a %10 difference in perf (which seems close enough to the benchmark results here). The thing that stands out immediately is a This is There seems to be a double The next leading difference is The situation here is similar. Looking at the other critical dispatches that take up more than %5 of the runtime seem to have similar perf between the models. @MaheshRavishankar can you take a look at these IR dumps? Let me know if you want dumps at other levels of the stack or if you can identify whats going on here. |
Thanks a lot @KoolJBlack ! This is very helpful! Can you post the IR for the dispatches before tile and distribute (Ideally before LLVMGPULowerExecutableTarget). |
|
These are the dispatches before tile/distribute: https://gist.github.com/KoolJBlack/3d56c69cfbeee69893b38c45fa3e0bb4 The should correspond to the state before |
… the same. Previous implementation of multi-use fusion was too aggressive making it hard to enable by default. For example it would fuse a reduction producer with its consumer which generates outputs of different shapes making it hard for backends to handle this. Making the conditions for fusion less aggressive to restrict this to all parallel producers/consumers of the same shape, should make this handalable on all backends. Issue iree-org#13545
fa0f589 to
3f22bf0
Compare
… the same. (iree-org#13747) Previous implementation of multi-use fusion was too aggressive making it hard to enable by default. For example it would fuse a reduction producer with its consumer which generates outputs of different shapes making it hard for backends to handle this. Making the conditions for fusion less aggressive to restrict this to all parallel producers/consumers of the same shape, should make this handalable on all backends. Issue iree-org#13545
Previous implementation of multi-use fusion was too aggressive making
it hard to enable by default. For example it would fuse a reduction
producer with its consumer which generates outputs of different shapes
making it hard for backends to handle this. Making the conditions for
fusion less aggressive to restrict this to all parallel
producers/consumers of the same shape, should make this handalable on
all backends.
Issue #13545