HomeAIAI Chips & ComputeAWS Releases TorchNeuron, a Native PyTorch Backend for Trainium

AWS Releases TorchNeuron, a Native PyTorch Backend for Trainium

Updated 29 October 2026: TorchNeuron went live as a public beta on 20 October, as planned. This article now reflects the AWS announcement, the Neuron 2.33.0 release notes and the public GitHub repository.

AWS has released TorchNeuron, an open-source PyTorch backend that lets developers run standard PyTorch code on its Trainium AI chips by moving a model to a new neuron device. The project was announced on the PyTorch blog on 19 October 2026, and AWS launched the public beta on 20 October for Trainium2 and Trainium3 instances on Amazon EC2.

The code is published under the Apache 2.0 licence in the aws-neuron/torch-neuronx repository on GitHub. According to the Neuron 2.33.0 release notes, the first beta packages are torch-neuronx 2.13.3.0 and 2.14.3.0, matching PyTorch 2.13 and 2.14.

How the backend plugs into PyTorch

TorchNeuron registers Trainium through PrivateUse1, the extension point PyTorch provides for hardware outside its built-in device types, and through the newer torch.accelerator APIs. In practice, AWS says, developers change .to("cuda") to .to("neuron") and keep the rest of their code.

The release notes list three ways to run models. Eager mode executes each operation as Python calls it, so ordinary debugging with breakpoints and print statements works. Each operation compiles on first use and is then cached. torch.compile(model, backend="neuron") compiles whole models or selected regions, including backward passes, for production speed. The third route is custom kernels written in AWS’s Neuron Kernel Interface (NKI), which can be registered as PyTorch operations and used in both modes.

ItemWhat AWS documents
HardwareTrainium2 and Trainium3 (EC2 Trn2, Trn3)
Device.to("neuron")
ModesEager, torch.compile, NKI custom kernels
DistributedDDP, FSDP2, tensor, sequence and pipeline parallelism; collectives over EFA
LicenceApache 2.0, public beta
Not yet supportedDynamic shapes in torch.compile, torch.sparse, torch.func, TorchAO, MXFP8

Distributed training and profiling

For large jobs, TorchNeuron adds a neuron backend for PyTorch’s distributed library. AWS says it supports data parallelism (DDP), fully sharded data parallelism (FSDP2), tensor, sequence and pipeline parallelism, and experimental context parallelism. Collectives run over Trainium’s own collective cores inside a node and over AWS’s Elastic Fabric Adapter (EFA) between nodes. Profiling goes through the standard torch.profiler, with traces viewable in AWS’s Neuron Explorer tool. The PyTorch blog also describes vLLM plugins for serving language and diffusion models.

Jana van Greunen, director of PyTorch engineering at Meta, said in the PyTorch post that native Trainium support lets teams “experiment and iterate using the eager execution and distributed APIs they already know”.

Why a native backend matters for Trainium

Until now, the main PyTorch route onto Trainium was an XLA-based library that compiled models into graphs before running them. That made quick experiments and debugging harder than on NVIDIA GPUs, where eager PyTorch is the default. The release notes confirm the shift: the new backend uses the neuron device in place of torch_xla, and code written for the old library must be updated.

This matters because software, more than raw chip performance, keeps most AI work on NVIDIA. Researchers write PyTorch first and tune it for CUDA. A backend that runs the same code with a one-line device change lowers the cost of trying Trainium, at a time when AWS chief executive Andy Jassy has said AWS capacity is sold out for 2026. Other chipmakers are taking the same open route. IBM has moved its Spyre compiler onto PyTorch’s Inductor, and Tenstorrent has raised $1.5bn partly on the strength of its open software stack.

The beta label is accurate. AWS lists real gaps: torch.compile needs static shapes, so variable-length inputs can trigger repeated compilation; unsupported eager operations fall back to the CPU, which can slow a model down (a helper function lists the operations that fell back); and TorchAO and MXFP8 low-precision support are absent. Standalone wheels support only Ubuntu 26.04 for now. The test for production teams will be operator coverage and compile reliability on real models. None of the AWS sources cited here includes a GPU comparison for TorchNeuron.

What’s still unknown

  • When TorchNeuron leaves beta and when dynamic shapes arrive
  • Independent performance figures against GPUs on the same open models
  • Whether the older XLA-based library will be deprecated, and on what timetable

Sources

Related stories

Follow @tsnmediahub on X for breaking AI news as it happens.

Follow on X

Share this story

Latest stories

More in this category

Latest stories

Explore the TSN Atlas: Every topic we cover, mapped. Click a bubble to dive in.