Dev & Engineering ✓ NVIDIA · Official megatron-bridgeactivation-recomputegpu-memory-optimizationfp8-trainingcuda-graphsdistributed-training

Megatron Bridge Activation Recompute

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

FollowSkills review · FSRS-2.0
Not recommended
59/ 100 5-point scale 3.0 / 5
Trust18 / 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.

Reliability9 / 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.

Adaptability11 / 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.

Convention10 / 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.

Effectiveness7 / 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.

Verifiability4 / 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.

Evidence confidence:Low Reviewed Jul 20, 2026 Reviewed revision 55f18499943e
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.
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.
See the full review method →

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.

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

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 do you install this skill?

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.

How do you use this skill?

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.

How does this skill compare with similar options?

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.

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.

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Performance Workflow

Systematically diagnose and improve MoE training throughput in Megatron Bridge.

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE VLM Training Guide

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge CUDA Graphs

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge CPU Offload

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

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.

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Recipe Recommender

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Hierarchical Context Parallelism

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Training Guide

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Parallelism Strategy Guide

Choose, combine, and validate Megatron Bridge parallelism configurations.

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Expert-Parallel Overlap

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Training Resiliency

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge MoE Communication Overlap

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

Dev & Engineering ✓ NVIDIA · Official

Megatron FSDP Configuration and Performance Guide

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

Dev & Engineering ✓ NVIDIA · Official

Megatron-Bridge Communication Overlap Guide

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

Automation & Ops ✓ NVIDIA · Official

Megatron-LM on SLURM

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

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.

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Sequence Packing

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

Automation & Ops ✓ NVIDIA · Official

TAO Jobs on Kubernetes

Submit and monitor NVIDIA TAO GPU training jobs through Kubernetes.

Dev & Engineering ✓ NVIDIA · Official

NeMo AutoModel Distributed Training

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

Related skills