From 5e08e996c0689306fae69718cebf70a0211da06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Tue, 18 Jun 2024 09:38:36 +0200 Subject: [PATCH] Add Mkl on windows --- .github/actions/deploy-windows/action.yml | 8 ++++---- .github/workflows/mkl.yml | 1 + .github/workflows/pytorch.yml | 1 + pytorch/cppbuild.sh | 4 ++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/actions/deploy-windows/action.yml b/.github/actions/deploy-windows/action.yml index 8ebe1055cd0..8943c9c0863 100644 --- a/.github/actions/deploy-windows/action.yml +++ b/.github/actions/deploy-windows/action.yml @@ -29,9 +29,9 @@ runs: rm "C:/msys64/mingw32/bin/clang-cl.exe" "C:/msys64/mingw64/bin/clang-cl.exe" "C:/msys64/mingw32/bin/cmake.exe" "C:/msys64/mingw64/bin/cmake.exe" rm "C:/Strawberry/c/lib/libz.a" "C:/Strawberry/c/lib/libzlib.a" "C:/Strawberry/c/lib/libzdll.a" "C:/Strawberry/c/bin/cmake.exe" - curl -LO https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-win64-x64.msi - msiexec /i cmake-3.26.4-win64-x64.msi /qn - rm cmake-3.26.4-win64-x64.msi + #curl -LO https://github.com/Kitware/CMake/releases/download/v3.30.0-rc3/cmake-3.30.0-rc3-win64-x64.msi + #msiexec /i cmake-3.30.0-rc3-win64-x64.msi /qn + #rm cmake-3.30.0-rc3-win64-x64.msi curl -LO https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz bash -c "tar -xzf apache-maven-3.6.3-bin.tar.gz -C 'C:/Program Files/'" @@ -159,7 +159,7 @@ runs: move TensorRT-10.0.1.6 "%ProgramFiles%\NVIDIA GPU Computing Toolkit\TensorRT" ) - if "%CI_DEPLOY_MODULE%"=="mkl" ( + if not "%CI_DEPLOY_NEED_MKL%"=="" ( echo Installing MKL curl -LO https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b5a4ff98-2c98-4b28-87f7-32082cac359e/w_onemkl_p_2024.0.0.49672_offline.exe w_onemkl_p_2024.0.0.49672_offline.exe -s -a -s --eula accept diff --git a/.github/workflows/mkl.yml b/.github/workflows/mkl.yml index 9008cb80383..e438efe8133 100644 --- a/.github/workflows/mkl.yml +++ b/.github/workflows/mkl.yml @@ -16,6 +16,7 @@ env: CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }} STAGING_REPOSITORY: ${{ secrets.STAGING_REPOSITORY }} + CI_DEPLOY_NEED_MKL: 1 jobs: # linux-x86: # runs-on: ubuntu-20.04 diff --git a/.github/workflows/pytorch.yml b/.github/workflows/pytorch.yml index 283b37ba6e5..73300dac5fc 100644 --- a/.github/workflows/pytorch.yml +++ b/.github/workflows/pytorch.yml @@ -12,6 +12,7 @@ on: env: CI_DEPLOY_NEED_CACHE: 1 CI_DEPLOY_NEED_CUDA: 1 + CI_DEPLOY_NEED_MKL: 1 CI_DEPLOY_MODULE: ${{ github.workflow }} CI_DEPLOY_PLATFORM: ${{ github.job }} CI_DEPLOY_SETTINGS: ${{ secrets.CI_DEPLOY_SETTINGS }} diff --git a/pytorch/cppbuild.sh b/pytorch/cppbuild.sh index 9371111b254..bc306dfbca0 100755 --- a/pytorch/cppbuild.sh +++ b/pytorch/cppbuild.sh @@ -36,6 +36,7 @@ fi export PYTHON_BIN_PATH=$(which python3) if [[ $PLATFORM == windows* ]]; then export PYTHON_BIN_PATH=$(which python.exe) + export MKLProductDir="C:/Program Files (x86)/Intel/oneAPI" fi PYTORCH_VERSION=2.3.1 @@ -208,6 +209,9 @@ sedinplace 's/const std::string& interface)/const std::string\& interface_name)/ #USE_FBGEMM=0 USE_KINETO=0 USE_GLOO=0 USE_MKLDNN=0 \ "$PYTHON_BIN_PATH" setup.py build +echo "CMAKECACHE" +cat $BUILD_DIR/CMakeCache.txt + rm -Rf ../lib if [[ ! -e torch/include/gloo ]]; then ln -sf ../../third_party/gloo/gloo torch/include