Does Your Model Run on AWS Trainium? Look It Up

Hugging Face Blog News

Summary

Hugging Face 发布了一个 torch-neuronx 模型支持查询 Space,可查看哪些 Hub 上的模型能在 AWS Trainium 上直接运行,并提供可复现的运行脚本和 NEFF 缓存以跳过编译。目前仅覆盖 text-generation 与 image-text-to-text 类 Transformers 模型,未来将扩展到 diffusers 和 sentence transformers。

No content available
Original Article
View Cached Full Text

Cached at: 10/28/26, 01:30 AM

Does Your Model Run on AWS Trainium? Look It Up

Source: https://huggingface.co/blog/torch-neuronx-model-support In aprevious post, we introduced TorchNeuron, the native PyTorch backend for AWS Trainium (thetorch\-neuronxpackage). With it, Transformers runs its own modeling code on Trainium, as it does on any other device, so any Transformers model on the Hub may run. Which ones actually do?

Thetorch-neuronx model supportSpace answers that question for the most popular models on the Hub. It tells you whether a model runs unmodified on Trainium, and gives you the script to run it yourself.

torch-neuronx model support

https://huggingface.co/blog/torch-neuronx-model-support#look-up-a-modelLook up a model

The Space opens on theSelectedview: our own selection of models picked among the top models on the Hub by downloads and by trending score. Each row gives the result, the number of Trainium cores the model is sharded over, the wall time of the run (compilation included) and the peak device memory.

To look up a given model, switch to theTrendingorDownloadsview and type part of its name. These views follow the Hub’s own rankings, one task at a time, whether a model was tested or not. When a model was left out on purpose, the Space tells you why (most of the time it was not prioritized, sometimes it is truly incompatible). You can also pick the versions of the Neuron compiler (neuronx\-cc) and of Transformers to look at.

At the time of writing, only Transformers models are tested, and our selection is limited totext\-generationandimage\-text\-to\-textmodels. We plan to expand to diffusers, sentence transformers, and other transformers tasks.

https://huggingface.co/blog/torch-neuronx-model-support#run-it-yourselfRun it yourself

Select a model to see how to run it. The Space lists the Neuron stack the model was tested on, the packages to install on top of it, and therun\.pyscript that ran. The script follows the recipe of theTorchNeuron announcement: it loads the model withfrom\_pretrained, sharded when it needs to be, then generates with a static cache andtorch\.compile\(backend="neuron"\).

On a Trainium2 (trn2) instance with that stack, for example in theAWS Neuron Deep Learning Container, install the packages, then run:

python3 run.py

No need fortorchrun: the script launches its owntorch\.distributedranks when the model is sharded.

A first run starts by compiling the model’s graphs. To skip that step, copy the graphs the same compiler built during the test, from the publicNEFF cachebucket. The Space gives you the command, with the right compiler version:

hf buckets sync hf://buckets/aws-neuron/torch-neuronx-neff-cache/neuronxcc-<version> /tmp/neff_cache

https://huggingface.co/blog/torch-neuronx-model-support#what-runs-meansWhat “runs” means

Each test loads the model on atrn2instance, sharded over the smallest number of Trainium cores that can hold its weights. Most models are sharded with tensor parallelism. Mixture-of-experts models without a tensor-parallel plan use expert parallelism only. The test then generates 32 tokens and checks them. On a single core, the tokens are compared with those of a CPU run of the same checkpoint. When the model is sharded, a small judge model checks that the text is fluent English.

At the time of writing, only models that fit on 4 Trainium2 devices are tested, which means 16 cores at most. APASSsays nothing about throughput, or about longer generations.

https://huggingface.co/blog/torch-neuronx-model-support#the-results-are-a-datasetThe results are a dataset

Everything the Space shows comes from the publicaws\-neuron/torch\-neuronx\-model\-supportdataset, with one Parquet file per pair ofneuronx\-ccand library versions.

Each row holds a model’s result, the error when it failed, the versions of the whole stack and therun\.pythat ran. You can query it directly:

import pandas as pd

df = pd.read_parquet("hf://datasets/aws-neuron/torch-neuronx-model-support/data")
df[df.model_id == "Qwen/Qwen3-0.6B"][["neuronx_cc", "library", "library_version", "neuron_cores", "result"]]

Thedataset cardgives the exact meaning of each result.

Next time you wonder whether a model runs on Trainium,look it up.

Similar Articles

huggingface/transformers

GitHub Trending (daily)

The Hugging Face Transformers repository, an open-source library providing thousands of pretrained transformer models for natural language processing tasks, with support for PyTorch, TensorFlow, and JAX.

@nini_incrypto_: Hugging Face automates entire AI training pipeline! Recently, a project called ml-intern has gone viral on GitHub. It's like a 24/7 algorithmic intern that can independently perform post-training of large models. 1. Autonomous research: It will…

X AI KOLs Timeline

The ml-intern project from Hugging Face has gone viral on GitHub, enabling full automation of the entire workflow including paper research, data processing, training script writing, and model training, without human intervention. It significantly improves the performance of small models (such as Qwen3-1.7B), even surpassing Claude Code.