[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CPW4Z08WRGMZPRMEBHJV0J":3,"skill-same:01M7CPW4Z08WRGMZPRMEBHJV0J":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7CPW4Z08WRGMZPRMEBHJV0J","nemo-mbridge-perf-megatron-fsdp",null,"Operational guide for enabling Megatron FSDP in Megatron-Bridge, including config knobs, code anchors, pitfalls, and verification.","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fnvidia-skills\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fskills\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":15,"description":7,"when_to_use":24},"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","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fnvidia-skills\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fskills\u002Fnemo-mbridge-perf-megatron-fsdp",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill nemo-mbridge-perf-megatron-fsdp",{"tool":39,"command":40},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill nemo-mbridge-perf-megatron-fsdp",{"tool":42,"command":43},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill nemo-mbridge-perf-megatron-fsdp","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fnvidia-skills\u002Fnemo-mbridge-perf-megatron-fsdp\u002Fskills\u002Fnemo-mbridge-perf-megatron-fsdp\u002FSKILL.md",true,[],[48,56,61,68,73,80],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":52,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":57,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":52,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":52,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":69,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":52,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":52,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":81,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":52,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]