I guess I have another case:
A D H
| | |
B E I
| | |
C F J
to
A D H
\ | /
G
/ | \
C F J
Essentially, I can match A-B-C, D-E-F, H-I-J patterns. Can I group them to one relay function? My ultimate goal is to match a group of connected functions and offload to something like byoc. Since the replacing function is highly hackable, as long as the inputs and outputs of the matched pattern are in control, we could get away…
I am not talking about general graph rewrite approach for all models. Yet, such hack can enable aggressive fusion strategies, which lead to better perf for specific models.