# TorchNeuron brings native PyTorch eager mode to AWS Trainium, Hugging Face libraries follow

> **Key takeaway:** TorchNeuron replaces the XLA-based torch-neuronx with a native PyTorch backend for AWS Trainium, enabling eager execution, torch.compile, and standard Hugging Face libraries without Optimum Neuron wrappers.

**Published:** 2026-10-19T00:00:00+00:00 
**Source:** Hugging Face Blog &amp; Announcements 
**Category:** ai-open-models 
**Canonical URL:** https://fosswire.org/news/torchneuron-brings-native-pytorch-eager-mode-to-aws-trainium.html 

## Summary
TorchNeuron enters public beta on October 20, 2026, as a PyTorch plugin that exposes Trainium as a native device. Hugging Face's Transformers, Diffusers, Accelerate, PEFT and TRL now run directly on Trainium with the same APIs used for CUDA or other accelerators. Inference coverage for top text-generation models rises from 46% under Optimum Neuron v0.4.5 to 89% of the top 100 architectures. Users pass device_map="neuron" and standard distributed configs rather than Neuron-specific trainers or modeling classes.

## What changes for Trainium users
- **Eager mode replaces lazy tensors**: Prior torch-neuronx required XLA lazy tensors, static shapes, and recompilation on every graph break; TorchNeuron uses standard PyTorch eager execution
- **Native distributed APIs**: FSDP2, DTensor, and tensor parallelism work through PyTorch's own primitives rather than custom Neuron wrappers
- **torch.compile integration**: No manual backend selection needed; torch.compile auto-detects Neuron and compiles to it
- **Library compatibility**: Transformers, Diffusers, Accelerate, PEFT, TRL run unmodified; Optimum Neuron is deprecated for new work
- **Inference coverage**: 89% of top 100 text-generation architectures supported vs. 46% in Optimum Neuron v0.4.5
- **Installation**: `pip install torch-neuronx` starting October 20, 2026

## Why it matters
The shift removes a major friction point for researchers and teams evaluating Trainium against NVIDIA GPUs, since model ports and training scripts no longer need Neuron-specific forks. For Hugging Face, it reduces maintenance surface by folding Trainium support into the standard libraries rather than a separate optimum-neuron package.