---
{
  "title": "TorchNeuron explained: AWS's native PyTorch backend for Trainium",
  "slug": "torchneuron",
  "intent": "hype",
  "locale": "en",
  "date": "2026-10-20",
  "updated": "2026-10-20T06:24:45Z",
  "template": "default",
  "excerpt": "TorchNeuron runs existing PyTorch code on AWS Trainium by switching the device to neuron. What changed, what a chip costs, and where the one-line promise stops.",
  "categories": [
    "Trending"
  ],
  "tags": [
    "open source",
    "developer tools",
    "AI models",
    "LLM costs"
  ],
  "readTime": 17,
  "author": 19,
  "reviewer": 4,
  "seo": {
    "title": "TorchNeuron explained: PyTorch on AWS Trainium, cost and limits",
    "description": "TorchNeuron explained: how AWS's open-source backend runs PyTorch on Trainium with .to('neuron'), what a Trainium2 chip costs per hour, and the limits to know.",
    "image": "https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/banners/torchneuron-mvgai7rv-101470-20261020.png"
  },
  "coverImage": "https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/banners/torchneuron-mvgai7rv-101470-20261020.png",
  "coverImageAlt": "Hand-drawn illustration of a developer at a laptop sending work to a cloud with an AI chip inside, next to the AWS logo",
  "coverImageWidth": 1920,
  "coverImageHeight": 1080,
  "cta": {
    "variant": "demo",
    "headline": "Faster chips, same backlog",
    "subhead": "See how an eesel AI teammate answers your tickets and chats, tested on your past conversations before it goes live.",
    "primary": {
      "label": "Book a demo",
      "action": "demo"
    },
    "secondary": {
      "label": "Try for free",
      "action": "signup"
    }
  },
  "faqs": {
    "heading": "Frequently Asked Questions",
    "type": "blog",
    "answerType": "html",
    "faqs": [
      {
        "question": "What is TorchNeuron?",
        "answer": "TorchNeuron is AWS's open-source, native PyTorch backend for its Trainium chips. It adds a <code>neuron</code> device to standard PyTorch, so eager mode, <code>torch.compile</code> and <code>torch.distributed</code> run on Trainium2 and Trainium3. It launched in public beta on 20 October 2026. If you want AI that does a job rather than a chip to run models on, an <a href=\"https://www.eesel.ai/blog/ai-teammates\">AI teammate</a> is the other end of the stack."
      },
      {
        "question": "Is TorchNeuron free?",
        "answer": "Yes. TorchNeuron is released under the Apache 2.0 license on GitHub and installs with pip. What you pay for is the Trainium instance it runs on, for example a trn2.48xlarge at $35.7608 an hour through EC2 Capacity Blocks. See my <a href=\"https://www.eesel.ai/blog/aws-pricing\">AWS pricing breakdown</a> for how the wider bill works."
      },
      {
        "question": "Does TorchNeuron really need only one line of code changed?",
        "answer": "For eager mode, mostly yes: change <code>.to('cuda')</code> to <code>.to('neuron')</code>, or change nothing if your code already uses <code>torch.accelerator</code>. For production speed you also add <code>backend=\"neuron\"</code> to <code>torch.compile</code>, use static shapes and drop CUDA-only options. Agentic tools like <a href=\"https://www.eesel.ai/blog/claude-code\">Claude Code</a> can handle that kind of mechanical port well."
      },
      {
        "question": "Which instances does TorchNeuron support?",
        "answer": "TorchNeuron supports Trainium2 (trn2) and Trainium3 (trn3) instances only. Trainium1 and Inferentia users stay on the older XLA-based torch-neuronx line, versions before 2.14. If you only need hosted inference without managing chips, providers like <a href=\"https://www.eesel.ai/blog/together-ai\">Together AI</a> or <a href=\"https://www.eesel.ai/blog/fireworks-ai\">Fireworks AI</a> are simpler."
      },
      {
        "question": "How does TorchNeuron compare to running PyTorch on NVIDIA GPUs?",
        "answer": "The code path is now the same shape: standard PyTorch, a different device name. Per chip-hour, a Trainium2 chip costs $2.235 in EC2 Capacity Blocks against $5.970 for an H100, and AWS claims 30-40% better price performance than P5e and P5en. Chips are not equal, so benchmark your own model. GPU clouds like <a href=\"https://www.eesel.ai/blog/coreweave\">CoreWeave</a> remain the default for CUDA-heavy code."
      },
      {
        "question": "Does TorchNeuron work with Hugging Face Transformers?",
        "answer": "Yes. Transformers, Diffusers, Accelerate, PEFT and TRL run on the neuron device directly, and Hugging Face now recommends them over Optimum Neuron. Hugging Face reports 89% of the top 100 text-generation architectures work out of the box, up from 46% with Optimum Neuron v0.4.5. More on the platform in my <a href=\"https://www.eesel.ai/blog/hugging-face\">Hugging Face overview</a>."
      },
      {
        "question": "Should a customer support team care about TorchNeuron?",
        "answer": "Only indirectly. TorchNeuron lowers the cost of training and serving models, which over time lowers what AI tools cost to run. A support team gets more from a ready-to-work <a href=\"https://www.eesel.ai/blog/ai-helpdesk-agent\">AI helpdesk agent</a> that plugs into its helpdesk than from picking chips, and <a href=\"https://www.eesel.ai\">eesel</a> handles the model layer for you."
      }
    ],
    "supportLink": null
  },
  "alternates": {
    "x-default": "torchneuron",
    "en": "torchneuron",
    "de": "torchneuron-erklaert-pytorch-backend-aws-trainium",
    "es": "torchneuron-explicado-backend-pytorch-aws-trainium",
    "fr": "torchneuron-explique-backend-pytorch-aws-trainium",
    "ja": "torchneuron-kaisetsu-pytorch-aws-trainium",
    "pt": "torchneuron-explicado-backend-pytorch-aws-trainium"
  }
}
---

## TL;DR

TorchNeuron is AWS's open-source PyTorch backend for its Trainium chips, <mark>in public beta since 20 October 2026</mark>. It registers Trainium as a normal PyTorch device called `neuron`, so for most code the port really is `.to('cuda')` becoming `.to('neuron')`. The library is free under Apache 2.0, and you pay for Trainium time: <mark>$2.235 per Trainium2 chip-hour</mark> in EC2 Capacity Blocks, against $5.970 for an H100.

The headline undersells the catch. Eager mode is the easy, debuggable path, but production speed comes from `torch.compile`, which on Neuron needs static shapes and fails on any operator it can't lower. It also runs only on Trainium2 and Trainium3, so Trainium1 and Inferentia users are left on the old stack.

If you train or serve your own models on AWS, this is the week to run a pilot. If you just want AI doing a job, like answering tickets, skip the chip question: an [eesel AI teammate](https://www.eesel.ai/blog/ai-teammates) handles the model layer, and [SE Ranking](https://www.eesel.ai/customers/se-ranking) runs one across three products and about 4,650 conversations a month.

## What is TorchNeuron?

TorchNeuron is a native PyTorch backend for [AWS Trainium](https://aws.amazon.com/ai/machine-learning/trainium/), the custom AI chip family Amazon has built since buying Annapurna Labs in 2015. It was [announced on the PyTorch blog](https://pytorch.org/blog/introducing-torchneuron-native-pytorch-backend-for-aws-trainium/) on 19 October 2026 and went live as an open-source public beta at PyTorch Conference North America on 20 October. The code lives at [aws-neuron/torch-neuronx](https://github.com/aws-neuron/torch-neuronx) under Apache 2.0.

I build integrations and APIs for eesel, and "works with a one-line change" is the claim I trust least, mostly because I've written it on our own pages. So I read the docs, the repo and the launch material before believing it. The short version: the claim holds for eager mode, and the real engineering moves to the compile step.

![The TorchNeuron docs page showing the public beta notice for Trn2 and Trn3 and the list of changes needed for eager mode and torch.compile, as taken from the AWS Neuron documentation](https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/torchneuron/images/torchneuron-docs-20261020.png)

The [official docs](https://awsdocs-neuron.readthedocs-hosted.com/en/latest/torch/index.html) put it plainly: TorchNeuron is in public beta for the Neuron 2.33 release and runs on Trainium2 (trn2) and Trainium3 (trn3) instances. Amazon's own framing on [About Amazon](https://www.aboutamazon.com/news/innovation-at-amazon/torchneuron-pytorch-aws-trainium-chips-ai) is that <mark>85% of AI researchers and developers write their code in PyTorch</mark>, and until now moving that code to new chips meant months of rewriting and revalidating.

Andy Jassy, Amazon's CEO, made the business case on X the same day:

> "Trying a new AI chip used to be a lot of work. You often had to rewrite your code, revalidate it, and sink many weeks in, betting this new chip is the right one for your workload."
>
> -- [Andy Jassy, X](https://x.com/ajassy/status/2112255793701773696)

## What's actually new here

Trainium has run PyTorch for years, so it's fair to ask what changed. The answer is the plumbing underneath. Until PyTorch 2.9, Neuron ran PyTorch through [PyTorch/XLA](https://awsdocs-neuron.readthedocs-hosted.com/en/v2.27.0/about-neuron/announcements/neuron2.x/announce-transition-pytorch-trainium.html), which used lazy tensors: nothing ran until a graph was traced and compiled, so prints, breakpoints and Python control flow behaved oddly. AWS announced that PyTorch 2.9 would be the last XLA-based version, with 2.10 and later moving to native support.

TorchNeuron plugs into PrivateUse1, the official PyTorch extension point for custom hardware. To PyTorch, Trainium becomes just another device next to CPU and CUDA. That's why the [launch post](https://pytorch.org/blog/introducing-torchneuron-native-pytorch-backend-for-aws-trainium/) can say `torch.nn`, `torch.autocast`, `torch.distributed` and `torch.profiler` all work on the `neuron` device as written.

![Before and after comparison: PyTorch/XLA with lazy tensors, a Neuron-specific trainer and 46% of top-100 text models, versus TorchNeuron with eager by default, standard Transformers plus TRL and 89% of top-100 text models](https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/blog-gen/generated/asset-1792477146849-cqtjw6-20261020.png)

The clearest measure of the change comes from [Hugging Face](https://www.eesel.ai/blog/hugging-face). In its [launch post](https://huggingface.co/blog/hf-torchneuron), Hugging Face says <mark>89% of the top 100 text-generation architectures now work out of the box</mark>, compared with 46% through its older Optimum Neuron v0.4.5 library. It now recommends using Transformers, Diffusers, Accelerate, PEFT and TRL directly on Trainium instead of going through Optimum Neuron.

Here's the before and after in one table:

| | PyTorch/XLA (torch-neuronx before 2.14) | TorchNeuron (torch-neuronx 2.14+) |
| --- | --- | --- |
| Execution | Lazy tensors, traced graphs | Eager by default, `torch.compile` optional |
| Debugging | Graph-level, prints delayed | Python prints and breakpoints work |
| Hugging Face path | Optimum Neuron wrapper | Transformers, TRL, Diffusers directly |
| Distributed | Neuron-specific APIs | DDP, FSDP2, DTensor, TP, PP |
| Chips | Trn1, Trn2, Inferentia | Trn2 and Trn3 only |
| PyTorch versions | Up to 2.9 | 2.14 in the current release |

That last row matters more than the launch coverage suggests, and I come back to it in the limits section.

## How TorchNeuron works

Under the hood, TorchNeuron has two backends: one registered with the PyTorch dispatcher for eager mode, and one registered with TorchDynamo for `torch.compile`. Both hand work to the Neuron compiler, which produces NEFF files (Neuron Executable File Format) that the Neuron runtime runs on the chip.

![TorchNeuron architecture: PyTorch frontend and dispatcher feed the Neuron PrivateUse1 backend and the Neuron TorchDynamo backend, which talk to the Neuron compiler and runtime above AWS Trainium, as taken from the PyTorch blog](https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/torchneuron/images/torchneuron-architecture-20261020.png)

The [About TorchNeuron](https://awsdocs-neuron.readthedocs-hosted.com/en/latest/torch/about-pytorch-neuron.html) page explains the two paths in detail. They behave differently enough that I'd treat them as two products.

**Eager mode** runs each operation as soon as you call it. The first time an operator runs, it compiles to its own NEFF and lands in an on-disk cache; after that, it's served from the cache. If an operator has no Neuron implementation, it falls back to the CPU with a warning, so the model still runs. There's also an experimental adaptive eager mode (set `TORCH_NEURONX_ENABLE_CONCATENATION=1`) that fuses eligible operations to cut launch overhead.

**`torch.compile`** captures the model into a graph through TorchDynamo and AOTAutograd, lowers it through Torch-MLIR to StableHLO, and compiles the whole graph into one NEFF. It's the production path. The trade is strictness: per the [GitHub README](https://github.com/aws-neuron/torch-neuronx), `dynamic` must be `False`, `mode` only accepts `"default"`, tensors must be contiguous, and every new input shape triggers a fresh compile. A captured operator the backend can't lower makes compilation fail by default.

![Eager mode versus torch.compile on TorchNeuron: eager needs only .to('neuron') and falls back to CPU for missing ops, while torch.compile adds backend='neuron', needs static shapes and stops on a missing op](https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/blog-gen/generated/asset-1792477145474-rhq69o-20261020.png)

So the honest reading of "one configuration change" is: one change to start, and a second round of work to go fast. In practice that second round is mostly padding or bucketing inputs to a few fixed shapes, and pointing `TORCH_NEURONX_NEFF_CACHE_DIR` at shared storage (the docs suggest Amazon FSx) so a fleet doesn't recompile the same graphs on every instance.

Above both modes sits NKI, the Neuron Kernel Interface, for writing custom kernels when the compiler isn't enough. You register an NKI kernel as a normal PyTorch operator with `nki_op`, and it works in eager mode and inside a compiled graph. AWS also open-sourced [NKI-lib](https://github.com/aws-neuron/nki-library/blob/main/README.md), a set of tuned kernels including FlashAttention and MoE blockwise kernels.

## What the code change looks like

For a training loop, the [launch post](https://pytorch.org/blog/introducing-torchneuron-native-pytorch-backend-for-aws-trainium/) shows the whole diff as one line:

```python
model = MyModel().to('neuron')   # the only change
optimizer = torch.optim.AdamW(model.parameters())
for batch in dataloader:
    optimizer.zero_grad()
    loss = criterion(model(batch), targets)
    loss.backward()
    optimizer.step()
```

For the compiled version, you name the backend once with `torch.compiler.set_default_backend("neuron")`, or per call with `torch.compile(model, backend="neuron")`. Code written against `torch.accelerator`, PyTorch's device-agnostic API, needs no change at all. You don't even need `import torch_neuronx`: the package registers itself through the `torch.backends` entry point and loads on `import torch`.

The full list of edits from the [docs](https://awsdocs-neuron.readthedocs-hosted.com/en/latest/torch/index.html) is short:

1. Change `.to('cuda')` to `.to('neuron')`, or rely on `torch.accelerator`.
2. Use `torch.autocast(device_type="neuron")` for mixed precision.
3. Configure sharding by NeuronCores rather than GPUs for distributed jobs.
4. For `torch.compile`, add `backend="neuron"` and remove CUDA-only settings like `mode="max-autotune-no-cudagraphs"`.

For Hugging Face models it's even shorter. Loading a model with `device_map="neuron"` puts the weights on Trainium, and `device_map="auto"` finds the device on its own. The [Hugging Face example](https://huggingface.co/blog/hf-torchneuron) fine-tunes with a standard TRL `SFTTrainer` script on 8 Trainium2 chips (half a trn2.48xlarge), with one Neuron-specific setting: `HF_DEACTIVATE_ASYNC_LOAD=1`, because async weight loading isn't supported yet. The checkpoint it saves is a normal Transformers checkpoint you can load on any hardware.

This is the kind of mechanical port that coding agents are good at. If you're moving a repo, a tool like [Claude Code](https://www.eesel.ai/blog/claude-code) or [OpenAI Codex](https://www.eesel.ai/blog/openai-codex) can find the CUDA-specific calls and swap them, as long as you check the compile logs yourself.

## How much does TorchNeuron cost?

The library is free. TorchNeuron is Apache 2.0, installs with `pip install torch-neuronx` from the Neuron pip repository, and comes preinstalled in the Neuron Deep Learning AMI and Deep Learning Containers. The cost is the Trainium time.

AWS publishes Trainium prices on its [Capacity Blocks pricing page](https://aws.amazon.com/ec2/capacityblocks/pricing/), where you reserve accelerator capacity for a fixed window. These are the effective hourly rates listed on 20 October 2026, and AWS says the next scheduled price update is January 2027:

| Instance | Accelerators | Per instance-hour | Per chip-hour | Works with TorchNeuron? |
| --- | --- | --- | --- | --- |
| trn2.48xlarge (US East, Ohio) | 16 x Trainium2 | $35.7608 | $2.235 | Yes |
| trn2.3xlarge (select regions) | 1 x Trainium2 | $2.235 | $2.235 | Yes |
| trn1.32xlarge | 16 x Trainium | $9.532 | $0.596 | No |
| p5.48xlarge | 8 x H100 | $47.757 | $5.970 | GPU, not Neuron |
| p5e.48xlarge | 8 x H200 | $54.924 | $6.866 | GPU, not Neuron |
| p5en.48xlarge | 8 x H200 | $63.158 | $7.895 | GPU, not Neuron |

Linux carries no extra operating system fee on these blocks. Trn3 UltraServers, which scale to 144 Trainium3 chips, have no public per-hour rate on that page.

![Hourly price per chip in EC2 Capacity Blocks, October 2026: Trainium1 $0.596 (not supported), Trainium2 $2.235, H100 $5.970, H200 on P5e $6.866, H200 on P5en $7.895](https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/blog-gen/generated/asset-1792477191887-cyorbz-20261020.png)

Per chip, a Trainium2 hour costs <mark>about 37% of an H100 hour</mark>. That doesn't mean your job costs 37% as much, because a Trainium2 chip and an H100 do different amounts of work. AWS's own claim on the [Trn2 page](https://aws.amazon.com/ec2/instance-types/trn2/) is narrower: Trn2 instances offer "30-40% better price performance than GPU-based EC2 P5e and P5en instances." A trn2.48xlarge carries 16 Trainium2 chips, 1.5 TB of HBM and up to 20.8 FP8 petaflops.

The one customer number from the launch is from Deepgram, the speech recognition company:

> "In the benchmarks we evaluated, Trainium processes about 60% more input audio seconds per dollar than our existing GPU baselines, which helps us bring better models to customers at lower prices."
>
> -- Adam Sypniewski, CTO of Deepgram, on the [PyTorch blog](https://pytorch.org/blog/introducing-torchneuron-native-pytorch-backend-for-aws-trainium/)

Note the setup behind that number: Deepgram ported its model over a multi-month engagement with the AWS Generative AI Innovation Center. That's a real result, but it's a supported migration, not a weekend switch. For comparison shopping across GPU clouds, my breakdowns of [CoreWeave pricing](https://www.eesel.ai/blog/coreweave-pricing) and [Lambda pricing](https://www.eesel.ai/blog/lambda-pricing) cover the other side of the table, and the [AWS pricing guide](https://www.eesel.ai/blog/aws-pricing) covers the rest of the bill.

## Benchmarks and test coverage

AWS didn't publish a model-speed leaderboard with the launch. What it did publish is coverage testing, which I think is the more useful number for a beta. Per the [launch post](https://pytorch.org/blog/introducing-torchneuron-native-pytorch-backend-for-aws-trainium/), AWS continuously runs about 100,000 Hugging Face models, picked to cover 99.9% of real-world usage by download count, in a reduced configuration on Trainium. Each run checks whether the model loads, whether forward and backward passes run, and whether it compiles.

![Hugging Face 100k model suite results from September 2026: in eager mode 96,618 of 101,076 models passed (95.6%), and under torch.compile 95,097 of 98,420 passed (96.6%), as taken from the PyTorch blog](https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/torchneuron/images/torchneuron-hf-100k-model-suite-20261020.png)

The September 2026 results: <mark>95.6% pass in eager mode and 96.6% under torch.compile</mark>, with 4,458 and 3,323 failures respectively. That's a strong beta number, and it's the right kind of test. At eesel, I learned the same lesson from the other direction: a support agent that looks great in a demo can still give confident wrong answers on live tickets, which is why we simulate every rollout against a customer's historical tickets before it goes live. A sweep across 100,000 real models is AWS doing the equivalent for a compiler.

The upstream PyTorch test suite tells you where the gaps are. The August 2026 run produced about 154,000 test outcomes, of which about 69,000 were skipped. Roughly 30,000 were skipped by PyTorch's own eligibility checks (CUDA-only and CPU-only tests). The other ~39,000 were deliberate Neuron skips, the largest group being ~22,000 tests for operators that don't yet have a native Neuron lowering.

On hardware, the [Trn3 page](https://aws.amazon.com/ec2/instance-types/trn3/) claims Trn3 UltraServers deliver up to 4.4x the performance and 4x the performance per watt of Trn2 UltraServers, with up to 362 MXFP8 petaflops across 144 chips. Those are AWS's numbers for the chip, not TorchNeuron results, and I haven't seen independent benchmarks of either yet.

## What TorchNeuron doesn't do yet

This is a first release, and AWS is unusually direct about what it left out. From the [launch post](https://pytorch.org/blog/introducing-torchneuron-native-pytorch-backend-for-aws-trainium/) and the [README](https://github.com/aws-neuron/torch-neuronx):

- **Older chips.** Only Trn2 and Trn3 are supported. Trainium1, at $0.596 per chip-hour the cheapest accelerator in the table above, and Inferentia stay on the XLA-based torch-neuronx line (versions before 2.14).
- **Dynamic shapes.** `torch.compile` needs static shapes. Variable-length inputs mean padding or bucketing, and every new shape recompiles.
- **Precision.** float64 runs as float32, which can change results that need 64-bit precision. int64 support depends on the operation.
- **Features skipped on purpose.** Sparse tensors, NestedTensor, forward-mode autograd, arbitrary attention masks in native multi-head attention (no-mask and causal work), per-channel quantization and bilinear/bicubic upsampling aren't in this release.
- **FP8 and TorchAO.** These are in private beta, with general availability planned for the next release. FlexAttention support is limited.
- **First-run compile time.** The first call of an operation or compiled graph includes compilation, which "can be significant for a large model," per the README.

The community reaction so far is mostly cautious optimism from people who've done this kind of port before. Replying to Jassy, one engineer put it this way:

> "Big if this works flawlessly. I have been on the other end, it's not been pretty."
>
> -- [sunil mallya, X](https://x.com/sunilmallya/status/2112261519778140568)

Another reply under AWS CEO [Matt Garman's post](https://x.com/mattsgarman/status/2112287318468182113) named the longer-term test: whether AWS keeps upstreaming its changes into PyTorch itself.

> "Open sourcing is the easy half, upstreaming is the harder promise."
>
> -- [Aapakari, X](https://x.com/aapakari/status/2112318730072191450)

AWS has started on that: the launch post lists 26 pull requests to PyTorch and TorchTitan, raised to improve test quality and remove hard-coded CUDA assumptions.

Before you book a Capacity Block, it's worth running your codebase against that list. Tick anything that applies:

<div class="widget-torchneuron-ready">
<style>
.widget-torchneuron-ready{background:#fff;color:#474739;border:1px solid #e3e3dc;border-radius:16px;padding:20px 22px;margin:24px 0;font-size:15px;line-height:1.5;counter-reset:tnblock}
.widget-torchneuron-ready .tn-title{font-weight:700;color:#333843;font-size:17px;margin:0 0 4px}
.widget-torchneuron-ready .tn-sub{margin:0 0 14px;font-size:14px}
.widget-torchneuron-ready .tn-item{border-top:1px solid #eeeee8;padding:10px 0}
.widget-torchneuron-ready .tn-item input{position:absolute;opacity:0;pointer-events:none}
.widget-torchneuron-ready .tn-item label{display:flex;gap:10px;align-items:flex-start;cursor:pointer;font-weight:600}
.widget-torchneuron-ready .tn-box{flex:0 0 18px;height:18px;border:2px solid #333843;border-radius:4px;margin-top:2px;background:#fff}
.widget-torchneuron-ready .tn-item input:checked + label .tn-box{background:#333843;box-shadow:inset 0 0 0 3px #fff}
.widget-torchneuron-ready .tn-item input:checked{counter-increment:tnblock}
.widget-torchneuron-ready .tn-fix{display:none;margin:6px 0 0 28px;font-size:14px;background:#f1f2f5;border-left:3px solid #333843;padding:8px 10px;border-radius:6px}
.widget-torchneuron-ready .tn-item input:checked + label + .tn-fix{display:block}
.widget-torchneuron-ready .tn-result{margin-top:14px;padding:12px 14px;border-radius:10px;background:#333843;color:#fff;font-weight:600}
.widget-torchneuron-ready .tn-result::before{content:"Blockers ticked: " counter(tnblock) ". "}
.widget-torchneuron-ready .tn-go{display:inline}
.widget-torchneuron-ready .tn-work{display:none}
.widget-torchneuron-ready:has(input:checked) .tn-go{display:none}
.widget-torchneuron-ready:has(input:checked) .tn-work{display:inline}
</style>
<p class="tn-title">Is your PyTorch code TorchNeuron-ready?</p>
<p class="tn-sub">Tick each thing your workload depends on. Each one shows what to do about it, based on the AWS docs and README.</p>
<div class="tn-item"><input type="checkbox" id="tnr1"><label for="tnr1"><span class="tn-box"></span>I need to run on Trainium1 or Inferentia</label><div class="tn-fix">TorchNeuron supports Trn2 and Trn3 only. Stay on the XLA-based torch-neuronx (before 2.14) for these chips, or plan a move to Trn2.</div></div>
<div class="tn-item"><input type="checkbox" id="tnr2"><label for="tnr2"><span class="tn-box"></span>My inputs change shape from batch to batch</label><div class="tn-fix">Fine in eager mode. For torch.compile, pad or bucket inputs to a few fixed shapes, since each new shape recompiles.</div></div>
<div class="tn-item"><input type="checkbox" id="tnr3"><label for="tnr3"><span class="tn-box"></span>I rely on float64 math</label><div class="tn-fix">float64 runs as float32 on Neuron. Check whether your results drift before trusting them.</div></div>
<div class="tn-item"><input type="checkbox" id="tnr4"><label for="tnr4"><span class="tn-box"></span>I use sparse tensors, NestedTensor or forward-mode autograd</label><div class="tn-fix">Not supported in the first release. These need a code change or a wait for a later release.</div></div>
<div class="tn-item"><input type="checkbox" id="tnr5"><label for="tnr5"><span class="tn-box"></span>I depend on FP8 or TorchAO quantization</label><div class="tn-fix">Private beta today, with general availability planned for the next release.</div></div>
<div class="tn-item"><input type="checkbox" id="tnr6"><label for="tnr6"><span class="tn-box"></span>I use custom CUDA or Triton kernels</label><div class="tn-fix">These don't carry over. Rewrite hot paths as NKI kernels, or check NKI-lib for a tuned version first.</div></div>
<div class="tn-item"><input type="checkbox" id="tnr7"><label for="tnr7"><span class="tn-box"></span>I use CUDA graphs or max-autotune compile modes</label><div class="tn-fix">Remove them. TorchNeuron accepts only mode="default", and CUDA graph tests are skipped as CUDA-specific.</div></div>
<div class="tn-result"><span class="tn-go">Nothing ticked: try eager mode on a trn2 instance today, then move hot paths to torch.compile.</span><span class="tn-work">Plan this work before you reserve capacity, and start with eager mode to find CPU fallbacks.</span></div>
</div>

*Tick what your workload uses to see the fix for each blocker, drawn from the TorchNeuron docs and README.*

## How TorchNeuron compares to other ways to run models

TorchNeuron's real rival is the GPU. The choice for a team training or serving its own models looks like this:

| Option | What you manage | Code changes | Best for |
| --- | --- | --- | --- |
| TorchNeuron on Trainium | Instances, compile cache, shapes | Device name, static shapes for compile | AWS-committed teams with steady, large jobs |
| NVIDIA GPUs on AWS (P5, P5e, P5en) | Instances | None for CUDA code | Code with custom CUDA kernels, fastest start |
| GPU clouds ([CoreWeave](https://www.eesel.ai/blog/coreweave), Lambda) | Instances or clusters | None for CUDA code | GPU capacity outside the big clouds |
| Serverless GPUs ([Modal](https://www.eesel.ai/blog/modal-ai), [Baseten](https://www.eesel.ai/blog/baseten)) | Your model code | Small wrappers | Bursty inference without capacity planning |
| Hosted model APIs ([Together AI](https://www.eesel.ai/blog/together-ai), [Groq](https://www.eesel.ai/blog/groq)) | Nothing | API calls only | Open models without touching hardware |

The interesting shift is that the first row used to have "rewrite your training stack" in the code changes column. Now it's closer to the GPU rows, which is the whole point of the launch. AWS lists partners already building on it, including [Anyscale](https://www.eesel.ai/blog/anyscale), Modular and Nota AI, and Hugging Face support means most of the open models covered in my posts on [Kimi K3](https://www.eesel.ai/blog/kimi-k3) or [DeepSeek V4 Flash](https://www.eesel.ai/blog/deepseek-v4-flash) are a `device_map` away from Trainium.

On serving, TorchNeuron feeds the same `torch.compile` backend into vLLM Neuron, a plugin that adds an OpenAI-compatible server, continuous batching and a paged KV cache. If your end goal is a managed agent on AWS rather than your own serving stack, [Bedrock Managed Agents](https://www.eesel.ai/blog/bedrock-managed-agents) sits a layer above all of this.

## Getting started

You need a Trn2 or Trn3 instance and Python 3.12, 3.13 or 3.14. On the Neuron Deep Learning AMI, TorchNeuron is already installed. On another Linux instance, the [README](https://github.com/aws-neuron/torch-neuronx) has you install the Neuron driver and runtime, then pin versions:

```bash
pip install torch==2.14.0 --index-url https://download.pytorch.org/whl/cpu
pip install "torch-neuronx==2.14.*" "neuronx-cc==2.*" "nki>=0.6" --extra-index-url https://pip.repos.neuron.amazonaws.com
python -m torch_neuronx.collect_env
```

Keep the pins: earlier torch-neuronx versions are the XLA-based product with the same package name, which is an easy way to install the wrong thing. The `collect_env` check should report the device as usable from torch.

![The aws-neuron/torch-neuronx repository on GitHub, showing the torch-neuronx 2.33.0 release, Apache 2.0 license and 63 stars on launch day](https://wmeojibgfvjvinftolho.supabase.co/storage/v1/object/public/blog-research/torchneuron/images/torchneuron-github-20261020.png)

The repo had 63 stars and 48 contributors when I captured it on launch day, with examples covering Llama, Whisper, Qwen2, a mixture-of-experts model, GPT-2 training and multi-node runs. For large-scale training, [torchtitan-neuron](https://github.com/aws-neuron/torchtitan-neuron) carries Trainium-tuned TorchTitan recipes. The launch post walks through training Llama 3 8B with SimpleFSDP and `torch.compile` on a single trn2.48xlarge.

My suggested order for a pilot:

1. Run your model in eager mode on a trn2.3xlarge or trn2.48xlarge and read every CPU-fallback warning.
2. Fix shapes, then move the hot path to `torch.compile` with `fullgraph=True`.
3. Share the NEFF cache across instances before you scale out.
4. Compare cost per training step or per token against your current GPUs, not cost per hour.

## Who TorchNeuron is for

TorchNeuron is for teams that train or serve their own PyTorch models, already run on AWS, and spend enough on accelerators that a 30-40% price-performance gap is worth an engineering sprint. Research teams get the most from eager mode, since debugging finally works like it does on any other device. Production teams get the most from the cost side, once shapes and caching are sorted.

It's not for you if your code leans on custom CUDA kernels you can't rewrite yet, if you need Trainium1 or Inferentia, or if you never touch model weights at all. Most companies using AI, including most of the ones I talk to at eesel, are in that last group: they want the AI to do a job, and the chip it runs on is someone else's problem.

## Where eesel fits: this is infrastructure, eesel is the employee

TorchNeuron makes the hardware layer cheaper and easier to switch. That's good news for everyone building models, and over time it pushes down the cost of the AI products built on them. But it doesn't answer a ticket, draft a reply or write a blog post. Those are jobs, and jobs need context: your help center, your past conversations, your rules about refunds.

That's the layer eesel works at. eesel is an [AI teammate](https://www.eesel.ai/blog/best-ai-teammates) platform: you hire ready-to-work teammates for specific jobs, today an [AI helpdesk teammate](https://www.eesel.ai/blog/ai-helpdesk-agent) and an AI blog writer. The helpdesk teammate joins your existing queue, learns from your help center and past tickets, and gets simulated against your historical conversations before it answers a real customer.

[SE Ranking](https://www.eesel.ai/customers/se-ranking) is a good example for a technical audience. It runs one eesel agent per product for SE Ranking, Planable and SE Visible on Zendesk, and between 8 August and 8 September 2026 eesel handled about 4,650 conversations, including about 2,100 live chats. API and Looker Studio questions get routed to a Tier 2 group with the evidence collected first, instead of the bot guessing.

If you're the kind of reader who just installed a PyTorch backend from a pinned pip index, you'll probably prefer setting this up from a terminal too. The [eesel CLI](https://docs.eesel.ai/apis-and-developer-resources/cli) operates the same teammate and workspace as the dashboard, so anything you set up there shows up in the UI and the other way round. `npx @eesel/cli init chat-bubble --site https://your-site.com` creates an agent, adds a website chat bubble and starts reading your site, with no account needed; `eesel login` keeps the workspace afterwards. From there, `eesel chat` talks to the agent, `eesel files upload` adds knowledge, `eesel integrations connect` wires up your helpdesk, `eesel automations` sets what it does on its own, and `eesel approvals` lets you approve held actions.

Every command prints JSON, errors come back as `{error, hint, retryable}`, and `--dry-run` shows the exact server call a write would make. That's what makes it usable by coding agents like [Claude Code](https://www.eesel.ai/blog/claude-code-cli-reference) or [Cursor](https://www.eesel.ai/blog/cursor-reviews): the agent can run the setup and read its own results. Every workspace is also an [MCP server](https://www.eesel.ai/blog/ai-agent-mcp-server), and `eesel mcp token` prints a ready-to-paste config line.

![The eesel activity view listing what the AI teammate has done, including Zendesk conversations, ticket automations and resolved chats](https://cdn-public.eesel.ai/blog/internal-assets/eesel-activity-log-no-customers-20261122-20261122.png)

The same log you see above in the dashboard is what `eesel activity` prints in the terminal, newest first.

## Try eesel

TorchNeuron lets you pick the cheapest chip for your models. eesel lets you skip that decision for support work: a helpdesk teammate that plugs into Zendesk, Freshdesk or Gorgias, trains on your past tickets, and proves itself on historical conversations before it touches a live one. For SaaS teams with API-heavy questions, the [AI helpdesk API](https://www.eesel.ai/blog/ai-helpdesk-api) and the CLI mean you can script the whole setup. [Try eesel](https://www.eesel.ai) free, or start from the terminal with `npx @eesel/cli`.
