Skip to content

Data Loading Optimization

Guides an agent to set up PyTorch DataLoaders so the GPU isn't left waiting on data.

Stars
14,802
Licence
MIT
Files
1 file

What it does

When installed, this skill gives the agent a short checklist of best practices for feeding data to machine learning training code, such as choosing a sensible number of loader worker processes, pinning memory when a GPU is used, keeping workers alive between passes, caching preprocessing, and profiling for slow input. It is a set of written guidelines only; it does not run anything itself, and the agent applies the advice when it writes or reviews PyTorch data code.

Great for

  • Machine learning engineers setting up PyTorch training pipelines
  • Researchers whose GPU sits idle while waiting for data
  • Anyone reviewing a DataLoader or preprocessing script for speed

Skip it if

  • Non-PyTorch data work, since the advice is specific to DataLoader and torchvision; it may mislead other frameworks
  • Very small datasets or CPU-only jobs, where these tuning steps give little benefit
  • Expecting measured results: the file gives rules of thumb, not benchmarks, so the agent's changes still need testing on your hardware

Try asking

  • “Set up a DataLoader for my image dataset so the GPU isn't starved”
  • “Review my preprocessing code and suggest faster data loading settings”
  • “Should I use persistent_workers and pin_memory for this training script?”
  • “Help me profile where my input pipeline is slow”
Step-by-step guide: how to use Data Loading OptimizationInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    data-loading.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip data-loading.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip data-loading.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Ask the agent to measure throughput before and after changes, since the optimal num_workers depends on your machine.
  • Mention whether you train on GPU, because pin_memory only applies when a GPU is used.
  • Treat the suggested num_workers cap of 8 as a starting point, not a rule.

What's inside

  • SKILL.md

Redistributed unmodified from aiming-lab/AutoResearchClaw under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.