Update to latest Neuron MXNet

Develop on AWS ML accelerator instance

The simplest environment setup for model development installs all Neuron SDK components directly on an AWS ML accelerator instance: the Neuron framework extensions, compiler, runtime, and tools. This will allow you to compile, execute, and performance tune your model, all in the same instance. This is the recommended workflow when first starting to work with Neuron device or when optimizing a model.

Note

For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

# Update OS packages
sudo apt-get update -y

# Update Neuron Driver
sudo apt-get install aws-neuron-dkms -y

# Activate Python virtual environment where Neuron pip packages were installed 
source mxnet_venv/bin/activate


# Set Pip repository  to point to the Neuron repository
pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com

#Update Neuron MXNet
pip install --upgrade mx_neuron neuron-cc

# Update Neuron Tools
sudo apt-get install aws-neuron-tools -y

Compile on compute instance

If model compilation occurs outside the model deployment environment, you can install only the Neuron framework extensions and the compiler on any compute instance. This setup is helpful when compiling large complex models that require large amount of memory or during a CICD process where models are compiled in a separate step, prior to deployment.

Note

For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

# Activate Python virtual environment where Neuron pip packages were installed 
source mxnet_venv/bin/activate


# Set Pip repository  to point to the Neuron repository
pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com

#Update Neuron MXNet
pip install --upgrade mx_neuron neuron-cc

Deploy on AWS ML accelerator instance

During deployment it can be beneficial to reduce the number of components installed in the system. For use-cases where only inference is necessary (compilation is already complete), only the framework and runtime should be installed.

Note

For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

# Update OS packages
sudo apt-get update -y

# Update Neuron Driver
sudo apt-get install aws-neuron-dkms -y

# Activate Python virtual environment where Neuron pip packages were installed 
source mxnet_venv/bin/activate


# Set Pip repository  to point to the Neuron repository
pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com

#Update Neuron MXNet
pip install --upgrade mx_neuron