Support for other Device Types, OpenCL AMD GPU
It would be nice to eventually have OpenCL support for those of us with GPUs that don't do CUDA.
Hi,
We are considering this as well! The thing is that for company like AMD, they are actually developing environments that is compatible with CUDA in the future: http://www.anandtech.com/show/9792/amd-sc15-boltzmann-initiative-announced-c-and-cuda-compilers-for-amd-gpus. So we are still deciding whether we are going to put our limited human resources into supporint OpenCL. If you are interested, you are more than welcome to help us enhance the project in this direction.
Thank you, Minjie
Hi Minjie,
Maybe we can collaborate on extending MXnet with OpenCL support. we have Opencl caffe open sourced, I guess we can reuse the core kernels?
thanks! Junli On Nov 18, 2015 10:53 AM, "Minjie Wang" [email protected] wrote:
Hi,
We are considering this as well! The thing is that for company like AMD, they are actually developing environments that is compatible with CUDA in the future: http://www.anandtech.com/show/9792/amd-sc15-boltzmann-initiative-announced-c-and-cuda-compilers-for-amd-gpus. So we are still deciding whether we are going to put our limited human resources into supporint OpenCL. If you are interested, you are more than welcome to help us enhance the project in this direction.
Thank you, Minjie
— Reply to this email directly or view it on GitHub https://github.com/dmlc/mxnet/issues/621#issuecomment-157820246.
Ha, it's great to hear voice from AMD people here :p. I heard that the problem of integrating OpenCL is mainly due to its support for template which is widely used in mshadow. @tqchen may know more details about this.
Minjie
@gujunli it's very nice to see you here, (we met at icml beijing last year). we are definitely interested on opencl, and hope to support it asap. but the current issue is that we used C++ template while opencl doesn't support it, see https://github.com/dmlc/mshadow/issues/71
template is an issue. On AMD devices we have special keyword to support, no problem. The problem is the same key word does not work on NV GPUs. we are also figuring out a general solution. I would like to hear your thoughts on this.@limu @minjie
junli
On Wed, Nov 18, 2015 at 11:43 AM, Mu Li [email protected] wrote:
@gujunli https://github.com/gujunli it's very nice to see you here, (we met at icml beijing last year). we are definitely interested on opencl, and hope to support it asap. but the current issue is that we used C++ template while opencl doesn't support it, see dmlc/mshadow#71 https://github.com/dmlc/mshadow/issues/71
— Reply to this email directly or view it on GitHub https://github.com/dmlc/mxnet/issues/621#issuecomment-157839013.
Junli Gu--谷俊丽 Coordinated Science Lab University of Illinois at Urbana-Champaign
nvidia gpu should be fine with cuda. our main motivation to support opencl is for amd gpus and other devices, such as fpga. for example, altera also contacted us to make mxnet run on their devices.
This won't pose a problem as long as AMD's version of compiler support somewhat similar thing as nvcc does, i.e. template programming and allow integration of host and device code.
What can be done is to have something like tensor_gpu-inl.amd.cc to specialize for AMD's version of keyword. As long as the extra keyword is minimum and the compiler can be detected by marco, it should be fine.
It would be nice to be able to target FPGAs and OpenCL would allow that to be done much more easily through the Altera tool chain.
Also: I'm not sure I understand the templates issue, isn't there a C API that could be used to get around that?
I'll also add that OpenCL would allow targetting Intel Integrated Graphics which is pretty common on a lot of laptops as well as desktops these days.
@philtomson The problem is more for the kernel code. OpenCL uses C as a language for its kernels and MXNet uses C++ for CUDA and CPU kernels and is able to generate both from the same template, which is nice because you don't need to support 2 or 3 different versions of things.
+1 I want to experiment on my laptop which does not have cuda support!
@vchuravy Speak of portability, maybe it's the problem of using template itself in mxnet, because a neural network implement doesn't really need templates for different data types. For a typical neural network implementation, single precision floating point is most commonly used, because double precision is unnecessary and leads to much more computational cost, and half precision computation is not native supported among many devices. Using fixed point data types are completely another case for performance optimization. What people really want is a single efficient, flexible, minimal and yet portable neural network implementation, that can be ported to multiple CPUs, GPUs and FPGAs. The design principle of mxnet meets almost all of these features except the last one.
Is there anyone who tried AMD HIP tools on MXNet?
+1
+1
Really want to see this happen someday for a major Python framework besides Tensorflow (and without using a limited, experimental, proprietary compiler framework). Competition!
https://www.khronos.org/registry/OpenCL/ opencl 2.2 C++ language, including templates support, now is in provisional status. Of course, till now there is no manufacturers releases 2.2 drivers.
This could help convert the cuda kernels to opencl https://github.com/hughperkins/cuda-on-cl
Hi all,
I've been trying to tackle this problem for some time. From my investigation, cocl does not work very well because mshadow is built on Thrust which uses a lot of CUDA host side API that are not supported by cocl. @delijati Therefore, what we found promising is to use VexCL as the vector expression library (instead of mshadow) for GPU device. Currently I have most arithmetic operators on NDArray working but still need to fill in a hell lot of symbolic operators for the whole framework to work. Proof of concept code is here: https://github.com/windywinter/mxnet
Hi all,
I'm looking at PyOpenCL and it could be a solution for MXNet. The challenge that I've observed so far is PyOpenCL requires installation of Intel Open CL SDK on user's machine (if they are running Intel Graphics Card).
An example shared by Easy OpenCL with Python is that Gaston Hillar has demonstrated to use only 12 steps to build and deploy a kernel with PyOpenCL. I've tested his codes and it is working for me.
I wonder if MXNet would consider to support PyOpenCL?