The sketch explained
Two AWS families with distinct use cases
Model and data feed one accelerator family or the other. Trainium2 supports training and inference. Inferentia2 is designed for inference. The columns do not represent a single shared circuit.
On a small screen, scroll the diagram horizontally to read its labels.
- Trainium2
- Accelerator family used in Trn2 instances, among other configurations.
- Inferentia2
- Accelerator family used in Inf2 instances, among other configurations.
- Training and inference
- Training adjusts weights; inference uses the model to produce output.
- Inference
- Inference runs an already-trained model to answer a request.
- Model and data
- Required inputs are sent to the selected environment.
UNDERSTANDING THE SYSTEM
AWS Trainium2 and Inferentia2: from compiled model to distributed system
These purpose-built accelerators make sense together with the compiler, memory and communications that feed them. The right choice depends on actual model support, input shapes and service requirements as much as advertised compute capability.
Two chips, several system boundaries
Trainium2 is the AWS chip used in EC2 Trn2 instances for training and inference. Inferentia2 powers inference-oriented Inf2 instances: inference means running an already trained model. These names identify neither a library nor an AI model. This article retains those specific generations without presenting them as the latest.
A chip provides local resources; an instance adds host CPUs, host memory and connectivity. A Trn2 UltraServer joins four trn2u.48xlarge instances and 64 chips through NeuronLink. It is neither a 64-core chip nor an arbitrary group of four servers. Name the system boundary whenever comparing memory, networking or cost.
| Resource | Chips | Aggregate HBM, technical documentation |
|---|---|---|
| Inferentia2 | 1 | 32 GiB |
| inf2.24xlarge | 6 | 192 GiB |
| inf2.48xlarge | 12 | 384 GiB |
| Trainium2 | 1 | 96 GiB |
| trn2.48xlarge | 16 | 1 536 GiB |
| Trn2 UltraServer | 64 | 6 144 GiB |
What actually runs inside a NeuronCore
Matrix engines perform operations such as matrix multiplication; vector and scalar resources handle other operations, while GPSIMD provides additional programmability. On-chip SRAM keeps data near compute. Reusing a block already loaded avoids repeatedly reading HBM: tensor movement matters as much as arithmetic operations.
Inferentia2 uses NeuronCore-v2 and Trainium2 uses NeuronCore-v3. On Trn2, the LNC configuration groups physical cores into logical cores exposed to software. Compiler and runtime configurations must agree. Record LNC and component versions rather than deriving process counts from chip counts. A peak FP8 or BF16 rate says nothing by itself about utilization or the final model’s numerical quality.
Fit the model without confusing capacity and bandwidth
Capacity measures how much HBM can hold; bandwidth measures bytes transferred per second. Technical documentation lists 96 GiB and 2.9 TB/s per Trainium2, versus 32 GiB and 820 GiB/s per Inferentia2. These units are not interchangeable: 1 GiB = 2³⁰ bytes, while 1 GB = 10⁹ bytes. Product pages sometimes use different abbreviations; the calculations below follow technical capacities in GiB.
Hypothetical example: 70 billion parameters at two bytes each require 140 × 10⁹ bytes, approximately 130.4 GiB of weights. The capacity-only lower bound is five 32 GiB chips or two 96 GiB chips. This does not prescribe an instance size: placement, replication, buffers and operators add constraints. Inference also needs KV cache; training needs gradients, optimizer states and activations. Summing HBM capacities does not create uniform local access, and summing bandwidths does not predict tokens/s.
- KV cache
- Attention keys and values retained for active sequences. Size grows with context and concurrent requests, and also depends on architecture and precision.
- Operational headroom
- Measure actual peak memory for every partition, including temporary workspaces and fragmentation. An adequate theoretical sum can hide an overloaded partition.
Neuron: compile a program, then execute it
Neuron is the software stack connecting frameworks to the accelerators. In a compiled flow, a graph and its constraints are optimized for a target; neuronx-cc produces a NEFF artifact that the runtime loads and executes. Compilation and execution are separate activities. A long compilation does not imply poor performance once the program is ready; the converse is equally possible.
The persistent cache in the PyTorch/XLA path avoids some recompilation across runs. It is neither a response cache nor the model’s KV cache. Changing the graph, shapes, target or options may require a different artifact. Keeping code, weights, tokenizer, versions, options, LNC and artifact identities makes deployment reproducible. Native paths and libraries evolve: use the compatibility matrix for the integration actually selected.
Three functional stages with no time scale. The path back to the compiler means a new artifact is required, not that every request must compile.
- Graph and contract
Model, shapes, precision and target define what the compiler must prepare. A quality test set accompanies this contract.
- Compilation and artifact
neuronx-cc turns the program into NEFF. Compatible artifacts can be reused; their provenance must remain traceable.
- Loading and execution
The runtime places the program and its data on selected resources. Measure startup, warm-up and steady state separately.
Input shapes become an operational decision
A shape specifies tensor dimensions, such as batch size and sequence length. Hardware support for dynamic shapes does not guarantee that every library accepts arbitrary dimensions without preparation. Some paths compile several variants and select a bucket: a prepared size large enough for the input. Padding fills the remaining dimensions; masks must preserve the meaning of the computation.
Educational example: sequences of 300, 700 and 1,500 tokens, processed separately, use buckets of 512, 1,024 and 2,048 positions. They reserve 3,584 positions, compared with 6,144 if each uses a single 2,048-position bucket: 2,560 fewer positions, or 41.7%. This is not a 41.7% time saving: attention, KV cache, batches and kernels do not all scale linearly. More variants may reduce padding while increasing compilation, storage and qualification work.
Hypothetical lengths and reserved positions, with no performance measurement. The lighter region represents padding: 212, 324 and 548 positions.
- 300 → 512
300 useful positions, 212 added. The first bucket fits; a program prepared for a smaller length would not.
- 700 → 1 024
700 useful positions, 324 added. The router selects the smallest prepared shape that can accept the input.
- 1 500 → 2 048
1,500 useful positions, 548 added. Inputs beyond the largest bucket need an explicit rejection, splitting or alternative-processing policy.
buckets = (512, 1024, 2048)
lengths = (300, 700, 1500)
def choose_bucket(length):
if length < 1:
raise ValueError(length)
return next((b for b in buckets if length <= b), None)
selected = [choose_bucket(n) for n in lengths]
assert selected == [512, 1024, 2048]
assert choose_bucket(2049) is None
reserved = sum(selected)
single_bucket = len(lengths) * buckets[-1]
print(reserved, single_bucket, single_bucket - reserved)Distributed training: place the communications too
Data parallelism processes different examples on replicas and synchronizes gradients. Tensor parallelism divides computation within a layer and exchanges partial results; pipeline parallelism places groups of layers on different resources and passes microbatches between them. These strategies can be combined. Choose their degrees from memory and communication requirements rather than automatically equating one chip with one replica.
AllReduce combines contributions and returns the result to participants; AllGather assembles fragments. Excessive exchanges or waiting for the slowest participant can leave engines idle. NeuronLink connects chips; in a Trn2 UltraServer it also spans the four purpose-configured instances. EFA supports cluster expansion beyond that domain. A fast network removes neither synchronization nor imbalance. Profile whether communication and computation actually overlap.
A domain diagram, not a wiring plan. It represents the 16 chips in an instance and the four UltraServer instances; no application bandwidth is inferred from the drawing.
- Trn2 instance: 16 chips
NeuronLink supports collectives between chips within the instance. Each chip has its own HBM; distribution remains explicit in the program.
- UltraServer: 4 × 16 = 64
Four trn2u.48xlarge instances extend the NeuronLink domain. An UltraServer is not four instances joined solely through EFA.
- Cluster: EFA domain
Other instances or UltraServers communicate over the cluster network. Placement of parallelism groups must account for these boundaries.
Inference: qualify the service, not just the kernel
Prefill processes the prompt; decode then generates tokens while reusing KV cache. Measure time to first token and inter-token latency separately. Add queueing, tokenization and transfers to establish user-visible latency. High aggregate throughput can coexist with poor response time at peak demand.
Inf2 can shard a model over multiple Inferentia2 chips; Trn2 can serve inference too. Product positioning therefore does not make the decision for you. Test actual lengths, concurrent requests and arrival rates, then output quality after every precision change. Model support does not guarantee support for every feature: quantization, speculative decoding, architecture and engine version must be checked together. A successful Trn2 example does not establish Inf2 compatibility.
A comparison protocol that survives production
First fix weights, tokenizer, data, minimum quality and service requirements. Record instance, SDK, driver, runtime, compiler, precision, LNC, parallelism and buckets. Separate cold compilation, loading, warm-up and the measurement window; wait for operations to finish before stopping the timer. Test several length distributions and restart both with and without available artifacts.
Compare the cost of completed work at equivalent quality. For training: time to the quality target, checkpoints and recovery after interruption. For serving: successful requests meeting the latency target, errors and the cost of idle capacity. Include compilation, CPU, storage, networking and porting effort. Obtain prices and regional capacity when the project is evaluated; this article establishes no fixed price or universal cost advantage.
| Test | What to observe | Decision criterion |
|---|---|---|
| Compatibility | Operators, shapes and features actually used | No essential feature without a validated path |
| Quality | Same evaluation, documented precision | Difference within the project’s tolerance |
| Load | Queueing latency, first token, subsequent tokens, errors | Target met under representative traffic |
| Recovery | Artifacts, weights and checkpoint restored | Restart within the accepted window |
| Economics | Total cost per compliant result | Benefit exceeds migration and operating cost |
Select a first workload and define success
A good pilot uses a stable model, a supported feature and measurable traffic, with a team able to manage compilation and operations. An established AWS environment may reduce operational friction; it does not prove economic benefit. For daily model changes, highly customized operators or strong CUDA-kernel dependencies, estimate porting effort and recompilation delays first. Compare a GPU path and, for smaller needs, CPU execution or a managed service.
A useful deliverable includes a reproducible manifest, identified artifacts, memory budget per partition, quality and load results, a recovery test and full cost. Define the scaling threshold and abandonment criteria before the experiment. The examples here remain documentary: no instance was reserved, no runtime installed and no performance measured on AWS hardware.
ORIGINAL DOCUMENT
Catalog record
1. Foundations: hardware, silicon and accelerators
AWS aws.amazon.com Trainium2 & Inferentia2 — Innovation: 7, Adoption: 8
Editorial source: Taxonomie des Technologies d'Intelligence Artificielle · § 5522. Addresses restored with dots; innovation and adoption scores remain those of the document.
VERIFY AND EXPLORE
References
Historical scope: Trainium2/Trn2 and Inferentia2/Inf2. Specifications come from primary sources accessed on November 4, 2026; numerical examples are educational, with no benchmark or cloud spending.
- 01Trainium2 architecture
Chip specifications: HBM capacity and bandwidth; vendor specifications rather than application measurements.
awsdocs-neuron.readthedocs-hosted.com · - 02Inferentia2 architecture
Inferentia2 chip and technical GiB/GiB/s units. The product page uses different labels.
awsdocs-neuron.readthedocs-hosted.com · - 03Trn2 instance architecture
Chip, instance and UltraServer boundaries; technical table and interconnects. Regional availability must be checked separately.
awsdocs-neuron.readthedocs-hosted.com · - 04Inf2 instance architecture
Four Inf2 sizes, separate host memory and inter-chip collectives. Totals do not constitute uniform memory.
awsdocs-neuron.readthedocs-hosted.com · - 05NeuronCore-v3 architecture
Compute engines and software-managed SRAM; functional description without extrapolated throughput.
awsdocs-neuron.readthedocs-hosted.com · - 06Logical NeuronCore configuration
Logical configuration and compiler/runtime consistency requirement. Terminology in the accessed documentation, without asserting a hardware change.
awsdocs-neuron.readthedocs-hosted.com · - 07Neuron Graph Compiler
From graph to NEFF file; compilation targets and options. No particular API is assumed universal.
awsdocs-neuron.readthedocs-hosted.com · - 08NeuronX Runtime
Loading, allocation and execution. Details must match the selected runtime version.
awsdocs-neuron.readthedocs-hosted.com · - 09Neuron Persistent Cache
Compilation cache in the historical PyTorch/XLA flow; do not generalize its path or calls to every integration.
awsdocs-neuron.readthedocs-hosted.com · - 10Optimum Neuron: model export
Export and input shapes in Optimum Neuron; evidence that the software contract matters alongside silicon capabilities.
huggingface.co · - 11Tensor parallelism overview (archived library)
Tensor splitting and result gathering; archived library used for the mechanism rather than as current installation guidance.
awsdocs-neuron.readthedocs-hosted.com · - 12Pipeline parallelism overview (archived library)
Pipelines and microbatches; archived conceptual reference without promising support for every architecture.
awsdocs-neuron.readthedocs-hosted.com · - 13What is AWS Neuron?
SDK components and current software paths. A library recommendation for Trn2 does not automatically validate Inf2.
awsdocs-neuron.readthedocs-hosted.com · - 14vLLM Neuron: feature and model compatibility
Compatibility matrix: check model, feature and target together; no portability promise without examination.
awsdocs-neuron.readthedocs-hosted.com · - 15vLLM Neuron: feature guide
Bucketing, compilation and serving options; details of this Trn2 integration are not automatically transferred to Inf2.
awsdocs-neuron.readthedocs-hosted.com · - 16Amazon EC2 Trn2: product page
Product positioning, 16 chips and 64-chip UltraServer. Marketing percentages, prices and inconsistent availability statements are not used as results.
aws.amazon.com ·
Catalog provenance
Taxonomie des Technologies d'Intelligence Artificielle · Google DocsSource document consulted on . § 5522.
Websites cited in the record
A website’s inclusion in the catalog does not verify the versions, projections or results mentioned in the document.
FROM KNOWLEDGE TO PROJECT
Apply this knowledge to your context.
Scope, architecture, roadmap and notes: keep your decisions in the dedicated space.


