LoginSignup
1
1

More than 5 years have passed since last update.

ChainerのTRAIN_MNISTベンチマーク(GTX1070有/無)

Posted at

はじめに

Chainerにて、GPUの有無による処理速度の差についてメモとなります。
以下の環境にて、ChainerのTRAIN_MNISTが終わるまでのログを残します。

使用環境

OS Windows 10 (64bit)
CPU Intel(R) Core(TM) i7-6700HQ CPU @ 2.6GHz
MEMORY 16.0 GB
GPU GeForce GTX 1070 (8GB)

ベンチマーク結果

CPUでの処理

C:\chainer-master\examples\mnist>python train_mnist.py
GPU: -1
# unit: 1000
# Minibatch-size: 100
# epoch: 20

epoch       main/loss   validation/main/loss  main/accuracy  validation/main/accuracy  elapsed_time
1           0.190619    0.0927074             0.94225        0.9699                    46.2703
2           0.0732134   0.0946572             0.976817       0.9698                    94.4335
3           0.0495815   0.0804488             0.98425        0.9754                    143.703
4           0.0345411   0.0673166             0.988683       0.9802                    193.947
5           0.0294899   0.0734281             0.99045        0.98                      243.573
6           0.0260374   0.0757846             0.991683       0.9797                    293.635
7           0.0190805   0.0786918             0.993617       0.9793                    344.678
8           0.0166003   0.082916              0.994433       0.9809                    396.097
9           0.0154652   0.090306              0.995217       0.98                      448.621
10          0.0169737   0.104848              0.994883       0.9769                    501.25
11          0.0117565   0.101389              0.99615        0.9777                    554.47
12          0.0145186   0.11235               0.99575        0.9769                    608.389
13          0.0110811   0.0956835             0.996117       0.9815                    662.788
14          0.0113676   0.0973962             0.996517       0.9823                    717.948
15          0.013774    0.088823              0.9957         0.9812                    773.548
16          0.00806689  0.0884085             0.997233       0.982                     829.773
17          0.00992101  0.0927463             0.997033       0.9823                    887.692
18          0.00782566  0.0961337             0.997717       0.9826                    944.956
19          0.0133159   0.105524              0.99645        0.9821                    1001.04
20          0.0068301   0.0883455             0.997767       0.9835                    1057.97

GPUでの処理

C:\chainer-master\examples\mnist>python train_mnist.py --gpu 0
GPU: 0
# unit: 1000
# Minibatch-size: 100
# epoch: 20

epoch       main/loss   validation/main/loss  main/accuracy  validation/main/accuracy  elapsed_time
1           0.190363    0.100222              0.943133       0.9685                    5.38222
2           0.0719162   0.084497              0.977482       0.9741                    9.50494
3           0.0490139   0.0731739             0.984199       0.978                     13.4885
4           0.0358094   0.0814409             0.988032       0.9765                    17.7623
5           0.0305423   0.0738367             0.989965       0.9804                    22.0033
6           0.022727    0.0803794             0.992382       0.9792                    26.2637
7           0.0186859   0.0961434             0.993598       0.9788                    30.7188
8           0.0198382   0.0969315             0.993932       0.9774                    35.3541
9           0.0127851   0.109874              0.995965       0.977                     39.9716
10          0.017087    0.0834187             0.994715       0.9801                    44.2826
11          0.0149102   0.0909263             0.995049       0.9818                    48.6314
12          0.011534    0.108625              0.996232       0.9789                    52.9549
13          0.0108741   0.107841              0.996699       0.9798                    57.4682
14          0.00819485  0.109862              0.997316       0.9785                    62.0984
15          0.0144102   0.0972455             0.995515       0.9828                    66.4759
16          0.0122724   0.0908314             0.996382       0.983                     70.6265
17          0.0116133   0.0888805             0.996632       0.9829                    74.6868
18          0.00860304  0.124036              0.997315       0.98                      78.8948
19          0.00665736  0.10047               0.997933       0.9831                    83.2667
20          0.00535954  0.0913196             0.99865        0.9858                    87.8244

結果

CPUでの処理時間合計:約1,058秒(17分38秒)
GPUでの処理時間合計:約 88秒(1分28秒)

GPU使用環境が爆速すぎて、唖然としました・・。この際のGPU使用率は4~5%でした。
GPUを使用する環境の構築は大変手間ですが、長い目で見れば構築して損はないと思います。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1