@@ -142,17 +142,19 @@ jobs:
142
142
if : contains(inputs.ut, 'op_regression') || github.event_name == 'schedule'
143
143
run : |
144
144
cd ${{ github.workspace }}
145
+ mkdir -p ut_log/op_regression
145
146
xpu-smi discovery
146
147
source .github/scripts/env.sh ${{ inputs.pytorch }}
147
148
source activate xpu_op_${ZE_AFFINITY_MASK}
148
149
cd ${{ github.workspace }}
149
150
cd test/regressions
150
151
pip install pytest
151
- timeout 8000 pytest -v
152
+ timeout 8000 pytest -v 2>&1 | tee ${{ github.workspace }}/ut_log/op_regression/op_regression_test.log
152
153
- name : Run XPU OP Regressions test on device 1
153
154
if : contains(inputs.ut, 'op_regression_dev1') || github.event_name == 'schedule'
154
155
run : |
155
156
cd ${{ github.workspace }}
157
+ mkdir -p ut_log/op_regression_dev1
156
158
xpu-smi discovery
157
159
source .github/scripts/env.sh ${{ inputs.pytorch }}
158
160
source activate xpu_op_${ZE_AFFINITY_MASK}
@@ -161,35 +163,41 @@ jobs:
161
163
cd ${{ github.workspace }}
162
164
cd test/regressions
163
165
pip install pytest
164
- timeout 8000 pytest -v test_operation_on_device_1.py
166
+ timeout 8000 pytest -v test_operation_on_device_1.py 2>&1 | tee ${{ github.workspace }}/ut_log/op_regression_dev1/op_regression_dev1_test.log
165
167
export ZE_AFFINITY_MASK=${ZE_AFFINITY_MASK_OLD}
166
168
- name : Run XPU OP Extended UT
167
169
if : contains(inputs.ut, 'op_extended') || github.event_name == 'schedule'
168
170
run : |
169
171
source .github/scripts/env.sh ${{ inputs.pytorch }}
170
172
source activate xpu_op_${ZE_AFFINITY_MASK}
171
173
export PYTORCH_TEST_WITH_SLOW=1
174
+ cd ${{ github.workspace }}
175
+ mkdir -p ut_log/op_extended
172
176
cd ../pytorch/third_party/torch-xpu-ops/test/xpu/extended/
173
- timeout 10000 python run_test_with_skip.py
177
+ timeout 10000 python run_test_with_skip.py 2>&1 | tee ${{ github.workspace }}/ut_log/op_extended/op_extended_test.log
174
178
- name : Run XPU OP UT
175
179
if : contains(inputs.ut, 'op_ut') || github.event_name == 'schedule'
176
180
run : |
177
181
source .github/scripts/env.sh ${{ inputs.pytorch }}
178
182
source activate xpu_op_${ZE_AFFINITY_MASK}
179
183
export PYTORCH_ENABLE_XPU_FALLBACK=1
180
184
export PYTORCH_TEST_WITH_SLOW=1
185
+ cd ${{ github.workspace }}
186
+ mkdir -p ut_log/op_ut
181
187
cd ../pytorch/third_party/torch-xpu-ops/test/xpu
182
- timeout 10000 python run_test_with_skip.py
188
+ timeout 10000 python run_test_with_skip.py 2>&1 | tee ${{ github.workspace }}/ut_log/op_ut/op_ut_with_skip_test.log
183
189
# Cases run with a on-demand white list, since some suites are too
184
190
# slow to go through all operators on CPU. So add cases on-demand
185
191
# when XPU implementatoin is done.
186
192
# test_foreach, test_decomp
187
- timeout 10000 python run_test_with_only.py
193
+ timeout 10000 python run_test_with_only.py 2>&1 | tee ${{ github.workspace }}/ut_log/op_ut/op_ut_with_only_test.log
188
194
- name : Run Torch XPU UT
189
195
if : contains(inputs.ut, 'torch_xpu') || github.event_name == 'schedule'
190
196
run : |
191
197
source .github/scripts/env.sh ${{ inputs.pytorch }}
192
198
source activate xpu_op_${ZE_AFFINITY_MASK}
199
+ cd ${{ github.workspace }}
200
+ mkdir -p ut_log/torch_xpu
193
201
cd ../pytorch
194
202
TEST_REPORTS_DIR=$(pwd)/test/test-reports
195
203
rm -rf "$TEST_REPORTS_DIR" && mkdir -p "$TEST_REPORTS_DIR"
@@ -198,7 +206,7 @@ jobs:
198
206
if [[ "$xpu_case" != *"*"* && "$xpu_case" != *.so && "$xpu_case" != *.a ]]; then
199
207
case_name=$(basename "$xpu_case")
200
208
echo "Testing ${case_name} ..."
201
- "$xpu_case" --gtest_output=xml:"$TEST_REPORTS_DIR"/"$case_name".xml
209
+ "$xpu_case" --gtest_output=xml:"$TEST_REPORTS_DIR"/"$case_name".xml 2>&1 | tee ${{ github.workspace }}/ut_log/torch_xpu/binary_ut_torch_xpu_${case_name}_test.log
202
210
fi
203
211
done
204
212
# Run Pytorch XPU python UT
@@ -219,4 +227,31 @@ jobs:
219
227
if [ -f "test/test_xpu.py" ]; then
220
228
test_cmd="${test_cmd} test_xpu.py"
221
229
fi
222
- eval $test_cmd
230
+ eval $test_cmd 2>&1 | tee ${{ github.workspace }}/ut_log/torch_xpu/Inductor_ut_torch_xpu_test.log
231
+ - name : UT Test Results Check
232
+ shell : bash
233
+ run : |
234
+ function contains() {
235
+ contains_status="echo 'Start $2 ...'"
236
+ {
237
+ [[ $1 =~ (^|,)$2($|,) ]]
238
+ } || {
239
+ echo "[Warning] $2 is not suppotted type! Skipped!"
240
+ contains_status="continue"
241
+ }
242
+ }
243
+ set -xe
244
+ for ut_suite in $(echo ${{ inputs.ut }} |sed 's/,/ /g')
245
+ do
246
+ contains "op_regression,op_regression_dev1,op_extended,op_ut,torch_xpu" $ut_suite
247
+ $contains_status
248
+ cd ${{ github.workspace }}/ut_log/${ut_suite}
249
+ cp ${{ github.workspace }}/.github/scripts/ut_result_check.sh ./
250
+ bash ut_result_check.sh ${ut_suite}
251
+ done
252
+ - name : Upload Inductor XPU UT Log
253
+ if : always()
254
+ uses : actions/upload-artifact@v4
255
+ with :
256
+ name : Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-${{ inputs.abi }}
257
+ path : ${{ github.workspace }}/ut_log
0 commit comments