Dev & Engineering ✓ NVIDIA · Official gpu-memorycudapytorchmegatron-bridgelorasequence-parallelismactivation-recomputedistributed-training

NeMo MBridge GPU Memory Tuning

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

FollowSkills review · FSRS-2.0
Use with care
61/ 100 5-point scale 3.1 / 5
Trust19 / 25 · 3.8/5

The skill recommends environment variables and training configuration changes only; no malware, credential collection, covert exfiltration, or destructive defaults are evident. It discloses NCCL, CUDA Graph, PP, and LoRA constraints and gives rollback directions such as removing an incompatible setting. Six points are deducted for lacking explicit user confirmation, pre-change backup/rollback procedure, dependency versions, and fuller data-flow boundaries. NVIDIA’s verified provenance supports attribution and governance only, not intrinsic safety.

Reliability9 / 20 · 2.3/5

The document provides a decision sequence, compatibility constraints, symptom/confirmation/fix tables, and coherent key paths on static inspection. Eleven points are deducted because execution depends on Megatron Bridge, PyTorch, MCore, CUDA, NCCL, and workload-specific configuration; no commands or tests were executed here, and abnormal-input coverage and reproducibility remain limited. The score respects the static-review cap.

Adaptability11 / 15 · 3.7/5

Triggers, audience, and OOM or LoRA-plus-sequence-parallel scenarios are specific, with boundaries for TP, PP, VPP, CPU offloading, and adapter eligibility. Core use does not depend on an overseas online service, so no mainland-China reachability deduction applies. Four points are deducted because Chinese-language support is absent and hardware, software-version, model, and cluster compatibility ranges are incompletely specified.

Convention10 / 15 · 3.3/5

The skill has clear sections for quick decisions, configuration examples, constraints, measured results, diagnosis, limitations, and verification commands; the card adds owner, version, evaluation, and Apache-2.0 licensing information. Five points are deducted for missing recommended Instructions and Examples sections, absent author metadata, incomplete installation/dependency notes, and no explicit changelog or concrete maintenance responsibility.

Effectiveness7 / 15 · 2.3/5

For the stated Megatron Bridge OOM cases, it gives directly usable first-step configuration, alternatives, performance tradeoffs, and compatibility warnings. The supplied Llama3, LoRA, and CPU-offloading cases support practical value. Eight points are deducted because the output and fixes were not executed in this review, coverage relies on referenced external files, and there is no automatic profiling or environment-specific strategy selection. The score respects the static cap.

Verifiability5 / 10 · 2.5/5

Code anchors, test commands, failure messages, measurement tables, PR identifiers, and numerical/gradient parity claims provide auditable primary material. Five points are deducted because tests were not executed, the cited PR and measurements cannot be independently reproduced from the supplied material, and corroboration across independent sources is thin. The score respects the static cap.

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
  • Do not treat expandable_segments as a universal capacity fix; confirm fragmentation first and account for its incompatibility with --use-nccl-ub and some CUDA Graph configurations.
  • Before production training, obtain user confirmation for configuration changes and validate against the actual GPU, CUDA, NCCL, and Megatron Bridge versions and runtime metrics; CPU offloading is unavailable with PP>1, and LoRA input re-gather adds communication and may reduce throughput.
  • The benchmark contains only one positive task, and this review executed no tests; broad effectiveness across other models, hardware, or clusters is unverified.
See the full review method →

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

This skill targets GPU out-of-memory failures in NeMo MBridge and Megatron Bridge training jobs. It prioritizes CUDA allocator fragmentation and also covers LoRA with sequence parallelism, activation recompute, parallelism resizing, distributed optimizers, FSDP, and CPU offloading. It provides a theoretical memory estimator workflow, compatibility constraints, failure-diagnosis guidance, and verification tests. Its measured results focus on 32 H100 80GB GPUs running Llama3 70B and several LoRA sequence-parallel configurations.

It instructs users to set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True, call Megatron Bridge's estimate_training_memory estimator, and analyze parameter, optimizer, activation, and temporary workspace memory. It recommends changes involving TP, PP, DP, distributed optimizers, FSDP, and activation recompute; shows how to configure LoRA(sequence_parallel_input_regather=True) to reduce retained gathered LoRA-A inputs; and checks constraints involving CPU offloading, CUDA graphs, NCCL user buffers, and adapter types. It also supplies environment checks, pytest commands, and a two-process distributed parity test.

  1. A Megatron Bridge job OOMs on one rank while other GPUs still have headroom, suggesting allocator fragmentation.
  2. A LoRA or PEFT job using sequence parallelism retains excessive activation memory.
  3. A model genuinely exceeds GPU capacity and the user needs to compare PP, TP, distributed optimizer, FSDP, or recompute options.
  4. A configuration change or commit appears to have introduced an OOM regression and needs targeted diagnosis.
  5. A user wants to enable CPU offloading or CUDA graphs and needs to validate pipeline-parallel and CUDA/NCCL constraints.

What are this skill's strengths and limitations?

Pros
  • Starts with expandable segments, which the supplied benchmark shows can remove fragmentation-induced OOM without changing the model or parallelism.
  • Covers LoRA sequence-parallel input re-gather with measured memory savings and throughput changes across several configurations.
  • Clearly documents tradeoffs and blockers involving TP, PP, VPP, CPU offloading, CUDA graphs, and NCCL user buffers.
  • Includes estimator usage, failure diagnosis, code anchors, and copyable verification commands.
Limitations
  • The measurements are concentrated on H100 80GB hardware and selected Llama3, Qwen3, and GPT-OSS workloads, so results may not generalize.
  • The theoretical estimator excludes allocator fragmentation, CUDA/NCCL workspace, CUDA graph buffers, token imbalance, and dispatcher workspace.
  • Activation recompute and parallelism changes can materially reduce throughput; the TP=8 example lost 28.4%.
  • CPU offloading is unavailable when pipeline parallelism exceeds one, and input re-gather does not cover every LoRA adapter.

How do you install this skill?

Install the specific skill with the README-supported Skills CLI command: npx skills add nvidia/skills --skill nemo-mbridge-perf-memory-tuning --yes. The README does not document additional skill-specific installation steps; after installation, the skill is available when the agent next loads skills and encounters a relevant task.

How do you use this skill?

Give the agent a concrete training problem, for example: “My Megatron Bridge training job has a GPU OOM. Check for allocator fragmentation first, then evaluate LoRA sequence-parallel input re-gather and activation recompute.” For verification, use the supplied commands to export the expandable-segments setting, run estimate_training_memory, and execute the focused pytest and two-process torch.distributed tests.

How does this skill compare with similar options?

Compared with immediately increasing TP or PP, the skill prioritizes fixing allocator fragmentation; the supplied results show nearly no throughput cost for expandable segments, versus a 28.4% throughput loss for TP=8 and about 5.9% for PP=8 after reducing DP. Compared with activation recompute, LoRA input re-gather trades memory for communication and does not rerun LayerNorm, attention, MLP, or LoRA GEMMs. VPP is presented primarily as a pipeline-bubble optimization, not a memory fix.

FAQ

Does the skill automatically change my training job?
The source describes recommendations, commands, and diagnostic procedures; it does not state that the skill automatically edits or submits training configurations.
Will expandable segments always solve the OOM?
No. If model state or activation memory genuinely exceeds capacity, the guidance recommends PP, TP, a distributed optimizer, or recompute. The setting is also incompatible with --use-nccl-ub.
Does LoRA input re-gather work for every sequence-parallel setup?
No. It applies only to eligible non-expert column-parallel LoRA-A projections. Row-parallel or expert adapters, TP=1, CUDA graphs, CPU activation offload, and certain recompute modes use the existing path.

More skills from this repository

All from NVIDIA/skills

Dev & Engineering ✓ NVIDIA · Official

Megatron Bridge Activation Recompute

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

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 Hierarchical Context Parallelism

Enable, troubleshoot, and verify hierarchical context parallelism 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 Recipe Recommender

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

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

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.

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 Training Guide

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

Dev & Engineering ✓ NVIDIA · Official

NeMo MBridge Training Resiliency

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

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 AutoModel Recipe Development

Build, modify, and validate NeMo AutoModel training and evaluation recipes.

Dev & Engineering ✓ NVIDIA · Official

CuTile Autotuning Guide

Design, implement, and validate low-overhead autotuning for CuTile GPU kernels.

Automation & Ops ✓ NVIDIA · Official

Jetson Package & Environment Advisor

Select Jetson-compatible containers and GPU package indexes by device architecture.

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 Sequence Packing

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

Automation & Ops ✓ NVIDIA · Official

Megatron-LM on SLURM

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

Related skills