nemo-mbridge-perf-megatron-fsdp
Operational guide for enabling Megatron FSDP in Megatron-Bridge, including config knobs, code anchors, pitfalls, and verification.
Security Assessment
About nemo-mbridge-perf-megatron-fsdp
nemo-mbridge-perf-megatron-fsdp is an operational reference skill from NVIDIA that documents how to enable Megatron FSDP (Fully Sharded Data Parallel) inside Megatron-Bridge. It addresses a concrete engineering problem: developers moving from DDP to FSDP-based data parallelism, or tracing an out-of-memory error or throughput regression back to an FSDP configuration change, need to know exactly which config knobs to set and which pitfalls to avoid. The skill provides the minimal config overrides (use_megatron_fsdp, data_parallel_sharding_strategy, average_in_collective, and the required fsdp_dtensor checkpoint format) plus an example recipe fixup.
Beyond enablement snippets, it supplies code anchors pointing at the relevant Bridge source lines for config definitions, validation assertions, runtime wrapper selection, and the performance-harness overrides, so an agent can verify guidance against the actual codebase. A pitfalls section covers common mistakes such as recipes defaulting to torch_dist checkpoint format, the mutual exclusivity of Megatron FSDP and FSDP2, CPU-offload constraints, and CUDA_DEVICE_MAX_CONNECTIONS differences on Hopper. A verification section gives an exact 2-GPU pytest smoke-test command and explicit success criteria (1 passed, finite loss, no checkpoint-format assertion).
It is aimed at ML infrastructure and performance engineers working with Megatron-Bridge large-model training. The skill is pure documentation plus code/command references; its outputs are configuration instructions and shell/pytest commands, and NVSkills-Eval reported a 100% Security score for it. There are no destructive operations, credential handling, or network exfiltration involved.
FAQ
When should I use this skill?
When enabling FSDP-based data parallelism instead of DDP in Megatron-Bridge, or when diagnosing an OOM or regression tied to an FSDP config change (keywords like use_megatron_fsdp, data_parallel_sharding_strategy, Megatron FSDP).
What config changes does it recommend?
Setting use_megatron_fsdp on dist and ddp, data_parallel_sharding_strategy = optim_grads_params, average_in_collective = False, and ckpt_format = fsdp_dtensor, which Megatron FSDP requires.
How do I verify a change works?
Run the checked-in 2-GPU functional smoke test via torch.distributed.run with pytest on test_megatron_fsdp; success is 1 passed, a finite loss at the last iteration, and no checkpoint-format assertion.
What common pitfalls does it call out?
Recipes that expose use_megatron_fsdp but still default to torch_dist checkpoint format, the mutual exclusivity of Megatron FSDP and FSDP2, CPU-offload constraints, and Hopper CUDA_DEVICE_MAX_CONNECTIONS differences.
Does it run training for me?
No. It is an operational guide of config snippets, source-code anchors, and verification commands; you apply and run them yourself.
Install nemo-mbridge-perf-megatron-fsdp
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
nvidia/skills