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

Sparse SVD #1566

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

Sparse SVD #1566

wants to merge 18 commits into from

Conversation

dallan-keylogic
Copy link
Contributor

@dallan-keylogic dallan-keylogic commented Feb 11, 2025

Summary/Motivation:

Presently, the SVDToolbox isn't widely utilized, in part because of the limited options for calculating the SVD. Scipy's dense SVD is time-consuming on problems larger than 1000x1000, while its sparse SVD does not work well to find the singular values of the smallest magnitude.

Therefore, I've implemented a custom version of the SVD that is based on Rayleigh-Ritz iteration.

I'd appreciate testers for this method before we merge it.

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Feb 13, 2025
@blnicho blnicho self-requested a review March 27, 2025 18:18
@ksbeattie ksbeattie added Priority:High High Priority Issue or PR and removed Priority:Normal Normal Priority Issue or PR labels Mar 27, 2025
@dallan-keylogic dallan-keylogic marked this pull request as ready for review April 3, 2025 21:35
Copy link

codecov bot commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 90.32258% with 12 lines in your changes missing coverage. Please review.

Project coverage is 76.87%. Comparing base (6e72af3) to head (1ec214f).

Files with missing lines Patch % Lines
idaes/core/util/linalg.py 91.45% 7 Missing and 3 partials ⚠️
idaes/core/util/model_diagnostics.py 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1566      +/-   ##
==========================================
+ Coverage   76.85%   76.87%   +0.02%     
==========================================
  Files         394      395       +1     
  Lines       63241    63365     +124     
  Branches    10359    10382      +23     
==========================================
+ Hits        48604    48713     +109     
- Misses      12188    12200      +12     
- Partials     2449     2452       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dallan-keylogic
Copy link
Contributor Author

Pylint is complaining about "Possible unbalanced tuple unpacking". The source of the issue is that the function returns three variables, U, svals, and V, if m=n but it additionally returns a basis for the (left) null space if m!=n. There are multiple ways to make this warning go away, but I want some feedback about the return signature of the function. Should I always return the null space, or only if a specific option is included?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:High High Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants