[Apache TVM Discuss] [Questions] `DFPatternRewriteComposer.AddRewrite` with additional args raises compile error

2022-03-16 Thread Matthew Brookhart via Apache TVM Discuss
I think your change it correct, but I'd like to defer to @altanh , he's the one that implemented this variadic template. --- [Visit Topic](https://discuss.tvm.apache.org/t/dfpatternrewritecomposer-addrewrite-with-additional-args-raises-compile-error/12323/2) to respond. You are receiving

[Apache TVM Discuss] [Questions] Difference between MixedModeMutator and ExprRewriter

2022-02-16 Thread Matthew Brookhart via Apache TVM Discuss
Hi @lhutton1. That was the intention (it's somewhat safer to do a dataflow transformation without access to recursion at all), but MixedMode* was introduced well after TVM became a mature project, and it seems like most people prefer using the MixedModMutator directly, since the API is closer

[Apache TVM Discuss] [Questions] Question on fuzzy path matching ---- matching arbitrary number and type of nodes in path

2021-11-19 Thread Matthew Brookhart via Apache TVM Discuss
Okay, I'm remembering how this works. The issue here comes in the definition of the domination pattern. In your pattern, the nodes I've circled in green count as part of the domination, they're in a direct line between conv2d and relu, but the second inputs to add and multiply are taking data

[Apache TVM Discuss] [Questions] Question on fuzzy path matching ---- matching arbitrary number and type of nodes in path

2021-11-19 Thread Matthew Brookhart via Apache TVM Discuss
Ooh, I haven't debugged a problem like this with the pattern matcher in like a year. :smiley: I thought it was stable. This looks like a bug. I have some freetime today, I'll try to reproduce and debug. --- [Visit Topic](https://discuss.tvm.apache.org/t/question-on-fuzzy-path-matching-mat

[Apache TVM Discuss] [Questions] [Pattern Language] Matching a tuple with variable size

2021-03-26 Thread Matthew Brookhart via Apache TVM Discuss
https://github.com/apache/tvm/pull/7754 Also managed to fix partitioning Functions with fuzzy bodies :D Skipping that test has been bothering me for a while. --- [Visit Topic](https://discuss.tvm.apache.org/t/pattern-language-matching-a-tuple-with-variable-size/9497/7) to respond. You a

[Apache TVM Discuss] [Questions] [Relay] analysing of relay graph and clone subggraphs

2021-03-25 Thread Matthew Brookhart via Apache TVM Discuss
https://tvm.apache.org/docs/langref/relay_pattern.html Docs are here. If you have more detail about what you'd like to do, we might be able to point you at something more specific. --- [Visit Topic](https://discuss.tvm.apache.org/t/relay-analysing-of-relay-graph-and-clone-subggraphs/9482/

[Apache TVM Discuss] [Questions] Changing return of relay.Function or IRModule?

2021-03-04 Thread Matthew Brookhart via Apache TVM Discuss
[quote="jmatai1, post:5, topic:9307"] ``` if call.op.name =="add": # save this call for return! self.return_values.append(call) super().visit_call(call) ``` [/quote] :point_down: ``` post = super().visit_call(call) if post.op.name =="add":

[Apache TVM Discuss] [Questions] Changing return of relay.Function or IRModule?

2021-03-04 Thread Matthew Brookhart via Apache TVM Discuss
return this `super().visit_call(call)` --- [Visit Topic](https://discuss.tvm.apache.org/t/changing-return-of-relay-function-or-irmodule/9307/6) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click here](https://discuss.tvm.ap

[Apache TVM Discuss] [Questions] Changing return of relay.Function or IRModule?

2021-03-04 Thread Matthew Brookhart via Apache TVM Discuss
Try this: ``` new_body = self.visit(fn.body) print("Visited all", new_body) return_values_to_function = relay.Tuple([new_body] + self.return_values) func = relay.Function(fn.params, return_values_to_function, fn.ret_type, fn.type_params, fn.attrs) ``` --- [V

[Apache TVM Discuss] [Questions] Changing return of relay.Function or IRModule?

2021-03-04 Thread Matthew Brookhart via Apache TVM Discuss
When you construct a relay Function, you can wrap multiple output variables in relay.Tuple and return that as the output of the Function. --- [Visit Topic](https://discuss.tvm.apache.org/t/changing-return-of-relay-function-or-irmodule/9307/2) to respond. You are receiving this because yo

[Apache TVM Discuss] [Questions] MergeComposite Error when defining custom pattern

2020-11-23 Thread Matthew Brookhart via Apache TVM Discuss
Ooh, good catch, sorry for this. I mostly left that check in as a debug tool for developing passes, but you're right, the partitioned graph won't match anymore if we're doing more specific things, like matching on names, or possibly matching on types. I think maybe we should just remove the ch

[Apache TVM Discuss] [Questions] How to match the pattern of a function in Relay?

2020-11-03 Thread Matthew Brookhart via Apache TVM Discuss
Like a pattern that exists across multiple functions? Yes, we'll need a FunctionPattern. --- [Visit Topic](https://discuss.tvm.apache.org/t/how-to-match-the-pattern-of-a-function-in-relay/8283/21) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe f

[Apache TVM Discuss] [Questions] How to match the pattern of a function in Relay?

2020-10-29 Thread Matthew Brookhart via Apache TVM Discuss
The way the API is written, the matcher doesn't traverse you're input graph, it will return false unless the exact node you supply matches the pattern. The partition and rewriting functions, however, will traverse the relay expression, go into functions, and find the match inside your function

[Apache TVM Discuss] [Questions] How to match the pattern of a function in Relay?

2020-10-27 Thread Matthew Brookhart via Apache TVM Discuss
@comaniac sounds good, we'll see who gets there first :) --- [Visit Topic](https://discuss.tvm.apache.org/t/how-to-match-the-pattern-of-a-function-in-relay/8283/11) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click here](h

[Apache TVM Discuss] [Questions] How to match the pattern of a function in Relay?

2020-10-27 Thread Matthew Brookhart via Apache TVM Discuss
I'm happy to add it, but it will be a couple of days before I can get to it. Any one else interested in adding the node and some matching tests? --- [Visit Topic](https://discuss.tvm.apache.org/t/how-to-match-the-pattern-of-a-function-in-relay/8283/7) to respond. You are receiving this b

[Apache TVM Discuss] [Questions] How to match the pattern of a function in Relay?

2020-10-27 Thread Matthew Brookhart via Apache TVM Discuss
It will definitely go inside the function to match patterns, but you're right, we don't have a Function Pattern right now, we should probably add one. This seems to be a function created by the FuseOps pass. Typically we'd do pattern rewriting/partitioning before that, maybe there's a simpler

[Apache TVM Discuss] [Questions] How to use Relay Control Flow?

2020-10-22 Thread Matthew Brookhart via Apache TVM Discuss
@jwfromm and I did ONNX LSTM a few months ago, and decided to unroll because the rest of the ONNX importer only support static shapes. We've recently fix that, and Josh recently implemented ONNX Loop using relay's recursive while function. We could probably use that experience to go back and t