From commits-return-13471-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Sat May 16 01:00:00 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 747EA180608 for ; Sat, 16 May 2020 03:00:00 +0200 (CEST) Received: (qmail 85023 invoked by uid 500); 16 May 2020 00:59:59 -0000 Mailing-List: contact commits-help@tvm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tvm.apache.org Delivered-To: mailing list commits@tvm.apache.org Received: (qmail 85012 invoked by uid 99); 16 May 2020 00:59:59 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 May 2020 00:59:59 +0000 From: =?utf-8?q?GitBox?= To: commits@tvm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-tvm=5D_comaniac_opened_a_new_issue_=2356?= =?utf-8?q?05=3A_=5BBUG=5D_Pattern_Reeriter_Seg_Fault?= Message-ID: Date: Sat, 16 May 2020 00:59:59 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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