What problem does it solve?
Moving an existing Megatron Core GPTModel training setup to HybridModel involves checkpoint conversion, layer-pattern generation, and launch-script rewrites where silent failures (stale --num-layers values, glob-expanded patterns, rejected pipeline arguments) are common. This Skill provides the mechanical procedure and verification checks to perform that migration without silent breakage.
Core Features & Use Cases
- Launch Script Transfer: Step-by-step edits to convert a pretrain_gpt.py script or sbatch launcher into a pretrain_hybrid.py invocation, including entrypoint, stack spec, and argument cleanup.
- Hybrid Layer Pattern Generation: Shell snippets to programmatically build --hybrid-layer-pattern strings (dense '*-' or MoE '*E' blocks, with pipeline segments) instead of error-prone hand-typing.
- Bash Quoting Hazard Guidance: Explains how unquoted array expansion glob-corrupts layer patterns and how to quote expansions correctly.
- Verification Checks: grep and pattern-shape commands that confirm no stale arguments survived and that attention/MLP counts match the source GPT layer count.
- Use Case: You have a 32-layer GPTModel trained via pretrain_gpt.py and want to rerun it under pretrain_hybrid.py with an equivalent '*-' pattern, verifying identical parameter counts and throughput.
Quick Start
Ask the assistant to migrate your existing pretrain_gpt.py launch script to pretrain_hybrid.py with an equivalent hybrid layer pattern and verify the rewrite.