masahi commented on PR #14417:
URL: https://github.com/apache/tvm/pull/14417#issuecomment-1490049917
Just hit an interesting bug in the graph matcher.
The following fake QKV projection mod and pattern should not match. Without
this PR I get segfault. With this PR, it incorrectly matches with the result
`{*: x2, *: w1, Op(relax.matmul)(*, *): lv1, *: w2, Op(relax.matmul)(*, *):
lv2, Op(relax.matmul)(*, *): lv0, *: w0}`
```
@R.function
def main(...) -> R.Tensor:
with R.dataflow():
lv0 = R.matmul(x1, w0)
lv1 = R.matmul(x2, w1)
lv2 = R.matmul(x2, w2)
...
with PatternContext() as ctx:
inp_pat = wildcard()
...
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)
```
I'll work on a fix in a separate PR.
--
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]