来自源的Tensorflow构建不会更快进行再培训?

时间:2017-05-27 18:16:49

标签: performance tensorflow eigen bazel eigen3

我在2015年初的可爱MBP上运行Tensorflow,仅限CPU。 我决定使用Bazel构建一个Tensorflow版本,以加快速度:SSE4.1,SSE4.2,AVX,AVX2和FMA。

bazel build --copt=-march=native //tensorflow/tools/pip_package:build_pip_package

但是使用新安装重新训练Inception v3模型并不快,它使用的时间完全相同。 这很奇怪,因为在使用经过训练的初始模型进行推理时,我的速度提高了12%。训练MNIST示例的速度提高了30%。

那么我们是否有可能在获得再培训方面获得任何速度优势?

我还为保留者做了一个Bazel构建,如解释here,结果相同。

我的./configure:

Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: Users/Gert/Envs/t4/bin/python3
Invalid python path. Users/Gert/Envs/t4/bin/python3 cannot be found
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: ls
Invalid python path. ls cannot be found
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: lslss
Invalid python path. lslss cannot be found
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: /rt/Envs/t4/bin/python3^C
(t4) Gerts-MacBook-Pro:tensorflow root#
(t4) Gerts-MacBook-Pro:tensorflow root# ./configure
Please specify the location of python. [Default is /Users/Gert/Envs/t4/bin/python]: /Users/Gert/Envs/t4/bin/python3
Please specify optimization flags to use during compilation [Default is -march=native]:
Do you wish to use jemalloc as the malloc implementation? (Linux only) [Y/n] n
jemalloc disabled on Linux
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] n
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/N] n
No Hadoop File System support will be enabled for TensorFlow
Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] n
No XLA JIT support will be enabled for TensorFlow
Found possible Python library paths:
  /Users/Gert/Envs/t4/lib/python3.4/site-packages
Please input the desired Python library path to use.  Default is [/Users/Gert/Envs/t4/lib/python3.4/site-packages]

Using python library path: /Users/Gert/Envs/t4/lib/python3.4/site-packages
Do you wish to build TensorFlow with OpenCL support? [y/N] n
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] n
No CUDA support will be enabled for TensorFlow
Configuration finished

谢谢,

格特

1 个答案:

答案 0 :(得分:4)

MNIST示例将大部分时间花在矩阵产品中。

另一方面,典型的CNN大部分时间都花在了卷积中。

TF在CPU上使用Eigen作为其矩阵产品,据我所知,这是非常优化的,以及你看到明显加速的原因。

如果我的信息是最新的,则CPU上的卷积不是优化的。他们浪费时间复制数据,因此可以通过矩阵乘法进行处理。因此,当后者加速时,影响较小。

相关问题