DeepSpeed icon indicating copy to clipboard operation
DeepSpeed copied to clipboard

[BUG] No module named 'torch._six'

Open parthmannan opened this issue 2 years ago • 2 comments

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

parthmannan avatar Feb 17 '23 00:02 parthmannan

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

weiwangmeta avatar Feb 17 '23 02:02 weiwangmeta

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.

styler00dollar avatar Feb 18 '23 00:02 styler00dollar

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.

chintan-donda avatar Jun 05 '23 06:06 chintan-donda

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

sanyanliangyu avatar Jun 06 '23 08:06 sanyanliangyu

not work for me in google colab

mclohrk avatar Jun 07 '23 23:06 mclohrk

not work for me in google colab

maybe restart your kernel and try again

bm777 avatar Jun 09 '23 10:06 bm777

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

sebasmos avatar Feb 11 '24 04:02 sebasmos

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/

nevakrien avatar Mar 04 '24 09:03 nevakrien