mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-29 17:20:21 -05:00
1322 lines
58 KiB
HTML
1322 lines
58 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
|
||
|
||
<meta charset="utf-8">
|
||
<meta name="generator" content="quarto-1.7.31">
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
|
||
<meta name="author" content="Vijay Janapa Reddi">
|
||
<meta name="dcterms.date" content="2026-01-07">
|
||
|
||
<title>ML Systems Textbook</title>
|
||
<style>
|
||
code{white-space: pre-wrap;}
|
||
span.smallcaps{font-variant: small-caps;}
|
||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||
div.column{flex: auto; overflow-x: auto;}
|
||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||
ul.task-list{list-style: none;}
|
||
ul.task-list li input[type="checkbox"] {
|
||
width: 0.8em;
|
||
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
||
vertical-align: middle;
|
||
}
|
||
</style>
|
||
|
||
|
||
<script src="site_libs/quarto-nav/quarto-nav.js"></script>
|
||
<script src="site_libs/clipboard/clipboard.min.js"></script>
|
||
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
|
||
<script src="site_libs/quarto-search/fuse.min.js"></script>
|
||
<script src="site_libs/quarto-search/quarto-search.js"></script>
|
||
<meta name="quarto:offset" content="./">
|
||
<link href="./contents/frontmatter/foreword.html" rel="next">
|
||
<link href="./assets/images/icons/favicon.png" rel="icon" type="image/png">
|
||
<script src="site_libs/quarto-html/quarto.js" type="module"></script>
|
||
<script src="site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
|
||
<script src="site_libs/quarto-html/popper.min.js"></script>
|
||
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
|
||
<script src="site_libs/quarto-html/anchor.min.js"></script>
|
||
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
|
||
<link href="site_libs/quarto-html/quarto-syntax-highlighting-92151ed919028c7172e396588fd5eb2d.css" rel="stylesheet" class="quarto-color-scheme" id="quarto-text-highlighting-styles">
|
||
<link href="site_libs/quarto-html/quarto-syntax-highlighting-dark-92151ed919028c7172e396588fd5eb2d.css" rel="stylesheet" class="quarto-color-scheme quarto-color-alternate" id="quarto-text-highlighting-styles">
|
||
<link href="site_libs/quarto-html/quarto-syntax-highlighting-92151ed919028c7172e396588fd5eb2d.css" rel="stylesheet" class="quarto-color-scheme-extra" id="quarto-text-highlighting-styles">
|
||
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
|
||
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
|
||
<link href="site_libs/bootstrap/bootstrap-e20ddbae1c31dc3d16ae49e0de1a1121.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme" id="quarto-bootstrap" data-mode="light">
|
||
<link href="site_libs/bootstrap/bootstrap-dark-c4b04d4abe0a732bdbc9f57301cfc3b1.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme quarto-color-alternate" id="quarto-bootstrap" data-mode="light">
|
||
<link href="site_libs/bootstrap/bootstrap-e20ddbae1c31dc3d16ae49e0de1a1121.min.css" rel="stylesheet" append-hash="true" class="quarto-color-scheme-extra" id="quarto-bootstrap" data-mode="light">
|
||
<link href="site_libs/quarto-contrib/foldbox/foldbox.css" rel="stylesheet">
|
||
<script id="quarto-search-options" type="application/json">{
|
||
"location": "navbar",
|
||
"copy-button": false,
|
||
"collapse-after": 3,
|
||
"panel-placement": "end",
|
||
"type": "overlay",
|
||
"limit": 50,
|
||
"keyboard-shortcut": [
|
||
"/"
|
||
],
|
||
"language": {
|
||
"search-no-results-text": "No results",
|
||
"search-matching-documents-text": "matching documents",
|
||
"search-copy-link-title": "Copy link to search",
|
||
"search-hide-matches-text": "Hide additional matches",
|
||
"search-more-match-text": "more match in this document",
|
||
"search-more-matches-text": "more matches in this document",
|
||
"search-clear-button-title": "Clear",
|
||
"search-text-placeholder": "",
|
||
"search-detached-cancel-button-title": "Cancel",
|
||
"search-submit-button-title": "Submit",
|
||
"search-label": "Search"
|
||
}
|
||
}</script>
|
||
<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-M21L0CBCVN"></script>
|
||
|
||
<script type="text/javascript">
|
||
|
||
window.dataLayer = window.dataLayer || [];
|
||
function gtag(){dataLayer.push(arguments);}
|
||
gtag('js', new Date());
|
||
gtag('config', 'G-M21L0CBCVN', { 'anonymize_ip': true});
|
||
</script>
|
||
<script type="application/json" class="js-hypothesis-config">
|
||
{
|
||
"theme": "clean",
|
||
"openSidebar": false
|
||
}
|
||
</script>
|
||
<script async="" src="https://hypothes.is/embed.js"></script>
|
||
<script>
|
||
window.document.addEventListener("DOMContentLoaded", function (_event) {
|
||
document.body.classList.add('hypothesis-enabled');
|
||
});
|
||
</script>
|
||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
|
||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
||
<link rel="manifest" href="./site.webmanifest">
|
||
<link rel="apple-touch-icon" href="./assets/images/icons/favicon.png">
|
||
<meta name="theme-color" content="#A51C30">
|
||
|
||
<script type="module" src="./tools/scripts/socratiQ/bundle.js" defer=""></script>
|
||
<script src="./assets/scripts/sidebar-auto-collapse.js" defer=""></script>
|
||
<script src="./assets/scripts/version-link.js" defer=""></script>
|
||
<script src="./assets/scripts/subscribe-modal.js" defer=""></script>
|
||
<style>
|
||
.callout-resource-exercises {
|
||
--color1: #E0F2F1;
|
||
--color2: #20B2AA;
|
||
}
|
||
.callout-resource-videos {
|
||
--color1: #E0F2F1;
|
||
--color2: #20B2AA;
|
||
}
|
||
.callout-quiz-question {
|
||
--color1: #F0F0F8;
|
||
--color2: #5B4B8A;
|
||
}
|
||
.callout-chapter-connection {
|
||
--color1: #FDF2F7;
|
||
--color2: #A51C30;
|
||
}
|
||
.callout-colab {
|
||
--color1: #FFF5E6;
|
||
--color2: #FF6B35;
|
||
}
|
||
.callout-example {
|
||
--color1: #F0F8F6;
|
||
--color2: #148F77;
|
||
}
|
||
.callout-definition {
|
||
--color1: #F0F4F8;
|
||
--color2: #1B4F72;
|
||
}
|
||
.callout-quiz-answer {
|
||
--color1: #E8F2EA;
|
||
--color2: #4a7c59;
|
||
}
|
||
.callout-resource-slides {
|
||
--color1: #E0F2F1;
|
||
--color2: #20B2AA;
|
||
}
|
||
.callout-code {
|
||
--color1: #F2F4F8;
|
||
--color2: #D1D7E0;
|
||
}
|
||
</style>
|
||
<style>
|
||
details.callout-resource-exercises > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_resource_exercises.png");
|
||
}
|
||
details.callout-resource-videos > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_resource_videos.png");
|
||
}
|
||
details.callout-quiz-question > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_quiz_question.png");
|
||
}
|
||
details.callout-chapter-connection > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_chapter_connection.png");
|
||
}
|
||
details.callout-colab > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_colab.png");
|
||
}
|
||
details.callout-example > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_example.png");
|
||
}
|
||
details.callout-definition > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_definition.png");
|
||
}
|
||
details.callout-quiz-answer > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_quiz_answer.png");
|
||
}
|
||
details.callout-resource-slides > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_resource_slides.png");
|
||
}
|
||
details.callout-code > summary::before {
|
||
background-image: url("assets/images/icons/callouts/icon_callout_code.png");
|
||
}
|
||
</style>
|
||
|
||
|
||
<meta property="og:title" content="ML Systems Textbook">
|
||
<meta property="og:description" content="Principles and Practices of Engineering Artificially Intelligent Systems">
|
||
<meta property="og:image" content="https://mlsysbook.ai/book/assets/images/covers/cover-hardcover-book.png">
|
||
<meta property="og:site_name" content="Machine Learning Systems">
|
||
<meta property="og:image:height" content="1124">
|
||
<meta property="og:image:width" content="1333">
|
||
<meta property="og:locale" content="en_US">
|
||
<meta name="twitter:title" content="ML Systems Textbook">
|
||
<meta name="twitter:description" content="Principles and Practices of Engineering Artificially Intelligent Systems">
|
||
<meta name="twitter:image" content="https://mlsysbook.ai/book/assets/images/covers/cover-hardcover-book.png">
|
||
<meta name="twitter:card" content="summary_large_image">
|
||
<meta name="twitter:image-height" content="1124">
|
||
<meta name="twitter:image-width" content="1333">
|
||
</head>
|
||
|
||
<body class="nav-sidebar floating nav-fixed quarto-light"><script id="quarto-html-before-body" type="application/javascript">
|
||
const toggleBodyColorMode = (bsSheetEl) => {
|
||
const mode = bsSheetEl.getAttribute("data-mode");
|
||
const bodyEl = window.document.querySelector("body");
|
||
if (mode === "dark") {
|
||
bodyEl.classList.add("quarto-dark");
|
||
bodyEl.classList.remove("quarto-light");
|
||
} else {
|
||
bodyEl.classList.add("quarto-light");
|
||
bodyEl.classList.remove("quarto-dark");
|
||
}
|
||
}
|
||
const toggleBodyColorPrimary = () => {
|
||
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap:not([rel=disabled-stylesheet])");
|
||
if (bsSheetEl) {
|
||
toggleBodyColorMode(bsSheetEl);
|
||
}
|
||
}
|
||
const setColorSchemeToggle = (alternate) => {
|
||
const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
|
||
for (let i=0; i < toggles.length; i++) {
|
||
const toggle = toggles[i];
|
||
if (toggle) {
|
||
if (alternate) {
|
||
toggle.classList.add("alternate");
|
||
} else {
|
||
toggle.classList.remove("alternate");
|
||
}
|
||
}
|
||
}
|
||
};
|
||
const toggleColorMode = (alternate) => {
|
||
// Switch the stylesheets
|
||
const primaryStylesheets = window.document.querySelectorAll('link.quarto-color-scheme:not(.quarto-color-alternate)');
|
||
const alternateStylesheets = window.document.querySelectorAll('link.quarto-color-scheme.quarto-color-alternate');
|
||
manageTransitions('#quarto-margin-sidebar .nav-link', false);
|
||
if (alternate) {
|
||
// note: dark is layered on light, we don't disable primary!
|
||
enableStylesheet(alternateStylesheets);
|
||
for (const sheetNode of alternateStylesheets) {
|
||
if (sheetNode.id === "quarto-bootstrap") {
|
||
toggleBodyColorMode(sheetNode);
|
||
}
|
||
}
|
||
} else {
|
||
disableStylesheet(alternateStylesheets);
|
||
enableStylesheet(primaryStylesheets)
|
||
toggleBodyColorPrimary();
|
||
}
|
||
manageTransitions('#quarto-margin-sidebar .nav-link', true);
|
||
// Switch the toggles
|
||
setColorSchemeToggle(alternate)
|
||
// Hack to workaround the fact that safari doesn't
|
||
// properly recolor the scrollbar when toggling (#1455)
|
||
if (navigator.userAgent.indexOf('Safari') > 0 && navigator.userAgent.indexOf('Chrome') == -1) {
|
||
manageTransitions("body", false);
|
||
window.scrollTo(0, 1);
|
||
setTimeout(() => {
|
||
window.scrollTo(0, 0);
|
||
manageTransitions("body", true);
|
||
}, 40);
|
||
}
|
||
}
|
||
const disableStylesheet = (stylesheets) => {
|
||
for (let i=0; i < stylesheets.length; i++) {
|
||
const stylesheet = stylesheets[i];
|
||
stylesheet.rel = 'disabled-stylesheet';
|
||
}
|
||
}
|
||
const enableStylesheet = (stylesheets) => {
|
||
for (let i=0; i < stylesheets.length; i++) {
|
||
const stylesheet = stylesheets[i];
|
||
if(stylesheet.rel !== 'stylesheet') { // for Chrome, which will still FOUC without this check
|
||
stylesheet.rel = 'stylesheet';
|
||
}
|
||
}
|
||
}
|
||
const manageTransitions = (selector, allowTransitions) => {
|
||
const els = window.document.querySelectorAll(selector);
|
||
for (let i=0; i < els.length; i++) {
|
||
const el = els[i];
|
||
if (allowTransitions) {
|
||
el.classList.remove('notransition');
|
||
} else {
|
||
el.classList.add('notransition');
|
||
}
|
||
}
|
||
}
|
||
const isFileUrl = () => {
|
||
return window.location.protocol === 'file:';
|
||
}
|
||
const hasAlternateSentinel = () => {
|
||
let styleSentinel = getColorSchemeSentinel();
|
||
if (styleSentinel !== null) {
|
||
return styleSentinel === "alternate";
|
||
} else {
|
||
return false;
|
||
}
|
||
}
|
||
const setStyleSentinel = (alternate) => {
|
||
const value = alternate ? "alternate" : "default";
|
||
if (!isFileUrl()) {
|
||
window.localStorage.setItem("quarto-color-scheme", value);
|
||
} else {
|
||
localAlternateSentinel = value;
|
||
}
|
||
}
|
||
const getColorSchemeSentinel = () => {
|
||
if (!isFileUrl()) {
|
||
const storageValue = window.localStorage.getItem("quarto-color-scheme");
|
||
return storageValue != null ? storageValue : localAlternateSentinel;
|
||
} else {
|
||
return localAlternateSentinel;
|
||
}
|
||
}
|
||
const toggleGiscusIfUsed = (isAlternate, darkModeDefault) => {
|
||
const baseTheme = document.querySelector('#giscus-base-theme')?.value ?? 'light';
|
||
const alternateTheme = document.querySelector('#giscus-alt-theme')?.value ?? 'dark';
|
||
let newTheme = '';
|
||
if(authorPrefersDark) {
|
||
newTheme = isAlternate ? baseTheme : alternateTheme;
|
||
} else {
|
||
newTheme = isAlternate ? alternateTheme : baseTheme;
|
||
}
|
||
const changeGiscusTheme = () => {
|
||
// From: https://github.com/giscus/giscus/issues/336
|
||
const sendMessage = (message) => {
|
||
const iframe = document.querySelector('iframe.giscus-frame');
|
||
if (!iframe) return;
|
||
iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
||
}
|
||
sendMessage({
|
||
setConfig: {
|
||
theme: newTheme
|
||
}
|
||
});
|
||
}
|
||
const isGiscussLoaded = window.document.querySelector('iframe.giscus-frame') !== null;
|
||
if (isGiscussLoaded) {
|
||
changeGiscusTheme();
|
||
}
|
||
};
|
||
const authorPrefersDark = false;
|
||
const queryPrefersDark = window.matchMedia('(prefers-color-scheme: dark)');
|
||
const darkModeDefault = queryPrefersDark.matches;
|
||
document.querySelector('link#quarto-text-highlighting-styles.quarto-color-scheme-extra').rel = 'disabled-stylesheet';
|
||
document.querySelector('link#quarto-bootstrap.quarto-color-scheme-extra').rel = 'disabled-stylesheet';
|
||
let localAlternateSentinel = darkModeDefault ? 'alternate' : 'default';
|
||
// Dark / light mode switch
|
||
window.quartoToggleColorScheme = () => {
|
||
// Read the current dark / light value
|
||
let toAlternate = !hasAlternateSentinel();
|
||
toggleColorMode(toAlternate);
|
||
setStyleSentinel(toAlternate);
|
||
toggleGiscusIfUsed(toAlternate, darkModeDefault);
|
||
window.dispatchEvent(new Event('resize'));
|
||
};
|
||
queryPrefersDark.addEventListener("change", e => {
|
||
if(window.localStorage.getItem("quarto-color-scheme") !== null)
|
||
return;
|
||
const alternate = e.matches
|
||
toggleColorMode(alternate);
|
||
localAlternateSentinel = e.matches ? 'alternate' : 'default'; // this is used alongside local storage!
|
||
toggleGiscusIfUsed(alternate, darkModeDefault);
|
||
});
|
||
// Switch to dark mode if need be
|
||
if (hasAlternateSentinel()) {
|
||
toggleColorMode(true);
|
||
} else {
|
||
toggleColorMode(false);
|
||
}
|
||
</script>
|
||
|
||
<div id="quarto-search-results"></div>
|
||
<header id="quarto-header" class="headroom fixed-top">
|
||
<nav class="navbar navbar-expand-lg " data-bs-theme="dark">
|
||
<div class="navbar-container container-fluid">
|
||
<div class="navbar-brand-container mx-auto">
|
||
<a href="./index.html" class="navbar-brand navbar-brand-logo">
|
||
<img src="./assets/images/icons/favicon.png" alt="" class="navbar-logo">
|
||
</a>
|
||
<a class="navbar-brand" href="./index.html">
|
||
<span class="navbar-title">Machine Learning Systems</span>
|
||
</a>
|
||
</div>
|
||
<div id="quarto-search" class="" title="Search"></div>
|
||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" role="menu" aria-expanded="false" aria-label="Toggle navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
||
<span class="navbar-toggler-icon"></span>
|
||
</button>
|
||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||
<ul class="navbar-nav navbar-nav-scroll me-auto">
|
||
<li class="nav-item dropdown ">
|
||
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-textbook" role="link" data-bs-toggle="dropdown" aria-expanded="false">
|
||
<span class="menu-text">Textbook</span>
|
||
</a>
|
||
<ul class="dropdown-menu" aria-labelledby="nav-menu-textbook">
|
||
<li>
|
||
<a class="dropdown-item" href="./../book/"><i class="bi bi-book-half" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Textbook</span></a>
|
||
</li>
|
||
<li>
|
||
<a class="dropdown-item" href="./../tinytorch/"><i class="bi bi-fire" role="img">
|
||
</i>
|
||
<span class="dropdown-text">TinyTorch</span></a>
|
||
</li>
|
||
<li>
|
||
<a class="dropdown-item" href="./../kits/"><i class="bi bi-cpu" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Hardware Kits</span></a>
|
||
</li>
|
||
<li><hr class="dropdown-divider"></li>
|
||
<li>
|
||
<a class="dropdown-item" href="./../labs/"><i class="bi bi-lightbulb" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Labs (Coming 2026)</span></a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<ul class="navbar-nav navbar-nav-scroll ms-auto">
|
||
<li class="nav-item dropdown ">
|
||
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-downloads" role="link" data-bs-toggle="dropdown" aria-expanded="false">
|
||
<i class="bi bi-download" role="img">
|
||
</i>
|
||
<span class="menu-text">Downloads</span>
|
||
</a>
|
||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-downloads">
|
||
<li>
|
||
<a class="dropdown-item" href="./assets/downloads/Machine-Learning-Systems.pdf" target="_blank"><i class="bi bi-file-pdf" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Textbook PDF</span></a>
|
||
</li>
|
||
<li>
|
||
<a class="dropdown-item" href="./assets/downloads/Machine-Learning-Systems.epub" target="_blank"><i class="bi bi-journal-text" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Textbook EPUB</span></a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="https://github.com/harvard-edge/cs249r_book#support-this-work" target="_blank"> <i class="bi bi-star" role="img">
|
||
</i>
|
||
<span class="menu-text">Star</span></a>
|
||
</li>
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="https://opencollective.com/mlsysbook" target="_blank"> <i class="bi bi-heart" role="img">
|
||
</i>
|
||
<span class="menu-text">Support</span></a>
|
||
</li>
|
||
<li class="nav-item">
|
||
<a class="nav-link" href="./#subscribe"> <i class="bi bi-envelope" role="img">
|
||
</i>
|
||
<span class="menu-text">Subscribe</span></a>
|
||
</li>
|
||
<li class="nav-item dropdown ">
|
||
<a class="nav-link dropdown-toggle" href="#" id="nav-menu-github" role="link" data-bs-toggle="dropdown" aria-expanded="false">
|
||
<i class="bi bi-github" role="img">
|
||
</i>
|
||
<span class="menu-text">GitHub</span>
|
||
</a>
|
||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="nav-menu-github">
|
||
<li>
|
||
<a class="dropdown-item" href="https://github.com/harvard-edge/cs249r_book" target="_blank"><i class="bi bi-pencil" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Edit this page</span></a>
|
||
</li>
|
||
<li>
|
||
<a class="dropdown-item" href="https://github.com/harvard-edge/cs249r_book/issues/new" target="_blank"><i class="bi bi-bug" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Report an issue</span></a>
|
||
</li>
|
||
<li>
|
||
<a class="dropdown-item" href="https://github.com/harvard-edge/cs249r_book/discussions" target="_blank"><i class="bi bi-chat" role="img">
|
||
</i>
|
||
<span class="dropdown-text">Discussions</span></a>
|
||
</li>
|
||
<li>
|
||
<a class="dropdown-item" href="https://github.com/harvard-edge/cs249r_book" target="_blank"><i class="bi bi-code" role="img">
|
||
</i>
|
||
<span class="dropdown-text">View source</span></a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div> <!-- /navcollapse -->
|
||
<div class="quarto-navbar-tools">
|
||
<a href="" class="quarto-color-scheme-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleColorScheme(); return false;" title="Toggle dark mode"><i class="bi"></i></a>
|
||
</div>
|
||
</div> <!-- /container-fluid -->
|
||
</nav>
|
||
<nav class="quarto-secondary-nav">
|
||
<div class="container-fluid d-flex">
|
||
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
||
<i class="bi bi-layout-text-sidebar-reverse"></i>
|
||
</button>
|
||
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./index.html">Homepage</a></li></ol></nav>
|
||
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
|
||
</a>
|
||
</div>
|
||
</nav>
|
||
<div id="quarto-announcement" data-announcement-id="b43e2aeb169c88acb08fe42121c141fd" class="alert alert-primary hidden"><i class="bi bi-megaphone quarto-announcement-icon"></i><div class="quarto-announcement-content">
|
||
<p>🎉 <strong>Happy New Year!</strong> New navbar with dropdown menus. Try them out!<br> 🔥 <strong>TinyTorch:</strong> Build your own ML framework from scratch. <a href="https://mlsysbook.ai/tinytorch">Start →</a><br> 📦 <strong>Hardware Kits:</strong> Arduino, Seeed & Raspberry Pi labs. <a href="https://mlsysbook.ai/kits">Explore →</a><br> 📬 <strong>Newsletter:</strong> ML Systems insights & updates. <a href="#subscribe">Subscribe →</a></p>
|
||
</div><i class="bi bi-x-lg quarto-announcement-action"></i></div>
|
||
</header>
|
||
<!-- content -->
|
||
<div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article page-navbar">
|
||
<!-- sidebar -->
|
||
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto">
|
||
<div class="sidebar-menu-container">
|
||
<ul class="list-unstyled mt-1">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./index.html" class="sidebar-item-text sidebar-link active">
|
||
<span class="menu-text">Homepage</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/frontmatter/foreword.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Foreword</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/frontmatter/about/about.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">About the Book</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/frontmatter/acknowledgements/acknowledgements.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Acknowledgements</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/frontmatter/socratiq/socratiq.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">SocratiQ AI</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="true">
|
||
<span class="menu-text">Systems Foundations</span></a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="true" aria-label="Toggle section">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/introduction/introduction.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Introduction</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/ml_systems/ml_systems.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">ML Systems</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/dl_primer/dl_primer.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">DL Primer</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/dnn_architectures/dnn_architectures.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">DNN Architectures</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" role="navigation" aria-expanded="true">
|
||
<span class="menu-text">Design Principles</span></a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" role="navigation" aria-expanded="true" aria-label="Toggle section">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/workflow/workflow.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">AI Workflow</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/data_engineering/data_engineering.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Data Engineering</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/frameworks/frameworks.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">AI Frameworks</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/training/training.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">AI Training</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" role="navigation" aria-expanded="true">
|
||
<span class="menu-text">Performance Engineering</span></a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" role="navigation" aria-expanded="true" aria-label="Toggle section">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/efficient_ai/efficient_ai.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Efficient AI</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/optimizations/optimizations.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Model Optimizations</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/hw_acceleration/hw_acceleration.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">AI Acceleration</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/benchmarking/benchmarking.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Benchmarking AI</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" role="navigation" aria-expanded="true">
|
||
<span class="menu-text">Robust Deployment</span></a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" role="navigation" aria-expanded="true" aria-label="Toggle section">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/ops/ops.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">ML Operations</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/ondevice_learning/ondevice_learning.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">On-Device Learning</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/privacy_security/privacy_security.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Security & Privacy</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/robust_ai/robust_ai.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Robust AI</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" role="navigation" aria-expanded="true">
|
||
<span class="menu-text">Trustworthy Systems</span></a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" role="navigation" aria-expanded="true" aria-label="Toggle section">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/responsible_ai/responsible_ai.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Responsible AI</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/sustainable_ai/sustainable_ai.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Sustainable AI</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/ai_for_good/ai_for_good.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">AI for Good</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" role="navigation" aria-expanded="true">
|
||
<span class="menu-text">Frontiers of ML Systems</span></a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" role="navigation" aria-expanded="true" aria-label="Toggle section">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-6" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/frontiers/frontiers.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">AGI Systems</span></a>
|
||
</div>
|
||
</li>
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/core/conclusion/conclusion.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Conclusion</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="px-0"><hr class="sidebar-divider hi "></li>
|
||
<li class="sidebar-item sidebar-item-section">
|
||
<div class="sidebar-item-container">
|
||
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" role="navigation" aria-expanded="true">
|
||
<span class="menu-text">Glossary</span></a>
|
||
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" role="navigation" aria-expanded="true" aria-label="Toggle section">
|
||
<i class="bi bi-chevron-right ms-2"></i>
|
||
</a>
|
||
</div>
|
||
<ul id="quarto-sidebar-section-7" class="collapse list-unstyled sidebar-section depth1 show">
|
||
<li class="sidebar-item">
|
||
<div class="sidebar-item-container">
|
||
<a href="./contents/backmatter/glossary/glossary.html" class="sidebar-item-text sidebar-link">
|
||
<span class="menu-text">Complete Glossary</span></a>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</nav>
|
||
<div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
|
||
<!-- margin-sidebar -->
|
||
<div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
|
||
<nav id="TOC" role="doc-toc" class="toc-active" data-toc-expanded="99">
|
||
<h2 id="toc-title">On this page</h2>
|
||
|
||
<ul>
|
||
<li><a href="#abstract" id="toc-abstract" class="nav-link active" data-scroll-target="#abstract">Abstract</a>
|
||
<ul>
|
||
<li><a href="#support-our-mission" id="toc-support-our-mission" class="nav-link" data-scroll-target="#support-our-mission">Support Our Mission</a></li>
|
||
<li><a href="#why-we-wrote-this-book" id="toc-why-we-wrote-this-book" class="nav-link" data-scroll-target="#why-we-wrote-this-book">Why We Wrote This Book</a></li>
|
||
<li><a href="#listen-to-the-ai-podcast" id="toc-listen-to-the-ai-podcast" class="nav-link" data-scroll-target="#listen-to-the-ai-podcast">Listen to the AI Podcast</a></li>
|
||
<li><a href="#global-outreach" id="toc-global-outreach" class="nav-link" data-scroll-target="#global-outreach">Global Outreach</a></li>
|
||
<li><a href="#want-to-help-out" id="toc-want-to-help-out" class="nav-link" data-scroll-target="#want-to-help-out">Want to Help Out?</a></li>
|
||
</ul></li>
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
<!-- main -->
|
||
<main class="content" id="quarto-document-content">
|
||
|
||
|
||
<header id="title-block-header" class="quarto-title-block default">
|
||
<div class="quarto-title">
|
||
<h1 class="title">Machine Learning Systems</h1>
|
||
<p class="subtitle lead">Principles and Practices of Engineering Artificially Intelligent Systems</p>
|
||
</div>
|
||
|
||
|
||
<div class="quarto-title-meta-author">
|
||
<div class="quarto-title-meta-heading">Author, Editor & Curator</div>
|
||
<div class="quarto-title-meta-heading">Affiliation</div>
|
||
|
||
<div class="quarto-title-meta-contents">
|
||
<p class="author"><a href="https://vijay.seas.harvard.edu">Vijay Janapa Reddi</a> <a href="mailto:vj@eecs.harvard.edu" class="quarto-title-author-email"><i class="bi bi-envelope"></i></a> </p>
|
||
</div>
|
||
<div class="quarto-title-meta-contents">
|
||
<p class="affiliation">
|
||
Harvard University
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="quarto-title-meta">
|
||
|
||
|
||
<div>
|
||
<div class="quarto-title-meta-heading">Last Updated</div>
|
||
<div class="quarto-title-meta-contents">
|
||
<p class="date">January 7, 2026</p>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div>
|
||
<div class="quarto-title-meta-heading">Version</div>
|
||
<div class="quarto-title-meta-contents">
|
||
<p class="doi">
|
||
<a href="https://doi.org/v0.5.1">v0.5.1</a>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
</header>
|
||
|
||
|
||
<section id="abstract" class="level1 unnumbered">
|
||
<h1 class="unnumbered">Abstract</h1>
|
||
<div class="abstract-section">
|
||
<div class="abstract-content">
|
||
<p>Machine Learning Systems provides a systematic framework for understanding and engineering machine learning (ML) systems. This textbook bridges the gap between theoretical foundations and practical engineering, emphasizing the systems perspective required to build effective AI solutions. Unlike resources that focus primarily on algorithms and model architectures, this book highlights the broader context in which ML systems operate, including data engineering, model optimization, hardware-aware training, and inference acceleration. Readers will develop the ability to reason about ML system architectures and apply enduring engineering principles for building flexible, efficient, and robust machine learning systems.</p>
|
||
</div>
|
||
|
||
<a href="assets/downloads/Machine-Learning-Systems.pdf" target="_blank" class="book-card-link" title="Download PDF version">
|
||
<div class="book-card">
|
||
<img src="assets/images/covers/cover-hardcover-book.png" alt="Machine Learning Systems Book Cover" class="book-image">
|
||
<p class="book-title">Early Access Preview</p>
|
||
<p class="book-subtitle">Publisher: The MIT Press (2026)</p>
|
||
<p style="font-size: 0.8em; color: #6c757d; margin-top: 6px; margin-bottom: 0;">📖 Click here to download PDF</p>
|
||
</div>
|
||
</a>
|
||
</div>
|
||
<section id="support-our-mission" class="level2 unnumbered">
|
||
<h2 class="unnumbered anchored" data-anchor-id="support-our-mission">Support Our Mission</h2>
|
||
<div class="support-mission">
|
||
<p><strong>2026 Goal:</strong> Help 100,000 students learn ML Systems. On track for 1 million learners by 2030. Sponsors like the <a href="https://edgeaifoundation.org/" target="_blank" rel="noopener noreferrer">EDGE AI Foundation</a> match every star with funding that supports learning.</p>
|
||
|
||
<div class="support-actions">
|
||
<span class="star-count" id="star-count">Loading...</span>
|
||
<a href="https://github.com/harvard-edge/cs249r_book" target="_blank" rel="noopener" class="github-star-btn">⭐ Star on GitHub</a>
|
||
</div>
|
||
|
||
<p class="support-note">
|
||
<a href="https://opencollective.com/mlsysbook" target="_blank" rel="noopener">New! We just started an Open Collective. Learn more →</a>
|
||
</p>
|
||
</div>
|
||
<script>
|
||
async function fetchGitHubStars() {
|
||
const starElement = document.getElementById('star-count');
|
||
|
||
try {
|
||
const response = await fetch('https://api.github.com/repos/harvard-edge/cs249r_book');
|
||
const data = await response.json();
|
||
const starCount = data.stargazers_count;
|
||
|
||
// Update the star count with thousands separator
|
||
const formattedCount = starCount.toLocaleString();
|
||
starElement.textContent = formattedCount;
|
||
starElement.style.opacity = '1';
|
||
} catch (error) {
|
||
console.error('Failed to fetch GitHub stars:', error);
|
||
// Show a fallback message if API fails
|
||
starElement.textContent = 'Loading...';
|
||
starElement.style.opacity = '1';
|
||
}
|
||
}
|
||
|
||
// Fetch stars when the page loads
|
||
document.addEventListener('DOMContentLoaded', fetchGitHubStars);
|
||
</script>
|
||
</section>
|
||
<section id="why-we-wrote-this-book" class="level2 unnumbered">
|
||
<h2 class="unnumbered anchored" data-anchor-id="why-we-wrote-this-book">Why We Wrote This Book</h2>
|
||
<p><strong>The Problem:</strong> Students learn to train AI models, but few understand how to build the systems that actually make them work in production. When ML systems concepts are taught, students often learn individual components without grasping the holistic architecture—they can see the trees but miss the forest.</p>
|
||
<p><strong>The Future:</strong> As AI becomes more autonomous, the bottleneck won’t be just the algorithms—it will be the AI engineers who can build efficient, scalable, and sustainable systems.</p>
|
||
<blockquote class="blockquote">
|
||
"If you want to go fast, go alone. If you want to go far, go together."
|
||
<footer>— African Proverb</footer>
|
||
</blockquote>
|
||
<p><strong>Our Approach:</strong> This vision emerged from collaborative work in CS249r at Harvard University, where students, faculty, and industry partners came together to explore the systems side of ML. The content was developed through real student contributions during Fall 2023. What started as class notes has turned into a comprehensive educational resource we now share globally.</p>
|
||
<p>Want the full story? Read our <a href="./contents/frontmatter/foreword.html">Author’s Note</a> about the inspiration and values driving this project.</p>
|
||
</section>
|
||
<section id="listen-to-the-ai-podcast" class="level2 unnumbered">
|
||
<h2 class="unnumbered anchored" data-anchor-id="listen-to-the-ai-podcast">Listen to the AI Podcast</h2>
|
||
<div class="podcast-section">
|
||
<p>
|
||
This short podcast, created with Google's Notebook LM and inspired by insights from our <a href="https://web.eng.fiu.edu/gaquan/Papers/ESWEEK24Papers/CPS-Proceedings/pdfs/CODES-ISSS/563900a043/563900a043.pdf" target="_blank" rel="noopener">IEEE education viewpoint paper</a>, offers an accessible overview of the book's key ideas and themes.
|
||
</p>
|
||
<audio controls="controls">
|
||
<source src="assets/media/notebooklm_podcast_mlsysbookai.mp3" type="audio/mpeg">
|
||
Your browser does not support the audio element.
|
||
</audio>
|
||
</div>
|
||
</section>
|
||
<section id="global-outreach" class="level2 unnumbered">
|
||
<h2 class="unnumbered anchored" data-anchor-id="global-outreach">Global Outreach</h2>
|
||
<p>Thank you to all our readers and visitors. Your engagement with the material keeps us motivated.</p>
|
||
<div style="position: relative; padding-top: 56.25%; margin: 20px 0;">
|
||
<iframe src="https://lookerstudio.google.com/embed/reporting/e7192975-a8a0-453d-b6fe-1580ac054dbf/page/0pNbE" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0; border-radius: 8px;" allowfullscreen="allowfullscreen" sandbox="allow-storage-access-by-user-activation allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox">
|
||
</iframe>
|
||
</div>
|
||
</section>
|
||
<section id="want-to-help-out" class="level2 unnumbered">
|
||
<h2 class="unnumbered anchored" data-anchor-id="want-to-help-out">Want to Help Out?</h2>
|
||
<p>This is a collaborative project, and your input matters! If you’d like to contribute, check out our <a href="https://github.com/harvard-edge/cs249r_book/blob/main/book/docs/CONTRIBUTING.md">contribution guidelines</a>. Feedback, corrections, and new ideas are welcome. Simply file a GitHub <a href="https://github.com/harvard-edge/cs249r_book/issues">issue</a>.</p>
|
||
<p>We warmly invite you to join us on this journey by contributing your expertise, feedback, and ideas.</p>
|
||
|
||
|
||
</section>
|
||
</section>
|
||
|
||
<a onclick="window.scrollTo(0, 0); return false;" role="button" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a></main> <!-- /main -->
|
||
<script id="quarto-html-after-body" type="application/javascript">
|
||
window.document.addEventListener("DOMContentLoaded", function (event) {
|
||
// Ensure there is a toggle, if there isn't float one in the top right
|
||
if (window.document.querySelector('.quarto-color-scheme-toggle') === null) {
|
||
const a = window.document.createElement('a');
|
||
a.classList.add('top-right');
|
||
a.classList.add('quarto-color-scheme-toggle');
|
||
a.href = "";
|
||
a.onclick = function() { try { window.quartoToggleColorScheme(); } catch {} return false; };
|
||
const i = window.document.createElement("i");
|
||
i.classList.add('bi');
|
||
a.appendChild(i);
|
||
window.document.body.appendChild(a);
|
||
}
|
||
setColorSchemeToggle(hasAlternateSentinel())
|
||
const icon = "";
|
||
const anchorJS = new window.AnchorJS();
|
||
anchorJS.options = {
|
||
placement: 'right',
|
||
icon: icon
|
||
};
|
||
anchorJS.add('.anchored');
|
||
const isCodeAnnotation = (el) => {
|
||
for (const clz of el.classList) {
|
||
if (clz.startsWith('code-annotation-')) {
|
||
return true;
|
||
}
|
||
}
|
||
return false;
|
||
}
|
||
const onCopySuccess = function(e) {
|
||
// button target
|
||
const button = e.trigger;
|
||
// don't keep focus
|
||
button.blur();
|
||
// flash "checked"
|
||
button.classList.add('code-copy-button-checked');
|
||
var currentTitle = button.getAttribute("title");
|
||
button.setAttribute("title", "Copied!");
|
||
let tooltip;
|
||
if (window.bootstrap) {
|
||
button.setAttribute("data-bs-toggle", "tooltip");
|
||
button.setAttribute("data-bs-placement", "left");
|
||
button.setAttribute("data-bs-title", "Copied!");
|
||
tooltip = new bootstrap.Tooltip(button,
|
||
{ trigger: "manual",
|
||
customClass: "code-copy-button-tooltip",
|
||
offset: [0, -8]});
|
||
tooltip.show();
|
||
}
|
||
setTimeout(function() {
|
||
if (tooltip) {
|
||
tooltip.hide();
|
||
button.removeAttribute("data-bs-title");
|
||
button.removeAttribute("data-bs-toggle");
|
||
button.removeAttribute("data-bs-placement");
|
||
}
|
||
button.setAttribute("title", currentTitle);
|
||
button.classList.remove('code-copy-button-checked');
|
||
}, 1000);
|
||
// clear code selection
|
||
e.clearSelection();
|
||
}
|
||
const getTextToCopy = function(trigger) {
|
||
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
||
for (const childEl of codeEl.children) {
|
||
if (isCodeAnnotation(childEl)) {
|
||
childEl.remove();
|
||
}
|
||
}
|
||
return codeEl.innerText;
|
||
}
|
||
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
|
||
text: getTextToCopy
|
||
});
|
||
clipboard.on('success', onCopySuccess);
|
||
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
|
||
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
|
||
text: getTextToCopy,
|
||
container: window.document.getElementById('quarto-embedded-source-code-modal')
|
||
});
|
||
clipboardModal.on('success', onCopySuccess);
|
||
}
|
||
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
|
||
var mailtoRegex = new RegExp(/^mailto:/);
|
||
var filterRegex = new RegExp("https:\/\/mlsysbook\.ai\/book\/");
|
||
var isInternal = (href) => {
|
||
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
|
||
}
|
||
// Inspect non-navigation links and adorn them if external
|
||
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
|
||
for (var i=0; i<links.length; i++) {
|
||
const link = links[i];
|
||
if (!isInternal(link.href)) {
|
||
// undo the damage that might have been done by quarto-nav.js in the case of
|
||
// links that we want to consider external
|
||
if (link.dataset.originalHref !== undefined) {
|
||
link.href = link.dataset.originalHref;
|
||
}
|
||
// target, if specified
|
||
link.setAttribute("target", "_blank");
|
||
if (link.getAttribute("rel") === null) {
|
||
link.setAttribute("rel", "noopener");
|
||
}
|
||
}
|
||
}
|
||
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
|
||
const config = {
|
||
allowHTML: true,
|
||
maxWidth: 500,
|
||
delay: 100,
|
||
arrow: false,
|
||
appendTo: function(el) {
|
||
return el.parentElement;
|
||
},
|
||
interactive: true,
|
||
interactiveBorder: 10,
|
||
theme: 'quarto',
|
||
placement: 'bottom-start',
|
||
};
|
||
if (contentFn) {
|
||
config.content = contentFn;
|
||
}
|
||
if (onTriggerFn) {
|
||
config.onTrigger = onTriggerFn;
|
||
}
|
||
if (onUntriggerFn) {
|
||
config.onUntrigger = onUntriggerFn;
|
||
}
|
||
window.tippy(el, config);
|
||
}
|
||
const xrefs = window.document.querySelectorAll('a.quarto-xref');
|
||
const processXRef = (id, note) => {
|
||
// Strip column container classes
|
||
const stripColumnClz = (el) => {
|
||
el.classList.remove("page-full", "page-columns");
|
||
if (el.children) {
|
||
for (const child of el.children) {
|
||
stripColumnClz(child);
|
||
}
|
||
}
|
||
}
|
||
stripColumnClz(note)
|
||
if (id === null || id.startsWith('sec-')) {
|
||
// Special case sections, only their first couple elements
|
||
const container = document.createElement("div");
|
||
if (note.children && note.children.length > 2) {
|
||
container.appendChild(note.children[0].cloneNode(true));
|
||
for (let i = 1; i < note.children.length; i++) {
|
||
const child = note.children[i];
|
||
if (child.tagName === "P" && child.innerText === "") {
|
||
continue;
|
||
} else {
|
||
container.appendChild(child.cloneNode(true));
|
||
break;
|
||
}
|
||
}
|
||
if (window.Quarto?.typesetMath) {
|
||
window.Quarto.typesetMath(container);
|
||
}
|
||
return container.innerHTML
|
||
} else {
|
||
if (window.Quarto?.typesetMath) {
|
||
window.Quarto.typesetMath(note);
|
||
}
|
||
return note.innerHTML;
|
||
}
|
||
} else {
|
||
// Remove any anchor links if they are present
|
||
const anchorLink = note.querySelector('a.anchorjs-link');
|
||
if (anchorLink) {
|
||
anchorLink.remove();
|
||
}
|
||
if (window.Quarto?.typesetMath) {
|
||
window.Quarto.typesetMath(note);
|
||
}
|
||
if (note.classList.contains("callout")) {
|
||
return note.outerHTML;
|
||
} else {
|
||
return note.innerHTML;
|
||
}
|
||
}
|
||
}
|
||
for (var i=0; i<xrefs.length; i++) {
|
||
const xref = xrefs[i];
|
||
tippyHover(xref, undefined, function(instance) {
|
||
instance.disable();
|
||
let url = xref.getAttribute('href');
|
||
let hash = undefined;
|
||
if (url.startsWith('#')) {
|
||
hash = url;
|
||
} else {
|
||
try { hash = new URL(url).hash; } catch {}
|
||
}
|
||
if (hash) {
|
||
const id = hash.replace(/^#\/?/, "");
|
||
const note = window.document.getElementById(id);
|
||
if (note !== null) {
|
||
try {
|
||
const html = processXRef(id, note.cloneNode(true));
|
||
instance.setContent(html);
|
||
} finally {
|
||
instance.enable();
|
||
instance.show();
|
||
}
|
||
} else {
|
||
// See if we can fetch this
|
||
fetch(url.split('#')[0])
|
||
.then(res => res.text())
|
||
.then(html => {
|
||
const parser = new DOMParser();
|
||
const htmlDoc = parser.parseFromString(html, "text/html");
|
||
const note = htmlDoc.getElementById(id);
|
||
if (note !== null) {
|
||
const html = processXRef(id, note);
|
||
instance.setContent(html);
|
||
}
|
||
}).finally(() => {
|
||
instance.enable();
|
||
instance.show();
|
||
});
|
||
}
|
||
} else {
|
||
// See if we can fetch a full url (with no hash to target)
|
||
// This is a special case and we should probably do some content thinning / targeting
|
||
fetch(url)
|
||
.then(res => res.text())
|
||
.then(html => {
|
||
const parser = new DOMParser();
|
||
const htmlDoc = parser.parseFromString(html, "text/html");
|
||
const note = htmlDoc.querySelector('main.content');
|
||
if (note !== null) {
|
||
// This should only happen for chapter cross references
|
||
// (since there is no id in the URL)
|
||
// remove the first header
|
||
if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
|
||
note.children[0].remove();
|
||
}
|
||
const html = processXRef(null, note);
|
||
instance.setContent(html);
|
||
}
|
||
}).finally(() => {
|
||
instance.enable();
|
||
instance.show();
|
||
});
|
||
}
|
||
}, function(instance) {
|
||
});
|
||
}
|
||
let selectedAnnoteEl;
|
||
const selectorForAnnotation = ( cell, annotation) => {
|
||
let cellAttr = 'data-code-cell="' + cell + '"';
|
||
let lineAttr = 'data-code-annotation="' + annotation + '"';
|
||
const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
|
||
return selector;
|
||
}
|
||
const selectCodeLines = (annoteEl) => {
|
||
const doc = window.document;
|
||
const targetCell = annoteEl.getAttribute("data-target-cell");
|
||
const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
|
||
const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
|
||
const lines = annoteSpan.getAttribute("data-code-lines").split(",");
|
||
const lineIds = lines.map((line) => {
|
||
return targetCell + "-" + line;
|
||
})
|
||
let top = null;
|
||
let height = null;
|
||
let parent = null;
|
||
if (lineIds.length > 0) {
|
||
//compute the position of the single el (top and bottom and make a div)
|
||
const el = window.document.getElementById(lineIds[0]);
|
||
top = el.offsetTop;
|
||
height = el.offsetHeight;
|
||
parent = el.parentElement.parentElement;
|
||
if (lineIds.length > 1) {
|
||
const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
|
||
const bottom = lastEl.offsetTop + lastEl.offsetHeight;
|
||
height = bottom - top;
|
||
}
|
||
if (top !== null && height !== null && parent !== null) {
|
||
// cook up a div (if necessary) and position it
|
||
let div = window.document.getElementById("code-annotation-line-highlight");
|
||
if (div === null) {
|
||
div = window.document.createElement("div");
|
||
div.setAttribute("id", "code-annotation-line-highlight");
|
||
div.style.position = 'absolute';
|
||
parent.appendChild(div);
|
||
}
|
||
div.style.top = top - 2 + "px";
|
||
div.style.height = height + 4 + "px";
|
||
div.style.left = 0;
|
||
let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
|
||
if (gutterDiv === null) {
|
||
gutterDiv = window.document.createElement("div");
|
||
gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
|
||
gutterDiv.style.position = 'absolute';
|
||
const codeCell = window.document.getElementById(targetCell);
|
||
const gutter = codeCell.querySelector('.code-annotation-gutter');
|
||
gutter.appendChild(gutterDiv);
|
||
}
|
||
gutterDiv.style.top = top - 2 + "px";
|
||
gutterDiv.style.height = height + 4 + "px";
|
||
}
|
||
selectedAnnoteEl = annoteEl;
|
||
}
|
||
};
|
||
const unselectCodeLines = () => {
|
||
const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
|
||
elementsIds.forEach((elId) => {
|
||
const div = window.document.getElementById(elId);
|
||
if (div) {
|
||
div.remove();
|
||
}
|
||
});
|
||
selectedAnnoteEl = undefined;
|
||
};
|
||
// Handle positioning of the toggle
|
||
window.addEventListener(
|
||
"resize",
|
||
throttle(() => {
|
||
elRect = undefined;
|
||
if (selectedAnnoteEl) {
|
||
selectCodeLines(selectedAnnoteEl);
|
||
}
|
||
}, 10)
|
||
);
|
||
function throttle(fn, ms) {
|
||
let throttle = false;
|
||
let timer;
|
||
return (...args) => {
|
||
if(!throttle) { // first call gets through
|
||
fn.apply(this, args);
|
||
throttle = true;
|
||
} else { // all the others get throttled
|
||
if(timer) clearTimeout(timer); // cancel #2
|
||
timer = setTimeout(() => {
|
||
fn.apply(this, args);
|
||
timer = throttle = false;
|
||
}, ms);
|
||
}
|
||
};
|
||
}
|
||
// Attach click handler to the DT
|
||
const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
|
||
for (const annoteDlNode of annoteDls) {
|
||
annoteDlNode.addEventListener('click', (event) => {
|
||
const clickedEl = event.target;
|
||
if (clickedEl !== selectedAnnoteEl) {
|
||
unselectCodeLines();
|
||
const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
|
||
if (activeEl) {
|
||
activeEl.classList.remove('code-annotation-active');
|
||
}
|
||
selectCodeLines(clickedEl);
|
||
clickedEl.classList.add('code-annotation-active');
|
||
} else {
|
||
// Unselect the line
|
||
unselectCodeLines();
|
||
clickedEl.classList.remove('code-annotation-active');
|
||
}
|
||
});
|
||
}
|
||
});
|
||
</script>
|
||
<nav class="page-navigation">
|
||
<div class="nav-page nav-page-previous">
|
||
</div>
|
||
<div class="nav-page nav-page-next">
|
||
<a href="./contents/frontmatter/foreword.html" class="pagination-link" aria-label="Foreword">
|
||
<span class="nav-page-text">Foreword</span> <i class="bi bi-arrow-right-short"></i>
|
||
</a>
|
||
</div>
|
||
</nav>
|
||
</div> <!-- /content -->
|
||
<footer class="footer">
|
||
<div class="nav-footer">
|
||
<div class="nav-footer-left">
|
||
<p>© 2024-2025 Harvard University. Licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC-BY-NC-SA 4.0</a></p>
|
||
</div>
|
||
<div class="nav-footer-center">
|
||
<p>Written, edited and curated by Prof. Vijay Janapa Reddi (Harvard University)</p>
|
||
</div>
|
||
<div class="nav-footer-right">
|
||
<ul class="footer-items list-unstyled">
|
||
<li class="nav-item compact">
|
||
<a class="nav-link" href="https://github.com/harvard-edge/cs249r_book">
|
||
<i class="bi bi-github" role="img" aria-label="View source on GitHub">
|
||
</i>
|
||
</a>
|
||
</li>
|
||
<li class="nav-item compact">
|
||
<a class="nav-link" href="https://github.com/harvard-edge/cs249r_book">
|
||
<i class="bi bi-star" role="img" aria-label="Star this repository">
|
||
</i>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
|
||
|
||
|
||
|
||
</body></html> |