Last active
October 15, 2020 08:26
-
-
Save hiteshjasani/97c76d33c7649f281f9c7e2749f607ab to your computer and use it in GitHub Desktop.
Building tensorflow using Bazel with cpu optimizations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install bazel | |
# download tensorflow src | |
# Checkout tagged version | |
# ./configure | |
# Compile | |
bazel build -c opt --copt=-march=native //tensorflow/tools/pip_package:build_pip_package | |
#bazel build -c opt --copt=-mavx --copt=-msse4.1 --copt=-msse4.2 //tensorflow/tools/pip_package:build_pip_package | |
# Build the PIP package | |
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg | |
# uninstall previous tensorflow version (if applicable) | |
# Install PIP package | |
pip install /tmp/tensorflow_pkg/tensorflow-1.2.0rc2-cp27-cp27m-macosx_10_12_x86_64.whl | |
# References | |
# https://www.tensorflow.org/install/install_sources | |
# https://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions | |
# https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#AVX2 | |
# https://en.wikipedia.org/wiki/SSE4 | |
# https://en.wikipedia.org/wiki/FMA_instruction_set | |
# https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/x86-Options.html#x86-Options | |
# https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/i386-and-x86_002d64-Options.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment