"projects/vscode:/vscode.git/clone" did not exist on "18467adf062b28ba58a55596743b7827e678ec4d"
Unverified Commit 406c9668 authored by PanZezhong1725's avatar PanZezhong1725 Committed by GitHub
Browse files

Merge pull request #663 from gongchensu/feature/moore_adapt

Issue/658 - Update test tolerances and remove device-specific dtype f…
parents 3aeee034 e00e65e2
...@@ -33,7 +33,7 @@ _TEST_CASES_DATA = [ ...@@ -33,7 +33,7 @@ _TEST_CASES_DATA = [
# Tolerance configuration # Tolerance configuration
_TOLERANCE_MAP = { _TOLERANCE_MAP = {
infinicore.float16: {"atol": 0, "rtol": 1e-2}, infinicore.float16: {"atol": 0, "rtol": 1e-2},
infinicore.float32: {"atol": 0, "rtol": 1e-3}, infinicore.float32: {"atol": 1e-4, "rtol": 1e-3},
infinicore.bfloat16: {"atol": 0, "rtol": 5e-2}, infinicore.bfloat16: {"atol": 0, "rtol": 5e-2},
} }
......
...@@ -463,11 +463,8 @@ def debug(actual, desired, atol=0, rtol=1e-2, equal_nan=False, verbose=True): ...@@ -463,11 +463,8 @@ def debug(actual, desired, atol=0, rtol=1e-2, equal_nan=False, verbose=True):
def filter_tensor_dtypes_by_device(device, tensor_dtypes): def filter_tensor_dtypes_by_device(device, tensor_dtypes):
if device in (InfiniDeviceEnum.CPU, InfiniDeviceEnum.NVIDIA): if device in (InfiniDeviceEnum.CPU, InfiniDeviceEnum.NVIDIA, InfiniDeviceEnum.METAX, InfiniDeviceEnum.ASCEND, InfiniDeviceEnum.ILUVATAR, InfiniDeviceEnum.CAMBRICON):
return tensor_dtypes return tensor_dtypes
elif device == InfiniDeviceEnum.MOORE:
# 过滤掉 BF16 和 F64(PyTorch 在摩尔平台上不支持这些类型的某些操作)
return [dt for dt in tensor_dtypes if dt != InfiniDtype.BF16 and dt != InfiniDtype.F64]
else: else:
# 过滤掉 torch.bfloat16 # 过滤掉 torch.bfloat16
return [dt for dt in tensor_dtypes if dt != torch.bfloat16] return [dt for dt in tensor_dtypes if dt != torch.bfloat16]
......
...@@ -57,7 +57,7 @@ _TEST_CASES = [ ...@@ -57,7 +57,7 @@ _TEST_CASES = [
] ]
# Data types used for testing # Data types used for testing
_TENSOR_DTYPES = [InfiniDtype.BF16, InfiniDtype.F16, InfiniDtype.F32, InfiniDtype.F64] _TENSOR_DTYPES = [InfiniDtype.BF16, InfiniDtype.F16, InfiniDtype.F32]
# Tolerance map for different data types # Tolerance map for different data types
_TOLERANCE_MAP = { _TOLERANCE_MAP = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment