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

Project implicitly depends on torch nightly #29

Closed
ELanning opened this issue Dec 31, 2023 · 4 comments
Closed

Project implicitly depends on torch nightly #29

ELanning opened this issue Dec 31, 2023 · 4 comments

Comments

@ELanning
Copy link

Traceback (most recent call last):
  File "C:\code\foo\scripts\quantize.py", line 4, in <module>
    from torchao.quantization.smoothquant import (
  File "C:\code\py-envs\foo\lib\site-packages\torchao\quantization\__init__.py", line 7, in <module>
    from .smoothquant import *  # noqa: F403
  File "C:\code\py-envs\foo\lib\site-packages\torchao\quantization\smoothquant.py", line 17, in <module>
    import torchao.quantization.quant_api as quant_api
  File "C:\code\py-envs\foo\lib\site-packages\torchao\quantization\quant_api.py", line 18, in <module>
    from .subclass import (
  File "C:\code\py-envs\foo\lib\site-packages\torchao\quantization\subclass.py", line 13, in <module>
    from torch.utils._python_dispatch import return_and_correct_aliasing
ImportError: cannot import name 'return_and_correct_aliasing' from 'torch.utils._python_dispatch' (C:\code\py-envs\foo\lib\site-packages\torch\utils\_python_dispatch.py)

This project seems to rely on torch nightly, which exports return_and_correct_aliasing. It might be worthwhile to document this. I suppose one could argue it's obvious enough from this being an experimental repo, but it was surprising to me.

Nice work team, I'm looking forward to using this package.

@HDCharles
Copy link
Contributor

What version of pytorch were you using out of curiosity?

i'll add some info to the readme, there are a variety of torch version issues for the subclass api's the module swap api's should work fine

@ELanning
Copy link
Author

ELanning commented Jan 3, 2024

I was using the latest torch stable 2.1.2 on cuda 11.8. (return_and_correct_aliasing does not yet exist there)

@HDCharles
Copy link
Contributor

Yeah the module swap APIs should work in that case

@TimPietrusky
Copy link

TimPietrusky commented Jan 16, 2024

Yeah the module swap APIs should work in that case

@HDCharles You mean when using torch 2.1.2?

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

3 participants