L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Productivité · SKILL.md

core-models-and-parallelism

core-models-and-parallelism

Use Megatron Core model APIs, process groups, and parallelism/FSDP choices safely.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: core-models-and-parallelism description: "Use Megatron Core model APIs, process groups, and parallelism/FSDP choices safely." metadata: disco-role: operating disable-model-invocation: true license: NOASSERTION

core-models-and-parallelism

Use this sub-skill when the user is constructing Megatron Core modules, choosing TP/PP/CP/EP/DP/FSDP layouts, reviewing model-provider code, or diagnosing model-parallel/process-group errors.

Read first

Route by task

TaskRoute
Build a tiny GPT/Hybrid model or inspect TransformerConfigUse references/api-reference.md.
Select parallel sizes for a training jobUse references/parallelism-reference.md, then hand launch details to ../training-cli-and-data/SKILL.md.
Diagnose TP/PP/CP/EP/FSDP shape errorsStart with references/troubleshooting.md.
Convert GPTModel checkpoints or migrate to HybridModelRoute to ../checkpointing-and-conversion/SKILL.md.
Use high-level dynamic inference APIsRoute to ../inference-and-serving/SKILL.md.

Core workflow

  1. Pull the user's artifact first: model-provider function, config dataclass, parallel sizes, training command, traceback, or checkpoint metadata.

  2. Determine whether the task is a library API task or a Megatron-LM training entrypoint task.

  3. Check the total topology:

    total GPUs = TP × PP × CP × DP
    MoE adds EP constraints; expert/data dimensions must still be compatible.
    
  4. Validate divisibility: hidden size and attention heads with TP, layer counts with PP/layout, sequence length with CP, experts with EP/ETP.

  5. Check backend constraints before recommending flags. For example, CUDA_DEVICE_MAX_CONNECTIONS=1 helps some pre-Blackwell TP/CP non-FSDP paths but is wrong for FSDP and expert-overlap cases.

  6. If the answer becomes a launch command, cross-link to training-cli-and-data so data/checkpoint/logging details are handled there.

Key facts

  • GPTModel remains available but emits a deprecation warning: new architecture work should consider HybridModel and the migration route.
  • Current GPTModel construction requires a TransformerConfig, a layer ModuleSpec, vocab_size, and max_sequence_length.
  • TransformerConfig extends model-parallel configuration; many constructor fields control TP/PP/CP/EP/FSDP as well as transformer architecture.
  • Prefer passing explicit process groups or ProcessGroupCollection through library code rather than adding new direct global process-group reads in megatron/core production code.

Boundaries

This sub-skill owns model/core API and topology reasoning. It does not own data preprocessing, command-line launch assembly, checkpoint conversion, or CI test selection.

Skills enregistrées