DeepSpeed
DeepSpeed copied to clipboard
[Error] [Win] Unable to pre-compile async_io on Windows
Describe the bug I was trying to install Deepspeed on WIndows inside a python virtual environment. I have been told that Deepspeed has not been tested on windows so far as Deepspeed has primarily been used on Linux. @tjruwase what do you think is causing it?
To Reproduce Steps to reproduce the behaviour:
- Install PyTorch (I have torch=1.10.2+cu113 on RTX2060)
- pip install deepspeed
Expected behavior Deepspeed should be installed
ds_report output
Collecting deepspeed
Using cached deepspeed-0.5.10.tar.gz (515 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\divedeepai\desktop\fast-gpt-j\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\DIVEDE~1\AppData\Local\Temp\pip-install-wd7js0qm\deepspeed\setup.py'"'"'; file='"'"'C:\Users\DIVEDE~1\AppData\Local\Temp\pip-install-wd7js0qm\deepspeed\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\DIVEDE~1\AppData\Local\Temp\pip-pip-egg-info-66ojul50'
cwd: C:\Users\DIVEDE~1\AppData\Local\Temp\pip-install-wd7js0qm\deepspeed
Complete output (26 lines):
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
test.c
LINK : fatal error LNK1181: cannot open input file 'aio.lib'
Traceback (most recent call last):
File "
System info (please complete the following information):
- Windows 10
- RTX 2060
- Python version 3.7.9
@affanmehmood, thanks for creating this issue. My recollection is that libaio-dev is Linux library that is not available in Windows, so can you please share more details on how you installed this on Windows. One way to work around this for now is to disable async_io by setting environment variable DS_BUILD_AIO to 0

I was unable to disable async_io by setting the environment variable, after manually ignoring async_io and sparse_attn I am now getting this error.
ERROR: Command errored out with exit status 1:
command: 'c:\users\divedeepai\desktop\fast-gpt-j\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed\setup.py'"'"'; file='"'"'C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\DIVEDE~1\AppData\Local\Temp\pip-pip-egg-info-vw6et02g'
cwd: C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed
Complete output (22 lines):
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
Traceback (most recent call last):
File "
I was unable to disable async_io by setting the environment variable, after manually ignoring async_io and sparse_attn I am now getting this error. ERROR: Command errored out with exit status 1: command: 'c:\users\divedeepai\desktop\fast-gpt-j\venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed\setup.py'"'"'; file='"'"'C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\DIVEDE~1\AppData\Local\Temp\pip-pip-egg-info-vw6et02g' cwd: C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed Complete output (22 lines): The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified. Traceback (most recent call last): File "", line 1, in File "C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed\setup.py", line 193, in create_dir_symlink('....\csrc', '.\deepspeed\ops\csrc') File "C:\Users\DiveDeepAI\Desktop\Fast-GPT-J\DeepSpeed\setup.py", line 187, in create_dir_symlink os.symlink(src, dest) OSError: symbolic link privilege not held DS_BUILD_OPS=1 install_ops {'cpu_adam': False, 'cpu_adagrad': False, 'fused_adam': False, 'fused_lamb': False, 'sparse_attn': 0, 'transformer': False, 'stochastic_transformer': False, 'async_io': 0, 'utils': False, 'quantizer': False, 'transformer_inference': False} [WARNING] cpu_adam requires the 'lscpu' command, but it does not exist! [WARNING] 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. [WARNING] cpu_adam requires the 'lscpu' command, but it does not exist! [WARNING] 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. [WARNING] cpu_adagrad requires the 'lscpu' command, but it does not exist! [WARNING] 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. [WARNING] cpu_adagrad requires the 'lscpu' command, but it does not exist! [WARNING] 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. Install Ops={'cpu_adam': 1, 'cpu_adagrad': 1, 'fused_adam': 1, 'fused_lamb': 1, 'sparse_attn': 0, 'transformer': 1, 'stochastic_transformer': 1, 'async_io': 0, 'utils': 1, 'quantizer': 1, 'transformer_inference': 1} ---------------------------------------- I'm having the same problem now. Got a good plan, bro.
Any resolution for this? I am facing the same issue.
Nope. seems like there is no support for Windows. #2427
Too funny!
So far haven't found a workaround for insdtalling DeepSpeed on windows
Any resolution for this? I am facing the same issue.
me too
me too
I ran into the same problem but may have a workaround for those of you using Windows, sort of. I set up WSL Ubuntu 20.04 on windows 10 and got Successfully built deepspeed pathtools lit
I had to do the usual python3 setup within WSL, it doesn't use what you may have already installed on your Windows system, but once that was done, and after collecting all the dependencies, it worked.
See https://github.com/microsoft/DeepSpeed for instructions on building on Windows.
If people insist on not building things that work, at least release a docker container image with the right settings to make it work rather than making users jump through hoops.
Hello, I think I have your solution, though you're not going to like it.
The "Unable to pre-compile async_io" error can occur when installing DeepSpeed on Windows, and is usually caused by a missing dependency. Specifically, the async_io module used by DeepSpeed requires the libaio development files to be installed on the system. On Linux systems, these files are typically installed by default, but on Windows they need to be installed manually.
To resolve this issue, you can try installing the libaio development files on your Windows system using a package manager like Cygwin. Cygwin provides a Linux-like environment on Windows and includes a package for libaio-dev that you can install using the Cygwin installer. Once you have installed the libaio-dev package, you should be able to install DeepSpeed without encountering the async_io error.
However, even with the libaio development files installed, running DeepSpeed on Windows can be challenging, since DeepSpeed is optimized for Linux environments and relies on many Linux-specific features. Therefore, the best way to run DeepSpeed on Windows is to use the Windows Subsystem for Linux (WSL) or WSL2, which provide a more seamless experience.
WSL2 is the preferred option, since it provides a full Linux kernel and supports GPU acceleration through the DirectX 12 backend. With WSL2, you can install a Linux distribution like Ubuntu or Debian and use it to run DeepSpeed and other machine learning libraries without any compatibility issues. This provides a much better experience than trying to run DeepSpeed on a Windows CPU, which can be slow and may not support all the features of the library.
To review: if you encounter the "Unable to pre-compile async_io" error when installing DeepSpeed on Windows, you can try installing the libaio development files using a package manager like Cygwin. However, the best way to run DeepSpeed on Windows is to use the Windows Subsystem for Linux (WSL) or WSL2, which provide a Linux-like environment that is optimized for machine learning and provides a seamless experience.
If you must have your way with DeepSpeed on Windows, you'll likely need to fork TensorFlow and its dependencies and revise it to provide CUDA support on Windows past version 2.1. Good luck. Maybe build a model on Linux and have it guide you through this process. I think what it comes down to is projected use: these large language models are most often going to be run on servers, servers which are most often Linux based, due to the pricing constraints of Windows, and open-source developer contributions. To invest in supporting Windows (server) for the sake of satisfying some hobbyists desire to run deep learning natively on windows, would be a fool's errand. Until TensorFlow > 2.1 supports windows natively, you'll need to use WSL or WSL2. There is some irony there, but keep in mind, Microsoft has a vested interest Ubuntu Linux and works closely with Canonical and the Ubuntu community. They are just as much a Linux company now as they are a Windows company.
https://www.tensorflow.org/install/pip#windows-native
a quick workaround is force BUILD_OP_PLATFORM = 0 in setup.py: BUILD_OP_PLATFORM = 1 if sys.platform == "win32" else 0
solves "AssertionError: Unable to pre-compile async_io" under windows
Async_io isn't supported on Windows without using WSL to install this. If you are on Windows, then you will want to install DeepSpeed with DS_BUILD_AIO=0 pip install deepspeed since this will not install that op on your system.
Closing this for now, since there's nothing DeepSpeed can do for this, and the ds_report should list that this is an unsupported op on Windows.
Why are you closing this WITHOUT taking the installer for Windows off your home page? And without telling all the companies using your API or imbedding DeepSpeed into THEIR Windows workable applications so they can do what you won't! They can find a replacement for DeepSpeed from a partner that DOES TRUELY support Windows!
Excuse me. If you don’t understand WSL and Linux, what business do you have using DeepSpeed?
On Sun, Aug 20, 2023 at 3:10 PM Paul Paradise @.***> wrote:
Why are you closing this WITHOUT taking the installer for Windows off your home page? And without telling all the companies using your API or imbedding DeepSpeed into THEIR Windows workable applications so they can do what you won't! They can find a replacement for DeepSpeed from a partner that DOES TRUELY support Windows!
— Reply to this email directly, view it on GitHub https://github.com/microsoft/DeepSpeed/issues/1769#issuecomment-1685380194, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXJ72IXHMEWPBRZTTIQIW3XWJVM5ANCNFSM5OKT4LPQ . You are receiving this because you commented.Message ID: @.***>
When you install the lastest version(0.3.16), it works on the Windows System.
I've met the same problem even on Linux😓, bothering me for 2 weeks!😭 But I can't find any solution...
@LordEdison - if you are hitting an async io issue on Linux, you'll have a different issue than the main issue here on Windows. If so, can you please open a new issue and link this one? Thanks!
+1, useless for windows as there is no way to build it normally.
Tried on WSL2, everything worked till installation but unable to build the model pipeline, even for a small model like OPT125m
Hello, I think I have your solution, though you're not going to like it.
The "Unable to pre-compile async_io" error can occur when installing DeepSpeed on Windows, and is usually caused by a missing dependency. Specifically, the async_io module used by DeepSpeed requires the libaio development files to be installed on the system. On Linux systems, these files are typically installed by default, but on Windows they need to be installed manually.
To resolve this issue, you can try installing the libaio development files on your Windows system using a package manager like Cygwin. Cygwin provides a Linux-like environment on Windows and includes a package for libaio-dev that you can install using the Cygwin installer. Once you have installed the libaio-dev package, you should be able to install DeepSpeed without encountering the async_io error.
However, even with the libaio development files installed, running DeepSpeed on Windows can be challenging, since DeepSpeed is optimized for Linux environments and relies on many Linux-specific features. Therefore, the best way to run DeepSpeed on Windows is to use the Windows Subsystem for Linux (WSL) or WSL2, which provide a more seamless experience.
WSL2 is the preferred option, since it provides a full Linux kernel and supports GPU acceleration through the DirectX 12 backend. With WSL2, you can install a Linux distribution like Ubuntu or Debian and use it to run DeepSpeed and other machine learning libraries without any compatibility issues. This provides a much better experience than trying to run DeepSpeed on a Windows CPU, which can be slow and may not support all the features of the library.
To review: if you encounter the "Unable to pre-compile async_io" error when installing DeepSpeed on Windows, you can try installing the libaio development files using a package manager like Cygwin. However, the best way to run DeepSpeed on Windows is to use the Windows Subsystem for Linux (WSL) or WSL2, which provide a Linux-like environment that is optimized for machine learning and provides a seamless experience.
If you must have your way with DeepSpeed on Windows, you'll likely need to fork TensorFlow and its dependencies and revise it to provide CUDA support on Windows past version 2.1. Good luck. Maybe build a model on Linux and have it guide you through this process. I think what it comes down to is projected use: these large language models are most often going to be run on servers, servers which are most often Linux based, due to the pricing constraints of Windows, and open-source developer contributions. To invest in supporting Windows (server) for the sake of satisfying some hobbyists desire to run deep learning natively on windows, would be a fool's errand. Until TensorFlow > 2.1 supports windows natively, you'll need to use WSL or WSL2. There is some irony there, but keep in mind, Microsoft has a vested interest Ubuntu Linux and works closely with Canonical and the Ubuntu community. They are just as much a Linux company now as they are a Windows company.
https://www.tensorflow.org/install/pip#windows-native
**alright **
When you install the lastest version(0.3.16), it works on the Windows System.
Holy cow, it worked :D :D :D
When you install the lastest version(0.3.16), it works on the Windows System.
Used
pip install deepspeed==0.3.16
And yes, it's really working, thanks bro
@Skala05reg - I believe they are referring to the latest async_io version. 0.3.16 is not the latest version of DeepSpeed, and is from April 2021.
Makes sense Microsoft makes something that won't work in windows.
When you install the lastest version(0.3.16), it works on the Windows System.
Used
pip install deepspeed==0.3.16And yes, it's really working, thanks bro
very good
Kind of embarrassing the official install instructions is just "build it from scratch" and no mention that v0.3.16 installs fine on windows machines.
Hi @lewiswatson55 - older versions may work but lack newer features and support. If 0.3.16 (~3 years old) is sufficient for your needs, that's great. We are working on improving DeepSpeed on Windows. Currently, there is a batch file that can be used to build a wheel locally to be installed, and soon we should publish official Windows wheels on PyPI.