Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · AI · Past the basics · about 20 min to read

Play it as a journeyTutor comes with a plan

Four Ways to Split a Model

Training at Scale
Training at Scale · Open board

The Training at Scale board draws why one GPU cannot hold a model in training, and how the work gets cut up.

Before you start. From The GPU (thousands of cores, and the memory that feeds them): a GPU is thousands of simple calculators with memory that is very fast but small, 80 GB on an A100. From What a Neural Network Is: a weight is one adjustable number inside the network, a dial, and a model’s size is how many weights it has. From How It Learns (loss, gradient descent, backprop): training shows the model examples, measures how wrong it was, and nudges every weight a little. The list of which-way-to-nudge numbers, one per weight, is the gradient. From Why the Loss Won't Go Down: Adam, the standard way to take those nudges, remembers two extra numbers for every weight. A number can be stored in 4 bytes (careful) or 2 bytes (half the room, a little rougher).

Lesson 37 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 4 October 2019: “One may wonder where all the memory goes”
  • Split the batch: data parallelism, and the averaging round
  • Split every matrix: tensor parallelism
  • Split the layers: pipeline parallelism, and the bubble
  • Split the pile itself: ZeRO, and why data parallelism was wasting room
  • Two sizes of number: mixed precision, and why bf16’s range matters
  • What goes in each of the eight suitcases?
  • What does the averaging round cost?
  • What do the other two cuts pay?
  • Why keep the careful copy in the suitcase?
  • All of it in code

Terms it explains: Training at Scale, 112 GB, data parallelism, all-reduce, tensor parallelism, pipeline parallelism, ZeRO, mixed precision.

Related paper

Review AI