Skip to content

Commit 40180c0

Browse files
committed
test env
1 parent c144bab commit 40180c0

File tree

5 files changed

+168
-317
lines changed

5 files changed

+168
-317
lines changed

.github/actions/get-runner/action.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,10 @@ runs:
1717
echo "test_group=$(getent group render |cut -d: -f3)" |tee -a ${GITHUB_OUTPUT}
1818
# show host info
1919
lscpu
20+
lshw -C display
2021
free -h
21-
cat /etc/os-release
22-
uname -a
23-
gcc -v && g++ -v
24-
source /opt/intel/oneapi/setvars.sh
25-
sycl-ls
26-
icpx -v
27-
dpkg -l |grep -E 'libigc-dev|libze-dev|level-zero-dev'
28-
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor |sort |uniq -c
2922
df -h
23+
cat /etc/os-release
3024
- name: Cleanup host
3125
if: ${{ always() }}
3226
shell: bash -xe {0}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Get Runner Infos
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
test_type:
7+
required: true
8+
type: string
9+
description: Test scope
10+
pytorch:
11+
type: string
12+
default: 'main'
13+
description: Pytorch main by default, or 'commit/branch', or 'repo@commit/repo@branch'
14+
torch_xpu_ops:
15+
type: string
16+
default: 'main'
17+
description: Torch-xpu-ops main by default, 'commit/branch', or 'repo@commit/repo@branch', or 'pinned' for pytorch pin
18+
oneapi:
19+
type: string
20+
default: 'installed'
21+
description: Installed oneAPI DLE on host by default, fill offline.sh url if needed
22+
python:
23+
type: string
24+
default: '3.10'
25+
description: Python version
26+
27+
permissions: read-all
28+
29+
runs:
30+
using: composite
31+
steps:
32+
- name: Setup gh
33+
uses: actions4gh/setup-gh@v1
34+
- name: Setup gcc
35+
uses: Dup4/actions-setup-gcc@v1
36+
with:
37+
version: 11
38+
- name: Setup python-${{ inputs.python }}
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: ${{ inputs.python }}
42+
- name: Check runner
43+
run: |
44+
ls -al
45+
find ./ |grep -v "^\./$" |xargs rm -rf
46+
hostname && whoami && id
47+
cat /etc/os-release
48+
gcc -v && g++ -v
49+
which python && which pip
50+
python -V
51+
pip install -U pip wheel setuptools
52+
pip list
53+
uname -a
54+
dpkg -l |grep -E 'libigc-dev|libze-dev|level-zero-dev'
55+
clinfo --list
56+
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor |sort |uniq -c
57+
- name: Checkout torch-xpu-ops
58+
uses: actions/checkout@v4
59+
with:
60+
path: torch-xpu-ops
61+
- name: Install oneAPI DLE
62+
if: ${{ inputs.oneapi != 'installed' }}
63+
run: |
64+
rm -rf ~/intel ~/.intel
65+
wget -q -O oneapi.sh "${{ inputs.oneapi }}"
66+
bash oneapi.sh -a -s --eula accept --action install --install-dir ${HOME}/intel/oneapi
67+
echo "XPU_ONEAPI_PATH=${HOME}/intel/oneapi" >> ${GITHUB_ENV}
68+
- name: Download Pytorch wheel
69+
if: ${{ ! contains(inputs.test_type, 'wheel') }}
70+
uses: actions/download-artifact@v4
71+
with:
72+
pattern: Torch-XPU-Wheel-*
73+
- name: Prepare Stock Pytorch
74+
run: |
75+
# install pytorch
76+
if [ $(echo "${{ inputs.pytorch }}" |grep -w "release_wheel" |wc -l) -ne 0 ];then
77+
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/xpu
78+
elif [ $(echo "${{ inputs.pytorch }}" |grep -w "test_wheel" |wc -l) -ne 0 ];then
79+
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/test/xpu
80+
elif [ $(echo "${{ inputs.pytorch }}" |grep -w "nightly_wheel" |wc -l) -ne 0 ];then
81+
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/nightly/xpu
82+
else
83+
pip install --force-reinstall ${{ github.workspace }}/*.whl
84+
fi
85+
TORCH_COMMIT_ID=$(python -c 'import torch; print(torch.version.git_version)')
86+
if [[ "${{ inputs.pytorch }}" == *"https://"* ]];then
87+
PYTORCH_REPO="$(echo ${{ inputs.pytorch }} |sed 's/@.*//')"
88+
else
89+
PYTORCH_REPO="https://github.com/pytorch/pytorch.git"
90+
fi
91+
git clone ${PYTORCH_REPO} pytorch
92+
cd pytorch
93+
git checkout ${TORCH_COMMIT_ID}
94+
pip install -r .ci/docker/requirements-ci.txt
95+
# apply extra PRs for stock pytorch
96+
if [[ "${{ inputs.test_type }}" == *"cicd"* ]];then
97+
python ../torch-xpu-ops/.github/scripts/apply_torch_pr.py -e https://github.com/pytorch/pytorch/pull/152940
98+
else
99+
python ../torch-xpu-ops/.github/scripts/apply_torch_pr.py
100+
fi
101+
git status && git diff && git show -s
102+
- name: Prepare Torch-xpu-ops
103+
if: ${{ inputs.torch_xpu_ops != 'skipped' }}
104+
run: |
105+
cd pytorch
106+
rm -rf third_party/torch-xpu-ops
107+
if [[ "${{ inputs.torch_xpu_ops }}" == *"https://"* ]];then
108+
TORCH_XPU_OPS_REPO="$(echo ${{ inputs.torch_xpu_ops }} |sed 's/@.*//')"
109+
TORCH_XPU_OPS_COMMIT="$(echo ${{ inputs.torch_xpu_ops }} |sed 's/.*@//')"
110+
else
111+
TORCH_XPU_OPS_REPO="https://github.com/intel/torch-xpu-ops.git"
112+
if [ "${{ inputs.torch_xpu_ops }}" == "pinned" ];then
113+
TORCH_XPU_OPS_COMMIT="$(cat third_party/xpu.txt)"
114+
else
115+
TORCH_XPU_OPS_COMMIT="${{ inputs.torch_xpu_ops }}"
116+
fi
117+
fi
118+
if [ "${{ inputs.test_type }}" == "cicd" ];then
119+
cp -r ${{ github.workspace }}/torch-xpu-ops third_party/torch-xpu-ops
120+
else
121+
git clone ${TORCH_XPU_OPS_REPO} third_party/torch-xpu-ops
122+
fi
123+
cd third_party/torch-xpu-ops
124+
git checkout ${TORCH_XPU_OPS_COMMIT}
125+
git status && git diff && git show -s
126+
- name: Torch Config
127+
run: |
128+
printenv
129+
python -c "import torch; print(torch.__config__.show())"
130+
python -c "import torch; print(torch.__config__.parallel_info())"
131+
python -c "import torch; print(torch.__config__.torch.xpu.device_count())"
132+
python -c "import torchvision; print(torchvision.__version__)"
133+
python -c "import torchaudio; print(torchaudio.__version__)"
134+
python -c "import triton; print(triton.__version__)"
135+
python pytorch/torch/utils/collect_env.py
136+
pip list |grep -E 'torch|intel'

.github/workflows/_linux_e2e.yml

Lines changed: 7 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -79,77 +79,14 @@ jobs:
7979
run:
8080
shell: bash -xe {0}
8181
steps:
82-
- name: Setup python-${{ inputs.python }}
83-
uses: actions/setup-python@v5
84-
with:
85-
python-version: ${{ inputs.python }}
86-
- name: Check runner
87-
run: |
88-
ls -al
89-
find ./ |grep -v "^\./$" |xargs rm -rf
90-
hostname && whoami && id
91-
clinfo --list
92-
gcc -v && g++ -v
93-
which python && which pip
94-
python -V
95-
pip install -U pip wheel setuptools
96-
pip list
97-
uname -a
98-
dpkg -l |grep -E 'libigc-dev|libze-dev|level-zero-dev'
99-
pip install pandas psutil scipy requests
100-
- name: Checkout torch-xpu-ops
101-
uses: actions/checkout@v4
102-
- name: Install oneAPI DLE
103-
if: ${{ inputs.oneapi != 'installed' }}
104-
run: |
105-
rm -rf ~/intel ~/.intel
106-
wget -q -O oneapi.sh "${{ inputs.oneapi }}"
107-
bash oneapi.sh -a -s --eula accept --action install --install-dir ${HOME}/intel/oneapi
108-
echo "XPU_ONEAPI_PATH=${HOME}/intel/oneapi" >> ${GITHUB_ENV}
109-
- name: Download Pytorch wheel
110-
if: ${{ ! contains(inputs.test_type, 'wheel') }}
111-
uses: actions/download-artifact@v4
82+
- name: Setup Test Env
83+
uses: .github/actions/setup-testenv
11284
with:
113-
pattern: Torch-XPU-Wheel-*
114-
- name: Prepare Stock Pytorch
115-
run: |
116-
# install pytorch
117-
if [ $(echo "${{ inputs.pytorch }}" |grep -w "release_wheel" |wc -l) -ne 0 ];then
118-
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/xpu
119-
elif [ $(echo "${{ inputs.pytorch }}" |grep -w "test_wheel" |wc -l) -ne 0 ];then
120-
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/test/xpu
121-
elif [ $(echo "${{ inputs.pytorch }}" |grep -w "nightly_wheel" |wc -l) -ne 0 ];then
122-
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/nightly/xpu
123-
else
124-
pip install --force-reinstall ${{ github.workspace }}/*.whl
125-
fi
126-
TORCH_COMMIT_ID=$(python -c 'import torch; print(torch.version.git_version)')
127-
if [[ "${{ inputs.pytorch }}" == *"https://"* ]];then
128-
PYTORCH_REPO="$(echo ${{ inputs.pytorch }} |sed 's/@.*//')"
129-
else
130-
PYTORCH_REPO="https://github.com/pytorch/pytorch.git"
131-
fi
132-
git clone ${PYTORCH_REPO} pytorch
133-
cd pytorch
134-
git checkout ${TORCH_COMMIT_ID}
135-
# apply extra PRs for stock pytorch
136-
if [[ "${{ inputs.test_type }}" == *"cicd"* ]];then
137-
python ../.github/scripts/apply_torch_pr.py -e https://github.com/pytorch/pytorch/pull/152940
138-
else
139-
python ../.github/scripts/apply_torch_pr.py
140-
fi
141-
git status && git diff && git show -s
142-
- name: Torch Config
143-
run: |
144-
printenv
145-
python -c "import torch; print(torch.__config__.show())"
146-
python -c "import torch; print(torch.__config__.parallel_info())"
147-
python -c "import torch; print(torch.__config__.torch.xpu.device_count())"
148-
python -c "import torchvision; print(torchvision.__version__)"
149-
python -c "import torchaudio; print(torchaudio.__version__)"
150-
python -c "import triton; print(triton.__version__)"
151-
python pytorch/torch/utils/collect_env.py
152-
pip list |grep -E 'torch|intel'
85+
test_type: ${{ inputs.test_type }}
86+
pytorch: ${{ inputs.pytorch }}
87+
torch_xpu_ops: skipped
88+
oneapi: ${{ inputs.oneapi }}
89+
python: ${{ inputs.python }}
15390

15491
# CICD launch
15592
- name: Nightly Huggingface BF16 & FP16 Training Test

.github/workflows/_linux_op_benchmark.yml

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -60,60 +60,14 @@ jobs:
6060
run:
6161
shell: bash -xe {0}
6262
steps:
63-
- name: Setup python-${{ inputs.python }}
64-
uses: actions/setup-python@v5
63+
- name: Setup Test Env
64+
uses: .github/actions/setup-testenv
6565
with:
66-
python-version: ${{ inputs.python }}
67-
- name: Check runner
68-
run: |
69-
ls -al
70-
find ./ |grep -v "^\./$" |xargs rm -rf
71-
hostname && whoami && id
72-
clinfo --list
73-
gcc -v && g++ -v
74-
which python && which pip
75-
python -V
76-
pip install -U pip wheel setuptools
77-
pip list
78-
uname -a
79-
dpkg -l |grep -E 'libigc-dev|libze-dev|level-zero-dev'
80-
pip install pandas psutil scipy requests
81-
- name: Checkout torch-xpu-ops
82-
uses: actions/checkout@v4
83-
- name: Install oneAPI DLE
84-
if: ${{ inputs.oneapi != 'installed' }}
85-
run: |
86-
rm -rf ~/intel ~/.intel
87-
wget -q -O oneapi.sh "${{ inputs.oneapi }}"
88-
bash oneapi.sh -a -s --eula accept --action install --install-dir ${HOME}/intel/oneapi
89-
echo "XPU_ONEAPI_PATH=${HOME}/intel/oneapi" >> ${GITHUB_ENV}
90-
- name: Download Pytorch wheel
91-
if: ${{ ! contains(inputs.test_type, 'wheel') }}
92-
uses: actions/download-artifact@v4
93-
with:
94-
pattern: Torch-XPU-Wheel-*
95-
- name: Prepare Stock Pytorch
96-
run: |
97-
# install pytorch
98-
if [ $(echo "${{ inputs.pytorch }}" |grep -w "release_wheel" |wc -l) -ne 0 ];then
99-
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/xpu
100-
elif [ $(echo "${{ inputs.pytorch }}" |grep -w "test_wheel" |wc -l) -ne 0 ];then
101-
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/test/xpu
102-
elif [ $(echo "${{ inputs.pytorch }}" |grep -w "nightly_wheel" |wc -l) -ne 0 ];then
103-
pip install torch torchvision torchaudio --pre --index-url https://download.pytorch.org/whl/nightly/xpu
104-
else
105-
pip install --force-reinstall ${{ github.workspace }}/*.whl
106-
fi
107-
- name: Torch Config
108-
run: |
109-
printenv
110-
python -c "import torch; print(torch.__config__.show())"
111-
python -c "import torch; print(torch.__config__.parallel_info())"
112-
python -c "import torch; print(torch.__config__.torch.xpu.device_count())"
113-
python -c "import torchvision; print(torchvision.__version__)"
114-
python -c "import torchaudio; print(torchaudio.__version__)"
115-
python -c "import triton; print(triton.__version__)"
116-
pip list |grep -E 'torch|intel'
66+
test_type: ${{ inputs.test_type }}
67+
pytorch: ${{ inputs.pytorch }}
68+
torch_xpu_ops: skipped
69+
oneapi: ${{ inputs.oneapi }}
70+
python: ${{ inputs.python }}
11771

11872
- name: Run Torch XPU Op Benchmark
11973
run: |

0 commit comments

Comments
 (0)