[TVM Discuss] [Development/RFC] [RFC] Visualizing Relay program as graph

2020-04-11 Thread JC Li via TVM Discuss
Thanks for the great proposal. @hcho3, I followed your [script in github](https://github.com/hcho3/relayviz) and noticed it missed a case when operator being "Call"ed is a function. Adding some code within "Call" condition can generate graph with each function singled out. ```

[TVM Discuss] [Development] Missing memoization in ExprFunctor

2020-04-11 Thread masahi via TVM Discuss
[quote="tqchen, post:4, topic:6334"] The addtional cost for memo is not taking a lot of locs [/quote] Note that in addition to the memo logic itself, we can also remove `VisitExpr(const Expr& expr)` override in the derived classes (which to me seems only exist for memoization), and hence the d

[TVM Discuss] [Development] Missing memoization in ExprFunctor

2020-04-11 Thread tqchen via TVM Discuss
Given that the ExprFunctor also have additional arguments(besides the first argument), it is unclear how do we define such Memoization, unless we restrict the arguments to only contain the single one. The addtional cost for memo is not taking a lot of locs, so I think either way is fine(consi

[TVM Discuss] [Development] Missing memoization in ExprFunctor

2020-04-11 Thread masahi via TVM Discuss
hmm, then does it make sense to have a another derived class, say `MemoizedExprFunctor`, that does have a memo logic built in, for a simple use case in derived classes that requires memoization? The PR I saw today could derive from this instead of ExprFunctor, for example. Basically for encap

[TVM Discuss] [Development] Missing memoization in ExprFunctor

2020-04-11 Thread tqchen via TVM Discuss
ExprFunctor is a more generic base class for dispatching, while itself can be used to build recursive visitors, the visitor is not the only use case for the ExprFunctor. For example, we use the functor to build a dispatching Rewriter callbacks in the recent non-recursive vistor. Memoization

[TVM Discuss] [Development] Missing memoization in ExprFunctor

2020-04-11 Thread masahi via TVM Discuss
Currently I'm about to merge a PR https://github.com/apache/incubator-tvm/pull/5310 which adds memoization logic for `ExprFunctor` in two different derived classes. I've also noticed that there are many places in the code base that have the same duplicated memoization logic for `ExprFunctor`