This document is relevant for: Inf1
, Inf2
, Trn1
, Trn2
PyTorch Neuron Setup Guide for Rocky Linux 9#
Get Started with Latest Release of PyTorch Neuron#
This section provides links that will assist you to quickly start with a fresh installation of PyTorch Neuron (torch-neuronx
, torch-neuron
).
Launch the Instance
Please follow the instructions at launch an Amazon EC2 Instance to launch an instance. When choosing the instance type at the EC2 console, please make sure to select the correct instance type.
To get more information about instances sizes and pricing see: Trn1 web page, Inf2 web page
Select Rocky-9-EC2-Base AMI
When launching a Trn1, please adjust your primary EBS volume size to a minimum of 512GB.
After launching the instance, follow the instructions in Connect to your instance to connect to the instance
Install Drivers and Tools
# Install and enable EPEL
sudo yum config-manager --set-enabled crb
sudo yum install epel-release -y
# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB
# Update OS packages
sudo yum update -y
# Reboot instance to ensure kernel is updated
sudo reboot
# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y
# Install git
sudo yum install git -y
# install Neuron Driver
sudo yum install aws-neuronx-dkms-2.* -y
# Install Neuron Runtime
sudo yum install aws-neuronx-collectives-2.* -y
sudo yum install aws-neuronx-runtime-lib-2.* -y
# Install Neuron Tools
sudo yum install aws-neuronx-tools-2.* -y
# Add PATH
export PATH=/opt/aws/neuron/bin:$PATH
Please continue with the installation instructions for EFA and PyTorch Neuron by following the corresponding AL2023 setup guide below (please skip the “Launch the Instance” and “Install Drivers and Tools” sections).
This document is relevant for: Inf1
, Inf2
, Trn1
, Trn2