Skip to content

harvard-edge/cs249r_book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13,699 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Machine Learning Systems

Principles and Practices of Engineering Artificially Intelligent Systems

English中文日本語한국어

Book TinyTorch Labs Kits MLSys·im
Slides Instructors StaffML Newsletter Updated

License Cite Fund Us

📘 Textbook📗 Vol I + 📘 Vol II🔥 TinyTorch🔬 Labs🔮 MLSys·im💼 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 Two-volume MIT Press textbook. The theory, the mental models, and the quantitative reasoning that everything else builds on. Vol I · Vol II
🔬 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:

  • Socratiq explores AI-guided reading, contextual quizzes, and spaced repetition for static learning sites.
  • MLPerf EDU is an under-construction pedagogical benchmark suite aligned with MLCommons MLPerf.
  • Periodic Table of ML Systems is a compact concept map for organizing recurring systems ideas.

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 follows the Hennessy & Patterson pedagogical model across two volumes:

Volume Theme Scope
📗 Volume I Build, Optimize, Deploy Single-machine ML systems (1–8 GPUs). Foundations, optimization, and deployment on one node.
📘 Volume II Scale, Distribute, Govern Distributed systems at production scale. Multi-machine infrastructure, fault tolerance, and governance.

Quick Start

Read the textbook. Start with Volume I or continue to Volume II. It's the foundation for everything else.

Pick a hands-on path. Build a framework (TinyTorch), explore trade-offs (Labs), model constraints (MLSys·im), or deploy to real hardware (Kits).

Test yourself. Drill StaffML: physics-grounded systems design questions across cloud, edge, mobile, and TinyML.

Teach it. Adopt the curriculum with the AI Engineering Blueprint and lecture slides.

Branch Guide

Note

You are on the dev branch. Active development happens here. For the last stable release, see the main branch.

Branch What's on it Status
🟢 main
mlsysbook.ai
Single-volume textbook (current edition) Live — this is what readers see today.
🟡 dev
← you are here
Volume I — two-volume split (content complete, editorial polish)
Volume II — At Scale (active development)
Curriculum — TinyTorch, Kits, MLSys·im, Labs, StaffML
TinyTorch and Hardware Kits are live.
MLSys·im, Labs, and StaffML are early-release and actively iterated.

The two-volume split replaces the single-volume edition at launch.


Support This Work

Stars    Open Collective

Star the repo
Stars signal to universities and foundations that this work matters. They directly fund workshops and hardware kits for underserved classrooms.

Star History Chart
100 → 1,000 → 10,000 → 100,000 → 1M learners by 2030
Fund the mission
All contributions go to Open Collective, a transparent fund for educational outreach. Every dollar goes to reaching more students.

Open Collective

Contributing

I want to... Go here
📖 Fix a typo or improve a chapter Textbook contributing guide
🔥 Add a TinyTorch module or fix a bug TinyTorch contributing guide
🛠️ Improve hardware labs Hardware kits guide
🔬 Improve interactive labs or simulator models Labs guide · MLSys·im guide
💼 Improve assessment or career-readiness content StaffML guide · quiz refresh guide
🧠 Improve AI learning tools Socratiq guide
🐛 Report an issue GitHub Issues
💬 Ask a question GitHub Discussions

License

This is a multi-component repository, and each component is released under its own license to match its purpose. The file inside each directory (e.g. tinytorch/LICENSE, interviews/staffml/LICENSE) is authoritative.

Component License What it means
Textbook (book/), Labs (labs/), Kits (kits/), Slides (slides/), Instructors (instructors/) CC-BY-NC-SA 4.0 Share and adapt for non-commercial use, with attribution and same-license sharing.
TinyTorch MIT Permissive — use, modify, redistribute, including commercially.
MLSys·im Apache 2.0 Permissive with explicit patent grant.
StaffML AGPL v3 Strong copyleft — modifications to deployed services must be published. Commercial licensing available; contact the authors.
StaffML question corpus CC BY-NC 4.0 Research and educational use; commercial use requires permission.
TinyDigits dataset BSD 3-Clause Permissive (matches sklearn ancestry).
TinyTalks dataset CC BY 4.0 Permissive with attribution; commercial use allowed.

A user-facing summary lives at mlsysbook.ai/about/license.

If you are an institution considering adoption, or a company interested in commercial terms for a copyleft component, please reach out to edu@tinyML.org.


Contributors

Thanks goes to these wonderful people who have contributed to making this resource better for everyone!

Legend: 🪲 Bug Hunter · 🧑‍💻 Code Contributor · ✍️ Doc Wizard · 🎨 Design Artist · 🧠 Idea Spark · 🔎 Code Reviewer · 🧪 Test Tinkerer · 🛠️ Tool Builder

📖 Textbook Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🪲 🧑‍💻 🎨 ✍️ 🧠 🔎 🧪 🛠️
Marcelo Rovai
Marcelo Rovai

🧑‍💻 🎨 🧪
Gabriel Amazonas
Gabriel Amazonas

🪲 ✍️ 🧠
Zeljko Hrcek
Zeljko Hrcek

🧑‍💻 ✍️
Tess Watt
Tess Watt

🪲 ✍️
Kai Kleinbard
Kai Kleinbard

🧑‍💻 🛠️
Didier Durand
Didier Durand

✍️ 🪲
Rocky
Rocky

🪲 🧑‍💻
Gustaf Hammarberg
Gustaf Hammarberg

🪲 🧑‍💻
Jason Jabbour
Jason Jabbour

✍️
Ikechukwu Uchendu
Ikechukwu Uchendu

✍️
Naeem Khoshnevis
Naeem Khoshnevis

✍️
Sara Khosravi
Sara Khosravi

✍️
Douwe den Blanken
Douwe den Blanken

✍️
Jeffrey Ma
Jeffrey Ma

✍️
shanzehbatool
shanzehbatool

✍️
Elias
Elias

✍️
Jared Ping
Jared Ping

✍️
Itai Shapira
Itai Shapira

✍️
Maximilian Lam
Maximilian Lam

✍️
Jayson Lin
Jayson Lin

✍️
Sophia Cho
Sophia Cho

✍️
Andrea
Andrea

✍️
Alex Rodriguez
Alex Rodriguez

✍️
Korneel Van den Berghe
Korneel Van den Berghe

✍️
Nimo
Nimo

✍️
Colby Banbury
Colby Banbury

✍️
Zishen Wan
Zishen Wan

✍️
Mark Mazumder
Mark Mazumder

✍️
Abdulrahman Mahmoud
Abdulrahman Mahmoud

✍️
Divya Amirtharaj
Divya Amirtharaj

✍️
Srivatsan Krishnan
Srivatsan Krishnan

✍️
marin-llobet
marin-llobet

✍️
Aghyad Deeb
Aghyad Deeb

✍️
Haoran Qiu
Haoran Qiu

✍️
Emil Njor
Emil Njor

✍️
ELSuitorHarvard
ELSuitorHarvard

✍️
kaiM0ves
kaiM0ves

✍️
oishib
oishib

✍️
Jared Ni
Jared Ni

✍️
Aditi Raju
Aditi Raju

✍️
Michael Schnebly
Michael Schnebly

✍️
Thuong Duong
Thuong Duong

✍️
Yu-Shun Hsiao
Yu-Shun Hsiao

✍️
Henry Bae
Henry Bae

✍️
Eimhin Laverty
Eimhin Laverty

✍️
Jae-Won Chung
Jae-Won Chung

✍️
Shvetank Prakash
Shvetank Prakash

✍️
Marco Zennaro
Marco Zennaro

✍️
Arya Tschand
Arya Tschand

✍️
Andrew Bass
Andrew Bass

✍️
Pong Trairatvorakul
Pong Trairatvorakul

✍️
Eura Nofshin
Eura Nofshin

✍️
Matthew Stewart
Matthew Stewart

✍️
Emeka Ezike
Emeka Ezike

✍️
jianqingdu
jianqingdu

✍️
Jennifer Zhou
Jennifer Zhou

✍️
The Random DIY
The Random DIY

✍️
Fatima Shah
Fatima Shah

✍️
Bruno Scaglione
Bruno Scaglione

✍️
Allen-Kuang
Allen-Kuang

✍️
Tauno Erik
Tauno Erik

✍️
gnodipac886
gnodipac886

✍️
Sercan Aygün
Sercan Aygün

✍️
TheHiddenLayer
TheHiddenLayer

✍️
Gauri Jain
Gauri Jain

✍️
Fin Amin
Fin Amin

✍️
Alex Oesterling
Alex Oesterling

✍️
Abenezer Angamo
Abenezer Angamo

✍️
Baldassarre Cesarano
Baldassarre Cesarano

✍️
Jahnic Beck
Jahnic Beck

✍️
अरनव शुक्ला | Arnav Shukla
अरनव शुक्ला | Arnav Shukla

✍️
Rin
Rin

✍️
Bilge Acun
Bilge Acun

✍️
Andy Cheng
Andy Cheng

✍️
Aritra Ghosh
Aritra Ghosh

✍️
abigailswallow
abigailswallow

✍️
Yang Zhou
Yang Zhou

✍️
JEON HYUNJUN(Luciano)
JEON HYUNJUN(Luciano)

✍️
Emmanuel Rassou
Emmanuel Rassou

✍️
Jason Yik
Jason Yik

✍️
Jessica Quaye
Jessica Quaye

✍️
Cursor Agent
Cursor Agent

✍️
happyappledog
happyappledog

✍️
Snuggs
Snuggs

✍️
Sam Wilcock
Sam Wilcock

✍️
Shreya Johri
Shreya Johri

✍️
Sonia Murthy
Sonia Murthy

✍️
Costin-Andrei Oncescu
Costin-Andrei Oncescu

✍️
formlsysbookissue
formlsysbookissue

✍️
Annie Laurie Cook
Annie Laurie Cook

✍️
Parampreet Singh
Parampreet Singh

✍️
Vijay Edupuganti
Vijay Edupuganti

✍️
Jothi Ramaswamy
Jothi Ramaswamy

✍️
Batur Arslan
Batur Arslan

✍️
Curren Iyer
Curren Iyer

✍️
Edward Jin
Edward Jin

✍️
bluebaer7
bluebaer7

✍️
yanjingl
yanjingl

✍️
a-saraf
a-saraf

✍️
songhan
songhan

✍️
jvijay
jvijay

✍️
Zishen
Zishen

✍️
Kristian Radoš
Kristian Radoš

✍️
Dang Truong
Dang Truong

🧑‍💻
pipme
pipme

✍️
Salman Chishti
Salman Chishti

✍️
Paolo Estavillo
Paolo Estavillo

✍️
GronuJ
GronuJ

✍️
Pratham Chaudhary
Pratham Chaudhary

🧑‍💻
Octopus
Octopus

✍️

🔥 TinyTorch Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🪲 🧑‍💻 🎨 ✍️ 🧠 🔎 🧪 🛠️
kai
kai

🪲 🧑‍💻 🎨 ✍️ 🧪
Dang Truong
Dang Truong

🪲 🧑‍💻 ✍️ 🧪
Farhan Asghar
Farhan Asghar

🪲 🧑‍💻 🎨 ✍️
Rocky
Rocky

🪲 🧑‍💻 ✍️ 🧪
Didier Durand
Didier Durand

🪲 🧑‍💻 ✍️
rnjema
rnjema

🧑‍💻 ✍️ 🛠️
Pratham Chaudhary
Pratham Chaudhary

🪲 🧑‍💻 ✍️
Karthik Dani
Karthik Dani

🪲 🧑‍💻
Avik De
Avik De

🪲 🧪
Takosaga
Takosaga

🪲 ✍️
joeswagson
joeswagson

🧑‍💻 🛠️
AndreaMattiaGaravagno
AndreaMattiaGaravagno

🧑‍💻 ✍️
Rolds
Rolds

🪲 🧑‍💻
asgalon
asgalon

🧑‍💻 ✍️
Amir Alasady
Amir Alasady

🪲
jettythek
jettythek

🧑‍💻
wzz
wzz

🪲
Ng Bo Lin
Ng Bo Lin

✍️
keo-dara
keo-dara

🪲
Wayne Norman
Wayne Norman

🪲
Ilham Rafiqin
Ilham Rafiqin

🪲
Oscar Flores
Oscar Flores

✍️
harishb00a
harishb00a

✍️
Pastor Soto
Pastor Soto

✍️
Salman Chishti
Salman Chishti

🧑‍💻
Aditya Mulik
Aditya Mulik

✍️
Ademola Arigbabuwo
Ademola Arigbabuwo

✍️
Yaroslav Halchenko
Yaroslav Halchenko

🧑‍💻
Harish
Harish

✍️

🚀 MLSys·im Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🧑‍💻 🎨 ✍️ 🧠
Peter Koellner
Peter Koellner

🪲 ✍️
Rocky
Rocky

🪲 🧑‍💻
Zeljko Hrcek
Zeljko Hrcek

🧑‍💻

🤖 StaffML Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🎨 ✍️ 🧠
Rocky
Rocky

🪲 🧑‍💻
Farhan Asghar
Farhan Asghar

🧑‍💻

🛠️ Hardware Kits Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🪲 🧑‍💻 🎨 ✍️ 🧪 🛠️
Marcelo Rovai
Marcelo Rovai

✍️ 🧑‍💻 🎨
Farhan Asghar
Farhan Asghar

🪲 🧑‍💻
Salman Chishti
Salman Chishti

🧑‍💻
Pratham Chaudhary
Pratham Chaudhary

🧑‍💻
Rocky
Rocky

🪲

🧪 Labs Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🧑‍💻 🎨 ✍️
Rocky
Rocky

🪲 🧑‍💻 🎨
Salman Chishti
Salman Chishti

🧑‍💻
Pratham Chaudhary
Pratham Chaudhary

🧑‍💻
Peter Koellner
Peter Koellner

🪲

🎞️ Slides Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🧑‍💻 🎨 ✍️

🗺️ Instructor Site Contributors

Vijay Janapa Reddi
Vijay Janapa Reddi

🧑‍💻 🎨 ✍️
Rocky
Rocky

🧑‍💻 ✍️ 🔎
Farhan Asghar
Farhan Asghar

🪲 🧑‍💻

⚗️ Periodic Table of ML Systems Contributors

Coming soon!


✉️ Subscribe💬 Join discussions🌐 Visit mlsysbook.ai

Made with ❤️ for AI engineers
in the making, around the world 🌎