ml-profile

Profile PyTorch Lightning training to diagnose data loading, computation, and GPU memory bottlenecks.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-profile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ml-profile
Source: https://github.com/nishide-dev/claude-code-ml-research/tree/main/skills/ml-profile
Command: npx skills add https://github.com/nishide-dev/claude-code-ml-research --skill ml-profile

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires matplotlib, hydra-core, pytorch-lightning, torch, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you identify why training is slow or unstable by profiling where time and memory are going, then guiding targeted performance fixes.

Core Features & Use Cases

  • Training performance profiling: Run PyTorch Lightning profilers (simple, advanced, and PyTorch profiler) for operator-level insight and trace visualization in TensorBoard.
  • Data loading diagnostics: Measure DataLoader throughput and find an optimal num_workers to reduce input bottlenecks.
  • GPU utilization and memory checks: Monitor GPU utilization and GPU memory usage to detect compute starvation, inefficient data pipelines, and OOM risks.
  • Use case: When a training run shows low GPU utilization and long iteration gaps, profile the DataLoader and training steps, then adjust worker counts, preprocessing, and batch/memory strategies based on the results.

Quick Start

Use ml-profile when you notice low GPU utilization or OOM symptoms by asking for a short profiling run and interpreting the traces in TensorBoard.

Frequently Asked Questions about ml-profile

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

FAQPage Schema
How do I profile PyTorch Lightning training to find performance bottlenecks?

To profile PyTorch Lightning training, run Lightning profilers to diagnose bottlenecks in data loading, computation, and GPU memory usage. This generates TensorBoard traces and reports that guide targeted performance fixes.

Why does my PyTorch training show low GPU utilization and how can I fix it?

Low GPU utilization often indicates input bottlenecks. Profile your DataLoader throughput to find an optimal num_workers setting, then adjust preprocessing and batch strategies based on the resulting traces.

How do I diagnose OOM errors and monitor GPU memory usage during training?

Diagnose OOM errors and monitor GPU memory usage by running GPU memory checks during your training profile. This detects compute starvation and memory risks to prevent out-of-memory crashes.

Can I use PyTorch profiler with my existing Hydra training workflows?

Yes, PyTorch profiler integrates with PyTorch Lightning and Hydra workflows. It runs operator-level profiling routines to produce TensorBoard traces suitable for performance optimization decisions.

What is the best way to measure DataLoader throughput and optimize num_workers?

Measure DataLoader throughput by running data loading diagnostics during a short profiling run. This identifies input bottlenecks and helps find the optimal num_workers count to reduce iteration gaps.