Skip to content

Commit

Permalink
Update xpu wheel CD build (#1988)
Browse files Browse the repository at this point in the history
* Update xpu linux build with extra depencies

* Update xpu windows build with extra depencies
  • Loading branch information
chuanqi129 committed Sep 14, 2024
1 parent a6eef67 commit 6056720
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
30 changes: 29 additions & 1 deletion manywheel/build_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [[ "$GPU_ARCH_TYPE" == "xpu" ]]; then
# Refer https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpu/2-5.html
source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh
source /opt/intel/oneapi/pti/latest/env/vars.sh
export TORCH_XPU_ARCH_LIST=pvc,xe-lpg,ats-m150
export USE_STATIC_MKL=1
fi

WHEELHOUSE_DIR="wheelhouse$DIR_SUFFIX"
Expand Down Expand Up @@ -60,6 +60,34 @@ DEPS_SONAME=(
"libgomp.so.1"
)

if [[ "$GPU_ARCH_TYPE" == "xpu" ]]; then
echo "Bundling with xpu support package libs."
DEPS_LIST+=(
"/opt/intel/oneapi/compiler/latest/lib/libsycl-preview.so.7"
"/opt/intel/oneapi/compiler/latest/lib/libOpenCL.so.1"
"/opt/intel/oneapi/compiler/latest/lib/libxptifw.so"
"/opt/intel/oneapi/compiler/latest/lib/libsvml.so"
"/opt/intel/oneapi/compiler/latest/lib/libirng.so"
"/opt/intel/oneapi/compiler/latest/lib/libimf.so"
"/opt/intel/oneapi/compiler/latest/lib/libintlc.so.5"
"/opt/intel/oneapi/compiler/latest/lib/libpi_level_zero.so"
"/opt/intel/oneapi/pti/latest/lib/libpti_view.so.0.9"
"/opt/intel/oneapi/pti/latest/lib/libpti.so.0.9"
)
DEPS_SONAME+=(
"libsycl-preview.so.7"
"libOpenCL.so.1"
"libxptifw.so"
"libsvml.so"
"libirng.so"
"libimf.so"
"libintlc.so.5"
"libpi_level_zero.so"
"libpti_view.so.0.9"
"libpti.so.0.9"
)
fi

rm -rf /usr/local/cuda*

SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
Expand Down
13 changes: 13 additions & 0 deletions windows/internal/copy_xpu.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\common_clang64.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\intelocl64.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\libmmd.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\onnxruntime.1.12.22.721.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\pi_level_zero.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\pi_win_proxy_loader.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\svml_dispmd.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\compiler\latest\bin\sycl7.dll" pytorch\torch\lib
copy "%XPU_BUNDLE_ROOT%\tbb\latest\bin\tbb12.dll" pytorch\torch\lib

copy "%CONDA_LIB_PATH%\libiomp*5md.dll" pytorch\torch\lib
:: Should be set in build_pytorch.bat
copy "%libuv_ROOT%\bin\uv.dll" pytorch\torch\lib
14 changes: 8 additions & 6 deletions windows/xpu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ set USE_CUDA=0
call internal\check_opts.bat
IF ERRORLEVEL 1 goto :eof

if exist "%NIGHTLIES_PYTORCH_ROOT%" cd %NIGHTLIES_PYTORCH_ROOT%\..
call %~dp0\internal\copy_cpu.bat
IF ERRORLEVEL 1 goto :eof

echo Activate XPU Bundle env
set VS2022INSTALLDIR=%VS15INSTALLDIR%
call "%ProgramFiles(x86)%\Intel\oneAPI\setvars.bat"
set XPU_BUNDLE_ROOT=%ProgramFiles(x86)%\Intel\oneAPI
call "%XPU_BUNDLE_ROOT%\compiler\latest\env\vars.bat"
call "%XPU_BUNDLE_ROOT%\ocloc\latest\env\vars.bat"
IF ERRORLEVEL 1 goto :eof
set USE_KINETO=0

:: Workaround for https://github.com/pytorch/pytorch/issues/134989
set CMAKE_SHARED_LINKER_FLAGS=/FORCE:MULTIPLE
set CMAKE_MODULE_LINKER_FLAGS=/FORCE:MULTIPLE
set CMAKE_EXE_LINKER_FLAGS=/FORCE:MULTIPLE

if exist "%NIGHTLIES_PYTORCH_ROOT%" cd %NIGHTLIES_PYTORCH_ROOT%\..
call %~dp0\internal\copy_xpu.bat
IF ERRORLEVEL 1 goto :eof

call %~dp0\internal\setup.bat
IF ERRORLEVEL 1 goto :eof

0 comments on commit 6056720

Please sign in to comment.