harvard-edge/cs249r_book
Learning ResourcesOpen four-volume textbook series on how machine learning systems are built, with hands-on tools for students and instructors.
What This Is
CS249r is an open textbook curriculum on machine learning systems rather than model training. It asks how models actually execute and scale: memory hierarchies, kernel efficiency, quantization, clusters, serving, and physical deployment. The material spans four volumes — single machine, fleets, agentic systems, and physical AI — and is complemented by tools that let readers build and measure the concepts rather than only read about them the repository and curriculum overview.
It targets students, software engineers moving toward ML infrastructure, hardware architects, and instructors. The only stated prerequisites are Python programming and familiarity with basic ML ideas such as neural networks or loss functions; no prior computer architecture or distributed systems background is required FAQ on audience and prerequisites.
Key companion components:
- TinyTorch — builds an ML framework from scratch across 20 modules, from tensors to a transformer.
- MLSys·im — models memory, compute, network, and energy limits at scales students cannot rent.
- Hardware Kits — deploy models to Arduino, Seeed, Grove, and Raspberry Pi devices.
- Labs — interactive Marimo notebooks tied to chapters (early release).
- StaffML — practice and assessment material.
Getting Started
The textbook is free to read online. A sensible first path for a self-learner:
- Open Volume I and read Chapter 1 to see the scope.
- When an idea needs practice, work through TinyTorch to implement the machinery yourself.
- Use MLSys·im to compute the systems trade-offs the book discusses.
- Try the labs for parameterized, hands-on experiments.
No single required setup covers all components; each component has its own guide in the repository, and the README's Start Here table maps learner type to entry point Start Here table. Instructors can begin from the Instructor Hub to find syllabi, slides, kits, and labs.
Each volume stands alone as a textbook, and the companions are optional additions for readers who want to go deeper FAQ on using the book alone.
Constraints and Licensing
- Volume status differs. Volume I is released (with a forthcoming MIT Press print edition), Volume II is a preview under active revision, and Volumes III and IV are open drafts the README explicitly says should not yet be cited or taught volume table.
- Licenses are per component. The textbook is CC BY-NC-ND 4.0: non-commercial sharing with attribution, with modified versions and translations requiring permission. Labs, kits, slides, and instructors material use CC BY-NC-SA 4.0. TinyTorch is MIT, MLSys·im is Apache 2.0, StaffML is AGPL v3, and the StaffML question corpus is CC BY-NC 4.0 license table.
- Not a prerequisite chain. Volume II does not require completing Volume I, though reading Volume I first gives the cleanest progression FAQ on volume order.
- AI use is disclosed. Chapters were written and revised by the author, with AI tools used in the workflow; the stated standard is traceability rather than trust How the material is made.
HotRepo's Take
On 2026-11-05 the repository appeared in the Python daily list at position 16 with 108 stars gained that day, against a total of 29,966 stars and 3,713 forks. Earlier snapshots in July 2026 show daily gains of a few hundred stars, with a peak of 792 on July 3 — but those records lack rank fields, so they support only the daily counts, not a ranking trend.
A Hacker News commenter on 2025-12-31 described the approach as using "a better level of abstraction than usual, less techniques of the day, more how to think about their purpose" HN comment. The README supports that framing: the curriculum is explicitly built around durable constraints such as memory bandwidth, latency, energy, and failure rates rather than current frameworks. That design is what makes the repository useful well beyond a single course offering.
Written by AI from the project's README, updated . The project's own docs are the source of truth.