2017-05-27 2 views
2

Je cours Tensorflow sur ma belle MBP début 2015, CPU seulement. J'ai décidé de construire une version Tensorflow avec Bazel pour accélérer les choses avec: SSE4.1, SSE4.2, AVX, AVX2 et FMA.Tensorflow construire de la source n'est pas plus rapide pour la rééducation?

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

Mais le recyclage du modèle v3 Inception avec la nouvelle installation n'est pas plus rapide, il utilise exactement la même quantité de temps. C'est étrange, car en faisant des inférences avec un modèle de début de formation, j'obtiens une augmentation de vitesse de 12%. La formation de l'exemple MNIST est 30% plus rapide.

Alors est-il possible que nous n'obtenions aucun avantage de vitesse en recyclant?

J'ai également fait une construction Bazel pour une retenue comme expliqué here, même résultat.

Mon ./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 

Merci,

Gert

+0

entièrement connecté MNIST ou conv? – MaxB

+0

Celui-ci: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax.py – GMath

Répondre

4

L'exemple MNIST passe le plus clair de son temps à l'intérieur du produit de la matrice. En revanche, les CNN typiques passent la majeure partie de leur temps à l'intérieur des circonvolutions.

TF utilise Eigen pour ses produits matriciels sur la CPU, ce qui est assez optimisé, si je comprends bien, et la raison pour laquelle vous voyez une accélération notable.

Les convolutions sur la CPU ne sont pas aussi optimisées, si mes informations sont à jour. Ils perdent leur temps à copier des données, de sorte qu'il peut être traité par multiplication matricielle. Donc, il y a moins d'impact quand ce dernier est accéléré.