-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix import container_abcs issue #1049
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
Conversation
Nightly PyTorch has removed `container_abcs` from `torch._six`. pytorch/pytorch@58eb233#diff-b3c160475f0fbe8ad50310f92d3534172ba98203387a962b7dc8f4a23b15cf4dL35
Nightly PyTorch has removed `container_abcs` from `torch._six`. pytorch/pytorch@58eb233#diff-b3c160475f0fbe8ad50310f92d3534172ba98203387a962b7dc8f4a23b15cf4dL35
CC @mcarilli @seryilmaz @definitelynotmcarilli Hi, would you mind having a review? |
Apex is in maintenance mode at best. I'm not working on apex, but i guess this counts as "maintenance." I AM working to ensure all of apex's commonly used features have better support through Pytorch itself. I strongly recommend anyone still using apex amp or DDP to use torch.cuda.amp and torch.nn.parallel.DistributedDataParallel instead. torch.optim fused optimizers are also coming soon courtesy of @izdeby. |
apex/amp/_amp_state.py
Outdated
import collections.abc as container_abcs | ||
else: | ||
from torch._six import container_abcs | ||
import collections.abc as container_abcs |
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.
I'd rather keep existing import for Pytorch 1.7 and earlier:
TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1])
if TORCH_MAJOR == 1 and TORCH_MINOR < 8:
from torch._six import container_abcs
else:
import collections.abc as container_abcs
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.
Thanks for your suggestion. I've updated it.
Thanks @ShoufaChen and @mcarilli for such a prompt response. |
Nightly PyTorch has removed
container_abcs
fromtorch._six
.pytorch/pytorch@58eb233#diff-b3c160475f0fbe8ad50310f92d3534172ba98203387a962b7dc8f4a23b15cf4dL35
Also fix #1048 and #1046