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

Custom PyTorch implementation of eigsh #137

Merged
merged 3 commits into from
Mar 18, 2023
Merged

Custom PyTorch implementation of eigsh #137

merged 3 commits into from
Mar 18, 2023

Conversation

norabelrose
Copy link
Member

@norabelrose norabelrose commented Mar 17, 2023

Introduces a custom PyTorch implementation of the Lanczos method for computing the top k eigenpairs of a symmetric matrix, lanczos_eigsh. This replaces the SciPy implementation and the naive dense eigendecomposition method that were previously used in EigenReporter.

This method can be several times faster than torch.linalg.eigh for large matrices, and is quite accurate and stable. It also supports warm-starting.

Copy link
Collaborator

@AlexTMallen AlexTMallen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@norabelrose norabelrose merged commit a4a8e21 into main Mar 18, 2023
@norabelrose norabelrose deleted the pytorch-eigsh branch March 18, 2023 22:13
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.

2 participants