Nemo Mbridge Perf Megatron Fsdp
NVIDIAOfficialPublished by NVIDIA
- Skill
- Tool integration
- Software development
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a comprehensive reference for enabling and troubleshooting Megatron FSDP (Fully Sharded Data Parallel) in Megatron-Bridge. It covers essential configuration parameters, code migration paths, common pitfalls, and verification procedures to ensure stable training performance.
What it does
- Provides configuration snippets for enabling Megatron FSDP in training recipes.
- Details necessary adjustments for checkpoint formats and sharding strategies.
- Identifies code anchors for migrating legacy distributed configuration settings.
- Highlights common pitfalls regarding mutual exclusivity and hardware-specific settings.
- Outlines functional smoke testing procedures to verify successful implementation.
When to use it
- When transitioning from DDP to FSDP-based data parallelism.
- When debugging Out-of-Memory (OOM) errors related to data parallel configurations.
- When investigating performance regressions linked to FSDP settings.
- When setting up new training runs requiring specific sharding strategies.
Advantages
- Centralizes configuration requirements for Megatron FSDP.
- Reduces integration errors by highlighting mandatory checkpoint format changes.
- Provides clear validation steps to confirm correct deployment.
- Clarifies the relationship between different distributed training wrappers.
Usage examples
- “How do I enable Megatron FSDP in my Megatron-Bridge training config?”
- The agent provides the required configuration block, including setting use_megatron_fsdp to True, selecting the appropriate sharding strategy, and configuring the fsdp_dtensor checkpoint format.
- “I am getting an error when using Megatron FSDP, how do I verify my setup?”
- The agent directs you to run the functional smoke test using the provided pytest command and explains how to interpret the logs for finite loss and successful checkpointing.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/nvidia/nemo-mbridge-perf-megatron-fsdp/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip nemo-mbridge-perf-megatron-fsdp.zip -d .agents/skills
Documentation by NVIDIA
Megatron FSDP Skill
For stable background and recommendation level, see:
@docs/training/megatron-fsdp.md
@skills/nemo-mbridge-perf-megatron-fsdp/card.yaml
Enablement
Minimal Megatron FSDP override in Bridge:
cfg.ddp.use_megatron_fsdp = True
cfg.ddp.data_parallel_sharding_strategy = "optim_grads_params"
cfg.ddp.average_in_collective = False
cfg.checkpoint.ckpt_format = "fsdp_dtensor"Example recipe fixup:
cfg = llama3_8b_pretrain_config()
cfg.ddp.use_megatron_fsdp = True
cfg.ddp.data_parallel_sharding_strategy = "optim_grads_params"
cfg.ddp.average_in_collective = False
cfg.checkpoint.ckpt_format = "fsdp_dtensor"
cfg.checkpoint.save = "/tmp/fsdp_ckpts"
cfg.checkpoint.load = NonePerformance harness note:
python scripts/performance/launch.py --use_megatron_fsdp trueCode Anchors
Megatron-Core DDP configuration (exposed as cfg.ddp in Bridge):
from megatron.core.distributed import DistributedDataParallelConfig
ddp_config = DistributedDataParallelConfig(use_megatron_fsdp=True)DistributedInitConfig no longer accepts use_megatron_fsdp. Migrate existing
cfg.dist.use_megatron_fsdp overrides to cfg.ddp.use_megatron_fsdp.
Bridge validation:
if self.ddp.use_megatron_fsdp and self.dist.use_torch_fsdp2:
raise ValueError(...)
...
assert not self.dist.use_tp_pp_dp_mapping, "use_tp_pp_dp_mapping is not supported with Megatron FSDP"
...
assert self.checkpoint.ckpt_format == "fsdp_dtensor", (
"Megatron FSDP only supports fsdp_dtensor checkpoint format"
)Runtime wrapper selection:
if use_megatron_fsdp:
DP = FullyShardedDataParallel
elif use_torch_fsdp2:
DP = TorchFullyShardedDataParallel
else:
DP = DistributedDataParallel
...
DP(
config=get_model_config(model_chunk),
ddp_config=ddp_config,
module=model_chunk,
...
pg_collection=pg_collection,
)Perf harness overrides:
recipe.ddp.use_megatron_fsdp = True
recipe.ddp.data_parallel_sharding_strategy = "optim_grads_params"
recipe.ddp.keep_fp8_transpose_cache = False
recipe.ddp.average_in_collective = False
...
recipe.checkpoint.load = NonePitfalls
Public recipes often expose
use_megatron_fsdpbut still default tockpt_format="torch_dist". If save/load is enabled, switch tofsdp_dtensor.use_torch_fsdp2exists, but on the validated branch Bridge still fails before training because_ddp_wrappassespg_collection.CPU offloading is only valid when
pipeline_model_parallel_size == 1and activation recomputation is disabled.Upstream warns that FSDP and TP/CP can want different
CUDA_DEVICE_MAX_CONNECTIONSsettings on Hopper and earlier.Megatron FSDP and FSDP2 are mutually exclusive.
Verification
Use the existing 2-GPU functional smoke test:
CUDA_VISIBLE_DEVICES=0,1 uv run python -m torch.distributed.run --nproc_per_node=2 \
-m pytest tests/functional_tests/training/test_megatron_fsdp.py::TestMegatronFSDP::test_fsdp_pretrain_basic -v -sSuccess criteria:
Pytest reports
1 passedThe log shows finite loss at the last iteration
The run finishes without a checkpoint format assertion
Files
- ATTRIBUTION.mdAdded by AutoGineer861 B
- BENCHMARK.md9.3 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md3.7 KiB
- card.yaml2.0 KiB
- evals/evals.json1.4 KiB
- skill-card.md7.0 KiB
- skill.oms.sig4.7 KiB
BENCHMARK.md
Skill Benchmark: nemo-mbridge-perf-megatron-fsdp
✅ Overall verdict: PASS — Recommended for publication
Publication Recommendation
Recommended for publication based on the completed evaluation evidence in this report.
Evaluation Metadata
Skill:
nemo-mbridge-perf-megatron-fsdpValidation status:
passedEvaluation date: 2026-11-04
Evaluator version:
1.6.6Agents: Claude Code (
aws/anthropic/bedrock-claude-opus-5-5), Codex (openai/openai/gpt-6.1-sol)Tasks: 1 evaluation tasks (1 positive)
Dataset digest:
sha256:16192a516f7c2ea6a26939adadefb7c586f47ca060c1f0a59c72721dc0f0e393(skill-evaluator-dataset-snapshot/1)Attempts per task: 1
Environment:
k8s-sandboxTier 2 evidence: required for publication
Tier 3 evidence: required for publication
Each task attempt ran in its own isolated sandbox pod.
Tier 1 LLM Provenance
SkillSpector provider, model, analyzer revision, and determinism evidence retained for this scan.
| Skill | Provider | Adapter | Analyzer | Model | Revision | Determinism |
|---|---|---|---|---|---|---|
| nemo-mbridge-perf-megatron-fsdp | nv_inference | openai | mcp_tool_poisoning | aws/anthropic/bedrock-claude-opus-5-5 | 2.13.3 | nondeterministic / provider_defaults |
| nemo-mbridge-perf-megatron-fsdp | nv_inference | openai | semantic_developer_intent | aws/anthropic/bedrock-claude-opus-5-5 | 2.13.3 | nondeterministic / provider_defaults |
| nemo-mbridge-perf-megatron-fsdp | nv_inference | openai | semantic_quality_policy | aws/anthropic/bedrock-claude-opus-5-5 | 2.13.3 | nondeterministic / provider_defaults |
| nemo-mbridge-perf-megatron-fsdp | nv_inference | openai | semantic_security_discovery | aws/anthropic/bedrock-claude-opus-5-5 | 2.13.3 | nondeterministic / provider_defaults |
| nemo-mbridge-perf-megatron-fsdp | nv_inference | openai | meta_analyzer | aws/anthropic/bedrock-claude-opus-5-5 | 2.13.3 | nondeterministic / provider_defaults |
Controls for
nemo-mbridge-perf-megatron-fsdp: temperature=not set (source=provider_default, forwarded=no); seed=not set (source=unset, forwarded=no); reasoning_effort=not set (source=provider_default, forwarded=no)
What This Report Answers
The three-tier evaluation checks whether the skill:
is safe to use;
produces correct answers;
is discovered and activated when needed;
helps the agent complete the user's goal and expected workflow; and
avoids wasted skill and tool usage.
Results at a Glance
| Measure | Claude Code (Baseline → Skill Uplift) | Codex (Baseline → Skill Uplift) |
|---|---|---|
| Overall | 98.1% — baseline ran, but no comparable score was available; uplift unavailable | 89.8% — baseline ran, but no comparable score was available; uplift unavailable |
| Security | 100.0% → 100.0% (±0.0 points) | 100.0% → 100.0% (±0.0 points) |
| Correctness | 60.0% → 100.0% (+40.0 points) | 100.0% → 100.0% (±0.0 points) |
| Discoverability | 100.0% — baseline ran, but no comparable score was available; uplift unavailable | 95.0% — baseline ran, but no comparable score was available; uplift unavailable |
| Effectiveness | 16.7% → 91.7% (+75.0 points) | 66.7% → 83.3% (+16.6 points) |
| Efficiency | 98.6% — baseline ran, but no comparable score was available; uplift unavailable | 70.6% — baseline ran, but no comparable score was available; uplift unavailable |
How to read this table: baseline is the same task attempted without the target skill. Scores are rounded to one decimal; threshold-adjacent values use additional precision so their displayed band matches the verdict. Uplift is derived from those displayed scores and shown in percentage points.
Example: 47.0% → 92.0% (+45.0 points) means the skill-assisted run scored 92.0%, 45.0 percentage points above its 47.0% no-skill baseline.
Comparison details
Shared-source comparisons use the same signals and weights on both conditions. They do not replace the full dimension scores above or change the publication verdict.
| Agent | Dimension | Basis | Baseline → With skill (uplift) | Explanation |
|---|---|---|---|---|
| claude-code | Discoverability | Dimension comparison | N/A | Discoverability is not applicable to the no-skill baseline; there is no installed skill to discover. |
| claude-code | Efficiency | Token-only comparison | 84.0% → 97.2% (+13.2 points) | Only Token Efficiency is comparable; the full dimension scores use different evaluator sources. |
| codex | Discoverability | Dimension comparison | N/A | Discoverability is not applicable to the no-skill baseline; there is no installed skill to discover. |
| codex | Efficiency | Token-only comparison | 86.3% → 91.2% (+4.9 points) | Only Token Efficiency is comparable; the full dimension scores use different evaluator sources. |
Token Usage
Actual Tier 3 execution usage is reported for every observed agent/case pair and both conditions.
| Agent | Dataset case | With skill | Without skill | Delta | Change | Coverage |
|---|---|---|---|---|---|---|
| claude-code | All cases | 74,521 | 73,128 | +1,393 | +1.90% | skill 1/1; base 1/1 |
| claude-code | megatron-fsdp-positive-enable-smoke | 74,521 | 73,128 | +1,393 | +1.90% | skill 1/1; base 1/1 |
| codex | All cases | 32,600 | 58,473 | -25,873 | -44.25% | skill 1/1; base 1/1 |
| codex | megatron-fsdp-positive-enable-smoke | 32,600 | 58,473 | -25,873 | -44.25% | skill 1/1; base 1/1 |
| ALL AGENTS | Dataset aggregate | 107,121 | 131,601 | -24,480 | -18.60% | skill 2/2; base 2/2 |
Prompt tokens include cached reads, so total tokens are prompt + completion (cached is not added twice). The Efficiency score uses (prompt - cached) + completion. Change is 100 * (with - without) / without; negative means fewer tokens. N/A comparisons include their reason in the coverage column; coverage is never estimated.
Tier Status
| Tier | Purpose | Status | Evidence |
|---|---|---|---|
| Tier 1 | Static validation | PASSED WITH OBSERVATIONS | 11 validator(s); 10 finding(s) |
| Tier 2 | Semantic deduplication | PASSED | 2 validator(s); 0 finding(s) |
| Tier 3 | Live agent evaluation | PASS | 2 agent(s); 1 task(s) |
Findings and Observations
<details> <summary>Show detailed findings and successful checks</summary>
MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.author' (
skills/nemo-mbridge-perf-megatron-fsdp/SKILL.md)MEDIUM QUALITY/quality_correctness: SKILL_SPEC recommended field missing: 'metadata.tags' (
skills/nemo-mbridge-perf-megatron-fsdp/SKILL.md)MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Instructions' (
skills/nemo-mbridge-perf-megatron-fsdp/SKILL.md)MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Examples' (
skills/nemo-mbridge-perf-megatron-fsdp/SKILL.md)MEDIUM SCHEMA/author_missing: Author not specified in metadata (
skills/nemo-mbridge-perf-megatron-fsdp/SKILL.md)5 additional finding(s) are available in the full evaluation artifacts.
</details>
Scoring Methodology
<details> <summary>Show dimension definitions, source signals, and thresholds</summary>
| Dimension | Question | Scored signals |
|---|---|---|
| Security | Is it safe to use? | security (100%) |
| Correctness | Is the answer correct? | accuracy (100%) |
| Discoverability | Was the right skill loaded when needed? | skill_execution (100%) |
| Effectiveness | Did the skill help complete the task? | goal_accuracy (50%) + behavior_check (50%) |
| Efficiency | Did it avoid wasted tool calls and token usage? | skill_efficiency (50%) + token_efficiency (50%) |
Dimension bands: PASS at 50% or above; NEUTRAL from 40% to below 50%; FAIL below 40%.
Overall Tier 3 lift: PASS at +5 points or more; FAIL at -10 points or less; values between those bands are NEUTRAL.
Overall verdict: PASS only when every configured dimension passes for at least one supported agent. Lift is reported as diagnostic evidence and does not override this gate.
The 50% attempt pass threshold is a separate per-task gate; it is not the dimension pass threshold.
Effectiveness is the equal-weight mean of goal completion (
goal_accuracy) and expected workflow adherence (behavior_check).Efficiency is 50% tool-call productivity (the backward-compatible
skill_efficiencywire id) and 50%token_efficiency. Positive-case skill routing is scored under Discoverability, not Efficiency; a negative case without a routing target is N/A. N/A sources are omitted, remaining weights are renormalized, and the dimension is marked partial.
Signals present in this run:
security(Security): unsafe operations, secret leakage, and unauthorized access.skill_execution(Skill Execution): whether the expected skill was selected, decoys were avoided, and the workflow executed.skill_efficiency(Tool Productivity): tool-call productivity (legacy wire id; routing is scored under Discoverability).accuracy(Accuracy): final-answer correctness against the reference answer.goal_accuracy(Goal Accuracy): whether the user's goal was achieved.behavior_check(Behavior Check): whether the expected workflow behavior was followed.token_efficiency(Token Efficiency): actual uncached prompt plus completion usage (50% of Efficiency).
</details>
Freshness
Regenerate this benchmark when the skill, evaluation dataset, target agent/model, evaluator version, environment, or scoring policy changes.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- NVIDIA
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/nemo-mbridge-perf-megatron-fsdp · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nemo-mbridge-perf-megatron-fsdp.zip