Skip to content

Commit 406c966

Browse files
Merge pull request #663 from gongchensu/feature/moore_adapt
Issue/658 - Update test tolerances and remove device-specific dtype f…
2 parents 3aeee03 + e00e65e commit 406c966

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

test/infinicore/ops/matmul.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# Tolerance configuration
3434
_TOLERANCE_MAP = {
3535
infinicore.float16: {"atol": 0, "rtol": 1e-2},
36-
infinicore.float32: {"atol": 0, "rtol": 1e-3},
36+
infinicore.float32: {"atol": 1e-4, "rtol": 1e-3},
3737
infinicore.bfloat16: {"atol": 0, "rtol": 5e-2},
3838
}
3939

test/infiniop/libinfiniop/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,8 @@ def debug(actual, desired, atol=0, rtol=1e-2, equal_nan=False, verbose=True):
463463

464464

465465
def filter_tensor_dtypes_by_device(device, tensor_dtypes):
466-
if device in (InfiniDeviceEnum.CPU, InfiniDeviceEnum.NVIDIA):
466+
if device in (InfiniDeviceEnum.CPU, InfiniDeviceEnum.NVIDIA, InfiniDeviceEnum.METAX, InfiniDeviceEnum.ASCEND, InfiniDeviceEnum.ILUVATAR, InfiniDeviceEnum.CAMBRICON):
467467
return tensor_dtypes
468-
elif device == InfiniDeviceEnum.MOORE:
469-
# 过滤掉 BF16 和 F64(PyTorch 在摩尔平台上不支持这些类型的某些操作)
470-
return [dt for dt in tensor_dtypes if dt != InfiniDtype.BF16 and dt != InfiniDtype.F64]
471468
else:
472469
# 过滤掉 torch.bfloat16
473470
return [dt for dt in tensor_dtypes if dt != torch.bfloat16]

test/infiniop/silu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Inplace(Enum):
5757
]
5858

5959
# Data types used for testing
60-
_TENSOR_DTYPES = [InfiniDtype.BF16, InfiniDtype.F16, InfiniDtype.F32, InfiniDtype.F64]
60+
_TENSOR_DTYPES = [InfiniDtype.BF16, InfiniDtype.F16, InfiniDtype.F32]
6161

6262
# Tolerance map for different data types
6363
_TOLERANCE_MAP = {

0 commit comments

Comments
 (0)