AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
Hugging Face Blog·2026年6月25日 01:00·約16分で読める

NVIDIA NeMo AutoModel を用いたトランスフォーマーファインチューニングの加速化

#LLM#ファインチューニング#NVIDIA NeMo#Hugging Face#トランスフォーマー
TL;DR

Hugging Face は NVIDIA の NeMo AutoModel を活用することで、トランスフォーマーモデルのファインチューニング処理を大幅に高速化する手法を発表した。

AI深層分析2026年6月25日 01:03
4
重要/ 5段階
深度40%
4
関連度30%
5
実用性20%
5
革新性10%
3

キーポイント

1

NeMo AutoModel の統合による高速化

Hugging Face が NVIDIA の NeMo AutoModel と連携し、トランスフォーマーモデルのファインチューニング処理を劇的に短縮する手法を発表した。

2

開発効率の向上とコスト削減

複雑な設定や最適化の手間を自動化することで、研究者やエンジニアがモデルの実装に集中できる環境を提供し、リソースコストも削減する。

3

大規模モデルへの対応力強化

従来の手法では困難だった大規模なトランスフォーマーモデルのファインチューニングを、より安定かつ迅速に実行可能にする技術的基盤を整備した。

影響分析・編集コメントを表示

影響分析

この連携は、AI モデルの開発サイクルを加速し、企業や研究機関が独自の大規模言語モデルを迅速にカスタマイズする障壁を下げる画期的な進展です。特に、計算リソースの最適化と開発プロセスの自動化が進むことで、LLM の実装民主化(Democratization)がさらに進むことが期待されます。

編集コメント

Hugging Face と NVIDIA の強力な連携により、LLM ファインチューニングのハードルが大幅に下がることは業界全体にとって歓迎すべき朗報です。開発者がより迅速に実証実験から本番導入へ移行できる環境が整いつつあります。

記事一覧に戻る

HuggingFace Transformers はオープンソース AI エコシステムの基盤となり、最近の Transformers v5 リリースでは、現在 フロンティアモデル の主流である Expert モデル(Mixture-of-Experts: MoE)に対するファーストクラスのサポートが強化されました。v5 では、MoE を拡張可能で構築しやすいものにするための基盤として、エキスパートバックエンド、動的ウェイトローディング、分散実行が提供されています。

NVIDIA NeMo AutoModel は、大規模なカスタム生成 AI モデルを構築するための NVIDIA NeMo フレームワーク の一部であるオープンソースライブラリです。NeMo AutoModel は v5 をクリーンに上乗せし、エキスパート並列処理(Expert Parallelism)、DeepEP 統合型オールツーオールディスパッチ、および TransformerEngine カーネルを追加します。また、v5 の動的ウェイトローディングを活用して、これらの最適化を広がり続ける多数のモデルファミリーに提供します。その結果、同じ from_pretrained() API を使用しながらも、ネイティブな Transformers v5 と比較して MoE モデルのファインチューニングにおいてトレーニングスループットが 3.4〜3.7 倍向上し、GPU メモリ使用量が 29〜32% 削減されます。これは単なるインポート行の追加であり、他のコード変更は一切不要です。

本ブログでは、この組み合わせがどのように機能するか、そしてユーザーが API を変更せずに MoE モデルをより高速にファインチューニングする方法について詳しく解説します。

背景

MoE モデルの台頭は、効率的なトレーニングに新たな課題をもたらしました:数百のエキスパート間でルーティングされたトークン、エキスパート行列積算の単一カーネルへの統合、GPU 間での重みのシャード化、および通信と計算のオーバーラップは、汎用ライブラリが標準で提供するものを超えたインフラストラクチャを必要とします。

Transformers v5(「v5」)は、expert backends、dynamic weight loading、および分散実行用のテンソル並列計画など、ファーストクラスの MoE サポートを導入しました。さらに、v5 では PyTorch の DeviceMesh を from_pretrained() に直接統合することで、分散トレーニングをファーストクラスとして扱っています。

NeMo AutoModel は v5 をベースに、AutoModelForCausalLM をサブクラス化し、Expert Parallelism (EP)、DeepEP による融合された all-to-all ディスパッチ、および TransformerEngine カーネルを追加しています。DeepEP は v5 がまだ持っていない機能で、通信とエキスパート計算のオーバーラップを実現します。さらに、NeMo AutoModel は v5 の可逆的な重み変換を利用して各モデルを読み込むため、再利用可能なコア演算にエンジニアリングリソースを集中でき、モデルごとのチェックポイント処理に費やす必要がなくなります。また、save_pretrained() により標準的な HF チェックポイントが出力されるため、vLLM や SGLang などのツールでロード可能です。

次のセクションでは、これら 2 つがどのように連携し、16 ノードにわたるフルファインチューニング NVIDIA Nemotron 3 Ultra 550B A55B から、Qwen3-30B-A3B や Nemotron 3 Nano 30B A3B のような単一ノードモデルに至るまで、私たちが測定したパフォーマンスの向上について詳しく解説します。

NeMo AutoModel: 同じ API でより高いパフォーマンス

NeMo AutoModel の目標の一つは、オープンソースコミュニティを支援するために HuggingFace Transformers との API 互換性を維持することです。NeMoAutoModelForCausalLM は AutoModelForCausalLM をサブクラス化しているため、HF モデルで動作するコードはそのまま AutoModel でも動作します。

モデルを読み込む際の両者の違いは以下の通りです。変更されるのはインポート文のみです:

この単一のインポートが多くの役割を果たしています。Qwen3 や NVIDIA Nemotron、GPT-OSS、DeepSeek V3 などの人気のある MoE アーキテクチャでは、NeMo AutoModel は TransformerEngine のアテンション、融合された線形層、カスタムエキスパートカーネルを備えた 手動調整された実装 を提供します。それ以外のアーキテクチャについては、Liger kernel パッチなどの最適化を適用しつつも、バニラの HF にフォールバックします。どちらのパスを選択しても、結果として得られるモデルはスケーリングの準備ができています:device_mesh を渡すだけで、追加のリファクタリングなしにマルチ GPU 学習が可能になります。

NeMo AutoModel が特に輝くのは、MoE モデルをマルチ GPU 学習にスケールさせる点です。Nemotron 3 Nano 30B A3B を 8 枚の GPU にわたる Expert Parallelism(エキスパート並列処理)で学習するには、分散メッシュ設定を追加します。

import os

import torch

import torch.distributed as dist

from nemo_automodel import NeMoAutoModelForCausalLM

from nemo_automodel.recipes._dist_utils import create_distributed_setup_from_config

dist.init_process_group(backend="nccl")

torch.manual_seed(0)

torch.cuda.set_device(int(os.environ.get("LOCAL_RANK", 0)))

dist_setup = create_distributed_setup_from_config(

{

"strategy": "fsdp2",

"ep_size": 8,

},

)

model = NeMoAutoModelForCausalLM.from_pretrained(

"nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16",

dtype=torch.bfloat16,

distributed_setup=dist_setup,

)

dist.destroy_process_group()

これにより、from_pretrained() 呼び出し一つで、FSDP2(Fully Sharded Data Parallel 2)、Expert Parallelism、TransformerEngine カーネル、DeepEP ディスパッチによる高速化、スケーラビリティ向上、メモリ最適化が実現します。

パフォーマンス比較

NeMo AutoModel の評価は二つのシナリオで行いました。一つは、16 ノードにわたって最先端の 550B モデルをフルファインチューニングするケース、もう一つは単一ノードで 30B の MoE モデル 2 つを学習するケースです。550B の結果は、スケールにおいて Expert Parallelism が不可欠である理由を示しており、30B の結果は Transformers v5 に対する GPU ごとの速度向上を定量化したものです。

Nemotron 3 Ultra 550B A55B(フルファインチューニング、マルチノード)

Nemotron 3 Ultra 550B A55B は、Mamba2、LatentMoE、および Multi-Token Prediction (MTP) を搭載したパラメータ数 550B のハイブリッドモデルです。私たちはフルファインチューニングをベンチマークしました。これはすべてのパラメータが更新され、Adam オプティマイザの状態もマテリアライズされるものであり、この規模では16 H100 ノード(128 GPU)にまたがります。

方法論:

パラメータ

値

ハードウェア

16x H100 80GB (128 GPU)

エキスパート並列化

EP=64

ローカルバッチサイズ

2

シーケンス長

4,096

機能

MTP、活性化チェックポイント、融合線形クロスエントロピー

カーネル

DeepEP ディスパッチ + torch_mm エキスパート + TransformerEngine

メトリック

NeMo AutoModel (EP=64)

GPU 当たり TPS/GPU (平均)

815

GPU 当たり TFLOP/s/GPU

~293

ピークメモリ

58.2 GiB

なぜ Transformers v5 の列がないのか。 この規模では Transformers v5 はメモリ不足になるため、報告できる v5 の数値はありません。AutoModel のエキスパート並列化 (Expert Parallelism) は、エキスパートを GPU 間でシャードしてフットプリントを予算内に収め、これによりフルファインチューニングが実行可能になります。以下の 30B の比較でも、v5 が適合する同様の利点が示されています。

シングルノード 30B MoE ベンチマーク

8x H100 80GB GPU を備えたシングルノード上で、3 つのアプローチをベンチマークしました。それは、HF Transformers v4 (ハブコード)、最適化が施された HF Transformers v5、および NeMo AutoModel (EP=8 + カスタムカーネル) です。

方法論:

パラメータ

値

ハードウェア

8x H100 80GB (シングルノード)

シーケンス長

4,096

ローカルバッチサイズ

1

ルーティングゲートに関する注記。 以下の NeMo AutoModel の数値は、バランス型ルーティングゲートを使用しており、トークンがエキスパート間で均一に分散されるように強制しています。これは、MoE が学習する際に目指す*理想的な*動作点を模倣したものです:適切に訓練されたモデルでは、負荷分散損失がエキスパートの利用効率をほぼ均一にするため、バランス型ルーティングは実際のワークロードが収束する定常状態を反映し(ランダムなダミートークンがエキスパート並列処理に注入するノイズである「遅延者」のノイズも除去します)。v4/v5 は、ネイティブルーターを同じダミートークン上で実行しています。したがって、バランス型ゲートは NeMo AutoModel をその目標とする MoE 動作点で測定しており、v4/v5 の列はそれらの出荷時(out-of-the-box)の動作を反映しています。

Qwen3-30B-A3B

Metric

v4

v5 (FA2 + grouped_mm)

NeMo AutoModel (EP=8)

v5 → NeMo AutoModel

TPS/GPU (avg)

deadlock

3,075

11,340

3.69x

Peak Memory

—

68.2 GiB

48.1 GiB

-29%

Avg Forward+Loss

—

582 ms

194 ms

3.00x

Avg Backward

—

758 ms

178 ms

4.26x

v4 がデッドロックする理由: Transformers v4 では、Qwen3 MoE のエキスパートを 128 個の個別 MLP モジュールからなる ModuleList として保存しており、それぞれが個別に FSDP(Fully Sharded Data Parallel)でラップされています。順方向パスは、トークンを受け取ったエキスパートのみを反復するデータ依存ループを使用します。ランクごとに異なるデータがあるため、各ランクが異なるエキスパートをスキップし、FSDP の AllGather/ReduceScatter 集合演算に不一致が生じて、無限の停止(hang)を引き起こします。Transformers v5 では、これをエキスパートを融合した 3D パラメータテンソルとして保存することで修正しました(個別のエキスパートモジュールや個別のエキスパート向け FSDP 集合演算はありません)。

Nemotron 3 Nano 30B A3B

Metric

v4 (hub code)

v5 (FA2 + grouped_mm + Mamba CUDA)

NeMo AutoModel (EP=8)

v5 → NeMo AutoModel

TPS/GPU (avg)

1,807

4,583

15,421

3.36x

Peak Memory

61.9 GiB

62.1 GiB

42.5 GiB

-32%

Avg Forward+Loss

1,024 ms

283 ms

109 ms

2.60x

Avg Backward

1,246 ms

611 ms

157 ms

3.89x

v4 config: trust_remote_code=True (NVIDIA's hub modeling code). The hub code's expert loop is FSDP-safe (iterates all experts regardless of token assignment), so it doesn't deadlock like Qwen3 v4.

Where the speedup comes from

The 3.4-3.7x speedup from NeMo AutoModel over Transformers v5 comes from three sources:

  • Expert Parallelism reduces memory pressure. EP=8 distributes expert weights across GPUs, cutting the per-GPU MoE footprint by 8x. For Qwen3, this drops peak memory from 68.2 GiB to 48.1 GiB (-29%). For Nemotron Nano, it drops from 62.1 GiB to 42.5 GiB (-32%), freeing headroom for larger batch sizes or longer sequences.
  • DeepEP fuses communication with computation. Instead of separate AllGather/ReduceScatter collectives for expert routing, DeepEP fuses token dispatch and combines into optimized GPU kernels, overlapping communication with expert computation.
  • TransformerEngine kernels accelerate core operations. TE's fused attention, linear layers, and RMSNorm implementations provide consistent speedups over their PyTorch/Flash Attention equivalents across all layer types, not just MoE layers.

HuggingFace AutoModel が活用する Transformers v5 の機能

エキスパートバックエンド

Transformers v5 における最も影響力のある機能の一つに、experts_implementation パラメータがあり、これには 3 つのエキスパートバックエンドが含まれています:

Backend

Description

Best for

eager

選択されたエキスパートに対するループ処理

デバッグ、互換性、および正しさ。v4 でも利用可能。

batched_mm

エキスパートパラメータを複製し、torch.bmm を介した単一のバッチ化 GEMM(行列積)を実行

小規模な入力に対して高速で、torch.compile との相性が良い。v5 で追加。

grouped_mm

トークンを割り当てられたエキスパート順にソートし、torch.nn.functional.grouped_mm を介した単一のグループ化 GEMM(行列積)を実行

トレーニング向け(メモリ効率的でパラメータの複製なし)。v5 で追加。

grouped_mm バックエンドが主要なトレーニング最適化です。エキスパートを一つずつループするのではなく、トークンを割り当てられたエキスパート順にソートし、単一の融合されたグループ化行列乗算を実行します。

NeMo AutoModel はこれをさらに発展させます。カスタム実装を持つモデルに対しては、DeepEP による融合されたオール・トゥー・オール(all-to-all)ディスパッチと、grouped GEMM カーネル、および TransformerEngine の線形層を組み合わせて使用します。その進化の過程は以下のようになります:

v4 (eager ループ) → v5 (grouped_mm) → NeMo AutoModel (DeepEP + GMM + TE)

NeMo AutoModel では、エキスパートバックエンドは BackendConfig を通じて設定されます:

from nemo_automodel.components.models.common.utils import BackendConfig

backend = BackendConfig(

attn="te", # TransformerEngine attention

linear="te", # TransformerEngine linear layers

experts="torch_mm", # Grouped expert matmul

dispatcher="deepep", # DeepEP fused all-to-all

)

Expert Parallelism and DeepEP

Transformers v5 also ships an Expert Parallelism path. It shards expert weights across GPUs. The GroupedGemmParallel style loads only each device's local experts, and RouterParallel routes tokens and combines results with an all_reduce. It's neatly built on v5's existing tensor-parallel machinery. Enabling it makes the model's tp_plan return its expert plan, so expert parallelism shares the device budget with data parallelism (ep × dp = world_size). For the single-node 30B benchmarks here, we found plain data-parallel v5 (dp=8, ep=1) to be the fastest v5 configuration, so that's the v5 setup we report.

NeMo AutoModel は、マルチ GPU MoE 学習に最適化された補完的なアプローチを採用しています。これは EP を独自の並列次元として扱い、データ並列メッシュから切り出すのではなく、それに並行して専用の moe_mesh を構築します。これには PyTorch の DTensor と Shard(0) が使用されます。エキスパートメッシュがデータ並列と直交しているため、両者は同じデバイス上で合成されます。8 枚の GPU 環境では NeMo AutoModel は ep=8 と dp=8 を同時に実行し、各 GPU が独自にデータの断片を処理しながら、保持するエキスパートは全体の 1/8 に抑えられます。エキスパート重みは、エキスパート次元に沿って物理的に GPU 間でシャードされます。

From nemo_automodel/components/moe/parallelizer.py

from torch.distributed.tensor import Shard, distribute_tensor

Each GPU holds only 1/ep_size of the expert weights

distribute_tensor(param, device_mesh, [Shard(0)])

8 枚の GPU で ep_size=8 の場合、各 GPU はエキスパートパラメータの 1/8 しか保持しません。Nemotron-3-Nano-30B-A3B のようなモデルでは、約 55 GiB のエキスパート重みを持ちますが、EP を用いることで GPU あたりのエキスパート負荷を約 55 GiB から約 6.8 GiB に削減できます。これにより、FSDP(Fully Sharded Data Parallel)のみを用いたアプローチではメモリ不足で実行不可能な環境でも学習が可能になります。

EP に加え、NeMo AutoModel は DeepEP を統合しており、これはトークンルーティングを最適化された GPU カーネルに融合させ、グループ化された GEMM(行列乗算)と組み合わせることで、グループ化されたエキスパート計算において大幅な速度向上を実現します。私たちの 大規模 MoE ベンチマーク において、DeepEP とグループ化された GEMM を併用することで、全 DeepSeek V3 671B モデルにおける 1 イテレーションあたりのコストを、all-gather(全結合)とループ型エキスパートベースラインと比較して 47% 削減しました。

Dynamic Weight Loading

Transformers v5 では、WeightConverter と WeightRenaming を通じて 動的ウェイト読み込み システムも導入されました。これにより、MoE チェックポイント(重み保存ファイル)を融合された 3D テンソルとして保存し、より効率的な実行を可能にしています。WeightConverter は、from_pretrained() の実行中にチェックポイントテンソルに対して合成可能な操作を適用し、オンザフライで変換を行います。

NeMo AutoModel はこの v5 API を直接利用するコンシューマーです。20 以上のモデルタイプ が、MODELS_REQUIRING_TENSOR_MERGING を通じてこのメカニズムを利用しており、Mixtral、Qwen2 MoE、Qwen3 MoE、DeepSeek V2/V3、OLMoE などを含みます。これらの変換は完全に可逆であり、save_pretrained() によって生成されるのは標準的な HF フォーマットのチェックポイントで、あらゆる下流ツールが読み込むことができます。

Getting Started

NeMo AutoModel をお試しください。まずは公式ドキュメントページにて はじめに をご覧ください。

詳細については、以下の資料をご参照ください:

  • NeMo AutoModel HuggingFace API 互換性ガイド
  • NeMo AutoModel モデル対応状況
  • NeMo AutoModel パフォーマンスサマリー
  • HuggingFace 上の NeMo AutoModel

結論

NVIDIA NeMo AutoModel は、モデルトレーニングのスケールアップを図る HuggingFace ユーザーにとって、自然な次のステップです。Transformers v5 を基盤として直接構築されているため、AutoModel は摩擦のないアップグレードパスを提供します:インポート文を1行変更するだけで、3 倍以上高速なモデルインスタンスが利用可能になります。

Qwen3-30B-A3B および Nemotron 3 Nano 30B-A3B において、これは最適な Transformers v5 設定と比較して、GPU メモリ使用量を 29〜32% 削減しながら、トレーニングスループットを 3.4〜3.7 倍向上させます。そして、真のエキスパート並列化(Expert Parallelism)がエキスパートを GPU にまたいでシャードするため、この同じパスは 16 ノードにわたって 550B モデルである Nemotron 3 Ultra のフルファインチューニングまでスケールアップ可能です。これは、モデルをメモリに収めるためにエキスパート並列化が不可欠となる領域です。NeMo AutoModel チェックポイントは標準的な HF フォーマットの safetensors であるため、vLLM や SGLang などの推論フレームワーク上でデプロイすることができます。

コード、設定ファイル、ベンチマークスクリプトはすべて、NeMo AutoModel リポジトリ で利用可能です。

謝辞

この研究の主要貢献者(姓順にアルファベット列記):Adil Asif, Hemil Desai, Alexandros Koumparoulis, Huiying Li。

原文を表示

Back to Articles

HuggingFace Transformers has become the foundation of the open-source AI ecosystem, and the recent Transformers v5 release strengthened it with first-class support for Mixture-of-Experts (MoE) models, now the dominant architecture for frontier models. v5 ships the MoE foundations: expert backends, dynamic weight loading, and distributed execution that make MoE extensible and easy to build on.

NVIDIA NeMo AutoModel is an open library part of the NVIDIA NeMo framework for building custom generative AI models at scale. NeMo AutoModel builds cleanly on top of v5, adding Expert Parallelism, DeepEP fused all-to-all dispatch, and TransformerEngine kernels, and it leans on v5's dynamic weight loading to bring those optimizations to a broad and growing set of model families. The payoff is 3.4-3.7x higher training throughput and 29-32% less GPU memory on fine-tuning MoE models than native Transformers v5, using the same from_pretrained() API: a single import line, with no other code changes.

This blog details how this combination works and how users can fine-tune MoE models faster without changing their APIs.

Background

The rise of MoE models has introduced new challenges to efficient training: Routing tokens across hundreds of experts, fusing expert matmuls into a single kernel, sharding weights across GPUs, and overlapping communication with computation all require infrastructure beyond what a general-purpose library provides out of the box.

Transformers v5 (“v5”) introduced first-class MoE support such as expert backends, dynamic weight loading, and tensor parallel plans for distributed execution. In addition, v5 made distributed training first-class by integrating PyTorch's DeviceMesh directly into from_pretrained().

NeMo AutoModel builds on top of v5 by subclassing AutoModelForCausalLM, and adding Expert Parallelism (EP), DeepEP fused all-to-all dispatch, and TransformerEngine kernels. DeepEP is the piece v5 doesn't have yet: it overlaps communication with expert compute. And because NeMo AutoModel rides v5's reversible weight conversion to load each model, it can focus its engineering on these reusable core ops instead of per-model checkpoint plumbing, while save_pretrained() still emits standard HF checkpoints that tools like vLLM and SGLang can load.

The next section walks through how the two work together and the performance gains we measured, from full fine-tuning NVIDIA Nemotron 3 Ultra 550B A55B across 16 nodes down to single-node models such as Qwen3-30B-A3B and Nemotron 3 Nano 30B A3B.

NeMo AutoModel: Same API, More Performance

One of NeMo AutoModel's goals is API compatibility with HuggingFace Transformers to enable open-source community. NeMoAutoModelForCausalLM subclasses AutoModelForCausalLM, so any code that works with HF models works with AutoModel too.

Here's what loading a model looks like in both. Only the import changes:

That single import does a lot of work. For popular MoE architectures like Qwen3, NVIDIA Nemotron, GPT-OSS, and DeepSeek V3, NeMo AutoModel ships hand-tuned implementations with TransformerEngine attention, fused linear layers, and custom expert kernels. For everything else, it falls back to vanilla HF while still applying optimizations like Liger kernel patching, among others. And whichever path it takes, the resulting model is ready to scale: pass a device_mesh and you have multi-GPU training without further rewrites.

Where NeMo AutoModel really shines is scaling MoE models to multi-GPU training. To train Nemotron 3 Nano 30B A3B with Expert Parallelism across 8 GPUs, one adds the distributed mesh configuration:

code
import os
import torch
import torch.distributed as dist
from nemo_automodel import NeMoAutoModelForCausalLM
from nemo_automodel.recipes._dist_utils import create_distributed_setup_from_config

dist.init_process_group(backend="nccl")
torch.manual_seed(0)
torch.cuda.set_device(int(os.environ.get("LOCAL_RANK", 0)))

dist_setup = create_distributed_setup_from_config(
    {
        "strategy": "fsdp2",
        "ep_size": 8,
    },
)

model = NeMoAutoModelForCausalLM.from_pretrained(
    "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16",
    dtype=torch.bfloat16,
    distributed_setup=dist_setup,
)

dist.destroy_process_group()

This gives speed, scalability and memory-optimizations with FSDP2, Expert Parallelism, TransformerEngine kernels and DeepEP dispatch, all from a from_pretrained() call.

Performance Comparison

We evaluated NeMo AutoModel in two regimes: full fine-tuning a frontier-scale 550B model across 16 nodes, and training two 30B MoE models on a single node. The 550B result shows why Expert Parallelism is essential at scale; the 30B results quantify the per-GPU speedup over Transformers v5.

Nemotron 3 Ultra 550B A55B (full fine-tune, multi-node)

Nemotron 3 Ultra 550B A55B is a 550B-parameter hybrid model shipping with Mamba2, LatentMoE, and Multi-Token Prediction (MTP). We benchmark a full fine-tune: every parameter is updated and the Adam optimizer state is materialized, which at this scale spans 16 H100 nodes (128 GPUs).

Methodology:

Parameter

Value

Hardware

16x H100 80GB (128 GPUs)

Expert Parallelism

EP=64

Local batch size

2

Sequence length

4,096

Features

MTP, activation checkpointing, fused linear cross-entropy

Kernels

DeepEP dispatch + torch_mm experts + TransformerEngine

Metric

NeMo AutoModel (EP=64)

TPS/GPU (avg)

815

TFLOP/s/GPU

~293

Peak Memory

58.2 GiB

Why there is no Transformers v5 column. Transformers v5 runs out of memory at this scale, so there is no v5 number to report here. AutoModel's Expert Parallelism shards the experts across GPUs to bring the footprint within budget, which is what lets the full fine-tune run. The 30B comparisons below show the same advantage where v5 fits.

Single-node 30B MoE benchmarks

We benchmarked three approaches on a single node with 8x H100 80GB GPUs: HF Transformers v4 (hub code), HF Transformers v5 (with best available optimizations), and NeMo AutoModel (EP=8 + custom kernels).

Methodology:

Parameter

Value

Hardware

8x H100 80GB (single node)

Sequence length

4,096

Local batch size

1

A note on the routing gate. The NeMo AutoModel numbers below use a balanced routing gate, which forces tokens to be distributed uniformly across experts. This emulates the *ideal* operating point an MoE is trained toward: a well-trained model's load-balancing loss drives expert utilization to near-uniform, so balanced routing reflects the steady-state a real workload converges to (and removes the straggler noise that random dummy tokens otherwise inject into expert parallelism). v4/v5 run their native router on the same dummy tokens. The balanced gate therefore measures NeMo AutoModel at its target MoE operating point, and the v4/v5 columns reflect their out-of-the-box behavior.

Qwen3-30B-A3B

Metric

v4

v5 (FA2 + grouped_mm)

NeMo AutoModel (EP=8)

v5 → NeMo AutoModel

TPS/GPU (avg)

deadlock

3,075

11,340

3.69x

Peak Memory

—

68.2 GiB

48.1 GiB

-29%

Avg Forward+Loss

—

582 ms

194 ms

3.00x

Avg Backward

—

758 ms

178 ms

4.26x

Why v4 deadlocks: Transformers v4 stores Qwen3 MoE experts as a ModuleList of 128 individual MLP modules, each separately FSDP-wrapped. The forward pass uses a data-dependent loop that only iterates experts that received tokens. With different data per rank, different ranks skip different experts, causing mismatched FSDP AllGather/ReduceScatter collectives and an indefinite hang. Transformers v5 fixes this by storing experts as fused 3D parameter tensors (no per-expert modules, no per-expert FSDP collectives).

Nemotron 3 Nano 30B A3B

Metric

v4 (hub code)

v5 (FA2 + grouped_mm + Mamba CUDA)

NeMo AutoModel (EP=8)

v5 → NeMo AutoModel

TPS/GPU (avg)

1,807

4,583

15,421

3.36x

Peak Memory

61.9 GiB

62.1 GiB

42.5 GiB

-32%

Avg Forward+Loss

1,024 ms

283 ms

109 ms

2.60x

Avg Backward

1,246 ms

611 ms

157 ms

3.89x

v4 config: trust_remote_code=True (NVIDIA's hub modeling code). The hub code's expert loop is FSDP-safe (iterates all experts regardless of token assignment), so it doesn't deadlock like Qwen3 v4.

Where the speedup comes from

The 3.4-3.7x speedup from NeMo AutoModel over Transformers v5 comes from three sources:

  • Expert Parallelism reduces memory pressure. EP=8 distributes expert weights across GPUs, cutting the per-GPU MoE footprint by 8x. For Qwen3, this drops peak memory from 68.2 GiB to 48.1 GiB (-29%). For Nemotron Nano, it drops from 62.1 GiB to 42.5 GiB (-32%), freeing headroom for larger batch sizes or longer sequences.
  • DeepEP fuses communication with computation. Instead of separate AllGather/ReduceScatter collectives for expert routing, DeepEP fuses token dispatch and combines into optimized GPU kernels, overlapping communication with expert computation.
  • TransformerEngine kernels accelerate core operations. TE's fused attention, linear layers, and RMSNorm implementations provide consistent speedups over their PyTorch/Flash Attention equivalents across all layer types, not just MoE layers.

Transformers v5 Features Leveraged by HuggingFace AutoModel

Expert Backends

One of the most impactful features in Transformers v5 is the experts_implementation parameter, which includes three expert backends:

Backend

Description

Best for

eager

For-loop over selected experts

Debugging, compatibility, and correctness. Also available for v4.

batched_mm

Duplicates expert params, single batched GEMM via torch.bmm

Small inputs, fast with torch.compile. Added for v5

grouped_mm

Orders tokens by expert, single grouped GEMM via torch.nn.functional.grouped_mm

Training (memory efficient, no param duplication). Added for v5.

The grouped_mm backend is the key training optimization: instead of looping over experts one by one, it sorts tokens by their assigned expert and executes a single fused grouped matrix multiplication.

NeMo AutoModel takes this further. For models with custom implementations, it uses DeepEP fused all-to-all dispatch combined with grouped GEMM kernels and TransformerEngine linear layers. The progression looks like:

code
v4 (eager for-loop) → v5 (grouped_mm) → NeMo AutoModel (DeepEP + GMM + TE)

In NeMo AutoModel, the expert backend is configured through BackendConfig:

code
from nemo_automodel.components.models.common.utils import BackendConfig

backend = BackendConfig(
    attn="te",           # TransformerEngine attention
    linear="te",         # TransformerEngine linear layers
    experts="torch_mm",  # Grouped expert matmul
    dispatcher="deepep", # DeepEP fused all-to-all
)

Expert Parallelism and DeepEP

Transformers v5 also ships an Expert Parallelism path. It shards expert weights across GPUs. The GroupedGemmParallel style loads only each device's local experts, and RouterParallel routes tokens and combines results with an all_reduce. It's neatly built on v5's existing tensor-parallel machinery. Enabling it makes the model's tp_plan return its expert plan, so expert parallelism shares the device budget with data parallelism (ep × dp = world_size). For the single-node 30B benchmarks here, we found plain data-parallel v5 (dp=8, ep=1) to be the fastest v5 configuration, so that's the v5 setup we report.

NeMo AutoModel takes a complementary approach tuned for multi-GPU MoE training. It makes EP its own parallelism dimension, a dedicated moe_mesh alongside (rather than carved from) the data-parallel mesh, using PyTorch's DTensor with Shard(0). Because the expert mesh is orthogonal to data parallelism, the two compose on the same devices. On 8 GPUs NeMo AutoModel runs ep=8 and dp=8 together, so every GPU trains on its own data shard while holding only 1/8 of the experts. Expert weights are physically sharded across GPUs along the expert dimension.

code
# From nemo_automodel/components/moe/parallelizer.py
from torch.distributed.tensor import Shard, distribute_tensor

# Each GPU holds only 1/ep_size of the expert weights
distribute_tensor(param, device_mesh, [Shard(0)])

With ep_size=8 on 8 GPUs, each GPU holds only 1/8 of the expert parameters. For a model like Nemotron-3-Nano-30B-A3B with ~55 GiB of expert weights, EP reduces the per-GPU expert footprint from ~55 GiB to ~6.8 GiB, making training possible where FSDP-only approaches run out of memory.

On top of EP, NeMo AutoModel integrates DeepEP that fuses the token routing into optimized GPU kernels, and delivers significant speedups when combined with grouped GEMM for grouped expert computation. In our large-scale MoE benchmarks, DeepEP + grouped GEMM reduced cost per iteration by 47% on the full DeepSeek V3 671B model compared to all-gather + looped expert baselines.

Dynamic Weight Loading

Transformers v5 also introduced a dynamic weight loading system through WeightConverter and WeightRenaming. This enables MoE checkpoint to be stored in fused 3D tensors for more efficient execution. The WeightConverter applies composable operations to transform checkpoint tensors on-the-fly during from_pretrained().

NeMo AutoModel is a direct consumer of this v5 API. Over 20 model types use this mechanism through MODELS_REQUIRING_TENSOR_MERGING, including Mixtral, Qwen2 MoE, Qwen3 MoE, DeepSeek V2/V3, OLMoE, and more. The conversions are fully reversible: save_pretrained() produces standard HF-format checkpoints that any downstream tool can load.

Getting Started

To try NeMo AutoModel, please visit our official documentation page to get started.

For more details, see:

  • NeMo AutoModel HuggingFace API Compatibility Guide
  • NeMo AutoModel Model Coverage
  • NeMo AutoModel Performance Summary
  • NeMo AutoModel on HuggingFace

Conclusion

NVIDIA NeMo AutoModel is the natural next step for HuggingFace users scaling up model training. By building directly on Transformers v5, AutoModel provides a zero-friction upgrade path: change one import line and get a model instance that is more than three times as fast.

On Qwen3-30B-A3B and Nemotron 3 Nano 30B-A3B, this delivers 3.4-3.7x higher training throughput with 29-32% less GPU memory compared to the best Transformers v5 configuration. And because true Expert Parallelism shards experts across GPUs, the same path scales up to full fine-tuning a 550B model like Nemotron 3 Ultra across 16 nodes, the regime where Expert Parallelism becomes essential to fit the model in memory. Because NeMo AutoModel checkpoints are standard HF-format safetensors, you can deploy them on inference frameworks like vLLM and SGLang.

The code, configs, and benchmark scripts are all available in the NeMo AutoModel repository.

Acknowledgements

Core contributors to this work, listed alphabetically by last name: Adil Asif, Hemil Desai, Alexandros Koumparoulis, and Huiying Li.

この記事をシェア

関連記事

The Verge AI★42026年6月24日 23:36

OpenAI、Broadcomと共同開発した初のAI専用プロセッサ「Jalapeño」を発表

OpenAIは Broadcom と共同で開発した AI サーバー用専用チップ「Jalapeño」を公開しました。この ASIC は大規模言語モデルの推論処理に特化しており、同社の次世代モデルを支える基盤となります。

404 Media★32026年6月24日 22:03

ポッドキャスト:AI に自我があるなら『帝国時代 II』にもあるという論文について

Matthew が、大規模言語モデルに自我があると仮定した場合、古典的ゲーム『帝国時代 II』も同様に自我を持つと主張する興味深い論文を紹介した。

404 Media★42026年6月24日 21:50

トークン終末が到来:企業、AI への支出抑制に躍起

コンサルティング大手のアクセンチュアは、非技術職による PDF からスライド作成などの些細なタスクでの AI トークン予算の浪費を防ぐため、業界全体で急激に増加するトークン支出を抑制しようとしている。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む