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 23 min to read

Play it as a journeyTutor comes with a plan

When the long run breaks: training diagnostics at scale

From Transformer to LLM
From Transformer to LLM · Open board

The board that draws how a transformer becomes a language model. This lesson is about the long pretraining step on that board, and what you do when it stops, slows or blows up.

Before you start. From What the model ate: pretraining data and the recipe: a loss spike is a sudden jump in the loss, and clipping caps the length of one step but does not stop every spike. From Four Ways to Split a Model: training keeps a 4-byte copy of each weight plus two optimizer numbers, and bf16 is a 2-byte format with wide range but little detail. From How It Learns (loss, gradient descent, backprop): a step moves the weights to lower the loss. From The GPU (thousands of cores, and the memory that feeds them): GPU memory is fast but small.

Lesson 39 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

  • 54 days, 419 unexpected stops
  • Gradient accumulation: many small pots, one serving
  • Activation checkpointing: write down only some of the steps
  • The accumulator: where bf16 quietly stops adding
  • FP8 and the tile scale: one big number ruins its neighbours
  • The gradient norm: the number that moves before the loss
  • Checkpoint and resume: the state is more than the weights
  • Symptoms, causes and fixes
  • Accumulation and the cost of syncing
  • Checkpointing: choosing what to recompute
  • Number formats: three different failures
  • Spikes: what to log and what to do
  • Checkpoint and resume: the full list
  • All of it in code

Terms it explains: gradient accumulation, micro-batch, activations, activation checkpointing, accumulator, FP8, scale, checkpoint, Common mistakes, alignment, autoregressive, base model, Chinchilla, decoder-only, distribution, emergent ability, in-context learning, logits, next-token prediction, parameters / data / compute, pretraining, scaling laws, self-supervised.

Related papers

Review AI