Skip to content
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

[BUG] DeepSpeed on pypi not compatible with latest numpy #5671

Closed
younesbelkada opened this issue Jun 17, 2024 · 7 comments
Closed

[BUG] DeepSpeed on pypi not compatible with latest numpy #5671

younesbelkada opened this issue Jun 17, 2024 · 7 comments
Assignees
Labels
bug Something isn't working compression

Comments

@younesbelkada
Copy link

Describe the bug

Importing deepspeed on a python env with numpy>=2.0.0 fails:

  File "/miniconda3/envs/py39/lib/python3.9/site-packages/deepspeed/autotuning/scheduler.py", line 8, in <module>
    from numpy import BUFSIZE
E   cannot import name 'BUFSIZE' from 'numpy' (/miniconda3/envs/py39/lib/python3.9/site-packages/numpy/__init__.py)

To Reproduce

pip install deepspeed on a env with python>=3.9 and import deepspeed

@loadams
Copy link
Collaborator

loadams commented Jun 17, 2024

Thanks @younesbelkada, I believe the second linked PR should resolve this.

@loadams loadams self-assigned this Jun 17, 2024
@adk9
Copy link
Contributor

adk9 commented Jun 17, 2024

@loadams, is it really necessary for us to pin numpy to a pre-2.0.0 version?

I wonder if BUFSIZE was a botched import and the right fix for this is something like:

diff --git a/deepspeed/autotuning/scheduler.py b/deepspeed/autotuning/scheduler.py
index 7d2a1c08..35f709ea 100755
--- a/deepspeed/autotuning/scheduler.py
+++ b/deepspeed/autotuning/scheduler.py
@@ -5,7 +5,6 @@
 
 import copy
 
-from numpy import BUFSIZE
 import json
 import subprocess
 import sys
@@ -18,7 +17,7 @@ import hjson
 from tqdm import tqdm
 
 from ..utils import logger
-from .constants import AUTOTUNING, AUTOTUNING_METRIC_PATH
+from .constants import AUTOTUNING, AUTOTUNING_METRIC_PATH, BUFSIZE
 from .utils import get_val_by_key, search_error, was_interruptted
 """
 thread-0: loop over experiment queue dispatching experiments if they become available

Um, lmk if this makes sense and I can open a PR for it.

@loadams
Copy link
Collaborator

loadams commented Jun 19, 2024

Okay @younesbelkada, DeepSpeed master branch should have this resolved here, one we confirm, we can do a new release as well.

#5680

@younesbelkada
Copy link
Author

Thank you very much for the quick action @loadams !

@sedletsky-f5
Copy link

Okay @younesbelkada, DeepSpeed master branch should have this resolved here, one we confirm, we can do a new release as well.

#5680

please release the fix, to unblock users

@hvaara
Copy link

hvaara commented Aug 28, 2024

xref #5686

For code archeologists coming here after me: this seems like it was released in v0.14.4. If I don't make an additional update after this, it's probably safe to assume this holds (for package version bumps).

@loadams
Copy link
Collaborator

loadams commented Aug 28, 2024

Yes @sedletsky-f5 and @hvaara - this was released in v0.14.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compression
Projects
None yet
5 participants