internalsGet Pro

Module 13 · Lesson 5 of 8Pro

Batch size, memory and training speed

Level
Intermediate
Topic
Tuning and efficient training
Reading time
17 min

When you finish this page you can

  1. Split a training run’s time into epochs to reach a target and time per epoch, and say how batch size moves each one.
  2. Measure throughput at several batch sizes and explain why it levels off.
  3. Estimate the critical batch size from two runs and pick the batch that reaches a target quality fastest.
  4. Find the largest batch that fits in GPU memory and treat it as a ceiling, not a choice.
  1. Stochastic and mini-batch gradient descent17 min
  2. Training on GPUs: memory, precision and speed18 min
  3. Design: a classifier for product photos28 min

Video lesson · coming soon

A bigger batch made the run slower

is the online store this course uses as its example. Farah, an ML engineer, fine-tunes a photo classifier every month. It looks at a new listing’s main photo and predicts which of Kartly’s 20 categories it belongs to. Joseph’s growth team uses it to keep products on the right category pages.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan