From 65300e88e2c06fb8ce078617db5c121ef7a60aa8 Mon Sep 17 00:00:00 2001 From: "Cheng, Penghui" Date: Tue, 17 Jun 2025 08:11:32 +0000 Subject: [PATCH 1/7] Add print message when UT is failed with segmentation fault Signed-off-by: Cheng, Penghui --- test/xpu/extended/run_test_with_skip.py | 2 ++ test/xpu/extended/run_test_with_skip_arc.py | 2 ++ test/xpu/extended/run_test_with_skip_bmg.py | 2 ++ test/xpu/extended/run_test_with_skip_lnl.py | 2 ++ test/xpu/extended/run_test_with_skip_mtl.py | 2 ++ test/xpu/run_test_with_only.py | 4 +++- test/xpu/run_test_with_skip_arc.py | 9 ++++++++- test/xpu/run_test_with_skip_bmg.py | 9 ++++++++- test/xpu/run_test_with_skip_lnl.py | 9 ++++++++- test/xpu/run_test_with_skip_mtl.py | 9 ++++++++- 10 files changed, 45 insertions(+), 5 deletions(-) diff --git a/test/xpu/extended/run_test_with_skip.py b/test/xpu/extended/run_test_with_skip.py index 0adbd6bee8..ddc3dd271e 100644 --- a/test/xpu/extended/run_test_with_skip.py +++ b/test/xpu/extended/run_test_with_skip.py @@ -20,4 +20,6 @@ test_command = "pytest --timeout 600 -v --junit-xml=./op_extended.xml test_ops_xpu.py" test_command += skip_options res = os.system(test_command) +if res: + print("".join("test_ops_xpu.py") + " have failures in extended UT") sys.exit(res) diff --git a/test/xpu/extended/run_test_with_skip_arc.py b/test/xpu/extended/run_test_with_skip_arc.py index c9110b0829..a54489dbd3 100644 --- a/test/xpu/extended/run_test_with_skip_arc.py +++ b/test/xpu/extended/run_test_with_skip_arc.py @@ -22,4 +22,6 @@ test_command = "pytest -v test_ops_xpu.py" test_command += skip_options res = os.system(test_command) +if res: + print("".join("test_ops_xpu.py") + " have failures in extended UT") sys.exit(res) diff --git a/test/xpu/extended/run_test_with_skip_bmg.py b/test/xpu/extended/run_test_with_skip_bmg.py index 7769c23872..c5f33f2927 100644 --- a/test/xpu/extended/run_test_with_skip_bmg.py +++ b/test/xpu/extended/run_test_with_skip_bmg.py @@ -20,4 +20,6 @@ os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"] res = pytest.main(test_command) +if res: + print("".join("test_ops_xpu.py") + " have failures in extended UT") sys.exit(res) diff --git a/test/xpu/extended/run_test_with_skip_lnl.py b/test/xpu/extended/run_test_with_skip_lnl.py index c0cffe62c5..4ece10b803 100644 --- a/test/xpu/extended/run_test_with_skip_lnl.py +++ b/test/xpu/extended/run_test_with_skip_lnl.py @@ -20,4 +20,6 @@ os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"] res = pytest.main(test_command) +if res: + print("".join("test_ops_xpu.py") + " have failures in extended UT") sys.exit(res) diff --git a/test/xpu/extended/run_test_with_skip_mtl.py b/test/xpu/extended/run_test_with_skip_mtl.py index e2683b64ce..11a31b4271 100644 --- a/test/xpu/extended/run_test_with_skip_mtl.py +++ b/test/xpu/extended/run_test_with_skip_mtl.py @@ -20,4 +20,6 @@ os.environ["PYTORCH_TEST_WITH_SLOW"] = "1" test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"] res = pytest.main(test_command) +if res: + print("".join("test_ops_xpu.py") + " have failures in extended UT") sys.exit(res) diff --git a/test/xpu/run_test_with_only.py b/test/xpu/run_test_with_only.py index 9d70896b11..00c453500a 100644 --- a/test/xpu/run_test_with_only.py +++ b/test/xpu/run_test_with_only.py @@ -51,7 +51,9 @@ def launch_test(test_case, skip_list=None, exe_list=None): "test_comprehensive_nn_functional_nll_loss_xpu_float64", "bincount", ) -res += launch_test("test_decomp_xpu.py", exe_list=execute_list) +res = launch_test("test_decomp_xpu.py", exe_list=execute_list) +if res: + print("".join("test_decomp_xpu.py") + " have failures in run_test_with_only.py") if os.name == "nt": sys.exit(res) diff --git a/test/xpu/run_test_with_skip_arc.py b/test/xpu/run_test_with_skip_arc.py index e3d38192bb..6777fcd536 100644 --- a/test/xpu/run_test_with_skip_arc.py +++ b/test/xpu/run_test_with_skip_arc.py @@ -8,6 +8,7 @@ from xpu_test_utils import launch_test res = 0 +fail_test = [] IS_WINDOWS = sys.platform == "win32" for key in skip_dict: @@ -18,7 +19,13 @@ skip_list += skip_dict_win[key] if IS_WINDOWS and key in skip_dict_win_arc: skip_list += skip_dict_win_arc[key] - res += launch_test(key, skip_list) + fail = launch_test(key, skip_list) + res += fail + if fail: + fail_test.append(key) + +if fail_test: + print(",".join(fail_test) + " have failures") if os.name == "nt": sys.exit(res) diff --git a/test/xpu/run_test_with_skip_bmg.py b/test/xpu/run_test_with_skip_bmg.py index 1e663191b5..668372f00f 100644 --- a/test/xpu/run_test_with_skip_bmg.py +++ b/test/xpu/run_test_with_skip_bmg.py @@ -7,6 +7,7 @@ from xpu_test_utils import launch_test res = 0 +fail_test = [] IS_WINDOWS = sys.platform == "win32" for key in skip_dict: @@ -15,7 +16,13 @@ skip_list += skip_dict_win[key] if IS_WINDOWS and key in skip_dict_win_bmg: skip_list += skip_dict_win_bmg[key] - res += launch_test(key, skip_list) + fail = launch_test(key, skip_list) + res += fail + if fail: + fail_test.append(key) + +if fail_test: + print(",".join(fail_test) + " have failures") if os.name == "nt": sys.exit(res) diff --git a/test/xpu/run_test_with_skip_lnl.py b/test/xpu/run_test_with_skip_lnl.py index 6b9e82b860..4589740a5a 100644 --- a/test/xpu/run_test_with_skip_lnl.py +++ b/test/xpu/run_test_with_skip_lnl.py @@ -7,6 +7,7 @@ from xpu_test_utils import launch_test res = 0 +fail_test = [] IS_WINDOWS = sys.platform == "win32" for key in skip_dict: @@ -15,7 +16,13 @@ skip_list += skip_dict_win[key] if IS_WINDOWS and key in skip_dict_win_lnl: skip_list += skip_dict_win_lnl[key] - res += launch_test(key, skip_list) + fail = launch_test(key, skip_list) + res += fail + if fail: + fail_test.append(key) + +if fail_test: + print(",".join(fail_test) + " have failures") if os.name == "nt": sys.exit(res) diff --git a/test/xpu/run_test_with_skip_mtl.py b/test/xpu/run_test_with_skip_mtl.py index a92ec2f5a0..19d154d57b 100644 --- a/test/xpu/run_test_with_skip_mtl.py +++ b/test/xpu/run_test_with_skip_mtl.py @@ -7,6 +7,7 @@ from xpu_test_utils import launch_test res = 0 +fail_test = [] IS_WINDOWS = sys.platform == "win32" for key in skip_dict: @@ -15,7 +16,13 @@ skip_list += skip_dict_specifical[key] if IS_WINDOWS and key in skip_dict_win: skip_list += skip_dict_win[key] - res += launch_test(key, skip_list) + fail = launch_test(key, skip_list) + res += fail + if fail: + fail_test.append(key) + +if fail_test: + print(",".join(fail_test) + " have failures") if os.name == "nt": sys.exit(res) From 1cd64b615dc5922b20ceec051c425f424d6449e9 Mon Sep 17 00:00:00 2001 From: "Cheng, Penghui" Date: Tue, 17 Jun 2025 16:29:38 +0800 Subject: [PATCH 2/7] Update test/xpu/extended/run_test_with_skip.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/xpu/extended/run_test_with_skip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xpu/extended/run_test_with_skip.py b/test/xpu/extended/run_test_with_skip.py index ddc3dd271e..865b0edd48 100644 --- a/test/xpu/extended/run_test_with_skip.py +++ b/test/xpu/extended/run_test_with_skip.py @@ -21,5 +21,5 @@ test_command += skip_options res = os.system(test_command) if res: - print("".join("test_ops_xpu.py") + " have failures in extended UT") + print("test_ops_xpu.py has failures in extended unit tests") sys.exit(res) From da23b9a2ac7b146b649bbfeb3947bf8948f3e0b4 Mon Sep 17 00:00:00 2001 From: "Cheng, Penghui" Date: Tue, 17 Jun 2025 16:29:52 +0800 Subject: [PATCH 3/7] Update test/xpu/extended/run_test_with_skip_arc.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/xpu/extended/run_test_with_skip_arc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xpu/extended/run_test_with_skip_arc.py b/test/xpu/extended/run_test_with_skip_arc.py index a54489dbd3..bca77b096e 100644 --- a/test/xpu/extended/run_test_with_skip_arc.py +++ b/test/xpu/extended/run_test_with_skip_arc.py @@ -23,5 +23,5 @@ test_command += skip_options res = os.system(test_command) if res: - print("".join("test_ops_xpu.py") + " have failures in extended UT") + print("test_ops_xpu.py has failures in extended unit tests") sys.exit(res) From 28b867b389573bc3fb756ac85b5ff64b9c57897e Mon Sep 17 00:00:00 2001 From: "Cheng, Penghui" Date: Tue, 17 Jun 2025 16:30:04 +0800 Subject: [PATCH 4/7] Update test/xpu/extended/run_test_with_skip_bmg.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/xpu/extended/run_test_with_skip_bmg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xpu/extended/run_test_with_skip_bmg.py b/test/xpu/extended/run_test_with_skip_bmg.py index c5f33f2927..37768d3405 100644 --- a/test/xpu/extended/run_test_with_skip_bmg.py +++ b/test/xpu/extended/run_test_with_skip_bmg.py @@ -21,5 +21,5 @@ test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"] res = pytest.main(test_command) if res: - print("".join("test_ops_xpu.py") + " have failures in extended UT") + print("test_ops_xpu.py has failures in extended UT") sys.exit(res) From f8226c3657b1f6e54f58513aec0fe33954e591b8 Mon Sep 17 00:00:00 2001 From: "Cheng, Penghui" Date: Tue, 17 Jun 2025 16:30:15 +0800 Subject: [PATCH 5/7] Update test/xpu/extended/run_test_with_skip_lnl.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/xpu/extended/run_test_with_skip_lnl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xpu/extended/run_test_with_skip_lnl.py b/test/xpu/extended/run_test_with_skip_lnl.py index 4ece10b803..d175cef1db 100644 --- a/test/xpu/extended/run_test_with_skip_lnl.py +++ b/test/xpu/extended/run_test_with_skip_lnl.py @@ -21,5 +21,5 @@ test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"] res = pytest.main(test_command) if res: - print("".join("test_ops_xpu.py") + " have failures in extended UT") + print("test_ops_xpu.py has failures in extended UT") sys.exit(res) From 438cd16e470dcb8610c54cafda42d7da6db7c9a9 Mon Sep 17 00:00:00 2001 From: "Cheng, Penghui" Date: Tue, 17 Jun 2025 16:30:26 +0800 Subject: [PATCH 6/7] Update test/xpu/extended/run_test_with_skip_mtl.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/xpu/extended/run_test_with_skip_mtl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xpu/extended/run_test_with_skip_mtl.py b/test/xpu/extended/run_test_with_skip_mtl.py index 11a31b4271..4b491579a3 100644 --- a/test/xpu/extended/run_test_with_skip_mtl.py +++ b/test/xpu/extended/run_test_with_skip_mtl.py @@ -21,5 +21,5 @@ test_command = ["-k", skip_options, "test_ops_xpu.py", "-v"] res = pytest.main(test_command) if res: - print("".join("test_ops_xpu.py") + " have failures in extended UT") + print("test_ops_xpu.py" + " have failures in extended UT") sys.exit(res) From 0ba0d1528d865e260f320f777d4cd0f2d6e47872 Mon Sep 17 00:00:00 2001 From: "Cheng, Penghui" Date: Tue, 17 Jun 2025 16:30:34 +0800 Subject: [PATCH 7/7] Update test/xpu/run_test_with_only.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/xpu/run_test_with_only.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/xpu/run_test_with_only.py b/test/xpu/run_test_with_only.py index 00c453500a..76540dd571 100644 --- a/test/xpu/run_test_with_only.py +++ b/test/xpu/run_test_with_only.py @@ -53,7 +53,7 @@ def launch_test(test_case, skip_list=None, exe_list=None): ) res = launch_test("test_decomp_xpu.py", exe_list=execute_list) if res: - print("".join("test_decomp_xpu.py") + " have failures in run_test_with_only.py") + print("test_decomp_xpu.py" + " have failures in run_test_with_only.py") if os.name == "nt": sys.exit(res)