1

I have a server with two Intel xeon gold 6148 and tensorflow running on it. When I install tf with pip I get a message that AVX2 and AVX512 is not used with my installation. So, to get the best performance I tried to build tf from source using docker. I did so following https://www.tensorflow.org/install/source but for the bazel build command I used:

bazel build --config=mkl -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mavx512f --copt=-mavx512pf --copt=-mavx512cd --copt=-mavx512er //tensorflow/tools/pip_package:build_pip_package

following https://software.intel.com/en-us/articles/intel-optimization-for-tensorflow-installation-guide.
But this installation performs much worse than the standard pip installation.

So, to sum this up: what is the best way to install tensorflow an xeon gold architecture?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • Only KNL (Xeon Phi) has `-mavx512er`, not mainstream Xeon CPUs. Ideally use `-march=native` (except that the build scripts seem to mangle compiler options that contain an `=`). – Peter Cordes Mar 29 '19 at 22:10
  • @ChileAddict : please don't remove a key "generic" tag like [tag:tensorflow]. People searching that tag still want this question to come up, even if they didn't know to do `([tensorflow] OR [intel-tensorflow])` – Peter Cordes Nov 19 '19 at 09:30

1 Answers1

2

Try out using tensorflow wheel from the Intel website.

Please follow the below steps to create your own conda environment and to install the wheel.

1) conda create -n ENV_NAME -c intel python=3.6 pip numpy

2) source activate ENV_NAME

3) pip install https://storage.googleapis.com/intel-optimized-tensorflow/tensorflow-1.11.0-cp36-cp36m-linux_x86_64.whl

Hope this helps.

Aswathy - Intel
  • 638
  • 4
  • 12
  • Turned out that the problem is that the values for `inter_op_parallelism_threads` and `intra_op_parallelism_threads` on the tensorflow site [https://www.tensorflow.org/guide/performance/overview ] just don't work at all. But when I use something like intra=10 and inter=1 it works fine for the build installation. – Daniel Lang Dec 06 '18 at 09:14