Lunderberg commented on PR #15916:
URL: https://github.com/apache/tvm/pull/15916#issuecomment-1792924890

   @slyubomirsky @tqchen Can you take a look at PRs 
https://github.com/apache/tvm/pull/16067 and 
https://github.com/apache/tvm/pull/16068?  The former introduces new 
functionality through a `FNormalize` attribute, and the latter applies that 
functionality to `relax.op.call_tir`.
   
   1. Downstream passes can make assumptions about the specific form of the 
AST.  For `call_tir`, the current use of `Downcast<Tuple>` be guaranteed to 
have an in-line tuple.
   2. If the operator can be automatically normalized, then upstream passes do 
not need to be aware of the operator-specific requirements.  The normalization 
is applied as part of every ExprMutator usage, the same as any other 
normalization step.
   3. If automatic normalization is impossible, an error is raised during the 
pass that introduced the ill-formed IR, rather than at the downstream pass that 
tried to use it.
   
   Properties (2) and (3) fulfill my goals of avoiding an increased mental 
burden when writing an upstream pass, and of making all IR requirements be 
explicit within the code.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to