perf-memory-tuning

Official

Optimize GPU memory use to prevent OOM errors during training.

AuthorNVIDIA-NeMo
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses GPU out-of-memory (OOM) failures caused by memory fragmentation and inefficient resource utilization during model training.

Core Features & Use Cases

  • Memory fragmentation mitigation through setting PYTORCH_CUDA_ALLOC_CONF to expandable segments.
  • Parallelism adjustment techniques such as increasing tensor parallelism or pipeline parallelism to fit models within GPU memory constraints.
  • Activation recompute strategies to reduce peak memory consumption.
  • Use Case: When training large language models on H100 GPUs, users can prevent OOM errors by applying these techniques, ensuring stable training without hardware upgrades.

Quick Start

Set the environment variable PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True before launching your training session to dramatically reduce memory fragmentation and eliminate OOM errors.

Dependency Matrix

Required Modules

nvidia-pyindexpycuda

Components

scriptsreferences

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: perf-memory-tuning
Download link: https://github.com/NVIDIA-NeMo/Megatron-Bridge/archive/main.zip#perf-memory-tuning

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.