cs249r_book README

The project's README from github.com/harvard-edge/cs249r_book. As one markdown file: README.md.

Machine Learning Systems

Principles and Practices of Engineering Artificially Intelligent Systems

English • 中文 • 日本語 • 한국어

Vol I: Foundations Vol II: Scaling Vol III: Agentic Vol IV: Physical AI

TinyTorch MLSys·im Labs Kits Slides Instructors

License Cite Fund Us StaffML Newsletter Updated

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

📚 Hardcopy edition coming 2026 with MIT Press.


Mission

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

That gap is what we mean by AI engineering.

AI engineering is the discipline of building efficient, reliable, safe, and robust intelligent systems that operate in the real world, not just models in isolation. Our mission is to establish AI engineering as a foundational discipline alongside software engineering and computer engineering, by teaching how to design, build, and evaluate end-to-end intelligent systems.

Our goal: Help 100,000 learners master ML Systems this year, and reach 1 million by 2030.


Why One Repository

I designed this as a single integrated curriculum, not a collection of independent projects. The textbook teaches the theory. TinyTorch makes you build the internals. The hardware kits force you to confront real constraints. The simulator lets you reason about infrastructure you can't afford to rent. Each piece exists because I found that students who only read don't internalize, and students who only code don't generalize.

The repository is the curriculum.

A growing community of contributors helps improve every part of it: fixing errors, sharpening explanations, testing on new hardware. Their work makes this better for everyone, and I'm grateful for every pull request.


The Curriculum

Every component connects. The textbook gives you the mental models. The labs let you reason through trade-offs interactively, powered by MLSys·im — a modeling engine for infrastructure you can't physically access, and a standalone tool in its own right. TinyTorch makes you build the machinery yourself. The hardware kits put you face-to-face with real deployment constraints. StaffML tests whether you actually understand it. Socratiq adds AI-guided reading, contextual quizzes, and spaced repetition inside the learning experience. And the instructor hub, slides, and newsletter give educators everything they need to bring this into a classroom.

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

For Students

Component Role in the Curriculum Link
📖 Textbook Series Four-volume MIT Press textbook series on Machine Learning Systems Architecture:
• Vol I: Introduction to Machine Learning Systems (Released)
   The foundations, abstractions, lifecycle, data, training, inference, evaluation, deployment, and responsible systems.
• Vol II: Scaling Machine Learning Systems (Preview)
   Distributed computation, accelerators, memory, communication, parallelism, serving, reliability, and efficiency.
• Vol III: Agentic Machine Learning Systems (In Development)
   Reasoning and acting loops, memory, tools, planning, search, orchestration, evaluation, security, and multi-agent systems.
• Vol IV: Physical AI Systems (In Development)
   Sensing, perception, world models, control, robotics, embodiment, real-time constraints, safety, and hardware.

⚠️ Volumes III and IV are in development and change quickly as I iterate. Please do not cite or teach from them yet. Feedback is welcome through the Book feedback issue forms.
Vol I · Vol II (Preview) · Vol III (In Dev) · Vol IV (In Dev)
🔬 Labs Interactive Marimo notebooks where you explore trade-offs from the textbook: change a parameter, see what breaks, build intuition. Powered by MLSys·im under the hood. Launch labs · Repo guide
🔥 Tiny🔥Torch Build your own ML framework from scratch across 20 progressive modules. You don't understand a system until you've built one. Get started
🛠️ Hardware Kits Deploy ML to Arduino, Seeed, Grove, and Raspberry Pi devices. Real memory limits, real power budgets, real latency. Browse labs
🔮 MLSys·im Calculate memory bottlenecks, network saturation, and scheduling limits at infrastructure scales you can't physically access. Use simulator · Repo guide
💼 StaffML Physics-grounded interview questions for ML systems roles. Vault, practice drills, mock interviews, and progress tracking. Practice · Repo guide

For Educators

Component What It Provides Link
🎓 Instructor Hub The AI Engineering Blueprint: two 16-week syllabi, pedagogy guide, assessment rubrics, and a TA handbook. View hub · Repo guide
🎬 Lecture Slides Beamer slide decks for every chapter, with four theme variants. Drop into your course and teach. Browse decks · Repo guide
📬 Newsletter Updates on the curriculum, new chapters, and what the community is building. Subscribe

Choose Your Path

The pieces are designed to work together, but you do not need to adopt everything at once.

If you are... Start here Then go deeper
A student or self-learner Read Volume I and try Lab 00 Build TinyTorch, use MLSys·im, and practice with StaffML
An instructor Open The AI Engineering Blueprint Use the course map, slides, rubrics, and TA guide
A contributor Pick the component you use most Improve chapters, labs, tests, examples, hardware notes, simulator models, or assessment content

The learning loop is: Read → Explore → Build → Model → Deploy → Practice → Teach.

Adjacent and Experimental Work

Some projects are intentionally earlier-stage than the main curriculum:


What You Will Learn

This textbook teaches you to think at the intersection of machine learning and systems engineering. Each chapter bridges algorithmic concepts with the infrastructure that makes them work in practice.

You know... You will learn...
How to train a model → How training scales across GPU clusters
That quantization shrinks models → How INT8 math maps to silicon
What a transformer is → Why KV-cache dominates memory at inference
Models run on GPUs → How schedulers balance latency vs throughput
Edge devices have limits → How to co-design models and hardware

Book Structure

The textbook series follows a comprehensive systems progression across four core volumes:

Volume Unit of Work Core Systems Question Consequence of Failure
📗 Volume I
Foundations
The Model How do we make intelligence execute efficiently on a single node? Bad prediction or degraded runtime efficiency.
📘 Volume II
Scaling (Preview)
The Fleet How do we scale intelligence across distributed clusters and datacenters? Multi-million dollar cluster stall or service outage.
🟣 Volume III
Agentic (In Dev)
The Trajectory How do we govern intelligence acting autonomously over long horizons? Compounding trajectory drift and unauthorized side-effects.
🌲 Volume IV
Physical AI (In Dev)
The Physical Plant How do we let intelligence act safely on matter and physical systems? Irreversible physical damage in the real world.

Note: Volumes III and IV are in development. They change quickly as I iterate, so expect chapters to be added, reorganized, and rewritten. You are welcome to follow along as they take shape.

How the Volumes Connect

Each volume in the series expands the systems boundary, answering the question that the previous level leaves open:


FAQ

Why do you do all this?

I consider myself a student of my own learning.

Whenever I want to understand an emerging or complex systems discipline, I learn it by trying to teach and build it from first principles. Writing forces me to slow down: to identify invariants, formalize abstractions, derive quantitative limits, and separate durable engineering foundations from passing industry hype.

This repository—the books, software frameworks, and hardware kits—is my open research and teaching instrument. It is how I clarify my own thinking for research, benchmarking programs (like MLPerf), and classroom instruction. If sharing this open process helps other engineers and students along the way, you are more than welcome to follow along.

Who is this for, and what should I know first?

This is for anyone who wants to engineer intelligent systems, not only train models: students, working engineers moving into ML infrastructure, and educators building a course. We assume you can program in Python and have met basic machine learning ideas, but the book builds the systems concepts from the ground up. You do not need a background in computer architecture, distributed systems, or datacenter operations. Volume I starts at the foundations, and the rest of the curriculum (TinyTorch, labs, hardware kits, and the simulator) lets you learn by building rather than only by reading.

Do I need Volume I before Volume II? What is the difference?

The two volumes differ in scope, not depth. Both are equally rigorous. Volume I is the single-machine world: how an ML system works on one node with a handful of accelerators, from data and a single neuro

cs249r_book (harvard-edge/cs249r_book)

Searching Database…

这是什么?一套关于机器学习系统(也就是 AI 工程)的开源教科书和完整课程体系,来自哈佛 CS249r 课程:共四卷,涵盖基础、规模化、智能体 AI 和具身 AI,还配有实验、项目和教师教学材料。
它只是一本可以读的书,还是一门带动手实践的整体课程?是一套完整的课程体系,不只是阅读材料:TinyTorch 会让你亲手搭建一个机器学习框架,实验是可交互的 Marimo 笔记本,硬件套件可以部署到真实设备上,MLSys·im 则是一个模拟器,用来模拟那些你租不到的基础设施。
作为自学者,我该怎么入门?先读第一卷并做一下 Lab 00,然后深入下去:一个模块一个模块地搭建 TinyTorch 框架,在实验中探索各种权衡取舍,用 MLSys·im 对大规模系统进行建模,再用 StaffML 练习机器学习系统方向的面试。
开始之前我需要先会哪些东西?你需要会用 Python 编程,并了解机器学习的基本概念。不需要任何计算机体系结构、分布式系统或数据中心方面的背景——这本书会从零开始讲解系统方面的概念。
四卷都真的写完了吗?没有。第一卷已经发布,第二卷处于预览阶段;第三卷(智能体)和第四卷(具身 AI)仍在开发中,内容变化很快——作者请读者暂时不要引用或直接用它们来教学。
这套课程是给谁用的?面向学生、转行进入机器学习基础设施方向的工程师,以及想开课的教师——教师可以使用 Instructor Hub,里面有两份 16 周的教学大纲、评分标准、助教手册,以及每一章的 Beamer 幻灯片。
TinyTorch 是什么?一条由 20 个循序渐进的模块组成的学习路线,让你从零开始搭建自己的机器学习框架——这套课程的理念是:只有亲手造过一遍,你才算真正理解一个系统。
四卷各自讲的是什么?第一卷:基础——让智能在单个节点上高效运行。第二卷:规模化——集群、加速器、并行和推理服务。第三卷:智能体——记忆、工具、规划以及多智能体系统。第四卷:具身 AI——感知、机器人、实时控制与安全。
作者为什么要做一个完整的课程体系,而不只是写一本书?他把这个仓库当作一个开放的研究和教学工具:写作迫使他区分哪些是经得起时间的工程基础、哪些只是一时的炒作;只读不动手的学生无法真正内化知识,而只写代码的学生又难以举一反三。
有纸质版吗?有——纸质精装版将于 2026 年由 MIT Press 出版;目前所有内容都可以在 mlsysbook.ai 上免费在线阅读。
Size
3.8 GB
Stars
29K
Age
3y
Commits · 90 Days