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

hSVD (rank and tolerance, new) #1126

Merged
merged 83 commits into from
Jun 6, 2023
Merged

hSVD (rank and tolerance, new) #1126

merged 83 commits into from
Jun 6, 2023

Conversation

mrfh92
Copy link
Collaborator

@mrfh92 mrfh92 commented Mar 20, 2023

replaces old #1042 which I closed due to a problem with the CI

Description

Hiearchical SVD (hSVD) computes an approximate truncated SVD of $A \in \mathbb{R}^{m \times n}$ utilizing a distributed hiearchical algorithm; the truncation rank is given by $maxrank$, i.e. if $A = U diag(\sigma) V^T$, $U \in \mathbb{R}^{m \times m}$, $V \in \mathbb{R}^{n \times n}$, $\sigma \in \mathbb{R}^{\min(m,n)}$ is the true SVD of $A$, this routine computes an approximation for $U[:,:maxrank]$ (and $sigma[:maxrank]$, $V[:,:maxrank]$).

There are three routines:

  • hsvd: "expert" version with all parameters to be set; potential conflicts are not catched
  • hsvd_rank: user-friendly version with appropriate default-parameters to compute hSVD with prescribed truncation rank
  • hsvd_reltol: user-friendly version with appropriate default-parameters to compute hSVD with prescribed relative reconstruction accuracy

Selected References:

[1] Iwen, Ong. A distributed and incremental SVD algorithm for agglomerative data analysis on large networks. SIAM J. Matrix Anal. Appl., 37(4), 2016.
[2] Himpe, Leibner, Rave. Hierarchical approximate proper orthogonal decomposition. SIAM J. Sci. Comput., 40 (5), 2018.

Dependencies

hSVD makes use of the pytorch-SVD and MPI-communication. No dependencies on HeAT linear algebra, except for matmul.

Type of change

  • New feature: hSVD

Memory requirements

TBD

Performance

TBD

Due Diligence

  • All split configurations tested
  • Multiple dtypes tested in relevant functions
  • Documentation updated (if needed)
  • Title of PR is suitable for corresponding CHANGELOG entry

Does this change modify the behaviour of other functions? If so, which?

no

@mrfh92 mrfh92 mentioned this pull request Mar 20, 2023
4 tasks
@ghost
Copy link

ghost commented Mar 20, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@github-actions
Copy link
Contributor

Thank you for the PR!

@ClaudiaComito ClaudiaComito self-assigned this Mar 20, 2023
@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Merging #1126 (6ddc295) into main (9f6b2eb) will increase coverage by 0.06%.
The diff coverage is 94.89%.

❗ Current head 6ddc295 differs from pull request most recent head 9de4e20. Consider uploading reports for the commit 9de4e20 to get more accurate results

@@            Coverage Diff             @@
##             main    #1126      +/-   ##
==========================================
+ Coverage   91.79%   91.85%   +0.06%     
==========================================
  Files          72       74       +2     
  Lines       10497    10712     +215     
==========================================
+ Hits         9636     9840     +204     
- Misses        861      872      +11     
Flag Coverage Δ
unit 91.85% <94.89%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
heat/core/linalg/svdtools.py 92.72% <92.72%> (ø)
heat/core/linalg/__init__.py 100.00% <100.00%> (ø)
heat/utils/data/__init__.py 100.00% <100.00%> (ø)
heat/utils/data/matrixgallery.py 100.00% <100.00%> (ø)
heat/utils/data/spherical.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mrfh92 mrfh92 enabled auto-merge March 20, 2023 11:06
@ClaudiaComito ClaudiaComito added enhancement New feature or request linalg high-level functions High-level machine-learning algorithms labels Mar 20, 2023
@ClaudiaComito ClaudiaComito added this to the 1.3.0 milestone Mar 20, 2023
…VD of the zero-matrix (or numerically zero-matrix) appears ... added also corresponding tests
@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

auto-merge was automatically disabled March 29, 2023 09:41

Merge queue setting changed

@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

@ClaudiaComito ClaudiaComito left a comment

Choose a reason for hiding this comment

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

I'm not done with the review, filing what I have so far so it doesn't get lost. Will get back to it later.

heat/core/linalg/tests/test_svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
heat/core/linalg/svdtools.py Show resolved Hide resolved
heat/core/linalg/svdtools.py Outdated Show resolved Hide resolved
mrfh92 and others added 3 commits June 2, 2023 11:15
Co-authored-by: Claudia Comito <39374113+ClaudiaComito@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Thank you for the PR!

2 similar comments
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Thank you for the PR!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Thank you for the PR!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Thank you for the PR!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Thank you for the PR!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

Thank you for the PR!

ClaudiaComito
ClaudiaComito previously approved these changes Jun 2, 2023
Copy link
Contributor

@ClaudiaComito ClaudiaComito left a comment

Choose a reason for hiding this comment

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

Brilliant @mrfh92 !

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Thank you for the PR!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Thank you for the PR!

@mrfh92 mrfh92 requested a review from ClaudiaComito June 5, 2023 15:39
ClaudiaComito
ClaudiaComito previously approved these changes Jun 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Thank you for the PR!

@mrfh92 mrfh92 dismissed mtar’s stale review June 6, 2023 11:02

Changes have been addressed

@mrfh92 mrfh92 merged commit 1bc1cca into main Jun 6, 2023
@mrfh92 mrfh92 deleted the features/1041-hsvd-new branch June 6, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high-level functions High-level machine-learning algorithms linalg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants