Closed yogeshsinghrbt closed 6 years ago
Able to build tensorflow with trisycl using a-doumoulakis repo.
Great ! But unfortunately the latest TensorFlow is using more advanced features than the current triSYCL can cope with, so you have to use ComputeCpp, currently the only fully compliant SYCL implementation...
After building with bosst and opencl. I ran following code: import tensorflow as tf
with tf.device('/device:SYCL:0'): a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='b') c = tf.add(a, b)
sess = tf.Session(config=tf.ConfigProto( allow_soft_placement=True, log_device_placement=True))
print(sess.run(c))
output with CPU device :[[22. 28.] [49. 64.]] (correct) output with SYCL device: [[2.3509838e-38 2.3509838e-38] [2.3509838e-38 2.3509838e-38]] (incorrect)
Can you please let me know why the output from SYCL device is random and different. I am using nvidia gpu with opencl drivers.
Thanks,
As I said somewhere else, TensorFlow can only work natively on GPU through ComputeCpp because it requires advanced SYCL features not implemented by triSYCL yet. Furthermore I am not sure that nVidia supports OpenCL SPIR which is required by the current SYCL implementations I know. There is a feature of PoCL that ingests OpenCL + SPIR and calls CUDA API + PTX, if you are adventurous, with a stack ComputeCpp/PoCL/CUDA that might work... :-) But anyway, if you have an nVidia GPU, why not using TensorFlow with CUDA directly?
We want to run tensorflow model on various accelerators. As computecpp is not open source, we are more inclined towards other implementations. We will like to contribute towards gpu support of SYCL. Can you please ellaborate more about the advanced SYCL features.
Your goal seems pretty similar to the one from @airlied and a lot of other people. :-)
I think TensorFlow is using placeholder accessors now which are not implemented yet even on CPU https://github.com/triSYCL/triSYCL/issues/96
Then there will be a lot of issues to fix to have a full-fledged device compiler, such as https://github.com/triSYCL/triSYCL/issues/178 https://github.com/triSYCL/triSYCL/issues/179 https://github.com/triSYCL/triSYCL/issues/146 So it is not a short-term task...
Somehow related to https://github.com/triSYCL/triSYCL/issues/150
Which tensorflow and trisycl version are tested together and can build out of the box. I having trouble building tensorflow ( 1.9) with latest trisycl release.