You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] AttributeError: module 'deepspeed' has no attribute 'utils' when installing DeepSpeed from source #2020
Describe the bug
When installing deepspeed from Github rather than using pip install deepspeed I get the below error. I've traced this back to commit 6ad3119d5420c6b25b456626a40f4ded8c05a81. Before this commit running these instructions works whereas from this commit onwards I get the below error:
Traceback (most recent call last):
File "/usr/local/bin/deepspeed", line 3, in <module>
from deepspeed.launcher.runner import main
File "/usr/local/lib/python3.6/dist-packages/deepspeed/__init__.py", line 13, in <module>
from . import ops
File "/usr/local/lib/python3.6/dist-packages/deepspeed/ops/__init__.py", line 1, in <module>
from . import adam
File "/usr/local/lib/python3.6/dist-packages/deepspeed/ops/adam/__init__.py", line 1, in <module>
from .cpu_adam import DeepSpeedCPUAdam
File "/usr/local/lib/python3.6/dist-packages/deepspeed/ops/adam/cpu_adam.py", line 10, in <module>
from deepspeed.utils.logging import should_log_le
File "/usr/local/lib/python3.6/dist-packages/deepspeed/utils/__init__.py", line 1, in <module>
from .logging import logger, log_dist
File "/usr/local/lib/python3.6/dist-packages/deepspeed/utils/logging.py", line 5, in <module>
import deepspeed.comm as dist
File "/usr/local/lib/python3.6/dist-packages/deepspeed/comm/__init__.py", line 3, in <module>
import deepspeed.utils as utils
AttributeError: module 'deepspeed' has no attribute 'utils'
I get the same error with a virtual environment unfortunately. If it helps I'm running this on a VM set up in ovhcloud. I think this might be an error related to how some of the subdirectories are being imported. I made these changes on my fork and they fixed this error.
Essential replacing imports such as:
import deepspeed.comm as dist
import deepspeed.runtime.lr_schedules as lr_schedules
import deepspeed.utils.groups as groups
import deepspeed.utils as utils
with:
from deepspeed import comm as dist
from deepspeed.runtime import lr_schedules
from deepspeed.utils import groups
from deepspeed import utils
Activity
mrwyattii commentedon Jun 15, 2022
@KMFODA I've tried reproducing in a fresh environment, but I get no error. Could you try installing with a python virtual environment?
KMFODA commentedon Jun 15, 2022
I get the same error with a virtual environment unfortunately. If it helps I'm running this on a VM set up in ovhcloud. I think this might be an error related to how some of the subdirectories are being imported. I made these changes on my fork and they fixed this error.
Essential replacing imports such as:
with:
not sure if these changes make sense?
mrwyattii commentedon Jun 16, 2022
@KMFODA Would you be able to submit a PR from your modified fork?
KMFODA commentedon Jun 16, 2022
yes of course just submitted #2026