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

AttributeError: partially initialized module 'torch._dynamo' has no attribute 'external_utils' #184

Open
ego-thales opened this issue Nov 28, 2024 · 0 comments

Comments

@ego-thales
Copy link

Hello,

While using pytest-timeout, I got the following error on most of my tests after the first occuring timeout:

FAILED test/test_mytests.py::test_mytestfunc[ID] - AttributeError: partially initialized module 'torch._dynamo' has no attribute 'external_utils' (most likely due to a circular import)

If I put a large enough time-out, I never get this problem. So I guess that the triggering mechanism of pytest-timeout causes an issue. I don't know if it plays a role, but I use a second decorator @pytest.mark.parametrize.

For some env context, I'm on Ubuntu22.04, using python 3.12 and (amongst others):

pytest                   8.3.3       pytest: simple powerful testing with Python
pytest-timeout           2.3.1       pytest plugin to abort hanging tests
torch                    2.5.1       Tensors and Dynamic neural networks in Python with strong GPU acceleration

Any idea on how to fix the issue? I could find this error only on one other issue.

Thank you!

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

No branches or pull requests

1 participant