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] Allow optional arguments to be passed to importers #7674

Merged
merged 3 commits into from
Mar 18, 2021

Conversation

CircleSpin
Copy link
Contributor

This PR adds the ability to pass optional arguments to importers within TVMC. For example, onnx importers have a "freeze_params" argument that is useful for supporting certain models.
This change is aimed at making TVMC more useful when called from python, but doesn't impact the command line experience.

@CircleSpin
Copy link
Contributor Author

@leandron @jwfromm @mdw-octoml

Could you take a look at this PR?

python/tvm/driver/tvmc/frontends.py Outdated Show resolved Hide resolved
tests/python/driver/tvmc/test_frontends.py Outdated Show resolved Hide resolved
tests/python/driver/tvmc/test_frontends.py Outdated Show resolved Hide resolved

mod, params = tvmc.frontends.load_model(onnx_resnet50)
def verify_load_model__onnx(model, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

As in the comment above, I would probably suggest using @pytest.mark.parametrize here as well and not having the separate verify_load_model__onnx helper function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The onnx test is a little bit more complex because of the things being tested, so I think I'm going to leave it as is and try to not break things.

@masahi masahi merged commit 38aed59 into apache:main Mar 18, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* add support for optional args for frontends tvmc

* remove unnecessary comments

* Add changes suggested by Matt W. via PR

Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
* add support for optional args for frontends tvmc

* remove unnecessary comments

* Add changes suggested by Matt W. via PR

Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
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.

4 participants