Reputation: 412
I've seen a lot of documentation about making using of a CPU with tensorflow, however, I don't have a GPU. What I do have is a fairly capable CPU and a holing 5GB of intel math kernel, which, I hope, might help me speed up tensorflow a fair bit.
Does anyone know how I can "make" tensorflow use the intel-mlk ?
Upvotes: 7
Views: 10167
Reputation: 1627
Build TensorFlow 1.2 from source and during the configuration step enable the support of MKL.
As of Dec. 2017, MKL only works on Linux. See https://tensorflow.org/performance/performance_guide#optimizing_for_cpu
Note: MKL was added as of TensorFlow 1.2 and currently only works on Linux. It also does not work when also using --config=cuda.
Upvotes: 3
Reputation: 690
I know its been a whole year but I now see that there is an office WHEEL for Intel Optimized Tensorflow. Worth a try https://software.intel.com/en-us/articles/intel-optimized-tensorflow-wheel-now-available
Upvotes: 0
Reputation: 3877
Since tensorflow uses Eigen, try to use an MKL enabled version of Eigen as described here:
- define the EIGEN_USE_MKL_ALL macro before including any Eigen's header
- link your program to MKL libraries (see the MKL linking advisor)
- on a 64bits system, you must use the LP64 interface (not the ILP64 one)
So one way to do it is to follow the above steps to modify the source of tensorflow, recompile and install on your machine. While you're at it you should also try the Intel compiler, which might provide a decent performance boost by itself, if you set the correct flags: -O3 -xHost -ipo
.
Upvotes: 1