Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
d3f32fa
modify build
mengfei25 Jul 16, 2025
bdc58d7
modify ut
mengfei25 Jul 16, 2025
b07b490
modify e2e
mengfei25 Jul 16, 2025
7b4582b
update
mengfei25 Jul 16, 2025
3ae4b09
update
mengfei25 Jul 16, 2025
fe06ca3
update
mengfei25 Jul 16, 2025
be531f7
Update nightly_ondemand.yml
mengfei25 Jul 16, 2025
1df6138
update
mengfei25 Jul 17, 2025
9fe4dcb
update
mengfei25 Jul 17, 2025
ef91984
update
mengfei25 Jul 17, 2025
01fbe46
update
mengfei25 Jul 17, 2025
191b5c0
update
mengfei25 Jul 17, 2025
f313b85
update
mengfei25 Jul 18, 2025
7d4488b
update
mengfei25 Jul 18, 2025
66e28da
update
mengfei25 Jul 18, 2025
8b22418
update
mengfei25 Jul 18, 2025
acf94d1
update
mengfei25 Jul 18, 2025
a6fa7da
update
mengfei25 Jul 18, 2025
053bed3
update
mengfei25 Jul 18, 2025
7ee8d4b
update
mengfei25 Jul 18, 2025
428e483
update
mengfei25 Jul 18, 2025
c483968
update
mengfei25 Jul 18, 2025
32474f8
update
mengfei25 Jul 18, 2025
5976099
update
mengfei25 Jul 18, 2025
28e53b2
update
mengfei25 Jul 18, 2025
2e9921e
update
mengfei25 Jul 18, 2025
b058b1a
update
mengfei25 Jul 18, 2025
93e5444
update
mengfei25 Jul 18, 2025
2aa5b11
Merge branch 'main' into mengfeil/containerd
mengfei25 Jul 18, 2025
8baec84
update
mengfei25 Jul 18, 2025
95709b9
Merge branch 'mengfeil/containerd' of https://github.com/intel/torch-…
mengfei25 Jul 18, 2025
d4c78aa
update
mengfei25 Jul 18, 2025
a8154f1
update
mengfei25 Jul 18, 2025
f25ecfe
update
mengfei25 Jul 18, 2025
e06e1bd
update
mengfei25 Jul 18, 2025
c437f29
update
mengfei25 Jul 18, 2025
0ae0bb1
update
mengfei25 Jul 18, 2025
d4da95d
update
mengfei25 Jul 18, 2025
db17d7d
update
mengfei25 Jul 18, 2025
b9c247a
update
mengfei25 Jul 18, 2025
a7d76ae
Merge branch 'main' into mengfeil/containerd
mengfei25 Jul 18, 2025
9ae98ea
update
mengfei25 Jul 18, 2025
c06f1ee
update
mengfei25 Jul 18, 2025
6e14f8b
update
mengfei25 Jul 21, 2025
9a621c5
update
mengfei25 Jul 21, 2025
bb17bab
update
mengfei25 Jul 21, 2025
981c744
update
mengfei25 Jul 21, 2025
6482077
update
mengfei25 Jul 21, 2025
ec0c1f2
update
mengfei25 Jul 21, 2025
1cc986e
update
mengfei25 Jul 21, 2025
b2b48c5
update
mengfei25 Jul 21, 2025
bccec93
update
mengfei25 Jul 21, 2025
9f604a7
update
mengfei25 Jul 21, 2025
8a78c7c
update
mengfei25 Jul 22, 2025
46d00c8
update
mengfei25 Jul 22, 2025
e3949d8
update
mengfei25 Jul 22, 2025
3f69213
update
mengfei25 Jul 22, 2025
e8b015a
update
mengfei25 Jul 22, 2025
bbd82cd
update
mengfei25 Jul 22, 2025
c144bab
get runner
mengfei25 Jul 22, 2025
40180c0
test env
mengfei25 Jul 22, 2025
54ea2f0
update
mengfei25 Jul 22, 2025
9b660b9
Revert "update"
mengfei25 Jul 22, 2025
7d025c0
update
mengfei25 Jul 22, 2025
dd23ceb
update
mengfei25 Jul 22, 2025
f21e4c9
Merge branch 'main' into mengfeil/containerd
mengfei25 Jul 22, 2025
de4a432
update
mengfei25 Jul 22, 2025
517c324
Merge branch 'mengfeil/containerd' of https://github.com/intel/torch-…
mengfei25 Jul 22, 2025
65cc01a
remove useless inputs for op benchmark
mengfei25 Jul 22, 2025
f727ef8
checkout torch-xpu-ops
mengfei25 Jul 22, 2025
18ada97
modify get runner
mengfei25 Jul 22, 2025
018f968
modify build
mengfei25 Jul 22, 2025
93fa112
modify build
mengfei25 Jul 23, 2025
ad8cc67
update
mengfei25 Jul 23, 2025
de0f557
Merge branch 'main' into mengfeil/containerd
mengfei25 Jul 23, 2025
7c9d3a3
update
mengfei25 Jul 23, 2025
2fc3b8e
update
mengfei25 Jul 23, 2025
78cedbf
update
mengfei25 Jul 23, 2025
c6bc928
update
mengfei25 Jul 23, 2025
9765fac
update
mengfei25 Jul 23, 2025
eda9634
modify ut
mengfei25 Jul 23, 2025
ec697f5
modify build
mengfei25 Jul 23, 2025
c1e4ca7
modify build
mengfei25 Jul 23, 2025
50e40fe
modify build
mengfei25 Jul 24, 2025
6173798
Merge branch 'main' into mengfeil/containerd
mengfei25 Jul 24, 2025
b3f6f0e
update
mengfei25 Jul 24, 2025
5848944
Merge branch 'mengfeil/containerd' of https://github.com/intel/torch-…
mengfei25 Jul 24, 2025
42da693
modify build
mengfei25 Jul 24, 2025
26b56db
modify build
mengfei25 Jul 24, 2025
77d8172
modify build
mengfei25 Jul 24, 2025
e9d551a
update
mengfei25 Jul 24, 2025
9649dfd
update
mengfei25 Jul 24, 2025
84a5132
update
mengfei25 Jul 24, 2025
ee18a1c
update
mengfei25 Jul 24, 2025
43fee42
update
mengfei25 Jul 24, 2025
e8f1c0d
update
mengfei25 Jul 24, 2025
517b081
update
mengfei25 Jul 25, 2025
ddecdf9
update
mengfei25 Jul 25, 2025
d1bf4cf
modify ut
mengfei25 Jul 25, 2025
d99668c
update
mengfei25 Jul 25, 2025
d0d1ceb
update
mengfei25 Jul 25, 2025
1f26538
update
mengfei25 Jul 25, 2025
d06b8db
update
mengfei25 Jul 25, 2025
70577e1
update
mengfei25 Jul 25, 2025
2467e9e
update
mengfei25 Jul 25, 2025
96ff039
update
mengfei25 Jul 25, 2025
da12ea0
update
mengfei25 Jul 25, 2025
4f6ecfd
modify ut
mengfei25 Jul 25, 2025
ba97507
modify ut
mengfei25 Jul 25, 2025
9896441
fix pip warnings
mengfei25 Jul 25, 2025
50467ee
modify ut logs path
mengfei25 Jul 25, 2025
5c62bc9
modify ut logs path
mengfei25 Jul 25, 2025
8b33c21
set run name for nightly and on-demand tests
mengfei25 Jul 25, 2025
f08c528
modify ut logs path
mengfei25 Jul 25, 2025
55bd5dc
ut summray always
mengfei25 Jul 25, 2025
dbd3a27
fix ut logs path
mengfei25 Jul 25, 2025
2e7680d
fix e2e summary permission
mengfei25 Jul 25, 2025
0a78df1
fix ut log path
mengfei25 Jul 25, 2025
074992f
update
mengfei25 Jul 25, 2025
b11510f
update
mengfei25 Jul 25, 2025
a18995b
modify e2e summary
mengfei25 Jul 25, 2025
754202d
modify e2e summary
mengfei25 Jul 25, 2025
27c5cff
modify e2e summary
mengfei25 Jul 25, 2025
92d7ff1
update
mengfei25 Jul 25, 2025
0fade31
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 4, 2025
56520ca
update
mengfei25 Aug 4, 2025
9117a0c
update
mengfei25 Aug 4, 2025
79155e5
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 4, 2025
587aa95
update
mengfei25 Aug 4, 2025
3b0b94d
update
mengfei25 Aug 4, 2025
e47b3e4
update
mengfei25 Aug 5, 2025
eafefa4
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 5, 2025
51578bd
enable pytest to survive crashing tests and potentially complete the …
mengfei25 Aug 6, 2025
75c99ff
update
mengfei25 Aug 6, 2025
15d0daf
Merge branch 'mengfeil/containerd' into mengfeil/ut_skip_crash
mengfei25 Aug 6, 2025
dcc4433
fix lint issue
mengfei25 Aug 6, 2025
e244cb1
Update pull.yml
mengfei25 Aug 6, 2025
47cbdf5
modify pt2e
mengfei25 Aug 7, 2025
37e652e
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 7, 2025
de15a3f
update
mengfei25 Aug 7, 2025
8445b8b
e2e test matrix tests
mengfei25 Aug 11, 2025
a145fa2
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 11, 2025
8fe34c5
modify e2e summary
mengfei25 Aug 11, 2025
bfc98da
update
mengfei25 Aug 11, 2025
8c66acd
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 11, 2025
8064126
update
mengfei25 Aug 11, 2025
1ea6a62
update
mengfei25 Aug 11, 2025
530af25
update
mengfei25 Aug 11, 2025
091678f
update
mengfei25 Aug 11, 2025
eaa4bc4
update
mengfei25 Aug 11, 2025
f70ef8a
update deps
mengfei25 Aug 11, 2025
a12045a
update
mengfei25 Aug 11, 2025
70415c2
modify cache dir
mengfei25 Aug 11, 2025
5fcc6c6
update
mengfei25 Aug 12, 2025
067ef5a
Rebase
mengfei25 Aug 12, 2025
263a393
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 12, 2025
18f22e0
update
mengfei25 Aug 12, 2025
2eb33ed
Merge branch 'mengfeil/containerd' of https://github.com/intel/torch-…
mengfei25 Aug 12, 2025
0add64e
update
mengfei25 Aug 12, 2025
8902540
update
mengfei25 Aug 13, 2025
0eda9f7
update
mengfei25 Aug 13, 2025
3631454
update
mengfei25 Aug 13, 2025
00a3720
Revert "update"
mengfei25 Aug 13, 2025
315544e
Rebase
mengfei25 Aug 13, 2025
0aab07a
update
mengfei25 Aug 13, 2025
29a9fd8
update
mengfei25 Aug 13, 2025
c69854f
update
mengfei25 Aug 13, 2025
3d98b0e
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 13, 2025
a6b2302
merge main
mengfei25 Aug 13, 2025
0a17050
update
mengfei25 Aug 13, 2025
a7257b0
modify e2e summary
mengfei25 Aug 14, 2025
88af21f
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 14, 2025
8a54cfa
modify on-demand test
mengfei25 Aug 14, 2025
82783de
Merge branch 'mengfeil/containerd' of https://github.com/intel/torch-…
mengfei25 Aug 14, 2025
23f097f
modify on-demand test
mengfei25 Aug 14, 2025
a047acc
rebase
mengfei25 Aug 14, 2025
21aedbf
Merge branch 'main' into mengfeil/containerd
mengfei25 Aug 14, 2025
7df6ea3
rebase
mengfei25 Aug 14, 2025
58122cd
rebase
mengfei25 Aug 14, 2025
72c4bb5
parallel 1 to skip crash only
mengfei25 Aug 14, 2025
d951abf
install pytest-xdist
mengfei25 Aug 14, 2025
d459b6e
modify
mengfei25 Aug 14, 2025
171cc61
modify
mengfei25 Aug 14, 2025
d50cf68
lint python
mengfei25 Aug 14, 2025
9d16096
Merge branch 'main' into mengfeil/ut_skip_crash
mengfei25 Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/scripts/check-ut.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ def parse_log_file(log_file):
return summary

def determine_category(ut):
if ut == 'op_regression':
return 'op_regression'
elif ut == 'op_regression_dev1':
return 'op_regression_dev1'
elif ut == 'op_extended':
return 'op_extended'
elif 'op_ut' in ut:
return 'op_ut'
if ut == 'ut_regression':
return 'ut_regression'
elif ut == 'xpu_dev1':
return 'xpu_dev1'
elif ut == 'ut_extended':
return 'ut_extended'
elif 'ut_op' in ut:
return 'ut_op'
else:
return 'unknown'

Expand Down
16 changes: 8 additions & 8 deletions .github/scripts/ut_result_check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
ut_suite="${1:-op_regression}" # op_regression / op_extended / op_ut / torch_xpu
ut_suite="${1:-ut_regression}" # ut_regression / ut_extended / ut_op / ut_torch

# usage
# compare_and_filter_logs <UT'log> <Known_issue.log> [output.log]
Expand Down Expand Up @@ -101,7 +101,7 @@ check_passed_known_issues() {
fi
}

if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1' || "${ut_suite}" == 'op_extended' || "${ut_suite}" == 'op_transformers' ]]; then
if [[ "${ut_suite}" == 'ut_regression' || "${ut_suite}" == 'xpu_dev1' || "${ut_suite}" == 'ut_extended' || "${ut_suite}" == 'ut_transformers' ]]; then
grep -E "FAILED" "${ut_suite}"_test.log | awk '{print $1}' | grep -v "FAILED" > ./"${ut_suite}"_failed.log
grep -E "have failures" "${ut_suite}"_test.log | awk '{print $1}' >> ./"${ut_suite}"_failed.log
grep -E "Timeout" "${ut_suite}"_test.log | grep "test" >> ./"${ut_suite}"_failed.log
Expand Down Expand Up @@ -131,7 +131,7 @@ if [[ "${ut_suite}" == 'op_regression' || "${ut_suite}" == 'op_regression_dev1'
echo -e "[PASS] UT ${ut_suite} test Pass"
fi
fi
if [[ "${ut_suite}" == 'op_ut' ]]; then
if [[ "${ut_suite}" == 'ut_op' ]]; then
grep -E "FAILED" op_ut_with_skip_test.log | awk '{print $1}' | grep -v "FAILED" > ./"${ut_suite}"_with_skip_test_failed.log
grep -E "have failures" op_ut_with_skip_test.log | awk '{print $1}' >> ./"${ut_suite}"_with_skip_test_failed.log
grep -E "Timeout" op_ut_with_skip_test.log | grep "test" >> ./"${ut_suite}"_with_skip_test_failed.log
Expand Down Expand Up @@ -175,8 +175,8 @@ if [[ "${ut_suite}" == 'op_ut' ]]; then
num_failed_with_only=$(wc -l < "./${ut_suite}_with_only_test_failed.log")
fi
((num_failed=num_failed_with_skip+num_failed_with_only))
grep "PASSED" op_ut_with_skip_test.log | awk '{print $1}' > ./"${ut_suite}"_with_skip_test_passed.log
grep "PASSED" op_ut_with_only_test.log | awk '{print $1}' > ./"${ut_suite}"_with_only_test_passed.log
grep "PASSED" ut_op_with_skip_test.log | awk '{print $1}' > ./"${ut_suite}"_with_skip_test_passed.log
grep "PASSED" ut_op_with_only_test.log | awk '{print $1}' > ./"${ut_suite}"_with_only_test_passed.log
num_passed_with_skip=$(wc -l < "./${ut_suite}_with_skip_test_passed.log")
num_passed_with_only=$(wc -l < "./${ut_suite}_with_only_test_passed.log")
((num_passed=num_passed_with_skip+num_passed_with_only))
Expand All @@ -187,13 +187,13 @@ if [[ "${ut_suite}" == 'op_ut' ]]; then
echo -e "[PASS] UT ${ut_suite} test Pass"
fi
fi
if [[ "${ut_suite}" == 'torch_xpu' ]]; then
if [[ "${ut_suite}" == 'ut_torch' ]]; 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
cd ../ut_log/ut_torch || exit
grep -E "FAILED|have failures" 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
Expand All @@ -204,7 +204,7 @@ if [[ "${ut_suite}" == 'torch_xpu' ]]; then
echo -e "========================================================================="
echo -e "Show Failed cases in ${ut_suite}"
echo -e "========================================================================="
cd ../ut_log/torch_xpu || exit
cd ../ut_log/ut_torch || 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)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/_linux_op_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Cleanup workspace
run: |
find ./ |grep -v "^\./$" |xargs rm -rf
- name: Checkout torch-xpu-ops
uses: actions/checkout@v4
- name: Prepare test env on ${{ needs.runner.outputs.hostname }}
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/_linux_ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ jobs:
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
HF_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
steps:
- name: Cleanup workspace
if: ${{ contains(inputs.ut, matrix.test) }}
run: |
find ./ |grep -v "^\./$" |xargs rm -rf
- name: Checkout torch-xpu-ops
if: ${{ contains(inputs.ut, matrix.test) }}
uses: actions/checkout@v4
- name: Prepare test env on ${{ needs.runner.outputs.hostname }}
uses: ./.github/actions/linux-testenv
Expand Down Expand Up @@ -168,18 +173,25 @@ jobs:
if: ${{ ! cancelled() }}
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
test: [ut_regression, ut_transformers, ut_extended, ut_op, ut_torch, ut_profiling, xpu_dev1, xpu_distributed]
env:
GH_TOKEN: ${{ github.token }}
UT_SKIP_ISSUE: 1624
steps:
- name: Checkout torch-xpu-ops
if: ${{ contains(inputs.ut, matrix.test) }}
uses: actions/checkout@v4
- name: Download XPU UT Logs
if: ${{ contains(inputs.ut, matrix.test) }}
uses: actions/download-artifact@v4
with:
name: Inductor-XPU-UT-Data-${{ github.event.pull_request.number || github.sha }}-${{ inputs.ut }}
path: ${{ github.workspace }}/ut_log
- name: Check UT Results
if: ${{ contains(inputs.ut, matrix.test) }}
shell: bash
run: |
repo="${{ github.repository }}"
Expand All @@ -192,7 +204,7 @@ jobs:
grep -Eo 'test[^[:space:]]+( \|\| [^[:space:]]+)?' | sed 's/ *|| */ /g' | sort -u > issues_temp.log
awk '$2 == "op_ut" {print $1}' issues_temp.log > issues_op_ut.log
cat issues_temp.log | awk '{print $1}' >> Known_issue.log
awk -F'::' '{print $1}' issues_op_ut.log | sort -u | paste -sd ',' >> Known_issue.log
awk -F'::' '{print $1}' issues_ut_op.log | sort -u | paste -sd ',' >> Known_issue.log
cp ${{ github.workspace }}/.github/scripts/ut_result_check.sh ./
bash ut_result_check.sh ${{ inputs.ut }}
- name: Upload Inductor XPU UT Log
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/_windows_ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
required: true
type: string
default: ''
description: UT scope. `op_regression,op_regression_dev1,op_extended,op_ut,torch_xpu` Delimiter is comma
description: UT scope. `ut_regression,xpu_dev1,ut_extended,ut_op,ut_torch` Delimiter is comma
python:
required: false
type: string
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
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'
if: contains(inputs.ut, 'ut_extended') || github.event_name == 'schedule'
shell: cmd
run: |
call "C:\ProgramData\miniforge3\Scripts\activate.bat"
Expand All @@ -169,7 +169,7 @@ jobs:
python run_test_with_skip_mtl.py

- name: Run Test XPU UT
if: contains(inputs.ut, 'torch_xpu') || github.event_name == 'schedule'
if: contains(inputs.ut, 'ut_torch') || github.event_name == 'schedule'
shell: cmd
run: |
call "C:\ProgramData\miniforge3\Scripts\activate.bat"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
needs: [conditions-filter, preci-lint-check]
uses: ./.github/workflows/_windows_ut.yml
with:
ut: op_extended,torch_xpu
ut: ut_extended,ut_torch
runner: Windows_CI
src_changed: ${{ needs.conditions-filter.outputs.src_changed }}
has_label: ${{ needs.conditions-filter.outputs.has_label }}
15 changes: 14 additions & 1 deletion test/xpu/extended/run_test_with_skip.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import sys

import torch
from skip_list_common import skip_dict
from skip_list_win import skip_dict as skip_dict_win

Expand All @@ -16,8 +17,20 @@
skip_options += skip_option
skip_options += '"'

# pytest options
xpu_num = torch.xpu.device_count()
parallel_options = (
" --dist worksteal "
+ " ".join([f"--tx popen//env:ZE_AFFINITY_MASK={x}" for x in range(xpu_num)])
if xpu_num > 1
else " -n 1 "
)
test_options = f" --timeout 600 --timeout_method=thread {parallel_options} "

os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"
test_command = "pytest --junit-xml=./op_extended.xml test_ops_xpu.py"
test_command = (
f" pytest {test_options} --junit-xml=./ut_extended.xml test_ops_xpu.py "
)
test_command += skip_options
res = os.system(test_command)
sys.exit(res)
25 changes: 22 additions & 3 deletions test/xpu/run_test_with_only.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
import os
import sys

import torch

# Cases in the file is too slow to run all suites on CPU. So add white list.


def launch_test(test_case, skip_list=None, exe_list=None):
os.environ["PYTORCH_ENABLE_XPU_FALLBACK"] = "1"
os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"

# pytest options
xpu_num = torch.xpu.device_count()
parallel_options = (
" --dist worksteal "
+ " ".join([f"--tx popen//env:ZE_AFFINITY_MASK={x}" for x in range(xpu_num)])
if xpu_num > 1
else " -n 1 "
)
test_options = f" --timeout 600 --timeout_method=thread {parallel_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 += '"'
test_command = (
"pytest --junit-xml=./op_ut_with_only.xml " + test_case + skip_options
f" pytest {test_options} --junit-xml=./ut_op_with_only.xml "
+ test_case
+ skip_options
)
return os.system(test_command)
elif exe_list is not None:
Expand All @@ -24,11 +39,15 @@ def launch_test(test_case, skip_list=None, exe_list=None):
exe_options += exe_option
exe_options += '"'
test_command = (
"pytest --junit-xml=./op_ut_with_only.xml " + test_case + exe_options
f" pytest {test_options} --junit-xml=./ut_op_with_only.xml "
+ test_case
+ exe_options
)
return os.system(test_command)
else:
test_command = "pytest --junit-xml=./op_ut_with_only.xml " + test_case
test_command = (
f" pytest {test_options} --junit-xml=./ut_op_with_only.xml " + test_case
)
return os.system(test_command)


Expand Down
20 changes: 17 additions & 3 deletions test/xpu/xpu_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,14 +1163,26 @@ def copy_tests(
def launch_test(test_case, skip_list=None, exe_list=None):
os.environ["PYTORCH_ENABLE_XPU_FALLBACK"] = "1"
os.environ["PYTORCH_TEST_WITH_SLOW"] = "1"

# pytest options
xpu_num = torch.xpu.device_count()
parallel_options = (
" --dist worksteal "
+ " ".join([f"--tx popen//env:ZE_AFFINITY_MASK={x}" for x in range(xpu_num)])
if xpu_num > 1
else " -n 1 "
)
test_options = f" --timeout 600 --timeout_method=thread {parallel_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 += '"'
test_command = (
f"pytest --junit-xml=./op_ut_with_skip_{test_case}.xml " + test_case
f" pytest {test_options} --junit-xml=./ut_op_with_skip_{test_case}.xml "
+ test_case
)
test_command += skip_options
elif exe_list is not None:
Expand All @@ -1180,11 +1192,13 @@ def launch_test(test_case, skip_list=None, exe_list=None):
exe_options += exe_option
exe_options += '"'
test_command = (
f"pytest --junit-xml=./op_ut_with_skip_{test_case}.xml " + test_case
f" pytest {test_options} --junit-xml=./ut_op_with_skip_{test_case}.xml "
+ test_case
)
test_command += exe_options
else:
test_command = (
f"pytest --junit-xml=./op_ut_with_skip_{test_case}.xml " + test_case
f" pytest {test_options} --junit-xml=./ut_op_with_skip_{test_case}.xml "
+ test_case
)
return os.system(test_command)
Loading