New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to compile tensorflow using SSE4.1, SSE4.2, and AVX. #8037
Comments
This isn't an error, just warnings saying if you build TensorFlow from source it can be faster on your machine. SO question about this: http://stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions |
Just as @Carmezim stated these are simply warning messages. You can follow our guide to install TensorFlow from sources to compile TF with support for SIMD instruction sets. |
Ok, thanks. I get it. |
Is there a way we can silence this? |
The only way to silence these warning messages is to build from sources, using |
A sort of "workaround" (albeit imperfect) that redirects the messages on Unix/Linux/OSX: |
@CGTheLegend @ocampesato you can use TF environment variable
So you can do the following to silence the warnings:
@gunan @mrry I've seen many folks interested in silencing the warnings, would there be interest in adding this kind of info to the docs? |
I install from tensorflow install guide, also got this warning.
|
@jadeydi Instead of compiling from source, "pip" just install the binary as well, so that you'll still got these warnings. |
I just compiled tensorflow with support for SSE4.1 SSE4.2 AVX AVX2 and FMA. The build is available here: https://github.com/lakshayg/tensorflow-build . I hope this is useful. |
Hi @lakshayg, thanks for sharing. You might want to check https://github.com/yaroslavvb/tensorflow-community-wheels |
Approximately much faster is the build compared to the standard |
http://www.anandtech.com/show/2362/5 This came up on google and has some decent technical details.
...
Now sure what functions tensorflow is using, but might be worth the effort. |
Sorry but this is a ridiculous thing to have output in all TF scripts by default. Most people probably aren't compiling TF from source nor want to. |
@TomAshley303, this is a pretty awesome info to get! I don't plan to recompile from source. I don't want to. But the info tells me what to do if my model becomes big and slow and will need a performance boost. It's usually cheaper to recompile with extensions than to buy new hardware, given that having good walkthroughts (which we do have) minimizes the labour cost of recompiling (CPU time does not matter, can run overnight). |
I went through the process... Was straight-forward and took no time at all. Not your usual cmake C++ kinda nightmare. |
I have a small bash script to compile TF under MacOS/Linux. It dynamically calculates CPU features and put them as the build parameters. I was thinking to create a PR but didn't find a folder with scripts (helpers) for local builds, only ci_build. If it makes sense I will do it gist |
A note to @gunan I've encountered this issue when I was installing TensorFlow for the first time. Now I am having to figure out how to resolve it again because I'm installing TensorFlow on a new machine. It's a pain in the neck, and the documentation you've provided is not clear at all. The fact that I have to do it on my end is ridiculous and infuriating. It's no good making something available from pip/pip3 if it then just throws warnings at you all day. At the very least, you should edit https://www.tensorflow.org/install/install_sources and explicitly explain how to compile it with SSE / AVX The solution that worked for me: input "-mavx -msse4.1 -msse4.2" when prompted during the configuration process (when you run ./configure). Is it that hard to add this to your installation instructions? |
Thank you, according to @Carmezim answer, I get the cpu speed up version based on avx and sse. I'v tested faster-rcnn(resnet-101) on Intel. Cost time speeds up about 30%, it is truly useful. |
You can silence the warnings. |
you could easily add a user variable in System Environment Variable: |
@mikalyoung improvements for GPU computations cannot be expected, since those instructions set are CPU only, and they allow for vectorized operations. |
I C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 As You can see the warning is with my system also but In that, I am not able to understand 'I' in the starting of the Warning so someone can help me in that case |
"I" there just is a shorthand for "INFO". The other letters you can see there are E for error, or F for fatal. |
So I installed using conda. If I wish now to compile from source instead to take advantage of any speed boost, do I need to do anything to remove my conda install of tensorflow? Or is it in its own little container and I can separately compile from source? |
I had installed DeepSpeech and also a DeepSpeech server. Went to start the server and got an error message - "2018-01-17 08:21:49.120154: F tensorflow/core/platform/cpu_feature_guard.cc:35] The TensorFlow library was compiled to use AVX2 instructions, but these aren't available on your machine. Apparently I need to compile TensorFlow on the same computer. Is there a list somewhere to match Kubuntu 17.10.1 and a HP Probook 4330S please ? |
Why are there no windows compiles? I am having the same issues, but instead of muting the warnings I would like to use my GPU, I also have an and graphics card and not Nvidia what do I do? |
*I Do not have a Nvidia graphics card, I have an and one what do I do? |
*AMD graphics card.. autocorrect |
These are not merely warnings as it kills the process on my test boxes. Since I also use AMD GPUs I spun up a Digital Ocean tensorflow box to give this a go, but it seems there is no GPU support there either, and it's failing miserably. `# Job id 0 Loading hparams from /home/science/tf-demo/models/nmt-chatbot/model/hparamssaving hparams to /home/science/tf-demo/models/nmt-chatbot/model/hparams creating train graph ...num_bi_layers = 1, num_bi_residual_layers=0 Trainable variablesembeddings/encoder/embedding_encoder:0, (15003, 512), creating eval graph ...num_bi_layers = 1, num_bi_residual_layers=0 Trainable variablesembeddings/encoder/embedding_encoder:0, (15003, 512), creating infer graph ...num_bi_layers = 1, num_bi_residual_layers=0 Trainable variablesembeddings/encoder/embedding_encoder:0, (15003, 512), log_file=/home/science/tf-demo/models/nmt-chatbot/model/log_15196691842018-02-26 18:19:44.862736: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA |
what command needs to run and where to run these commands and how please tell. I desperately need help. |
But does it mean that the system is not using GPU for the process? |
Well you need to resolve this if you are building tensorflow in an acceleration environment such as using k-fold in the KerasClassifier.
Just follow the instruction on the screen to complete tensorflow installation. Good luck and enjoy... |
Just chiming in on this thread that you shouldn't just silence these warnings - I'm getting about 43% faster training time by building from source, I think it's worth the effort.
|
how to install tensorflow using this file" tensorflow-1.6.0-cp36-cp36m-win_amd64.whl" |
@anozele |
@gunan --config=opt is not enough, you should also add, e.g., --copt="-msse4.2", when you build TensorFlow from source. |
According to Intel, https://software.intel.com/en-us/articles/intel-optimization-for-tensorflow-installation-guide, If you use intel built Tensorflow, you can ignore those warning since all available instruction set would be used by the backend MKL. Can anyone from Tensorflow confirm this? |
However,it is not faster than i do not use -FMA -AVX -SSE https://stackoverflow.com/questions/57197854/fma-avx-sse-flags-did-not-bring-me-good-performance |
Hi. Sorry if I am beating a dead horse. Just wondering why is the default pip wheel not the binaries compiled with advance instructions? |
This is because old cpu architectures don't support advanced instruction set. See wiki for the detailed list of cpus supporting AVX, AVX2 or AVX512. If the default pip binary is compiled with these instruction sets then tensorflow cannot work on old CPUs. |
Nope, It shows even if you are using GPU, if you haven`t silenced the messages you should also see Tensorflor loading your GPU device in command prompt. |
If you check with this repo: https://github.com/fo40225/tensorflow-windows-wheel He has compiled almost all version of TF with SSE and AVX |
This article was a good tutorial on how to build from source including the flags
|
Just got tensorflow running. Now running into this error.
Currently using Mac Yosemite, downloaded tensorflow using pip3 through anaconda, using python 3.5.
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.
So since anaconda has a special set of commands, how do you get tensorflow to run on SSE4.1, SSE4.2, and AVX via the anaconda command system ? I am really confused how to go about this.
The text was updated successfully, but these errors were encountered: