chainer_example_performance_report

YOSHIFUJI Naoki edited this page Aug 22, 2018 · 6 revisions

Chainer's Examples Execution Time on ClPy and CuPy

Execution Environments

  • src: v2.1.0b0
  • Primary machine (vega)
    • OS: Ubuntu 16.04.4 LTS
    • CPU: Core i7-7700
    • MEM: 8GB
    • GPU: AMD Radeon Vega Frontier Edition (Air Cooled)
    • SDK: amdgpu-pro-18.20-621984
  • Old Primary machine (furyx)
    • OS: Ubuntu 16.04.4 LTS
    • CPU: Core i7-4790
    • MEM: 16GB
    • GPU: AMD Radeon R9 Fury X
    • SDK: amdgpu-pro-17.50-511655
  • Secondary machine (titanv)
    • OS: Ubuntu 16.04.5 LTS
    • CPU: Core i9-7900X
    • MEM: 64GB
    • GPU: NVIDIA TITAN V
    • SDK: CUDA 9.2
    • cuDNN 7.1
  • Old Secondary machine (gf1060)
    • OS: Ubuntu 16.04.5 LTS
    • CPU: Core i7-4790
    • MEM: 8GB
    • GPU: NVIDIA GeForce GTX 1060
    • SDK: CUDA 9.2
    • cuDNN 7.1

Example settings

mnist

  • src: chainer/examples/mnist/train_mnist.py
  • cmd: python train_mnist.py -g 0
  • execution time: See elapsed_time at epoch 20.

ptb

  • src: chainer/examples/ptb/train_ptb.py
  • change: Change train_ptb.py as below to get elapsed_time.
  • cmd: python train_ptb.py -g 0 -e 1
  • execution time: See elapsed_time at epoch 0 iteration 1000.
diff --git a/examples/ptb/train_ptb.py b/examples/ptb/train_ptb.py
index 055a0dd96..ccd6cda96 100755
--- a/examples/ptb/train_ptb.py
+++ b/examples/ptb/train_ptb.py
@@ -238,7 +238,7 @@ def main():
     trainer.extend(extensions.LogReport(postprocess=compute_perplexity,
                                         trigger=(interval, 'iteration')))
     trainer.extend(extensions.PrintReport(
-        ['epoch', 'iteration', 'perplexity', 'val_perplexity']
+        ['epoch', 'iteration', 'perplexity', 'val_perplexity', 'elapsed_time']
     ), trigger=(interval, 'iteration'))
     trainer.extend(extensions.ProgressBar(
         update_interval=1 if args.test else 10))

word2vec

  • src: chainer/examples/word2vec/train_word2vec.py
  • change: Change train_word2vec.py as below to get elapsed_time.
  • cmd: python train_word2vec.py -g 0
  • execution time: See elapsed_time at epoch 20.
diff --git a/examples/word2vec/train_word2vec.py b/examples/word2vec/train_word2vec.py
index 1e462b7bb..6b5929710 100755
--- a/examples/word2vec/train_word2vec.py
+++ b/examples/word2vec/train_word2vec.py
@@ -249,7 +249,7 @@ def main():
         val_iter, model, converter=convert, device=args.gpu))
     trainer.extend(extensions.LogReport())
     trainer.extend(extensions.PrintReport(
-        ['epoch', 'main/loss', 'validation/main/loss']))
+        ['epoch', 'main/loss', 'validation/main/loss', 'elapsed_time']))
     trainer.extend(extensions.ProgressBar())
     trainer.run()

ImageNet

  • src: chainer/examples/imagenet/train_imagenet.py
  • change: Change train_imagenet.py as below to get elapsed_time.
  • cmd: python train_imagenet.py -B10 -E1 -g0
  • execution time: See elapsed_time at iteration 2000.
diff --git a/examples/imagenet/train_imagenet.py b/examples/imagenet/train_imagenet.py
index e2babed..168c710 100755
--- a/examples/imagenet/train_imagenet.py
+++ b/examples/imagenet/train_imagenet.py
@@ -150,7 +150,7 @@ def main():
     trainer.extend(extensions.observe_lr(), trigger=log_interval)
     trainer.extend(extensions.PrintReport([
         'epoch', 'iteration', 'main/loss', 'validation/main/loss',
-        'main/accuracy', 'validation/main/accuracy', 'lr'
+        'main/accuracy', 'validation/main/accuracy', 'lr', 'elapsed_time'
     ]), trigger=log_interval)
     trainer.extend(extensions.ProgressBar(update_interval=10))

Chainer's Example Execution time(sec)

machine gpu mnist ptb word2vec ImageNet
Primary vega 109.745 1157.57 499.036 690.280
Secondary titanv(clpy) 79.829 381.01 194.613 153.185
Old Primary furyx 128.843 896.23 609.921 581.927
Old Secondary gf1060(clpy) 97.015 537.91 131.664 407.442
Secondary titanv(cupy) 38.410 165.07 28.212 118.442
Old Secondary gf1060(cupy) 41.430 200.50 42.442 129.613
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.