From f863cfbaade7588da5c3e34cff7a0248cdf4b615 Mon Sep 17 00:00:00 2001 From: Peter Hawkins Date: Sat, 16 Sep 2023 06:54:52 -0700 Subject: [PATCH] Relax some test tolerances to fix failures on Linux aarch64. PiperOrigin-RevId: 565930178 --- tests/BUILD | 1 + tests/lax_numpy_test.py | 2 +- tests/lax_scipy_test.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/BUILD b/tests/BUILD index ff10b9b2b..996ccbc9b 100644 --- a/tests/BUILD +++ b/tests/BUILD @@ -662,6 +662,7 @@ jax_test( name = "pytorch_interoperability_test", srcs = ["pytorch_interoperability_test.py"], disable_backends = ["tpu"], + tags = ["not_build:arm"], deps = py_deps("torch"), ) diff --git a/tests/lax_numpy_test.py b/tests/lax_numpy_test.py index 252c32ead..8a2f62241 100644 --- a/tests/lax_numpy_test.py +++ b/tests/lax_numpy_test.py @@ -1278,7 +1278,7 @@ class LaxBackedNumpyTests(jtu.JaxTestCase): elif rank == 2 and jtu.device_under_test() in ("tpu", "gpu"): self.skipTest("Nonsymmetric eigendecomposition is only implemented on the CPU backend.") rng = jtu.rand_default(self.rng()) - tol = { np.int8: 1e-3, np.int32: 1e-3, np.float32: 1e-3, np.float64: 1e-6 } + tol = { np.int8: 2e-3, np.int32: 1e-3, np.float32: 1e-3, np.float64: 1e-6 } if jtu.device_under_test() == "tpu": tol[np.int32] = tol[np.float32] = 1e-1 tol = jtu.tolerance(dtype, tol) diff --git a/tests/lax_scipy_test.py b/tests/lax_scipy_test.py index 7c6ff3bfe..8bf7c2245 100644 --- a/tests/lax_scipy_test.py +++ b/tests/lax_scipy_test.py @@ -489,7 +489,7 @@ class LaxBackedScipyTests(jtu.JaxTestCase): should_be_eye = np.matmul(unitary.conj().T, unitary) else: should_be_eye = np.matmul(unitary, unitary.conj().T) - tol = 500 * float(jnp.finfo(matrix.dtype).eps) + tol = 650 * float(jnp.finfo(matrix.dtype).eps) eye_mat = np.eye(should_be_eye.shape[0], dtype=should_be_eye.dtype) with self.subTest('Test unitarity.'): self.assertAllClose(