AWS Trainium

Also known as: Trainium

On this page 7

AWS Trainium is a family of custom AI accelerator chips designed by Amazon Web Services for training and, increasingly, serving large deep learning models. The chips are developed by Annapurna Labs, the AWS chip design unit, and are available only as cloud instances inside AWS, not as cards that customers can buy.

In AI hardware, Trainium belongs to the group of domain-specific accelerators that hyperscale cloud providers build as an alternative to data-center GPUs. Its purpose is to lower the cost per unit of training compute, give AWS control over supply, and offer customers a second platform beside NVIDIA hardware for workloads such as large language models.

How AWS Trainium processes neural network workloads

Each Trainium chip contains several NeuronCores, the compute engines that execute the operations of a neural network. A NeuronCore combines a large tensor engine built as a systolic array for matrix multiplication, a vector engine for element-wise operations such as activations and normalization, a scalar engine, and general-purpose cores for custom operators.

The chips are fed by high-bandwidth memory (HBM) stacked beside the die, because large models are often limited by memory bandwidth rather than arithmetic. Chips inside a server are linked by NeuronLink, a direct chip-to-chip interconnect, while servers communicate over the Elastic Fabric Adapter (EFA) network to form clusters with thousands to hundreds of thousands of chips.

Trainium supports the numeric formats that modern training relies on. The table below summarizes them and their typical role.

FormatTypical roleTrade-off
FP32Master weights, sensitive layersHighest precision, lowest throughput
TF32Matrix math with FP32 rangeFaster than FP32, reduced mantissa
bfloat16Default for large model trainingFP32 range, coarse precision
FP16Mixed-precision trainingNarrow range, needs loss scaling
FP8Highest-throughput matrix mathRequires careful scaling
Numeric formats supported for training

Trainium also implements hardware stochastic rounding, which rounds values up or down with a probability proportional to their distance from each neighbor. This reduces the bias that accumulates when low-precision weights are updated over many training steps.

Trainium generations and instance types

AWS has released the chip in successive generations, each delivered through dedicated Amazon EC2 instance families and larger rack-scale systems. The figures below are approximate and are meant to show the direction of development rather than exact specifications.

GenerationAvailabilityKey characteristics
Trainium (first generation)Trn1 instances, 2022Two NeuronCores, 32 GB HBM per chip, 16 chips per instance
Trainium2Trn2 instances, late 2024Roughly four times the compute, 96 GB HBM per chip
Trn2 UltraServerLate 202464 Trainium2 chips linked by NeuronLink
Trainium3Announced 2024, launched 20253-nanometer process, larger UltraServer systems
Trainium generations at a glance

Very large deployments group many UltraServers into UltraClusters. AWS built one such cluster, known as Project Rainier, with hundreds of thousands of Trainium2 chips for training frontier language models, which shows that the platform is designed for frontier-scale training, not only for small experiments.

The AWS Neuron software stack

Developers program Trainium through the AWS Neuron SDK, which includes a compiler, runtime, profiling tools and framework integrations. Models written in PyTorch or JAX are traced into a computation graph, compiled by the Neuron compiler and executed on NeuronCores, usually through the open XLA compiler infrastructure.

  • Neuron compiler: converts framework graphs into instructions for the tensor, vector and scalar engines.
  • Distributed training libraries: provide tensor, pipeline and data parallelism for models that span many chips.
  • Neuron Kernel Interface (NKI): lets engineers write custom low-level kernels, similar in spirit to writing CUDA or Triton kernels on GPUs.
  • Profiler and monitoring tools: show engine utilization, memory traffic and collective communication time.

The software stack is the main adoption hurdle. Popular model architectures run with little change, but custom operators, dynamic shapes and code tuned specifically for CUDA may require porting work and recompilation.

Trainium compared with other AI accelerators

Trainium competes with data-center GPUs and with other custom chips built by cloud providers. The main differences lie in availability, software ecosystem and pricing model rather than in a single performance figure.

AcceleratorProvider and accessMain distinction
AWS TrainiumAWS only, EC2 instancesTraining focus, lower cost per hour
AWS InferentiaAWS only, EC2 instancesOptimized for inference serving
Cloud TPUGoogle Cloud onlyMature XLA and JAX ecosystem
NVIDIA Hopper and BlackwellAll major clouds and on premisesBroadest software support through CUDA
AMD InstinctSeveral clouds and on premisesROCm software, large HBM capacity
Trainium and related accelerators

AWS has gradually blurred the line between Trainium and Inferentia: Trainium2 and later generations are also marketed for inference of large models, because the same high memory bandwidth and interconnect benefit both training and serving.

When to choose Trainium and what to watch

Trainium is most attractive for large, steady training or serving workloads on standard architectures, where a lower price per hour adds up over weeks of use. It is less attractive when a team depends on GPU-specific libraries or needs to move workloads between clouds.

SituationRecommendationReason
Long training runs on transformersEvaluate Trainium seriouslyCost savings compound over time
Heavy use of custom CUDA kernelsStay on GPUs or budget porting timeKernels must be rewritten
Multi-cloud portability requiredPrefer widely available GPUsTrainium exists only in AWS
Short research experimentsUse familiar hardwareCompilation overhead dominates
Decision guide for Trainium adoption
  • Compilation time: first runs can take minutes to compile; caching compiled graphs avoids repeated delays.
  • Vendor lock-in: code tuned for Neuron does not transfer directly to other hardware.
  • Benchmark claims: vendor price-performance figures depend on model, precision and batch size, so a pilot run on the real workload is essential.

In plain words

Training a modern AI model needs huge amounts of math. Most companies do that math on graphics chips from NVIDIA. Amazon decided to design its own chip for this job. That chip is Trainium.

You cannot buy a Trainium chip and put it in your office. You rent it by the hour in Amazon’s cloud. The main promise is a lower price for the same training work.

The catch is software. Programs written for graphics chips sometimes need changes before they run well on Trainium. So Trainium suits teams that run big, steady workloads on Amazon and can spend some time adapting their code.

A real-world example

A mid-sized software company wants to fine-tune a 70-billion-parameter language model on its own support tickets. On rented GPU instances, the estimated cost of the planned three-week training run exceeds its budget, so the machine learning team tests Trn2 instances with the Neuron SDK.

The team keeps its PyTorch training script, switches the device to the Neuron backend and uses the bfloat16 format with stochastic rounding. The first compilation takes about 40 minutes, and two custom attention operators must be replaced with supported equivalents. After a one-week pilot, measured throughput per dollar is roughly 30 percent better than the GPU baseline for this specific model.

The company runs the full training on Trainium but keeps a small GPU cluster for research prototypes, where flexibility matters more than cost per training step.