SiriusNEO opened a new pull request, #14512:
URL: https://github.com/apache/tvm/pull/14512

   Prior to this PR, we first have a pass named `SimplifyNormInference` 
(https://github.com/apache/tvm/pull/14221), which is used to decompose 
`batch_norm` into simple operators for optimization during inference. And there 
are some follow-up changes:
   
   - https://github.com/apache/tvm/pull/14282 This PR introduces a policy to 
decompose `tensor_to_shape` op.
   - https://github.com/mlc-ai/relax/pull/170 In mlc, we make 
`SimplifyNormInference` support op simplification during training (Because 
`batch_norm` behaves differently in inference and training).
   - And in the future maybe there will be more operators needed to be 
decomposed.
   
   So this PR polishes the changes in https://github.com/apache/tvm/pull/14282 
mainly in the following aspects:
   - Use one mutator (instead of two) to visit and decompose ops.
   - Separate inference and training by registering two passes (Adviced by TQ).
   - Shorten the name (DecomposeCompositeOps -> DecomposeOps)
   
   Now the code is clear and easy to read. Now we use `if-else if-else if ...` 
pattern to recognize the op we want to decompose. In the future maybe we can 
introduce a map or register the decomposition policy in the op attribute, just 
like what we do in the `LegalizeOps` pass.
   


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