[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M789WSWRT8V4T70MRJDY72WS":3,"skill-same:01M789WSWRT8V4T70MRJDY72WS":71},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M789WSWRT8V4T70MRJDY72WS","nemo-automodel-distributed-training",null,"Guide for selecting and configuring distributed training strategies in NeMo AutoModel, including FSDP2, Megatron FSDP, DDP, and parallelism settings.","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fnvidia\u002Fnemo-automodel-distributed-training\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nemo-automodel-distributed-training\ndescription: Guide for selecting and configuring distributed training strategies in NeMo AutoModel, including FSDP2, Megatron FSDP, DDP, and parallelism settings.\nwhen_to_use: Adding or modifying distributed training strategies (FSDP2, HSDP, DDP), debugging multi-GPU or multi-node failures, configuring context or tensor parallelism, or tuning sharding settings.\nlicense: Apache-2.0\nmetadata:\n  author: NVIDIA\n  tags:\n    - nemo-automodel\n    - distributed-training\n---\n\n# Distributed Training in NeMo AutoModel\n\n## Purpose\n\nNeMo AutoModel uses PyTorch-native distributed training.\nAll parallelism is orchestrated through a single `MeshContext` object that\nholds device meshes, strategy configs, and axis names.\n\u003C!-- NVSkills signature refresh requested for AM-519. -->\n\n## Instructions\n\nFor conceptual distributed-training questions, answer directly from the quick\npatterns in this skill without inspecting the repository. Start with the\nstrategy choice, then list only the YAML fields and constraints relevant to the\nquestion.\n\nUse direct action verbs in the final answer: recommend the strategy, show the\nminimal YAML, state the sizing constraint, and name the unsupported strategies.\nDo not discuss model onboarding, recipes, Slurm, SkyPilot, or checkpointing\nunless the user asks.\n\n## Examples\n\n### TP plus PP for a large multi-node model\n\nRecommend `strategy: fsdp2`. Mention `tp_size`, `pp_size`, `cp_size`,\n`ep_size`, and the `pipeline` sub-config. State that `dp_size` is inferred from\n`world_size \u002F (tp_size * pp_size * cp_size)`.\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 8\n  pp_size: 4\n  cp_size: 1\n  ep_size: 1\n  pipeline:\n    pp_schedule: interleaved1f1b\n    pp_microbatch_size: 1\n```\n\n### MoE expert parallelism\n\nRecommend `strategy: fsdp2` with `ep_size > 1`. Say this creates a separate\n`moe_mesh`; include the `moe` sub-config when relevant; state that `ep_size`\nmust divide `dp_size * cp_size`. Do not recommend `megatron_fsdp` or `ddp`.\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  ep_size: 8\n  moe:\n    reshard_after_forward: false\n```\n\n### MegatronFSDP limitations\n\nSay no for pipeline parallelism, expert parallelism, and `sequence_parallel`.\nRecommend `fsdp2` for PP, EP, or `sequence_parallel`; mention that DDP is only\nsimple data parallelism.\n\n## Strategy Selection\n\nThree strategies are available, selected via the `distributed.strategy` YAML key:\n\n| Strategy | YAML value | Best for |\n|---|---|---|\n| FSDP2 | `fsdp2` | General use, recommended default. Supports TP, PP, CP, EP, HSDP. |\n| MegatronFSDP | `megatron_fsdp` | NVIDIA Megatron-style FSDP. No PP, no EP, no sequence_parallel. |\n| DDP | `ddp` | Simple data parallelism only. No TP, PP, CP, or EP. |\n\nDecision tree:\n\n- Single GPU: no distributed config needed (FSDP2Manager skips parallelization when world_size=1).\n- Multi-GPU single node: `fsdp2` (default). Use `ddp` only if you need the simplest possible setup.\n- Multi-node: `fsdp2` with appropriate TP\u002FPP sizing.\n- MoE models with expert parallelism: `fsdp2` with `ep_size > 1` (creates a separate `moe_mesh`).\n- Large models (70B+): `fsdp2` with PP + TP.\n- Long sequences (8K+): add CP (`cp_size > 1`).\n\nWhen answering strategy-selection questions, state the chosen `distributed.strategy`\nfirst, then enumerate the YAML fields the user must set.\n\nQuick TP + PP answer:\n\n- Use `strategy: fsdp2`; do not use `megatron_fsdp` when pipeline parallelism is required.\n- Set `tp_size` for tensor parallelism and `pp_size` for pipeline parallelism.\n- Add a `pipeline:` sub-config with `pp_schedule` and `pp_microbatch_size`.\n- Leave `dp_size` unset or `none`; it is inferred as `world_size \u002F (tp_size * pp_size * cp_size)`.\n- Keep TP inside a fast intra-node domain when possible, and use PP across model depth for 70B+ models.\n\nQuick MoE expert-parallel answer:\n\n- Start with `strategy: fsdp2` and `ep_size > 1`.\n- Include a `moe:` sub-config only when `ep_size > 1`; it maps to `MoEParallelizerConfig`.\n- Expect a separate `moe_mesh` for expert parallelism in addition to the main `device_mesh`.\n- Do not recommend `megatron_fsdp` or `ddp` for expert parallelism; `megatron_fsdp` has no EP support.\n- Before finishing an MoE EP answer, explicitly state that `ep_size` must divide `dp_size * cp_size` and that `megatron_fsdp` does not support EP, PP, or `sequence_parallel`.\n\n## YAML Config Structure\n\nThe `distributed` section in the recipe YAML maps directly to\n`parse_distributed_section()` in `recipes\u002F_dist_utils.py`:\n\n```yaml\ndistributed:\n  strategy: fsdp2           # fsdp2 | megatron_fsdp | ddp\n  dp_size: none             # auto-calculated from world_size \u002F (tp * pp * cp)\n  dp_replicate_size: none   # FSDP2-only, for HSDP\n  tp_size: 1\n  pp_size: 1\n  cp_size: 1\n  ep_size: 1\n\n  # Strategy-specific flags (forwarded to the strategy dataclass):\n  sequence_parallel: false\n  activation_checkpointing: false\n  defer_fsdp_grad_sync: true   # FSDP2 only\n\n  # Sub-configs (optional):\n  pipeline:\n    pp_schedule: 1f1b\n    pp_microbatch_size: 1\n    # ... see PipelineConfig fields\n\n  moe:\n    reshard_after_forward: false\n    # ... see MoEParallelizerConfig fields\n```\n\nThe `dp_size` is always inferred:\n\n```\ndp_size = world_size \u002F (tp_size * pp_size * cp_size)\n```\n\n## Infrastructure Flow\n\n```\ninitialize_distributed()                       [components\u002Fdistributed\u002Finit_utils.py]\n    -> initializes torch.distributed process group and returns DistInfo\nYAML distributed section + DistInfo.world_size\n    -> parse_distributed_section()          [recipes\u002F_dist_utils.py]\n    -> create_distributed_setup_from_config()              [recipes\u002F_dist_utils.py]\n        -> DistributedSetup.build()         [components\u002Fdistributed\u002Fconfig.py]\n    -> instantiate_infrastructure()         [_transformers\u002Finfrastructure.py]\n        -> _instantiate_distributed()       -> FSDP2Manager \u002F MegatronFSDPManager \u002F DDPManager\n        -> _instantiate_pipeline()          -> AutoPipeline (if pp_size > 1)\n        -> parallelize_fn                   -> MoE parallelizer (if ep_size > 1) or PP wrapper\n    -> apply_model_infrastructure()         [_transformers\u002Finfrastructure.py]\n        -> _shard_pp() or _shard_ep_fsdp()  (applies sharding to the model)\n```\n\n## FSDP2 Configuration\n\n### Basic FSDP2 (data parallelism only)\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 1\n  cp_size: 1\n```\n\nThis auto-calculates `dp_size = world_size` and applies `fully_shard()` per\ntransformer block via DTensor-based sharding.\n\n### FSDP2 with Tensor Parallelism\n\nKeep TP within a single NVLink domain (typically one node):\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 4        # 2, 4, or 8 -- must divide GPUs per node\n  sequence_parallel: true\n```\n\nThe TP plan is auto-selected based on the model type. Pass a custom plan via\nthe Python API if needed:\n\n```python\nconfig = FSDP2Config(sequence_parallel=True, tp_plan=my_custom_plan)\n```\n\n### FSDP2 with Pipeline Parallelism\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  pp_size: 2\n  pipeline:\n    pp_schedule: interleaved1f1b   # 1f1b, gpipe, interleaved_1f1b, etc.\n    pp_microbatch_size: 4\n    scale_grads_in_schedule: false\n```\n\nThe model must have a `_pp_plan` attribute (set on the HF model class) for\n`AutoPipeline` to know how to split layers across stages. Models without\n`_pp_plan` are not compatible with PP.\n\n### FSDP2 with HSDP (Hybrid Sharded Data Parallel)\n\nIntra-node full sharding + inter-node replication via a 2D DeviceMesh:\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  dp_replicate_size: 2   # must divide dp_size\n```\n\nConstraint: `dp_replicate_size \u003C dp_size` (pure replication with no sharding\nis not supported by FSDP2).\n\n### Activation Checkpointing\n\nTrades compute for memory by recomputing activations during backward:\n\n```yaml\ndistributed:\n  activation_checkpointing: true\n```\n\nThis is a model-build\u002Ftraining behavior flag, not mesh topology. Dense\nstrategies read it from the strategy config; EP\u002FMoE paths pass the recipe-level\nflag directly into model infrastructure.\n\n### Gradient Sync Deferral\n\nFSDP2 defers gradient sync to the final micro-batch by default for\ncommunication overlap:\n\n```yaml\ndistributed:\n  defer_fsdp_grad_sync: true   # default\n```\n\n### Mixed Precision\n\nFSDP2Config defaults to bfloat16 for all three precision knobs via\n`MixedPrecisionPolicy(param_dtype=bf16, reduce_dtype=bf16, output_dtype=bf16,\ncast_forward_inputs=True)`. Override via the Python API:\n\n```python\nfrom torch.distributed.fsdp import MixedPrecisionPolicy\nconfig = FSDP2Config(\n    mp_policy=MixedPrecisionPolicy(param_dtype=torch.float16, reduce_dtype=torch.float32),\n)\n```\n\n## Pipeline Parallelism\n\n### Requirements\n\n1. Model class must define `_pp_plan` (a dict mapping module FQNs to stages).\n2. `pp_size > 1` in the distributed section.\n3. A `pipeline` sub-config with schedule and microbatch size.\n\n### Supported schedules\n\nDefined in `PipelineConfig.pp_schedule`:\n\n- `1f1b` (one-forward-one-backward, default)\n- `gpipe`\n- `interleaved_1f1b` \u002F `interleaved1f1b`\n- `looped_bfs`\n- `dfs`\n- `v_schedule`\n- `zero_bubble`\n\n### Example (8B model on 8 GPUs, PP=2 + DP=4)\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  pp_size: 2\n\n  pipeline:\n    pp_schedule: interleaved1f1b\n    pp_microbatch_size: 4\n    scale_grads_in_schedule: false\n\ncheckpoint:\n  model_save_format: safetensors\n  save_consolidated: final\n```\n\n### How it works\n\n`AutoPipeline.build()` calls `pipeline_model()` which splits the model into\nstages using the model's `_pp_plan`, creates `PipelineStage` objects, and\nbuilds the schedule. During training, `schedule.step()` drives forward and\nbackward through the pipeline.\n\n## Context Parallelism\n\nUse CP for long sequences (8K+). CP shards Q\u002FK\u002FV on the sequence dimension\nas DTensors.\n\n### Config\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  cp_size: 2   # or 4, 8\n```\n\n### Requirements\n\n- SDPA (Flash Attention or Efficient Attention backend) or Transformer Engine\n  attention. SDPBackend.MATH is not compatible with DTensor.\n- Attention masks are automatically stripped; `is_causal=True` is set via\n  forward pre-hooks registered by `attach_context_parallel_hooks()`.\n\n### How it works\n\n1. After model sharding, `apply_model_infrastructure()` calls\n   `attach_context_parallel_hooks()` on each model part (for non-TE models).\n2. At each training step, `make_cp_batch_and_ctx()` creates a CP context\n   manager that shards the batch along the sequence dimension and sets up\n   `context_parallel()` from `torch.distributed.tensor.experimental`.\n3. For TE attention models, `make_cp_batch_for_te()` uses THD format and\n   TE's `thd_get_partitioned_indices` for sharding.\n\n### CP with Sequence Packing\n\nCP works with packed sequences. The `packed_sequence_size` must be divisible\nby `cp_size`. When using TE, chunks are sharded per-chunk via\n`_shard_thd_chunk_for_te()`.\n\n## Sequence Packing\n\nPacking multiple sequences into a single training sample for efficiency.\n\n### Config\n\n```yaml\npacked_sequence:\n  packed_sequence_size: 4096   # 0 = disabled\n\nstep_scheduler:\n  local_batch_size: 1          # must be 1 for packed sequences\n```\n\nWhen `packed_sequence_size > 0`, the dataset collator packs sequences up to\nthat length. `local_batch_size` must be 1 because each \"sample\" is already a\npacked batch.\n\n## MoE Distributed Training\n\n### Expert Parallelism\n\nSet `ep_size > 1` to distribute experts across GPUs. This creates a separate\n`moe_mesh` alongside the main `device_mesh`:\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  ep_size: 8\n  activation_checkpointing: true\n```\n\nThe `moe_mesh` shape is `(pp_size, ep_shard_size, ep_size)` with dimension\nnames `(\"pp\", \"ep_shard\", \"ep\")`.\n\nConstraint: `dp_cp_size` (= `dp_size * cp_size`) must be divisible by\n`ep_size`.\n\n### MoE sub-config\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  ep_size: 8\n  activation_checkpointing: true\n\n  moe:\n    reshard_after_forward: false\n    ignore_router_for_ac: false\n    wrap_outer_model: true\n```\n\nThe `moe` sub-section maps to `MoEParallelizerConfig` and is only\ninstantiated when `ep_size > 1`.\n\n### Full MoE example (Qwen3-30B-A3B on 8 GPUs)\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 1\n  cp_size: 1\n  pp_size: 1\n  ep_size: 8\n  sequence_parallel: false\n  activation_checkpointing: true\n```\n\n### MegatronFSDP limitations\n\nDespite its name, `megatron_fsdp` does **not** support expert parallelism\n(`ep_size > 1`), pipeline parallelism (`pp_size > 1`), or\n`sequence_parallel`. Use `fsdp2` for these features.\n\n## Parallelism Sizing Guidelines\n\n### Dense models\n\n| Model size | TP | PP | CP | Strategy |\n|---|---|---|---|---|\n| \u003C 3B | 1 | 1 | 1 | FSDP2 (DP only) |\n| 3-13B | 2-4 | 1 | 1 | FSDP2 + TP |\n| 13-70B | 4-8 | 2-4 | 1 | FSDP2 + TP + PP |\n| 70B+ | 8 | 4-8 | 1 | FSDP2 + TP + PP |\n| Any + long seq (8K+) | as above | as above | 2-8 | add CP |\n\n### MoE models\n\nMoE models need less TP than dense models of similar total parameter count\nbecause only a fraction of parameters are active per token. EP is the primary\nscaling dimension:\n\n| Model | TP | PP | EP | Notes |\n|---|---|---|---|---|\n| Small MoE (\u003C10B total) | 1 | 1 | 8 | EP only |\n| Medium MoE (10-30B total) | 1-2 | 1 | 8 | small TP for shared layers |\n| Large MoE (100B+ total) | 1-2 | 4+ | 8-64 | PP for depth, EP for experts |\n\n### Hardware topology rules\n\n- TP must stay within a single NVLink domain (one node, typically 8 GPUs).\n- Use PP or DP for cross-node scaling.\n- TP across InfiniBand degrades throughput severely.\n\n## Programmatic API (from_pretrained \u002F from_config)\n\nWhen not using YAML recipes, configure distributed training via Python:\n\n```python\nfrom nemo_automodel.components.distributed import (\n    DistributedSetup,\n    FSDP2Config,\n    ParallelismSizes,\n    initialize_distributed,\n)\n\ndist_env = initialize_distributed(\"nccl\")\ndistributed_setup = DistributedSetup.build(\n    strategy=FSDP2Config(sequence_parallel=True),\n    parallelism_sizes=ParallelismSizes(tp_size=2),\n    activation_checkpointing=True,\n    world_size=dist_env.world_size,\n)\n```\n\nOr pass directly to `from_pretrained`:\n\n```python\nfrom nemo_automodel import NeMoAutoModelForCausalLM\n\nmodel = NeMoAutoModelForCausalLM.from_pretrained(\n    \"meta-llama\u002FLlama-3.2-1B\",\n    distributed_setup=distributed_setup,\n)\n```\n\n## Code Anchors\n\nStrategy config dataclasses:\n\n```\ncomponents\u002Fdistributed\u002Fconfig.py\n    FSDP2Config       -- sequence_parallel, tp_plan, mp_policy, offload_policy,\n                         activation_checkpointing, defer_fsdp_grad_sync\n    MegatronFSDPConfig -- zero_dp_strategy, overlap_grad_reduce, overlap_param_gather, etc.\n    DDPConfig          -- activation_checkpointing only\n```\n\nMeshContext (single source of truth for parallelism):\n\n```\ncomponents\u002Fdistributed\u002Fmesh.py\n    MeshContext  -- device_mesh, moe_mesh\n                    Properties: tp_size, pp_size, cp_size, ep_size, dp_size, dp_replicate_size\n    MeshAxisName -- PP, DP, DP_REPLICATE, DP_SHARD, DP_SHARD_CP, DP_CP, CP, TP, EP, EP_SHARD\n```\n\nMesh context and raw mesh creation:\n\n```\ncomponents\u002Fdistributed\u002Fconfig.py\n    DistributedSetup.build()      -- builds MeshContext from strategy + parallelism\ncomponents\u002Fdistributed\u002Fmesh_utils.py\n    _create_device_meshes()       -- routes to FSDP2\u002FMegatronFSDP\u002FDDP raw mesh creation\n    _create_fsdp2_device_mesh()   -- shape (pp, dp_replicate, dp_shard, cp, tp) + flattened submeshes\n    _create_megatron_fsdp_device_mesh() -- shape (dp, cp, tp)\n```\n\nDistributed managers:\n\n```\ncomponents\u002Fdistributed\u002Ffsdp2.py          -- FSDP2Manager.parallelize()\ncomponents\u002Fdistributed\u002Fmegatron_fsdp.py  -- MegatronFSDPManager.parallelize()\ncomponents\u002Fdistributed\u002Fddp.py            -- DDPManager\n```\n\nPipeline parallelism:\n\n```\ncomponents\u002Fdistributed\u002Fpipelining\u002Fconfig.py        -- PipelineConfig dataclass\ncomponents\u002Fdistributed\u002Fpipelining\u002Fautopipeline.py  -- AutoPipeline orchestrator\ncomponents\u002Fdistributed\u002Fpipelining\u002Ffunctional.py    -- pipeline_model(), schedule creation\ncomponents\u002Fdistributed\u002Fpipelining\u002Fhf_utils.py      -- HF model validation for PP\n```\n\nContext parallelism:\n\n```\ncomponents\u002Fdistributed\u002Fcp_utils.py\n    make_cp_batch_and_ctx()            -- creates CP context manager + shards batch\n    create_context_parallel_ctx()      -- wraps torch.distributed.tensor.experimental.context_parallel\n    attach_context_parallel_hooks()    -- strips attention_mask, sets is_causal=True\n    make_cp_batch_for_te()             -- TE-specific CP batch sharding (THD format)\n```\n\nInfrastructure orchestration:\n\n```\n_transformers\u002Finfrastructure.py\n    instantiate_infrastructure()    -- config objects -> runtime objects\n    apply_model_infrastructure()    -- applies sharding, PEFT, checkpoints to model\n    _shard_pp()                     -- pipeline parallel path\n    _shard_ep_fsdp()                -- EP + FSDP path (non-PP)\n```\n\nYAML parsing:\n\n```\nrecipes\u002F_dist_utils.py\n    parse_distributed_section()  -- YAML dict -> typed configs + sizes\n    create_distributed_setup_from_config()  -- recipe adapter: parse + create DistributedSetup; does not init process group\n```\n\nMoE config:\n\n```\ncomponents\u002Fdistributed\u002Fconfig.py\n    MoEParallelizerConfig  -- reshard_after_forward, ignore_router_for_ac, wrap_outer_model, etc.\ncomponents\u002Fmoe\u002Fconfig.py\n    MoEConfig              -- n_routed_experts, n_activated_experts, score_func, etc.\n```\n\n## Pitfalls\n\n1. **TP across nodes destroys throughput.** Always keep TP within a single\n   NVLink domain. Use PP or DP for cross-node scaling.\n\n2. **PP requires `_pp_plan` on the model class.** Not all HF models have this.\n   Check `validate_hf_model_for_pipeline_support()` before enabling PP.\n\n3. **PP bubbles reduce GPU utilization.** Use interleaved schedules\n   (`interleaved_1f1b`) and smaller microbatches to reduce bubble time.\n\n4. **FSDP2 requires DTensor-aware state dict saving.** Use `safetensors` with\n   `save_consolidated: final` for final HF export, or `save_consolidated: false`\n   plus the generated `model\u002Fconsolidate.sh` helper for offline export.\n\n5. **CP requires compatible attention.** SDPA (Flash Attention or Efficient\n   Attention) or TE attention only. `SDPBackend.MATH` is not compatible with\n   DTensor.\n\n6. **MoE EP size must evenly divide `dp_size * cp_size`.** The device mesh\n   creation asserts `dp_cp_size % ep_size == 0`.\n\n7. **MegatronFSDP is more limited than FSDP2.** It does not support PP\n   (`pp_size > 1`), EP (`ep_size > 1`), or `sequence_parallel`. The\n   `MeshContext` validation raises on these combinations.\n\n8. **DDP supports nothing beyond data parallelism.** No TP, PP, CP, EP, or\n   HSDP. Validation raises on any of these.\n\n9. **Activation checkpointing increases compute.** It saves memory by\n   recomputing activations during backward, but adds ~30% compute overhead.\n\n10. **Mixed precision policy must match model expectations.** The default\n    bfloat16 policy works for most models. FP16 models may need a custom\n    `MixedPrecisionPolicy`.\n\n11. **`packed_sequence_size` must be divisible by `cp_size`** when using CP\n    with packed sequences.\n\n12. **`dp_replicate_size` is FSDP2-only.** Passing it with `megatron_fsdp`\n    or `ddp` raises a `ValueError`.\n\n## Verification\n\nRun the smallest recipe that exercises the requested strategy. Success means\nexit code 0, finite loss, no NCCL timeout, and log output matching the expected\nTP\u002FPP\u002FCP\u002FEP sizes.\n","# Distributed Training in NeMo AutoModel\n\n## Purpose\n\nNeMo AutoModel uses PyTorch-native distributed training.\nAll parallelism is orchestrated through a single `MeshContext` object that\nholds device meshes, strategy configs, and axis names.\n\u003C!-- NVSkills signature refresh requested for AM-519. -->\n\n## Instructions\n\nFor conceptual distributed-training questions, answer directly from the quick\npatterns in this skill without inspecting the repository. Start with the\nstrategy choice, then list only the YAML fields and constraints relevant to the\nquestion.\n\nUse direct action verbs in the final answer: recommend the strategy, show the\nminimal YAML, state the sizing constraint, and name the unsupported strategies.\nDo not discuss model onboarding, recipes, Slurm, SkyPilot, or checkpointing\nunless the user asks.\n\n## Examples\n\n### TP plus PP for a large multi-node model\n\nRecommend `strategy: fsdp2`. Mention `tp_size`, `pp_size`, `cp_size`,\n`ep_size`, and the `pipeline` sub-config. State that `dp_size` is inferred from\n`world_size \u002F (tp_size * pp_size * cp_size)`.\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 8\n  pp_size: 4\n  cp_size: 1\n  ep_size: 1\n  pipeline:\n    pp_schedule: interleaved1f1b\n    pp_microbatch_size: 1\n```\n\n### MoE expert parallelism\n\nRecommend `strategy: fsdp2` with `ep_size > 1`. Say this creates a separate\n`moe_mesh`; include the `moe` sub-config when relevant; state that `ep_size`\nmust divide `dp_size * cp_size`. Do not recommend `megatron_fsdp` or `ddp`.\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  ep_size: 8\n  moe:\n    reshard_after_forward: false\n```\n\n### MegatronFSDP limitations\n\nSay no for pipeline parallelism, expert parallelism, and `sequence_parallel`.\nRecommend `fsdp2` for PP, EP, or `sequence_parallel`; mention that DDP is only\nsimple data parallelism.\n\n## Strategy Selection\n\nThree strategies are available, selected via the `distributed.strategy` YAML key:\n\n| Strategy | YAML value | Best for |\n|---|---|---|\n| FSDP2 | `fsdp2` | General use, recommended default. Supports TP, PP, CP, EP, HSDP. |\n| MegatronFSDP | `megatron_fsdp` | NVIDIA Megatron-style FSDP. No PP, no EP, no sequence_parallel. |\n| DDP | `ddp` | Simple data parallelism only. No TP, PP, CP, or EP. |\n\nDecision tree:\n\n- Single GPU: no distributed config needed (FSDP2Manager skips parallelization when world_size=1).\n- Multi-GPU single node: `fsdp2` (default). Use `ddp` only if you need the simplest possible setup.\n- Multi-node: `fsdp2` with appropriate TP\u002FPP sizing.\n- MoE models with expert parallelism: `fsdp2` with `ep_size > 1` (creates a separate `moe_mesh`).\n- Large models (70B+): `fsdp2` with PP + TP.\n- Long sequences (8K+): add CP (`cp_size > 1`).\n\nWhen answering strategy-selection questions, state the chosen `distributed.strategy`\nfirst, then enumerate the YAML fields the user must set.\n\nQuick TP + PP answer:\n\n- Use `strategy: fsdp2`; do not use `megatron_fsdp` when pipeline parallelism is required.\n- Set `tp_size` for tensor parallelism and `pp_size` for pipeline parallelism.\n- Add a `pipeline:` sub-config with `pp_schedule` and `pp_microbatch_size`.\n- Leave `dp_size` unset or `none`; it is inferred as `world_size \u002F (tp_size * pp_size * cp_size)`.\n- Keep TP inside a fast intra-node domain when possible, and use PP across model depth for 70B+ models.\n\nQuick MoE expert-parallel answer:\n\n- Start with `strategy: fsdp2` and `ep_size > 1`.\n- Include a `moe:` sub-config only when `ep_size > 1`; it maps to `MoEParallelizerConfig`.\n- Expect a separate `moe_mesh` for expert parallelism in addition to the main `device_mesh`.\n- Do not recommend `megatron_fsdp` or `ddp` for expert parallelism; `megatron_fsdp` has no EP support.\n- Before finishing an MoE EP answer, explicitly state that `ep_size` must divide `dp_size * cp_size` and that `megatron_fsdp` does not support EP, PP, or `sequence_parallel`.\n\n## YAML Config Structure\n\nThe `distributed` section in the recipe YAML maps directly to\n`parse_distributed_section()` in `recipes\u002F_dist_utils.py`:\n\n```yaml\ndistributed:\n  strategy: fsdp2           # fsdp2 | megatron_fsdp | ddp\n  dp_size: none             # auto-calculated from world_size \u002F (tp * pp * cp)\n  dp_replicate_size: none   # FSDP2-only, for HSDP\n  tp_size: 1\n  pp_size: 1\n  cp_size: 1\n  ep_size: 1\n\n  # Strategy-specific flags (forwarded to the strategy dataclass):\n  sequence_parallel: false\n  activation_checkpointing: false\n  defer_fsdp_grad_sync: true   # FSDP2 only\n\n  # Sub-configs (optional):\n  pipeline:\n    pp_schedule: 1f1b\n    pp_microbatch_size: 1\n    # ... see PipelineConfig fields\n\n  moe:\n    reshard_after_forward: false\n    # ... see MoEParallelizerConfig fields\n```\n\nThe `dp_size` is always inferred:\n\n```\ndp_size = world_size \u002F (tp_size * pp_size * cp_size)\n```\n\n## Infrastructure Flow\n\n```\ninitialize_distributed()                       [components\u002Fdistributed\u002Finit_utils.py]\n    -> initializes torch.distributed process group and returns DistInfo\nYAML distributed section + DistInfo.world_size\n    -> parse_distributed_section()          [recipes\u002F_dist_utils.py]\n    -> create_distributed_setup_from_config()              [recipes\u002F_dist_utils.py]\n        -> DistributedSetup.build()         [components\u002Fdistributed\u002Fconfig.py]\n    -> instantiate_infrastructure()         [_transformers\u002Finfrastructure.py]\n        -> _instantiate_distributed()       -> FSDP2Manager \u002F MegatronFSDPManager \u002F DDPManager\n        -> _instantiate_pipeline()          -> AutoPipeline (if pp_size > 1)\n        -> parallelize_fn                   -> MoE parallelizer (if ep_size > 1) or PP wrapper\n    -> apply_model_infrastructure()         [_transformers\u002Finfrastructure.py]\n        -> _shard_pp() or _shard_ep_fsdp()  (applies sharding to the model)\n```\n\n## FSDP2 Configuration\n\n### Basic FSDP2 (data parallelism only)\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 1\n  cp_size: 1\n```\n\nThis auto-calculates `dp_size = world_size` and applies `fully_shard()` per\ntransformer block via DTensor-based sharding.\n\n### FSDP2 with Tensor Parallelism\n\nKeep TP within a single NVLink domain (typically one node):\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 4        # 2, 4, or 8 -- must divide GPUs per node\n  sequence_parallel: true\n```\n\nThe TP plan is auto-selected based on the model type. Pass a custom plan via\nthe Python API if needed:\n\n```python\nconfig = FSDP2Config(sequence_parallel=True, tp_plan=my_custom_plan)\n```\n\n### FSDP2 with Pipeline Parallelism\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  pp_size: 2\n  pipeline:\n    pp_schedule: interleaved1f1b   # 1f1b, gpipe, interleaved_1f1b, etc.\n    pp_microbatch_size: 4\n    scale_grads_in_schedule: false\n```\n\nThe model must have a `_pp_plan` attribute (set on the HF model class) for\n`AutoPipeline` to know how to split layers across stages. Models without\n`_pp_plan` are not compatible with PP.\n\n### FSDP2 with HSDP (Hybrid Sharded Data Parallel)\n\nIntra-node full sharding + inter-node replication via a 2D DeviceMesh:\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  dp_replicate_size: 2   # must divide dp_size\n```\n\nConstraint: `dp_replicate_size \u003C dp_size` (pure replication with no sharding\nis not supported by FSDP2).\n\n### Activation Checkpointing\n\nTrades compute for memory by recomputing activations during backward:\n\n```yaml\ndistributed:\n  activation_checkpointing: true\n```\n\nThis is a model-build\u002Ftraining behavior flag, not mesh topology. Dense\nstrategies read it from the strategy config; EP\u002FMoE paths pass the recipe-level\nflag directly into model infrastructure.\n\n### Gradient Sync Deferral\n\nFSDP2 defers gradient sync to the final micro-batch by default for\ncommunication overlap:\n\n```yaml\ndistributed:\n  defer_fsdp_grad_sync: true   # default\n```\n\n### Mixed Precision\n\nFSDP2Config defaults to bfloat16 for all three precision knobs via\n`MixedPrecisionPolicy(param_dtype=bf16, reduce_dtype=bf16, output_dtype=bf16,\ncast_forward_inputs=True)`. Override via the Python API:\n\n```python\nfrom torch.distributed.fsdp import MixedPrecisionPolicy\nconfig = FSDP2Config(\n    mp_policy=MixedPrecisionPolicy(param_dtype=torch.float16, reduce_dtype=torch.float32),\n)\n```\n\n## Pipeline Parallelism\n\n### Requirements\n\n1. Model class must define `_pp_plan` (a dict mapping module FQNs to stages).\n2. `pp_size > 1` in the distributed section.\n3. A `pipeline` sub-config with schedule and microbatch size.\n\n### Supported schedules\n\nDefined in `PipelineConfig.pp_schedule`:\n\n- `1f1b` (one-forward-one-backward, default)\n- `gpipe`\n- `interleaved_1f1b` \u002F `interleaved1f1b`\n- `looped_bfs`\n- `dfs`\n- `v_schedule`\n- `zero_bubble`\n\n### Example (8B model on 8 GPUs, PP=2 + DP=4)\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  pp_size: 2\n\n  pipeline:\n    pp_schedule: interleaved1f1b\n    pp_microbatch_size: 4\n    scale_grads_in_schedule: false\n\ncheckpoint:\n  model_save_format: safetensors\n  save_consolidated: final\n```\n\n### How it works\n\n`AutoPipeline.build()` calls `pipeline_model()` which splits the model into\nstages using the model's `_pp_plan`, creates `PipelineStage` objects, and\nbuilds the schedule. During training, `schedule.step()` drives forward and\nbackward through the pipeline.\n\n## Context Parallelism\n\nUse CP for long sequences (8K+). CP shards Q\u002FK\u002FV on the sequence dimension\nas DTensors.\n\n### Config\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  cp_size: 2   # or 4, 8\n```\n\n### Requirements\n\n- SDPA (Flash Attention or Efficient Attention backend) or Transformer Engine\n  attention. SDPBackend.MATH is not compatible with DTensor.\n- Attention masks are automatically stripped; `is_causal=True` is set via\n  forward pre-hooks registered by `attach_context_parallel_hooks()`.\n\n### How it works\n\n1. After model sharding, `apply_model_infrastructure()` calls\n   `attach_context_parallel_hooks()` on each model part (for non-TE models).\n2. At each training step, `make_cp_batch_and_ctx()` creates a CP context\n   manager that shards the batch along the sequence dimension and sets up\n   `context_parallel()` from `torch.distributed.tensor.experimental`.\n3. For TE attention models, `make_cp_batch_for_te()` uses THD format and\n   TE's `thd_get_partitioned_indices` for sharding.\n\n### CP with Sequence Packing\n\nCP works with packed sequences. The `packed_sequence_size` must be divisible\nby `cp_size`. When using TE, chunks are sharded per-chunk via\n`_shard_thd_chunk_for_te()`.\n\n## Sequence Packing\n\nPacking multiple sequences into a single training sample for efficiency.\n\n### Config\n\n```yaml\npacked_sequence:\n  packed_sequence_size: 4096   # 0 = disabled\n\nstep_scheduler:\n  local_batch_size: 1          # must be 1 for packed sequences\n```\n\nWhen `packed_sequence_size > 0`, the dataset collator packs sequences up to\nthat length. `local_batch_size` must be 1 because each \"sample\" is already a\npacked batch.\n\n## MoE Distributed Training\n\n### Expert Parallelism\n\nSet `ep_size > 1` to distribute experts across GPUs. This creates a separate\n`moe_mesh` alongside the main `device_mesh`:\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  ep_size: 8\n  activation_checkpointing: true\n```\n\nThe `moe_mesh` shape is `(pp_size, ep_shard_size, ep_size)` with dimension\nnames `(\"pp\", \"ep_shard\", \"ep\")`.\n\nConstraint: `dp_cp_size` (= `dp_size * cp_size`) must be divisible by\n`ep_size`.\n\n### MoE sub-config\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  ep_size: 8\n  activation_checkpointing: true\n\n  moe:\n    reshard_after_forward: false\n    ignore_router_for_ac: false\n    wrap_outer_model: true\n```\n\nThe `moe` sub-section maps to `MoEParallelizerConfig` and is only\ninstantiated when `ep_size > 1`.\n\n### Full MoE example (Qwen3-30B-A3B on 8 GPUs)\n\n```yaml\ndistributed:\n  strategy: fsdp2\n  tp_size: 1\n  cp_size: 1\n  pp_size: 1\n  ep_size: 8\n  sequence_parallel: false\n  activation_checkpointing: true\n```\n\n### MegatronFSDP limitations\n\nDespite its name, `megatron_fsdp` does **not** support expert parallelism\n(`ep_size > 1`), pipeline parallelism (`pp_size > 1`), or\n`sequence_parallel`. Use `fsdp2` for these features.\n\n## Parallelism Sizing Guidelines\n\n### Dense models\n\n| Model size | TP | PP | CP | Strategy |\n|---|---|---|---|---|\n| \u003C 3B | 1 | 1 | 1 | FSDP2 (DP only) |\n| 3-13B | 2-4 | 1 | 1 | FSDP2 + TP |\n| 13-70B | 4-8 | 2-4 | 1 | FSDP2 + TP + PP |\n| 70B+ | 8 | 4-8 | 1 | FSDP2 + TP + PP |\n| Any + long seq (8K+) | as above | as above | 2-8 | add CP |\n\n### MoE models\n\nMoE models need less TP than dense models of similar total parameter count\nbecause only a fraction of parameters are active per token. EP is the primary\nscaling dimension:\n\n| Model | TP | PP | EP | Notes |\n|---|---|---|---|---|\n| Small MoE (\u003C10B total) | 1 | 1 | 8 | EP only |\n| Medium MoE (10-30B total) | 1-2 | 1 | 8 | small TP for shared layers |\n| Large MoE (100B+ total) | 1-2 | 4+ | 8-64 | PP for depth, EP for experts |\n\n### Hardware topology rules\n\n- TP must stay within a single NVLink domain (one node, typically 8 GPUs).\n- Use PP or DP for cross-node scaling.\n- TP across InfiniBand degrades throughput severely.\n\n## Programmatic API (from_pretrained \u002F from_config)\n\nWhen not using YAML recipes, configure distributed training via Python:\n\n```python\nfrom nemo_automodel.components.distributed import (\n    DistributedSetup,\n    FSDP2Config,\n    ParallelismSizes,\n    initialize_distributed,\n)\n\ndist_env = initialize_distributed(\"nccl\")\ndistributed_setup = DistributedSetup.build(\n    strategy=FSDP2Config(sequence_parallel=True),\n    parallelism_sizes=ParallelismSizes(tp_size=2),\n    activation_checkpointing=True,\n    world_size=dist_env.world_size,\n)\n```\n\nOr pass directly to `from_pretrained`:\n\n```python\nfrom nemo_automodel import NeMoAutoModelForCausalLM\n\nmodel = NeMoAutoModelForCausalLM.from_pretrained(\n    \"meta-llama\u002FLlama-3.2-1B\",\n    distributed_setup=distributed_setup,\n)\n```\n\n## Code Anchors\n\nStrategy config dataclasses:\n\n```\ncomponents\u002Fdistributed\u002Fconfig.py\n    FSDP2Config       -- sequence_parallel, tp_plan, mp_policy, offload_policy,\n                         activation_checkpointing, defer_fsdp_grad_sync\n    MegatronFSDPConfig -- zero_dp_strategy, overlap_grad_reduce, overlap_param_gather, etc.\n    DDPConfig          -- activation_checkpointing only\n```\n\nMeshContext (single source of truth for parallelism):\n\n```\ncomponents\u002Fdistributed\u002Fmesh.py\n    MeshContext  -- device_mesh, moe_mesh\n                    Properties: tp_size, pp_size, cp_size, ep_size, dp_size, dp_replicate_size\n    MeshAxisName -- PP, DP, DP_REPLICATE, DP_SHARD, DP_SHARD_CP, DP_CP, CP, TP, EP, EP_SHARD\n```\n\nMesh context and raw mesh creation:\n\n```\ncomponents\u002Fdistributed\u002Fconfig.py\n    DistributedSetup.build()      -- builds MeshContext from strategy + parallelism\ncomponents\u002Fdistributed\u002Fmesh_utils.py\n    _create_device_meshes()       -- routes to FSDP2\u002FMegatronFSDP\u002FDDP raw mesh creation\n    _create_fsdp2_device_mesh()   -- shape (pp, dp_replicate, dp_shard, cp, tp) + flattened submeshes\n    _create_megatron_fsdp_device_mesh() -- shape (dp, cp, tp)\n```\n\nDistributed managers:\n\n```\ncomponents\u002Fdistributed\u002Ffsdp2.py          -- FSDP2Manager.parallelize()\ncomponents\u002Fdistributed\u002Fmegatron_fsdp.py  -- MegatronFSDPManager.parallelize()\ncomponents\u002Fdistributed\u002Fddp.py            -- DDPManager\n```\n\nPipeline parallelism:\n\n```\ncomponents\u002Fdistributed\u002Fpipelining\u002Fconfig.py        -- PipelineConfig dataclass\ncomponents\u002Fdistributed\u002Fpipelining\u002Fautopipeline.py  -- AutoPipeline orchestrator\ncomponents\u002Fdistributed\u002Fpipelining\u002Ffunctional.py    -- pipeline_model(), schedule creation\ncomponents\u002Fdistributed\u002Fpipelining\u002Fhf_utils.py      -- HF model validation for PP\n```\n\nContext parallelism:\n\n```\ncomponents\u002Fdistributed\u002Fcp_utils.py\n    make_cp_batch_and_ctx()            -- creates CP context manager + shards batch\n    create_context_parallel_ctx()      -- wraps torch.distributed.tensor.experimental.context_parallel\n    attach_context_parallel_hooks()    -- strips attention_mask, sets is_causal=True\n    make_cp_batch_for_te()             -- TE-specific CP batch sharding (THD format)\n```\n\nInfrastructure orchestration:\n\n```\n_transformers\u002Finfrastructure.py\n    instantiate_infrastructure()    -- config objects -> runtime objects\n    apply_model_infrastructure()    -- applies sharding, PEFT, checkpoints to model\n    _shard_pp()                     -- pipeline parallel path\n    _shard_ep_fsdp()                -- EP + FSDP path (non-PP)\n```\n\nYAML parsing:\n\n```\nrecipes\u002F_dist_utils.py\n    parse_distributed_section()  -- YAML dict -> typed configs + sizes\n    create_distributed_setup_from_config()  -- recipe adapter: parse + create DistributedSetup; does not init process group\n```\n\nMoE config:\n\n```\ncomponents\u002Fdistributed\u002Fconfig.py\n    MoEParallelizerConfig  -- reshard_after_forward, ignore_router_for_ac, wrap_outer_model, etc.\ncomponents\u002Fmoe\u002Fconfig.py\n    MoEConfig              -- n_routed_experts, n_activated_experts, score_func, etc.\n```\n\n## Pitfalls\n\n1. **TP across nodes destroys throughput.** Always keep TP within a single\n   NVLink domain. Use PP or DP for cross-node scaling.\n\n2. **PP requires `_pp_plan` on the model class.** Not all HF models have this.\n   Check `validate_hf_model_for_pipeline_support()` before enabling PP.\n\n3. **PP bubbles reduce GPU utilization.** Use interleaved schedules\n   (`interleaved_1f1b`) and smaller microbatches to reduce bubble time.\n\n4. **FSDP2 requires DTensor-aware state dict saving.** Use `safetensors` with\n   `save_consolidated: final` for final HF export, or `save_consolidated: false`\n   plus the generated `model\u002Fconsolidate.sh` helper for offline export.\n\n5. **CP requires compatible attention.** SDPA (Flash Attention or Efficient\n   Attention) or TE attention only. `SDPBackend.MATH` is not compatible with\n   DTensor.\n\n6. **MoE EP size must evenly divide `dp_size * cp_size`.** The device mesh\n   creation asserts `dp_cp_size % ep_size == 0`.\n\n7. **MegatronFSDP is more limited than FSDP2.** It does not support PP\n   (`pp_size > 1`), EP (`ep_size > 1`), or `sequence_parallel`. The\n   `MeshContext` validation raises on these combinations.\n\n8. **DDP supports nothing beyond data parallelism.** No TP, PP, CP, EP, or\n   HSDP. Validation raises on any of these.\n\n9. **Activation checkpointing increases compute.** It saves memory by\n   recomputing activations during backward, but adds ~30% compute overhead.\n\n10. **Mixed precision policy must match model expectations.** The default\n    bfloat16 policy works for most models. FP16 models may need a custom\n    `MixedPrecisionPolicy`.\n\n11. **`packed_sequence_size` must be divisible by `cp_size`** when using CP\n    with packed sequences.\n\n12. **`dp_replicate_size` is FSDP2-only.** Passing it with `megatron_fsdp`\n    or `ddp` raises a `ValueError`.\n\n## Verification\n\nRun the smallest recipe that exercises the requested strategy. Success means\nexit code 0, finite loss, no NCCL timeout, and log output matching the expected\nTP\u002FPP\u002FCP\u002FEP sizes.\n",{"name":5,"license":15,"metadata":24,"description":7,"when_to_use":29},{"tags":25,"author":28},[26,27],"nemo-automodel","distributed-training","NVIDIA","Adding or modifying distributed training strategies (FSDP2, HSDP, DDP), debugging multi-GPU or multi-node failures, configuring context or tensor parallelism, or tuning sharding settings.","main","be3de0244dc1a57e323d8160787ebb40fb64930e","public\u002Fapi\u002Fskills\u002Fnvidia\u002Fnemo-automodel-distributed-training","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add Solizardking\u002Fskillhub-main --skill nemo-automodel-distributed-training",{"tool":45,"command":46},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill nemo-automodel-distributed-training",{"tool":48,"command":49},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill nemo-automodel-distributed-training","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fnvidia\u002Fnemo-automodel-distributed-training\u002FSKILL.md",true,[53,59,63,67],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"BENCHMARK.md","REFERENCE","参考文档",3738,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fnvidia\u002Fnemo-automodel-distributed-training\u002FBENCHMARK.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"metadata.json",404,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fnvidia\u002Fnemo-automodel-distributed-training\u002Fmetadata.json",{"path":64,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":65,"sourceHtmlUrl":66},"skill-card.md",4111,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fnvidia\u002Fnemo-automodel-distributed-training\u002Fskill-card.md",{"path":68,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":69,"sourceHtmlUrl":70},"verification.json",1408,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fpublic\u002Fapi\u002Fskills\u002Fnvidia\u002Fnemo-automodel-distributed-training\u002Fverification.json",[72,80,87,94,101,109],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":105,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":76,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]