Uh oh!
There was an error while loading. Please reload this page.
Conversation
I checked that we have this capability (added in cupy/cupy#3247), so it's straightforward for us to support it: |
rgommers
commented
Jan 26, 2021
|
rgommers
commented
Jan 29, 2021
There's an incompatibility between NumPy and PyTorch missed in number of values returned for |
leofang
commented
Feb 9, 2021
So it turns out not as straightforward, but is still possible on both CUDA and HIP, see cupy/cupy#4628. btw, we could also note the support for complex numbers will land in the next version (like what we discussed in the eigensolver PR #113). The nice point of SVD is that |
kgryte
commented
Feb 15, 2021
Updated this PR based on the above feedback and meeting discussions. Reordered the output values to follow NumPy |
kgryte
commented
Feb 16, 2021
Updated this PR to return an array, rather than a tuple, when |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Leo Fang <leofang@bnl.gov>
Co-authored-by: Leo Fang <leofang@bnl.gov>
Co-authored-by: Leo Fang <leofang@bnl.gov>
Co-authored-by: Leo Fang <leofang@bnl.gov>
IvanYashchuk
commented
Mar 18, 2021
Why does Should this flag be dropped for |
rgommers
commented
Mar 18, 2021
Good question @IvanYashchuk. No/fewer boolean keywords would make the design better, that is probably how we'd design it if starting from scratch. I do see that I like the idea of dropping |
rgommers
commented
Mar 18, 2021
The signature |
I think in reality it depends on how things are implemented at the low level. Taking CUDA as an example, this function In fact, I think this interface dates way back to Lapack's But, if we take into account decades of familiarity in numerical routines I don't think changing the API is a good idea, though I don't have strong opinion. |
Uh oh!
There was an error while loading. Please reload this page.
kgryte
commented
Mar 24, 2021
I'm also in favor of @IvanYashchuk's proposal to have a separate API which only returns singular values. Regarding whether an implementation reuses the same routine for both |
kgryte
commented
Apr 12, 2021
I've updated this proposal (and OP) to no longer include the |
0607525 to
138e963Comparekgryte
commented
May 12, 2021
Thanks, @leofang, for the review! This PR is ready for merge... |
This PR
Notes
NumPy and Torch order the returned tuple
(u, s, v), while TF orders as(s, u, v). This proposal follows NumPy.NumPy et al provide a
compute_uvkeyword to indicate whether to return the left and right singular vectors along with the singular values. This proposal omits such a keyword, in favor of a separatesvdvalsspecification (see gh-160). This is to promote consistency witheigandeigvalsand minimize polymorphism within the set of linagl APIs.By default, NumPy computes full matrixes, while TF and Torch do not. This proposal follows NumPy and sets the
full_matriceskeyword argument default asTrue.MXNet does not currently support any keyword arguments.
Dask currently supports a
coerce_signskeyword argument to indicate whether or not to apply sign coercion to singular vectors in order to maintain deterministic results. It is alone in this regard.This proposal follows NumPy, Torch, MXNet, JAX, and TF in supporting stacks of matrices. CuPy and Dask do not currently support providing stacks.
NumPy currently supports a
hermitiankeyword argument for speeding up computation; however, it is alone in doing this.TF (and LAPACK) returns both the left and right singular vectors in columns. NumPy returns the left singular vectors in rows (i.e., NumPy returns the adjoint). This proposal follows NumPy.