Install any skill in seconds. Free to start, no credit card required.
Get Started Free →nvidia/nemo-mbridge-perf-activation-recompute
Validate and use selective and full activation recompute in Megatron Bridge to reduce GPU memory usage at the cost of extra compute.
Passed 19 of 20 test cases with the skill, and 7 of 20 without it.
and 15 more in the full report
14 fixed7 passed either way0 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 12 test cases the skill fixed. Same model, same prompt, with and without the skill.
In a hybrid Gated Delta Net (GDN) architecture trained in Megatron Core, activation memory is dominated by the gated normalization tensor. What selective recompute label targets this specific boundary?
| Checked | Without skill | With skill |
|---|---|---|
| Specifies gdn_norm_out as the selective module label for Gated Delta Net gated normalization. | Missed | Passed |
The instructions your model reads when the skill loads.
Stable docs: @docs/training/activation-recomputation.md Card: @skills/nemo-mbridge-perf-activation-recompute/card.yaml
Activation recompute (activation checkpointing) trades additional forward work during backward for lower retained-activation memory. The useful checkpoint boundary depends on the model architecture, attention backend, parallelism, and the tensor that actually drives the per-rank peak.
max_memory_allocated() with max_memory_reserved() on every rank.recompute_modules=[] is valid and useful for this comparison.core_attn is the common first candidate. It is strongest when unfused attention materializes score/probability tensors. With Transformer Engine fused or Flash Attention, compare it against [] because those backends already rematerialize attention internals.mla_up_proj when expanded Q/K/V projections dominate. Add core_attn only when the attention-core state still matters.moe_act when the expert intermediate activation dominates; add layernorm when norm outputs are material. Use whole moe recompute only after accounting for the extra expert compute and communication it replays.mlp can save the whole dense-MLP activation region, but it usually costs more compute than a narrow output-discard boundary.Megatron Core's cpu_offloading=True is an alternative when PCIe/NVLink transfer overhead is preferable to replayed compute. It cannot be combined with activation recompute and is not compatible with pipeline parallelism greater than one.
cfg.model.recompute_granularity = "selective"
cfg.model.recompute_modules = ["core_attn"] # Common standard-attention candidate, not a universal default.
Use the decision table below to replace or extend that list for MLA, MoE, dense-MLP, or GDN workloads.
cfg.model.recompute_granularity = "full"
cfg.model.recompute_method = "uniform"
test cases passed, vs 7 / 20 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.