Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Bazel in TensorFlow? When do I need to build again?

Tags:

tensorflow

I'm new to Bazel. I'm not sure how this thing works. On the TF website, there's this section on "Create the pip package and install".

$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package

# To build with GPU support: 
$ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

# The name of the .whl file will depend on your platform. 
$ pip install /tmp/tensorflow_pkg/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

Here's the situation:

  1. There's a new commit on the master branch of TensorFlow and I merge it into my fork.
  2. I need to rebuild the wheel and do a pip install of the new wheel (correct me if I am wrong).
  3. I ./configure first, then bazel build, then bazel-bin, then pip install.

Is this the correct way to properly update changes from master? The bazel build step takes a really long time.

like image 307
jkschin Avatar asked Feb 16 '16 02:02

jkschin


People also ask

Do I need Bazel for TensorFlow?

To build TensorFlow, you will need to install Bazel.

What is Bazel TensorFlow?

Bazel is a build tool just like other build tools like cmake and make. The steps you listed is the correct way to get updates from master. The build step could take long the first time you build TensorFlow.

What does Bazel build do?

Bazel is a tool that automates software builds and tests. Supported build tasks include running compilers and linkers to produce executable programs and libraries, and assembling deployable packages for Android, iOS and other target environments.


1 Answers

Bazel is a build tool just like other build tools like cmake and make. The steps you listed is the correct way to get updates from master. The build step could take long the first time you build TensorFlow. Later builds, after updates from master, should be faster, as Bazel, just like any other build tool, doesn't re-build targets whose dependencies have not been modified.

like image 115
keveman Avatar answered Oct 16 '22 03:10

keveman