Skip to content

Commit 44c35bc

Browse files
authored
[Windows] [RC] update compile_bundle.bat (#3853)
* cherry-pick update windows compile_bundle.bat
1 parent d2589e5 commit 44c35bc

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

scripts/compile_bundle.bat

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set "VER_PYTORCH=v2.1.0"
44
set "VER_TORCHVISION=v0.16.0"
55
set "VER_TORCHAUDIO=v2.1.0"
6-
set "VER_IPEX=v2.1.10+xpu"
6+
set "VER_IPEX=release/xpu/2.1.20"
77

88
if "%~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-
4234
rem Save current directory path
4335
set "BASEFOLDER=%~dp0"
4436
cd "%BASEFOLDER%"
@@ -47,7 +39,7 @@ rem Be verbose now
4739
echo on
4840

4941
rem 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

5244
rem Checkout individual components
5345
if NOT EXIST pytorch (
@@ -123,23 +115,18 @@ rem Compile individual component
123115

124116
rem PyTorch
125117
cd ..\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-
132118
for %%f in ("..\intel-extension-for-pytorch\torch_patches\*.patch") do git apply "%%f"
133119
python -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
135122
rem Ensure cmake can find python packages when using conda or virtualenv
136123
if 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%"
143130
set "USE_NUMA=0"
144131
set "USE_CUDA=0"
145132
python setup.py clean
@@ -150,21 +137,20 @@ set "USE_NUMA="
150137
set "LIB="
151138
set "CMAKE_INCLUDE_PATH="
152139
set "CMAKE_PREFIX_PATH="
153-
python -m pip uninstall -y mkl-include
140+
call conda remove mkl-static mkl-include -y
154141
for %%f in ("dist\*.whl") do python -m pip install --force-reinstall --no-deps "%%f"
155142

156-
call "%DPCPP_ENV%"
157-
call "%ONEMKL_ENV%"
158-
159143
rem TorchVision
160144
cd ..\vision
161-
set "DISTUTILS_USE_SDK=1"
145+
call conda install -y --force-reinstall libpng libjpeg-turbo -c conda-forge
162146
python setup.py clean
163147
python setup.py bdist_wheel
164148

165-
set "DISTUTILS_USE_SDK="
166149
for %%f in ("dist\*.whl") do python -m pip install --force-reinstall --no-deps "%%f"
167150

151+
call "%DPCPP_ENV%"
152+
call "%ONEMKL_ENV%"
153+
168154
rem TorchAudio
169155
cd ..\audio
170156
python -m pip install -r requirements.txt
@@ -184,11 +170,9 @@ if NOT "%AOT%"=="" (
184170
set "BUILD_WITH_CPU=0"
185171
set "USE_MULTI_CONTEXT=1"
186172
set "DISTUTILS_USE_SDK=1"
187-
set "CMAKE_CXX_COMPILER=icx"
188173
python setup.py clean
189174
python setup.py bdist_wheel
190175

191-
set "CMAKE_CXX_COMPILER="
192176
set "DISTUTILS_USE_SDK="
193177
set "USE_MULTI_CONTEXT="
194178
set "BUILD_WITH_CPU="

0 commit comments

Comments
 (0)