Skip to content

Install DeepSpeed fail with setuptools-77.0.3 #7165

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

Closed
kuailehaha opened this issue Mar 21, 2025 · 8 comments
Closed

Install DeepSpeed fail with setuptools-77.0.3 #7165

kuailehaha opened this issue Mar 21, 2025 · 8 comments
Assignees

Comments

@kuailehaha
Copy link

root@csi67c88jasm4-0:/workspace/LLaMA-Factory# pip list
Package                           Version       Editable project location
--------------------------------- ------------- ---------------------------------
accelerate                        1.2.1
aiofiles                          23.2.1
aiohappyeyeballs                  2.6.1
aiohttp                           3.11.14
aiosignal                         1.3.2
airportsdata                      20250224
annotated-types                   0.7.0
anyio                             4.9.0
astor                             0.8.1
async-timeout                     5.0.1
attrs                             25.3.0
audioread                         3.0.1
av                                14.2.0
blake3                            1.0.4
cachetools                        5.5.2
certifi                           2025.1.31
cffi                              1.17.1
charset-normalizer                3.4.1
click                             8.1.8
cloudpickle                       3.1.1
compressed-tensors                0.9.2
contourpy                         1.3.1
cupy-cuda12x                      13.4.1
cycler                            0.12.1
datasets                          3.2.0
dbus-python                       1.2.18
decorator                         5.2.1
depyf                             0.18.0
dill                              0.3.8
diskcache                         5.6.3
distro                            1.7.0
dnspython                         2.7.0
docstring_parser                  0.16
einops                            0.8.1
email_validator                   2.2.0
exceptiongroup                    1.2.2
fastapi                           0.115.11
fastapi-cli                       0.0.7
fastrlock                         0.8.3
ffmpy                             0.5.0
filelock                          3.18.0
fire                              0.7.0
fonttools                         4.56.0
frozenlist                        1.5.0
fsspec                            2024.9.0
gguf                              0.10.0
gradio                            5.21.0
gradio_client                     1.7.2
groovy                            0.1.2
h11                               0.14.0
httpcore                          1.0.7
httptools                         0.6.4
httpx                             0.28.1
huggingface-hub                   0.29.3
idna                              3.10
importlib_metadata                8.6.1
interegular                       0.3.3
jieba                             0.42.1
Jinja2                            3.1.6
jiter                             0.9.0
joblib                            1.4.2
jsonschema                        4.23.0
jsonschema-specifications         2024.10.1
kiwisolver                        1.4.8
lark                              1.2.2
lazy_loader                       0.4
librosa                           0.11.0
llamafactory                      0.9.2         /workspace/LLM_test/LLaMA-Factory
llvmlite                          0.43.0
lm-format-enforcer                0.10.11
markdown-it-py                    3.0.0
MarkupSafe                        2.1.5
matplotlib                        3.10.1
mdurl                             0.1.2
mistral_common                    1.5.4
mpmath                            1.3.0
msgpack                           1.1.0
msgspec                           0.19.0
multidict                         6.2.0
multiprocess                      0.70.16
nest-asyncio                      1.6.0
networkx                          3.4.2
ninja                             1.11.1.3
nltk                              3.9.1
numba                             0.60.0
numpy                             1.26.4
nvidia-cublas-cu12                12.4.5.8
nvidia-cuda-cupti-cu12            12.4.127
nvidia-cuda-nvrtc-cu12            12.4.127
nvidia-cuda-runtime-cu12          12.4.127
nvidia-cudnn-cu12                 9.1.0.70
nvidia-cufft-cu12                 11.2.1.3
nvidia-curand-cu12                10.3.5.147
nvidia-cusolver-cu12              11.6.1.9
nvidia-cusparse-cu12              12.3.1.170
nvidia-cusparselt-cu12            0.6.2
nvidia-nccl-cu12                  2.21.5
nvidia-nvjitlink-cu12             12.4.127
nvidia-nvtx-cu12                  12.4.127
openai                            1.67.0
opencv-python-headless            4.11.0.86
orjson                            3.10.15
outlines                          0.1.11
outlines_core                     0.1.26
packaging                         24.2
pandas                            2.2.3
partial-json-parser               0.2.1.1.post5
peft                              0.12.0
pillow                            11.1.0
pip                               25.0.1
platformdirs                      4.3.7
pooch                             1.8.2
prometheus_client                 0.21.1
prometheus-fastapi-instrumentator 7.1.0
propcache                         0.3.0
protobuf                          6.30.1
psutil                            7.0.0
py-cpuinfo                        9.0.0
pyarrow                           19.0.1
pycountry                         24.6.1
pycparser                         2.22
pydantic                          2.10.6
pydantic_core                     2.27.2
pydub                             0.25.1
Pygments                          2.19.1
PyGObject                         3.42.1
pyparsing                         3.2.1
python-dateutil                   2.9.0.post0
python-dotenv                     1.0.1
python-json-logger                3.3.0
python-multipart                  0.0.20
pytz                              2025.1
PyYAML                            6.0.2
pyzmq                             26.3.0
ray                               2.44.0
referencing                       0.36.2
regex                             2024.11.6
requests                          2.32.3
rich                              13.9.4
rich-toolkit                      0.13.2
rouge-chinese                     1.0.3
rpds-py                           0.23.1
ruff                              0.11.1
safehttpx                         0.1.6
safetensors                       0.5.3
scikit-learn                      1.6.1
scipy                             1.15.2
semantic-version                  2.10.0
sentencepiece                     0.2.0
setuptools                        77.0.3
shellingham                       1.5.4
shtab                             1.7.1
six                               1.17.0
sniffio                           1.3.1
soundfile                         0.13.1
soxr                              0.5.0.post1
sse-starlette                     2.2.1
ssh-import-id                     5.11
starlette                         0.46.1
sympy                             1.13.1
termcolor                         2.5.0
threadpoolctl                     3.6.0
tiktoken                          0.9.0
tokenizers                        0.21.0
tomlkit                           0.13.2
torch                             2.6.0
torchaudio                        2.6.0
torchvision                       0.21.0
tqdm                              4.67.1
transformers                      4.49.0
triton                            3.2.0
trl                               0.9.6
typer                             0.15.2
typing_extensions                 4.12.2
tyro                              0.8.14
tzdata                            2025.1
urllib3                           2.3.0
uvicorn                           0.34.0
uvloop                            0.21.0
vllm                              0.8.1
watchfiles                        1.0.4
websockets                        15.0.1
wheel                             0.45.1
xformers                          0.0.29.post2
xgrammar                          0.1.16
xxhash                            3.5.0
yarl                              1.18.3
zipp                              3.21.0

When I install deepspeed with pip install deepspeed

I got this:

      TypeError: Command.__init__() got an unexpected keyword argument 'use_ninja'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for deepspeed
  Running setup.py clean for deepspeed
Failed to build deepspeed

Then I downgrade setuptools with pip install setuptools==58.0.4 and succeed to install deepspeed.

I will check if it works as well in practice as it seems.

@winglian
Copy link

I'm seeing this issue as well. setuptools==75.8.0 works for me

@ChenAnno
Copy link

+1, seems to be a bug? As the bug report refers to a lower pytorch version, but actually setuptools==75.8.0 works perfectly for me, too.

@winglian
Copy link

here's a more detailed stacktrace
Building wheel for deepspeed (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [46 lines of output]
      DS_BUILD_OPS=0
      Install Ops={'async_io': False, 'fused_adam': False, 'cpu_adam': False, 'cpu_adagrad': False, 'cpu_lion': False, 'evoformer_attn': False, 'fp_quantizer': False, 'fused_lamb': False, 'fused_lion': False, 'gds': False, 'transformer_inference': False, 'inference_core_ops': False, 'cutlass_ops': False, 'quantizer': False, 'ragged_device_ops': False, 'ragged_ops': False, 'random_ltd': False, 'sparse_attn': False, 'spatial_inference': False, 'transformer': False, 'stochastic_transformer': False}
      fatal: not a git repository (or any of the parent directories): .git
      version=0.16.1, git_hash=unknown, git_branch=unknown
      install_requires=['einops', 'hjson', 'msgpack', 'ninja', 'numpy', 'packaging>=20.0', 'psutil', 'py-cpuinfo', 'pydantic>=2.0.0', 'torch', 'tqdm', 'nvidia-ml-py']
      ext_modules=[]
      running bdist_wheel
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-5h8qglm0/deepspeed_e8ca5f8efcb04ccb914e1463946fd0ec/setup.py", line 306, in <module>
          setup(name='deepspeed',
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 186, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
          dist.run_commands()
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
          self.run_command(cmd)
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/dist.py", line 1105, in run_command
          super().run_command(command)
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/command/bdist_wheel.py", line 366, in run
          build_ext = self.reinitialize_command("build_ext")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/__init__.py", line 225, in reinitialize_command
          cmd = _Command.reinitialize_command(self, command, reinit_subcommands)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 350, in reinitialize_command
          return self.distribution.reinitialize_command(command, reinit_subcommands)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 974, in reinitialize_command
          command = self.get_command_obj(command_name)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 885, in get_command_obj
 cmd_obj = self.command_obj[command] = klass(self)
                                                ^^^^^^^^^^^
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 483, in __init__
          super().__init__(*args, **kwargs)
        File "/root/miniconda3/envs/py3.11/lib/python3.11/site-packages/torch/utils/cpp_extension.py", line 488, in __init__
          super().__init__(*args, **kwargs)
      TypeError: Command.__init__() got an unexpected keyword argument 'use_ninja'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for deepspeed

@yuzhaouoe
Copy link

same issue with setuptools-77.0.3

@loadams
Copy link
Collaborator

loadams commented Mar 24, 2025

@kuailehaha or @zhangsmallshark or @yuzhaouoe can you test with this branch to confirm if we just need the updated pyproject.toml?

@loadams
Copy link
Collaborator

loadams commented Mar 24, 2025

I'm not able to repro this so far in a venv:

Package                  Version
------------------------ ----------
annotated-types          0.7.0
deepspeed                0.16.4
einops                   0.8.1
filelock                 3.18.0
fsspec                   2025.3.0
hjson                    3.1.0
Jinja2                   3.1.6
MarkupSafe               3.0.2
mpmath                   1.3.0
msgpack                  1.1.0
networkx                 3.4.2
ninja                    1.11.1.4
numpy                    2.2.4
nvidia-cublas-cu12       12.4.5.8
nvidia-cuda-cupti-cu12   12.4.127
nvidia-cuda-nvrtc-cu12   12.4.127
nvidia-cuda-runtime-cu12 12.4.127
nvidia-cudnn-cu12        9.1.0.70
nvidia-cufft-cu12        11.2.1.3
nvidia-curand-cu12       10.3.5.147
nvidia-cusolver-cu12     11.6.1.9
nvidia-cusparse-cu12     12.3.1.170
nvidia-cusparselt-cu12   0.6.2
nvidia-ml-py             12.570.86
nvidia-nccl-cu12         2.21.5
nvidia-nvjitlink-cu12    12.4.127
nvidia-nvtx-cu12         12.4.127
packaging                24.2
pillow                   11.1.0
pip                      22.0.2
psutil                   7.0.0
py-cpuinfo               9.0.0
pydantic                 2.10.6
pydantic_core            2.27.2
setuptools               78.0.1
sympy                    1.13.1
torch                    2.6.0
torchaudio               2.6.0
torchvision              0.21.0
tqdm                     4.67.1
triton                   3.2.0
typing_extensions        4.12.2
wheel                    0.45.1

DeepSpeed installed just fine as a result of the following commands:

pip install -U setuptools
pip install torch torchvision torchaudio
pip install deepspeed

I have the same result with setuptools==77.0.3, can you share if you have ninja installed on your system?

@kuailehaha
Copy link
Author

kuailehaha commented Mar 25, 2025

I'm not able to repro this so far in a venv:

Package                  Version
------------------------ ----------
annotated-types          0.7.0
deepspeed                0.16.4
einops                   0.8.1
filelock                 3.18.0
fsspec                   2025.3.0
hjson                    3.1.0
Jinja2                   3.1.6
MarkupSafe               3.0.2
mpmath                   1.3.0
msgpack                  1.1.0
networkx                 3.4.2
ninja                    1.11.1.4
numpy                    2.2.4
nvidia-cublas-cu12       12.4.5.8
nvidia-cuda-cupti-cu12   12.4.127
nvidia-cuda-nvrtc-cu12   12.4.127
nvidia-cuda-runtime-cu12 12.4.127
nvidia-cudnn-cu12        9.1.0.70
nvidia-cufft-cu12        11.2.1.3
nvidia-curand-cu12       10.3.5.147
nvidia-cusolver-cu12     11.6.1.9
nvidia-cusparse-cu12     12.3.1.170
nvidia-cusparselt-cu12   0.6.2
nvidia-ml-py             12.570.86
nvidia-nccl-cu12         2.21.5
nvidia-nvjitlink-cu12    12.4.127
nvidia-nvtx-cu12         12.4.127
packaging                24.2
pillow                   11.1.0
pip                      22.0.2
psutil                   7.0.0
py-cpuinfo               9.0.0
pydantic                 2.10.6
pydantic_core            2.27.2
setuptools               78.0.1
sympy                    1.13.1
torch                    2.6.0
torchaudio               2.6.0
torchvision              0.21.0
tqdm                     4.67.1
triton                   3.2.0
typing_extensions        4.12.2
wheel                    0.45.1

DeepSpeed installed just fine as a result of the following commands:

pip install -U setuptools
pip install torch torchvision torchaudio
pip install deepspeed

I have the same result with setuptools==77.0.3, can you share if you have ninja installed on your system?

Yes, it does work with pip install -U setuptools or pip install setuptools==78.0.2.

@loadams
Copy link
Collaborator

loadams commented Mar 25, 2025

Thanks @kuailehaha - so we think this was a possible bug with setuptools, since it seems resolved otherwise. @winglian @yuzhaouoe can you confirm if this resolves the issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants