megatron-fsdp

Enable Megatron FSDP in Megatron-Bridge with configuration flags and validation checks.

2.8k|332|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/NVIDIA/skills --skill megatron-fsdp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: megatron-fsdp
Source: https://github.com/NVIDIA/skills/tree/main/skills/Megatron-Bridge/perf-techniques/megatron-fsdp
Command: npx skills add https://github.com/NVIDIA/skills --skill megatron-fsdp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Megatron-FSDP enables Fully Sharded Data Parallel in Megatron-Bridge to optimize memory usage and training scalability for very large Megatron models.

Core Features & Use Cases

  • Enable Megatron's FSDP by toggling configuration flags in Bridge: dist.use_megatron_fsdp and ddp.use_megatron_fsdp.
  • Provide code anchors, validation steps, pitfalls guidance, and a runtime path choice between Megatron FSDP and Torch FSDP2 for robust experimentation.
  • Suitable for large-scale pretraining and fine-tuning workflows that demand distributed memory management and performance gains.

Quick Start

Set cfg.dist.use_megatron_fsdp and cfg.ddp.use_megatron_fsdp to True, then run the Megatron-Bridge performance harness to verify the setup.

Frequently Asked Questions about megatron-fsdp

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

FAQPage Schema
How do I enable Megatron FSDP for distributed training?

To enable Megatron FSDP for distributed training, set both cfg.dist.use_megatron_fsdp and cfg.ddp.use_megatron_fsdp to True, then run the Megatron-Bridge performance harness to verify the setup.

What is the difference between Megatron FSDP and Torch FSDP2?

The difference between Megatron FSDP and Torch FSDP2 involves a runtime path choice provided during setup, allowing you to select and validate the specific Fully Sharded Data Parallel implementation for robust experimentation.

When do I need Fully Sharded Data Parallel for large model training?

You need Fully Sharded Data Parallel for large model training when optimizing memory usage and improving training scalability across multiple GPUs for very large Megatron models.

How to ensure checkpoint format compatibility when using Megatron FSDP?

To ensure checkpoint format compatibility with Megatron FSDP, the system enforces compatible checkpoint formats during the FSDP configuration process to maintain memory efficiency and proper validation checks.

Does Megatron-Bridge support FSDP for fine-tuning workflows?

Yes, Megatron-Bridge supports FSDP for large-scale pretraining and fine-tuning workflows that demand distributed memory management and performance gains across multiple GPUs.

What are common pitfalls when configuring Megatron FSDP?

Common pitfalls when configuring Megatron FSDP are mitigated by using provided code anchors, validation steps, and pitfalls guidance to ensure correct runtime selection and robust experimentation.