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

[Frontend] Speed up Fold Constant #8208

Merged
merged 1 commit into from
Jun 9, 2021

Conversation

mbrookhart
Copy link
Contributor

@masahi

This utiliy was creating a new IRModule from the provided expression if the provided module was None. This isn't strictly necessary, the use cases are correct if we pass in an empty IRModule. The WellFormed check inside IRModule.from_expr was actually taking a lot of the time when importing large ONNX models. This change gets me a 2.6x speedup on importing the large NLP model I'm playing with today.

Copy link
Contributor

@jcf94 jcf94 left a comment

Choose a reason for hiding this comment

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

Do we have a UT for the fold_const with mod input as None?

If not, I suggest to add one for that.

@mbrookhart
Copy link
Contributor Author

We use it in dozens of places in the ONNX importer with mod=None, if there was a problem, ~1/3 of the onnx unit tests would have failed. I'm not sure any of the utilities in the frontend/common.py file are actually tested? https://github.com/apache/tvm/blob/main/tests/python/frontend/test_common.py

Copy link
Contributor

@jcf94 jcf94 left a comment

Choose a reason for hiding this comment

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

OK, then I don't have any other questions.

@masahi masahi merged commit f646048 into apache:main Jun 9, 2021
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Jun 17, 2021
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants