Asking Claude to Optimize Training Code Yields 2-10x Speedups
MarcJSchmidt · x · 2026-12-05
Dev Marc J. Schmidt suggests having your coding agent optimize ML training pipelines to stop wasting GPUs.
His reusable prompt covers:
- Switch to bf16/tf32/fp16
- No Python loops, temp tensors, or einsum
- Avoid GPU-CPU thrashing, optimize data loading
- Use torch.compile or CUDA graphs
- Write generic mega kernels where possible, tune batch size for your GPU
He reports 2-10x improvements depending on how rough the original code was.
More from coding & agent
- Oxford Spin-off AlikeLabs Raises $5.5M from a16z for Agent Coordination Layer — emax · 2026-12-05
- Dev builds Fennick: a PKM app where your own Claude subscription powers agents — thesaraharminta · 2026-12-05
- Glongus launches a remote MCP server letting agents trade secondhand goods with price guardrails and escrow — glongushq · 2026-12-05
- The double meat proxy problem: PR authors and reviewers are both pasting AI output — 4310sy · 2026-12-05
- When AI writes all the code, code design matters more: a tech lead's software factory practice — 4310sy · 2026-12-05
- Runnersbench v6 benchmark: CircleCI is slower and pricier than GitHub Actions — DanielLockyer · 2026-12-05