Home

Awesome

Ceci n'est pas un benchmark

Deep learning has been extremely successful on a few classes of data/machine learning problems such as involving images, speech and text (supervised learning) and games (reinforcement learning).

In this repo we'll look at the performance of the most commonly used deep learning tools with high-level API from R/Python (keras on tensorflow and theano backends, mxnet, neon etc.) running on EC2 machines with GPUs (P2 instances with NVIDIA Tesla K80 GPUs) using the most common network architectures on basic datasets of the classes mentioned above.

This author's interest is mainly in "traditional" machine learning problems such as fraud detection, credit scoring or churn, and it seems that on that kind of data/problems deep learning is not as successful and it provides lower accuracy than random forests or gradient boosting machines. Unfortunately most of the hype surrounding deep learning and "artificial intelligence" does not acknowledge this reality.

Conv-nets (CNN)

Image recognition on the MNIST dataset. 2x conv+pooling, dropout, 2x fully connected layers, trained with SGD for 10 epochs. Code and detailed results here.

By Tools

On p2.xlarge (1 GPU):

ToolTime (s)vs Bestvs TFGPU (%)CPUsCPU1 (%)Error rate
neon250.7x5711000.9%
Keras (tensorflow)371.5x664180.8%
R Keras (TF)381.5x634221.0%
Keras (CNTK)582.3x1.6x8011000.8%
Keras (theano)1305x3.5x9711000.9%
mxnet502x1.3x944341.0%

On GTX 1080 Ti:

ToolTime (s)vs Bestvs K80Error rate
Keras (CNTK)230.4x0.9%
mxnet251.1x0.5x0.8%
Keras (tensorflow)271.2x0.7x0.8%
Keras (theano)733.2x0.6x0.9%

Let's say that GTX 1080 Ti is ~2x faster than K80.

On p3.2xlarge (Tesla V100):

ToolTime (s)Error rate
Keras (tensorflow)200.7%

1.3x faster than GTX 1080 Ti, 1.8x faster than K80 (keras TF)

By GPU number/types

Tensorflow backend:

InstanceGPUsGPUTime (s)GPU (%)GPUs
p2.xlarge1Tesla K8037661
p2.8xlarge8Tesla K803667 (1)1/8
g2.2xlarge1GRID K52056701

P2 GPU is 1.5x faster than G2.

Tensorflow uses only 1 GPU even on the multi-GPU server (maybe because of small dataset/model).

mxnet can be set to use multiple GPUs, but then it runs slower (probably because of small dataset/model).

Theano obtained multi-GPU support only recently and that feature has not been added to Keras yet.

Neon disabled multi-GPU support (except on their cloud hosted version).

GPU vs CPU

Tensorflow backend:

DeviceTime (s)vs GPU
GPU (P2)371x
CPU 4 cores3269x
CPU 32 cores1303.5x

"If it's not running on the GPU, it's crap" - Scott Le Grand [ref]