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

   I recently tried to disable the `qnn.Legalize` pass on the TVMC command line 
and learned, that the list of passes is actuallt not complete. It lacks:
   * Custom relay passes which not not follow the `relay._transform.` scheme 
such as `relay.qnn._transform.Legalize`
   * Any TIR passes. Is this intentional, i.e. to keep complexity down and not 
overwhelm users?
   
   My patch fixes this by automatically mapping user-provided path names to 
fully-qualified TVM passes as follows:
   ```python
   replacements = {
       "tir.": "tir.transform.",
       "qnn.": "relay.qnn._transform.",
       "": "relay._transform.",
   }
   ```
   
   A small unit test for this use case was added. 
   
   **Example usage:** `tvmc compile ... --disabled-pass 
tir.UnrollLoop,qnn.Legalize`
   
   ### Discussion
   * To not break the compatibility with the older interface, I still use an 
empty prefix for the `relay._transform.` passes which is inconsistent with the 
QNN & TIR ones. Should I allow `relay.ABC` inputs instead and deprecate the 
unprefixed version instead?
   * Having these non-trivial mappings might lead to users struggling how to 
find the expected names for these passes. Allowing to specify the 
fully-qualified pass name (i.e. `relay._transform.RemoveUnusedFunctions`) would 
be help but also blow up the number of allowed passes which would be printed in 
case of a failed lookup in `pass_list.py`.
   * A number of passes is currently not exposed automatically for two reasons:
       ```
       relay.transform.LiftConstants
       relay.transform.RecoverVirtualDeviceMap
       relay.transform.ManifestAlloc
       relay.transform.MemoryPlan
       tir.usmp.transform.ConvertPoolAllocationsToOffsets
       tir.usmp.transform.CreateAllocatesForIO
       tir.usmp.transform.AssignPoolInfo
       ```
     1. Using `relay.transform.` as prefix instead of `relay._transform.`. Can 
anyone explain why?
     2. Mapping `tir.usmp.transform.` -> `tir.usmp.` is currently not 
implemented. Should I add it?


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