Skip to content

Commit

Permalink
filter fp64 dtypes for ARC (#819)
Browse files Browse the repository at this point in the history
filter double, complex128, float64 from the dtypeIfXPU and
dtype_backward of op for ARC.

Co-authored-by: Zhong, Ruijie <[email protected]>
  • Loading branch information
daisyden and RUIJIEZHONG66166 authored Aug 26, 2024
1 parent aae765a commit 12d7ee7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/xpu/xpu_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 12d7ee7

Please sign in to comment.