nemo-mbridge-perf-cuda-graphs

nemo-mbridge-perf-cuda-graphs is a skill for Claude Code from NVIDIA-NeMo/Megatron-Bridge. It costs 57 tokens per session (3,737 once invoked), scanned C, a copy of nemo-mbridge-perf-cuda-graphs, Apache-2.0.

A guide for capturing GPU work in CUDA graphs so it can be replayed with less CPU-side launch overhead in Megatron Bridge, a system for training large language models.

In plain words
What is it for?
Use it to profile workloads, test full-iteration or selected Transformer Engine graphs, verify replay timings, and investigate regressions or failures.
Why use it?
It helps determine whether CUDA graphs improve performance and provides checks for comparing them with normal execution.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is uv run python scripts/performance/run_script.py \.

Good fit Use it to profile workloads, test full-iteration or selected Transformer Engine graphs, verify replay timings, and investigate regressions or failures.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/NVIDIA-NeMo/Megatron-Bridge
agentmods
npx agentmods add skills/nvidia-nemo/megatron-bridge/nemo-mbridge-perf-cuda-graphs

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nemo-mbridge-perf-cuda-graphs

README.md
[![agentmods](https://agentmods.dev/badge/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-perf-cuda-graphs/github.svg)](https://agentmods.dev/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-perf-cuda-graphs)
Your own site
<a href="https://agentmods.dev/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-perf-cuda-graphs"><img src="https://agentmods.dev/badge/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-perf-cuda-graphs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nemo-mbridge-perf-cuda-graphs

Your own site · 80×15
<a href="https://agentmods.dev/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-perf-cuda-graphs"><img src="https://agentmods.dev/badge/skills/nvidia-nemo/megatron-bridge/nemo-mbridge-perf-cuda-graphs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,737 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 13
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • medium Agent Snooping · line 316
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.03737
Opus 5 $0.00028 $0.01869
Sonnet 5 $0.00011 $0.00747
Haiku 4.5 $0.00006 $0.00374

Measured 12d ago against content hash 3eb297f3d421, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade C, and why

nemo-mbridge-perf-cuda-graphs scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- NVSkills CI refresh: 2026-06-15. No instruction changes. -->
Origin

This is a copy

91% identical to nemo-mbridge-perf-cuda-graphs — 24 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/nemo-mbridge-perf-cuda-graphs/SKILL.md · 359 lines

How it starts

The opening of the file, as written. The whole thing — 359 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CUDA Graphs

Stable documentation: @docs/training/cuda-graphs.md Card: @skills/nemo-mbridge-perf-cuda-graphs/card.yaml

What It Is

CUDA graphs capture GPU operations once and replay them with minimal host-driver overhead. Bridge supports two implementations:

cuda_graph_impl Mechanism Scope support
"local" MCore FullCudaGraphWrapper wrapping entire fwd+bwd full_iteration
"transformer_engine" TE make_graphed_callables() per layer attn, mlp, moe, moe_router, moe_preprocess, mamba

Quick Decision

First confirm a profile shows material host/launch gaps. Then test the narrowest TE-scoped graph candidate and verify replay timing against eager on the same dispatcher, layout, routing, precision, and container:

  • dense models: attn, then optionally mlp
  • dropless MoE: moe_router moe_preprocess, then optionally attn
  • VLMs: the same dropless-MoE scope, but only after the real-data path is stable

Use local + full_iteration only when you specifically want full-iteration capture and can satisfy the tighter constraints.

For recompute-heavy workloads:

  • TE-scoped graphs pair naturally with selective recompute
  • full recompute usually pushes you toward local full-iteration graphs or away from graphs entirely

Related docs:

  • @docs/training/cuda-graphs.md
  • @docs/training/activation-recomputation.md

Enablement

Local full-iteration graph

cfg.model.cuda_graph_impl = "local"
cfg.model.cuda_graph_scope = ["full_iteration"]
cfg.model.cuda_graph_warmup_steps = 3
cfg.model.use_te_rng_tracker = True
cfg.rng.te_rng_tracker = True
cfg.rerun_state_machine.check_for_nan_in_loss = False
cfg.ddp.check_for_nan_in_grad = False

TE scoped graph (dense model)

cfg.model.cuda_graph_impl = "transformer_engine"
cfg.model.cuda_graph_scope = ["attn"]           # or ["attn", "mlp"]
cfg.model.cuda_graph_warmup_steps = 3
cfg.model.use_te_rng_tracker = True
cfg.rng.te_rng_tracker = True

Read the full file on GitHub · 359 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 359 lines · 57 tokens per session scan C 3eb297f3d421

Subscribe to this mod's changes

nemo-mbridge-perf-cuda-graphs is a skill published in the GitHub repository NVIDIA-NeMo/Megatron-Bridge (906 stars, last pushed today), licensed Apache-2.0. It adds 57 tokens to every session and 3,737 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). It is 91% identical to nemo-mbridge-perf-cuda-graphs, differing in 24 lines, and is treated as a copy.

Related

Other skills, from other repositories

spark-optimization

Optimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or scaling data processing pipelines.

wshobson/agents · 37 tokens

notebooklm

Install, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API.…

teng-lin/notebooklm-py · 79 tokens

debug-inference

Debug inference clients that use an attached provider and its native endpoint, including hosted APIs and host-local Ollama, vLLM, SGLang, TRT-LLM, LM Studio, or NIM. Use for provider attachment, endpoint policy, credential substitution, topology, and migration from the removed inference.local endpoint. Trigger…

NVIDIA/OpenShell · 119 tokens

oh-my-posh

Install, configure, or troubleshoot Oh My Posh/ohmyposh: shell init, themes, segments, Nerd Font icons, and prompt setup on PowerShell, zsh, bash, or fish.

JanDeDobbeleer/oh-my-posh · 47 tokens

eagle3-triage

Triage a failed EAGLE3 pipeline run. Identifies which step failed (data synthesis, hidden state dump, training, or benchmark), diagnoses root cause from logs, and suggests fixes. Use when user reports an EAGLE3 pipeline failure or asks why a specific step failed. Also helps debug new model support issues.

NVIDIA/Model-Optimizer · 73 tokens

trulens-instrumentation

Instrument LLM apps with TruLens OTEL-based tracing - from setup to debugging and optimization.

truera/trulens · 25 tokens