Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-31 Thread EDJ
Hi @MarisaKirisame , I have several questions during the learning of AAM, about the advantage of implementing AAM over using the normal Dataflow Analysis framework (like the proposed one above) in the context of Relay. Because I have no experience in Relay at all, I would appreciate it if you ca

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-16 Thread EDJ
@MarisaKirisame : I might still be a little confused about the semantic and **internal memory representation** of RelayIR. I would appreciated if you can enlighten me: in the official document, the picture for ANF is still a DAG (a child can have several different parent) with respect to **inte

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-15 Thread EDJ
Hi @MarisaKirisame , I currently have a question about representing "location inside the program" because when the users want to query about the Dataflow-Info, they will need to use "location". **TLDR**: Pointers to ASTNodes are not one-to-one correspondent to "locations in the program". Can th

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-12 Thread EDJ
Hi @MarisaKirisame , thanks for commenting! So which one are you looking for? ADI or AAM? I am not familiar with either, but I remember AAM requires a state machine transition definition of the semantics, where ADI requires a definitional interpreter to define the semantics. My another question

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-09 Thread EDJ
Hi @comaniac , Thanks for your suggestion! :) Because of your suggestion and [Unified IR Post](https://discuss.tvm.ai/t/ir-unified-tvm-ir-infra/4801), I think I need to dig into the design and infrastructure of Relay for a while to see how to design an DFA infrastructure that fits into both IRs.

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-06 Thread EDJ
Hi @comaniac , Thanks for commenting. :) Yes. This is a real problem happening in the industrial context. The current solution is either over-conservative or unsound. About the name of "Data-flow Analysis", I think it is more a terminology question. For example the CFA is also a kind of pr

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-06 Thread EDJ
Hi @junrushao1994 , an over-simplified example from the industrial context is the following: ```python ... B0 = tvm.compute((m,n), lambda i,j: A0[i,j] + 2*A1[i,j], name = "B0") C0 = tvm.compute((m,n), lambda i,j: A0[i,j] + 2*A1[i,j], name = "C0") D0 = tvm.compute((m,n), lambda i,j: B0[i,j] + 3*

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-04 Thread EDJ
Hi @junrushao1994 , Thanks for the comments! :) I will get back to you about a real world example as soon as possible. But generally speaking, dead code elimination pass is required in some workloads; and after TVM output program with intrinsics and not even targetting CPU or GPU, LLVM or other

Re: [apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-04 Thread EDJ
### Comments: IsLattice The basic usage is just: ```cpp template struct STD_SET_IS_LATTICE : public IsLattice> { using SET = std::set; public: SET join(const SET& a, const SET& b); SET meet(const SET& a, const SET& b); const SET& top(); const SET& bottom(); bool equal

[apache/incubator-tvm] [RFC] Data-flow Analysis Functionality on TVM IR (#4468)

2019-12-04 Thread EDJ
# Problem When developing program passes on TVM IR (the one once was Halide IR), it is normal to ask for all sorts of information requiring program analysis, for example, live variable analysis for dead code elimination. This requirement becomes urgent when TVM has to directly issue intrinsic a