nemo-automodel-distributed-training

Configure FSDP2, Megatron FSDP, and DDP parallelism strategies for NeMo AutoModel training.

960|316|Updated May 21, 2025
One-click install
npx skills add https://github.com/NVIDIA-NeMo/Automodel --skill nemo-automodel-distributed-training-nvidia-nemo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nemo-automodel-distributed-training
Source: https://github.com/NVIDIA-NeMo/Automodel/tree/main/skills/nemo-automodel-distributed-training
Command: npx skills add https://github.com/NVIDIA-NeMo/Automodel --skill nemo-automodel-distributed-training-nvidia-nemo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing and configuring the right distributed training strategy in NeMo AutoModel is error-prone: tensor, pipeline, context, and expert parallelism each have sizing constraints, hardware topology rules, and strategy-specific limitations that are easy to get wrong. ## Core Features & Use Cases - Strategy Selection Guidance: Decide between FSDP2, Megatron FSDP, and DDP based on model size, MoE architecture, sequence length, and cluster topology. - YAML Configuration Patterns: Ready-to-adapt distributed section examples covering TP, PP, CP, EP, HSDP, activation checkpointing, and sequence packing. - Constraint and Pitfall Reference: Sizing rules such as dp_size = world_size / (tp_size * pp_size * cp_size), EP divisibility requirements, and MegatronFSDP limitations (no PP, EP, or sequence_parallel). - Use Case: You are training a 70B model across 8 nodes and need tensor plus pipeline parallelism; the skill recommends strategy: fsdp2 with the correct tp_size, pp_size, and pipeline sub-config. ## Quick Start Ask which distributed strategy and YAML settings to use for training your model on a given number of GPUs with tensor, pipeline, context, or expert parallelism.

Frequently Asked Questions about nemo-automodel-distributed-training

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Which distributed strategy should I use in NeMo AutoModel for tensor and pipeline parallelism?

Use strategy fsdp2, which is the recommended default and the only strategy supporting TP plus PP. Set tp_size and pp_size, add a pipeline sub-config with pp_schedule and pp_microbatch_size, and let dp_size be inferred as world_size divided by tp_size times pp_size times cp_size.

How do I configure expert parallelism for MoE models in NeMo AutoModel?

Set strategy fsdp2 with ep_size greater than 1, which creates a separate moe_mesh alongside the main device mesh. Optionally add a moe sub-config mapping to MoEParallelizerConfig. Note that ep_size must evenly divide dp_size times cp_size.

Does megatron_fsdp support pipeline parallelism or sequence_parallel?

No. In NeMo AutoModel, megatron_fsdp does not support pipeline parallelism, expert parallelism, or sequence_parallel, and MeshContext validation raises on those combinations. Use fsdp2 when you need PP, EP, or sequence_parallel; DDP is simple data parallelism only.

What are the requirements for using context parallelism with long sequences?

Context parallelism requires SDPA with Flash Attention or Efficient Attention backend, or Transformer Engine attention; SDPBackend.MATH is incompatible with DTensor. Set cp_size greater than 1, and when combining CP with sequence packing, packed_sequence_size must be divisible by cp_size.

Why does tensor parallelism across nodes hurt training throughput?

TP is communication-intensive and must stay within a single NVLink domain, typically one node of up to 8 GPUs. Running TP across InfiniBand links degrades throughput severely, so use pipeline parallelism or data parallelism for cross-node scaling instead.