Does T.nlinalg.eigh run on GPU ?

17 views
Skip to first unread message

smce

unread,
Apr 12, 2018, 3:48:54 PM4/12/18
to theano-dev
Hello,

Since this post is rather old and since the function seems to be implemented in scikit-cuda now, I am wondering if T.nlinalg.eigh is now implemented on the GPU ?

Thanks !

Frédéric Bastien

unread,
Apr 13, 2018, 9:10:35 AM4/13/18
to thean...@googlegroups.com
It is implemented by calling magma that you must install. I'm just made a PR to document that a little bit better:

https://github.com/Theano/Theano/pull/6594

--

---
You received this message because you are subscribed to the Google Groups "theano-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

smce

unread,
Apr 13, 2018, 10:23:10 AM4/13/18
to theano-dev
Very nice thank you !

Are there any docs about how to install magma / link it to theano/cuda/BLAS etc.. ?

Frédéric Bastien

unread,
Apr 13, 2018, 5:06:10 PM4/13/18
to thean...@googlegroups.com
not, more then what I put in the PR. Check magma link to download and install it. Then user the theano flags that is wroten about in the doc page I created in that PR. Look at the PR directly for now, until it get merged.

On Fri, Apr 13, 2018 at 10:23 AM smce <mass.c...@gmail.com> wrote:
Very nice thank you !

Are there any docs about how to install magma / link it to theano/cuda/BLAS etc.. ?

--

Frédéric Bastien

unread,
Apr 16, 2018, 8:05:54 AM4/16/18
to thean...@googlegroups.com

smce

unread,
Apr 16, 2018, 10:38:40 AM4/16/18
to theano-dev
OK Thank you for the PR and the docs !

smce

unread,
Apr 16, 2018, 1:54:36 PM4/16/18
to theano-dev
One last question, If magma is properly installed and configured (enabled + headers and lib in theano.config), will theano automatically transform for instance theano.tensor.nlinalg.eigh in theano.gpuarrya.linalg.GpuMagmaEigh ?

Or do I need to use theano.gpuarray functions directly ?

Frédéric Bastien

unread,
Apr 16, 2018, 2:30:04 PM4/16/18
to thean...@googlegroups.com
It should use it automatically.

On Mon, Apr 16, 2018 at 1:54 PM smce <mass.c...@gmail.com> wrote:
One last question, If magma is properly installed and configured (enabled + headers and lib in theano.config), will theano automatically transform for instance theano.tensor.nlinalg.eigh in theano.gpuarrya.linalg.GpuMagmaEigh ?

Or do I need to use theano.gpuarray functions directly ?

--

mcomin

unread,
Apr 27, 2018, 2:17:30 PM4/27/18
to theano-dev
Ok I finally managed to load Magma with theano.

The following code, on the gpu

import theano
import theano.tensor as T
x = T.matrix()
f = theano.function([x], T.nlinalg.eigh(x))

gives the following error :

AttributeError: ('The following error happened while compiling the node', GpuMagmaEigh{lower=True, compute_v=True}(GpuContiguous.0), '\n', '/software-gpu/libs/magma/2.0.1_gcc4.8_cuda7.5.18/lib/libmagma.so: undefined symbol: magma_get_sbulge_nb_mgpu')

I am using CUDA 7.5.18 with MAGMA 2.0.1.

Do you know why I am getting this error ?

Thanks !

mcomin

unread,
May 1, 2018, 10:58:23 AM5/1/18
to theano-dev
Update : When using T.nlinalg.eig instead of T.nlinalg.eigh, the computation falls back on CPU, even with theano.config.magma.enabled = True.
Using eigh results in the error above.

Was Theano tested with MAGMA 2.0.1 or another version ? Is there a preferred one ?
Reply all
Reply to author
Forward
0 new messages