pytorch / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
https://pytorch.org
Other
82.23k stars 22.12k forks source link

Pytorch XPU Windows build failed in cmake rerun loop due to the source code deep path #134956

Open chuanqi129 opened 2 weeks ago

chuanqi129 commented 2 weeks ago

šŸ› Describe the bug

When we follow below steps to build XPU pytorch wheel on Windows platform, if the pytorch source code path too long (>52 in total), the cmake will re-run 100 times and failed in the end.

Steps:

  1. install MSVC 2022
  2. install xpu support package by following https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpu/2-5.html
  3. Build
    set VS2022INSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community
    "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" 
    set USE_KINETO=0
    python setup.py bdist_wheel

With Ninja

ninja: error: manifest 'build.ninja' still dirty after 100 tries, perhaps system time is not set

Cmake only

CMake is re-running because generate.stamp is out-of-date.
Check the system timeā€¦

Versions

Collecting environment information...
PyTorch version: 2.5.0a0+git3f3774a
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Enterprise
GCC version: Could not collect
Clang version: Could not collect
CMake version: version 3.24.1
Libc version: N/A

Python version: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:29:51) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22631-SP0
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture=9
CurrentClockSpeed=2400
DeviceID=CPU0
Family=207
L2CacheSize=14336
L2CacheSpeed=
Manufacturer=GenuineIntel
MaxClockSpeed=2400
Name=12th Gen Intel(R) Core(TM) i9-12900
ProcessorType=3
Revision=

Versions of relevant libraries:
[pip3] numpy==2.1.0
[pip3] optree==0.12.1
[pip3] torch==2.5.0a0+git3f3774a
[conda] mkl-include               2024.2.1                 pypi_0    pypi
[conda] mkl-static                2024.2.1                 pypi_0    pypi
[conda] numpy                     2.1.0                    pypi_0    pypi
[conda] optree                    0.12.1                   pypi_0    pypi
[conda] torch                     2.5.0a0+git3f3774a          pypi_0    pypi

cc @gujinghui @EikanWang @fengyuan14 @guangyey

chuanqi129 commented 1 week ago

The current workaround is replace the long source code path to a short one.