nemo-mbridge-perf-moe-vlm-training
NVIDIA/skills
为在 Megatron Bridge 中训练专家混合视觉-语言模型提供了实用指南,并结合近期多模态实验的经验,对比了 FSDP 方法与 3D 并行方法。
...展开全部MoE VLM 训练
稳定版文档:@docs/training/moe-optimization.md 技能卡片:@skills/nemo-mbridge-perf-moe-vlm-training/card.yaml
FSDP 与 3D 并行
| 方法 | 优势 | 最适合 |
|---|---|---|
| FSDP | 实现可运行的多模态运行的最简路径 | 首次启动、内存优先调优、棘手的PP边界 |
| 3D并行 | 调优后性能上限更高 | 具有简洁PP布局且有时间进行更深入扫描的稳定模型 |
对于MoE VLM,实际的工作流程通常是:
- 使用FSDP获得首次可靠运行
- 稳定真实数据输入,重新计算并分析内存行为
- 仅当吞吐量余量足以抵消额外工作量时,才转为3D并行计算
近期VLM运行的综合发现
Qwen3-VL 类模型
在整个追踪器中,主要模式保持一致:
- 在GB200级系统上,FSDP已能达到10%多的高利用率 且配置相对简单
- B200 上的 FSDP 运行可行,但对重计算选择和冻结的 视觉设置更为敏感
- 3D并行模式可恢复至相似或更优的运行状态,但必须 同时对MBS、重计算及实际视觉路径进行联合调优
真实数据与模拟数据
基于模拟数据的 VLM 运行结果并非可靠的性能指标。在实验中, 与真实多模态输入相比,无图像的模拟运行结果更接近“速度大约快一倍”,而非“略显 乐观”。
在对VLM吞吐量得出任何结论前, 请使用真实或逼真的图像有效载荷。
规模较小的多模态MoE实验
规模较小的 Qwen3.5 风格多模态实验再次印证了相同的结论:
- HybridEP 是 GB200 上可靠的默认设置
- 一旦训练循环稳定,采用 TE 范围的 CUDA 图会有所帮助
- 更大的MBS可能带来回报,但前提是视觉编码器不会成为 下一个瓶颈
决策指南
在以下情况下选择 FSDP:
- 首次启动新的VLM时
- 模型在嵌入层、视觉层和解码器层之间存在棘手的阶段边界时
- 内存适配比绝对吞吐量更重要
- 在以解码器为重点的调优过程中,您可能需要冻结视觉堆栈
在以下情况下选择 3D 并行
- 当模型在FSDP下已稳定时
- PP布局清晰且可重复
- 可以同时扫描 MBS、重新计算并调整 CUDA 图范围
- 目标是最佳稳态吞吐量,而非最简单的调试过程
关键调优参数
在适当情况下冻结视觉堆栈:如果工作重点在于解码器, 冻结视觉侧通常能带来微小但切实的吞吐量提升,并 减轻内存压力。
积极扫描 MBS:与纯文本 MoE 运行相比,VLMs 对 MBS 更为敏感, 因为视觉路径会改变计算与开销之间的平衡。
模型拟合完成后优先采用选择性重计算:全量重计算虽是 有用的调试工具,但选择性重计算通常能实现更优的 稳态性能。
将 CUDA 图的范围与工作负载相匹配:
attn moe_router moe_preprocess是更稳妥的 MoE 默认设置,而更窄的范围对于 受控实验仍可能有用。仅在 EP 不足时才使用 ETP:它虽能解锁布局,但 也会引入更多通信开销和调优空间。
代表性配置族
FSDP优先的GB200路径
TP=1 CP=1 PP=1
EP 尺寸根据专家拓扑调整,通常较大
调度器:在 GB200 级系统上采用混合 EP
重计算:从全重计算开始,随后逐步过渡到选择性重计算
3D并行 GB200 路径
TP=1 CP=1 PP=1 或适度 PP
EP 和 ETP 规模根据专家拓扑确定
调度器:HybridEP
CUDA 图:从窄范围开始,仅在真实数据路径稳定后才扩展
兼容性
| 特性 | FSDP | 3D并行 |
|---|---|---|
| GB200上的混合EP | 强默认 | 拓扑稳定后的强默认值 |
| CUDA图 | 在系统调试完成后有用 | 很有用,但对作用域更敏感 |
| 画面冻结 | 自然契合 | 可行,但较少作为主要性能优化路径 |
| 选择性重新计算 | 推荐 | 建议 |
注意事项
模拟的多模态数据会产生误导:它可能会使解码器看起来比 真实的端到端VLM路径要“健康”得多。
视觉编码器可能会出乎意料地占据主导地位:在将所有问题归咎于调度器之前,请分别对编码器、投影器和 解码器进行性能分析。
不要比较有效工作量不同的 FSDP 和 3D-parallel 运行结果: 应根据有效令牌和工作负载形状进行归一化,而不仅仅是根据步骤时间。
ETP并非免费:将其作为拟合或拓扑工具使用,而非默认选项。
重新计算和 CUDA 图的选择是耦合的:使 模型拟合成功的设置,往往并非能提供最佳稳态速度的设置。
---
name: nemo-mbridge-perf-moe-vlm-training
description: Provides practical guidance for training Mixture-of-Experts Vision-Language Models in Megatron Bridge, comparing FSDP and 3D-parallel approaches with lessons from recent multimodal experiments.
license: Apache-2.0
---
# MoE VLM Training
Stable docs: @docs/training/moe-optimization.md
Card: @skills/nemo-mbridge-perf-moe-vlm-training/card.yaml
## FSDP vs 3D Parallel
| Approach | Strength | Best fit |
|---|---|---|
| FSDP | Simplest path to a working multimodal run | first bring-up, memory-first tuning, awkward PP boundaries |
| 3D parallel | Higher ceiling after tuning | stable models with a clean PP layout and time for deeper sweeps |
For MoE VLMs, the practical workflow is usually:
1. get the first reliable run with FSDP
2. stabilize real-data input, recompute, and memory behavior
3. move to 3D parallel only if the throughput headroom is worth the extra work
## Rounded Findings From Recent VLM Runs
### Qwen3-VL class models
The main patterns were consistent across the tracker:
- FSDP on GB200-class systems can already reach healthy high-teens utilization
with a comparatively simple setup
- B200 FSDP runs are viable, but more sensitive to recompute choice and frozen
vision settings
- 3D parallel can recover to a similar or better operating point, but only after
tuning MBS, recompute, and the real vision path together
### Real data vs mock data
Mock-data VLM runs are not trustworthy performance proxies. In the experiments,
image-free mock runs looked closer to "roughly twice as fast" than "slightly
optimistic" when compared with real multimodal input.
Use real or realistic image payloads before drawing any conclusion about VLM
throughput.
### Smaller multimodal MoE runs
The smaller Qwen3.5-style multimodal experiments reinforce the same lessons:
- HybridEP is a solid default on GB200
- TE-scoped CUDA graphs help once the training loop is stable
- larger MBS can pay off, but only if the vision encoder does not become the
next bottleneck
## Decision Guide
### Choose FSDP when
- you are bringing up a new VLM for the first time
- the model has awkward stage boundaries across embedding, vision, and decoder
- memory fit matters more than absolute throughput
- you may freeze the vision stack during decoder-focused tuning
### Choose 3D parallel when
- the model is already stable under FSDP
- the PP layout is clear and repeatable
- you can sweep MBS, recompute, and CUDA-graph scope together
- the goal is best steady-state throughput, not easiest bring-up
## Key Tuning Knobs
1. **Freeze the vision stack when appropriate**: if the work is decoder-focused,
freezing the vision side often gives a small but real throughput gain and
reduces memory pressure.
2. **Sweep MBS aggressively**: VLMs are more MBS-sensitive than text-only MoE
runs because the vision path changes the compute-to-overhead balance.
3. **Prefer selective recompute once the model fits**: full recompute is a
useful bring-up tool, but selective recompute is usually the better steady
state.
4. **Match CUDA-graph scope to the workload**: `attn moe_router moe_preprocess`
is the safer MoE default, while narrower scopes can still be useful for
controlled experiments.
5. **Use ETP only when EP alone is insufficient**: it can unlock a layout, but
it also introduces more communication and more tuning surface.
## Representative Config Families
### FSDP-first GB200 path
```text
TP=1 CP=1 PP=1
EP sized to the expert topology, often large
Dispatcher: HybridEP on GB200-class systems
Recompute: start with full, then relax toward selective recompute
```
### 3D-parallel GB200 path
```text
TP=1 CP=1 PP=1 or modest PP
EP and ETP sized to the expert topology
Dispatcher: HybridEP
CUDA Graph: start narrow, then widen only after the real-data path is stable
```
## Compatibility
| Feature | FSDP | 3D parallel |
|---|---|---|
| HybridEP on GB200 | strong default | strong default once topology is stable |
| CUDA graphs | useful after bring-up | useful, but more scope-sensitive |
| Freeze vision | natural fit | possible, but less often used as the headline perf path |
| Selective recompute | recommended | recommended |
## Pitfalls
1. **Mock multimodal data is misleading**: it can make the decoder look much
healthier than the real end-to-end VLM path.
2. **The vision encoder can dominate unexpectedly**: profile encoder, projector,
and decoder separately before attributing everything to the dispatcher.
3. **Do not compare FSDP and 3D-parallel runs with different effective work**:
normalize by useful tokens and workload shape, not only by step time.
4. **ETP is not free**: use it as a fit or topology tool, not as the default.
5. **Recompute and CUDA-graph choices are coupled**: the setting that gets the
model to fit is often not the setting that gives the best steady-state speed.





首页
