Skip to content

Commit

Permalink
Merge with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
terrytangyuan committed Jan 28, 2016
2 parents f9c1f09 + 120f8af commit 3933be5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 34 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@ List of Contributors
* [Ruixiang Zhang](https://github.com/sodabeta7)
* [Lodewic van Twillert](https://github.com/Lodewic)
* [Aditya Kumar](https://github.com/hiraditya)
* [Dan Becker](https://github.com/dansbecker)
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

MXNet is a deep learning framework designed for both *efficiency* and *flexibility*.
It allows you to ***mix*** the [flavours](http://mxnet.readthedocs.org/en/latest/program_model.html) of symbolic
programming and imperative programming together to ***maximize*** the efficiency and your productivity.
programming and imperative programming to ***maximize*** efficiency and productivity.
In its core, a dynamic dependency scheduler that automatically parallelizes both symbolic and imperative operations on the fly.
A graph optimization layer is build on top, which makes symbolic execution fast and memory efficient.
The library is portable and lightweight, and is ready scales to multiple GPUs, and multiple machines.
A graph optimization layer on top of that makes symbolic execution fast and memory efficient.
The library is portable and lightweight, and it scales to multiple GPUs and multiple machines.

MXNet is also more than a deep learning project. It is also a collection of
[blue prints and guidelines](http://mxnet.readthedocs.org/en/latest/#open-source-design-notes) for building
Expand All @@ -33,7 +33,7 @@ What's New
Contents
--------
* [Documentation and Tutorials](http://mxnet.readthedocs.org/en/latest/)
* [Open Source Design Notes](http://mxnet.readthedocs.org/en/latest/#open-source-design-notes)
* [Design Notes](http://mxnet.readthedocs.org/en/latest/#open-source-design-notes)
* [Code Examples](example)
* [Installation](http://mxnet.readthedocs.org/en/latest/build.html)
* [Pretrained Models](https://github.com/dmlc/mxnet-model-gallery)
Expand All @@ -42,13 +42,13 @@ Contents

Features
--------
* Open sourced design note on useful insights that can re-used by general DL projects.
* Flexible configuration, for arbitrary computation graph.
* Mix and Maximize good flavours of programming to maximize flexibility and efficiency.
* Lightweight, memory efficient and portable to smart devices.
* Scales up to multi GPUs and distributed setting with auto parallelism.
* Support python, R, C++, Julia,
* Cloud friendly, and directly compatible with S3, HDFS, AZure
* Design notes providing useful insights that can re-used by other DL projects
* Flexible configuration for arbitrary computation graph
* Mix and match good flavours of programming to maximize flexibility and efficiency
* Lightweight, memory efficient and portable to smart devices
* Scales up to multi GPUs and distributed setting with auto parallelism
* Support for python, R, C++ and Julia
* Cloud-friendly and directly compatible with S3, HDFS, and Azure

Bug Reporting
-------------
Expand All @@ -68,4 +68,4 @@ In Neural Information Processing Systems, Workshop on Machine Learning Systems,

History
-------
MXNet is initiated and designed in collaboration by authors from [cxxnet](https://github.com/dmlc/cxxnet), [minerva](https://github.com/dmlc/minerva) and [purine2](https://github.com/purine/purine2). The project reflects what we have learnt from the past projects. It combines important flavour of the existing projects, being efficient, flexible and memory efficient.
MXNet is initiated and designed in collaboration by the authors of [cxxnet](https://github.com/dmlc/cxxnet), [minerva](https://github.com/dmlc/minerva) and [purine2](https://github.com/purine/purine2). The project reflects what we have learnt from the past projects. It combines important flavours of the existing projects for efficiency, flexibility and memory efficiency.
33 changes: 15 additions & 18 deletions doc/aws.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Setup an AWS GPU Cluster from Stratch
# Setup an AWS GPU Cluster from Scratch

In this document we give a step-by-step tutorial on how to set up Amazon AWS for
MXNet. In particular, we will address:
Expand All @@ -10,13 +10,12 @@ MXNet. In particular, we will address:

## Use Amazon S3 to host data

Amazon S3 is distributed data storage, which is quite convenient for hosting large
scale datasets. In order to use S3, we need first to get the
[AWS credentials](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html)),
Amazon S3 is distributed data storage, which is quite convenient for hosting large datasets. To use S3, we first get the
[AWS credentials](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html),
which includes an `ACCESS_KEY_ID` and a `SECRET_ACCESS_KEY`.

In order for MXNet to use S3, we only need to set the environment variables `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` properly. For example, we can add the following two lines in
To use MXNet with S3, we must set the environment variables `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` properly. This can be done by adding the following two lines in
`~/.bashrc` (replacing the strings with the correct ones)

```bash
Expand All @@ -32,7 +31,7 @@ wget http://webdocs.cs.ualberta.ca/~bx3/data/mnist.zip
unzip mnist.zip && s3cmd put t*-ubyte s3://dmlc/mnist/
```

## Setup an EC2 GPU Instance
## Set Up an EC2 GPU Instance

MXNet requires the following libraries

Expand All @@ -42,7 +41,7 @@ MXNet requires the following libraries
- `opencv` for image augmentations
- `curl` and `openssl` for read/write Amazon S3

Installing `CUDA` on EC2 instances needs a little bit of effort. Caffe has a nice
Installing `CUDA` on EC2 instances requires some effort. Caffe has a nice
[tutorial](https://github.com/BVLC/caffe/wiki/Install-Caffe-on-EC2-from-scratch-(Ubuntu,-CUDA-7,-cuDNN))
on how to install CUDA 7.0 on Ubuntu 14.04 (Note: we tried CUDA 7.5 on Nov 7
2015, but it is problematic.)
Expand Down Expand Up @@ -74,36 +73,34 @@ echo "USE_S3=1" >>config.mk
make -j8
```

In order to test whether everything has installed properly, we train a convolution neural network on MNIST using GPU:
To test whether everything is installed properly, we train a Convolutional neural network on MNIST using a GPU:

```bash
python tests/python/gpu/test_conv.py
```

If the MNISt data is placed on `s3://dmlc/mnist`, we can let the program read
the S3 data directly:
If the MNISt data is placed on `s3://dmlc/mnist`, we can read the S3 data directly with the following command

```bash
sed -i.bak "s!data_dir = 'data'!data_dir = 's3://dmlc/mnist'!" tests/python/gpu/test_conv.py
```

Note: We can use `sudo ln /dev/null /dev/raw1394` to fix the opencv error `libdc1394 error: Failed to initialize libdc1394`.

## Setup an EC2 GPU Cluster
## Set Up an EC2 GPU Cluster

A cluster consists of multiple machines. We can use the machine with MXNet
installed as the root machine for submitting jobs, and then launch several
slaves machine to run the jobs. For example, launch multiple instances using a
AMI, e.g.
[ami-12fd8178](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-12fd8178),
with dependencies installed. There are two suggestions:
with dependencies installed. There are two options:

1. Make all slaves' ports are accessible (same for the root) by setting **type: All TCP**,
1. Make all slaves' ports accessible (same for the root) by setting **type: All TCP**,
**Source: Anywhere** in **Configure Security Group**

2. Use the same `pem` as the root machine to access all slaves machine, and
then copy the `pem` file into root machine's `~/.ssh/id_rsa`, it all slaves
machines are ssh-able from the root.
2. Use the same `pem` as the root machine to access all slave machines, and
then copy the `pem` file into root machine's `~/.ssh/id_rsa`. If you do this, all slave machines are ssh-able from the root.

Now we run the previous CNN on multiple machines. Assume we are on a working
directory of the root machine, such as `~/train`, and MXNet is built as `~/mxnet`.
Expand Down Expand Up @@ -147,7 +144,7 @@ benchmark for the distributed training. We may consider other [examples](https:/
## More NOTE
### Use multiple data shards
Usually it is common to pack dataset into multiple files, especially when we pack it distributedly. MXNet support direct loading from multiple data shards, simply put all the record files into a folder, and point the data path to the folder
It is common to pack a dataset into multiple files, especially when working in a distributed environment. MXNet supports direct loading from multiple data shards. Simply put all the record files into a folder, and point the data path to the folder.
### Use YARN, MPI, SGE
While ssh can be simple for cases when we do not have a cluster scheduling framework. MXNet is designed to be able to port to various platforms. We also provide other scripts in [tracker](https://github.com/dmlc/dmlc-core/tree/master/tracker) to run on other cluster frameworks, including Hadoop(YARN) and SGE. Your contribution is more than welcomed to provide examples to run mxnet on your favorite distributed platform.
6 changes: 3 additions & 3 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MXNet Documentation
===================
[MXNet](https://github.com/dmlc/mxnet) is a deep learning framework designed for both *efficiency* and *flexibility*.
It allows you to mix the flavours of deep learning programs together to maximize the efficiency and your productivity.
It allows you to mix the flavours of deep learning programs together to maximize efficiency and your productivity.

User Guide
----------
Expand All @@ -24,8 +24,8 @@ Developer Guide

Open Source Design Notes
------------------------
This section contains the design document and notes we made for mxnet system design and deep learning
libraries in general. We believe that open sourcing the system design note can letgeneral audiences understand the motivations and the benefits drawbacks of design choices, and help those who uses deep learning and who builds deep learning systems.
This design document contains notes that are relevant to the MXNet system design and deep learning
libraries in general. We believe that open sourcing this system design note can help general audiences understand the motivations, benefits and drawbacks of our design choices. This will help deep learning practitioners as well as builders of other deep learning systems.

This section will be updated with self-contained design notes on various aspect of deep learning systems,
in terms of abstraction, optimization and trade-offs.
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Mixed(object):
"""
def __init__(self, patterns, initializers):
assert len(patterns) == len(initializers)
self.map = zip([re.compile(p) for p in patterns], initializers)
self.map = list(zip([re.compile(p) for p in patterns], initializers))

def __call__(self, name, arr):
for prog, init in self.map:
Expand Down

0 comments on commit 3933be5

Please sign in to comment.