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

[NDTensorsCUDAExt] Fix QR-based SVD for some rectangular matrices #1229

Merged
merged 9 commits into from
Nov 2, 2023

Conversation

kmp5VT
Copy link
Collaborator

@kmp5VT kmp5VT commented Nov 1, 2023

Description

CUDA's QRAlgorithm fails when an (N x M) matrix has N < M. Here I fix this issue by catching the problem in the SVD dispatch and transposing the matrices and the resulting SVD.

TODO

  • Fix the QR SVD algorithm
  • Make sure all the unit tests still pass

@mtfishman mtfishman changed the title [NDTensorsCUDAExt][Debug] QR based SVD fails for some rectangular matrices [NDTensorsCUDAExt] QR based SVD fails for some rectangular matrices Nov 1, 2023
@mtfishman mtfishman changed the title [NDTensorsCUDAExt] QR based SVD fails for some rectangular matrices [NDTensorsCUDAExt] Fix QR-based SVD for some rectangular matrices Nov 1, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (66f5d39) 85.31% compared to head (c89e33a) 54.54%.
Report is 7 commits behind head on main.

❗ Current head c89e33a differs from pull request most recent head 4e3b304. Consider uploading reports for the commit 4e3b304 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1229       +/-   ##
===========================================
- Coverage   85.31%   54.54%   -30.78%     
===========================================
  Files          89       88        -1     
  Lines        8445     8392       -53     
===========================================
- Hits         7205     4577     -2628     
- Misses       1240     3815     +2575     

see 37 files with indirect coverage changes

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

@mtfishman
Copy link
Member

I see, it looks like other code is sending alg keyword arguments into this CUDA SVD function which only make sense for the CPU SVD. Maybe it is an issue with picking good defaults for alg which are aware of the backend?

@mtfishman
Copy link
Member

Maybe need to overload default_svd_alg for CuArrays.

@mtfishman
Copy link
Member

Looks good, thanks!

@mtfishman mtfishman merged commit 5a22695 into ITensor:main Nov 2, 2023
7 checks passed
@kmp5VT kmp5VT deleted the kmp5/debug/cu_qr_svd branch November 2, 2023 20:56
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.

3 participants