[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78J3QX50YXFFHQF2SBXFGPV":3,"skill-same:01M78J3QX50YXFFHQF2SBXFGPV":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M78J3QX50YXFFHQF2SBXFGPV","nemo-mbridge-perf-megatron-fsdp",null,"Operational guide for enabling Megatron FSDP in Megatron-Bridge, including config knobs, code anchors, pitfalls, and verification.","matheussluzz\u002FZeuZ-Agent","matheussluzz","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F209255758?v=4","01M78HKHH1D1ASC9KC9BG583DH","01M78HKHHP6W7XRXQM2SBCAM3R",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nemo-mbridge-perf-megatron-fsdp\ndescription: Operational guide for enabling Megatron FSDP in Megatron-Bridge, including config knobs, code anchors, pitfalls, and verification.\nlicense: Apache-2.0\nwhen_to_use: Using FSDP-based data parallelism instead of DDP, or tracing an OOM or regression to a FSDP config change; 'use_megatron_fsdp', 'data_parallel_sharding_strategy', 'sharded data parallel', 'Megatron FSDP'.\n---\n\n# Megatron FSDP Skill\n\nFor stable background and recommendation level, see:\n\n- @docs\u002Ftraining\u002Fmegatron-fsdp.md\n- @skills\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fcard.yaml\n\n## Enablement\n\nMinimal Megatron FSDP override in Bridge:\n\n```python\ncfg.dist.use_megatron_fsdp = True\ncfg.ddp.use_megatron_fsdp = True\ncfg.ddp.data_parallel_sharding_strategy = \"optim_grads_params\"\ncfg.ddp.average_in_collective = False\ncfg.checkpoint.ckpt_format = \"fsdp_dtensor\"\n```\n\nExample recipe fixup:\n\n```python\ncfg = llama3_8b_pretrain_config()\ncfg.dist.use_megatron_fsdp = True\ncfg.ddp.use_megatron_fsdp = True\ncfg.ddp.data_parallel_sharding_strategy = \"optim_grads_params\"\ncfg.ddp.average_in_collective = False\ncfg.checkpoint.ckpt_format = \"fsdp_dtensor\"\ncfg.checkpoint.save = \"\u002Ftmp\u002Ffsdp_ckpts\"\ncfg.checkpoint.load = None\n```\n\nPerformance harness note:\n\n```bash\npython scripts\u002Fperformance\u002Flaunch.py --use_megatron_fsdp true\n```\n\n## Code Anchors\n\nBridge config definition:\n\n```148:154:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fconfig.py\nuse_megatron_fsdp: bool = False\n\"\"\"Use Megatron's Fully Sharded Data Parallel. Cannot be used together with use_torch_fsdp2.\"\"\"\n\nuse_torch_fsdp2: bool = False\n\"\"\"Use the torch FSDP2 implementation. FSDP2 is not currently working with Pipeline Parallel.\nIt is still not in a stable release stage, and may therefore contain bugs or other\npotential issues.\"\"\"\n```\n\nBridge validation:\n\n```1533:1578:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fconfig.py\nif self.dist.use_megatron_fsdp and self.dist.use_torch_fsdp2:\n    raise ValueError(...)\n...\nassert not self.dist.use_tp_pp_dp_mapping, \"use_tp_pp_dp_mapping is not supported with Megatron FSDP\"\n...\nassert self.checkpoint.ckpt_format == \"fsdp_dtensor\", (\n    \"Megatron FSDP only supports fsdp_dtensor checkpoint format\"\n)\n```\n\nRuntime wrapper selection:\n\n```217:243:src\u002Fmegatron\u002Fbridge\u002Fmodels\u002Fcommon\u002Funimodal.py\nif use_megatron_fsdp:\n    DP = FullyShardedDataParallel\nelif use_torch_fsdp2:\n    DP = TorchFullyShardedDataParallel\nelse:\n    DP = DistributedDataParallel\n...\nDP(\n    config=get_model_config(model_chunk),\n    ddp_config=ddp_config,\n    module=model_chunk,\n    ...\n    pg_collection=pg_collection,\n)\n```\n\nPerf harness overrides:\n\n```74:98:scripts\u002Fperformance\u002Futils\u002Foverrides.py\nrecipe.ddp.use_megatron_fsdp = True\nrecipe.ddp.data_parallel_sharding_strategy = \"optim_grads_params\"\nrecipe.ddp.keep_fp8_transpose_cache = False\nrecipe.ddp.average_in_collective = False\n...\nrecipe.checkpoint.load = None\n```\n\n## Pitfalls\n\n1. Public recipes often expose `use_megatron_fsdp` but still default to `ckpt_format=\"torch_dist\"`. If save\u002Fload is enabled, switch to `fsdp_dtensor`.\n2. `use_torch_fsdp2` exists, but on the validated branch Bridge still fails before training because `_ddp_wrap` passes `pg_collection`.\n3. CPU offloading is only valid when `pipeline_model_parallel_size == 1` and activation recomputation is disabled.\n4. Upstream warns that FSDP and TP\u002FCP can want different `CUDA_DEVICE_MAX_CONNECTIONS` settings on Hopper and earlier.\n5. Megatron FSDP and FSDP2 are mutually exclusive.\n\n## Verification\n\nUse the existing 2-GPU functional smoke test:\n\n```bash\nCUDA_VISIBLE_DEVICES=0,1 uv run python -m torch.distributed.run --nproc_per_node=2 \\\n  -m pytest tests\u002Ffunctional_tests\u002Ftraining\u002Ftest_megatron_fsdp.py::TestMegatronFSDP::test_fsdp_pretrain_basic -v -s\n```\n\nSuccess criteria:\n\n- Pytest reports `1 passed`\n- The log shows finite loss at the last iteration\n- The run finishes without a checkpoint format assertion\n","# Megatron FSDP Skill\n\nFor stable background and recommendation level, see:\n\n- @docs\u002Ftraining\u002Fmegatron-fsdp.md\n- @skills\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fcard.yaml\n\n## Enablement\n\nMinimal Megatron FSDP override in Bridge:\n\n```python\ncfg.dist.use_megatron_fsdp = True\ncfg.ddp.use_megatron_fsdp = True\ncfg.ddp.data_parallel_sharding_strategy = \"optim_grads_params\"\ncfg.ddp.average_in_collective = False\ncfg.checkpoint.ckpt_format = \"fsdp_dtensor\"\n```\n\nExample recipe fixup:\n\n```python\ncfg = llama3_8b_pretrain_config()\ncfg.dist.use_megatron_fsdp = True\ncfg.ddp.use_megatron_fsdp = True\ncfg.ddp.data_parallel_sharding_strategy = \"optim_grads_params\"\ncfg.ddp.average_in_collective = False\ncfg.checkpoint.ckpt_format = \"fsdp_dtensor\"\ncfg.checkpoint.save = \"\u002Ftmp\u002Ffsdp_ckpts\"\ncfg.checkpoint.load = None\n```\n\nPerformance harness note:\n\n```bash\npython scripts\u002Fperformance\u002Flaunch.py --use_megatron_fsdp true\n```\n\n## Code Anchors\n\nBridge config definition:\n\n```148:154:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fconfig.py\nuse_megatron_fsdp: bool = False\n\"\"\"Use Megatron's Fully Sharded Data Parallel. Cannot be used together with use_torch_fsdp2.\"\"\"\n\nuse_torch_fsdp2: bool = False\n\"\"\"Use the torch FSDP2 implementation. FSDP2 is not currently working with Pipeline Parallel.\nIt is still not in a stable release stage, and may therefore contain bugs or other\npotential issues.\"\"\"\n```\n\nBridge validation:\n\n```1533:1578:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fconfig.py\nif self.dist.use_megatron_fsdp and self.dist.use_torch_fsdp2:\n    raise ValueError(...)\n...\nassert not self.dist.use_tp_pp_dp_mapping, \"use_tp_pp_dp_mapping is not supported with Megatron FSDP\"\n...\nassert self.checkpoint.ckpt_format == \"fsdp_dtensor\", (\n    \"Megatron FSDP only supports fsdp_dtensor checkpoint format\"\n)\n```\n\nRuntime wrapper selection:\n\n```217:243:src\u002Fmegatron\u002Fbridge\u002Fmodels\u002Fcommon\u002Funimodal.py\nif use_megatron_fsdp:\n    DP = FullyShardedDataParallel\nelif use_torch_fsdp2:\n    DP = TorchFullyShardedDataParallel\nelse:\n    DP = DistributedDataParallel\n...\nDP(\n    config=get_model_config(model_chunk),\n    ddp_config=ddp_config,\n    module=model_chunk,\n    ...\n    pg_collection=pg_collection,\n)\n```\n\nPerf harness overrides:\n\n```74:98:scripts\u002Fperformance\u002Futils\u002Foverrides.py\nrecipe.ddp.use_megatron_fsdp = True\nrecipe.ddp.data_parallel_sharding_strategy = \"optim_grads_params\"\nrecipe.ddp.keep_fp8_transpose_cache = False\nrecipe.ddp.average_in_collective = False\n...\nrecipe.checkpoint.load = None\n```\n\n## Pitfalls\n\n1. Public recipes often expose `use_megatron_fsdp` but still default to `ckpt_format=\"torch_dist\"`. If save\u002Fload is enabled, switch to `fsdp_dtensor`.\n2. `use_torch_fsdp2` exists, but on the validated branch Bridge still fails before training because `_ddp_wrap` passes `pg_collection`.\n3. CPU offloading is only valid when `pipeline_model_parallel_size == 1` and activation recomputation is disabled.\n4. Upstream warns that FSDP and TP\u002FCP can want different `CUDA_DEVICE_MAX_CONNECTIONS` settings on Hopper and earlier.\n5. Megatron FSDP and FSDP2 are mutually exclusive.\n\n## Verification\n\nUse the existing 2-GPU functional smoke test:\n\n```bash\nCUDA_VISIBLE_DEVICES=0,1 uv run python -m torch.distributed.run --nproc_per_node=2 \\\n  -m pytest tests\u002Ffunctional_tests\u002Ftraining\u002Ftest_megatron_fsdp.py::TestMegatronFSDP::test_fsdp_pretrain_basic -v -s\n```\n\nSuccess criteria:\n\n- Pytest reports `1 passed`\n- The log shows finite loss at the last iteration\n- The run finishes without a checkpoint format assertion\n",{"name":5,"license":14,"description":7,"when_to_use":23},"Using FSDP-based data parallelism instead of DDP, or tracing an OOM or regression to a FSDP config change; 'use_megatron_fsdp', 'data_parallel_sharding_strategy', 'sharded data parallel', 'Megatron FSDP'.","main","fc4f2c7759ae400c66cd38656db70ead882a0d08","catalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent#readme","https:\u002F\u002Fgithub.com\u002Fmatheussluzz","2026-08-27 05:21:51",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add matheussluzz\u002FZeuZ-Agent --skill nemo-mbridge-perf-megatron-fsdp",{"tool":37,"command":38},"bunx","bunx skills add matheussluzz\u002FZeuZ-Agent --skill nemo-mbridge-perf-megatron-fsdp",{"tool":40,"command":41},"pnpm","pnpm dlx skills add matheussluzz\u002FZeuZ-Agent --skill nemo-mbridge-perf-megatron-fsdp","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp\u002FSKILL.md",true,[45,51,55,59,65],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"BENCHMARK.md","REFERENCE","参考文档",4331,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp\u002FBENCHMARK.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"card.yaml",2108,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fcard.yaml",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"skill-card.md",3760,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fskill-card.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"skill.oms.sig","OTHER","其他",4825,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fskill.oms.sig",{"path":66,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":67,"sourceHtmlUrl":68},"zeuz.manifest.yaml",172,"https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fcatalog\u002Fbundles\u002Fnvidia\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fzeuz.manifest.yaml",[70,78,85,92,99,106],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M78JQ2R0QR8H2Z6662RFX804","gamma","Fixture skill gamma for discovery benchmarks.","MIT","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskill-registry-mini\u002Fskills\u002Fgamma\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M78JQ1KCVZ15APZG3FFF29K0","beta","Fixture skill beta for discovery benchmarks.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskill-registry-mini\u002Fskills\u002Fbeta\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M78JQ0FJTK4Q9JKZMX9SVSEN","alpha","Fixture skill alpha for discovery benchmarks.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fskill-registry-mini\u002Fskills\u002Falpha\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M78JPYVYPY7R8QS10KADQPWE","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M78JPVYHB88RF5ATZVGX84RR","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fskills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":18},"01M78JPSSWNTZW89DWGJTX7716","wayfinder","Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002Fmatheussluzz\u002FZeuZ-Agent\u002Fblob\u002Fmain\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[]]