Skip to content

Instantly share code, notes, and snippets.

@takagi
Last active June 10, 2019 07:25
Show Gist options
  • Save takagi/ea0891439769d011de3467b3468ad6f1 to your computer and use it in GitHub Desktop.
Save takagi/ea0891439769d011de3467b3468ad6f1 to your computer and use it in GitHub Desktop.
Comparison of Chainer's dcgan example between in FP32 mode and in FP16 mode
$ CHAINER_DTYPE=float16 python train_dcgan.py -d 0
Device: @cupy:0
# Minibatch-size: 50
# n_hidden: 100
# epoch: 1000
epoch iteration gen/loss dis/loss ................] 0.01%
0 100 nan nan
0 200 nan nan
0 300 nan nan
0 400 nan nan
0 500 nan nan
0 600 nan nan
0 700 nan nan
0 800 nan nan
0 900 nan nan
1 1000 nan nan
1 1100 nan nan
1 1200 nan nan
1 1300 nan nan
1 1400 nan nan
1 1500 nan nan
1 1600 nan nan
1 1700 nan nan
1 1800 nan nan
1 1900 nan nan
2 2000 nan nan
2 2100 nan nan
2 2200 nan nan
2 2300 nan nan
2 2400 nan nan
2 2500 nan nan
2 2600 nan nan
2 2700 nan nan
2 2800 nan nan
2 2900 nan nan
3 3000 nan nan
3 3100 nan nan
3 3200 nan nan
3 3300 nan nan
3 3400 nan nan
3 3500 nan nan
3 3600 nan nan
3 3700 nan nan
3 3800 nan nan
3 3900 nan nan
...
$ python train_dcgan.py -d 0
Device: @cupy:0
# Minibatch-size: 50
# n_hidden: 100
# epoch: 1000
epoch iteration gen/loss dis/loss ................] 0.01%
0 100 1.36729 1.70036
0 200 1.05911 1.39986
0 300 0.8962 1.37879
0 400 1.18072 1.25942
0 500 1.58481 0.95768
0 600 0.966862 1.34283
0 700 0.964553 1.3054
0 800 1.45845 1.09906
0 900 1.5795 0.991304
1 1000 1.92293 0.940691
1 1100 1.71312 0.924229
1 1200 1.42584 1.16963
1 1300 1.58338 0.933945
1 1400 1.44867 1.12133
1 1500 1.48926 1.00477
1 1600 1.65783 0.971421
1 1700 1.3983 1.15322
1 1800 1.54752 1.00439
1 1900 1.442 1.0563
2 2000 1.60031 0.968116
2 2100 1.40266 1.12639
2 2200 1.45351 1.05327
2 2300 1.48971 0.995408
2 2400 1.5162 1.02328
2 2500 1.45729 1.02267
2 2600 1.4148 1.03601
2 2700 1.49699 1.00479
2 2800 1.71598 0.885762
2 2900 1.54374 1.04083
3 3000 1.55792 1.04438
3 3100 1.51615 0.953852
3 3200 1.29792 1.09466
3 3300 1.54899 0.965764
3 3400 1.68514 0.872914
3 3500 1.54683 1.06491
3 3600 1.47871 1.0106
3 3700 1.58115 0.994612
3 3800 1.44715 1.04719
3 3900 1.53162 0.963249
...
$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import chainer
>>> chainer.print_runtime_info()
Platform: Linux-4.15.0-50-generic-x86_64-with-debian-buster-sid
Chainer: 6.0.0
NumPy: 1.16.4
CuPy:
CuPy Version : 6.0.0
CUDA Root : /usr/local/cuda
CUDA Build Version : 10000
CUDA Driver Version : 10000
CUDA Runtime Version : 10000
cuDNN Build Version : 7500
cuDNN Version : 7500
NCCL Build Version : 2402
NCCL Runtime Version : 2402
iDeep: 2.0.0.post3
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment