Manifolds.jl icon indicating copy to clipboard operation
Manifolds.jl copied to clipboard

GPU support

Open mateuszbaran opened this issue 5 years ago • 5 comments

I checked how hard would it be to add GPU support to Manifolds.jl. Essentially without some kind of contextual dispatch (like this: https://github.com/JuliaGPU/CUDAnative.jl/pull/334 ) it would require rewriting almost everything.

mateuszbaran avatar Oct 02 '20 12:10 mateuszbaran

I would have to first read about GPU support in general, but yes it would be great, especially for large power manifolds to have GPU support.

kellertuer avatar Oct 09 '20 06:10 kellertuer

I'm not even sure what would I recommend reading here, usually GPU support is done from the other side than I'd prefer to do it here: each manifold is implemented to also handle its own powers (e.g. Pymanopt, Geomstats). That puts on us the burden of handling power manifolds separately for each manifold, doesn't scale to product manifolds and is troublesome when someone cares about performance in low-dimensional cases.

Here I'd prefer to just rewrite PowerManifold to automatically generate GPU kernels from CPU implementations of methods. That's not always possible but with contextual dispatch we should be able to automatically offload to GPU most non-allocating operations (GPU code can't really allocate).

mateuszbaran avatar Oct 09 '20 09:10 mateuszbaran

Thanks for the explanation, I actually still prefer our generic approach to power manifolds and rewrite that one, too.

kellertuer avatar Oct 09 '20 09:10 kellertuer

Related thing: https://github.com/JuliaGPU/KernelAbstractions.jl .

mateuszbaran avatar Oct 16 '20 11:10 mateuszbaran

Yeah KernelAbstractions that was just recommended to me and seems like it might be promising.

sethaxen avatar Oct 16 '20 20:10 sethaxen