33set " VER_PYTORCH = v2.1.0"
44set " VER_TORCHVISION = v0.16.0"
55set " VER_TORCHAUDIO = v2.1.0"
6- set " VER_IPEX = v2 .1.10+xpu "
6+ set " VER_IPEX = release/xpu/2 .1.20 "
77
88if " %~2 " == " " (
99 echo Usage: %~nx0 ^ < DPCPPROOT^ > ^ < MKLROOT^ > [AOT]
@@ -31,14 +31,6 @@ if NOT EXIST "%ONEMKL_ENV%" (
3131 exit /b 3
3232)
3333
34- rem Check existence of required Windows commands
35- for %%A in (python git curl 7z) do (
36- where %%A > nul 2 >& 1 || (
37- echo Error: Command " %%A " not found.
38- exit /b 4
39- )
40- )
41-
4234rem Save current directory path
4335set " BASEFOLDER = %~dp0 "
4436cd " %BASEFOLDER% "
@@ -47,7 +39,7 @@ rem Be verbose now
4739echo on
4840
4941rem Install Python dependencies
50- python -m pip install cmake astunparse numpy ninja pyyaml mkl-include setuptools cffi typing_extensions future six requests dataclasses Pillow
42+ python -m pip install cmake astunparse numpy ninja pyyaml setuptools cffi typing_extensions future six requests dataclasses Pillow
5143
5244rem Checkout individual components
5345if NOT EXIST pytorch (
@@ -123,23 +115,18 @@ rem Compile individual component
123115
124116rem PyTorch
125117cd ..\pytorch
126-
127- rem Download MKL files
128- echo :: NOTE: Downloading MKL file from https://s3.amazonaws.com/ossci-windows/mkl_2020.2.254.7z
129- curl https://s3.amazonaws.com/ossci-windows/mkl_2020.2.254.7z -k -O
130- 7z x -aoa mkl_2020.2.254.7z -omkl
131-
132118for %%f in (" ..\intel-extension-for-pytorch\torch_patches\*.patch" ) do git apply " %%f "
133119python -m pip install -r requirements.txt
134- call conda install -q --yes -c conda-forge libuv=1.39
120+ call conda install --force-reinstall intel::mkl-static intel::mkl-include -y
121+ call conda install conda-forge::libuv -y
135122rem Ensure cmake can find python packages when using conda or virtualenv
136123if defined CONDA_PREFIX (
137124 set " CMAKE_PREFIX_PATH = %CONDA_PREFIX% "
138125) else if defined VIRTUAL_ENV (
139126 set " CMAKE_PREFIX_PATH = %VIRTUAL_ENV% "
140127)
141- set " CMAKE_INCLUDE_PATH = %cd% \mkl \include"
142- set " LIB = %cd% \mkl \lib;%LIB% "
128+ set " CMAKE_INCLUDE_PATH = %CONDA_PREFIX% \Library \include"
129+ set " LIB = %CONDA_PREFIX% \Library \lib;%LIB% "
143130set " USE_NUMA = 0"
144131set " USE_CUDA = 0"
145132python setup.py clean
@@ -150,21 +137,20 @@ set "USE_NUMA="
150137set " LIB = "
151138set " CMAKE_INCLUDE_PATH = "
152139set " CMAKE_PREFIX_PATH = "
153- python -m pip uninstall -y mkl-include
140+ call conda remove mkl-static mkl-include -y
154141for %%f in (" dist\*.whl" ) do python -m pip install --force-reinstall --no-deps " %%f "
155142
156- call " %DPCPP_ENV% "
157- call " %ONEMKL_ENV% "
158-
159143rem TorchVision
160144cd ..\vision
161- set " DISTUTILS_USE_SDK = 1 "
145+ call conda install -y --force-reinstall libpng libjpeg-turbo -c conda-forge
162146python setup.py clean
163147python setup.py bdist_wheel
164148
165- set " DISTUTILS_USE_SDK = "
166149for %%f in (" dist\*.whl" ) do python -m pip install --force-reinstall --no-deps " %%f "
167150
151+ call " %DPCPP_ENV% "
152+ call " %ONEMKL_ENV% "
153+
168154rem TorchAudio
169155cd ..\audio
170156python -m pip install -r requirements.txt
@@ -184,11 +170,9 @@ if NOT "%AOT%"=="" (
184170set " BUILD_WITH_CPU = 0"
185171set " USE_MULTI_CONTEXT = 1"
186172set " DISTUTILS_USE_SDK = 1"
187- set " CMAKE_CXX_COMPILER = icx"
188173python setup.py clean
189174python setup.py bdist_wheel
190175
191- set " CMAKE_CXX_COMPILER = "
192176set " DISTUTILS_USE_SDK = "
193177set " USE_MULTI_CONTEXT = "
194178set " BUILD_WITH_CPU = "
0 commit comments