2017-05-27 12 views
2

私は2015年初頭、私の素敵なMBPであるTensorflowをCPUだけで使っています。 私はSSE4.1、SSE4.2、AVX、AVX2、FMAで処理速度を上げるためにBazelでTensorflowバージョンを構築することに決めました。Tensorflowは、再学習のためのソースからのビルドが高速ではありませんか?

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

しかし、新しいインストールでInception v3モデルを再学習するのは、それほど高速ではなく、まったく同じ時間を使用します。 訓練された開始モデルを使って推論を行っているうちに、私は12%のスピードアップを得るので、奇妙です。 MNISTの例のトレーニングは30%高速です。

再トレーニングのスピード上の利点はありませんか?

同じような結果をhereと説明したようなリテーナー用のBazelビルドも行いました。

私は./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 

おかげで、

ゲルト

+0

完全に接続されたMNISTまたはconv? – MaxB

+0

これはhttps://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/mnist/mnist_softmax.pyです。 – GMath

答えて

4

MNISTの例では、行列積の内側にそのほとんどの時間を費やしています。

一方、一般的なCNNは、ほとんどの時間を畳み込みの中で過ごします。

TFはCPU上のマトリックス製品にEigenを使用していますが、これは非常に最適化されています。私は理解しています。

私の情報が最新の場合、CPU上の畳み込みは最適化されていません。彼らはデータをコピーする時間を無駄にするので、行列乗算によって処理することができます。したがって、後者のスピードアップ時に影響が少なくなります。

関連する問題