界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

checkpointing-and-conversion

checkpointing-and-conversion

【效率与协作】Work with Megatron distributed checkpoints, safe loading, resharding, and GPT-Hybrid conversion.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: checkpointing-and-conversion description: "Work with Megatron distributed checkpoints, safe loading, resharding, and GPT-Hybrid conversion." metadata: disco-role: operating disable-model-invocation: true license: NOASSERTION

checkpointing-and-conversion

Use this sub-skill when the task involves Megatron checkpoint formats, save/load/resume behavior, optimizer state compatibility, distributed checkpoint resharding, PyTorch safe loading, or GPTModel ↔ HybridModel conversion.

Read first

Route by task

TaskAction
Resume training from a checkpointConfirm --load, --save, --ckpt-format, optimizer load flags, and parallelism compatibility.
Change TP/PP/EP/FSDP layoutPrefer distributed checkpoint formats and, for optimizer resharding, fully-reshardable optimizer state.
PyTorch 2.6 unsafe global errorKeep safe loading; allow-list only the required class or use the repo's safe globals guidance.
GPTModel to HybridModel migrationChoose load-time translation or offline converter; validate --hybrid-layer-pattern.
HF ↔ Megatron conversionTreat Megatron Bridge/HF conversion as an external workflow with mounts, tokens, and model-specific scripts.

Checkpoint workflow

  1. Pull checkpoint metadata first: format, root directory shape, tracker file, model args, parallel sizes, optimizer state format, and target run command.
  2. Decide whether the user needs weights-only load, full resume, finetune semantics, or format conversion.
  3. If changing parallelism, confirm the checkpoint format and optimizer state format support that change.
  4. If migrating GPT to Hybrid, validate the layer pattern before running any conversion.
  5. After any conversion or resume, run a bounded smoke before launching full training.

Boundaries

我的收藏