microsoft / DeepSpeed

DeepSpeed is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective.
https://www.deepspeed.ai/
Apache License 2.0
35.75k stars 4.15k forks source link

[BUG] No module named 'torch._six' #2845

Closed parthmannan closed 1 year ago

parthmannan commented 1 year ago

Torch does not seem to support torch._six anymore and it has been removed. Refer - https://github.com/pytorch/pytorch/pull/94709

DeepSpeed still has dependency on it. Example in runtime/utils.py

from torch._six import inf

Torch version to be precise - 2.0.0a0+git5a54537

weiwangmeta commented 1 year ago

Please apply fix " from torch import inf", please let us know if this does not fix your issue.

styler00dollar commented 1 year ago

I cloned git master (8be8c01) now, I did not modify deepspeed, ran into same problem. I used torch==2.0.0.dev20230217+cu118.

Changing to from torch import inf in all files works.

chintan-donda commented 1 year ago

Uninstall the old version of deepspeed, and reinstall it without any version to let it pick up the latest one.

pip uninstall deepspeed
pip install deepspeed

This worked for me.

sanyanliangyu commented 1 year ago

Uninstall the old version of deepspeed, and reinstall it without any version to let it pick up the latest one.

pip uninstall deepspeed
pip install deepspeed

This worked for me.

WORK FOR ME TOO

mclohrk commented 1 year ago

not work for me in google colab

bm777 commented 1 year ago

not work for me in google colab

maybe restart your kernel and try again

sebasmos commented 9 months ago

Please apply fix " from torch import inf", please let us know if this does not fix your issue.

Still works, thanks! tested over Pytorch2.0.0+cu118

nevakrien commented 9 months ago

same issue but from the xpu end of things

using the official intel extension ie

python -m pip install torch==2.0.1a0 torchvision==0.15.2a0 intel-extension-for-pytorch==2.0.120+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl-aitools/