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

Syntaxnet fails to compile with XLA enabled on MacOS #1444

Closed
udnaan opened this issue May 5, 2017 · 7 comments
Closed

Syntaxnet fails to compile with XLA enabled on MacOS #1444

udnaan opened this issue May 5, 2017 · 7 comments

Comments

@udnaan
Copy link
Contributor

udnaan commented May 5, 2017

System information

  • What is the top-level directory of the model you are using:
    models/syntaxnet
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
    No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    MacOS 10.12.4
  • TensorFlow installed from (source or binary):
    Source
  • TensorFlow version (use command below):
    a7d6015
  • Bazel version (if compiling from source):
    0.4.5 (brew)
  • CUDA/cuDNN version:
    8.0/5.1
  • GPU model and memory:
    1080 TI 11GB
  • Exact command to reproduce:
$ ./configure
cd ..
 bazel test --linkopt=-headerpad_max_install_names \
    dragnn/... syntaxnet/... util/utf8/...

Describe the problem

See subject

Source code / logs

Please specify the location of python. [Default is /usr/local/bin/python]:
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/N]
No Hadoop File System support will be enabled for TensorFlow
Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] y
XLA JIT support will be enabled for TensorFlow
Found possible Python library paths:
  /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Please input the desired Python library path to use.  Default is [/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages]

Using python library path: /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Do you wish to build TensorFlow with OpenCL support? [y/N]
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] y
CUDA support will be enabled for TensorFlow
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:
Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to use system default]: 8.0
Please specify the location where CUDA 8.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify the Cudnn version you want to use. [Leave empty to use system default]: 5
Please specify the location where cuDNN 5 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size.
[Default is: "3.5,5.2"]: 6.1
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
........
INFO: All external dependencies fetched successfully.
Configuration finished
$ cd ..
$ bazel test --linkopt=-headerpad_max_install_names \
                                             dragnn/... syntaxnet/... util/utf8/...
WARNING: /private/var/tmp/_bazel_nan/a58a8744e0a370eb1d612194d68aa421/external/org_tensorflow/tensorflow/workspace.bzl:72:5: tf_repo_name was specified to tf_workspace but is no longer used and will be removed in the future.
ERROR: /private/var/tmp/_bazel_nan/a58a8744e0a370eb1d612194d68aa421/external/llvm/BUILD:176:1: no such package 'third_party/llvm': BUILD file not found on package path and referenced by '@llvm//:llvm_config_gen'.
ERROR: Analysis of target '//dragnn/python:biaffine_units' failed; build aborted.
INFO: Elapsed time: 73.200s
ERROR: Couldn't start the build. Unable to run tests.
@drpngx
Copy link
Contributor

drpngx commented May 6, 2017

Could you run bazel fetch ... again? Which version of tensorflow is that? We removed bazel clean during configure a while back.

@drpngx drpngx added stat:awaiting response Waiting on input from the contributor type:build/install labels May 6, 2017
@udnaan
Copy link
Contributor Author

udnaan commented May 6, 2017

The commit tag is in the report. It's the version that works with syntaxnet and is provided as git submodule.

I'm following the instructions here to run syntaxnet: https://github.com/tensorflow/models/tree/master/syntaxnet#installation

I did try running it using master/HEAD beforehand but that seems to be broken altogether.

@udnaan
Copy link
Contributor Author

udnaan commented May 7, 2017

Here is the error I get if I try using tensorflow from master branch with syntaxnet (note that syntaxnet itself is still using the git-tag mentioned in the report as it fails to compile with the master)

---------------------------------------------------------------------------
NotFoundError                             Traceback (most recent call last)
<ipython-input-1-9239b98b75e1> in <module>()
      6 from dragnn.python import graph_builder
      7 from dragnn.python import spec_builder
----> 8 from dragnn.python import load_dragnn_cc_impl  # This loads the actual op definitions
      9 from dragnn.python import render_parse_tree_graphviz
     10 from dragnn.python import visualization

/usr/local/lib/python2.7/site-packages/dragnn/python/load_dragnn_cc_impl.py in <module>()
     20 
     21 tf.load_op_library(
---> 22     os.path.join(tf.resource_loader.get_data_files_path(), 'dragnn_cc_impl.so'))

/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/load_library.pyc in load_op_library(library_filename)
     62       # pylint: disable=protected-access
     63       raise errors_impl._make_specific_exception(
---> 64           None, None, error_msg, error_code)
     65       # pylint: enable=protected-access
     66   finally:

NotFoundError: dlopen(/usr/local/lib/python2.7/site-packages/dragnn/python/dragnn_cc_impl.so, 6): Symbol not found: __ZN10tensorflow15shape_inference16InferenceContext8WithRankENS0_11ShapeHandleEiPS2_
  Referenced from: /usr/local/lib/python2.7/site-packages/dragnn/python/dragnn_cc_impl.so
  Expected in: flat namespace
 in /usr/local/lib/python2.7/site-packages/dragnn/python/dragnn_cc_impl.so

demangled name of the Symbol: _tensorflow::shape_inference::InferenceContext::WithRank(tensorflow::shape_inference::ShapeHandle, int, tensorflow::shape_inference::ShapeHandle*)

@drpngx
Copy link
Contributor

drpngx commented May 7, 2017

Can you rebuild dragnn against TF master?

Here's the signature I have from the current codebase:

  Status WithRank(ShapeHandle shape, int64 rank,
                  ShapeHandle* out) TF_MUST_USE_RESULT;

It's int64, not int32.

@udnaan
Copy link
Contributor Author

udnaan commented May 7, 2017

Giving it a go. Note that the build only goes through if I omit the MacOS specific option --linkopt=-headerpad_max_install_names specified in the Syntaxnet build instructions. Seems like it's not a valid option anymore.

@udnaan
Copy link
Contributor Author

udnaan commented May 7, 2017

That seems to work. It also takes care of #248 if you separately built and install tensorflow with CUDA and XLA support
Thank you for the help!

@udnaan udnaan closed this as completed May 7, 2017
@drpngx
Copy link
Contributor

drpngx commented May 7, 2017 via email

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

No branches or pull requests

2 participants