Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] tridiagonal_eigh #45

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

[WIP] tridiagonal_eigh #45

wants to merge 9 commits into from

Conversation

paolot-gc
Copy link
Contributor

This PR covers the mods required to implement the computation of eigenvectors and eigenvalues of a (symmetrical) tridiagonal matrix, such as the one emerging from a reduction to Hessenberg form.

@paolot-gc
Copy link
Contributor Author

At commit c0e27ff, ipu_tridiag_solve() runs a Vertex implementing Thomas algorithm.
One can run python examples/tridiag_solver_example.py 1472 1472 to solve 1472 symmetrical tridiagonal linear systems with random coefficients, each with 1472 unknowns, concurrently.
Profiling indicates this takes a total of 176,743 cycles. Memory usage was 46.7MiB (memory excluding gaps).
Note that at present, the algorithm is implemented as a Vertex, therefore using just one of the 6 threads.

@paolot-gc
Copy link
Contributor Author

With commit 85b4ebd, I added Alex's code for the computation of eigenvalues of a tridiagonal matrix and added an example in which eigenvectors of a real symmetric matrix are computed using the inverse iteration method.
The chart below shows the execution trace for the computation of the 1472 eigenvalues and eigenvectors of a 1472x1472 symmetric matrix. Only two inverse iterations were performed.
The vast majority of the 46.7M cycles are taken by the Hessenberg tridiagonalization.
image
There was a small but non-negligible "reconstruction" error.

Compiling module jit_real_symmetric_eigh.0:
[##################################################] 100% Compilation Finished [Elapsed: 00:04:44.4]
ic| np.max(np.abs(mat @ x.T - eig * x.T)): 0.00011253357

Memory usage is reported below. Note the huge component due to Internal Exchange Message Buffers (276MiB) and Internal Exchange Code (115MiB).
image

@paolot-gc paolot-gc marked this pull request as ready for review October 30, 2023 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant