Skip to content

Instantly share code, notes, and snippets.

@suvayu
Created February 16, 2017 05:49
Show Gist options
  • Save suvayu/a1cd7cc8468cf7921618dec803c62b23 to your computer and use it in GitHub Desktop.
Save suvayu/a1cd7cc8468cf7921618dec803c62b23 to your computer and use it in GitHub Desktop.
Deep Learning AMI README

Deep Learning Amazon Machine Image

The Deep Learning AMIs are prebuilt with popular Deep Learning frameworks and also contain the Anaconda Platform(Python2 and Python3).

Prebuilt Deep Learning Frameworks

  • MXNet: MXNet is a flexible, efficient, portable and scalable open source library for deep learning. It supports declarative and imperative programming models, across a wide variety of programming languages, making it powerful yet simple to code deep learning applications. MXNet is efficient, inherently supporting automatic parallel scheduling of portions of source code that can be parallelized over a distributed environment. MXNet is also portable, using memory optimizations that allow it to run on mobile phones to full servers.

    • branch/tag used: v0.9.3 tag
    • Justification: Stable and well tested
  • Caffe: Caffe is a deep learning framework made with expression, speed, and modularity in mind. It is developed by the Berkeley Vision and Learning Center (BVLC) and by community contributors.

    • branch/tag used: master branch
    • Justification: Supports cuda7.5 and cudnn 5.1
  • Theano: Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently.

    • branch/tag used: rel-0.8.2 tag
    • Justification: Stable and well tested
  • TensorFlow: TensorFlow™ is an open source software library for numerical computation using data flow graphs.

    • branch/tag used : 0.12.1 tag
    • Justification : Stable and well tested
  • Torch: Torch is a scientific computing framework with wide support for machine learning algorithms that puts GPUs first. It is easy to use and efficient, thanks to an easy and fast scripting language, LuaJIT, and an underlying C/CUDA implementation.

    • branch/tag used : master branch
    • Justification : No other stable branch or tag available
  • CNTK: CNTK - Microsoft Cognitive Toolkit - is a unified deep-learning toolkit by Microsoft Research.

    • branch/tag used : v2.0beta7.0
    • Justification : Latest release

Python 2.7 and Python3.5 Support

Python2.7 and Python3.5 is supported in the AMI for the following Deep Learning Frameworks :

  1. Caffe
  2. Tensorflow
  3. Theano
  4. MXNet
  5. CNTK

CPU Instance Type Support

The AMI supports CPU Instance Types for all frameworks. MXNet is built with support for Intel MKL2017 DNN library support. If you want to use the caffe binary for the CPU instance, then you should use the binary inside /home/ubuntu/src/caffe_cpu/

CNTK Python Support

You can run cntk for python inside a conda environment. To do this:

cd /home/ubuntu/src/anaconda3/bin source activate cntk-py34

GPU Drivers Installed

  • CuDNN 5.1
  • Nvidia 352.99
  • CUDA 7.5

Launching Deep Learning Instance

Choose the flavor of the AMI from the list below in the region of your choice and follow the steps at: EC2 Documentation to launch G2 Instance

Testing the FrameWorks

The Deep Learning frameworks have been tested with MNIST data. The AMI contains scripts to train and test with MNIST for each of the frameworks. The test checks if the validation accuracy is above a specific threshold. The threshold is different for each of the frameworks.

The scripts are available in the /home/ubuntu/src/bin directory.

The following scripts test the various frameworks: /home/ubuntu/src/bin/testAll : tests all frameworks /home/ubuntu/src/bin/testMXNet : tests MXNet /home/ubuntu/src/bin/testTheano : tests Theano /home/ubuntu/src/bin/testTensorFlow : tests TensorFlow /home/ubuntu/src/bin/testTorch : tests Torch /home/ubuntu/src/bin/testCNTK : tests CNTK

The following tests have been run against each of the frameworks:

  • MXNet: This example inside the MXNet repository. Validation accuracy threshold tested for is 97%.
  • Tensorflow: This example inside the keras repository. Validation accuracy threshold tested for is 95%.
  • Theano: The same example above. Validation accuracy threshold is 95%.
  • Torch: This example inside the Torch tree. Validation accuracy threshold is 93%.
  • Caffe: This example inside the Caffe repository. Validation accuracy threshold is 98%.
  • CNTK: Ths example inside the CNTK repository. Validation accuracy threshold is 97%.

Ubuntu AMI

Ubuntu based Deep Learning AMIs are available in the following regions:

  • eu-west-1(DUB)
  • us-east-1(IAD)
  • us-west-1(PDX)

References

Test Environments

  • Built and Tested on g2.2xlarge
  • Also tested on g2.8xlarge, p2.16xlarge, c4.4xlarge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment