Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TVMC] Add configuration tir.add_lower_pass to option --pass-config #9817

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

leeexyz
Copy link
Contributor

@leeexyz leeexyz commented Dec 31, 2021

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.

~/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))]}
~/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))]}

Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one remark, and I think we're good to go with this PR.

python/tvm/driver/tvmc/common.py Outdated Show resolved Hide resolved
@leeexyz leeexyz force-pushed the tvmc_fix branch 2 times, most recently from f7b3c53 to ee7df62 Compare January 7, 2022 15:38
@leeexyz leeexyz requested a review from leandron January 8, 2022 08:23
@leeexyz
Copy link
Contributor Author

leeexyz commented Jan 13, 2022

@leandron Would you mind helping me review again? :)

@leeexyz
Copy link
Contributor Author

leeexyz commented Jan 22, 2022

cc @leandron @junrushao1994 @comaniac 😊

Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leandron leandron merged commit ac9bf1f into apache:main Feb 14, 2022
@leandron
Copy link
Contributor

Thanks @leeexyz, this is merged now.

ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
@leeexyz leeexyz deleted the tvmc_fix branch March 9, 2022 06:56
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants