Official agent skill

Megatron-LM CI/CD Guide

by NVIDIA in 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.

OfficialApache-2.0Auto-check passedDevOps & Cloud

Install Megatron-LM CI/CD Guide

skills CLI
$ npx skills add NVIDIA/Megatron-LM --skill mcore-cicd -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NVIDIA/Megatron-LM mcore-cicd --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NVIDIA/Megatron-LM.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/mcore-cicd .claude/skills/mcore-cicd && rm -rf skills-src

Use ~/.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/

Facts

Skill name
mcore-cicd
GitHub stars
18k
Token cost
~1.8k tokens
SKILL.md length
545 words
Files
5
Skills in repo
14
Repo updated
First seen
Licence
Apache-2.0

At a glance

Explains Megatron-LM's CI pipeline, PR scope labels, triggering the internal GitLab CI with a dry run first, and investigating CI failures.

  • Works in 5 steps: Linting failure — re-run… → Container build failure — inspect the… → Unit test failure — the failing bucket… → …
  • Choosing PR labels to set the CI test scope in Megatron-LM
  • SKILL.md covers Answer-First CI Facts, CI Pipeline Structure, CI Test Scope Labels and Triggering Internal CI, plus 1 more section
  • Calls gh, python and git; needs GITLAB_TOKEN

What it does

This is a CI/CD reference for the Megatron-LM repository. It leads with exact values for label questions: with no label the pipeline uses the slim scope with 2 repeats and no lightweight mode, container::lts only switches the image to the older long-term-support base and is opt-in, and extra labels trigger the MBridge L1 suite or NeMo RL's Megatron functional tests. A decision tree maps labels to scope, repeat count and image.

The main workflow, cicd-main.yml, runs on pushes to pull-request and deploy-release branches, on merge groups and on manual dispatch, passing through preflight and configure stages. The skill carries a warning: tools/trigger_internal_ci.py force-pushes the current branch to the internal GitLab remote as a pull-request ref, so always run it with --dry-run first, confirm the destination and never target a shared or protected branch. It also covers investigating CI failures.

When your agent uses it

  • Choosing PR labels to set the CI test scope in Megatron-LM
  • Triggering the internal GitLab CI safely for a branch
  • Investigating why a CI run failed

Example prompts

  • “Which labels do I need so my PR also runs the MBridge tests?”
  • “Do a dry run of triggering the internal CI for my branch and show me the destination ref.”
  • “Why did the cicd-main workflow fail on my pull request?”

Requirements

  • A Megatron-LM checkout
  • Access to the internal GitLab remote for triggering CI

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Linting failure — re-run tools/autoformat.sh locally; the diff shows exactly what needs to change.
  2. Container build failure — inspect the cicd-container-build job log.
  3. Unit test failure — the failing bucket is in the cicd-unit-tests-latest job matrix.
  4. Functional test failure — look at the cicd-integration-tests-* job. Start with stdout.log for rank 0.
  5. Flaky test — the runner retries automatically up to 3 times. If all retries exhausted and the pattern matches a known transient (NCCL…

What it can do on your machine

Read from SKILL.md and the folder at commit 486a126. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • gh
    • python
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GITLAB_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Megatron-LM CI/CD Guide loads about 1.8k tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 545 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from NVIDIA/Megatron-LM at commit 486a126, republished under its Apache-2.0 licence (© NVIDIA). 545 words, ~1,754 tokens.

Download SKILL.mdSave it as .claude/skills/mcore-cicd/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
mcore-cicd
description
CI/CD reference for Megatron-LM. Covers CI pipeline structure, PR scope labels, triggering internal GitLab CI (which force-pushes the current branch to a pull-request/BRANCH ref — always dry-run and verify the destination first; never run against shared or protected branches), and CI failure investigation.
license
Apache-2.0
when_to_use
Investigating a CI failure; understanding the pipeline structure; which CI label to attach; triggering internal GitLab CI; 'CI is red', 'how do I trigger CI'…
metadata.author
Oliver Koenig <okoenig@nvidia.com>

CI/CD Guide


Answer-First CI Facts

For PR-label or trigger questions, lead with the exact values:

  • No label: scope=mr-github-slim, n_repeat=2, lightweight=false.
  • container::lts only switches the container image path to LTS and combines with any scope label. Opt-in only — attach it solely when the user explicitly asks for LTS validation; never add it on your own initiative, even for a container or dependency change.
  • Run MBridge tests additionally triggers the MBridge L1 suite.
  • Run NeMoRL tests additionally triggers NeMo RL's Megatron functional test suite.
  • ⚠️ WARNING — destructive remote write. tools/trigger_internal_ci.py force-pushes the current branch to the internal GitLab remote as pull-request/<branch>. Always run with --dry-run first and confirm the destination ref before invoking it without the flag. Never run against a shared or protected branch — only target your own pull-request branch. Safe preflight: python tools/trigger_internal_ci.py --gitlab-origin gitlab --dry-run. Add the optional --functional-test-* flags only after the dry-run output matches the intended destination.

CI Pipeline Structure

The main workflow is .github/workflows/cicd-main.yml. It triggers on pushes to branches matching pull-request/[0-9]+ and deploy-release/*, on merge groups, and on manual dispatch.

text
is-not-external-contributor
  └─ pre-flight
       └─ configure          # determines scope, container tag, n_repeat
            ├─ linting
            ├─ cicd-container-build
            │    ├─ cicd-parse-unit-tests → cicd-unit-tests-latest
            │    ├─ cicd-parse-integration-tests-h100 → cicd-integration-tests-latest-h100
            │    └─ cicd-parse-integration-tests-gb200 → cicd-integration-tests-latest-gb200 (maintainers only)
            └─ Nemo_CICD_Test  # final pass/fail gate

Images are pushed to:

  • AWS ECR: 766267172432.dkr.ecr.us-east-1.amazonaws.com/…
  • GCP Artifact Registry: us-east4-docker.pkg.dev/nv-projdgxchipp-20260113193621/megatron-lm/…

CI Test Scope Labels

The CI pipeline reads PR labels to decide test scope, n_repeat, and container image.

Decision tree (first match wins):

Conditionscopen_repeatlightweightNotes
Merge groupmr-github1falseAutomatic, no label needed
(no label)mr-github-slim2falseSlim subset only

Orthogonal image label:

LabelEffect
container::ltsBuild on the older long-term-support NGC PyTorch base instead of dev's latest — a backward-compat check, not a different test set (combinable with any scope label)
Run MBridge testsAlso triggers the MBridge L1 test suite
Run NeMoRL testsAlso triggers NeMo RL's Megatron functional test suite

Adding a label does not itself start cicd-main.yml; apply it before the next synthetic PR push or rerun the workflow after applying it.

Show full SKILL.md (240 more words)Show less
Which label to attach when opening a PR
Changed paths / nature of changeLabel to attach
Docs only (docs/, *.md, docstrings)(none)
CI/tooling only (.github/, tools/, Makefile)(none)
Touches MBridge integrationadd Run MBridge tests
Could affect NeMo RL's Megatron integrationadd Run NeMoRL tests

Triggering Internal CI

Use tools/trigger_internal_ci.py after the internal GitLab remote and GITLAB_TOKEN are configured; see @tools/trigger_internal_ci.md for setup details. First run a dry run and verify the destination ref:

bash
python tools/trigger_internal_ci.py --gitlab-origin gitlab --dry-run

The script force-pushes the current branch to pull-request/<branch> before triggering the pipeline. Only target your own pull-request branch, never a shared or protected branch. Add optional --functional-test-* flags only after the dry-run output matches the intended destination.


CI Failure Investigation

CI branches always follow the pattern pull-request/<number>.

Locating the PR from a CI Branch
bash
# Extract PR number from the current branch
PR_NUMBER=$(git rev-parse --abbrev-ref HEAD | grep -oP '(?<=pull-request/)\d+')

# Fetch the PR metadata (title, labels, author, base branch)
gh pr view "$PR_NUMBER" --repo NVIDIA/Megatron-LM

# Show the changeset for that PR
gh pr diff "$PR_NUMBER" --repo NVIDIA/Megatron-LM
Reading CI Job Logs
bash
# List recent workflow runs for the PR
gh run list --repo NVIDIA/Megatron-LM --branch "pull-request/$PR_NUMBER"

# Stream failing job output
gh run view <run-id> --repo NVIDIA/Megatron-LM --log-failed

Full per-rank logs are not in the runner stdout. They are uploaded as GitHub artifacts named logs-<test_case>-<run_id>-<uuid>.

bash
# 1. Find artifact name
gh run view <run-id> --repo NVIDIA/Megatron-LM --json artifacts \
  --jq '.artifacts[].name'

# 2. Download the artifact zip
gh run download <run-id> --repo NVIDIA/Megatron-LM \
  --name "logs-<artifact-name>" -D ./ci-logs

# 3. Locate which rank logs contain errors
grep -r -l "ERROR\|Traceback\|FAILED\|fatal" ./ci-logs/

# 4. Log files can exceed 10 000 lines — never read a full log at once.
wc -l ./ci-logs/<test>/<attempt>/attempt_0/<rank>/stderr.log
sed -n '1,200p' ./ci-logs/.../stderr.log   # read in chunks
Identifying Failure Root Cause
  1. Linting failure — re-run tools/autoformat.sh locally; the diff shows exactly what needs to change.
  2. Container build failure — inspect the cicd-container-build job log.
  3. Unit test failure — the failing bucket is in the cicd-unit-tests-latest job matrix.
  4. Functional test failure — look at the cicd-integration-tests-* job. Start with stdout.log for rank 0.
  5. Flaky test — the runner retries automatically up to 3 times. If all retries exhausted and the pattern matches a known transient (NCCL, ECC, segfault), it is infrastructure noise.
Correlating a Failure with the PR Changeset
bash
# Find unit tests that cover a changed source file
grep -r "from megatron.core.transformer.attention" tests/unit_tests/ -l

# Check CODEOWNERS for reviewer assignment
cat .github/CODEOWNERS | grep "<changed-path>"

© 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

Files

SKILL.md and 4 other files in skills/mcore-cicd of NVIDIA/Megatron-LM.

  • SKILL.md
  • BENCHMARK.md
  • evals/evals.json
  • skill-card.md
  • skill.oms.sig

Open the folder on GitHubat commit 486a126

Compare with similar skills

Megatron-LM CI/CD Guide 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.

Megatron-LM CI/CD Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Megatron-LM CI/CD Guide this skillNVIDIA/Megatron-LM18k—~1.8kAutomated safety check: PassApache-2.0
Azure Pipelines Log Downloaderansible/ansible71k—~825Automated safety check: PassGPL-3.0
ONNX Runtime CI Managementmicrosoft/onnxruntime22k—~4.1kAutomated safety check: PassMIT
CI Watchdoglatitude-dev/latitude-llm4.7k—~1.6kAutomated safety check: PassMIT
Migrate To TeamcityJetBrains/teamcity-cli125—~1.3kAutomated safety check: PassApache-2.0
CI/CD Failure Troubleshootingruby-git/ruby-git1.8k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Downloads Azure Pipelines CI logs for an Ansible pull request or build so the agent can analyze test failures, after asking you first.

    71k GitHub stars~825 tokensUpdated today
    DevOps & CloudAuto-check passed
  • ONNX Runtime CI Management

    microsoft/onnxruntime

    Official

    Triggers, re-runs and unblocks the CI checks on an ONNX Runtime pull request, after diagnosing whether a failure is transient or needs a code change.

    22k GitHub stars~4.1k tokensUpdated today
    DevOps & CloudAuto-check passed
  • CI Watchdog

    latitude-dev/latitude-llm

    Continuously monitor GitHub PR CI checks and automatically fix failures until all checks pass.

    4.7k GitHub stars~1.6k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Migrate To Teamcity

    JetBrains/teamcity-cli

    Official

    Migrating CI/CD pipelines to TeamCity. An agent skill from JetBrains/teamcity-cli.

    125 GitHub stars~1.3k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Diagnoses and fixes failing GitHub Actions runs by identifying the failure, fetching only the relevant logs, finding the root cause and reproducing it locally.

    1.8k GitHub stars~1.9k tokensUpdated 5 days ago
    DevOps & CloudAuto-check passed
  • CI CD

    EliasOulkadi/shokunin

    Design CI/CD pipelines for GitHub Actions, GitLab CI, and CircleCI with matrix builds, test sharding, caching, Docker layer caching, OIDC auth, deployment strategies (rolling, blue-green, canary)…

    114 GitHub stars~3.4k tokensUpdated 2 days ago
    DevOps & CloudAuto-check: notes

More from NVIDIA/Megatron-LM

All 14 skills in this repo
  • Official

    Refreshes stored golden values from a GitHub Actions run, reports signed percentage changes per model, and writes a summary ready for a pull request description.

    18k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Official

    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.

    18k GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Megatron-LM Base Image Bump

    NVIDIA/Megatron-LM

    Official

    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.

    18k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Official

    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.

    18k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Official

    Guides moving Megatron Core GPTModel checkpoints, configs, training commands and launch scripts to HybridModel, following the repository's migration document.

    18k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Official

    Creates one-node GitHub merge-request variants of existing two-node GB200 functional tests in Megatron-LM, adjusting parallelism settings to fit four GPUs.

    18k GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Megatron-LM CI/CD Guide

What does Megatron-LM CI/CD Guide do?

Explains Megatron-LM's CI pipeline, PR scope labels, triggering the internal GitLab CI with a dry run first, and investigating CI failures. This is a CI/CD reference for the Megatron-LM repository. It leads with exact values for label questions: with no label the pipeline uses the slim scope with 2 repeats and no lightweight mode, container::lts only switches the image to the older long-term-support base and is opt-in, and extra labels trigger the MBridge L1 suite or NeMo RL's Megatron functional tests.

When should I use Megatron-LM CI/CD Guide?

Megatron-LM CI/CD Guide fits situations like: choosing PR labels to set the CI test scope in Megatron-LM; triggering the internal GitLab CI safely for a branch; investigating why a CI run failed.

How do I install Megatron-LM CI/CD Guide in Claude Code?

Run `npx skills add NVIDIA/Megatron-LM --skill mcore-cicd -a claude-code`. Or copy the skill folder (skills/mcore-cicd in NVIDIA/Megatron-LM) into .claude/skills/mcore-cicd in your project. Claude Code loads it when a task matches its description.

How do I install Megatron-LM CI/CD Guide in Codex?

Run `npx skills add NVIDIA/Megatron-LM --skill mcore-cicd -a codex`. Or copy the skill folder (skills/mcore-cicd in NVIDIA/Megatron-LM) into .agents/skills/mcore-cicd in your project. Codex loads it when a task matches its description.

Can I use Megatron-LM CI/CD Guide in Cursor, Gemini CLI or GitHub Copilot?

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-cicd -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-cicd, .gemini/skills/mcore-cicd, .github/skills/mcore-cicd and .opencode/skills/mcore-cicd in your project.

What does Megatron-LM CI/CD Guide need to run?

Going by SKILL.md and its folder, Megatron-LM CI/CD Guide needs the command-line tools its instructions call (gh, python and git) and credentials named GITLAB_TOKEN. Our summary lists: A Megatron-LM checkout; Access to the internal GitLab remote for triggering CI.

Does Megatron-LM CI/CD Guide access the network?

SKILL.md contains no URLs. Its commands use gh and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Megatron-LM CI/CD Guide safe to install?

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.

What licence does Megatron-LM CI/CD Guide use?

Megatron-LM CI/CD Guide 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.

How many tokens does Megatron-LM CI/CD Guide use?

About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Megatron-LM CI/CD Guide?

Skills that share tags, products or a category with Megatron-LM CI/CD Guide: Azure Pipelines Log Downloader (ansible/ansible, 71k stars), ONNX Runtime CI Management (microsoft/onnxruntime, 22k stars), CI Watchdog (latitude-dev/latitude-llm, 4.7k stars) and Migrate To Teamcity (JetBrains/teamcity-cli, 125 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Megatron-LM CI/CD Guide?

NVIDIA (a GitHub organization, an official publisher) maintains it in NVIDIA/Megatron-LM, which has 18,078 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 7, 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.