From 5ca7014179ba6b68b54c5a4c4428c46518a0547e Mon Sep 17 00:00:00 2001 From: Paul Balanca Date: Wed, 18 Oct 2023 15:59:36 +0000 Subject: [PATCH] Fix IPU Jacobi eigh algorithm when size % 4 == 2 The recent improvement in PR #49 introduced a regression in Jacobi `eigh`, raising an error when size % 4 == 2. This is due to the partial loop unrolling in Jacobi second update stage. This PR is fixing the issue by passing explicitely the offset and size of the workload to the vertex. --- tests/linalg/test_tile_linalg_jacobi.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/linalg/test_tile_linalg_jacobi.py b/tests/linalg/test_tile_linalg_jacobi.py index 5c07e0d..c44f681 100644 --- a/tests/linalg/test_tile_linalg_jacobi.py +++ b/tests/linalg/test_tile_linalg_jacobi.py @@ -177,8 +177,11 @@ def test__jacobi_eigh__single_iteration(self): npt.assert_array_almost_equal(np.linalg.eigh(A)[0], np.linalg.eigh(x)[0], decimal=5) @unittest.skipUnless(ipu_num_tiles >= 16, "Requires IPU with 16 tiles") - def test__jacobi_eigh_raw__proper_eigh_result(self): - N = 12 + @parameterized.parameters( + {"N": 10}, # testing Jacobi 2nd update. + # {"N": 12}, + ) + def test__jacobi_eigh_raw__proper_eigh_result(self, N): x = np.random.randn(N, N).astype(np.float32) x = (x + x.T) / 2.0