This document is relevant for: Inf1, Inf2, Trn1, Trn2, Trn3
Install PyTorch for Neuron#
Install PyTorch with AWS Neuron support for training and inference on Inferentia and Trainium instances.
Supported Instances: Inf2, Trn1, Trn2, Trn3
PyTorch Version: 2.9+ with Native Neuron backend
Choose installation method#
Method |
Best for |
Considerations |
|---|---|---|
Getting started quickly, prototyping, single-user development |
Pre-configured with tested dependency versions; launch a new AMI to update |
|
Production deployments, CI/CD pipelines, multi-tenant environments |
Requires Docker and Neuron driver on host; portable across EC2, ECS, EKS |
|
Custom OS images, shared clusters, integrating into existing environments |
Full control over versions and dependencies; requires manual dependency management |
Prerequisites#
Before installing, ensure you have:
Requirement |
Details |
|---|---|
Instance Type |
Inf2, Trn1, Trn2, or Trn3 instance |
Operating System |
Ubuntu 24.04, Ubuntu 22.04, or Amazon Linux 2023 |
Python Version |
Python 3.10, 3.11, or 3.12 |
AWS Account |
With EC2 launch permissions |
SSH Access |
Key pair for instance connection |
What You’ll Get#
After installation, you’ll have:
PyTorch 2.9+ with Native Neuron backend
torch-neuronx package for Neuron-specific operations
neuronx-cc compiler for model optimization
Neuron Runtime for model execution
Neuron Tools for profiling and debugging
Version Information#
Component |
Version |
|---|---|
PyTorch |
2.9.0+ |
torch-neuronx |
2.9.0+ |
neuronx-cc |
2.15.0+ |
Python |
3.10, 3.11, 3.12 |
Next Steps#
After installation:
Verify Installation: Run verification commands in the installation guide
Try a Tutorial:
Read the torch-neuronx Programming Guide: Developer Guide (torch-neuronx)
Explore Examples: PyTorch Support on Neuron
Update an existing installation#
Already have PyTorch Neuron installed and need to update to a newer PyTorch version or Neuron SDK release? Select the guide that matches your installation method.
This document is relevant for: Inf1, Inf2, Trn1, Trn2, Trn3