ucbrise / actnn

ActNN: Reducing Training Memory Footprint via 2-Bit Activation Compressed Training
MIT License
196 stars 30 forks source link

problem with torch._six on latest pytorch #15

Closed liuyanyi closed 2 years ago

liuyanyi commented 3 years ago

Hi, thanks for your great work, but there's some wrong with latest torch. When I'm trying to import actnn on pytorch1.9, I faced an error

>>>import actnn Traceback (most recent call last): File "", line 1, in File "/workspace/actnn-main/actnn/actnn/__init__.py", line 1, in from . import dataloader File "/workspace/actnn-main/actnn/actnn/dataloader.py", line 16, in from torch._six import queue, string_classes ImportError: cannot import name 'queue' from 'torch._six' (/miniconda3/lib/python3.8/site-packages/torch/_six.py)

then I compare the difference with torch1.9 and torch1.7 there is a commit in torch and they remove some import in torch._six, then I revert torch._six to old version so that actnn can work well.

Maybe just directly import queue it could work well. other import from torch._six should fix too.

merrymercy commented 3 years ago

Thanks for reporting this. If you find a solution, could you send a pull request to fix this?