📦harvard-edge / cs249r_book
← 返回首页
Machine Learning Systems: Foundations, Scaling, Agentic AI, and Physical AI (Vols I–IV) • Harvard CS249r | https://mlsysbook.ai
⚖️ NOASSERTION#artificial-intelligence#cloud-ml#computer-systems#courseware#deep-learning🌐 mlsysbook.ai📅 创建于 2023-09-06🔄 更新于 2026-10-29
🔗 GitHub Python

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有

Machine Learning Systems

English • 中文 (earlier version) • 日本語 (earlier version) • 한국어 (earlier version)

An open textbook series on how machine learning systems are built and why they are built that way, with companion tools for building, measuring, and teaching them.

License: per component Cite Stars Fund Us

📘 Textbook Series • 📗 Vol I • 📘 Vol II (Preview) • 🟣 Vol III (Draft) • 🌲 Vol IV (Draft)
🔥 TinyTorch • 🔬 Labs • 🧰 Kits • 🔮 MLSys·im • 🎓 Instructors • 💼 StaffML

📚 Volume I is forthcoming in print from MIT Press.


Why This Curriculum Exists

The world is rushing to build AI systems. It is not yet engineering them.

A model that scores well on a benchmark still has to fit in memory, meet a latency budget, stay within a power limit, and fail safely in front of real people. Those constraints decide the architecture, and they follow laws that outlast any framework or chip. Memory bandwidth, network latency, energy, and failure rates govern a microcontroller with 256 KB of memory and an accelerator in a datacenter alike, even though the two differ in scale by many orders of magnitude. I learned this while working on TinyML at Google, and it became the idea that runs through every volume: constraints drive architecture.

AI engineering is the discipline of building efficient, reliable, and safe intelligent systems that operate in the real world, not just models in isolation. My aim is to help establish it alongside software engineering and computer engineering, and to teach it the way computer architecture has long been taught, from first principles and with numbers a student can recompute.

Everything lives in one repository because each part teaches something the others cannot. Students who only read do not internalize, and students who only code do not generalize. The textbook builds the mental model, TinyTorch makes it concrete by having students build the machinery themselves, and the hardware kits and the MLSys·im simulator show where the model breaks, on devices students can hold and at scales they cannot rent.

The repository is the curriculum.

The work began in a classroom. In 2023, the students in CS249r at Harvard wrote the first class notes together, one topic per group, and we published them on GitHub. Those notes have been rewritten every semester since, and the HarvardX TinyML course that preceded them reached more than 100,000 learners. The goal now is one million learners by 2030.

There is also a personal reason, which the FAQ tells in full. As an undergraduate, I wrote to a professor I had never met and received a VHS tape in the mail that changed what I studied. This curriculum is my way of sending that package back out.


What You Will Learn

Each chapter connects an idea a reader may already know from machine learning to the systems that make it work in practice.

You know... You will learn...
How to train a model → How training scales across accelerator clusters
That quantization shrinks models → How low-precision arithmetic maps to silicon
What a transformer is → Why the KV cache dominates memory at inference
Models run on GPUs → How schedulers balance latency against throughput
Models need good data → How data pipelines, selection, and drift decide what a model can learn
Models get deployed → How to benchmark, monitor, and roll back models in production
Hardware fails sometimes → How to checkpoint and recover training jobs that span thousands of accelerators
Edge devices have limits → How to co-design models and hardware
AI uses a lot of energy → How to measure and reduce the energy and carbon cost of a system over its full lifecycle
How to prompt an LLM → How to architect agent loops, tool sandboxes, and context memory (Vol III, draft)
How vision and robotics models infer → How to close real-time sensor-actuator loops under physical constraints (Vol IV, draft)

The Four Volumes

Each volume widens the boundary of the system and raises the cost of failure. The distinction between volumes is scope, not depth; every volume is equally quantitative.

Volume Unit of work Core systems question Status
📗 I. Introduction to Machine Learning Systems The model How does intelligence execute efficiently on a single machine? Released; forthcoming in print from MIT Press
📘 II. Scaling Machine Learning Systems The fleet How does intelligence scale across distributed clusters and datacenters? Preview; in active revision
🟣 III. Agentic Machine Learning Systems The trajectory How is intelligence governed when it acts autonomously over long horizons? Draft; changes often
🌲 IV. Physical AI: Machine Learning Systems That Sense and Act The physical action How can intelligence act safely on matter and physical systems? Draft; changes often

Each volume answers a question the previous one leaves open:

  • Vol I → Vol II, when one machine is not enough. Volume I covers single-machine execution, memory walls, and kernel efficiency. Volume II carries those foundations across thousands of accelerators, collective communication, fault-tolerant networks, and datacenter orchestration.
  • Vol II → Vol III, when a stateless response is not enough. Volume II serves stateless requests at scale. Volume III adds stateful, multi-step loops that manage context memory, call tools, run in sandboxes, and recover from nondeterministic failures.
  • Vol III → Vol IV, when software acts on the physical world. Volume III governs software environments. Volume IV crosses into physical systems, where computational latency becomes distance traveled and a failure cannot be undone.

⚠️ Volumes III and IV are open drafts. Chapters are added, reorganized, and rewritten as I iterate, so please do not cite or teach from them yet. Feedback is welcome through the book feedback issue forms.


Start Here

The pieces are designed to work together, but none of them requires the others.

If you are... Start here Then go deeper
A student or self-learner Read Volume I Build TinyTorch, model systems with MLSys·im, try the labs (early release), and practice with StaffML
An instructor Open the Instructor Hub Pick a course and use its syllabus, slides, kits, and labs
A contributor Pick the component you use most See Contributing

Curriculum map showing how the textbook, labs, TinyTorch, hardware kits, MLSys·im, and StaffML connect

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR