Graphsignal
graphsignal/graphsignal
Profile AI inference workloads (vLLM, SGLang, TensorRT-LLM, PyTorch, any GPU application) with the Graphsignal profiler and read the results from its local /signals JSON endpoint.
Guides moving Megatron Core GPTModel checkpoints, configs, training commands and launch scripts to HybridModel, following the repository's migration document.
$ npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install NVIDIA/Megatron-LM mcore-migrate-gpt-to-hybrid --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mcore-migrate-gpt-to-hybrid .claude/skills/mcore-migrate-gpt-to-hybrid && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "mcore-migrate-gpt-to-hybrid" agent skill from https://github.com/NVIDIA/Megatron-LM/tree/main/skills/mcore-migrate-gpt-to-hybrid into .claude/skills/mcore-migrate-gpt-to-hybrid/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcore-migrate-gpt-to-hybrid", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/NVIDIA/Megatron-LM/tree/main/skills/mcore-migrate-gpt-to-hybridType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install NVIDIA/Megatron-LM mcore-migrate-gpt-to-hybrid --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/mcore-migrate-gpt-to-hybrid .agents/skills/mcore-migrate-gpt-to-hybrid && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "mcore-migrate-gpt-to-hybrid" agent skill from https://github.com/NVIDIA/Megatron-LM/tree/main/skills/mcore-migrate-gpt-to-hybrid into .agents/skills/mcore-migrate-gpt-to-hybrid/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcore-migrate-gpt-to-hybrid", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install NVIDIA/Megatron-LM mcore-migrate-gpt-to-hybrid --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/mcore-migrate-gpt-to-hybrid .cursor/skills/mcore-migrate-gpt-to-hybrid && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "mcore-migrate-gpt-to-hybrid" agent skill from https://github.com/NVIDIA/Megatron-LM/tree/main/skills/mcore-migrate-gpt-to-hybrid into .cursor/skills/mcore-migrate-gpt-to-hybrid/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcore-migrate-gpt-to-hybrid", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/NVIDIA/Megatron-LM.git --path skills/mcore-migrate-gpt-to-hybrid--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install NVIDIA/Megatron-LM mcore-migrate-gpt-to-hybrid --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/mcore-migrate-gpt-to-hybrid .gemini/skills/mcore-migrate-gpt-to-hybrid && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "mcore-migrate-gpt-to-hybrid" agent skill from https://github.com/NVIDIA/Megatron-LM/tree/main/skills/mcore-migrate-gpt-to-hybrid into .gemini/skills/mcore-migrate-gpt-to-hybrid/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcore-migrate-gpt-to-hybrid", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install NVIDIA/Megatron-LM mcore-migrate-gpt-to-hybridInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/mcore-migrate-gpt-to-hybrid .github/skills/mcore-migrate-gpt-to-hybrid && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "mcore-migrate-gpt-to-hybrid" agent skill from https://github.com/NVIDIA/Megatron-LM/tree/main/skills/mcore-migrate-gpt-to-hybrid into .github/skills/mcore-migrate-gpt-to-hybrid/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcore-migrate-gpt-to-hybrid", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install NVIDIA/Megatron-LM mcore-migrate-gpt-to-hybrid --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/mcore-migrate-gpt-to-hybrid .opencode/skills/mcore-migrate-gpt-to-hybrid && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "mcore-migrate-gpt-to-hybrid" agent skill from https://github.com/NVIDIA/Megatron-LM/tree/main/skills/mcore-migrate-gpt-to-hybrid into .opencode/skills/mcore-migrate-gpt-to-hybrid/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "mcore-migrate-gpt-to-hybrid", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
mcore-migrate-gpt-to-hybridGuides moving Megatron Core GPTModel checkpoints, configs, training commands and launch scripts to HybridModel, following the repository's migration document.
This skill covers migrating a Megatron Core GPTModel setup to HybridModel: checkpoints, model providers, training commands and layer mappings. It treats docs/user-guide/hybrid-model-migration.md in the repository as the canonical source, tells the agent to read it completely before answering, planning, editing, converting or training, and keeps migration behavior in that document rather than duplicating it. The skill adds only the mechanical procedure for editing an existing pretrain_gpt.py launch script and the shell hazards that come with it.
The workflow starts by collecting the task artifact (checkpoint metadata, config, training command, conversion log, diff or failure output), follows only the relevant document sections without inventing an unsupported path or silently changing the target architecture, validates in proportion, and reports with a link to the document. Launch script edits swap pretrain_gpt.py for pretrain_hybrid.py, generate the layer pattern with a shell snippet instead of typing it by hand, since a 96-layer model needs a 192-character pattern, replace --num-layers with --hybrid-layer-pattern, because a stale value only warns while being silently overridden, and add the stack spec in place of any GPT spec.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit a3e1f82. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Megatron GPT to Hybrid Migration loads about 1.6k tokens when it runs. Until then it costs about 173 tokens; SKILL.md has 583 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from NVIDIA/Megatron-LM at commit a3e1f82, republished under its Apache-2.0 licence (© NVIDIA). 583 words, ~1,636 tokens.
.claude/skills/mcore-migrate-gpt-to-hybrid/SKILL.md (or your agent's skills folder).docs/user-guide/hybrid-model-migration.md.The canonical document specifies what the migrated command must contain. This section covers how to edit a working script into it without silent breakage. Apply the edits in order.
1. Entrypoint. pretrain_gpt.py → pretrain_hybrid.py. When the
entrypoint comes from a shell variable or a wrapper, follow it to the real
invocation.
2. Generate the pattern instead of typing it. A 96-layer model needs a 192-character pattern; hand-typing invites a silent off-by-one.
n=32 # source GPT layer count
blk='*-' # '*-' dense, '*E' every-layer MoE
pat=$(printf "$blk%.0s" $(seq $n))With pipeline segments (seg must divide n, and the segment count must be
divisible by --pipeline-model-parallel-size):
n=32; seg=4; per=$((n/seg))
b=$(printf "$blk%.0s" $(seq $per)); pat=$b
for ((i=1;i<seg;i++)); do pat="$pat|$b"; done3. Replace --num-layers N with --hybrid-layer-pattern. Deleting
--num-layers matters: leaving a stale value is only a warning, so it looks
healthy while being silently overridden by the pattern-derived count.
4. Add the stack spec, replacing any GPT --spec rather than adding a
second one.
5. Delete the pipeline-layout arguments the parser rejects, and repoint
--save at a new directory. See the canonical document for both lists.
Most scripts under examples/ collect arguments in arrays and expand them
unquoted:
torchrun ${DISTRIBUTED_ARGS[@]} pretrain_gpt.py ${MODEL_ARGS[@]}Unquoted ${ARR[@]} re-runs word-splitting and pathname expansion on every
element, so the pattern is globbed against the launch directory at expansion
time — single-quoting it where the array is defined does not protect it:
touch 'a-b-'; ARGS=(--hybrid-layer-pattern '*-*-')
printf '[%s]\n' ${ARGS[@]} # -> [--hybrid-layer-pattern] [a-b-] silently corrupted
printf '[%s]\n' "${ARGS[@]}" # -> [--hybrid-layer-pattern] [*-*-] correctAn unmatched glob survives intact, so this passes by luck in most working directories and fails only when some file happens to match. Store the pattern in a variable and quote that array's expansion:
HYBRID_PATTERN=$(printf '*-%.0s' $(seq $NUM_LAYERS))
MODEL_ARGS=( ... --hybrid-layer-pattern "$HYBRID_PATTERN" ... )
torchrun "${DISTRIBUTED_ARGS[@]}" pretrain_hybrid.py "${MODEL_ARGS[@]}" ...Both checks are cheap and catch the common slips:
# 1. No rejected or stale arguments survived -- must print nothing.
grep -nE -- '--(num-layers|num-layers-per-virtual-pipeline-stage|num-virtual-stages-per-pipeline-rank|pipeline-model-parallel-layout|account-for-embedding-in-pipeline-split|account-for-loss-in-pipeline-split|hybrid-override-pattern|fim-data)\b' train_hybrid.sh
# 2. Pattern shape -- attn and mlp must each equal the source GPT layer count.
p='*-*-|*-*-'
main=${p%%/*}; main=${main//|/}
attn=${main//[^\*]/}; mlp=${main//[^-E]/}; segs=${p%%/*}; segs=${segs//[^|]/}
echo "layers=${#main} attn=${#attn} mlp=${#mlp} segments=$(( ${#segs} + 1 ))"Then diff the migrated script against the original: it should contain the edits above and nothing else.
A *- or *E transfer changes the layer indexing, not the model. On a
measured 8-block dense run (2 GPUs, bf16, seq 4096, 100 iterations, identical
seed and data), pretrain_gpt.py --num-layers 8 and pretrain_hybrid.py --hybrid-layer-pattern '*-*-*-*-*-*-*-*-' produced:
HybridModel: ... layers='*-*-*-*-*-*-*-*-' (16 layers) from the allocator;Treat a systematic loss offset, a parameter-count difference, or a throughput gap beyond noise as a migration bug, not as expected behavior. Note that per-iteration wall clock early in a run is dominated by dataset-cache warmup, so compare steady-state iterations only.
If the implementation and migration guide disagree:
© NVIDIA, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/mcore-migrate-gpt-to-hybrid of NVIDIA/Megatron-LM.
Open the folder on GitHubat commit a3e1f82
Megatron GPT to Hybrid Migration next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Megatron GPT to Hybrid Migration this skillNVIDIA/Megatron-LM | 18k | — | ~1.6k | Automated safety check: Pass | Apache-2.0 | |
| Graphsignalgraphsignal/graphsignal | 257 | — | ~6.3k | Automated safety check: Pass | Apache-2.0 | |
| Megatron-Core LLM TrainingOrchestra-Research/AI-Research-SKILLs | 13k | 2 repos | ~2.4k | Automated safety check: Pass | MIT | |
| Quark Env Preflightamd/Quark | 182 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Slime Useryzlnew/infra-skills | 149 | — | ~3.2k | Automated safety check: Pass | None | |
| Hyperpod Version Checkerawslabs/agent-plugins | 916 | — | ~910 | Automated safety check: Pass | Apache-2.0 |
graphsignal/graphsignal
Profile AI inference workloads (vLLM, SGLang, TensorRT-LLM, PyTorch, any GPU application) with the Graphsignal profiler and read the results from its local /signals JSON endpoint.
Orchestra-Research/AI-Research-SKILLs
Sets up large-scale LLM training with NVIDIA Megatron-Core, choosing tensor, pipeline, data, context and expert parallelism for a given model size and GPU count.
amd/Quark
Collect and normalize environment facts (OS, Python, GPU, CUDA/ROCm, container state) before Quark installation or PTQ planning.
yzlnew/infra-skills
Guide for using SLIME (LLM post-training framework for RL Scaling).
awslabs/agent-plugins
Check and compare software component versions on SageMaker HyperPod cluster nodes - NVIDIA drivers, CUDA toolkit, cuDNN, NCCL, EFA, AWS OFI NCCL, GDRCopy, MPI, Neuron SDK (Trainium/Inferentia)…
wshobson/agents
Set up a working ML training/inference environment on NVIDIA DGX Spark (GB10, aarch64, CUDA 13).
NVIDIA/Megatron-LM
Walks an agent through working inside the Megatron-LM CI container and changing dependencies with uv, so lock files resolve the same locally and in CI.
NVIDIA/Megatron-LM
Moves Megatron-LM CI to a newer NVIDIA PyTorch base image, updating both the GitHub and GitLab pins together and handling the CI follow-up.
NVIDIA/Megatron-LM
Explains Megatron-LM's CI pipeline, PR scope labels, triggering the internal GitLab CI with a dry run first, and investigating CI failures.
NVIDIA/Megatron-LM
Investigates a failing GitHub Actions run or job for Megatron-LM, finds the root cause plus the PR and test author involved, and files a structured bug issue.
NVIDIA/Megatron-LM
Creates one-node GitHub merge-request variants of existing two-node GB200 functional tests in Megatron-LM, adjusting parallelism settings to fit four GPUs.
NVIDIA/Megatron-LM
Shows how to launch distributed Megatron-LM training on a SLURM cluster: sbatch skeleton, torch.distributed.run setup, CUDA_DEVICE_MAX_CONNECTIONS rules and failure diagnosis.
Works with
Categories
Guides moving Megatron Core GPTModel checkpoints, configs, training commands and launch scripts to HybridModel, following the repository's migration document. This skill covers migrating a Megatron Core GPTModel setup to HybridModel: checkpoints, model providers, training commands and layer mappings.md in the repository as the canonical source, tells the agent to read it completely before answering, planning, editing, converting or training, and keeps migration behavior in that document rather than duplicating it.
Megatron GPT to Hybrid Migration fits situations like: converting a GPTModel checkpoint or provider to HybridModel; editing a pretrain_gpt.py launch script into its hybrid equivalent; mapping GPT layers to a hybrid layer pattern for dense or MoE blocks; debugging a migrated training command that behaves unexpectedly.
Run `npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a claude-code`. Or copy the skill folder (skills/mcore-migrate-gpt-to-hybrid in NVIDIA/Megatron-LM) into .claude/skills/mcore-migrate-gpt-to-hybrid in your project. Claude Code loads it when a task matches its description.
Run `npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a codex`. Or copy the skill folder (skills/mcore-migrate-gpt-to-hybrid in NVIDIA/Megatron-LM) into .agents/skills/mcore-migrate-gpt-to-hybrid in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NVIDIA/Megatron-LM --skill mcore-migrate-gpt-to-hybrid -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcore-migrate-gpt-to-hybrid, .gemini/skills/mcore-migrate-gpt-to-hybrid, .github/skills/mcore-migrate-gpt-to-hybrid and .opencode/skills/mcore-migrate-gpt-to-hybrid in your project.
SKILL.md names no scripts, command-line tools or credentials: Megatron GPT to Hybrid Migration is instructions for the agent only. Our summary lists: A Megatron-LM checkout that includes docs/user-guide/hybrid-model-migration.md.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Megatron GPT to Hybrid Migration is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Megatron GPT to Hybrid Migration: Graphsignal (graphsignal/graphsignal, 257 stars), Megatron-Core LLM Training (Orchestra-Research/AI-Research-SKILLs, 13k stars), Quark Env Preflight (amd/Quark, 182 stars) and Slime User (yzlnew/infra-skills, 149 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
NVIDIA (a GitHub organization, an official publisher) maintains it in NVIDIA/Megatron-LM, which has 18,112 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 11, 2026.
Source: NVIDIA/Megatron-LM on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.