You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/05/16 00:59:59 UTC
[GitHub] [incubator-tvm] comaniac opened a new issue #5605: [BUG] Pattern Reeriter Seg Fault
comaniac opened a new issue #5605:
URL: https://github.com/apache/incubator-tvm/issues/5605
I was trying the new merged pattern language. Specifically, my goal is to create a function for the matched pattern and rewrite the pattern with a function call, which is very similar to fusion.
However, the following example encounters segmentation fault. I breifly located the position and found that it was in dominator analysis. Specifically in `LeastCommonAncestor`. It crashes when visiting an input node with null parent.
Here is the code snippet to reproduce the problem. I am not sure if I wrote the pattern in the right way, but it works fine with `pattern.match`.
cc @mbrookhart
```python
import tvm
from tvm import relay
from tvm.relay.dataflow_pattern import *
class PatternCallback(DFPatternCallback):
def __init__(self, pattern):
self.pattern = pattern
def callback(self, pre, post, node_map):
return post
def gen():
x = relay.var('x')
y = relay.var('y')
y_add = relay.add(y, y)
n0 = relay.add(x, y_add)
n1 = relay.add(x, n0)
return relay.add(n1, n0)
def pattern():
a = wildcard()
b = wildcard()
n0 = is_op('add')(a, b)
n1 = is_op('add')(n0, a)
return is_op('add')(n0, n1)
out = gen()
pat = pattern()
print(pat.match(out))
new_out = rewrite(PatternCallback(pat), out)
print(new_out)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] comaniac commented on issue #5605: [BUG] Pattern Reeriter Seg Fault
Posted by GitBox <gi...@apache.org>.
comaniac commented on issue #5605:
URL: https://github.com/apache/incubator-tvm/issues/5605#issuecomment-630303281
The PR fixed this issue. Thanks!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] mbrookhart commented on issue #5605: [BUG] Pattern Reeriter Seg Fault
Posted by GitBox <gi...@apache.org>.
mbrookhart commented on issue #5605:
URL: https://github.com/apache/incubator-tvm/issues/5605#issuecomment-629943475
Thanks, @comaniac! Just saw this, I'll reproduce and produce a fix first thing tomorrow.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] comaniac closed issue #5605: [BUG] Pattern Reeriter Seg Fault
Posted by GitBox <gi...@apache.org>.
comaniac closed issue #5605:
URL: https://github.com/apache/incubator-tvm/issues/5605
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org