Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCL / AMD: Deep Learning [closed]

While "googl'ing" and doing some research I were not able to find any serious/popular framework/sdk for scientific GPGPU-Computing and OpenCL on AMD hardware. Is there any literature and/or software I missed?

Especially I am interested in deep learning.

For all I know deeplearning.net recommends NVIDIA hardware and CUDA frameworks. Additionally all big deep learning frameworks I know, such as Caffe, Theano, Torch, DL4J, ... are focussed on CUDA and do not plan to support OpenCL/AMD.

Furthermore one can find plenty of scientific papers as well as corresponding literature for CUDA based deep learning tasks but nearly nothing for OpenCL/AMD based solutions.

Is there any chance that new or existing scientific frameworks will show up for OpenCL/AMD based solutions in 2015/16?

What is a good start for deep learning with OpenCL/AMD? Any literature? Tutorials? Miscellaneous sources?

like image 347
daniel451 Avatar asked Jun 03 '15 14:06

daniel451


People also ask

Does AMD use OpenCL?

OpenCL, however, has been implemented by a vast array of vendors including but not limited to: AMD: Intel and AMD chips and GPU's are supported.

Can AMD compete with CUDA?

AMD launches GPUFORT, an open-source attempt against NVIDIA's CUDA. AMD has released GPUFORT with the purpose of tackling rival NVIDIA and its CUDA platform. CUDA currently has a firm grip on the parallel computing industry.

Does TensorFlow support OpenCL?

Google today launched an OpenCL-based mobile GPU inference engine for its TensorFlow framework on Android. It's available now in the latest version of the TensorFlow Lite library, and the company claims it offers a two times speedup over the existing OpenGL backend with “reasonably-sized” AI models.

Does PyTorch support OpenCL?

Torch 7 comes with the built-in support of OpenCL; when the base of PyTorch is the same as the Lua torch for backends, we can easily use it openly for working with integrated and modern graphics GPUs. You can find the official code on github from this link.


2 Answers

Edit 1 See Mikael Rousson's answer - Amazon is now the way forwards as you can "rent" computational power from them.

Edit 2 I've created a series of guides on how to set up Amazon EC2 Instances for Deep Learning with theano. It's a lot more convenient than running on a personal machine.

Edit 3 It seems that TensorFlow is now far more widely accepted than theano so I have updated the guide accordingly.

I have been in the same situation as yourself as I have a MacBook Pro with Intel Iris graphics. I have spent the best part of a week looking through all possible workarounds and I would be more than welcome to alternatives to those that I offer.

The best solution I currently have is to:

  1. Install the python library tensorflow and utilise what GPU support there is and continue to update to the latest development versions.
  2. Use theano - and use existing GPU support similarly to tensorflow
  3. Buy an NVIDIA graphics card and use it on a PC
  4. If you absolutely need a solution in OpenCL and you are willing to code everything from a high level of understanding (no tutorials) look at DeepCL and possibly pyOpenCl.

I have found that any solution using OpenCL, e.g. pyOpenCl, doesn't yet have user friendly interfaces for Deep Learning i.e. it will take longer to code it in an alternative method than to just code it fast and run on a CPU. With that said though, here are of the best alternative OpenCL libraries for deep learning:

  • Python - DeepCL
  • Jonathan's Torch7 Utility Library - C++

In Development

  • tensorflow is adding OpenCL support once improvements to Eigen and other dependencies are finished
  • theano is adding support to OpenCL through clBLAS
  • Caffe is in development stages of adding OpenCL support but a bit behind theano in progress, it seems
like image 163
Alexander McFarlane Avatar answered Sep 23 '22 09:09

Alexander McFarlane


--- Aug 2017 Update cool new things happened in the AMD side ---

now it is actually possible to run any library on most AMD hardware Check Here

As of 25 October 2015

it seems that AMD and others have extended their hands on the development of several OpenCL accelerated frameworks for deeplearning. So yeah OpenCL support is now existent for deeplearning :)

This is a list of OpenCL accelarated framework or tools that have been developed keeping deep learning in mind primarily. I hope they will get updated over the upcoming years

We know right now(25 October 2015) there are three deep learning framework that are very very popular to researchers and has seen some commercial products

  1. Theano

  2. Caffe

  3. Torch


caffe has a pretty good OpenCL support because amd developed a complete version of caffe which supports almost all the features of caffe and also it is being developed actively. it is named OpenCL Caffe. and here is the repository

OpenCL Caffe

if you are thinking about performance then according to that site(i have not bench-marked it myself) it gives around 261 images per second or 22.5 million images per day in a AMD R9 Fury hardware(training). to compare with nvidia K40, which can process 40 million images a day. so according to the site it can give half performance in one-sixth money.(considering k40 is 3000$ card and r9 fury is around 600$). however using any consumer card will give you a problem about memory(vram) which is quite important in deep learning.


Torch in recent days also seem to have decent OpenCL support. However it is maintained by a single person. It claims to have full support for all the features of torch. However it does not give an idea about performance. Here is the repository. it is actively maintained.

cltorch


Currently there does not seems to be a decent opencl backend for theano framework but work is in progress. and simple programs can be done with the current version.


There are some other opencl frameworks for deeplearning too. It will take some time to sort them out to see if they work properly or not.

like image 42
4 revs, 3 users 93% Avatar answered Sep 22 '22 09:09

4 revs, 3 users 93%