nemo-mbridge-perf-memory-tuning

Mitigate GPU memory pressure in Megatron Bridge training with expandable segments.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/sayalinvidia/sayali-skills-test --skill nemo-mbridge-perf-memory-tuning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nemo-mbridge-perf-memory-tuning
Source: https://github.com/sayalinvidia/sayali-skills-test/tree/main/skills/nemo-mbridge-perf-memory-tuning
Command: npx skills add https://github.com/sayalinvidia/sayali-skills-test --skill nemo-mbridge-perf-memory-tuning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GPU training with Megatron Bridge often hits out-of-memory due to memory fragmentation and suboptimal allocator behavior. The skill introduces fixes like using expandable memory segments and guidelines to tune parallelism, activation recompute, and CPU offloading to reduce peak memory without sacrificing throughput.

Core Features & Use Cases

  • Expandable segments to reduce memory fragmentation and prevent OOMs with zero throughput cost.
  • Memory planning guidance: theoretical memory estimator, and activation recompute as a secondary option.
  • Compatibility constraints: CPU offloading is blocked when pipeline model parallel size > 1; CUDA graph considerations.

Quick Start

Before launching training, set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to enable memory fragmentation mitigation and validate that the OOM does not occur.

Frequently Asked Questions about nemo-mbridge-perf-memory-tuning

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

FAQPage Schema
How do I fix GPU out-of-memory errors during Megatron Bridge training?

To resolve GPU out-of-memory errors during Megatron Bridge training, enable expandable_segments via PYTORCH_CUDA_ALLOC_CONF to reduce memory fragmentation and prevent OOMs with zero throughput cost.

What is the best way to reduce peak GPU memory for large models like Llama3-70B?

The best way to reduce peak GPU memory for Llama3-70B-style workloads is to combine expandable_segments with memory planning strategies like activation recompute and tuning parallelism configurations to satisfy safety and performance goals.

Can I use CPU offloading when pipeline model parallel size is greater than 1?

CPU offloading is blocked when pipeline model parallel size is greater than 1. This compatibility constraint prevents offloading in multi-stage pipeline configurations due to CUDA graph considerations.

When should I use activation recompute for GPU memory management?

Use activation recompute for GPU memory management as a secondary option when expandable segments are insufficient to mitigate fragmentation-induced memory pressure during training with long sequences.

Does tuning tensor and pipeline parallelism help prevent OOMs in Megatron?

Tuning tensor and pipeline parallelism configurations helps prevent OOMs in Megatron by distributing the workload to satisfy safety and performance goals while balancing memory planning constraints like CPU offloading limits.