summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjustheuristic <justheuristic@gmail.com>2022-09-18 00:35:03 +0300
committerjustheuristic <justheuristic@gmail.com>2022-09-18 00:35:03 +0300
commite35e2c665a69647d829c48e22fba0230180c11e7 (patch)
treeae71bd4aa07956036bad4454bf3963b23623edf7 /tests
parent577275bd8c1b4191284c4fb34799d252ae8667a1 (diff)
cast properly
Diffstat (limited to 'tests')
-rw-r--r--tests/test_autograd.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_autograd.py b/tests/test_autograd.py
index 5171c4f..4e4282a 100644
--- a/tests/test_autograd.py
+++ b/tests/test_autograd.py
@@ -372,8 +372,10 @@ def test_matmullt(
n = out_bnb.numel()
err = torch.abs(out_bnb - out_torch).mean().item()
# print(f'abs error {err:.4f}')
+ out_error_rate = 0.0175 if dtype == torch.float16 else 0.02
+
idx = torch.isclose(out_bnb, out_torch, atol=0.01, rtol=0.1)
- assert (idx == 0).sum().item() <= n * 0.0175
+ assert (idx == 0).sum().item() <= n * out_error_rate
idx = torch.isclose(out_bnb, out_torch, atol=0.035, rtol=0.2)
assert (idx == 0).sum().item() <= n * 0.001