add-memory-prints

Add memory profiling instrumentation to distributed MoE training workflows.

327|31|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/mlc-ai/pith-train --skill add-memory-prints
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-memory-prints
Source: https://github.com/mlc-ai/pith-train/tree/main/.agents/skills/add-memory-prints
Command: npx skills add https://github.com/mlc-ai/pith-train --skill add-memory-prints

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Add detailed memory profiling instrumentation throughout the pithtrain training framework. This enables visibility into distributed setup, model creation, checkpoint loading, pipeline scheduling, per-layer activations, saved tensor profiling, expert MLP internals, and memory snapshot dumps to diagnose memory-related bottlenecks.

Core Features & Use Cases

  • End-to-end memory profiling across distributed MoE training, including setup, pipeline steps, and per-layer execution.
  • Memory snapshots and dumps for activations, weights, and caches to ground memory budgets and identify leaks.
  • Targeted per-layer insight with optional detail layers to focus on specific network components during debugging.
  • Use Case: You suspect a memory spike during the gating or expert MLP stage and want precise footprints to guide optimization.

Quick Start

Run the memory instrumentation on your training script to enable detailed memory profiling during a run.

Frequently Asked Questions about add-memory-prints

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

FAQPage Schema
How do I profile GPU memory usage during distributed MoE training in PyTorch?

Profile GPU memory in distributed MoE training by integrating in-framework memory hooks and profiling utilities to surface allocation patterns across initialization, pipeline scheduling, and per-layer execution.

What is the best way to debug memory spikes in MoE expert MLP layers with CUDA?

Debug MoE expert MLP memory spikes by applying targeted per-layer memory instrumentation to capture precise footprints of activations, weights, and caches to guide optimization.

Can I capture memory snapshot dumps for activations and weights in PyTorch CUDA training?

Capture memory snapshots for activations and weights in PyTorch CUDA training by enabling optional saved tensor instrumentation to ground memory budgets and identify leaks.

Does this memory profiling approach work with pipeline scheduling and distributed training setups?

Yes, this memory profiling works with pipeline scheduling and distributed setups by applying comprehensive instrumentation across setup, pipeline steps, and per-layer execution.

Why does my GPU run out of memory during MoE model initialization and checkpoint loading?

Diagnose GPU memory shortages during MoE initialization and checkpoint loading by integrating memory profiling to surface allocation patterns and breakdowns throughout the distributed setup workflow.