diff --git a/.github/actions/inductor-xpu-e2e-test/action.yml b/.github/actions/inductor-xpu-e2e-test/action.yml index bcbcfbedd..f9084fe9b 100644 --- a/.github/actions/inductor-xpu-e2e-test/action.yml +++ b/.github/actions/inductor-xpu-e2e-test/action.yml @@ -41,7 +41,7 @@ runs: shell: bash run: | source activate e2e_ci - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh + source .github/scripts/env.sh if [[ ${{ inputs.suite }} == *"torchbench"* ]]; then cd ../ && rm -rf audio && git clone --single-branch -b main https://github.com/pytorch/audio.git cd audio && git checkout $TORCHAUDIO_COMMIT_ID @@ -78,9 +78,9 @@ runs: HUGGING_FACE_HUB_TOKEN: ${{ inputs.hf_token }} run: | source activate e2e_ci + source .github/scripts/env.sh cp .github/scripts/inductor_xpu_test.sh ../pytorch cd ../pytorch - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh # check param function contains() { contains_status="echo 'Start $2 ...'" diff --git a/.github/scripts/env.sh b/.github/scripts/env.sh new file mode 100644 index 000000000..ab7d7812d --- /dev/null +++ b/.github/scripts/env.sh @@ -0,0 +1,3 @@ +#!/bin/bash +source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh +source /opt/intel/oneapi/pti/latest/env/vars.sh diff --git a/.github/workflows/_linux_ut.yml b/.github/workflows/_linux_ut.yml index 6725d709e..0c35dc265 100644 --- a/.github/workflows/_linux_ut.yml +++ b/.github/workflows/_linux_ut.yml @@ -69,12 +69,11 @@ jobs: - name: Build Pytorch XPU run: | source activate xpu_op_${ZE_AFFINITY_MASK} + source .github/scripts/env.sh pip install mkl-static mkl-include cd ../pytorch pip install -r requirements.txt - export USE_XPU=1 - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh - export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} + export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${CONDA_PREFIX:-"$(dirname $(which conda))/../"} if [[ ${{ inputs.abi }} == '0' ]]; then export _GLIBCXX_USE_CXX11_ABI=0 else @@ -87,7 +86,7 @@ jobs: - name: Torch Config run: | source activate xpu_op_${ZE_AFFINITY_MASK} - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh + source .github/scripts/env.sh python -c "import torch; print(torch.__config__.show())" python -c "import torch; print(torch.__config__.parallel_info())" python -c "import torch; print(torch.__config__.torch.xpu.device_count())" @@ -96,7 +95,7 @@ jobs: run: | cd ${{ github.workspace }} xpu-smi discovery - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh + source .github/scripts/env.sh source activate xpu_op_${ZE_AFFINITY_MASK} cd ${{ github.workspace }} cd examples @@ -105,7 +104,7 @@ jobs: - name: Run XPU OP Extended UT if: contains(inputs.ut, 'op_extended') || github.event_name == 'schedule' run: | - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh + source .github/scripts/env.sh source activate xpu_op_${ZE_AFFINITY_MASK} export PYTORCH_TEST_WITH_SLOW=1 cd ../pytorch/third_party/torch-xpu-ops/test/xpu/extended/ @@ -113,7 +112,7 @@ jobs: - name: Run XPU OP UT if: contains(inputs.ut, 'op_ut') || github.event_name == 'schedule' run: | - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh + source .github/scripts/env.sh source activate xpu_op_${ZE_AFFINITY_MASK} export PYTORCH_ENABLE_XPU_FALLBACK=1 export PYTORCH_TEST_WITH_SLOW=1 @@ -127,7 +126,7 @@ jobs: - name: Run Torch XPU UT if: contains(inputs.ut, 'torch_xpu') || github.event_name == 'schedule' run: | - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh + source .github/scripts/env.sh source activate xpu_op_${ZE_AFFINITY_MASK} cd ../pytorch TEST_REPORTS_DIR=$(pwd)/test/test-reports diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 9fb6099e6..54fec51de 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -172,11 +172,10 @@ jobs: - name: Build Pytorch XPU run: | source activate e2e_ci + source .github/scripts/env.sh cd ../pytorch pip install -r requirements.txt - export USE_XPU=1 - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh - export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} + export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${CONDA_PREFIX:-"$(dirname $(which conda))/../"} python setup.py bdist_wheel pip install --force-reinstall dist/*.whl - name: Show GITHUB_ENV diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 3e8f9309a..45fdef513 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -79,11 +79,10 @@ jobs: - name: Build Pytorch XPU run: | source activate e2e_ci + source .github/scripts/env.sh cd ../pytorch pip install -r requirements.txt - export USE_XPU=1 - source /opt/intel/oneapi/pytorch-gpu-dev-0.5/oneapi-vars.sh - export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"} + export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${CONDA_PREFIX:-"$(dirname $(which conda))/../"} python setup.py bdist_wheel pip install --force-reinstall dist/*.whl - name: Identify pinned versions