Skip to content

Instantly share code, notes, and snippets.

@ontheklaud
Last active November 2, 2018 09:05
Show Gist options
  • Save ontheklaud/cb74e3d70dcb4762b60e47c18bfbfb3e to your computer and use it in GitHub Desktop.
Save ontheklaud/cb74e3d70dcb4762b60e47c18bfbfb3e to your computer and use it in GitHub Desktop.
Bazelbuild commands for TensorFlow Build
#!/bin/bash
# for CUDA acceleration,
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
# for Intel MKL acceleration,
bazel build --config=opt --config=mkl //tensorflow/tools/pip_package:build_pip_package
bazel --server_javabase=$HOME/opt/jdk build --config=opt --config=mkl //tensorflow/tools/pip_package:build_pip_package
# for TensorFlow r1.11 w/ Intel nGraph acceleration,
bazel --server_javabase=$HOME/opt/jdk build --config=opt //tensorflow/tools/pip_package:build_pip_package
# manual fix for r.11 CPU optimization
# error: 'se' does not name a type using StatusOr = se::port::StatusOr<T>;
# https://github.com/ROCmSoftwarePlatform/tensorflow-upstream/commit/79b274d453be95cb952df5a742e7aa12544b87c0
# BUILD:40:1: undeclared inclusion(s) in rule '//tensorflow/contrib/mpi_collectives:python/ops/_mpi_ops.so':
# https://github.com/tensorflow/tensorflow/issues/17437
# <confirmed manual fix> - for official build
# https://github.com/tensorflow/tensorflow/commit/c67ded664a20f27b4e90020bf76a097b462182b1
# for TensorFlow r1.12 w/ Intel MKL acceleration,
bazel --server_javabase=$HOME/opt/jdk build --config=opt --config=mkl --config=verbs //tensorflow/tools/pip_package:build_pip_package
# for TensorFlow r1.12 w/ Intel MKL acceleration (XLA) w/ Bazel 0.15.0,
bazel --host_javabase=$JAVA_HOME build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt --config=mkl //tensorflow/tools/pip_package:build_pip_package
# for TensorFlow r1.12 w/ Intel nGraph acceleration,
bazel --server_javabase=$HOME/opt/jdk build --config=opt --config=ngraph --config=verbs //tensorflow/tools/pip_package:build_pip_package
# for TensorFlow r1.12 w/ Intel nGraph acceleration w/ Bazel 0.15.0,
bazel --host_javabase=$HOME/opt/jdk build --config=opt --config=ngraph --config=verbs //tensorflow/tools/pip_package:build_pip_package
# for building wheel files with successful built,
bazel-bin/tensorflow/tools/pip_package/build_pip_package <destination folder>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment