Skip to content

Commit d6b49ee

Browse files
udpate the result check
1 parent 22d0a20 commit d6b49ee

File tree

3 files changed

+105
-4
lines changed

3 files changed

+105
-4
lines changed

.github/workflows/_windows_ut.yml

Lines changed: 103 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
set CMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library"
124124
)
125125
python setup.py clean
126-
set MAX_JOBS=8
126+
set MAX_JOBS=16
127127
python setup.py bdist_wheel > build_torch_wheel_log.log
128128
echo "[INFO] begin to install torch whls"
129129
for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do (
@@ -141,24 +141,22 @@ jobs:
141141
python -c "import torch; print(torch.__config__.show())"
142142
python -c "import torch; print(torch.__config__.parallel_info())"
143143
python -c "import torch; print(torch.__config__.torch.xpu.device_count())"
144-
145144
- name: Upload Windows build log
146145
if: ${{ ! cancelled() }}
147146
uses: actions/upload-artifact@v4
148147
with:
149148
name: Torch-XPU-Windows-Log-${{ github.event.pull_request.number || github.sha }}
150149
path: 'C:\actions-runner\_work\torch-xpu-ops\pytorch\build_torch_wheel_log.log'
151-
152150
- name: Upload Windows binary
153151
if: ${{ ! cancelled() }}
154152
uses: actions/upload-artifact@v4
155153
with:
156154
name: Torch-XPU-Windows-Binary-${{ github.event.pull_request.number || github.sha }}
157155
path: 'C:\actions-runner\_work\torch-xpu-ops\pytorch\dist'
158-
159156
- name: Run XPU OP Extended UT
160157
if: contains(inputs.ut, 'op_extended') || github.event_name == 'schedule'
161158
shell: cmd
159+
continue-on-error: true
162160
run: |
163161
call "C:\ProgramData\miniforge3\Scripts\activate.bat"
164162
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
@@ -168,13 +166,114 @@ jobs:
168166
cd ../pytorch/third_party/torch-xpu-ops/test/xpu/extended/
169167
python run_test_with_skip_mtl.py
170168
169+
if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log"
170+
copy op_extended.xml %GITHUB_WORKSPACE%\ut_log /Y
171171
- name: Run Test XPU UT
172172
if: contains(inputs.ut, 'torch_xpu') || github.event_name == 'schedule'
173173
shell: cmd
174+
continue-on-error: true
174175
run: |
175176
call "C:\ProgramData\miniforge3\Scripts\activate.bat"
176177
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
177178
call conda activate windows_ci
178179
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
179180
cd ../pytorch/third_party/torch-xpu-ops/test/xpu/
180181
python run_test_win_with_skip_mtl.py
182+
183+
if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log"
184+
copy test_xpu.xml %GITHUB_WORKSPACE%\ut_log /Y
185+
- name: UT Test Results Summary
186+
shell: cmd
187+
run: |
188+
call conda activate windows_ci
189+
pip install junitparser
190+
for %%f in ("%GITHUB_WORKSPACE%/ut_log/*.xml") do (
191+
python ./.github/scripts/check-ut.py "%%f" >> "%GITHUB_STEP_SUMMARY%"
192+
)
193+
@echo off
194+
195+
REM Check the failure logs
196+
if exist "%GITHUB_WORKSPACE%\failures*.log" (
197+
echo Exist Failure logs
198+
echo Found Failure logs as below:
199+
for %%f in ("%GITHUB_WORKSPACE%\failures*.log") do (
200+
echo - %%f
201+
copy "%%f" "%GITHUB_WORKSPACE%\ut_log\"
202+
)
203+
echo Failure logs Copied
204+
) else (
205+
echo No Failure logs
206+
)
207+
208+
REM Copied the passed logs
209+
if exist "passed*.log" (
210+
copy "passed*.log" "%GITHUB_WORKSPACE%\ut_log\"
211+
echo Passed logs Copied
212+
) else (
213+
echo No Passed logs
214+
)
215+
216+
REM Copied the Summary logs
217+
if exist "category*.log" (
218+
copy "category*.log" "%GITHUB_WORKSPACE%\ut_log\"
219+
echo Category logs Copied
220+
) else (
221+
echo No Category logs
222+
)
223+
- name: Upload Inductor XPU UT Log
224+
if: ${{ ! cancelled() }}
225+
uses: actions/upload-artifact@v4
226+
with:
227+
name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows
228+
path: "%GITHUB_WORKSPACE%/ut_log"
229+
if-no-files-found: ignore
230+
231+
summary:
232+
needs: [ut_test]
233+
runs-on: ubuntu-24.04
234+
timeout-minutes: 30
235+
env:
236+
GH_TOKEN: ${{ github.token }}
237+
steps:
238+
- name: Checkout torch-xpu-ops
239+
uses: actions/checkout@v4
240+
- name: Download XPU UT Logs
241+
uses: actions/download-artifact@v4
242+
with:
243+
name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows
244+
path: ${{ github.workspace }}/ut_log
245+
- name: Check UT Results
246+
shell: bash
247+
run: |
248+
ls -al ${{ github.workspace }}/ut_log
249+
cd ${{ github.workspace }}/ut_log
250+
251+
for log_file in "${{ github.workspace }}/ut_log"/{failures,passed,category}_"${{ inputs.ut }}".log; do
252+
[[ -f "$log_file" ]] && cp "$log_file" ./
253+
done
254+
255+
# get skipped known issues
256+
count=$(gh api "repos/${{ github.repository }}/issues?labels=skipped" --jq 'length')
257+
if [ "$count" -gt 0 ]; then
258+
echo -e "$count issues with skipped label found"
259+
gh api "repos/${{ github.repository }}/issues?labels=skipped" \
260+
--jq '.[] | select(.pull_request == null) | "Issue #\(.number): \(.title)\n\(.body)\n"' > issues.log
261+
fi
262+
263+
cp ${{ github.workspace }}/.github/scripts/ut_result_check.sh ./
264+
for ut_name in $(echo ${{ inputs.ut }} |sed 's/,/ /g')
265+
do
266+
awk -v r="${ut_name}" 'BEGIN{ print_row = 0 }{
267+
if ( ! ( $0 ~ /[a-zA-Z0-9]/ ) ) { print_row = 0 };
268+
if ( print_row == 1 && $1 ~ r ) { print $0 };
269+
if ( $0 ~ /Cases:/ ) { print_row = 1 };
270+
}' issues.log > Known_issue.log
271+
bash ut_result_check.sh ${ut_name}
272+
done
273+
- name: Upload Inductor XPU UT Log
274+
if: ${{ ! cancelled() }}
275+
uses: actions/upload-artifact@v4
276+
with:
277+
name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows
278+
path: ${{ github.workspace }}/ut_log
279+
overwrite: true

test/xpu/extended/run_test_with_skip_mtl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919

2020
os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"
2121
test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"]
22+
test_command.extend(["--junit-xml", "./op_extended.xml"])
2223
res = pytest.main(test_command)
2324
sys.exit(res)

test/xpu/run_test_win_with_skip_mtl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
sys.stdout = StringIO()
1919

2020
test_command = ["-k", skip_options, "../../../../test/test_xpu.py", "-v"]
21+
test_command.extend(["--junit-xml", "./test_xpu.xml"])
2122
res = pytest.main(test_command)
2223

2324
output = sys.stdout.getvalue()

0 commit comments

Comments
 (0)