From 89c783dbab76f47ecdbefd52cae93115a9e3c34f Mon Sep 17 00:00:00 2001 From: helen88 Date: Fri, 24 Jun 2022 15:56:46 +0800 Subject: [PATCH] modify xpu unittest to support fp64, *test=kunlun (#43772) * modify xpu unittest to support fp64, *test=kunlun * modify xpu unittest to support fp64 for KL2, *test=kunlun * modify xpu unittest to support fp64, *test=kunlun * modify xpu unittest to support fp64, *test=kunlun --- .../tests/unittests/xpu/get_test_cover_info.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/xpu/get_test_cover_info.py b/python/paddle/fluid/tests/unittests/xpu/get_test_cover_info.py index 0c3056ca8a..d92378f60f 100644 --- a/python/paddle/fluid/tests/unittests/xpu/get_test_cover_info.py +++ b/python/paddle/fluid/tests/unittests/xpu/get_test_cover_info.py @@ -83,7 +83,7 @@ type_dict_str_to_numpy = { } xpu_test_op_white_list = [] -xpu_test_type_white_list = ['float64'] +xpu_test_device_type_white_list = ['xpu1_float64'] xpu_test_op_type_white_list = ['dropout_float16', 'dropout_grad_float16'] xpu_test_device_op_white_list = [] xpu_test_device_op_type_white_list = [] @@ -106,7 +106,18 @@ def get_op_white_list(): def get_type_white_list(): - type_white_list = xpu_test_type_white_list + xpu_version = core.get_xpu_device_version(0) + version_str = "xpu2" if xpu_version == core.XPUVersion.XPU2 else "xpu1" + xpu1_type_white_list = [] + xpu2_type_white_list = [] + for device_type in xpu_test_device_type_white_list: + device, t_type = device_type.split("_") + if "xpu1" == device: + xpu1_type_white_list.append(t_type) + else: + xpu2_type_white_list.append(t_type) + + type_white_list = xpu1_type_white_list if version_str == "xpu1" else xpu2_type_white_list if os.getenv('XPU_TEST_TYPE_WHITE_LIST') is not None: type_white_list.extend( os.getenv('XPU_TEST_TYPE_WHITE_LIST').strip().split(',')) -- GitLab