AWS TorchNeuron: PyTorch on Trainium with one config change
AWS TorchNeuron runs existing PyTorch code on Trainium2 and Trainium3 with one device change, open source under Apache 2.0. Test your exit from Nvidia now.
AWS released TorchNeuron today, a native PyTorch backend for Trainium chips. Amazon says existing PyTorch code moves to Trainium with "a single configuration change and no rewrite," and the code goes open source under Apache 2.0 at PyTorch Conference North America on October 20. If your AI product runs PyTorch on rented Nvidia GPUs, you just got a cheap way to find out whether you are locked in.
What actually happened
Per Amazon's announcement and the torch-neuronx repo:
- What it is: A PyTorch device backend registered through PyTorch's built-in hardware mechanism. You call
model.to("neuron")the same way you call.to("cuda"). Eager mode is the default. - Chips: Trainium2 and Trainium3 instances. Python 3.12–3.14, pinned to
torch 2.14andtorch-neuronx 2.14.*. - Compile:
torch.compile(backend="neuron")works, but only with static shapes. Every new input shape recompiles. - License: Apache 2.0.
- Upstream: Amazon says it will contribute changes to PyTorch to remove code that ties the framework to specific chips.
- Early users: Amazon names Cartesia and the Lieber Institute. In a separate AWS case study, Deepgram reports 70% more audio processed per dollar on Trainium.
TechCrunch quotes AWS's Colin Brace framing it as "removing the lock-in." Amazon did not publish Trainium prices or a cost comparison with this launch.
Why TorchNeuron matters for your business
Most small teams never chose Nvidia. They chose PyTorch, and Nvidia came with it. That is fine until GPU prices jump or your cloud runs short of capacity. Then "we could switch" turns out to mean a three-month rewrite.
TorchNeuron makes the switch a test you can run in an afternoon. We would do it this way:
- Grep for
cuda. Every hard-coded.cuda()ordevice="cuda"is lock-in you wrote yourself. Move the device into config. - Watch for dynamic shapes. Variable-length batches recompile on every new shape under
torch.compile. Pad to fixed buckets or the speed numbers lie. - Price per job, not per hour. Run the same workload on both, then compare cost per finished inference or per training step. Deepgram's 70% is one company's audio workload. Yours is a different number.
You may never move. But a backend you have tested is a price you can negotiate with. One you haven't is a guess.
Key takeaways
- TorchNeuron runs PyTorch on Trainium2 and Trainium3 through a neuron device, eager mode by default
- Open source under Apache 2.0 from October 20; Amazon is upstreaming chip-neutral changes to PyTorch
- torch.compile needs static shapes — dynamic batches recompile
- No Trainium pricing came with the launch; Deepgram's 70%-per-dollar gain is one case study
- Move your device choice into config and benchmark cost per job before you need the exit
Not sure how locked in your AI stack is? We build vendor-agnostic AI systems — the model, the chip and the cloud are config, not architecture. See how we build, or send us your stack and we'll map the exits.
Sources: Amazon, aws-neuron/torch-neuronx on GitHub, TechCrunch, AWS Machine Learning Blog.
- #aws
- #trainium
- #pytorch
- #ai-infrastructure
- #vendor-lock-in
Tommy Rush — Founder, Rush Commerce
Operator turned builder. 15+ years running operations — now shipping the systems businesses run on. More
Get The Rush Report weekly — one email, zero fluff.
Keep reading
XBOW's AI built a Chrome exploit for $40K. Relaunch your browsers
XBOW used GPT-5.6 Sol to build a full-chain Chrome exploit in six days for about $40K. Why browser patch discipline is now a business control.
Read itCohere to buy AISLE, the AI that found 500+ CVEs. Patch faster
Cohere plans to acquire AISLE, whose AI found 500+ CVEs including all 12 in OpenSSL's January release. AI-found bugs mean faster dependency updates.
Read it