From a1b86056194438dbab28bc6e2ab2834e9b675e22 Mon Sep 17 00:00:00 2001 From: min-jean-cho Date: Mon, 2 Sep 2024 19:14:57 -0700 Subject: [PATCH] [Windows] Enable Extended UTs (#859) Rebase https://github.com/intel/torch-xpu-ops/pull/844 with https://github.com/intel/torch-xpu-ops/pull/782, https://github.com/intel/torch-xpu-ops/pull/828 --- test/xpu/extended/run_test_with_skip.py | 6 +++++- test/xpu/extended/run_test_with_skip_arc.py | 17 +++++++++++------ test/xpu/extended/skip_list_win.py | 5 +++++ test/xpu/extended/skip_list_win_arc.py | 8 ++++++++ test/xpu/skip_list_win.py | 4 ---- test/xpu/skip_list_win_arc.py | 6 ------ 6 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 test/xpu/extended/skip_list_win.py create mode 100644 test/xpu/extended/skip_list_win_arc.py diff --git a/test/xpu/extended/run_test_with_skip.py b/test/xpu/extended/run_test_with_skip.py index 34e1ba4c1..9c7b2270f 100644 --- a/test/xpu/extended/run_test_with_skip.py +++ b/test/xpu/extended/run_test_with_skip.py @@ -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:]: @@ -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) diff --git a/test/xpu/extended/run_test_with_skip_arc.py b/test/xpu/extended/run_test_with_skip_arc.py index 87c88f6cc..30fd2c0e0 100644 --- a/test/xpu/extended/run_test_with_skip_arc.py +++ b/test/xpu/extended/run_test_with_skip_arc.py @@ -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) \ No newline at end of file diff --git a/test/xpu/extended/skip_list_win.py b/test/xpu/extended/skip_list_win.py new file mode 100644 index 000000000..e8faa008d --- /dev/null +++ b/test/xpu/extended/skip_list_win.py @@ -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 + ), +} diff --git a/test/xpu/extended/skip_list_win_arc.py b/test/xpu/extended/skip_list_win_arc.py new file mode 100644 index 000000000..9d9221a4d --- /dev/null +++ b/test/xpu/extended/skip_list_win_arc.py @@ -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", + ), +} diff --git a/test/xpu/skip_list_win.py b/test/xpu/skip_list_win.py index 35bf3014a..f6f74c817 100644 --- a/test/xpu/skip_list_win.py +++ b/test/xpu/skip_list_win.py @@ -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 - ), - } diff --git a/test/xpu/skip_list_win_arc.py b/test/xpu/skip_list_win_arc.py index 0b1d079e1..de5d03891 100644 --- a/test/xpu/skip_list_win_arc.py +++ b/test/xpu/skip_list_win_arc.py @@ -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",