Skip to content

Runtimes

Matt Huska edited this page Jul 29, 2016 · 3 revisions

Comparing GPU vs CPU

GPU

.theanorc:

[global]
device = gpu
floatX = float32

[nvcc]
fastmath = True

[lib]
cnmem = 1

Run output:

nostromo (2016-07-29 14:45:50): ~/src/mpi-github/dream_challenge_2016 $ THEANORC="~/.theanorc.gpu" python train_model.py nn_model_2layer 0 relaxed 1                                                                                                                           
Using gpu device 0: GeForce GTX 980 (CNMeM is enabled with initial size: 98.0% of memory, CuDNN 4007)
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 20.022s
  training loss:                0.034955
  validation loss:              0.020143
  training accuracy:            97.95 %
  validation accuracy:          98.87 %
  Test confusion matrix:
[[  0.     0.  ]
 [  1.13  98.87]]

CPU

[global]
device = cpu
openmp = True
force_device = True
print_active_device = True

[blas]
ldflags = -lopenblas -L/scratch/local2/kopp/dreamdata/openblas/lib

Run output:

gnosiophobiegnosiophobie (2016-07-29 14:36:22): ~/src/mpi-github/dream_challenge_2016/utils $ ./test-cpu.sh 
****************** 2 threads, openmp_elemwise_minsize=100000 ******************
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 666.324s
  training loss:		0.030642
  validation loss:		0.019488
  training accuracy:		97.50 %
  validation accuracy:		98.35 %
  Test confusion matrix:
[[  0.      0.   ]
 [  1.654  98.346]]
****************** 2 threads, openmp_elemwise_minsize=200000 ******************
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 657.368s
  training loss:		0.031621
  validation loss:		0.019605
  training accuracy:		97.30 %
  validation accuracy:		98.33 %
  Test confusion matrix:
[[  0.     0.  ]
 [  1.67  98.33]]
****************** 2 threads, openmp_elemwise_minsize=400000 ******************
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 692.086s
  training loss:		0.030744
  validation loss:		0.019502
  training accuracy:		97.47 %
  validation accuracy:		98.35 %
  Test confusion matrix:
[[  0.      0.   ]
 [  1.649  98.351]]
****************** 1 thread ******************
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 740.188s
  training loss:		0.030234
  validation loss:		0.019420
  training accuracy:		97.49 %
  validation accuracy:		98.33 %
  Test confusion matrix:
[[  0.      0.   ]
 [  1.671  98.329]]

20 cores:

gnosiophobiegnosiophobie (2016-07-29 16:50:09): ~/src/mpi-github/dream_challenge_2016/utils $ ./test-cpu.sh | tee results-20cores.txt
****************** openmp_elemwise_minsize=100000 ******************
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 607.899s
  training loss:		0.030730
  validation loss:		0.019452
  training accuracy:		97.50 %
  validation accuracy:		98.34 %
  Test confusion matrix:
[[  0.      0.   ]
 [  1.659  98.341]]
****************** openmp_elemwise_minsize=200000 ******************
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 578.712s
  training loss:		0.029422
  validation loss:		0.019659
  training accuracy:		97.79 %
  validation accuracy:		98.34 %
  Test confusion matrix:
[[  0.      0.   ]
 [  1.664  98.336]]
****************** openmp_elemwise_minsize=400000 ******************
Loading dataset ...
build: nn_model_2layer
Compiling ...
Starting training...
Epoch 1 of 1 took 599.070s
  training loss:		0.030984
  validation loss:		0.019701
  training accuracy:		97.49 %
  validation accuracy:		98.34 %
  Test confusion matrix:
[[  0.      0.   ]
 [  1.663  98.337]]
Clone this wiki locally