Extensions to the x86 instruction set architecture for Intel and AMD microprocessors, known as Advanced Vector Extensions (AVX) or Sandy Bridge New Extensions,

Were proposed by Intel in March 2008 and first supported by Intel with the Sandy Bridge processor shipping in Q1 2011, and then by AMD with the Bulldozer processor shipping in Q3 2011.

In addition to its additional features and instructions, AVX also introduces a novel encoding system.

Your CPU Supports Instructions That This Tensorflow Binary Was Not Compiled To Use: AVX2

This warning message is printed by the shared library of TensorFlow. As the warning suggests, the shared library doesn’t have the kind of instructions that your CPU may use.

Contents

Why am I getting a warning about this, exactly?

Binaries built with TensorFlow >= 1.6 use AVX instructions, which may cause compatibility issues with older CPUs. So the older CPUs will be unable to run the AVX, while for the newer ones, the user needs to build the tensorflow from source for their CPU.

All the details of this caution are provided here. Also, a means regarding getting rid of this notice for future use.

What does the AVX do?

Most notably, the AVX standard introduced the single-step, floating-point FMA (Fused multiply-add) operation. This helps speed up various tasks without any trouble. It makes the algebra computation more rapid and easy use, especially the dot-product, matrix multiply, convolution, etc.

And they are all the most used and basic operations for every machine-learning training. The CPUs that support the AVX and FMA will be significantly faster than the older ones. But the warning specifies that your CPU supports AVX, so it’s a good point.

Why isn’t it The Standard Practise?

Because the TensorFlow core is not designed to take advantage of the CPU extensions, it is not included in the default distribution. The AVX, AVX2, FMA, and other CPU extensions are listed.

However, the default builds do not have the instructions that cause this problem enabled. In order to ensure maximum compatibility with a wide variety of CPUs, they have been disabled.

These additions are also noticeably slower on the CPU compared to the GPU. When training for a small- to medium-sized machine-learning task, a central processing unit (CPU) is typically employed, whereas a graphics processing unit (GPU) is expected for a larger task.

Method 1: Repairing The Caution!

These alerts are basically straightforward texts. There are warnings because TensorFlow was constructed from source, and you should know about them. Speed improvements may be seen when building TensorFlow from source.

As a result, you can safely proceed with the build of TensorFlow from source notwithstanding these cautions. If your computer has a graphics processing unit (GPU), you can safely disregard the AVX warnings.

Reason being, the most expensive ones will be processed by a GPU. And if you’d rather not deal with this problem ever again, you can simply add this: You need to include the module for the operating system in the main programme and set the mapping object.

# For disabling the warning

import os

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

Alternatively, if you’re working on Unix, you can use the export command in the bash shell.

export TF_CPP_MIN_LOG_LEVEL=2