From 12d7ee72a59a40d14d0c7a0815126051b7575bb6 Mon Sep 17 00:00:00 2001 From: Daisy Deng Date: Mon, 26 Aug 2024 08:43:06 +0800 Subject: [PATCH] filter fp64 dtypes for ARC (#819) filter double, complex128, float64 from the dtypeIfXPU and dtype_backward of op for ARC. Co-authored-by: Zhong, Ruijie --- test/xpu/xpu_test_utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/xpu/xpu_test_utils.py b/test/xpu/xpu_test_utils.py index c6c239cca..1683e8a2f 100644 --- a/test/xpu/xpu_test_utils.py +++ b/test/xpu/xpu_test_utils.py @@ -659,6 +659,11 @@ def align_supported_dtypes(self, db): backward_dtypes.add(bfloat16) opinfo.backward_dtypes = tuple(backward_dtypes) + if "has_fp64=0" in str(torch.xpu.get_device_properties(0)): + fp64_dtypes = [ torch.float64, torch.complex128, torch.double, ] + opinfo.dtypesIfXPU = set(filter(lambda x: (x not in fp64_dtypes), list(opinfo.dtypesIfXPU))) + opinfo.backward_dtypes = tuple(filter(lambda x: (x not in fp64_dtypes), list(opinfo.backward_dtypes))) + def __enter__(self): # Monkey patch until we have a fancy way