Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow compilation fails with error "redeclared here as 'Eigen::internal::ComparisonName cmp'" #72

Open
kkarnatak opened this issue Jun 15, 2017 · 1 comment

Comments

@kkarnatak
Copy link

kkarnatak commented Jun 15, 2017

Hi,

I am trying to compile the tensorflow source with opencl 'syscl' flag. I got the following error:

In file included from <command-line>:0:0:
./bazel-out/local_linux-py3-opt/bin/tensorflow/core/kernels/_objs/relu_op/tensorflow/core/kernels/relu_op.pic.sycl:8149:22: note: 'const bool cl::sycl::detail::{anonymous}::arg_used [16]' previously defined here
 const bool           kernel_info< ::Eigen::TensorSycl::ExecExprFunctorKernel<const ::Eigen::TensorAssignOp< ::Eigen::TensorMap< ::Eigen::Tensor<float, 1, 1, long>, 16, ::Eigen::MakePointer>, const ::Eigen::TensorCwiseBinaryOp< ::Eigen::internal::scalar_product_op<const float, const float>, const ::Eigen::TensorMap< ::Eigen::Tensor<const float, 1, 1, long>, 16, ::Eigen::MakePointer>, const ::Eigen::TensorConversionOp<float, const ::Eigen::TensorCwiseBinaryOp< ::Eigen::internal::scalar_cmp_op<const float, const float, ::Eigen::internal::ComparisonName::cmp_GT>, const ::Eigen::TensorMap< ::Eigen::Tensor<const float, 1, 1, long>, 16, ::Eigen::MakePointer>, const ::Eigen::TensorCwiseNullaryOp< ::Eigen::internal::scalar_constant_op<const float>, const ::Eigen::TensorMap< ::Eigen::Tensor<const float, 1, 1, long>, 16, ::Eigen::MakePointer> > > > > >, ::Eigen::TensorSycl::internal::FunctorExtractor< ::Eigen::TensorEvaluator<const ::Eigen::TensorAssignOp< ::Eigen::TensorMap< ::Eigen::Tensor<float, 1, 1, long>, 16, ::Eigen::MakePointer>, const ::Eigen::TensorCwiseBinaryOp< ::Eigen::internal::scalar_product_op<const float, const float>, const ::Eigen::TensorMap< ::Eigen::Tensor<const float, 1, 1, long>, 16, ::Eigen::MakePointer>, const ::Eigen::TensorConversionOp<float, const ::Eigen::TensorCwiseBinaryOp< ::Eigen::internal::scalar_cmp_op<const float, const float, ::Eigen::internal::ComparisonName::cmp_GT>, const ::Eigen::TensorMap< ::Eigen::Tensor<const float, 1, 1, long>, 16, ::Eigen::MakePointer>, const ::Eigen::TensorCwiseNullaryOp< ::Eigen::internal::scalar_constant_op<const float>, const ::Eigen::TensorMap< ::Eigen::Tensor<const float, 1, 1, long>, 16, ::Eigen::MakePointer> > > > > >, const ::Eigen::SyclDevice> >, ::utility::tuple::Tuple< ::cl::sycl::accessor<unsigned char, 1, ::cl::sycl::access::mode::read_write, ::cl::sycl::access::target::global_buffer>, ::cl::sycl::accessor<unsigned char, 1, ::cl::sycl::access::mode::read, ::cl::sycl::access::target::global_buffer>, ::cl::sycl::accessor<unsigned char, 1, ::cl::sycl::access::mode::read, ::cl::sycl::access::target::global_buffer>, ::cl::sycl::accessor<unsigned char, 1, ::cl::sycl::access::mode::read, ::cl::sycl::access::target::global_buffer> > > >::arg_used[] = {
                      ^
In file included from <command-line>:0:0:
./bazel-out/local_linux-py3-opt/bin/tensorflow/core/kernels/_objs/relu_op/tensorflow/core/kernels/relu_op.pic.sycl:8012:83: error: template parameter 'int cmp'
 template <typename LhsScalar, typename RhsScalar, Eigen::internal::ComparisonName cmp> struct scalar_cmp_op;
                                                                                   ^
In file included from external/eigen_archive/unsupported/Eigen/CXX11/../../../Eigen/Core:423:0,
                 from external/eigen_archive/unsupported/Eigen/CXX11/Tensor:14,
                 from ./third_party/eigen3/unsupported/Eigen/CXX11/Tensor:1,
                 from ./tensorflow/core/kernels/relu_op.h:23,
                 from tensorflow/core/kernels/relu_op.cc:20:
external/eigen_archive/unsupported/Eigen/CXX11/../../../Eigen/src/Core/functors/BinaryFunctors.h:190:77: error: redeclared here as 'Eigen::internal::ComparisonName cmp'
 template<typename LhsScalar, typename RhsScalar, ComparisonName cmp> struct scalar_cmp_op;
                                                                             ^
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4754.029s, Critical Path: 191.56s

I have used the following command to initiate compilation:

bazel build -c opt --config=sycl //tensorflow/tools/pip_package:build_pip_package

I have AMD radeon 7670M GPU. I am using ubuntu 14.04.5 LTS and have latest compute-cpp module. My AMD drivers are working correctly ( The sole reason why i am using 14.04.5 :) )

~/TensorFlow/Packages/tensorflow$ glxinfo | grep OpenGL
OpenGL vendor string: Advanced Micro Devices, Inc.
OpenGL renderer string: AMD Radeon HD 7600M Series
OpenGL core profile version string: 4.3.13416 Core Profile Context 15.302
OpenGL core profile shading language version string: 4.40
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.13416 Compatibility Profile Context 15.302
OpenGL shading language version string: 4.40
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
$ bazel test //tensorflow/python/kernel_tests:basic_gpu_test    INFO: Found 1 test target...
Target //tensorflow/python/kernel_tests:basic_gpu_test up-to-date:
  bazel-bin/tensorflow/python/kernel_tests/basic_gpu_test
INFO: Elapsed time: 2.213s, Critical Path: 1.83s
//tensorflow/python/kernel_tests:basic_gpu_test                          PASSED in 1.8s

Executed 1 out of 1 test: 1 test passes.

Any help will be appreciated.

Thanks.

@lukeiwanski
Copy link
Collaborator

Can you try this branch: https://github.com/lukeiwanski/tensorflow/tree/dev/eigen_mehdi ?

make sure you have latest computecpp :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants