From 9a4ea4ed4b5d55608f474d60a429e7b5f7e49d57 Mon Sep 17 00:00:00 2001 From: "Wang, Chuanqi" Date: Thu, 21 Nov 2024 03:14:35 +0800 Subject: [PATCH] [XPU] Upgrade XPU support package version to 2025.0 (#5932) Depends on https://github.com/pytorch/builder/pull/2038 Works for https://github.com/pytorch/pytorch/issues/139722 and https://github.com/pytorch/pytorch/issues/114850 --- .github/scripts/install_xpu.bat | 63 +++++++++++++++------- .github/workflows/build_wheels_linux.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 + 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/.github/scripts/install_xpu.bat b/.github/scripts/install_xpu.bat index 11208580d5..c31276c0b5 100644 --- a/.github/scripts/install_xpu.bat +++ b/.github/scripts/install_xpu.bat @@ -1,6 +1,6 @@ @echo on REM Description: Install Intel Support Packages on Windows -REM BKM reference: https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpu/2-5.html +REM BKM reference: https://www.intel.com/content/www/us/en/developer/articles/tool/pytorch-prerequisites-for-intel-gpus.html set XPU_INSTALL_MODE=%~1 if "%XPU_INSTALL_MODE%"=="" goto xpu_bundle_install_start @@ -28,15 +28,28 @@ if "%XPU_INSTALL_MODE%"=="driver" goto xpu_install_end set XPU_BUNDLE_PARENT_DIR=C:\Program Files (x86)\Intel\oneAPI set XPU_BUNDLE_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/9d1a91e2-e8b8-40a5-8c7f-5db768a6a60c/w_intel-for-pytorch-gpu-dev_p_0.5.3.37_offline.exe -set XPU_PTI_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/9d1a91e2-e8b8-40a5-8c7f-5db768a6a60c/w_intel-pti-dev_p_0.9.0.37_offline.exe -set XPU_BUNDLE_VERSION=0.5.3+31 -set XPU_PTI_VERSION=0.9.0+36 set XPU_BUNDLE_PRODUCT_NAME=intel.oneapi.win.intel-for-pytorch-gpu-dev.product -set XPU_PTI_PRODUCT_NAME=intel.oneapi.win.intel-pti-dev.product +set XPU_BUNDLE_VERSION=0.5.3+31 set XPU_BUNDLE_INSTALLED=0 -set XPU_PTI_INSTALLED=0 set XPU_BUNDLE_UNINSTALL=0 -set XPU_PTI_UNINSTALL=0 +set XPU_EXTRA_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/9d1a91e2-e8b8-40a5-8c7f-5db768a6a60c/w_intel-pti-dev_p_0.9.0.37_offline.exe +set XPU_EXTRA_PRODUCT_NAME=intel.oneapi.win.intel-pti-dev.product +set XPU_EXTRA_VERSION=0.9.0+36 +set XPU_EXTRA_INSTALLED=0 +set XPU_EXTRA_UNINSTALL=0 + +if not [%XPU_VERSION%]==[] if [%XPU_VERSION%]==[2025.0] ( + set XPU_BUNDLE_URL=https://registrationcenter-download.intel.com/akdlm/IRC_NAS/efc86abd-cb77-452e-a03f-a741895b8ece/intel-deep-learning-essentials-2025.0.0.336_offline.exe + set XPU_BUNDLE_PRODUCT_NAME=intel.oneapi.win.deep-learning-essentials.product + set XPU_BUNDLE_VERSION=2025.0.0+335 + set XPU_BUNDLE_INSTALLED=0 + set XPU_BUNDLE_UNINSTALL=0 + set XPU_EXTRA_URL=NULL + set XPU_EXTRA_PRODUCT_NAME=intel.oneapi.win.compiler.product + set XPU_EXTRA_VERSION=2025.0.1+1226 + set XPU_EXTRA_INSTALLED=0 + set XPU_EXTRA_UNINSTALL=0 +) :: Check if XPU bundle is target version or already installed if exist "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" goto xpu_bundle_ver_check @@ -51,25 +64,34 @@ for /f "tokens=1,2" %%a in (xpu_bundle_installed_ver.log) do ( echo %%a Installed Version: %%b set XPU_BUNDLE_INSTALLED=1 if not "%XPU_BUNDLE_VERSION%"=="%%b" ( - start /wait "Installer Title" "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --action=remove --eula=accept --silent --product-id %XPU_BUNDLE_PRODUCT_NAME% --product-ver %%b --log-dir uninstall_bundle + start /wait "Installer Title" "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --action=remove --eula=accept --silent --product-id %%a --product-ver %%b --log-dir uninstall_bundle set XPU_BUNDLE_UNINSTALL=1 ) ) - if "%%a"=="%XPU_PTI_PRODUCT_NAME%" ( + if "%%a"=="%XPU_EXTRA_PRODUCT_NAME%" ( echo %%a Installed Version: %%b - set XPU_PTI_INSTALLED=1 - if not "%XPU_PTI_VERSION%"=="%%b" ( - start /wait "Installer Title" "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --action=remove --eula=accept --silent --product-id %XPU_PTI_PRODUCT_NAME% --product-ver %%b --log-dir uninstall_bundle - set XPU_PTI_UNINSTALL=1 + set XPU_EXTRA_INSTALLED=1 + if not "%XPU_EXTRA_VERSION%"=="%%b" ( + start /wait "Installer Title" "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --action=remove --eula=accept --silent --product-id %%a --product-ver %%b --log-dir uninstall_bundle + set XPU_EXTRA_UNINSTALL=1 ) ) + if not "%%b" == "Version" if not [%%b]==[] if not "%%a"=="%XPU_BUNDLE_PRODUCT_NAME%" if not "%%a"=="%XPU_EXTRA_PRODUCT_NAME%" ( + echo "Uninstalling...." + start /wait "Installer Title" "%XPU_BUNDLE_PARENT_DIR%\Installer\installer.exe" --action=remove --eula=accept --silent --product-id %%a --product-ver %%b --log-dir uninstall_bundle + ) ) if errorlevel 1 exit /b 1 if exist xpu_bundle_installed_ver.log del xpu_bundle_installed_ver.log +if exist uninstall_bundle rmdir /s /q uninstall_bundle if "%XPU_BUNDLE_INSTALLED%"=="0" goto xpu_bundle_install if "%XPU_BUNDLE_UNINSTALL%"=="1" goto xpu_bundle_install -if "%XPU_PTI_INSTALLED%"=="0" goto xpu_pti_install -if "%XPU_PTI_UNINSTALL%"=="1" goto xpu_pti_install + +:xpu_extra_check + +if "%XPU_EXTRA_URL%"=="NULL" goto xpu_install_end +if "%XPU_EXTRA_INSTALLED%"=="0" goto xpu_extra_install +if "%XPU_EXTRA_UNINSTALL%"=="1" goto xpu_extra_install goto xpu_install_end :xpu_bundle_install @@ -79,13 +101,14 @@ echo "XPU Bundle installing..." start /wait "Intel Pytorch Bundle Installer" "xpu_bundle.exe" --action=install --eula=accept --silent --log-dir install_bundle if errorlevel 1 exit /b 1 del xpu_bundle.exe +goto xpu_extra_check -:xpu_pti_install +:xpu_extra_install -curl -o xpu_pti.exe --retry 3 --retry-all-errors -k %XPU_PTI_URL% -echo "XPU PTI installing..." -start /wait "Intel PTI Installer" "xpu_pti.exe" --action=install --eula=accept --silent --log-dir install_bundle +curl -o xpu_extra.exe --retry 3 --retry-all-errors -k %XPU_EXTRA_URL% +echo "Intel XPU EXTRA installing..." +start /wait "Intel XPU EXTRA Installer" "xpu_extra.exe" --action=install --eula=accept --silent --log-dir install_bundle if errorlevel 1 exit /b 1 -del xpu_pti.exe +del xpu_extra.exe :xpu_install_end diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 2813ef1e19..0d91d104c1 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -200,7 +200,7 @@ jobs: run: | { echo "set +u" - echo "source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh" + echo "source /opt/intel/oneapi/compiler/latest/env/vars.sh" echo "source /opt/intel/oneapi/pti/latest/env/vars.sh" } >> "${BUILD_ENV_FILE}" - name: Install torch dependency diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 7dd9118dca..974d193c0a 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -127,6 +127,8 @@ jobs: arch: ${{ env.ARCH }} - name: Install XPU support package if: ${{ matrix.gpu_arch_type == 'xpu' }} + env: + XPU_VERSION: '2025.0' run: | cmd //c .\\test-infra\\.github\\scripts\\install_xpu.bat - name: Install torch dependency