Using Python + Theano with OpenCL in AMD GPU

I am trying to use Python with Theano to speed up some code with OpenCL. I installed libgpuarray and pygpu according to the instructions (I think) and did not get errors. During installation, the installed OpenCL environment was detected.

I just can't run the Theano example for OpenCL, mainly because I don't know how to specify my GPU. My GPU is Radeon HD 5340/5450/5470 , according to inxi . All the code in Theano documentation uses device=cuda0 and the only place where OpenCL is mentioned is device=openclN , where N is a number.

I tried device=opencl0 and got a pygpu error indicating that the correct format is opencl<int>:<int> . Since then I have tried any number of combinations of numbers ( opencl0:0 and such) and always GpuArrayException: Unknown error .

My system is Ubuntu 14.04 x64, and my hardware is Toshiba Satellite, 15 ". I installed Theano with pip , and later installed libgpuarray according to the instructions on my website.

What am I doing wrong?

+15
python theano opencl
Jan 15 '15 at 19:43
source share
1 answer

opencl0: 0 is correct. Could you confirm that pyopencl is working? You may have a problem with your opencl (or the drivers / cl compiler).

However, I think Theano is currently not working with OpenCL. In the current state there is partial support, enough for a "hello world", but not enough to run any meaningful code.

Cm:

https://github.com/Theano/Theano/issues/2189

https://github.com/Theano/Theano/issues/1471

https://github.com/Theano/Theano/issues/2190

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

To summarize, no, most things are not ported (including, for example, Elemwise, which is a regular operator). I would really like to see Theano on OpenCL. That would be great for AMD. Soon:)

+9
Feb 26 '15 at 17:33
source share



All Articles