I'm using tensorflow (without GPU support) and I'm seeing a fairly significant hit in performance compared to what's expected. So, I figured it was time to pay attention to these warnings:
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
I've seen some people claim they've gotten close to a 10x improvement in speed, building with these instructions.
The instructions I've found on doing this, though, seem to be related to older versions of TF (v < 1.0). I was wondering if anyone could point me to a correct bazel command for building using a newer version of tf?
Installing for python3 on Mac OSX by following the instructions here: https://www.tensorflow.org/install/install_sources and selecting "No" for CUDA support.
and using the bazel command:
bazel build --linkopt='-lrt' -c opt --copt=-march=native --copt=-mavx --copt=-msse4.2 --copt=-msse4.1 //tensorflow/tools/pip_package:build_pip_package
However, this results in many pages of warrnings/errors... mostly of the form:
target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': Use SavedModel Builder instead.
and
external/protobuf/python/google/protobuf/pyext/message_factory.cc:78:28: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
Edit
I will note that I only saw a marginal increase in speed building from source.