Skip to content

Commit

Permalink
[Windows] Enable Extended UTs (#859)
Browse files Browse the repository at this point in the history
Rebase #844 with
#782,
#828
  • Loading branch information
min-jean-cho authored Sep 3, 2024
1 parent b0c41fa commit a1b8605
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 17 deletions.
6 changes: 5 additions & 1 deletion test/xpu/extended/run_test_with_skip.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import os
import sys
from skip_list_common import skip_dict
from skip_list_win import skip_dict as skip_dict_win

IS_WINDOWS = sys.platform == "win32"

skip_list = skip_dict["test_ops_xpu.py"]
if IS_WINDOWS:
skip_list += skip_dict_win["test_ops_xpu.py"]

skip_options = " -k \"not " + skip_list[0]
for skip_case in skip_list[1:]:
Expand All @@ -11,7 +16,6 @@
skip_options += "\""

os.environ["PYTORCH_TEST_WITH_SLOW"]="1"

test_command = "pytest -v test_ops_xpu.py"
test_command += skip_options
res = os.system(test_command)
Expand Down
17 changes: 11 additions & 6 deletions test/xpu/extended/run_test_with_skip_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@
import sys
from skip_list_common import skip_dict
from skip_list_arc import skip_dict as skip_dict_specifical
from skip_list_win import skip_dict as skip_dict_win
from skip_list_win_arc import skip_dict as skip_dict_win_arc

IS_WINDOWS = sys.platform == "win32"

skip_list = skip_dict["test_ops_xpu.py"] + skip_dict_specifical["test_ops_xpu.py"]
if IS_WINDOWS:
skip_list += skip_dict_win["test_ops_xpu.py"] + skip_dict_win_arc["test_ops_xpu.py"]

skip_options = " -k 'not " + skip_list[0]
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 += "'"
skip_options += "\""

test_command = "PYTORCH_TEST_WITH_SLOW=1 pytest -v test_ops_xpu.py"
os.environ["PYTORCH_TEST_WITH_SLOW"]="1"
test_command = "pytest -v test_ops_xpu.py"
test_command += skip_options

res = os.system(test_command)
exit_code = os.WEXITSTATUS(res)
sys.exit(exit_code)
sys.exit(res)
5 changes: 5 additions & 0 deletions test/xpu/extended/skip_list_win.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
skip_dict = {
"test_ops_xpu.py": (
"test_compare_cpu_pow_xpu_bfloat16", # https://github.com/intel/torch-xpu-ops/pull/764
),
}
8 changes: 8 additions & 0 deletions test/xpu/extended/skip_list_win_arc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
skip_dict = {
# SYCL Compiler on Windows removed the following operations when '-cl-poison-unsupported-fp64-kernels' is on
# Hence, skip the following windows specific errors
"test_ops_xpu.py": (
"test_compare_cpu_sqrt_xpu_complex64",
"test_backward_nn_functional_adaptive_avg_pool2d_xpu_float32",
),
}
4 changes: 0 additions & 4 deletions test/xpu/skip_list_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,4 @@
"test_reference_numerics_large_sin_xpu_complex64",
"test_reference_numerics_small_acos_xpu_complex32",
),
"test_ops_xpu.py": (
"test_compare_cpu_pow_xpu_bfloat16", # https://github.com/intel/torch-xpu-ops/pull/764
),

}
6 changes: 0 additions & 6 deletions test/xpu/skip_list_win_arc.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
skip_dict = {
# SYCL Compiler on Windows removed the following operations when '-cl-poison-unsupported-fp64-kernels' is on
# Hence, skip the following windows specific errors
"test_ops_xpu.py": (
"test_compare_cpu_sqrt_xpu_complex64",
"test_backward_nn_functional_adaptive_avg_pool2d_xpu_float32",
),
"test_binary_ufuncs_xpu": (
"test_batch_vs_slicing___rpow___xpu_complex64",
"test_batch_vs_slicing__refs_pow_xpu_complex64",
Expand Down

0 comments on commit a1b8605

Please sign in to comment.