From 6cd1a0bbdd0283d68ecfeec6b0ffafdaf8ccb57d Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Fri, 29 Aug 2025 01:05:59 -0700 Subject: [PATCH 01/17] [CI] Enhance Windows CI --- .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 14129446e..5d2e36c60 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -112,7 +112,7 @@ jobs: call conda activate windows_ci cd ../pytorch pip install -r requirements.txt - pip install cmake setuptools==72.1.0 clang-format + pip install cmake setuptools clang-format pip install mkl-static mkl-include set USE_STATIC_MKL=1 copy "%CONDA_PREFIX%\Library\bin\libiomp*5md.dll" .\torch\lib @@ -123,7 +123,7 @@ jobs: set CMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ) python setup.py clean - set MAX_JOBS=4 + set MAX_JOBS=8 python setup.py bdist_wheel > build_torch_wheel_log.log echo "[INFO] begin to install torch whls" for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do ( From 652fbd41cd6b7c6abc7a3398c27d44a535674ee3 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Sun, 31 Aug 2025 20:22:01 -0700 Subject: [PATCH 02/17] udpate the result check --- .github/workflows/_windows_ut.yml | 107 +++++++++++++++++++- test/xpu/extended/run_test_with_skip_mtl.py | 1 + test/xpu/run_test_win_with_skip_mtl.py | 1 + 3 files changed, 105 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 5d2e36c60..037b575dc 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -123,7 +123,7 @@ jobs: set CMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ) python setup.py clean - set MAX_JOBS=8 + set MAX_JOBS=16 python setup.py bdist_wheel > build_torch_wheel_log.log echo "[INFO] begin to install torch whls" for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do ( @@ -141,24 +141,22 @@ jobs: python -c "import torch; print(torch.__config__.show())" python -c "import torch; print(torch.__config__.parallel_info())" python -c "import torch; print(torch.__config__.torch.xpu.device_count())" - - name: Upload Windows build log if: ${{ ! cancelled() }} uses: actions/upload-artifact@v4 with: name: Torch-XPU-Windows-Log-${{ github.event.pull_request.number || github.sha }} path: 'C:\actions-runner\_work\torch-xpu-ops\pytorch\build_torch_wheel_log.log' - - name: Upload Windows binary if: ${{ ! cancelled() }} uses: actions/upload-artifact@v4 with: name: Torch-XPU-Windows-Binary-${{ github.event.pull_request.number || github.sha }} path: 'C:\actions-runner\_work\torch-xpu-ops\pytorch\dist' - - name: Run XPU OP Extended UT if: contains(inputs.ut, 'op_extended') || 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" @@ -168,9 +166,12 @@ jobs: cd ../pytorch/third_party/torch-xpu-ops/test/xpu/extended/ python run_test_with_skip_mtl.py + if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" + copy op_extended.xml %GITHUB_WORKSPACE%\ut_log /Y - name: Run Test XPU UT if: contains(inputs.ut, 'torch_xpu') || 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" @@ -178,3 +179,101 @@ jobs: call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" cd ../pytorch/third_party/torch-xpu-ops/test/xpu/ python run_test_win_with_skip_mtl.py + + if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" + copy test_xpu.xml %GITHUB_WORKSPACE%\ut_log /Y + - name: UT Test Results Summary + shell: cmd + run: | + call conda activate windows_ci + pip install junitparser + for %%f in ("%GITHUB_WORKSPACE%/ut_log/*.xml") do ( + python ./.github/scripts/check-ut.py "%%f" >> "%GITHUB_STEP_SUMMARY%" + ) + @echo off + + REM Check the failure logs + if exist "%GITHUB_WORKSPACE%\failures*.log" ( + echo Exist Failure logs + echo Found Failure logs as below: + for %%f in ("%GITHUB_WORKSPACE%\failures*.log") do ( + echo - %%f + copy "%%f" "%GITHUB_WORKSPACE%\ut_log\" + ) + echo Failure logs Copied + ) else ( + echo No Failure logs + ) + + REM Copied the passed logs + if exist "passed*.log" ( + copy "passed*.log" "%GITHUB_WORKSPACE%\ut_log\" + echo Passed logs Copied + ) else ( + echo No Passed logs + ) + + REM Copied the Summary logs + if exist "category*.log" ( + copy "category*.log" "%GITHUB_WORKSPACE%\ut_log\" + echo Category logs Copied + ) else ( + echo No Category logs + ) + - name: Upload Inductor XPU UT Log + if: ${{ ! cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows + path: "%GITHUB_WORKSPACE%/ut_log" + if-no-files-found: ignore + + summary: + needs: [ut_test] + runs-on: ubuntu-24.04 + timeout-minutes: 30 + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: Checkout torch-xpu-ops + uses: actions/checkout@v4 + - name: Download XPU UT Logs + uses: actions/download-artifact@v4 + with: + name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows + path: ${{ github.workspace }}/ut_log + - name: Check UT Results + shell: bash + run: | + ls -al ${{ github.workspace }}/ut_log + cd ${{ github.workspace }}/ut_log + + for log_file in "${{ github.workspace }}/ut_log"/{failures,passed,category}_"${{ inputs.ut }}".log; do + [[ -f "$log_file" ]] && cp "$log_file" ./ + done + + # get skipped known issues + count=$(gh api "repos/${{ github.repository }}/issues?labels=skipped" --jq 'length') + if [ "$count" -gt 0 ]; then + echo -e "$count issues with skipped label found" + gh api "repos/${{ github.repository }}/issues?labels=skipped" \ + --jq '.[] | select(.pull_request == null) | "Issue #\(.number): \(.title)\n\(.body)\n"' > issues.log + fi + + cp ${{ github.workspace }}/.github/scripts/ut_result_check.sh ./ + for ut_name in $(echo ${{ inputs.ut }} |sed 's/,/ /g') + do + awk -v r="${ut_name}" 'BEGIN{ print_row = 0 }{ + if ( ! ( $0 ~ /[a-zA-Z0-9]/ ) ) { print_row = 0 }; + if ( print_row == 1 && $1 ~ r ) { print $0 }; + if ( $0 ~ /Cases:/ ) { print_row = 1 }; + }' issues.log > Known_issue.log + bash ut_result_check.sh ${ut_name} + done + - name: Upload Inductor XPU UT Log + if: ${{ ! cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows + path: ${{ github.workspace }}/ut_log + overwrite: true diff --git a/test/xpu/extended/run_test_with_skip_mtl.py b/test/xpu/extended/run_test_with_skip_mtl.py index e2683b64c..4b6eaa596 100644 --- a/test/xpu/extended/run_test_with_skip_mtl.py +++ b/test/xpu/extended/run_test_with_skip_mtl.py @@ -19,5 +19,6 @@ os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"] +test_command.extend(["--junit-xml", "./op_extended.xml"]) res = pytest.main(test_command) sys.exit(res) diff --git a/test/xpu/run_test_win_with_skip_mtl.py b/test/xpu/run_test_win_with_skip_mtl.py index 4ba56dba3..06a4849a6 100644 --- a/test/xpu/run_test_win_with_skip_mtl.py +++ b/test/xpu/run_test_win_with_skip_mtl.py @@ -18,6 +18,7 @@ sys.stdout = StringIO() test_command = ["-k", skip_options, "../../../../test/test_xpu.py", "-v"] +test_command.extend(["--junit-xml", "./test_xpu.xml"]) res = pytest.main(test_command) output = sys.stdout.getvalue() From 2f9fcbd96a54a57fe6bc75ab205a4c426ce0d371 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 1 Sep 2025 02:00:34 -0700 Subject: [PATCH 03/17] test parallel method --- .github/workflows/_windows_ut.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 037b575dc..ef836949e 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -124,6 +124,7 @@ jobs: ) python setup.py clean set MAX_JOBS=16 + set CMAKE_BUILD_PARALLEL_LEVEL=16 python setup.py bdist_wheel > build_torch_wheel_log.log echo "[INFO] begin to install torch whls" for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do ( @@ -187,8 +188,9 @@ jobs: run: | call conda activate windows_ci pip install junitparser - for %%f in ("%GITHUB_WORKSPACE%/ut_log/*.xml") do ( - python ./.github/scripts/check-ut.py "%%f" >> "%GITHUB_STEP_SUMMARY%" + echo "GITHUB_WORKSPACE: %GITHUB_WORKSPACE%" + for %i in ("%GITHUB_WORKSPACE%\ut_log\*.xml") do ( + python .\.github\scripts\check-ut.py "%i" >> "%GITHUB_STEP_SUMMARY%" ) @echo off @@ -225,7 +227,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows - path: "%GITHUB_WORKSPACE%/ut_log" + path: "%GITHUB_WORKSPACE%\ut_log" if-no-files-found: ignore summary: From d39d29b29d4003c5412f746a027700943894bf94 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 1 Sep 2025 02:04:05 -0700 Subject: [PATCH 04/17] fix the syntax 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 ef836949e..17ddb4d10 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -227,7 +227,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-Windows - path: "%GITHUB_WORKSPACE%\ut_log" + path: "${{ github.workspace }}/ut_log" if-no-files-found: ignore summary: From f948b29809b13c5122cced9bf436e1e4ea4ea60e Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 1 Sep 2025 18:17:48 -0700 Subject: [PATCH 05/17] test new max_job --- .github/workflows/_windows_ut.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 17ddb4d10..da9fd098d 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -123,8 +123,7 @@ jobs: set CMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ) python setup.py clean - set MAX_JOBS=16 - set CMAKE_BUILD_PARALLEL_LEVEL=16 + set MAX_JOBS=32 python setup.py bdist_wheel > build_torch_wheel_log.log echo "[INFO] begin to install torch whls" for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do ( From a50fa1a40190bb9bbf9286fcbe9572fb8e83ed3a Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 1 Sep 2025 23:17:26 -0700 Subject: [PATCH 06/17] fix the xml path --- .github/workflows/_windows_ut.yml | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index da9fd098d..e2188e753 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -188,8 +188,8 @@ jobs: call conda activate windows_ci pip install junitparser echo "GITHUB_WORKSPACE: %GITHUB_WORKSPACE%" - for %i in ("%GITHUB_WORKSPACE%\ut_log\*.xml") do ( - python .\.github\scripts\check-ut.py "%i" >> "%GITHUB_STEP_SUMMARY%" + for %%i in ("%GITHUB_WORKSPACE%\ut_log\*.xml") do ( + python .\.github\scripts\check-ut.py "%%i" >> "%GITHUB_STEP_SUMMARY%" ) @echo off @@ -202,25 +202,25 @@ jobs: copy "%%f" "%GITHUB_WORKSPACE%\ut_log\" ) echo Failure logs Copied - ) else ( - echo No Failure logs - ) + ) else ( + echo No Failure logs + ) - REM Copied the passed logs - if exist "passed*.log" ( - copy "passed*.log" "%GITHUB_WORKSPACE%\ut_log\" - echo Passed logs Copied - ) else ( - echo No Passed logs - ) + REM Copied the passed logs + if exist "passed*.log" ( + copy "passed*.log" "%GITHUB_WORKSPACE%\ut_log\" + echo Passed logs Copied + ) else ( + echo No Passed logs + ) - REM Copied the Summary logs - if exist "category*.log" ( - copy "category*.log" "%GITHUB_WORKSPACE%\ut_log\" - echo Category logs Copied - ) else ( - echo No Category logs - ) + REM Copied the Summary logs + if exist "category*.log" ( + copy "category*.log" "%GITHUB_WORKSPACE%\ut_log\" + echo Category logs Copied + ) else ( + echo No Category logs + ) - name: Upload Inductor XPU UT Log if: ${{ ! cancelled() }} uses: actions/upload-artifact@v4 From e06c88fddaa4d6ca08594f7dade42893b2225e3d Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Thu, 4 Sep 2025 00:00:21 -0700 Subject: [PATCH 07/17] update result check --- .github/scripts/ut_result_check.sh | 31 +----------------------------- .github/workflows/_windows_ut.yml | 2 +- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/scripts/ut_result_check.sh b/.github/scripts/ut_result_check.sh index efdd92dcb..8287a0c9a 100644 --- a/.github/scripts/ut_result_check.sh +++ b/.github/scripts/ut_result_check.sh @@ -115,7 +115,7 @@ check_test_cases() { } -if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1' || "${ut_suite}" == 'op_extended' || "${ut_suite}" == 'op_transformers' || "${ut_suite}" == 'op_ut' ]]; then +if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1' || "${ut_suite}" == 'op_extended' || "${ut_suite}" == 'op_transformers' || "${ut_suite}" == 'op_ut' || "${ut_suite}" == 'torch_xpu' ]]; then echo -e "=========================================================================" echo -e "Show Failed cases in ${ut_suite}" echo -e "=========================================================================" @@ -188,35 +188,6 @@ if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1' fi fi -if [[ "${ut_suite}" == 'torch_xpu' ]]; then - echo "Pytorch XPU binary UT checking" - cd ../../pytorch || exit - for xpu_case in build/bin/*{xpu,sycl}*; do - if [[ "$xpu_case" != *"*"* && "$xpu_case" != *.so && "$xpu_case" != *.a ]]; then - case_name=$(basename "$xpu_case") - cd ../ut_log/torch_xpu || exit - grep -E "FAILED" binary_ut_"${ut_suite}"_"${case_name}"_test.log | awk '{print $2}' > ./binary_ut_"${ut_suite}"_"${case_name}"_failed.log - wc -l < "./binary_ut_${ut_suite}_${case_name}_failed.log" | tee -a ./binary_ut_"${ut_suite}"_failed_summary.log - grep -E "PASSED|Pass" binary_ut_"${ut_suite}"_"${case_name}"_test.log | awk '{print $2}' > ./binary_ut_"${ut_suite}"_"${case_name}"_passed.log - wc -l < "./binary_ut_${ut_suite}_${case_name}_passed.log" | tee -a ./binary_ut_"${ut_suite}"_passed_summary.log - cd - || exit - fi - done - echo -e "=========================================================================" - echo -e "Show Failed cases in ${ut_suite}" - echo -e "=========================================================================" - cd ../ut_log/torch_xpu || exit - cat "./binary_ut_${ut_suite}_${case_name}_failed.log" - num_failed_binary_ut=$(awk '{sum += $1};END {print sum}' binary_ut_"${ut_suite}"_failed_summary.log) - num_passed_binary_ut=$(awk '{sum += $1};END {print sum}' binary_ut_"${ut_suite}"_passed_summary.log) - ((num_failed=num_failed_binary_ut)) - if [[ $num_failed -gt 0 ]] || [[ $num_passed_binary_ut -le 0 ]]; then - echo -e "[ERROR] UT ${ut_suite} test Fail" - exit 1 - else - echo -e "[PASS] UT ${ut_suite} test Pass" - fi -fi if [[ "${ut_suite}" == 'xpu_distributed' ]]; then grep -E "^FAILED" xpu_distributed_test.log | awk '{print $2}' > ./"${ut_suite}"_xpu_distributed_test_failed.log grep "PASSED" xpu_distributed_test.log | awk '{print $1}' > ./"${ut_suite}"_xpu_distributed_test_passed.log diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index e2188e753..a2601ee48 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -123,7 +123,7 @@ jobs: set CMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ) python setup.py clean - set MAX_JOBS=32 + set MAX_JOBS=16 python setup.py bdist_wheel > build_torch_wheel_log.log echo "[INFO] begin to install torch whls" for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do ( From b2cd90f8891bd16eada501556682bc84cef85284 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Thu, 4 Sep 2025 18:32:23 -0700 Subject: [PATCH 08/17] test maxjobs=32 --- .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 a2601ee48..eeae6e41b 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -123,7 +123,7 @@ jobs: set CMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ) python setup.py clean - set MAX_JOBS=16 + set MAX_JOBS=32 python setup.py bdist_wheel > build_torch_wheel_log.log echo "[INFO] begin to install torch whls" for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do ( @@ -249,7 +249,7 @@ jobs: ls -al ${{ github.workspace }}/ut_log cd ${{ github.workspace }}/ut_log - for log_file in "${{ github.workspace }}/ut_log"/{failures,passed,category}_"${{ inputs.ut }}".log; do + for log_file in "${{ github.workspace }}/ut_log"/{failures,passed,category}_*.log; do [[ -f "$log_file" ]] && cp "$log_file" ./ done From 04b4eed7fe9b66e929e94b7f0c9cf4a25b109b57 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Fri, 5 Sep 2025 00:02:20 -0700 Subject: [PATCH 09/17] fix the log copy --- .github/scripts/check-ut.py | 4 ++-- .github/workflows/_windows_ut.yml | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/scripts/check-ut.py b/.github/scripts/check-ut.py index b90ba4353..c21f9ceda 100644 --- a/.github/scripts/check-ut.py +++ b/.github/scripts/check-ut.py @@ -138,7 +138,6 @@ def print_failures(failure_list=None): def generate_failures_log(): if not failures: - print("No failures found, skipping log file creation.") return for case in failures: @@ -245,6 +244,8 @@ def determine_category(ut): return 'op_extended' elif ut == 'op_transformers': return 'op_transformers' + elif ut == 'test_xpu': + return 'test_xpu' elif 'op_ut' in ut: return 'op_ut' else: @@ -296,7 +297,6 @@ def process_xml_file(xml_file): def generate_passed_log(): if not passed_cases: - print("No passed cases found, skipping log file creation.") return for category, category_passed in passed_by_category.items(): diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index eeae6e41b..f348f7f71 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -249,10 +249,6 @@ jobs: ls -al ${{ github.workspace }}/ut_log cd ${{ github.workspace }}/ut_log - for log_file in "${{ github.workspace }}/ut_log"/{failures,passed,category}_*.log; do - [[ -f "$log_file" ]] && cp "$log_file" ./ - done - # get skipped known issues count=$(gh api "repos/${{ github.repository }}/issues?labels=skipped" --jq 'length') if [ "$count" -gt 0 ]; then From 1b761cbaef9f80b81f255373f5b8f32772bb3dce Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Sun, 7 Sep 2025 19:06:36 -0700 Subject: [PATCH 10/17] make results check for windows log --- .github/scripts/ut_result_check.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/scripts/ut_result_check.sh b/.github/scripts/ut_result_check.sh index 8287a0c9a..1568084d0 100644 --- a/.github/scripts/ut_result_check.sh +++ b/.github/scripts/ut_result_check.sh @@ -25,6 +25,10 @@ check_new_failed() { # Filter the same content from file_UT as file_known_issue echo "Filtering $file_known_issue for $file_UT" + if grep -q $'\r' "$file_UT"; then + echo "Detected log from windows" + sed -i 's/\r$//' "$file_UT" + fi grep -vFxf "$file_known_issue" "$file_UT" > "$output_file" echo -e "\n\033[1;31m[New failed cases Summary]\033[0m" From c87ec0849b77f113e7ba9dbd5ab28acac4d75a85 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Sun, 7 Sep 2025 20:21:29 -0700 Subject: [PATCH 11/17] fix the pass result show --- .github/scripts/ut_result_check.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/scripts/ut_result_check.sh b/.github/scripts/ut_result_check.sh index 1568084d0..b279d13d3 100644 --- a/.github/scripts/ut_result_check.sh +++ b/.github/scripts/ut_result_check.sh @@ -58,6 +58,10 @@ check_passed_known_issues() { return 1 fi echo "Checking for known issues that are now passing in $file_passed_UT" + if grep -q $'\r' "$file_passed_UT"; then + echo "Detected log from windows" + sed -i 's/\r$//' "$file_passed_UT" + fi grep -Fxf "$file_passed_UT" "$file_known_issue" > "$output_file" echo -e "\n\033[1;32m[New passed cases Summary]\033[0m" if [[ -s "$output_file" ]]; then @@ -78,6 +82,7 @@ check_test_cases() { ["op_regression_dev1"]=1 ["op_transformers"]=237 ["op_ut"]=120408 + ["test_xpu"]=69 ) if [[ ! -f "$log_file" ]]; then From b1bfebb2e3a4458ea50d09f40555b8d60db1636e Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 8 Sep 2025 01:37:42 -0700 Subject: [PATCH 12/17] fix the typo issue --- .github/scripts/ut_result_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/ut_result_check.sh b/.github/scripts/ut_result_check.sh index b279d13d3..0e6b95ec4 100644 --- a/.github/scripts/ut_result_check.sh +++ b/.github/scripts/ut_result_check.sh @@ -124,7 +124,7 @@ check_test_cases() { } -if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1' || "${ut_suite}" == 'op_extended' || "${ut_suite}" == 'op_transformers' || "${ut_suite}" == 'op_ut' || "${ut_suite}" == 'torch_xpu' ]]; then +if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1' || "${ut_suite}" == 'op_extended' || "${ut_suite}" == 'op_transformers' || "${ut_suite}" == 'op_ut' || "${ut_suite}" == 'test_xpu' ]]; then echo -e "=========================================================================" echo -e "Show Failed cases in ${ut_suite}" echo -e "=========================================================================" From 1705ac422c76909e46cc2fca82f67cadc8f94032 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 8 Sep 2025 01:44:37 -0700 Subject: [PATCH 13/17] fix the typo issue --- .github/workflows/_windows_ut.yml | 2 +- .github/workflows/nightly_ondemand.yml | 2 +- .github/workflows/pull.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index f348f7f71..aaf472b16 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -169,7 +169,7 @@ jobs: if not exist "%GITHUB_WORKSPACE%\ut_log" mkdir "%GITHUB_WORKSPACE%\ut_log" copy op_extended.xml %GITHUB_WORKSPACE%\ut_log /Y - name: Run Test XPU UT - if: contains(inputs.ut, 'torch_xpu') || github.event_name == 'schedule' + if: contains(inputs.ut, 'test_xpu') || github.event_name == 'schedule' shell: cmd continue-on-error: true run: | diff --git a/.github/workflows/nightly_ondemand.yml b/.github/workflows/nightly_ondemand.yml index 51ef59776..e5174af4f 100644 --- a/.github/workflows/nightly_ondemand.yml +++ b/.github/workflows/nightly_ondemand.yml @@ -205,7 +205,7 @@ jobs: needs: [Conditions-Filter] uses: ./.github/workflows/_windows_ut.yml with: - ut: 'op_extended,torch_xpu' + ut: 'op_extended,test_xpu' python: ${{ needs.Conditions-Filter.outputs.python }} src_changed: false has_label: true diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index bfb2d913a..8018abcf9 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -154,7 +154,7 @@ jobs: needs: [conditions-filter, preci-lint-check] uses: ./.github/workflows/_windows_ut.yml with: - ut: op_extended,torch_xpu + ut: op_extended,test_xpu runner: Windows_CI src_changed: ${{ needs.conditions-filter.outputs.src_changed }} has_label: ${{ needs.conditions-filter.outputs.has_label }} From b17ef50493d4624ac4faab353b9d3e72c98eafcd Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 8 Sep 2025 21:35:58 -0700 Subject: [PATCH 14/17] separate the windows and linux skip list --- .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 aaf472b16..8c0c7e5f6 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -250,10 +250,10 @@ jobs: cd ${{ github.workspace }}/ut_log # get skipped known issues - count=$(gh api "repos/${{ github.repository }}/issues?labels=skipped" --jq 'length') + count=$(gh api "repos/${{ github.repository }}/issues?labels=skipped_windows --jq 'length') if [ "$count" -gt 0 ]; then echo -e "$count issues with skipped label found" - gh api "repos/${{ github.repository }}/issues?labels=skipped" \ + gh api "repos/${{ github.repository }}/issues?labels=skipped_windows" \ --jq '.[] | select(.pull_request == null) | "Issue #\(.number): \(.title)\n\(.body)\n"' > issues.log fi From d2a9217f713287d341c11d171b11b4d1874fd199 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 8 Sep 2025 21:42:45 -0700 Subject: [PATCH 15/17] make result check more robust --- .github/workflows/_windows_ut.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/_windows_ut.yml b/.github/workflows/_windows_ut.yml index 8c0c7e5f6..dfffd85aa 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -260,11 +260,16 @@ jobs: cp ${{ github.workspace }}/.github/scripts/ut_result_check.sh ./ for ut_name in $(echo ${{ inputs.ut }} |sed 's/,/ /g') do - awk -v r="${ut_name}" 'BEGIN{ print_row = 0 }{ - if ( ! ( $0 ~ /[a-zA-Z0-9]/ ) ) { print_row = 0 }; - if ( print_row == 1 && $1 ~ r ) { print $0 }; - if ( $0 ~ /Cases:/ ) { print_row = 1 }; - }' issues.log > Known_issue.log + touch Known_issue.log + if [ -f "issues.log" ]; then + awk -v r="${ut_name}" 'BEGIN{ print_row = 0 }{ + if ( ! ( $0 ~ /[a-zA-Z0-9]/ ) ) { print_row = 0 }; + if ( print_row == 1 && $1 ~ r ) { print $0 }; + if ( $0 ~ /Cases:/ ) { print_row = 1 }; + }' issues.log > Known_issue.log + else + echo "Info: issues.log not found or empty, using empty Known_issue.log" + fi bash ut_result_check.sh ${ut_name} done - name: Upload Inductor XPU UT Log From 8204d7d359b7b24c51b2fbb70f5f8b9909ccf568 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Mon, 8 Sep 2025 22:49:33 -0700 Subject: [PATCH 16/17] set AOT target --- .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 dfffd85aa..def2afafc 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -124,6 +124,7 @@ jobs: ) python setup.py clean set MAX_JOBS=32 + set TORCH_XPU_ARCH_LIST=mtl-h,bmg,lnl-m python setup.py bdist_wheel > build_torch_wheel_log.log echo "[INFO] begin to install torch whls" for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do ( From 82a4bab02820905feb23005d6912493544b3c6d8 Mon Sep 17 00:00:00 2001 From: "Zhong, Ruijie" Date: Tue, 9 Sep 2025 18:25:49 -0700 Subject: [PATCH 17/17] fix the typo 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 def2afafc..e650e32d1 100644 --- a/.github/workflows/_windows_ut.yml +++ b/.github/workflows/_windows_ut.yml @@ -251,7 +251,7 @@ jobs: cd ${{ github.workspace }}/ut_log # get skipped known issues - count=$(gh api "repos/${{ github.repository }}/issues?labels=skipped_windows --jq 'length') + count=$(gh api "repos/${{ github.repository }}/issues?labels=skipped_windows" --jq 'length') if [ "$count" -gt 0 ]; then echo -e "$count issues with skipped label found" gh api "repos/${{ github.repository }}/issues?labels=skipped_windows" \