Dev & Engineering ✓ NVIDIA · Official

Megatron Bridge Activation Recompute

Trade extra compute for lower GPU activation memory in Megatron Bridge training.

59/ 100
Recommended

Generally reliable with disclosed limitations; trial as directed and keep a rollback path.

See how it was scored ↓
Works as-is in
Codex · Claude Code
Stars
★ 3.8k
Last updated
today
License
Apache-2.0
megatron-bridgeactivation-recomputegpu-memory-optimizationfp8-training
+2cuda-graphsdistributed-training

What does this skill do, and when should you use it?

This skill guides configuration, validation, and troubleshooting of selective and full-layer activation recompute in Megatron Bridge. It explains how intermediate activations are discarded during forward execution and recomputed during backward execution to reduce GPU memory usage. It covers constraints involving CUDA Graphs, FP8, sequence parallelism, pipeline parallelism, and CPU offloading. Its measured Llama3 70B example shows that MLP recompute saves about 3 GB of peak memory but reduces performance by about 16%; the actual OOM in that workload was caused by memory fragmentation.

Shows how to configure selective recompute with recompute_modules and full-layer recompute with recompute_method and recompute_num_layers; provides a performance-harness command; checks CUDA Graph, FP8, sequence-parallel, and pipeline-parallel constraints; diagnoses OOMs, throughput regressions, assertions, and CPU-offloading conflicts; and provides a recompute-focused unit-test command with success criteria.

Good fit
  • A Megatron Bridge training engineer needs to reduce peak activation memory during model training.
  • A practitioner wants to start with core_attn recompute and add modules according to their memory and throughput budget.
  • A developer is investigating an OOM, performance regression, or CUDA Graph assertion after changing recompute settings.
  • A performance engineer is evaluating selective versus full-layer recompute in an FP8 or Transformer Engine CUDA Graph configuration.
  • A user is comparing activation recompute with CPU offloading while using or avoiding pipeline parallelism.

How do you install this skill?

Before you use it
  • Treat the measured ~3 GB saving and ~16% utilization loss as workload-specific to Llama3 70B, FP8, H100, and the stated parallelism; do not generalize them.
  • Before enabling full recompute, verify CUDA-graph scope, recompute_method, and recompute_num_layers, and preserve the prior configuration for rollback.
  • The skill depends on Megatron Bridge/Megatron-Core source, external documentation, and a suitable test environment; the supplied files do not establish availability in the target environment.
  • No Chinese-language documentation or mainland-China network reachability is demonstrated.
Before you start
Your agent needs
  • Shell / CLI
  • Local filesystem
Install first
  • Python
  • uv
  • PyTorch
  • Megatron Bridge
  • Megatron-Core

Use the installation flow documented in the repository README: npx skills add nvidia/skills --skill nemo-mbridge-perf-activation-recompute --yes. The CLI prompts for an installation destination. The README does not specify a manual destination path for this individual skill.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/NVIDIA/skills.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/skills/nemo-mbridge-perf-activation-recompute" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • Configure selective activation recompute for memory pressure in Megatron Bridge and check FP8 CUDA Graph compatibility.

After the skill is loaded by an agent, use a request such as: “Configure selective activation recompute for memory pressure in Megatron Bridge and check FP8 CUDA Graph compatibility.” A typical starting configuration is cfg.model.recompute_granularity = "selective" with cfg.model.recompute_modules = ["core_attn"]; full-layer recompute also requires recompute_method and recompute_num_layers. Run performance tests with uv run python scripts/performance/run_script.py ... --recompute_modules core_attn,layernorm ... and validate configuration with uv run python -m pytest tests/unit_tests/training/test_config.py -k "recompute" -q.

What are this skill's strengths and limitations?

Pros
  • Provides concrete configuration examples for selective and full-layer recompute.
  • Documents relative compute costs and memory savings for recompute modules.
  • Covers important FP8, CUDA Graph, sequence-parallel, and pipeline-parallel constraints.
  • Includes measured performance, peak-memory data, failure symptoms, and fixes.
  • Includes a focused configuration-validation test command.
Limitations
  • Module selection is manual; there is no automatic selector.
  • Memory savings vary substantially by model architecture and hidden dimension.
  • MLP recompute can cause a substantial throughput loss; the example workload incurred about 16%.
  • Layernorm recompute is usually too small to resolve an OOM by itself.
  • The source does not document complete environment installation, a full hardware matrix, or platform-wide independent validation.

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
Megatron Bridge Activation Recompute this page ✓ NVIDIA · Official 59 · Recommended ★ 3.8k today Apache-2.0
NeMo MBridge GPU Memory Tuning ✓ NVIDIA · Official 61 · Recommended ★ 3.8k today Apache-2.0
NeMo MBridge MoE Performance Workflow ✓ NVIDIA · Official 53 · Use with care ★ 3.8k today Apache-2.0
NeMo MBridge MoE VLM Training Guide ✓ NVIDIA · Official 57 · Use with care ★ 3.8k today Apache-2.0
NeMo MBridge CUDA Graphs ✓ NVIDIA · Official 55 · Use with care ★ 3.8k today Apache-2.0

The skill explicitly compares activation recompute with CPU offloading: CPU offloading avoids recompute cost but is incompatible with PP > 1. It also recommends using PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True first to rule out allocator fragmentation.

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Recommended
59/ 100 5-point scale 3.0 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust18 / 25 · 3.6/5

The material is limited to training configuration, an environment variable, and test commands; it shows no malware, credential theft, covert exfiltration, or destructive default behavior, and it exposes compatibility constraints and recovery guidance. Points are deducted because user confirmation, rollback, data-flow and sensitive-data handling, dependency pinning, and execution isolation are not specified; attribution is mainly to internal repository anchors and does not independently substantiate every technical claim.

2Reliability9 / 20 · 2.3/5

Configuration fields, constraints, known assertions, and the failure-diagnosis table are internally consistent, with a unit-test command and intelligible failure messages. The static-review ceiling is 10; points are deducted because tests were not executed, key dependencies are not supplied by the skill, and the performance command contains ellipses, so the key path is not fully reproducible from the provided files alone.

3Adaptability11 / 15 · 3.7/5

The audience is Megatron Bridge training engineers, and triggers, use cases, selective-to-full ordering, non-fit constraints, and alternatives are fairly clear. Points are deducted because module availability varies by architecture, negative-trigger evidence and broader input boundaries are limited, Chinese-language support is absent, and mainland-China documentation reachability is not demonstrated, although the core operation appears local.

4Convention10 / 15 · 3.3/5

The skill provides a decision guide, configuration examples, compatibility rules, measured results, code anchors, troubleshooting, limitations, verification, and card metadata; the card states Apache 2.0, ownership, version, and validation information. Points are deducted for missing recommended Instructions and Examples sections, the benchmark finding missing author metadata, incomplete maintenance/change-log information, and dependencies on external documentation and repository paths not delivered with the skill.

5Effectiveness7 / 15 · 2.3/5

The skill supplies directly usable configuration snippets, an ordered remediation path, CUDA-graph workarounds, and symptom-to-fix mappings; the included single-task evaluation report shows positive correctness and effectiveness results. Static calibration limits this to 7; points are deducted because no execution was performed here and the measurements cover only a specific Llama3 70B/FP8/H100 workload, so direct applicability to other architectures and modules is unverified.

6Verifiability4 / 10 · 2.0/5

The files include source-path and line-number anchors, structured experiment conditions and results, an evaluation report, and a verification command. The static ceiling is 5; points are deducted because the evidence is primarily repository self-report plus one internal task, without independently inspectable commit contents, a complete committed test suite, or multi-source reproduction.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 55f18499943e Review evidence[1][2][3][4][5][6][7][8][9][10][11][12]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Does this skill solve every GPU OOM?
No. It targets activation-memory pressure. In the documented workload, the actual OOM cause was memory fragmentation, so expandable_segments should be tried first.
Should I start with selective or full-layer recompute?
Start with selective recompute, typically using core_attn, and consider full-layer recompute only if selective recompute does not fit.
Why can full-layer recompute trigger a CUDA Graph assertion?
Full-layer recompute requires CUDA Graph scope full_iteration; a TE-scoped scope triggers the assertion. Use selective recompute, disable CUDA Graphs, or use local with full_iteration.
Can CPU offloading replace recompute?
It can be an alternative, but cpu_offloading=True is incompatible with pipeline parallelism greater than one.

More skills from this repository

All from NVIDIA/skills

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge GPU Memory Tuning

Diagnose GPU OOMs in Megatron Bridge training and reduce fragmentation, activation, and PEFT memory usage.

★ 3.8k FS 61 Recommended today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Performance Workflow

Systematically diagnose and improve MoE training throughput in Megatron Bridge.

★ 3.8k FS 53 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE VLM Training Guide

Guides FSDP and 3D-parallel choices and tuning for MoE vision-language model training.

★ 3.8k FS 57 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge CUDA Graphs

Configure, validate, and benchmark CUDA Graph capture in Megatron Bridge to reduce host-driver overhead.

★ 3.8k FS 55 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge CPU Offload

Configure, validate, and troubleshoot CPU offloading in Megatron Bridge to relieve GPU memory pressure.

★ 3.8k FS 55 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Long-Context MoE Training

Practical Megatron Bridge guidance for sizing parallelism, managing memory, and preserving throughput in long-context MoE training.

★ 3.8k FS 48 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Recipe Recommender

Recommends adjustable Megatron Bridge recipes for your model, GPU budget, and training goal.

★ 3.8k FS 53 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Hierarchical Context Parallelism

Enable, troubleshoot, and verify hierarchical context parallelism in Megatron-Bridge.

★ 3.8k FS 51 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Training Guide

Run Megatron-LM and Megatron Bridge training and verify whether their loss curves match.

★ 3.8k FS 44 Not recommended today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Parallelism Strategy Guide

Choose, combine, and validate Megatron Bridge parallelism configurations.

★ 3.8k FS 58 Recommended today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Expert-Parallel Overlap

Configure, validate, and troubleshoot MoE expert-parallel communication overlap in Megatron-Bridge.

★ 3.8k FS 57 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Training Resiliency

Configure fault recovery and hang detection for Megatron Bridge distributed training.

★ 3.8k FS 57 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Communication Overlap

Tune expert-parallel communication and computation overlap in Megatron Bridge.

★ 3.8k FS 56 Use with care today
Dev & Engineering ✓ NVIDIA · Official

Megatron FSDP Configuration and Performance Guide

Enable, troubleshoot, and verify Megatron FSDP in Megatron-Bridge.

★ 3.8k FS 54 Use with care today
Dev & Engineering ✓ NVIDIA · Official

Megatron-Bridge Communication Overlap Guide

Configure and verify TP, DP, and PP communication overlap in Megatron-Bridge training.

★ 3.8k FS 54 Use with care today
Automation & Ops ✓ NVIDIA · Official

Megatron-LM on SLURM

Launch, monitor, and troubleshoot multi-node Megatron-LM training on SLURM GPU clusters.

★ 3.8k FS 56 Use with care today
Automation & Ops ✓ NVIDIA · Official

NeMo MBridge Multi-Node Slurm

Convert single-node MBridge scripts into multi-node Slurm jobs and diagnose launch, NCCL, and MoE memory failures.

★ 3.8k FS 44 Blocked today
Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Sequence Packing

Configure and validate sequence packing and long-context training in Megatron-Bridge.

★ 3.8k FS 56 Use with care today
Automation & Ops ✓ NVIDIA · Official

TAO Jobs on Kubernetes

Submit and monitor NVIDIA TAO GPU training jobs through Kubernetes.

★ 3.8k FS 53 Use with care today
Dev & Engineering ✓ NVIDIA · Official

NeMo AutoModel Distributed Training

Choose and configure multi-GPU and multi-node training strategies for NeMo AutoModel.

★ 3.8k FS 58 Recommended today

Related skills