Why does Tensorflow warn about AVX2 while I am using MKL?

╄→гoц情女王★ 提交于 2020-04-10 04:38:07

问题


I am using Tensorflow's Anaconda distribution with MKL support.

from tensorflow.python.framework import test_util
test_util.IsMklEnabled()

This code prints True. However, when I compile my Keras model I still get

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

This is not the behavior I was expecting.


回答1:


The MKL-DNN portions of the tensorflow execution (which is the main acceleration provided by MKL engineers) are JIT'ed at runtime. So the instruction set targeted at binary creation is not relevant to the MKL-DNN code. It will only effect the other math, mainly the Eigen library and whatever functions haven't been replaced with MKL-DNN functions.




回答2:


This warning can be ignored. The reason this is appearing is because of the instruction set flags set while building TF. However, MKL-DNN(The math lib responsible for performing core computations in tensorflow-mkl) at the run time will use the latest vector Instruction sets supported by your machine. If you look at the intel optimized tensorflow install guide, you can get more details. So bottomline is, although these warning messages appear, AVX2 is being used by MKL at the run time



来源:https://stackoverflow.com/questions/53979991/why-does-tensorflow-warn-about-avx2-while-i-am-using-mkl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!