7461d3091a | ||
---|---|---|
.. | ||
DOCKER.md | ||
Dockerfile.example.mxnet | ||
README.md | ||
mxnet.autoencoder.json | ||
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
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
.