Skip to content

B.11 Pass 9: Capstone Training

Every model so far has been small enough to train in minutes. The capstone is a Llama-family model of about ten million parameters trained on TinyStories, the first model in the course worth serving. Training it on a laptop takes the techniques that make training cheaper without changing what it learns: mixed precision, gradient accumulation, and activation checkpointing, which together match fp32 within 2% in less memory.

Concepts from other sections (11)

This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.

The capstone is then owned end to end: trained as a durable TrainRun, evaluated with seeded quality and safety evals, documented with a datasheet and a model card, and shipped through the ModelRelease workflow with gates and a canary before the gateway serves it.

Learning objectives

  • Explain how Hessian-vector products and the recompute-versus-memory schedule underlie activation checkpointing.
  • Explain why mixed precision, accumulation, and recompute together train like fp32.
  • Explain what a datasheet, a model card, and bias and safety evals must contain.
  • Explain how ModelRelease gates and canaries a new model before it replaces a working one.

This pass needs Pass 8, whose TrainRun workflow trains the capstone and whose durable services ModelRelease runs on.

  1. Hessian-vector products and the recompute-versus-memory schedule. Afterwards you can explain how a Hessian-vector product is computed without the Hessian and how the recompute-versus-memory schedule is chosen.
  2. Mixed precision, loss scaling, gradient accumulation, and activation checkpointing. Afterwards you can explain how mixed precision with loss scaling, gradient accumulation, and activation checkpointing train like fp32 in less memory.
  3. Datasheet and model card. Afterwards you can explain what the datasheet and model card report and why each section is there.
  4. Bias and safety evals. Afterwards you can explain what the bias and safety evals measure and how their results are reported.
  5. ModelRelease: gates, canary, burn check, and rollback. Afterwards you can explain how ModelRelease gates a model, runs a canary, checks the PromQL burn rate, and rolls back.
  6. Model evals as tests. Afterwards you can explain how model evals are written as tests with thresholds and confidence intervals.
  7. Capstone: TinyStories, owned end to end. Afterwards you can explain how the TinyStories model is trained, evaluated, released, and served end to end.
  8. What the System Does After Pass 9. Afterwards you can explain how the TinyStories model is trained with mixed precision, evaluated, released through ModelRelease, and served.

Two optional sections explain what changes when training moves from one machine to many. The capstone does not need them:

  1. Collectives over processes: ring all-reduce. Afterwards you can explain how ring all-reduce over processes sums gradients with bandwidth-optimal traffic.
  2. Data parallelism and ZeRO stages 1 to 3. Afterwards you can explain how DDP and ZeRO stages 1 to 3 partition optimizer state, gradients, and parameters.

The stages are also in this pass’s manifest, path.tsv. Pass 10 puts an agent on top of the served system.

Generated from path.tsv.

StageReadDone when
1Hessian-vector products and the recompute-versus-memory schedule
14.4 Hessian-vector products and the recompute-versus-memory schedule
You can explain how a Hessian-vector product is computed without the Hessian and how the recompute-versus-memory schedule is chosen (M08.4).
2Mixed precision, loss scaling, gradient accumulation, and activation checkpointing
17.1 Mixed precision, loss scaling, gradient accumulation, and activation checkpointing
You can explain how mixed precision with loss scaling, gradient accumulation, and activation checkpointing train like fp32 in less memory (L11.1).
3Datasheet and model card
35.1 Datasheet and model card
You can explain what the datasheet and model card report and why each section is there (ethics.03).
4Bias and safety evals
36.1 Bias and safety evals
You can explain what the bias and safety evals measure and how their results are reported (ethics.04).
5ModelRelease: gates, canary, PromQL burn check, rollback
7.12 ModelRelease: gates, canary, burn check, and rollback
You can explain how ModelRelease gates a model, runs a canary, checks the PromQL burn rate, and rolls back (dur.12).
6Model evals as tests (R8)
3.8 Model evals as tests
You can explain how model evals are written as tests with thresholds and confidence intervals (craft.22).
7Capstone: TinyStories, owned end to end
A.1 Capstone: TinyStories, owned end to end
You can explain how the TinyStories model is trained, evaluated, released, and served end to end (C1).
8What the system does after Pass 9
B.11.1 What the System Does After Pass 9
You can explain how the TinyStories model is trained with mixed precision, evaluated, released through ModelRelease, and served.
9Collectives over processes: ring all-reduce
17.2 Collectives over processes: ring all-reduce
You can explain how ring all-reduce over processes sums gradients with bandwidth-optimal traffic (L11.2).
10Data parallelism and ZeRO stages 1 to 3
17.3 Data parallelism and ZeRO stages 1 to 3
You can explain how DDP and ZeRO stages 1 to 3 partition optimizer state, gradients, and parameters (L11.3).