-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[HotFix] Fix python import #13099
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
[HotFix] Fix python import #13099
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment. Generated by tvm-bot |
Tuning doesn't work after apache#12969. It reports the following error: ``` ImportError: cannot import name 'get_const_float' from partially initialized module 'tvm.topi.utils' (most likely due to a circular import) ``` In this commit I moved import relay to a function which used in a test. And it helps to fix this circular import
b1dfea4 to
e31b648
Compare
|
If tuning doesn't work, that's a pretty big oversight on my part and a hotfix like this makes sense. I can't seem to reproduce the issue though - here's a log of what I get when I run on the latest TVM revision. We also have a unit test that (I believe) compiles and re-deploys the docs, with output, whenever changes are made. Here's a link to the tutorial in question - the output there looks fine. Any ideas why I can't seem to reproduce this? |
|
I see that someone else has the same issue: https://discuss.tvm.apache.org/t/error-of-import-topi-utils-during-autotune/13728 |
|
I'm on almost the exact same environment - Ubuntu 20.04 and Python 3.8.10 (see log). I wonder if this is an issue with your Python I suspect the error will go away once #13051 merges, but I'm very curious what the underlying problem is - we should add a test for this. |
|
I suspect this also might be related to how tvm doesn't initialize/import all nested modules, so you can end up with situations like: We do run the tutorials as part of the post-merge ci jobs for |
junrushao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes themselves seem reasonable, but I'm hesitant to merge a hotfix for an issue we can't reproduce. Any chance this issue can be reproduced on Google Colab or something similar?
|
It's not just tuning, I got this error yesterday when running https://github.com/apache/tvm/blob/main/tests/python/unittest/test_meta_schedule_schedule_rule_mlt.py by |
* [TVM] Update Submodule * Bring apache/tvm#13099 * Compatible apache/tvm#12923 * lint * trigger Co-authored-by: SubmoduleUpdaterBot <submodule-updater-bot@users.noreply.github.com> Co-authored-by: Cody Yu <comaniac0422@gmail.com>
* [HotFix] Fix python import Tuning doesn't work after apache#12969. It reports the following error: ``` ImportError: cannot import name 'get_const_float' from partially initialized module 'tvm.topi.utils' (most likely due to a circular import) ``` In this commit I moved import relay to a function which used in a test. And it helps to fix this circular import * Fix lint
* [HotFix] Fix python import Tuning doesn't work after apache#12969. It reports the following error: ``` ImportError: cannot import name 'get_const_float' from partially initialized module 'tvm.topi.utils' (most likely due to a circular import) ``` In this commit I moved import relay to a function which used in a test. And it helps to fix this circular import * Fix lint
Tuning doesn't work after #12969.
It reports the following error:
In this commit, I moved import relay to a function which used in a test. And it helps to fix this circular import.
To reproduce this issue, you can run the following tutorial and will see this error.
cc: @guberti, @areusch, @ekalda