我一直在我可爱的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构建,同样的结果。
My ./配置:
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谢谢,
格特
发布于 2017-05-28 19:10:19
MNIST示例将大部分时间花在矩阵产品中。
另一方面,典型的CNN大部分时间都花在卷积中。
TF在CPU上使用特征作为它的矩阵产品,这是相当优化的,正如我所理解的,以及为什么你看到一个明显的加速。
如果我的信息是最新的,CPU上的卷积就不是那么优化了。他们浪费了复制数据的时间,因此可以用矩阵乘法来处理。因此,当后者加速时,影响较小。
https://stackoverflow.com/questions/44220225
复制相似问题