activation-recompute

Configure selective or full activation recompute to trade memory for compute in Megatron Bridge.

2.8k|332|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/NVIDIA/skills --skill activation-recompute
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: activation-recompute
Source: https://github.com/NVIDIA/skills/tree/main/skills/Megatron-Bridge/perf-techniques/activation-recompute
Command: npx skills add https://github.com/NVIDIA/skills --skill activation-recompute

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Activation recompute trades GPU memory for compute by discarding intermediate activations during the forward pass and recomputing them during backward in Megatron Bridge.

Core Features & Use Cases

  • Supports selective recompute (per-submodule) and full-layer recompute (per transformer layer) to tune memory-compute tradeoffs.
  • Provides clear enablement guidelines and compatibility notes for CUDA graphs, CPU offloading, and model configurations.
  • Applies to large transformer training workflows where memory is a bottleneck, enabling deeper or larger models without hardware upgrades.

Quick Start

Configure recompute_granularity to selective and set recompute_modules to your target submodules to begin trading memory for compute in Megatron Bridge.

Frequently Asked Questions about activation-recompute

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce GPU memory usage during large transformer training?

Activation recompute reduces GPU memory by discarding intermediate activations during the forward pass and recomputing them during backward in Megatron Bridge, trading compute for memory relief.

What is the difference between selective and full activation recompute?

Selective recompute targets specific submodules using recompute_modules, while full recompute operates per transformer layer using recompute_num_layers and recompute_method, offering different memory-compute tradeoffs.

How do I configure activation recompute for Megatron Bridge?

Set recompute_granularity to selective and specify target submodules in recompute_modules to begin trading memory for compute in Megatron Bridge transformer training workloads.

Does activation recompute work with CUDA graphs and CPU offloading?

Activation recompute in Megatron Bridge requires awareness of CUDA graph and CPU offloading constraints, providing clear enablement guidelines and compatibility notes for these features.

When should I use activation recompute for transformer training?

Use activation recompute when memory is a bottleneck during large transformer training, especially with models featuring large hidden dimensions and long sequence lengths, enabling larger models without hardware upgrades.