leeexyz opened a new pull request #9817:
URL: https://github.com/apache/tvm/pull/9817


   Hi All,
   
   Sometimes, we should manipulate the Passes order or add new Passes not only 
for `Relay Pass` but for `TIR Pass`.  the This PR add the configuration 
`tir.add_lower_pass` to `--pass-config`. It supports two types of `TIR Pass`, 
one is the built-in pass in TVM and another one is the external customized pass 
that is loaded by `importlib`.
   
   Some use cases.
   
   ```bash
   ~/project/apache/tvm$ python -m tvm.driver.tvmc compile --target "llvm"  \
                                                      --output 
resnet50-v2-7-tvm.tar resnet50.onnx \
                                                      --pass-config 
"tir.add_lower_pass=1,tir.transform.UnrollLoop,2,tir.transform.UnrollLoop" 
   {'tir.add_lower_pass': [(1, PrimFuncPass(tir.UnrollLoop, opt_level=0)), (2, 
PrimFuncPass(tir.UnrollLoop, opt_level=0))]}
   ```
   
   ```bash
   ~/project/apache/tvm$ python -m tvm.driver.tvmc compile --target "llvm" \
                                                      --output 
resnet50-v2-7-tvm.tar resnet50.onnx \
                                                      --pass-config 
"tir.add_lower_pass=1,tir.transform.UnrollLoop,2,tir.transform.UnrollLoop" \
                                                      --pass-config 
"tir.add_lower_pass=1,tir.transform.UnrollLoop"
   {'tir.add_lower_pass': [(1, PrimFuncPass(tir.UnrollLoop, opt_level=0)), (2, 
PrimFuncPass(tir.UnrollLoop, opt_level=0)), (1, PrimFuncPass(tir.UnrollLoop, 
opt_level=0))]}
   ```


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