Why SYCL supports openCL 1.2 or above? - tensorflow

I am a student. My question may be very silly but I want to clear it. I have a device with Vivante GPU with openCL 1.1 version. I want to run tensorflow sample code with SYCL support on GPU. But before trying Tensorflow sample code, I want to try SYCL sample code with openCL 1.1 on GPU.
I have seen several SYCL implementations, like computeCPP, triSYCL, sycl-gtx. All the implementations support openCL 1.2 or above.
Does anyone know the reason why SYCL doesn't support openCL 1.1?
And how feasible will it be the attempt to modify the SYCL open-source code to support openCL 1.1?

The main reason for SYCL 1.2 to require OpenCL 1.2 is because the Khronos intermediate representation SPIR 1.2 requires it. Without SPIR, or any other intermediate representation, a SYCL implementation cannot compile C++ code into device binaries, and would need to convert C++ to OpenCL C, which is quite problematic.

Related

A program that supports different types of GPU

If i want to develop A program that supports different types of GPU.what should i do? I know that OPENCL can do this.but how OPENCL did this?
OpenCL is the best choice for vendor-independent GPU programming.
The way it works is runtime-compilation: You compile C++ to an executable and this executable contains the OpenCL C source code as text/string. When you run the executable on the CPU, it compiles the OpenCL C code specifically for the installed GPU. The OpenCL compiler is provided as part of the graphics driver. This way, you can copy the executable to another computer and there the contained OpenCL C code can compiled for a different GPU, all without having to recompile the executable.
This is similar to how Java works.

I'd like to manipulate the way using gpu in tensorflow lite, what can i study for that

At first, let me explain what i have to do.
My develop enviroment is Tizen OS. may be you are unfamilier that, anyway this os is using linux kernel based redhat and targeting on mobile, tv, etc.. And my target device is consists of exynos 5422 and arm mali-t628.
My main work is implement some gpu library to let tensorflow lite's operation can use the library.
I proceeded to build and install tensorflow lite as a rpm package file.
I am googling many times about the tensorflow and gpu. and get some useless information about cuda. i didnt see any info for my case(tizen and mali gpu).
i think linux have gpu instruction like the cpu or library.. but i cant find them.
can you suggest search keyword or document?
You can go to nvidia’s cuda toolkit page, where you can find the documentation and
Training buttons / options.
Also there’s the CUDA programming guide wich i myself find very usefull and helpull for CUDA.
I believe that one or two of those may help you.
CUDA is for NVidia GPU. Mali is not NVidia's, but ARM's. So you CANNOT use CUDA in your given hardware. Besides, if you want CUDA, you'd better drop Tensorflow-lite and use Tensorflow.
If you want to use CUDA, get a hardware with supported NVidia GPU (e.g., x64 machine with NVidia GPU). Note that you can use Tensorflow-GPU & CUDA/CUDNN in Tizen with x64+NVidia GPU. You just need to be careful on nvidia GPU kernel driver version and userspace driver version. Because NVidia's GPU userspace driver and CUDA/CUDNN are statically built, its Linux drivers are compatible with Tizen. (I've tested tensorflow-gpu, CUDA/CUDNN in Tizen with NVidia driver version 111... probably in winter, 2017)
If you want to use Tizen/Tensorflow-lite in the given hardware, forget CUDA.

How do I install tensorflow with gpu support for Mac?

My MacBook Pro doesn't have a NVIDIA gpu. So it's not possible to run CUDA. I'm wondering which of the earlier versions of TensorFlow have gpu support for Mac OS? And how can I install on Anaconda?
As stated on the official site:
Note: As of version 1.2, TensorFlow no longer provides GPU support on
Mac OS X.
..so installing any earlier version should be fine. But since your hardware does not have NVIDIA graphics card with CUDA support, it doesn't matter anyway.
In terms of installing TensorFlow on Mac OSX using Anaconda, you can just follow steps nicely described in the official docs
TensorFlow relies on CUDA for GPU use so you need Nvidia GPU. There's experimental work on adding OpenCL support to TensorFlow, but it's not supported on MacOS.
On anecdotal note, I've heard bad things from people trying to use AMD cards for deep learning. Basically AMD doesn't care about deep learning, they change their interfaces without notice so things break or run slower than CPU.

Does Google Tensorflow support OpenCL

Does Google Tensorflow support OpenCL... or is it still only Cuda?
OpenCL does not appear to be supported yet (April 2017) per this open issue - https://github.com/tensorflow/tensorflow/issues/22 but I keep reading that support exists -- I might be missing something.
tf-coriander is an implementation of Tensorflow for OpenCL 1.2 GPUs. It's based on coriander, which is a general compiler to run NVIDIA® CUDA™ code on OpenCL 1.2 devices. Disclosure: I'm the author, of both projects.
There is OpenCL support via SYCL on Tensorflow, some features are in, others are in progress: https://github.com/tensorflow/tensorflow/issues/22#issuecomment-266050835

What is SYCL 1.2?

I am trying to install tensorflow
Please specify the location where ComputeCpp for SYCL 1.2 is installed. [Default is /usr/local/computecpp]:
Invalid SYCL 1.2 library path. /usr/local/computecpp/lib/libComputeCpp.so cannot be found
What should I do?What is SYCL 1.2?
SYCL is a C++ abstraction layer for OpenCL. TensorFlow's experimental support for OpenCL uses SYCL, in conjunction with a SYCL-aware C++ compiler.
As Yaroslav pointed out in his comment, SYCL is only required if you are building TensorFlow with OpenCL support. The following question during the execution of ./configure asks about OpenCL support:
Do you wish to build TensorFlow with OpenCL support? [y/N]
If you answer N, you will not have to supply a SYCL path.
It is optional step so you can skip if you want.
OpenCL (Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms consisting of central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), field-programmable gate arrays (FPGAs) and other processors or hardware accelerators.
so if you want to intall you have to Setting Up TensorFlow With OpenCL Using SYCL bellow link provide step by step information about it
https://developer.codeplay.com/computecppce/latest/getting-started-with-tensorflow