64

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?

daniel451
  • 9,128
  • 15
  • 53
  • 115
  • 3
    There are reasons, why deep learning frameworks use CUDA instead of OpenCL - one of them is performance. It's easier to tune it for single vendor like Nvidia. Though I don't know exact answer, there are little chances to find that kind of software for AMD. – Roman Arzumanyan Jun 06 '15 at 12:47
  • Thanks for the input. This is, more or less, what I expected and found out so far. As I already mentioned, even Google has not supplied many results :( Is there really no official source, no literature, no tutorials, no attempts out there? – daniel451 Jun 06 '15 at 12:49
  • Theano seems to have some sort of OpenCL support available, via `GpuArray`: http://deeplearning.net/software/theano/tutorial/using_gpu.html#gpuarray – jprice Jun 07 '15 at 17:15
  • 3
    See also the [Comparison of deep learning software](https://en.wikipedia.org/wiki/Comparison_of_deep_learning_software) Wikipedia page. – HelloGoodbye Feb 05 '16 at 14:40

8 Answers8

39

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:

In Development

Alexander McFarlane
  • 8,800
  • 7
  • 47
  • 91
  • 1
    I appreciate your answer & upvoted it, thanks! However, I will wait some days with the bounty, maybe a more extensive answer arrives with more official sources or even scientific papers / literature about the topic. – daniel451 Jun 08 '15 at 11:19
  • I realised I didn't actually list the libraries that use OpenCL that I referred to in my original edit - updated this now. I also added a bit more information with regards to libraries in development stages. Likewise, I hope someone will provide an answer that solves all my OpenCL issues as I'm currently looking at trading my laptop up for an NVIDIA graphics version which will be effort & costly! – Alexander McFarlane Jun 08 '15 at 20:50
  • 2
    Thanks! I'm in the same situation. Desktop is AMD based, Notebook Intel based and NVIDIA hardware is not known for beeing cheap or having good price-performance ratios for GPU-Computing, especially when it comes to double precision operations :/ – daniel451 Jun 08 '15 at 21:47
  • Update: Two claims that OpenCL works with Theano: [here](https://gist.github.com/jarutis/ff28bca8cfb9ce0c8b1a) and [here](http://tinyfool.org/2016/04/how-to-install-theano-opencl-on-mac-os-x-ei-caption/) I haven't checked as I'm heavy into my thesis project but leaving here in case someone else has time. The [official github issue](https://github.com/Theano/Theano/issues/2936) states that OpenCL is *not currently usable* and the issue stack supports that – Alexander McFarlane Jul 10 '16 at 02:17
  • Update: Currently many libraries and framework support AMD hardware through their GPU open initiative. Cool things are happening there e.g. like cross platform code that runs both on AMD and Nvidia without any deep changes. check my answer in the link https://stackoverflow.com/a/33330306/2442649 – Yeasin Ar Rahman Aug 26 '17 at 16:07
  • @AlexanderMcFarlane, Gr8 Reply. By any chance do u know any of these frameworks is compatible with OpenCL 1.1 EP? – Whoami Jun 28 '18 at 15:48
17

--- 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.

Yeasin Ar Rahman
  • 549
  • 10
  • 21
10

An alternative is to use GPU instances on Amazon Web Services. You can find AMIs with commonly used deep learning packages already installed. For example:

Tip: use spot instances to get a cheaper price (around 10 cents/hour for a g2.2xlarge).

Mikael Rousson
  • 2,087
  • 13
  • 16
  • This is by far the best solution now! I am currently using this myself because you can install all your software as normal and use their computing power. I think they also do discounts. I'll edit my answer to link to yours as people might not read until it gets more up votes – Alexander McFarlane Oct 06 '15 at 15:48
7

PlaidML (https://github.com/plaidml/plaidml) is a fully open source deep learning runtime that runs on top of OpenCL and integrates with Keras to provide a familiar user-facing API. The README in the repo has more detailed status, currently convnet inference on Linux is well supported but we (http://vertex.ai) are working to expand completeness and platform support as quickly as we can. Our continuous integration machines include an assortment of AMD and NVIDIA GPUs, all Linux for now but we are also working on adding Mac and Windows.

Choong Ng
  • 71
  • 1
  • 3
  • Hi @Choong Ng! Is it possible to cross compile `PlaidML` for `armv7-a` platform? And is there any minimum OpenCL version required to use `PlaidML`? – Akhilesh Jun 07 '18 at 13:42
  • @Akhilesh Yes, we (Vertex.AI) do test PlaidML on armv7-a platform (Cortex A15), and OpenCL 1.2 is the minimum although I think we have made 1.1 work in the past. – Choong Ng Jun 08 '18 at 14:47
  • Thanks to respond. I visited your (vertex.AI) site and PlaidML (https://github.com/plaidml/plaidml), It seems very promising. Actually, mostly deep learning frameworks are required minimum OpenCL 1.2. But I am having OpenCL 1.1 EP. Please can you confirm whether it is possible for cross compile PlaidML for OpenCL 1.1 EP. – Akhilesh Jun 08 '18 at 15:13
  • @Akhilesh Thanks, I see your ticket mentioning 1.1 EP and the GC2000 GPU ([link](https://github.com/plaidml/plaidml/issues/137) for those following along). I expect you'll be able to make it work but it may involve small modifications to PlaidML to support EP and any quirks of that chip as well as working with Vivante if you find major bugs in their drivers. – Choong Ng Jun 09 '18 at 16:26
  • @ChoongNg, Thanks for the reply. While looking at the below thread, https://github.com/plaidml/plaidml/issues/137 flaub from PlaidML team claimed that they tried on GC2000 Vivante, but failed due to driver issue. Is it still worth we try? – Whoami Jun 28 '18 at 15:19
  • @ChoongNg, Also in this link https://groups.google.com/forum/#!topic/plaidml-dev/Kqqexk6OzdM Alfredo claimed that "The GC2000 will not work, it’s not FP but EP, most kernels won’t compile as EP doesn’t support a lot of the required functionality,". – Whoami Jun 28 '18 at 15:20
5

I'm writing opencl 1.2 support for Tensorflow. https://github.com/hughperkins/tensorflow-cl Currently supports:

  • blas matrix multiplication
  • gradients
  • eigen operations such as: reductions, argmin/argmax, per-element operations (binary and unary)
Hugh Perkins
  • 6,646
  • 6
  • 50
  • 63
4

TensorFlow now have OpenCL support on the roadmap.

See: Github issue.

Hopefully not that far away from a working version.

salle55
  • 1,821
  • 2
  • 24
  • 26
1

Please check out https://01.org/intel-deep-learning-framework - The Intel® Deep Learning Framework (IDLF) provides a unified framework for Intel® platforms accelerating Deep Convolutional Neural Networks. It is Open Source, so you could port it to AMD hardware as well. The cool thing: it could run on a MacBook Pro with Intel Iris graphics.

Robert Ioffe
  • 212
  • 1
  • 2
  • when you say *Intel® platforms* do you mean platforms with Intel® compilers, platforms with Intel® GPUs or do they require both? – Alexander McFarlane Jun 12 '15 at 01:11
  • Intel(R) platforms means Intel(R) Processors with or without Intel(R) Processor Graphics and Intel(R) accelerators like Intel(R) Xeon Phi. – Robert Ioffe Jun 15 '15 at 03:43
1

Check out the ROCm platform, which is driven by AMD. This is the first open-source HPC/Hyperscale-class platform for GPU computing that’s also programming-language independent.

Specifically:

AmitB
  • 614
  • 7
  • 5