Skip to content

Commit

Permalink
Fix IPU Jacobi eigh algorithm when size % 4 == 2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
balancap committed Oct 18, 2023
1 parent 2aea6a7 commit 5ca7014
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/linalg/test_tile_linalg_jacobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5ca7014

Please sign in to comment.