-
Notifications
You must be signed in to change notification settings - Fork 23k
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
PyTorch 2.0 not working on Windows #90768
Comments
|
@malfet speaking of the redundant dynamo I removed it from our main getting started blogs here pytorch/pytorch.github.io#1241 - for whatever reason though the doc build did not update @svekars |
PyTorch version: 2.0.0.dev20230104+cu117 |
py_cpuinfo works with 11 and gets rid of the lscpu flag when trying to install deepspeed in windows via pip. There's also a hacked together version of triton 2.0.0 some russian made I was able to use to make a working whl from |
Can't install it on windows PS D:> pip3 install numpy --pre torch --force-reinstall --index-url https://download.pytorch.org/whl/nightly/cu117 python version 3.9 (can't upgrade it, since it is the maximum version working with the last pytorch) |
I think for this you can install numpy separately and then repeat the command without numpy in it. If you look in the url under numpy there's no windows binaries provided. |
After researching a bit, the real problem is that Triton, which is the main compiler in torch 2.0, has no windows support. It is under development, in previous versions it had support, now it hasn't, I'll just wait. |
When I configured everything in Windows, I received this error:
I want to know if it can run on Windows 11 + troch2.0 + cuda118 🤯 |
Greetings! |
Any plans to make torch.compile available on Windows? |
Hi @Jerry-Master, I attempted to reproduce this issue but was unable to encounter it. It appears that the problem may have been resolved. If you are still encountering the same problem, please provide me with more details or steps to reproduce. |
I have the same issue using this code: import torch
import warnings
gpu_ok = False
if torch.cuda.is_available():
device_cap = torch.cuda.get_device_capability()
if device_cap in ((7, 0), (8, 0), (9, 0)):
gpu_ok = True
if not gpu_ok:
warnings.warn(
"GPU is not NVIDIA V100, A100, or H100. Speedup numbers may be lower "
"than expected."
) def foo(x, y):
a = torch.sin(x)
b = torch.cos(y)
return a + b
opt_foo1 = torch.compile(foo)
print(opt_foo1(torch.randn(10, 10), torch.randn(10, 10)))
Torch version: torch.__version__
Python version: from platform import python_version
print(python_version())
OS version + machine: import platform
print(platform.platform())
print(platform.machine())
I have already tried different Python versions (3.10.9, 3.11.4) and also Also linking this issue: #86566 |
Yep, torch.compile still doesn't seem to work on 2.0.1+cu118 / Windows. Any updates? |
Are there any updates from PyTorch team on this? When can we expect Windows support? |
Referring this discussion about the triton windows support issue as well: triton-lang/triton#1640 |
main branch has not been tested yet but, v210, v211 have been tested |
pip install --upgrade torch torchvision --index-url https://download.pytorch.org/whl/cu121 |
@Ken1256 This is just a draft, it has not been merged. @wkpark Do you have any like step to step guide how to make this happen and how to use it via Torch.Compile. I mean just a simple decorator example for how to use it, so we might test it out. Or perhaps it will get merged in a few weeks perhaps? |
The same problem on Windows 11 + troch2.1.1 + cuda118+py3.10: |
wkpark#1 has been updated to work with the latest triton(+with win32 fix)
|
Can you upload wheels for python 3.11 + cuda121? |
If you have some time you can test the latest triton (python 3.11+cuda121) + pytorch there are no direct wheel links but you can download patched triton wheels at https://github.com/wkpark/triton/actions/runs/7246431088 (also found at triton-lang/triton#2738 )
diff --git a/torch/_dynamo/eval_frame.py b/torch/_dynamo/eval_frame.py
index 251dd6d1c32..9349fdc62a5 100644
--- a/torch/_dynamo/eval_frame.py
+++ b/torch/_dynamo/eval_frame.py
@@ -531,8 +531,8 @@ class _NullDecorator(contextlib.nullcontext): # type: ignore[type-arg]
def check_if_dynamo_supported():
- if sys.platform == "win32":
- raise RuntimeError("Windows not yet supported for torch.compile")
+ #if sys.platform == "win32":
+ # raise RuntimeError("Windows not yet supported for torch.compile")
if sys.version_info >= (3, 12):
raise RuntimeError("Python 3.12+ not yet supported for torch.compile") |
with out x64 Native Tools Command Prompt for VS 2022 with x64 Native Tools Command Prompt for VS 2022
|
I guess, I've missed some fix. Please set or add wkpark@ee55add fix. |
still RuntimeError: Failed to find C compiler. Please specify via CC environment variable.
|
did you succeed to run |
some tests under >cl
Microsoft (R) C/C++ 최적화 컴파일러 버전 19.34.31937(x64)
Copyright (c) Microsoft Corporation. All rights reserved.
사용법: cl [ option... ] filename... [ /link linkoption... ]
>clang --version
clang version 18.0.0 (https://github.com/llvm/llvm-project 5e5a22caf88ac1ccfa8dc5720295fdeba0ad9372)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
>clang-cl --version
clang version 18.0.0 (https://github.com/llvm/llvm-project 5e5a22caf88ac1ccfa8dc5720295fdeba0ad9372)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
>pip install hypothesis expecttest pytest # install some modules
>cd pytorch\test
>python -m pytest distributed\_tensor\test_dtensor_compile.py
================================================================================== test session starts ===================================================================================
platform win32 -- Python 3.10.11, pytest-7.4.2, pluggy-1.3.0
rootdir: D:\src\pytorch
configfile: pytest.ini
plugins: anyio-3.7.1, hydra-core-1.3.2, hypothesis-6.93.0, xdist-3.5.0
collected 10 items
distributed\_tensor\test_dtensor_compile.py ....In file included from C:\Users\WK\AppData\Local\Temp\tmp7uz995_y\main.c:4:
In file included from C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\Include\Python.h:118:
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\Include\cpython/pytime.h:120:59: warning: declaration of 'struct timeval' will not be
visible outside of this function [-Wvisibility]
120 | PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
| ^
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\Include\cpython/pytime.h:127:12: warning: declaration of 'struct timeval' will not be
visible outside of this function [-Wvisibility]
127 | struct timeval *tv,
| ^
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\Include\cpython/pytime.h:132:12: warning: declaration of 'struct timeval' will not be
visible outside of this function [-Wvisibility]
132 | struct timeval *tv,
| ^
C:\Users\WK\AppData\Local\Temp\tmp7uz995_y\main.c:20:7: warning: 'strcat' is deprecated: This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations]
....(snip)
F:\webui\webui\stable-diffusion-webui\venv\lib\site-packages\torch\distributed\_functional_collectives_impl.py:101: UserWarning: Trying to register finalizer to AsyncCollectiveTensor but the inner tensor is already gone
warnings.warn(
F:\webui\webui\stable-diffusion-webui\venv\lib\site-packages\torch\distributed\_functional_collectives_impl.py:101: UserWarning: Trying to register finalizer to AsyncCollectiveTensor but the inner tensor is already gone
warnings.warn(
[rank1]:[2024-01-14 15:09:25,284] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank3]:[2024-01-14 15:09:25,284] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank2]:[2024-01-14 15:09:25,285] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank0]:[2024-01-14 15:09:25,286] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
. [100%]
======================================================================== 7 passed, 3 skipped in 77.75s (0:01:17) ========================================================================= CC, CXX with clang >set CC=clang
>set CXX=clang++
>python -m pytest distributed\_tensor\test_dtensor_compile.py
================================================================================== test session starts ===================================================================================
platform win32 -- Python 3.10.11, pytest-7.4.2, pluggy-1.3.0
rootdir: D:\src\pytorch
configfile: pytest.ini
plugins: anyio-3.7.1, hydra-core-1.3.2, hypothesis-6.93.0, xdist-3.5.0
collected 10 items
distributed\_tensor\test_dtensor_compile.py .....sss
...
F:\webui\webui\stable-diffusion-webui\venv\lib\site-packages\torch\distributed\_functional_collectives_impl.py:101: UserWarning: Trying to register finalizer to AsyncCollectiveTensor but the inner tensor is already gone
warnings.warn(
F:\webui\webui\stable-diffusion-webui\venv\lib\site-packages\torch\distributed\_functional_collectives_impl.py:101: UserWarning: Trying to register finalizer to AsyncCollectiveTensor but the inner tensor is already gone
warnings.warn(
F:\webui\webui\stable-diffusion-webui\venv\lib\site-packages\torch\distributed\_functional_collectives_impl.py:101: UserWarning: Trying to register finalizer to AsyncCollectiveTensor but the inner tensor is already gone
warnings.warn(
[rank1]:[2024-01-14 15:11:08,763] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank0]:[2024-01-14 15:11:08,763] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank3]:[2024-01-14 15:11:08,763] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank2]:[2024-01-14 15:11:08,764] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
. [100%]
======================================================================== 7 passed, 3 skipped in 75.91s (0:01:15) ========================================================================= CC, CXX=clang-cl also works >CC=clang-cl
>CXX=clang-cl
>python -m pytest distributed\_tensor\test_dtensor_compile.py
================================================================================== test session starts ===================================================================================
platform win32 -- Python 3.10.11, pytest-7.4.2, pluggy-1.3.0
rootdir: D:\src\pytorch
configfile: pytest.ini
plugins: anyio-3.7.1, hydra-core-1.3.2, hypothesis-6.93.0, xdist-3.5.0
collected 10 items
distributed\_tensor\test_dtensor_compile.py .....sss
...
[rank3]:[2024-01-14 15:14:50,463] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank2]:[2024-01-14 15:14:50,465] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank1]:[2024-01-14 15:14:50,467] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
[rank0]:[2024-01-14 15:14:50,467] torch.distributed._functional_collectives_impl: [WARNING] ProcessGroupGloo does not support reduce_scatter, falling back with all reduce!
. [100%]
======================================================================== 7 passed, 3 skipped in 104.95s (0:01:44) ======================================================================== |
Pytorch is trying to reinvent the wheel that was originally invented in Tensorflow 1.x ? |
can someone explain to me i'm a bit new to this stuff. windows doesn't support torch.complie yet? |
Hello @Jerry-Master and everyone interested in torch.compile. I believe we can close this issue and follow this thread instead: #122094. I'd like you to know that in the latest nightly there is cpu-only torch.compile support |
Currently, pytorch Windows is begin to support pip install torch --index-url https://download.pytorch.org/whl/nightly/cu121 --force-reinstall |
This issue here has been posted months before than the one you have referenced. Actually #124245 should be closed as that is a duplicate of this original issue reported here. |
As long this does not work for CUDA, it's useless as your cannot use the advantages of
|
No, #124245 is using to track my progress. |
For triton status: triton-lang/triton#4045 (comment) |
🐛 Describe the bug
When I try installing the nightly build with the following command:
pip3 install numpy --pre torch[dynamo] --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cu117
It gives the following warning
WARNING: torch 2.0.0.dev20221213+cu117 does not provide the extra 'dynamo'
And when I try to check the installation with
This results in the following error
The torch installation is working but dynamo seems not to work. When I run the benchmarks from https://gist.github.com/Chillee/f86675147366a7a0c6e244eaa78660f7 I get the following
Which again shows that dynamo is not working. If I try installing torchdynamo apart, it gives this error
I am using Windows 10, with AMD64 processors (the wheels for python show win_amd64 at the end). I also use 2 NVIDIA RTX 3090 with CUDA 12.0.
Versions
Collecting environment information...
PyTorch version: 2.0.0.dev20221213+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A
OS: Microsoft Windows 10 Pro
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A
Python version: 3.8.15 (default, Nov 24 2022, 14:38:14) [MSC v.1916 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19045-SP0
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 526.86
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Versions of relevant libraries:
[pip3] numpy==1.24.0rc2
[pip3] torch==2.0.0.dev20221213+cu117
[conda] numpy 1.24.0rc2 pypi_0 pypi
[conda] torch 2.0.0.dev20221213+cu117 pypi_0 pypi
cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh
The text was updated successfully, but these errors were encountered: