TorchNeuron makes AWS Trainium a native PyTorch device

AWS's TorchNeuron backend brings eager mode, torch.compile and FSDP to Trainium, and Hugging Face Transformers, Diffusers, PEFT and TRL now run on it directly; the public beta starts October 20.

Hardware2 min readBy
TorchNeuron makes AWS Trainium a native PyTorch device
Image: Hugging Face

Running models on AWS's own AI chips has long meant learning a different way of working. TorchNeuron aims to end that. It is a new PyTorch backend for AWS Trainium, and Hugging Face says its libraries now support it natively, so Trainium behaves like any other accelerator.

What changes

Until now, Hugging Face support for Trainium and Inferentia ran through optimum-neuron, which sat on a PyTorch XLA-based package. That meant thinking like a compiler: lazy tensors instead of eager execution, static shapes only and a recompile at every graph break. Optimum Neuron hid much of this with custom model classes and trainers.

TorchNeuron plugs directly into PyTorch and exposes "neuron" as a native device, with eager execution, torch.compile and PyTorch's own distributed tools such as DTensor and FSDP2. Transformers, Diffusers, Accelerate, PEFT and TRL run on it with the same classes and scripts used elsewhere, and Hugging Face now recommends using those libraries directly instead of Optimum Neuron.

Inference and training

For text generation, Hugging Face says 89% of the 100 most used model architectures work out of the box, up from 46% with Optimum Neuron v0.4.5. Moving a model onto Trainium mostly means setting the device map to neuron, with a static cache recommended to avoid recompiles. Training uses standard TRL scripts, such as SFTTrainer, with only a few Neuron-specific settings and no special fork of the model code.

The public beta starts on October 20, 2026 and installs with pip as torch-neuronx.

AWS's bigger bet

TechCrunch frames the launch as Amazon's most direct challenge yet to the software advantage behind Nvidia's dominance. AWS says about 85% of AI apps are written in PyTorch and that TorchNeuron lets them run on Trainium with a one-line configuration change. It also says it is contributing changes upstream so PyTorch itself becomes less tied to specific chips. AWS points to Deepgram, which it says processes 70% more audio per dollar after moving to Trainium.

Why it matters for builders

If you train or serve open models, Trainium becomes a realistic option without rewriting code or adopting a separate toolchain. That is useful leverage when GPU capacity is tight or expensive. Since it is a beta, benchmark your own workloads first, and expect rough edges such as dynamic shapes, which the Hugging Face post notes the backend cannot compile automatically yet.

Source: Hugging Face. This article is PickAI’s own summary and analysis based on the original reporting, prepared with AI assistance under our editorial policy.

Enjoyed this story? Get PickAI Weekly

Get the week’s best new AI tools and news — one email a week, free. No spam, unsubscribe anytime.

Related tools on PickAI

↗

Hugging Face

huggingface.co

Hub for open models, datasets and ML demos.

Related AI news

All news →
Hugging Face

TorchTPU makes Google TPUs a native PyTorch device on Hugging Face

A new native PyTorch backend called TorchTPU lets Transformers, Diffusers and Kernels run on Google TPUs by simply sending a model to "tpu", replacing the older torch_xla route.

Hugging Face

PyTorch 2.15 makes Macs much faster for local models

Hugging Face's PyTorch team says 2.15 brings FP8 to Apple's MPS backend, 5-6.5x faster mixture-of-experts decoding, an 8x faster softmax and a Wan2.2 video VAE decode that peaks at 8 GiB instead of 270 GiB.

TechCrunch

Ricursive Intelligence bets on AI-designed chips

The startup is building AI that designs chips and improves with each iteration, aiming to speed up chip design.

Get the weekly AI tools drop

New tools and releases for builders, once a week. No spam, unsubscribe anytime.