Files

47 KiB

Machine Learning Systems

Principles and Practices of Engineering Artificially Intelligent Systems

Build Website PDF EPUB

Read Online | Volume I | Volume II | PDF


Note

📌 Early release (2026)

The textbook shipped with the 2026 MLSysBook refresh. Chapters, figures, quizzes, cross-refs, and the Quarto build pipeline are actively iterated as we teach from the material.

Feedback — GitHub issues or pull requests (errata especially welcome).

What This Is

The ML Systems textbook teaches you how to engineer AI systems that work in the real world. It bridges machine learning theory with systems engineering practice, covering everything from neural network fundamentals to production deployment.

This directory holds the textbook's build and quality toolchain: the binder command, its checks, and supporting tools. Run it from the repository root as ./binder/binder. The book sources live in books/.

This folder is also Binder's configuration folder

repo2docker, the engine behind mybinder.org, reads its configuration from a repository's binder/ folder. That is what runs when someone presses a TinyTorch "Launch Binder" button. It looks only for a fixed set of file names, and this repository uses two of them here: postBuild and requirements.txt.

Keep the toolchain from colliding with that:

  • Do not add a top-level requirements.txt, environment.yml, Dockerfile, apt.txt, runtime.txt, start, Pipfile, or install.R to this folder for the toolchain's own use. repo2docker would read it and change the cloud image.
  • Do not recreate a .binder/ folder at the repository root. repo2docker refuses to build when both binder/ and .binder/ exist.

What You Will Learn

ML Concepts Systems Engineering
Neural networks and deep learning Memory hierarchies and caching
Model architectures (CNNs, Transformers) Hardware accelerators (GPUs, TPUs, NPUs)
Training and optimization Distributed systems and parallelism
Inference and deployment Power and thermal management
Compression and quantization Latency, throughput, and efficiency

The ML ↔ Systems Bridge

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
Models run on GPUs How schedulers balance latency vs throughput
Edge devices have limits How to co-design models and hardware

Book Structure

This textbook is organized into two volumes following the Hennessy & Patterson pedagogical model:

Volume Theme Focus
Volume I Build, Optimize, Deploy Single-machine ML systems, foundational principles
Volume II Scale, Distribute, Govern Distributed systems at production scale

Volume I: Build, Optimize, Deploy

Part Focus Chapters
Foundations Core concepts Introduction, System Paradigms, DL Primer, Architectures
Development Building blocks Workflow, Data Engineering, Frameworks, Training
Optimization Making it fast Efficient AI, Optimizations, HW Acceleration, Benchmarking
Deployment Making it work Serving, MLOps, Responsible Engineering

Volume II: Scale, Distribute, Govern

Part Focus Chapters
Foundations of Scale Infrastructure Infrastructure, Storage, Communication
Distributed Systems Coordination Distributed Training, Fault Tolerance, Inference, Edge Intelligence
Production Challenges Operations On-device Learning, Privacy & Security, Robust AI, Ops at Scale
Responsible Deployment Trust Responsible AI, Sustainable AI, AI for Good, Frontiers

What Makes This Book Different

Systems first: Start with hardware constraints and work up to algorithms, not the other way around.

Production focus: Every concept connects to real deployment scenarios, not just research benchmarks.

Open and evolving: Community-driven updates keep content current with a fast-moving field.

Hands-on companion: Pair with TinyTorch to build what you learn from scratch.


Quick Start

For Readers

# Read online
open https://mlsysbook.ai/book/

# Download formats
curl -O https://mlsysbook.ai/book/assets/downloads/Machine-Learning-Systems.pdf
curl -O https://mlsysbook.ai/book/assets/downloads/Machine-Learning-Systems.epub

For Contributors

cd book

# First time setup
./binder/binder setup
./binder/binder doctor

# Daily workflow
./binder/binder clean              # Clean build artifacts
./binder/binder build              # Build HTML book
./binder/binder preview intro      # Preview chapter with live reload

# Build all formats
./binder/binder build pdf          # Build PDF
./binder/binder build epub         # Build EPUB

# Utilities
./binder/binder help               # Show all commands
./binder/binder list               # List chapters
./binder/binder check all          # Run curated validation checks (same family as pre-commit)
./binder/binder fix repo-health    # Repo diagnostics

Iterate on one chapter

From the repository root, select a volume and a chapter filename or readable title. The same command supports --vol1, --vol2, --vol3, and --vol4:

./binder/binder build pdf "causal boundary" --vol4 --skip-validate -v
./binder/binder build pdf 02_body --vol4 --skip-validate
./binder/binder build pdf "Preface" --vol4 --skip-validate
./binder/binder build html "causal boundary" --vol4
./binder/binder list --vol4
./binder/binder layout purpose books/_build/pdf-vol4/chapters/01_boundary/01_boundary.pdf --vol4 --chapter "causal boundary"

Names match exact filenames first, then titles, unique partial names, and close typos. Ambiguous queries list the matching paths and stop; they never choose an arbitrary chapter. Use commas to select several chapters, or a volume-prefixed path such as vol4/01_boundary/01_boundary.qmd.

Each selective build renders the generated index.qmd plus the selected chapter(s). Quarto may also report processing the root 404.qmd as book-project housekeeping; it is not included in the PDF's chapter content. For Volume IV PDF/EPUB, the index comes from books/vol4/frontmatter/about.qmd; selecting the preface itself renders it only once. Canonical volume configs are unchanged, and previous generated entry points are restored when the command finishes or is interrupted.

Outputs are isolated under books/_build/<format>-<volume>/chapters/<chapter>/, for example books/_build/pdf-vol4/chapters/01_boundary/01_boundary.pdf. A selective build does not overwrite the full-volume PDF. Builds in one checkout must run one at a time because Quarto uses a shared active config and index; to build several chapters at once, add --parallel, which runs each build in its own git worktree (see Parallel builds).

Isolated chapters have local numbering and may have unresolved references to omitted chapters. --skip-validate supports these layout iterations; finish with ./binder/binder build pdf --vol4 to verify the complete volume with its canonical numbering and references. For isolated proofs mapped to a trusted full-book AUX file, use binder layout chapter instead.

The existing opener-fit gate supports all four volumes and both titled Purpose sections and untitled opening hooks. It checks every prose paragraph and any callout before the first pagebreak against the chapter's actual PDF title page. It reports missing chapters or unmatched source/PDF text as failures. Use --chapter for a selective proof; omitting it requires all canonical main chapters to be present:

./binder/binder layout purpose books/_build/pdf-vol4/Machine-Learning-Systems-Vol4.pdf --vol4
# Equivalent check against the standard full-volume output path:
./binder/binder check pdf --vol4 --scope purpose-overflow

This text-fit gate complements visual inspection of the cover figure, margin content, and learning-objectives page; it does not inspect figure geometry.


Directory Structure

book/
├── quarto/              # Book source (Quarto markdown)
│   ├── contents/        # Chapter content
│   │   ├── vol1/        # Volume I: Build, Optimize, Deploy
│   │   ├── vol2/        # Volume II: Scale, Distribute, Govern
│   │   ├── frontmatter/ # Preface, about, changelog
│   │   └── backmatter/  # References, glossary
│   ├── assets/          # Images, downloads
│   └── config/          # Quarto configuration files
├── cli/                 # Binder CLI tool
├── docker/              # Development containers
├── docs/                # Documentation
├── tools/               # Build scripts
└── binder               # CLI entry point

Documentation

Audience Resources
Readers Online Book ・ Volume I ・ Volume II ・ PDF
Contributors CONTRIBUTING.md ・ BUILD.md
Developers DEVELOPMENT.md ・ BINDER.md

Binder is the public automation API for book build/validate/maintenance workflows. Use Binder subcommands in editor integrations and CI where possible.


Contributing

We welcome contributions! See docs/CONTRIBUTING.md for guidelines.

  1. Fork and clone the repository
  2. Set up your environment: ./binder/binder setup
  3. Find an issue or propose a change
  4. Make your changes in books/ (one directory per volume)
  5. Preview your changes: ./binder/binder preview <chapter>
  6. Submit a PR with a clear description

Component Description
Main README Project overview and ecosystem
TinyTorch Build ML frameworks from scratch
Hardware Kits Deploy to Arduino, Raspberry Pi, edge devices
Website Read the book online

Contributors

Thanks to these wonderful people who helped improve the book!

Legend: 🪲 Bug Hunter · ⚡ Code Warrior · 📚 Documentation Hero · 🎨 Design Artist · 🧠 Idea Generator · 🔎 Code Reviewer · 🧪 Test Engineer · 🛠️ Tool Builder

Vijay Janapa Reddi
Vijay Janapa Reddi

🪲 🧑‍💻 🎨 ✍️ 🧠 🔎 🧪 🛠️
Zeljko Hrcek
Zeljko Hrcek

🪲 🧑‍💻 🎨 ✍️ 🛠️
Rocky
Rocky

🪲 🧑‍💻 🎨 ✍️
Farhan Asghar
Farhan Asghar

🪲 🧑‍💻 🎨 ✍️
Marcelo Rovai
Marcelo Rovai

🧑‍💻 🎨 🧪
Gabriel Amazonas
Gabriel Amazonas

🪲 ✍️ 🧠
Octopus
Octopus

🪲 🧑‍💻 ✍️
Tess Watt
Tess Watt

🪲 ✍️
Jahnic Beck
Jahnic Beck

🪲 ✍️
bluebaer
bluebaer

🪲 ✍️
Kai Kleinbard
Kai Kleinbard

🧑‍💻 🛠️
Didier Durand
Didier Durand

✍️ 🪲
Salman Chishti
Salman Chishti

🧑‍💻 ✍️
GronuJ
GronuJ

🪲 ✍️
Gustaf Hammarberg
Gustaf Hammarberg

🪲 🧑‍💻
Aayush Kumar
Aayush Kumar

🪲 🧑‍💻
Yue Cheng
Yue Cheng

🪲 🧑‍💻
s3rg3ysh
s3rg3ysh

🪲 ✍️
Johnson K C
Johnson K C

🧑‍💻 🛠️
mehdi B
mehdi B

🪲 🧑‍💻
Shivtej Gaikwad
Shivtej Gaikwad

🪲 🧑‍💻
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

✍️
अरनव शुक्ला | 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

✍️
yanjingl
yanjingl

✍️
a-saraf
a-saraf

✍️
songhan
songhan

✍️
jvijay
jvijay

✍️
Zishen
Zishen

✍️
Kristian Radoš
Kristian Radoš

✍️
Dang Truong
Dang Truong

🧑‍💻
pipme
pipme

✍️
Paolo Estavillo
Paolo Estavillo

✍️
Pratham Chaudhary
Pratham Chaudhary

🧑‍💻
Arul Kumaravel
Arul Kumaravel

🪲
STG
STG

🪲
Xizhuo
Xizhuo

🧠
CorpusIQ
CorpusIQ

🧠

Recognize a contributor: Comment on any issue or PR:

@all-contributors please add @username for doc, review, translation, or design

License

Book content is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0).

See LICENSE.md for details.