CourseAI / ML Engineer: The Complete Course · Module 7: Training at Scale · part 47 of 93
Part 47 · Module 7: Training at Scale

Lab: What Kestrel's training costs, and ADR-004

110 min read·
Module 7 · Lab · About 50 minutes · Needs: lessons 1 to 3 of this module, and the Module 6 lab (or nothing: Step 1 rebuilds Modules 1 to 6)

What you are building

What Kestrel's training costs Measured on the real models, then decided Active flow 1 Processing step number Models model v1 Module 3 lab model v2 Module 6 lab Measure time, profiler fit timings wall and CPU kill and resume torchrun, 2 processes Prices c7i.large CPU, AWS A10 24 GB GPU, Lambda Records throughput report ADR-004 no GPU 1 2 3 4
The lab times the real v1 and v2 and kills and resumes a training run (teal), prices the time on a CPU and a GPU (gold), and records the result as a generated report and ADR-004 (purple); circles give the order.

Imran's question is the first of the course's five: "What does one prediction cost, and one training run?" Module 8 answers the first half. This lab answers the second, for the two models Kestrel actually has: v1 from the Module 3 lab and v2 from the Module 6 lab. The lessons measured memory, throughput, checkpoints and prices on stand-ins; the lab puts those tools to work on the real models and writes down the decision Rhys keeps being asked about: does the late-risk model need a GPU?

The lab adds kestrel/scale/report.py, which writes reports/training-throughput.md from measured numbers, and docs/adr/ADR-004-training-hardware.md. It also runs Lesson 2's training script as Kestrel's resumable job: killed half way, relaunched, and checked weight for weight. No cell calls a hosted model.

Open a new Colab notebook, call it module-07-lab.ipynb, and run each cell in order. A CPU runtime is enough.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan