Window系统安装deepspeed库

  1. 直接在conda环境中安装deepspeed会报错:
pip install deepspeed
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      Traceback (most recent call last):
        File "", line 2, in 
        File "", line 34, in 
        File "C:\Users\8\AppData\Local\Temp\pip-install-32mrgogm\deepspeed_9dfd958a39eb4471bdb0a29f7760ef77\setup.py", line 162, in 
          abort(f"Unable to pre-compile {op_name}")
        File "C:\Users\8\AppData\Local\Temp\pip-install-32mrgogm\deepspeed_9dfd958a39eb4471bdb0a29f7760ef77\setup.py", line 51, in abort
          assert False, msg
      AssertionError: Unable to pre-compile async_io
      DS_BUILD_OPS=1
      [93m [WARNING] [0m async_io requires the dev libaio .so object and headers but these were not found.
      [93m [WARNING] [0m If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found.
      [93m [WARNING] [0m One can disable async_io with DS_BUILD_AIO=0
      [31m [ERROR] [0m Unable to pre-compile async_io
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

2.将DS_BUILD_AIO设置为0也是不行的:

  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [39 lines of output]
      系统找不到指定的文件。
      系统找不到指定的文件。
      系统找不到指定的文件。
      系统找不到指定的文件。
      系统找不到指定的文件。
      系统找不到指定的文件。
      Traceback (most recent call last):
        File "", line 2, in 
        File "", line 34, in 
        File "C:\Users\8\AppData\Local\Temp\pip-install-jzge374k\deepspeed_511a4216a76742acb5f90fd76d3a8966\setup.py", line 182, in 
          abort(f"Unable to pre-compile {op_name}")
        File "C:\Users\8\AppData\Local\Temp\pip-install-jzge374k\deepspeed_511a4216a76742acb5f90fd76d3a8966\setup.py", line 52, in abort
          assert False, msg
      AssertionError: Unable to pre-compile evoformer_attn
      DS_BUILD_OPS=1
      [93m [WARNING] [0m async_io requires the dev libaio .so object and headers but these were not found.
      [93m [WARNING] [0m If libaio is already installed (perhaps from source), try setting the CFLAGS and LDFLAGS environment variables to where it can be found.
      Installed CUDA version 11.3 does not match the version torch was compiled with 11.7 but since the APIs are compatible, accepting this combination
      Installed CUDA version 11.3 does not match the version torch was compiled with 11.7 but since the APIs are compatible, accepting this combination
      [93m [WARNING] [0m cpu_adam requires the 'lscpu' command, but it does not exist!
      [93m [WARNING] [0m cpu_adam attempted to query 'lscpu' after failing to use py-cpuinfo to detect the CPU architecture. 'lscpu' does not appear to exist on your system, will fall back to use -march=native and non-vectorized execution.
      [93m [WARNING] [0m cpu_adam requires the 'lscpu' command, but it does not exist!
      [93m [WARNING] [0m cpu_adam attempted to query 'lscpu' after failing to use py-cpuinfo to detect the CPU architecture. 'lscpu' does not appear to exist on your system, will fall back to use -march=native and non-vectorized execution.
      Installed CUDA version 11.3 does not match the version torch was compiled with 11.7 but since the APIs are compatible, accepting this combination
      Installed CUDA version 11.3 does not match the version torch was compiled with 11.7 but since the APIs are compatible, accepting this combination
      [93m [WARNING] [0m cpu_adagrad requires the 'lscpu' command, but it does not exist!
      [93m [WARNING] [0m cpu_adagrad attempted to query 'lscpu' after failing to use py-cpuinfo to detect the CPU architecture. 'lscpu' does not appear to exist on your system, will fall back to use -march=native and non-vectorized execution.
      [93m [WARNING] [0m cpu_adagrad requires the 'lscpu' command, but it does not exist!
      [93m [WARNING] [0m cpu_adagrad attempted to query 'lscpu' after failing to use py-cpuinfo to detect the CPU architecture. 'lscpu' does not appear to exist on your system, will fall back to use -march=native and non-vectorized execution.
      Installed CUDA version 11.3 does not match the version torch was compiled with 11.7 but since the APIs are compatible, accepting this combination
      Installed CUDA version 11.3 does not match the version torch was compiled with 11.7 but since the APIs are compatible, accepting this combination
      [93m [WARNING] [0m cpu_lion requires the 'lscpu' command, but it does not exist!
      [93m [WARNING] [0m cpu_lion attempted to query 'lscpu' after failing to use py-cpuinfo to detect the CPU architecture. 'lscpu' does not appear to exist on your system, will fall back to use -march=native and non-vectorized execution.
      [93m [WARNING] [0m cpu_lion requires the 'lscpu' command, but it does not exist!
      [93m [WARNING] [0m cpu_lion attempted to query 'lscpu' after failing to use py-cpuinfo to detect the CPU architecture. 'lscpu' does not appear to exist on your system, will fall back to use -march=native and non-vectorized execution.
      Installed CUDA version 11.3 does not match the version torch was compiled with 11.7 but since the APIs are compatible, accepting this combination
      [93m [WARNING] [0m Please specify the CUTLASS repo directory as environment variable $CUTLASS_PATH
      [93m [WARNING] [0m One can disable evoformer_attn with DS_BUILD_EVOFORMER_ATTN=0
      [31m [ERROR] [0m Unable to pre-compile evoformer_attn
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

3.解决方案:

下载0.3.16版本可以在Windows系统使用

pip install deepspeed==0.3.16

你可能感兴趣的:(python库,python,开发语言,windows,深度学习)