这个tensorflow消息是什么意思?有什么副作用吗?安装成功了吗?

我刚刚在 anaconda python 上安装了 tensorflow v2.3。我尝试使用下面的 python 命令测试安装;

$ python -c "import tensorflow as tf; x = [[2.]]; print('tensorflow version', tf.__version__); print('hello, {}'.format(tf.matmul(x, x)))"

我收到以下消息;

2020-12-15 07:59:12.411952: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
hello, [[4.]]

从消息来看,似乎安装成功了。但究竟This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX AVX2是什么意思?

我是否使用具有某些有限功能的 tensorflow 版本?有什么副作用吗?

我正在使用 Windows 10。

回答

Tensorflow 的一个重要部分是它应该很快。通过合适的安装,它可以与 CPU、GPU 或 TPU 配合使用。部分快速意味着它根据您的硬件使用不同的代码。一些 CPU 支持其他 CPU 不支持的操作,例如向量化加法(一次添加多个变量)。Tensorflow 只是告诉您,您安装的版本可以使用 AVX 和 AVX2 操作,并且在某些情况下(例如在前向或后向传播矩阵乘法中)默认设置为这样做,这可以加快速度。这不是错误,它只是告诉您它可以并且将会利用您的 CPU 来获得额外的速度。

注意:AVX 代表高级矢量扩展。


回答

消息

This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)
to use the following CPU instructions in performance-critical operations:  AVX AVX2

意味着在性能很重要的地方(例如深度神经网络中的矩阵乘法),将使用某些优化的编译器指令。安装好像成功了。

该oneDNN GitHub的库说:

oneAPI 深度神经网络库 (oneDNN) 是用于深度学习应用程序的基本构建块的开源跨平台性能库。该库针对英特尔架构处理器、英特尔处理器显卡和基于 Xe 架构的显卡进行了优化。oneDNN 对以下架构提供实验支持:

  • Arm* 64 位架构 (AArch64)
  • 英伟达* GPU
  • OpenPOWER* 电源 ISA (PPC64)
  • IBMz* (s390x)

以上是这个tensorflow消息是什么意思?有什么副作用吗?安装成功了吗?的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>