abergeron commented on issue #4758: [relay] ADT match becomes not well formed 
during VM optimization
URL: https://github.com/apache/incubator-tvm/issues/4758#issuecomment-578918024
 
 
   After some experimentation, if I comment out InlinePrimitives at line 921 in 
compiler.cc 
(https://github.com/apache/incubator-tvm/blob/master/src/relay/backend/vm/compiler.cc#L921),
 then the compilation works.  It seems this is the line that introduces the 
weird change.
   
   If I add an override like this:
   
   ```
     Expr VisitExpr_(const MatchNode* m) {
       std::vector<Clause> clauses;
       for (const Clause& p : m->clauses) {
         clauses.push_back(VisitClause(p));
       }
       return GetRef<Expr>(m);
     }
   ```
   
   to the PrimitiveInliner class (in 
https://github.com/apache/incubator-tvm/blob/master/src/relay/backend/vm/inline_primitives.cc#L54),
 it appears to make the compilation work (at least in my limited example), but 
this may have some other consequences that I am not aware of (I suspect this 
means that no transformations will be applied to the body of match clauses, 
which might be bad).
   
   I'll keep working on that for a bit trying to find an acceptable solution, 
but I will gladly take any help/hints that I can get.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to