From cfe9779fc662055cdfad5f761095e7ad863424a3 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Wed, 12 Nov 2025 01:29:04 -0800 Subject: [PATCH 01/13] [Nightly] Add op_ut for windows UT test --- .github/workflows/_windows_ut.yml | 62 ++++++++++++++++++++++++++ .github/workflows/nightly_ondemand.yml | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 217a3fe70f..210817be71 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -90,6 +90,7 @@ jobs: echo "C:\ProgramData\miniforge3\Scripts" >> "$GITHUB_PATH" echo "C:\ProgramData\miniforge3\Library\bin" >> "$GITHUB_PATH" call "C:\ProgramData\miniforge3\Scripts\activate.bat" + rmdir /s "C:\ProgramData\miniforge3\envs\windows_ci" call conda clean -ay call conda remove --all -y -n windows_ci call conda create -n windows_ci python=${{ inputs.python }} cmake ninja -y @@ -263,6 +264,67 @@ jobs: if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" copy test_xpu.xml %GITHUB_WORKSPACE%\ut_log /Y + - name: Run OP UT + if: contains(inputs.ut, 'op_ut') || github.event_name == 'schedule' + shell: cmd + continue-on-error: true + run: | + call "C:\ProgramData\miniforge3\Scripts\activate.bat" + call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" + call conda activate windows_ci + set PYTORCH_TEST_WITH_SLOW=1 + set PYTORCH_ENABLE_XPU_FALLBACK=1 + cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ + python run_test_with_skip.py + if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" + for %%f in (*.xml) do ( + if exist "%%f" ( + copy "%%f" "%GITHUB_WORKSPACE%\ut_log" /Y + ) + ) + if exist "op_ut_with_skip.nn" ( + echo Processing directory: op_ut_with_skip.nn + for /r "op_ut_with_skip.nn" %%f in (*.xml) do ( + if exist "%%f" ( + move "%%f" "%%~dpfop_ut_with_skip.nn.%%~nxf" >nul + ) + ) + ) + if exist "op_ut_with_skip.quantization\core" ( + echo Processing directory: op_ut_with_skip.quantization\core + for /r "op_ut_with_skip.quantization\core" %%f in (*.xml) do ( + if exist "%%f" ( + move "%%f" "%%~dpfop_ut_with_skip.quantization.core.%%~nxf" >nul + ) + ) + ) + if exist "op_ut_with_all.functorch" ( + echo Processing directory: op_ut_with_all.functorch + for /r "op_ut_with_all.functorch" %%f in (*.xml) do ( + if exist "%%f" ( + move "%%f" "%%~dpfop_ut_with_all_functorch_%%~nxf" >nul + ) + ) + ) + echo === XML files in directory === + dir "op_ut_with_skip_nn\*.xml" /B + dir "op_ut_with_skip_quantization\core\*.xml" /B + dir "op_ut_with_all_functorch\*.xml" /B + + for %%d in (op_ut_with_skip.nn "op_ut_with_skip.quantization\core" op_ut_with_all.functorch) do ( + if exist "%%d" ( + echo Copying XML files from %%d + for /f "delims=" %%f in ('dir "%%d\*.xml" /B /S 2^>nul') do ( + if exist "%%f" ( + echo Copying: %%f + copy "%%f" "%GITHUB_WORKSPACE%\ut_log\" /Y + ) + ) + ) + ) + + python run_test_with_only.py + copy op_ut_with_only.xml %GITHUB_WORKSPACE%\ut_log /Y - name: UT Test Results Summary shell: cmd run: | diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 932ad56a46..ff4d75c0c4 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -210,7 +210,7 @@ jobs: secrets: inherit uses: ./.github/workflows/_windows_ut.yml with: - ut: 'op_extended,test_xpu' + ut: 'op_extended,test_xpu,op_ut' python: ${{ needs.Conditions-Filter.outputs.python }} src_changed: false has_label: true From 3362987584654cd1152f33f5e96fd9e9aa5d1354 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Wed, 12 Nov 2025 17:34:22 -0800 Subject: [PATCH 02/13] fix the rm issue --- .github/workflows/_windows_ut.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 210817be71..cb965a69b3 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -90,7 +90,7 @@ jobs: echo "C:\ProgramData\miniforge3\Scripts" >> "$GITHUB_PATH" echo "C:\ProgramData\miniforge3\Library\bin" >> "$GITHUB_PATH" call "C:\ProgramData\miniforge3\Scripts\activate.bat" - rmdir /s "C:\ProgramData\miniforge3\envs\windows_ci" + rmdir /s /q "C:\ProgramData\miniforge3\envs\windows_ci" call conda clean -ay call conda remove --all -y -n windows_ci call conda create -n windows_ci python=${{ inputs.python }} cmake ninja -y From ed477ce7d9008e743c456b207cdb1121d1a9ffa7 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 17 Nov 2025 18:00:17 -0800 Subject: [PATCH 03/13] update op ut scope --- .github/workflows/_windows_ut.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index cb965a69b3..c5e9686ca8 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -74,7 +74,7 @@ jobs: ut_test: runs-on: ${{ inputs.runner }} if: ${{ inputs.src_changed == 'true' || inputs.has_label == 'true' }} - timeout-minutes: 900 + timeout-minutes: 1200 steps: - name: Checkout torch-xpu-ops uses: actions/checkout@v4 @@ -275,7 +275,7 @@ jobs: set PYTORCH_TEST_WITH_SLOW=1 set PYTORCH_ENABLE_XPU_FALLBACK=1 cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ - python run_test_with_skip.py + python run_test_with_skip_lnl.py if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" for %%f in (*.xml) do ( if exist "%%f" ( From 16f4724e8e8ab7b0bb6e6643611d1420e8915e65 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 17 Nov 2025 18:25:23 -0800 Subject: [PATCH 04/13] Skip crash --- .github/workflows/_windows_ut.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index c5e9686ca8..f015e70608 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -274,6 +274,7 @@ jobs: call conda activate windows_ci set PYTORCH_TEST_WITH_SLOW=1 set PYTORCH_ENABLE_XPU_FALLBACK=1 + set PYTEST_ADDOPTS=-v --timeout 600 --timeout_method=thread -n 1 cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ python run_test_with_skip_lnl.py if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" From 172564c50982988f941ce6c00ae0729770d6cd9b Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Tue, 18 Nov 2025 01:21:34 -0800 Subject: [PATCH 05/13] fix the typo issue --- .github/workflows/_windows_ut.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index f015e70608..c37be0780c 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -276,7 +276,7 @@ jobs: set PYTORCH_ENABLE_XPU_FALLBACK=1 set PYTEST_ADDOPTS=-v --timeout 600 --timeout_method=thread -n 1 cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ - python run_test_with_skip_lnl.py + python run_test_with_skip.py if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" for %%f in (*.xml) do ( if exist "%%f" ( @@ -303,14 +303,14 @@ jobs: echo Processing directory: op_ut_with_all.functorch for /r "op_ut_with_all.functorch" %%f in (*.xml) do ( if exist "%%f" ( - move "%%f" "%%~dpfop_ut_with_all_functorch_%%~nxf" >nul + move "%%f" "%%~dpfop_ut_with_all.functorch.%%~nxf" >nul ) ) ) echo === XML files in directory === - dir "op_ut_with_skip_nn\*.xml" /B - dir "op_ut_with_skip_quantization\core\*.xml" /B - dir "op_ut_with_all_functorch\*.xml" /B + dir "op_ut_with_skip.nn\*.xml" /B + dir "op_ut_with_skip.quantization\core\*.xml" /B + dir "op_ut_with_all.functorch\*.xml" /B for %%d in (op_ut_with_skip.nn "op_ut_with_skip.quantization\core" op_ut_with_all.functorch) do ( if exist "%%d" ( From 233c15295ec3744f56bf5250bf7113dc4a5281ba Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Wed, 19 Nov 2025 17:32:58 -0800 Subject: [PATCH 06/13] adjust the timeout --- .github/workflows/_windows_ut.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index c37be0780c..b12d507bfa 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -74,7 +74,7 @@ jobs: ut_test: runs-on: ${{ inputs.runner }} if: ${{ inputs.src_changed == 'true' || inputs.has_label == 'true' }} - timeout-minutes: 1200 + timeout-minutes: 2000 steps: - name: Checkout torch-xpu-ops uses: actions/checkout@v4 From 92b6b32703cbf26d1c7dcfdf87a9a8d7e2829f7a Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Thu, 20 Nov 2025 17:51:11 -0800 Subject: [PATCH 07/13] simplify the xml file upload --- .github/workflows/_windows_ut.yml | 49 +------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index b12d507bfa..02bff7330d 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -278,54 +278,7 @@ jobs: cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ python run_test_with_skip.py if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" - for %%f in (*.xml) do ( - if exist "%%f" ( - copy "%%f" "%GITHUB_WORKSPACE%\ut_log" /Y - ) - ) - if exist "op_ut_with_skip.nn" ( - echo Processing directory: op_ut_with_skip.nn - for /r "op_ut_with_skip.nn" %%f in (*.xml) do ( - if exist "%%f" ( - move "%%f" "%%~dpfop_ut_with_skip.nn.%%~nxf" >nul - ) - ) - ) - if exist "op_ut_with_skip.quantization\core" ( - echo Processing directory: op_ut_with_skip.quantization\core - for /r "op_ut_with_skip.quantization\core" %%f in (*.xml) do ( - if exist "%%f" ( - move "%%f" "%%~dpfop_ut_with_skip.quantization.core.%%~nxf" >nul - ) - ) - ) - if exist "op_ut_with_all.functorch" ( - echo Processing directory: op_ut_with_all.functorch - for /r "op_ut_with_all.functorch" %%f in (*.xml) do ( - if exist "%%f" ( - move "%%f" "%%~dpfop_ut_with_all.functorch.%%~nxf" >nul - ) - ) - ) - echo === XML files in directory === - dir "op_ut_with_skip.nn\*.xml" /B - dir "op_ut_with_skip.quantization\core\*.xml" /B - dir "op_ut_with_all.functorch\*.xml" /B - - for %%d in (op_ut_with_skip.nn "op_ut_with_skip.quantization\core" op_ut_with_all.functorch) do ( - if exist "%%d" ( - echo Copying XML files from %%d - for /f "delims=" %%f in ('dir "%%d\*.xml" /B /S 2^>nul') do ( - if exist "%%f" ( - echo Copying: %%f - copy "%%f" "%GITHUB_WORKSPACE%\ut_log\" /Y - ) - ) - ) - ) - - python run_test_with_only.py - copy op_ut_with_only.xml %GITHUB_WORKSPACE%\ut_log /Y + for /r . %%f in (op_ut_with_*.xml) do move "%%f" "%GITHUB_WORKSPACE%\ut_log\" >nul 2>&1 || echo "File move completed" - name: UT Test Results Summary shell: cmd run: | From 604baf1a0b13ec27eef63d5a65cecd656f2fc757 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 24 Nov 2025 21:16:48 -0800 Subject: [PATCH 08/13] add para for timeout --- .github/workflows/_windows_ut.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 02bff7330d..164ccf60c4 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -274,7 +274,7 @@ jobs: call conda activate windows_ci set PYTORCH_TEST_WITH_SLOW=1 set PYTORCH_ENABLE_XPU_FALLBACK=1 - set PYTEST_ADDOPTS=-v --timeout 600 --timeout_method=thread -n 1 + set PYTEST_ADDOPTS=-v --timeout 600 --timeout_method=thread --max-worker-restart 1000000 -n 1 cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ python run_test_with_skip.py if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" From 3c3f28adeda16c6dd41b42a6462fa30f94e64558 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Fri, 28 Nov 2025 00:23:30 -0800 Subject: [PATCH 09/13] add skip list --- .github/workflows/_windows_ut.yml | 2 +- test/xpu/run_test_with_windows_nighltly.py | 132 +++++++++++++++++++++ 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 test/xpu/run_test_with_windows_nighltly.py diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 164ccf60c4..87c05b9fc3 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -276,7 +276,7 @@ jobs: set PYTORCH_ENABLE_XPU_FALLBACK=1 set PYTEST_ADDOPTS=-v --timeout 600 --timeout_method=thread --max-worker-restart 1000000 -n 1 cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ - python run_test_with_skip.py + python run_test_with_windows_nighltly.py if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" for /r . %%f in (op_ut_with_*.xml) do move "%%f" "%GITHUB_WORKSPACE%\ut_log\" >nul 2>&1 || echo "File move completed" - name: UT Test Results Summary diff --git a/test/xpu/run_test_with_windows_nighltly.py b/test/xpu/run_test_with_windows_nighltly.py new file mode 100644 index 0000000000..36b5ab1294 --- /dev/null +++ b/test/xpu/run_test_with_windows_nighltly.py @@ -0,0 +1,132 @@ +import os +import sys + +from skip_list_common import skip_dict +from skip_list_win import skip_dict as skip_dict_win +from skip_list_win_lnl import skip_dict as skip_dict_win_lnl +from xpu_test_utils import launch_test + +res = 0 +IS_WINDOWS = sys.platform == "win32" + +def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): + os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" + skip_options = '' + if skip_list is not None: + skip_options = ' -k "not ' + skip_list[0] + for skip_case in skip_list[1:]: + skip_option = " and not " + skip_case + skip_options += skip_option + skip_options += '"' + + if skip_files is not None: + for skip_file in skip_files: + skip_options += f' --ignore={skip_file}' + + test_command = ( + f"pytest --junit-xml=./op_ut_with_windows_nightly.{test_case}.xml --max-worker-restart=1000 " + + test_case + ) + test_command += skip_options + elif exe_list is not None: + exe_options = ' -k "' + exe_list[0] + for exe_case in exe_list[1:]: + exe_option = " or " + exe_case + exe_options += exe_option + exe_options += '"' + + if skip_files is not None: + for skip_file in skip_files: + exe_options += f' --ignore={skip_file}' + + test_command = ( + f"pytest --junit-xml=./op_ut_with_windows_nightly.{test_case}.xml --max-worker-restart=1000 " + + test_case + ) + test_command += exe_options + else: + if skip_files is not None: + for skip_file in skip_files: + skip_options += f' --ignore={skip_file}' + + test_command = ( + f"pytest --junit-xml=./op_ut_with_windows_nightly.{test_case}.xml --max-worker-restart=1000 " + + test_case + ) + test_command += skip_options + return os.system(test_command) + +skip_files_list = [ + 'test_autocast_xpu.py', + 'test_autograd_fallback_xpu.py', + 'test_autograd_xpu.py', + # 'test_binary_ufuncs_xpu.py', + 'test_comparison_utils_xpu.py', + 'test_complex_xpu.py', + 'test_content_store_xpu.py', + 'test_dataloader_xpu.py', + 'test_decomp.py', + 'test_decomp_xpu.py', + 'test_distributions_xpu.py', + 'test_dynamic_shapes_xpu.py', + 'test_foreach_xpu.py', + # 'test_indexing_xpu.py', + 'test_linalg_xpu.py', + 'test_maskedtensor_xpu.py', + # 'test_masked_xpu.py', + 'test_matmul_cuda_xpu.py', + 'test_meta_xpu.py', + # 'test_modules_xpu.py', + 'test_namedtensor_xpu.py', + 'test_native_functions_xpu.py', + 'test_native_mha_xpu.py', + 'test_nestedtensor_xpu.py', + 'test_nn_xpu.py', + 'test_ops_fwd_gradients_xpu.py', + # 'test_ops_gradients_xpu.py', + # 'test_ops_xpu.py', + 'test_optim_xpu.py', + # 'test_reductions_xpu.py', + # 'test_scatter_gather_ops_xpu.py', + 'test_segment_reductions_xpu.py', + 'test_shape_ops_xpu.py', + 'test_sort_and_select_xpu.py', + 'test_sparse_csr_xpu.py', + 'test_sparse_xpu.py', + 'test_spectral_ops_xpu.py', + 'test_tensor_creation_ops_xpu.py', + # 'test_torch_xpu.py', + # 'test_transformers_xpu.py', + 'test_type_promotion_xpu.py', + # 'test_unary_ufuncs_xpu.py', + # 'test_view_ops_xpu.py', + 'functorch/test_ops_xpu.py', +] + +print("Current working directory:", os.getcwd()) +print("Files in directory:") +for file in os.listdir('.'): + if file.endswith('.py'): + print(f" {file}") + +for key in skip_dict: + # Check if key is in skip list + if key in skip_files_list: + print(f"\n=== Skipping test file: {key} ===") + continue + + skip_list = skip_dict[key] + skip_files = skip_files_list.copy() + if IS_WINDOWS and key in skip_dict_win: + skip_list += skip_dict_win[key] + if IS_WINDOWS and key in skip_dict_win_lnl: + skip_list += skip_dict_win_lnl[key] + + print(f"\n=== Processing test case: {key} ===") + res += launch_test(key, skip_list, skip_files) + +if os.name == "nt": + sys.exit(res) +else: + exit_code = os.WEXITSTATUS(res) + sys.exit(exit_code) \ No newline at end of file From 3f9dd8b7501535d51f99163f38a3b1767c8e3298 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Fri, 28 Nov 2025 00:33:13 -0800 Subject: [PATCH 10/13] align the lint check --- test/xpu/run_test_with_windows_nighltly.py | 107 ++++++++++----------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/test/xpu/run_test_with_windows_nighltly.py b/test/xpu/run_test_with_windows_nighltly.py index 36b5ab1294..d93f3880bb 100644 --- a/test/xpu/run_test_with_windows_nighltly.py +++ b/test/xpu/run_test_with_windows_nighltly.py @@ -4,14 +4,13 @@ from skip_list_common import skip_dict from skip_list_win import skip_dict as skip_dict_win from skip_list_win_lnl import skip_dict as skip_dict_win_lnl -from xpu_test_utils import launch_test res = 0 IS_WINDOWS = sys.platform == "win32" def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" - skip_options = '' + skip_options = "" if skip_list is not None: skip_options = ' -k "not ' + skip_list[0] for skip_case in skip_list[1:]: @@ -21,8 +20,8 @@ def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): if skip_files is not None: for skip_file in skip_files: - skip_options += f' --ignore={skip_file}' - + skip_options += f" --ignore={skip_file}" + test_command = ( f"pytest --junit-xml=./op_ut_with_windows_nightly.{test_case}.xml --max-worker-restart=1000 " + test_case @@ -37,7 +36,7 @@ def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): if skip_files is not None: for skip_file in skip_files: - exe_options += f' --ignore={skip_file}' + skip_options += f" --ignore={skip_file}" test_command = ( f"pytest --junit-xml=./op_ut_with_windows_nightly.{test_case}.xml --max-worker-restart=1000 " @@ -57,56 +56,56 @@ def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): return os.system(test_command) skip_files_list = [ - 'test_autocast_xpu.py', - 'test_autograd_fallback_xpu.py', - 'test_autograd_xpu.py', - # 'test_binary_ufuncs_xpu.py', - 'test_comparison_utils_xpu.py', - 'test_complex_xpu.py', - 'test_content_store_xpu.py', - 'test_dataloader_xpu.py', - 'test_decomp.py', - 'test_decomp_xpu.py', - 'test_distributions_xpu.py', - 'test_dynamic_shapes_xpu.py', - 'test_foreach_xpu.py', - # 'test_indexing_xpu.py', - 'test_linalg_xpu.py', - 'test_maskedtensor_xpu.py', - # 'test_masked_xpu.py', - 'test_matmul_cuda_xpu.py', - 'test_meta_xpu.py', - # 'test_modules_xpu.py', - 'test_namedtensor_xpu.py', - 'test_native_functions_xpu.py', - 'test_native_mha_xpu.py', - 'test_nestedtensor_xpu.py', - 'test_nn_xpu.py', - 'test_ops_fwd_gradients_xpu.py', - # 'test_ops_gradients_xpu.py', - # 'test_ops_xpu.py', - 'test_optim_xpu.py', - # 'test_reductions_xpu.py', - # 'test_scatter_gather_ops_xpu.py', - 'test_segment_reductions_xpu.py', - 'test_shape_ops_xpu.py', - 'test_sort_and_select_xpu.py', - 'test_sparse_csr_xpu.py', - 'test_sparse_xpu.py', - 'test_spectral_ops_xpu.py', - 'test_tensor_creation_ops_xpu.py', - # 'test_torch_xpu.py', - # 'test_transformers_xpu.py', - 'test_type_promotion_xpu.py', - # 'test_unary_ufuncs_xpu.py', - # 'test_view_ops_xpu.py', - 'functorch/test_ops_xpu.py', + "test_autocast_xpu.py", + "test_autograd_fallback_xpu.py", + "test_autograd_xpu.py", + # "test_binary_ufuncs_xpu.py", + "test_comparison_utils_xpu.py", + "test_complex_xpu.py", + "test_content_store_xpu.py", + "test_dataloader_xpu.py", + "test_decomp.py", + "test_decomp_xpu.py", + "test_distributions_xpu.py", + "test_dynamic_shapes_xpu.py", + "test_foreach_xpu.py", + # "test_indexing_xpu.py", + "test_linalg_xpu.py", + "test_maskedtensor_xpu.py", + # "test_masked_xpu.py", + "test_matmul_cuda_xpu.py", + "test_meta_xpu.py", + # "test_modules_xpu.py", + "test_namedtensor_xpu.py", + "test_native_functions_xpu.py", + "test_native_mha_xpu.py", + "test_nestedtensor_xpu.py", + "test_nn_xpu.py", + "test_ops_fwd_gradients_xpu.py", + # "test_ops_gradients_xpu.py", + # "test_ops_xpu.py", + "test_optim_xpu.py", + # "test_reductions_xpu.py", + # "test_scatter_gather_ops_xpu.py", + "test_segment_reductions_xpu.py", + "test_shape_ops_xpu.py", + "test_sort_and_select_xpu.py", + "test_sparse_csr_xpu.py", + "test_sparse_xpu.py", + "test_spectral_ops_xpu.py", + "test_tensor_creation_ops_xpu.py", + # "test_torch_xpu.py", + # "test_transformers_xpu.py", + "test_type_promotion_xpu.py", + # "test_unary_ufuncs_xpu.py", + # "test_view_ops_xpu.py", + "functorch/test_ops_xpu.py", ] print("Current working directory:", os.getcwd()) print("Files in directory:") -for file in os.listdir('.'): - if file.endswith('.py'): +for file in os.listdir("."): + if file.endswith(".py"): print(f" {file}") for key in skip_dict: @@ -114,14 +113,14 @@ def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): if key in skip_files_list: print(f"\n=== Skipping test file: {key} ===") continue - + skip_list = skip_dict[key] skip_files = skip_files_list.copy() if IS_WINDOWS and key in skip_dict_win: skip_list += skip_dict_win[key] if IS_WINDOWS and key in skip_dict_win_lnl: skip_list += skip_dict_win_lnl[key] - + print(f"\n=== Processing test case: {key} ===") res += launch_test(key, skip_list, skip_files) @@ -129,4 +128,4 @@ def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): sys.exit(res) else: exit_code = os.WEXITSTATUS(res) - sys.exit(exit_code) \ No newline at end of file + sys.exit(exit_code) From dfe855f2a37dc26bf58ac83356cba7ded414d5e8 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Fri, 28 Nov 2025 00:35:05 -0800 Subject: [PATCH 11/13] align the lint check --- test/xpu/run_test_with_windows_nighltly.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xpu/run_test_with_windows_nighltly.py b/test/xpu/run_test_with_windows_nighltly.py index d93f3880bb..05cd2dad18 100644 --- a/test/xpu/run_test_with_windows_nighltly.py +++ b/test/xpu/run_test_with_windows_nighltly.py @@ -46,7 +46,7 @@ def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): else: if skip_files is not None: for skip_file in skip_files: - skip_options += f' --ignore={skip_file}' + skip_options += f" --ignore={skip_file}" test_command = ( f"pytest --junit-xml=./op_ut_with_windows_nightly.{test_case}.xml --max-worker-restart=1000 " From 5f9af8a2354f1e02c1775442f8041b641766d6e8 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Fri, 28 Nov 2025 00:36:51 -0800 Subject: [PATCH 12/13] align the lint check --- test/xpu/run_test_with_windows_nighltly.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/xpu/run_test_with_windows_nighltly.py b/test/xpu/run_test_with_windows_nighltly.py index 05cd2dad18..efc7ef6b0d 100644 --- a/test/xpu/run_test_with_windows_nighltly.py +++ b/test/xpu/run_test_with_windows_nighltly.py @@ -8,6 +8,7 @@ res = 0 IS_WINDOWS = sys.platform == "win32" + def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" skip_options = "" From bffbb25b96b50c367dea79df88dd0f94c03cf442 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Fri, 28 Nov 2025 00:38:54 -0800 Subject: [PATCH 13/13] align the lint check --- test/xpu/run_test_with_windows_nighltly.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/xpu/run_test_with_windows_nighltly.py b/test/xpu/run_test_with_windows_nighltly.py index efc7ef6b0d..18a806ae42 100644 --- a/test/xpu/run_test_with_windows_nighltly.py +++ b/test/xpu/run_test_with_windows_nighltly.py @@ -56,6 +56,7 @@ def launch_test(test_case, skip_list=None, skip_files=None, exe_list=None): test_command += skip_options return os.system(test_command) + skip_files_list = [ "test_autocast_xpu.py", "test_autograd_fallback_xpu.py",