Skip to content

Mixed Precision Training

Guides an agent to apply FP16/BF16 mixed precision to speed up and shrink GPU training

Stars
14,802
Licence
MIT
Files
1 file

What it does

This skill gives an AI agent a short best-practice guide for mixed precision training, a technique that runs parts of a neural network's math in lower-precision numbers (FP16 or BF16) to make training faster and use less GPU memory. When a user is optimizing deep learning training on a GPU, the agent knows to wrap the forward pass in autocast, use a gradient scaler to prevent numerical underflow, prefer BF16 on newer NVIDIA GPUs, and watch for NaN gradients. The skill itself contains only instructions and an example code template; it does not run anything on its own.

Great for

  • Machine learning engineers who are training PyTorch models on NVIDIA GPUs and want faster or lighter training
  • Researchers in the AutoResearchClaw pipeline who need the training stage to use less memory
  • Developers troubleshooting NaN losses or slow training who want a checklist of standard fixes

Skip it if

  • People without an NVIDIA GPU or without PyTorch, since the guidance assumes torch.cuda.amp and Ampere-class hardware, so it will not help them directly
  • Non-technical users looking for a general-purpose tool; it only supplies guidance for one narrow training technique
  • Projects using custom CUDA kernels without testing, which the skill itself warns against combining with amp because results can break silently

Try asking

  • “Make my PyTorch training loop use mixed precision to reduce GPU memory usage”
  • “My training loss turns into NaN after I enabled FP16, what should I check?”
  • “Should I use FP16 or BF16 for my A100 training job?”
  • “Add GradScaler and autocast to this training script”
Step-by-step guide: how to use Mixed Precision TrainingInstall, 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.

    mixed-precision.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip mixed-precision.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip mixed-precision.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

  • Give the agent your training script and GPU model so it can pick FP16 versus BF16 and edit the actual code
  • Test the change on a short run and compare loss curves against full precision before a long training job
  • Note that the skill references torch.cuda.amp, which newer PyTorch versions have deprecated in favour of torch.amp, so ask the agent to check current API names

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.