Can a team train an open language model on Amazon’s own AI chips without rewriting its training code? AWS Trainium Qwen3 training is meant to answer that. A recent AWS Machine Learning blog post walks through training Qwen3 on a single trn2.48xlarge machine using torchtitan, an open-source PyTorch training framework, in three different ways.
Trainium is Amazon’s line of chips built for training AI models. The post describes the trn2.48xlarge as a single instance with 16 Trainium2 accelerators and 128 physical NeuronCores, which appear as 64 logical NeuronCores in the configuration AWS uses. Qwen3 is an open model family, and the walkthrough uses a 4-billion-parameter instruct variant as its example.
What does torchtitan on Trainium actually do?
torchtitan is a framework for training large models with PyTorch, the programming library most AI training code is built on. AWS explains that using it on Trainium means using it the way people already do. The reason is a plugin called TorchNeuron, which registers Trainium as a native PyTorch device named neuron, so torchtitan reaches the chips through standard PyTorch interfaces.
AWS says the same configurations can serve two jobs: pre-training from random initialization, or fine-tuning published weights. Teams can also customize the model implementation and the low-level kernels, the small programs that do the heavy math on the chip.
The Hugging Face team describes TorchNeuron as a new native backend for PyTorch on Trainium. According to Hugging Face, it supports eager mode (operations run immediately instead of being queued), torch.compile, and PyTorch’s built-in distributed training tools such as FSDP, which splits model state across chips. Hugging Face also says TorchNeuron enters public beta on October 20, 2026, installable with pip install torch-neuronx. That beta label matters when weighing it for production work.
What are the three training methods?
AWS lays out three configurations, all launched with the same torchrun command pattern and the same config structure. Each one changes a single layer of the stack.
- Hugging Face Transformers v5 as the model backend. torchtitan loads Qwen3 from the Hugging Face Hub through the standard AutoModelForCausalLM class, and reads and writes the published safetensors weight files directly.
- torchtitan’s native Qwen3. Instead of the Hub implementation, the config switches to torchtitan’s own Qwen3 code by changing a single setting, config.model_spec.
- Native Qwen3 plus NKI mixture-of-experts kernels. This adds kernels written with the Neuron Kernel Interface (NKI), AWS’s way of writing custom chip-level code, taken from the torchtitan-neuron recipes. It then uses torchtitan’s override registry to attach a team’s own kernel.
Mixture-of-experts (MoE) is a model design in which each input is routed to a small subset of specialist sub-networks. That is why kernels tuned for it get their own method.
What does the setup require?
AWS lists a single trn2.48xlarge running either the AWS Deep Learning AMI for Neuron or a Neuron PyTorch training container. Both include the Neuron driver, runtime, and compiler. The walkthrough then installs the torchtitan-neuron repository and downloads the Qwen3 weights from the Hugging Face Hub into a local folder.
AWS pins specific versions for the walkthrough: torch 2.14.0, torch_neuronx 2.14.3, transformers 5.16.0, and the release-2.33 branch of torchtitan-neuron. The post warns that the Transformers v5 integration and the Trainium-specific override modules can change between torchtitan releases, so reproducing the examples depends on matching those versions.
How does this compare with the older route?
Hugging Face explains that its earlier Trainium experience came through a library called Optimum Neuron, which relied on PyTorch XLA. That approach meant thinking like a compiler: lazy tensors, static shapes only, and a recompilation for every graph break. Optimum Neuron maintained its own custom modeling classes and trainers to hide that complexity.
Hugging Face says TorchNeuron changes this, making Trainium a device like any other for Transformers, Diffusers, Accelerate, PEFT and TRL. It now recommends that Neuron users use these libraries directly instead of Optimum Neuron. For text generation, Hugging Face reports that 89% of the top 100 most-used text-generation architectures run out of the box with TorchNeuron, compared with 46% under Optimum Neuron v0.4.5. That figure covers inference, not the training workflow AWS describes.
Within AWS’s own post, the three methods form a ladder. The Transformers route is closest to what many people already do on other hardware. The native Qwen3 route trades Hub convenience for torchtitan’s own implementation. The NKI route goes deepest, giving control over how specific operations run on the chip.
What would a realistic workflow look like?
Consider a small team that wants to fine-tune Qwen3-4B-Instruct on its own data. Following AWS’s outline, they would start a trn2.48xlarge with the Neuron deep learning image, confirm whether torchtitan-neuron is already installed, and download the model files from the Hub. They would then create a Python config file in the repository root, starting from the Transformers v5 base config, and launch it with torchrun.
If they later want to test torchtitan’s own Qwen3 code, AWS says the change is a single setting. If they move to a mixture-of-experts model and want faster expert routing, they would add the NKI kernels from the recipes and register their own override. The launch pattern stays the same throughout, which is the main point of AWS’s design.
In practice, the walkthrough covers one instance and one small model, so it shows how the pieces fit rather than how training behaves at larger scale. AWS’s excerpt does not include throughput, cost, or convergence numbers, and TorchNeuron’s public beta status means documentation and package versions should be rechecked before relying on the setup. The pinned versions also signal that results may differ on newer releases.
Who is this relevant to?
The material targets people who already run PyTorch training jobs and want an AWS-hosted alternative to GPU instances, as well as teams that publish models on the Hugging Face Hub and want to train them on Trainium. It requires comfort with launching jobs on a cloud machine and editing Python configs, so it is closer to an engineering guide than a no-code tool.
The open question is how the beta TorchNeuron stack performs once users move beyond a single instance and a small model, since neither the AWS walkthrough nor the Hugging Face announcement, as excerpted, addresses larger-scale training.