Roger-luo / MAGMA.jl

A Julia binding for MAGMA, don't drink it
MIT License
10 stars 2 forks source link

Bind the GPU gesvd #18

Open Roger-luo opened 5 years ago

Roger-luo commented 5 years ago

This is sort of resolved, but we will need some frontend wrapper later.

Roger-luo commented 5 years ago

I think we now just need to define a generic function (but do not overload the svd in LinearAlgebraand dispatch it to magmagesdd` in this repo as the upper most interface.

NOTE: PyTorch is using gesdd at the moment:

https://github.com/pytorch/pytorch/commit/7d055c21b31bfd8a3383b13af938d39239327d03#diff-5b3ae8ff75409dce3f752955b36b9359R457

they basically just convert the cuda pointer back to CPU, feed it into magma gesdd and convert it back to cuda, I think we could just do the same thing for now. But as a binding package, we should provide the bindings anyway.

@vchuravy suggested we could have a gesdd implemented in Julia to avoid this during JuliaCon, which is also possible.

JerryChen97 commented 5 years ago

Yes one month ago I read their code for the gpu version of magma_gesdd in pytorch and followed but only did this stuff in the test file test/dense/svd.jl as we can see. I will open a new PR and push a dispatched src.