Skip to content

Commit 79b2624

Browse files
[Nightly] Add op_ut for windows UT test
1 parent 1e69f40 commit 79b2624

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

.github/workflows/_windows_ut.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
echo "C:\ProgramData\miniforge3\Scripts" >> "$GITHUB_PATH"
9191
echo "C:\ProgramData\miniforge3\Library\bin" >> "$GITHUB_PATH"
9292
call "C:\ProgramData\miniforge3\Scripts\activate.bat"
93+
rmdir /s "C:\ProgramData\miniforge3\envs\windows_ci"
9394
call conda clean -ay
9495
call conda remove --all -y -n windows_ci
9596
call conda create -n windows_ci python=${{ inputs.python }} cmake ninja -y
@@ -263,6 +264,67 @@ jobs:
263264
264265
if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log"
265266
copy test_xpu.xml %GITHUB_WORKSPACE%\ut_log /Y
267+
- name: Run OP UT
268+
if: contains(inputs.ut, 'op_ut') || github.event_name == 'schedule'
269+
shell: cmd
270+
continue-on-error: true
271+
run: |
272+
call "C:\ProgramData\miniforge3\Scripts\activate.bat"
273+
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
274+
call conda activate windows_ci
275+
set PYTORCH_TEST_WITH_SLOW=1
276+
set PYTORCH_ENABLE_XPU_FALLBACK=1
277+
cd ../pytorch/third_party/torch-xpu-ops/test/xpu/
278+
python run_test_with_skip.py
279+
if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log"
280+
for %%f in (*.xml) do (
281+
if exist "%%f" (
282+
copy "%%f" "%GITHUB_WORKSPACE%\ut_log" /Y
283+
)
284+
)
285+
if exist "op_ut_with_skip.nn" (
286+
echo Processing directory: op_ut_with_skip.nn
287+
for /r "op_ut_with_skip.nn" %%f in (*.xml) do (
288+
if exist "%%f" (
289+
move "%%f" "%%~dpfop_ut_with_skip.nn.%%~nxf" >nul
290+
)
291+
)
292+
)
293+
if exist "op_ut_with_skip.quantization\core" (
294+
echo Processing directory: op_ut_with_skip.quantization\core
295+
for /r "op_ut_with_skip.quantization\core" %%f in (*.xml) do (
296+
if exist "%%f" (
297+
move "%%f" "%%~dpfop_ut_with_skip.quantization.core.%%~nxf" >nul
298+
)
299+
)
300+
)
301+
if exist "op_ut_with_all.functorch" (
302+
echo Processing directory: op_ut_with_all.functorch
303+
for /r "op_ut_with_all.functorch" %%f in (*.xml) do (
304+
if exist "%%f" (
305+
move "%%f" "%%~dpfop_ut_with_all_functorch_%%~nxf" >nul
306+
)
307+
)
308+
)
309+
echo === XML files in directory ===
310+
dir "op_ut_with_skip_nn\*.xml" /B
311+
dir "op_ut_with_skip_quantization\core\*.xml" /B
312+
dir "op_ut_with_all_functorch\*.xml" /B
313+
314+
for %%d in (op_ut_with_skip.nn "op_ut_with_skip.quantization\core" op_ut_with_all.functorch) do (
315+
if exist "%%d" (
316+
echo Copying XML files from %%d
317+
for /f "delims=" %%f in ('dir "%%d\*.xml" /B /S 2^>nul') do (
318+
if exist "%%f" (
319+
echo Copying: %%f
320+
copy "%%f" "%GITHUB_WORKSPACE%\ut_log\" /Y
321+
)
322+
)
323+
)
324+
)
325+
326+
python run_test_with_only.py
327+
copy op_ut_with_only.xml %GITHUB_WORKSPACE%\ut_log /Y
266328
- name: UT Test Results Summary
267329
shell: cmd
268330
run: |

.github/workflows/nightly_ondemand.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ jobs:
209209
secrets: inherit
210210
uses: ./.github/workflows/_windows_ut.yml
211211
with:
212-
ut: 'op_extended,test_xpu'
212+
ut: 'op_extended,test_xpu,op_ut'
213213
python: ${{ needs.Conditions-Filter.outputs.python }}
214214
src_changed: false
215215
has_label: true

0 commit comments

Comments
 (0)