masahi opened a new pull request, #14439:
URL: https://github.com/apache/tvm/pull/14439
Compared to the typical, structural matching (e.g. matching `is_op` based
pattern against `CallNode`), graph pattern matching requires additionally
specifying `used_by` constraints. This leads to an obvious redundancy in the
usage:
```
matmul1 = is_op("relax.matmul")(inp_pat, Q_weight_pat)
matmul2 = is_op("relax.matmul")(inp_pat, K_weight_pat)
matmul3 = is_op("relax.matmul")(inp_pat, V_weight_pat)
inp_pat.used_by(matmul1, 0)
inp_pat.used_by(matmul2, 0)
inp_pat.used_by(matmul3, 0)
Q_weight_pat.only_used_by(matmul1, 1)
K_weight_pat.only_used_by(matmul2, 1)
V_weight_pat.only_used_by(matmul3, 1)
```
This PR hacks `is_op` constructor by automatically adding such `used_by`
constraints between caller and callee patterns. See the simplified test case
for QOL improvement.
@ganler @sunggg
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]