Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tutorial for using Mocha in the cloud #221

Merged
merged 22 commits into from
Nov 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ src/cuda/kernels/*
*~
\#*\#
.\#*

*.DS*
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Tutorials
tutorial/cifar10
tutorial/ijulia-imagenet
tutorial/mnist-sDA
tutorial/cloud

############
User's Guide
Expand Down
395 changes: 395 additions & 0 deletions docs/tutorial/cloud.rst

Large diffs are not rendered by default.

Binary file added docs/tutorial/images/bitfusion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorial/images/capture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorial/images/continue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorial/images/create_case.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorial/images/gpu_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorial/images/gpu_test_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorial/images/smile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorial/images/support_request_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions examples/cloud/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Mocha in the Cloud

The real power of developing deep learning networks is only realized
when you can test your ideas and run your models on powerful compute
platforms that complete training in a fraction of the time it took only
a few years ago. Today, state-of-the-art machine learning algorithms
routinely run on cloud based compute that offers access to cutting edge
GPU technology for a tiny cost compared to buying the GPU hardware and
running it in your personal or company servers.

Amazon Web Services (AWS) is one of the most popular cloud based
services that provide access to such powerful computers. As Mocha and
Julia mature I'm sure that a pre-configured Amazon Machine Image (AMI)
will emerge to run Mocha in the cloud. Now, in October 2016, such an AMI
does not exist, but even when a pre-configured image for Mocha does
become available I highly recommend following through this tutorial at
least once so you understand how cloud resources are provisioned and
configured to suport Deep Learning.

We are going to show you how to take the CIFAR-10 example and get it
running in the cloud. Along the way you will learn how to interact with
AWS and get a broader understanding of cloud architectures in general.

The example includes several images and code snapshots. So it is best
to follow along with the [documentation](http://mochajl.readthedocs.io/en/latest/tutorial/cloud.html).
1 change: 1 addition & 0 deletions examples/cloud/cifar10.jl
1 change: 1 addition & 0 deletions examples/cloud/convert.jl
1 change: 1 addition & 0 deletions examples/cloud/get-cifar10.sh
32 changes: 32 additions & 0 deletions examples/cloud/yum_draft.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
This script for yum based linux is a draft and has not been thoroughly tested
=============================================================================

Build from scratch in yum based AMIs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

#! /bin/bash
# Install build environment
# The sed instruction allows the Extended Packages For
# Enterprise Linux (epel) repository to get added to the yum package
# manager. sed -i option edits in place.
echo "*****************Setting up the Build Environment******************"
sudo sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/epel.repo
sudo yum -y update
sudo yum -y upgrade
# I need to check which of these are needed
sudo yum -y install git gcc-gfortran clang m4 patch ncurses-devel python-devel

#Set up Julia
echo "*****************Cloning Julia*************************************"
git clone https://github.com/JuliaLang/julia.git
cd julia
git checkout v0.4.7

#Determine the number of CPUs to build on
NUM_CPUS=$(lscpu | awk '/^CPU\(s\):/ {print $2}')

echo "*****************Making Julia on $NUM_CPUS CPUs***************************"
#Takes 30 minutes on a 4CPU p2.xlarge AWS instance
time make -j $NUM_CPUS
2 changes: 2 additions & 0 deletions examples/mnist/mnist_learning_curve.jl
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/local/bin/julia

using PyPlot, JLD
# Plot the learning curve for the MNIST tutorial to verify
# the solver is progressing toward convergence
Expand Down