JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.44k stars 5.46k forks source link

Make LAPACK's Jacobi methods for SVD accessible #31080

Open carstenbauer opened 5 years ago

carstenbauer commented 5 years ago

In the course of #31057, which adds a algorithm or method keyword to svd and svd!, it would be nice to have access to Jacobi methods (gesvj in LAPACK) for SVD decomposition as well.

See the discussion on discourse Calling Lapack’s Jacobi SVD - dgesvj and a draft thereout: https://gist.github.com/RalphAS/6a80a1dd4039153c8c94fc27a4938665.

Unfortunately, this is a bit above my head so I'm hoping for someone else to actually implement this. I assume this isn't really difficult if one knows what one's doing.

@andreasnoack, maybe you would be willing to take a look? I saw that you seem to have access to a gesvdj! (is this the same as gesvj?) in CuArrays.jl already.

RalphAS commented 5 years ago

It's worth noting that there are also preconditioning drivers in LAPACK (with names corresponding to gejsv!). These can make the Jacobi scheme runtime-competitive with the other methods. They have rather complicated interfaces so getting the wrapper logic right may take some effort. Would it make sense to do this work in a separate package first (question for the main LinearAlgebra developers)? That would allow for more comprehensive public testing and perhaps some nice demonstrations.

ViralBShah commented 5 years ago

Yes, a separate package definitely sounds better. Could be in JuliaLinearAlgebra org.

RalphAS commented 5 years ago

Ok, here is an implementation candidate. I've refactored it a couple of times so it would be good for someone else to review for consistency.