Skip to content

Test torch.svd using complex float and double numbers (take 2)#45795

Closed
malfet wants to merge 4 commits intopytorch:masterfrom
malfet:malfet/add-torch.svd-complex-cuda
Closed

Test torch.svd using complex float and double numbers (take 2)#45795
malfet wants to merge 4 commits intopytorch:masterfrom
malfet:malfet/add-torch.svd-complex-cuda

Conversation

@malfet
Copy link
Copy Markdown
Contributor

@malfet malfet commented Oct 3, 2020

Adds support for magmaSvd for complex numbers

Fixes use-after-free error in apply_symeig

malfet added 3 commits October 2, 2020 18:16
Array allocated by ALLOCATE_ARRAY  will be freed when it goes out of scope
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Collaborator

@IvanYashchuk IvanYashchuk left a comment

Choose a reason for hiding this comment

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

Hi! I left a few suggestions regarding lrwork that come from the MAGMA documentation.

int64_t lrwork; // These settings are valid for on LAPACK 3.6+
if (jobz == MagmaNoVec){
lrwork = 7 * mn;
} else if (mx > 10 * mn){
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mx > 10 * n was an arbitrary decision, since LAPACK seems to not document this number #27653 (comment).
But MAGMA documents this condition. The threshold for mx >> mn is currently mx >= mn*17/9.
In code, this condition is calculated with (magma_int_t) (mn * 17. / 9.), maybe we can make it mx >= mn * 2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you know how 17/9 ration is computed? As in the documentation is simply says if mx >> mn

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know.

Comment thread aten/src/ATen/native/cuda/BatchLinearAlgebra.cu
Comment thread aten/src/ATen/native/cuda/BatchLinearAlgebra.cu
@malfet malfet deleted the malfet/add-torch.svd-complex-cuda branch October 3, 2020 19:10
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet merged this pull request in 3a27fc9.

laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…ch#45795)

Summary:
Adds support for magmaSvd for complex numbers

Fixes use-after-free error in `apply_symeig`

Pull Request resolved: pytorch#45795

Reviewed By: ezyang

Differential Revision: D24096955

Pulled By: malfet

fbshipit-source-id: 0d8d8492f89fe722bbd5aed3528f244245b496d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants