28
28
type : string
29
29
default : ' linux.idc.xpu'
30
30
description : Runner label
31
+ triton :
32
+ required : false
33
+ type : string
34
+ default : ' '
35
+ description : Triton commit. Use pytorch pined commit by default
31
36
outputs :
32
37
torch_commit_id :
33
38
description : The commit id of the torch build
70
75
uses : actions/checkout@v4
71
76
with :
72
77
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
73
102
- name : Build Pytorch XPU
74
103
run : |
75
104
set -xe -o pipefail
@@ -118,6 +147,12 @@ jobs:
118
147
with :
119
148
name : Torch-XPU-Wheel-${{ github.event.pull_request.number || github.sha }}
120
149
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
121
156
- name : Upload Build Log
122
157
if : ${{ ! cancelled() }}
123
158
uses : actions/upload-artifact@v4
@@ -128,4 +163,4 @@ jobs:
128
163
if : always()
129
164
run : |
130
165
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