pai/examples/mxnet
Manuel Möhlmann 7461d3091a Fixed typos (#1607) 2018-11-05 13:54:36 +08:00
..
DOCKER.md refactor job-tutorial folder to examples (#1360) 2018-09-14 09:05:34 +08:00
Dockerfile.example.mxnet add support for special characters & fix version of mxnet example (#1542) 2018-10-17 14:53:12 +08:00
README.md Fixed typos (#1607) 2018-11-05 13:54:36 +08:00
mxnet.autoencoder.json Yuqian/unstable example fix (#1474) 2018-10-11 15:00:30 +08:00
mxnet.image-classification.json

README.md

Apache MXNet on PAI

This guide introduces how to run Apache MXNet workload on PAI. The following contents show some basic MXNet examples, other customized MXNet code can be run similarly.

Contents

  1. MXNet autoencoder examples
  2. MXNet image classification examples

MXNet autoencoder examples

To run MXNet examples in PAI, you need to prepare a job configuration file and submit it through webportal.

OpenPAI packaged the docker env required by the job for user to use. User could refer to DOCKER.md to customize this example docker env. If user have built a customized image and pushed it to Docker Hub, replace our pre-built image openpai/pai.example.mxnet with your own.

Here're some configuration file examples:

autoencoder

{
  "jobName": "mxnet-autoencoder",
  "image": "openpai/pai.example.mxnet",
  "taskRoles": [
    {
      "name": "main",
      "taskNumber": 1,
      "cpuNumber": 4,
      "memoryMB": 8192,
      "gpuNumber": 1,
      "command": "pip install scipy scikit-learn && cd incubator-mxnet/example/autoencoder && python mnist_sae.py --gpu"
    }
  ]
}

MXNet image classification examples

image classification

{
  "jobName": "mxnet-image-classification",
  "image": "openpai/pai.example.mxnet",
  "taskRoles": [
    {
      "name": "main",
      "taskNumber": 1,
      "cpuNumber": 4,
      "memoryMB": 8192,
      "gpuNumber": 1,
      "command": "cd incubator-mxnet/example/image-classification && python train_mnist.py --network mlp"
    }
  ]
}

For more details on how to write a job configuration file, please refer to job tutorial.

Note:

Since PAI runs MXNet jobs in Docker, the training speed on PAI should be similar to speed on host.

We provide a stable docker image by adding the data to the image. If you want to use it, add stable tag to the image name: openpai/pai.example.mxnet:stable.