Lesson 3: Where training time goes, and how to win it back
22 min read·
Module 7 · Lesson 3 · About 50 minutes · Needs: profiling Python (Module 2 lesson 1), Module 4's training loop, and lesson 1's roofline. No GPU needed.
The situation
Week 7 at Kestrel, day four. Rhys has a rule for anything that runs every night: "Before anyone buys hardware, show me where the time goes." Lesson 1 found that the late-risk network barely uses a CPU. This lesson finds out what it waits for instead.
The running example is the same network fed three ways: ParcelRows, a Dataset that builds each parcel from its pandas row, the version a first draft would write; tensors read parcel by parcel; and whole batches cut from tensors. Parcel KP0000001, the first training parcel, comes out as the same 15 numbers from all three.