Skip to content

Commit

Permalink
[CI] Add PTI source (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanqi129 authored Aug 8, 2024
1 parent 9162837 commit 20a5626
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/actions/inductor-xpu-e2e-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ...'"
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/env.sh
Original file line number Diff line number Diff line change
@@ -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
15 changes: 7 additions & 8 deletions .github/workflows/_linux_ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())"
Expand All @@ -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
Expand All @@ -105,15 +104,15 @@ 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/
timeout 10000 python run_test_with_skip.py
- 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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/nightly_ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20a5626

Please sign in to comment.