Back to timeline

Mon, October 1908:00ToolsAPI & pricingChinese modelsOpen sourceAPI & pricing guide

TorchNeuron provides a native PyTorch backend for AWS Trainium

Decision Brief

What changedHugging Face released the TorchNeuron plugin, giving Transformers, Diffusers, and Kernels native AWS Trainium support so users no longer need to go through Optimum Neuron.
Why it mattersIn Transformers, Trainium goes from 46% out-of-the-box support for text-generation architectures under Optimum Neuron to 89%, all through standard device mapping and distributed config, sharply lowering migration cost for existing GPU training scripts.
Who should careAI coding tool users
Affected stackQwenHugging Face
Source confidenceHigh · Official release / blog / repo

TorchNeuron is a native PyTorch backend plugin for AWS Trainium, in public beta since October 20, 2026, installable via pip install torch-neuronx. It supports eager execution, torch.compile, and native distributed interfaces (DTensor, FSDP2), replacing the PyTorch XLA-based Optimum Neuron. Hugging Face recommends Neuron users use Transformers, Diffusers, Accelerate, PEFT, and TRL directly rather than going through Optimum Neuron. For inference, users just pass device_map=neuron and Transformers loads the model onto Neuron devices; 89% of the top 100 text-generation architectures are supported out of the box, versus 46% with Optimum Neuron v0.4.5. In Diffusers, pipelines such as FLUX.1-dev, FLUX.2, and Qwen-Image support tensor parallelism. For training with TRL's SFTTrainer, setting tp_size and fsdp_size in DistributedConfig's model_init_kwargs lets the Trainer shard weights across a TP×FSDP grid, with no --fsdp flag or Accelerate config needed. The example trains on 8 Trainium2 chips (32 NeuronCores) and saves standard Transformers checkpoints that can be uploaded to the Hub and loaded on other hardware. Note: Neuron does not yet support Dynamo automatic dynamic shapes, HF_DEACTIVATE_ASYNC_LOAD=1 must be disabled, and batches are padded to multiples of 128 tokens.

Summary basis: full article readCompiled from the source scope noted above; the original remains authoritative.

Sources

  • Hugging Face:Blog

    Open-source models, datasets, libraries, and practical ML engineering for builders.

  • Hugging Face:Blog

Related intel

留言

登入后即可留言,和其他 builder 交换实测心得。

还没有留言,抢头香。