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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch/_refs/__init__.py is not autoreloadable in bento / jupyter notebook #125183

Open
ezyang opened this issue Apr 29, 2024 · 0 comments
Open

torch/_refs/__init__.py is not autoreloadable in bento / jupyter notebook #125183

ezyang opened this issue Apr 29, 2024 · 0 comments
Labels
module: library Related to torch.library (for registering ops from Python) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@ezyang
Copy link
Contributor

ezyang commented Apr 29, 2024

馃悰 Describe the bug

When we try to reload this file, it fails with this exception:

 File "/mnt/xarfuse/uid-128580/66551cbc-seed-nspid4026531836_cgpid58278121-ns-4026531840/parsh/autoreload/autoreload.py", line 627, in _reload_modules
    self.superreload(m)
  File "/mnt/xarfuse/uid-128580/66551cbc-seed-nspid4026531836_cgpid58278121-ns-4026531840/parsh/autoreload/autoreload.py", line 836, in superreload
    self._superreload_helper(module)
  File "/mnt/xarfuse/uid-128580/66551cbc-seed-nspid4026531836_cgpid58278121-ns-4026531840/parsh/autoreload/autoreload.py", line 773, in _superreload_helper
    module = reload(module)
  File "/mnt/xarfuse/uid-128580/66551cbc-seed-nspid4026531836_cgpid58278121-ns-4026531840/runtime/lib/python3.10/importlib/__init__.py", line 203, in reload
    _bootstrap._exec(spec, module)
  File "<frozen importlib._bootstrap>", line 778, in _exec
  File "/mnt/xarfuse/uid-128580/66551cbc-seed-nspid4026531836_cgpid58278121-ns-4026531840/parsh/autoreload/measurements.py", line 46, in patched_exec_module
    orig_exec_module(self_, module)
  File "<frozen importlib._bootstrap_external>", line 896, in exec_module
  File "<frozen importlib._bootstrap>", line 400, in _call_with_frames_removed
  File "/data/users/ezyang/fbsource/fbcode/caffe2/torch/_refs/__init__.py", line 526, in <module>
    def abs(a):
  File "/data/users/ezyang/fbsource/fbcode/caffe2/torch/_refs/__init__.py", line 475, in inner
    aten_op = utils.get_aten_op(prim, prim.__name__)
AssertionError
]

The proximal cause seems to be that we are trying to reregister all of the operators, but the old registrations didn't get cleared on unload.

cc @anjali411 @zou3519

Versions

main

@cpuhrsch cpuhrsch added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: library Related to torch.library (for registering ops from Python) labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: library Related to torch.library (for registering ops from Python) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants