You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by Star via Apache TVM Discuss <no...@discuss.tvm.ai> on 2025/07/30 10:15:34 UTC
[Apache TVM Discuss] [Questions] Can Relax fuse same OPs that appear at the start of multiple branches?
Will operator fusion in Relax perform the following fusion? Let me illustrate it with a diagram.
```bash
Merge different branch with same starting op.
|---> B --> D ...
A --->
|---> C --> E ...
The B and C have same call.op, call.args, call.attr, can be merged as:
|---> D ...
A ---> B --->
|---> E ...
```
I think this is a very classic fusion pattern, yet it wasn’t fused in my subgraph, which puzzles me. Or perhaps this fusion is handled in a specific pass that I didn’t invoke?
---
[Visit Topic](https://discuss.tvm.apache.org/t/can-relax-fuse-same-ops-that-appear-at-the-start-of-multiple-branches/18491/1) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/2e434950e452c6732df21d29f7ad7f20bc54e7775c64eeefdaf5ca484055d907).
[Apache TVM Discuss] [Questions] [SOLVED] Can Relax fuse same OPs that appear at the start of multiple branches?
Posted by Star via Apache TVM Discuss <no...@discuss.tvm.ai>.
Sorry, I overlooked this—I was only focusing on our internal pass pipeline. It turns out the pass `relax.transform.EliminateCommonSubexpr` handles this fusion case.
---
[Visit Topic](https://discuss.tvm.apache.org/t/solved-can-relax-fuse-same-ops-that-appear-at-the-start-of-multiple-branches/18491/3) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/069f862487b32b685674f3927cf565f13275c73e79a60ebb74e1692587c3c0d3).
[Apache TVM Discuss] [Questions] Can Relax fuse same OPs that appear at the start of multiple branches?
Posted by tqchen via Apache TVM Discuss <no...@discuss.tvm.ai>.
seems right now it is not supported but something that can be added i think through pattern detect rewrite
---
[Visit Topic](https://discuss.tvm.apache.org/t/can-relax-fuse-same-ops-that-appear-at-the-start-of-multiple-branches/18491/2) to respond.
You are receiving this because you enabled mailing list mode.
To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/15522fc5b41c2b76e4cd6f98a4341ca64f3b44906cfe0f88949978bd81cb1947).