Skip to content

Commit db80b86

Browse files
[CI] Enable matrix test for UT (#1677)
Enable matrix test method to accelerate the UT test.
1 parent 49156b9 commit db80b86

File tree

2 files changed

+259
-207
lines changed

2 files changed

+259
-207
lines changed

.github/workflows/_linux_build.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
type: string
2929
default: 'linux.idc.xpu'
3030
description: Runner label
31+
triton:
32+
required: false
33+
type: string
34+
default: ''
35+
description: Triton commit. Use pytorch pined commit by default
3136
outputs:
3237
torch_commit_id:
3338
description: The commit id of the torch build
@@ -70,6 +75,30 @@ jobs:
7075
uses: actions/checkout@v4
7176
with:
7277
path: torch-xpu-ops
78+
- name: Build Triton XPU
79+
run: |
80+
# gcc 13
81+
dnf install -y gcc-toolset-13-gcc-c++
82+
source /opt/rh/gcc-toolset-13/enable
83+
dnf install -y zlib-devel
84+
cd ../ && rm -rf pytorch
85+
git clone https://github.com/pytorch/pytorch pytorch
86+
cd pytorch
87+
if [ -z ${{ inputs.triton }} ]; then
88+
TRITON_COMMIT_ID="$(<.ci/docker/ci_commit_pins/triton-xpu.txt)"
89+
else
90+
TRITON_COMMIT_ID="${{ inputs.triton }}"
91+
fi
92+
if [ "${{ inputs.pytorch }}" != "nightly_wheel" ]; then
93+
pip install cmake ninja pybind11
94+
rm -rf pytorch_triton_xpu-*.whl
95+
TRITON_VERSION_NAME="$(
96+
curl -sSL https://raw.githubusercontent.com/intel/intel-xpu-backend-for-triton/${TRITON_COMMIT_ID}/python/triton/__init__.py 2>&1 |\
97+
grep '__version__' |head -n 1 |awk -F "'" '{print $2}'
98+
)"
99+
python .github/scripts/build_triton_wheel.py --device xpu --commit-hash ${TRITON_COMMIT_ID} --triton-version ${TRITON_VERSION_NAME}
100+
cp pytorch_triton_xpu-*.whl ${{ github.workspace }}
101+
fi
73102
- name: Build Pytorch XPU
74103
run: |
75104
set -xe -o pipefail
@@ -118,6 +147,12 @@ jobs:
118147
with:
119148
name: Torch-XPU-Wheel-${{ github.event.pull_request.number || github.sha }}
120149
path: ${{ github.workspace }}/torch*.whl
150+
- name: Upload Triton Wheel
151+
if: ${{ ! cancelled() }}
152+
uses: actions/upload-artifact@v4
153+
with:
154+
name: Triton-Wheel-${{ github.event.pull_request.number || github.sha }}
155+
path: ${{ github.workspace }}/pytorch_triton_xpu-*.whl
121156
- name: Upload Build Log
122157
if: ${{ ! cancelled() }}
123158
uses: actions/upload-artifact@v4
@@ -128,4 +163,4 @@ jobs:
128163
if: always()
129164
run: |
130165
chmod 777 . -R
131-
rm -rf pytorch torch-xpu-ops pytorch_*.log torch*.whl
166+
rm -rf pytorch torch-xpu-ops pytorch_*.log torch*.whl pytorch_triton_xpu-*.whl

0 commit comments

Comments
 (0)