Commit Graph

1056 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
cb5034df98 CARD plots 2026-03-08 09:39:47 -04:00
Vijay Janapa Reddi
2409f6c20b chore: remove old book/quarto/mlsys shim directory and migrate tools/tests 2026-03-07 17:25:29 -05:00
Vijay Janapa Reddi
aa0c690a6f feat: add newsletter system with Buttondown integration and CLI commands
Adds newsletter infrastructure: CLI commands (new, list, preview, publish,
fetch, status) integrated into binder, Quarto archive site config for
mlsysbook.ai/newsletter/, and 12-month editorial content plan. Drafts
are gitignored for private local writing; sent newsletters are committed
as the public archive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:22:52 -05:00
Vijay Janapa Reddi
0b021d407f Updated equations 2026-03-07 17:19:57 -05:00
Vijay Janapa Reddi
c24ab1ccb9 Migrates diagrams to SVG and adds dynamic visualizations
Refactors numerous embedded TikZ diagrams in Quarto markdown files to external SVG images. This improves rendering performance, streamlines content management, and enhances cross-platform consistency.

Introduces interactive "Napkin Math" `callout-notebook` blocks, featuring Python code to generate dynamic visualizations for key system trade-offs and scenarios. Expands the `mlsysim` library with new constants and plotting utilities to support these interactive calculations and comparisons.
2026-03-07 16:15:40 -05:00
Vijay Janapa Reddi
9b81b58cef feat: add volume-specific output filenames to Quarto configs
Set output-file to Machine-Learning-Systems-Vol1 and
Machine-Learning-Systems-Vol2 in all PDF and EPUB configs.
This makes output filenames clean and distinguishable,
serving as single source of truth for downstream packaging.
2026-03-06 18:10:47 -05:00
Vijay Janapa Reddi
059291f243 fix: resolve Windows Unicode encoding errors in PDF builds
- Add PYTHONUTF8=1 env var to all Windows Docker run commands (PEP 540)
- Fix generate_figure_list.py to explicitly use encoding='utf-8' in
  write_text() instead of relying on system default (cp1252 on Windows)
- The ≈ character (\u2248) in Vol I content triggered charmap codec errors
2026-03-06 17:18:37 -05:00
Vijay Janapa Reddi
4494e30e71 Add ~88 SVG figures across all 16 Vol 2 chapters with prose integration
Visual audit identified ~85 high-priority figure gaps across Vol 2.
Three categories of work completed:

- Activated ~22 shelved SVGs (renamed from _prefix, wired into QMD)
- Created ~66 new SVGs from scratch following svg-style.md standards
- Replaced ~15 TikZ-in-callout blocks with proper @fig- labeled SVGs

All figures use sandwich prose pattern: intro sentence before the
figure div (telling students what to look for) and takeaway sentence
after (stating the key insight). 47 figures received prose fixes to
ensure complete integration.

SVG standards: viewBox 0 0 680 460, semantic color palette,
Helvetica Neue typography, arrow markers in defs, ≤250-char alt text.
2026-03-05 19:03:22 -05:00
Vijay Janapa Reddi
5885f12344 Fix double .pdf.pdf extension in PDF output filenames
Drop explicit .pdf from output-file in both vol1 and vol2 PDF configs.
Quarto appends the format extension automatically, so including it
produced Machine-Learning-Systems.pdf.pdf.
2026-03-05 18:39:40 -05:00
Vijay Janapa Reddi
f725294b52 Deduplicate Vol 2 principles: single source of truth in part files
Remove 14 duplicate .callout-principle blocks from chapter files,
replacing each with prose containing \ref{nte-...} back-references
to the canonical declaration in the part-level principles files.
This mirrors Vol 1's "declare once, reference everywhere" pattern.

Also reclassifies 3 orphan chapter-level observations from
.callout-principle to .callout-perspective, and adds 7 new
cross-references threading principles across chapters.
2026-03-05 18:07:23 -05:00
Vijay Janapa Reddi
4f44655224 Grant actions read permission to dev validation workflow.
Allow reusable container workflow status queries from the caller and fix a stylesheet spelling issue required by pre-commit checks.
2026-03-05 17:35:07 -05:00
Vijay Janapa Reddi
ce4dc6c483 Ensures blank lines precede Markdown lists
Adds a utility script to enforce proper Markdown list rendering. This addresses an issue where Quarto/Pandoc might incorrectly parse lists as paragraph continuations if not preceded by a blank line. Applies this formatting fix across all Quarto files by inserting the necessary blank lines.
2026-03-05 16:26:31 -05:00
Vijay Janapa Reddi
aed00cce30 Removes LLM text configuration
Eliminates the `llms-txt` configuration option from the Quarto website settings. This directive is no longer relevant or required for the site's operation, simplifying the overall configuration.
2026-03-05 15:34:53 -05:00
Vijay Janapa Reddi
01a7ee2a18 Add FP8 to Vol 1 precision list and tidy Vol 2 notation ending.
FP8 is a data format relevant to single-node systems (H100 supports
it natively), so it belongs in Vol 1's precision list rather than as
an orphaned bullet in Vol 2. Network throughput units (Gbps vs GB/s)
remain Vol 2-only under a proper "Additional Units" subsection.
2026-03-05 15:34:02 -05:00
Vijay Janapa Reddi
71b6090064 Split notation into per-volume files with Vol2 inheriting from Vol1.
Vol 1 owns its notation (vol1/frontmatter/notation.qmd) as a
standalone document free of distributed systems concepts. Vol 2
(vol2/frontmatter/notation.qmd) uses {{< include >}} to pull in
Vol 1's notation, then adds distributed systems notation on top.
This eliminates duplication while keeping Vol 1 independent of
Vol 2's publication timeline.

- Remove shared/notation.qmd (single shared file)
- Create vol1/frontmatter/notation.qmd (core ML systems notation)
- Create vol2/frontmatter/notation.qmd (extends Vol 1 via include)
- Update all 8 config files to point to volume-specific paths
- Remove contents/shared/ render glob from HTML configs
2026-03-05 11:23:51 -05:00
Vijay Janapa Reddi
2100099efb Standardize LaTeX subscripts to \text{} across both volumes.
Replace D_{vol}, R_{peak}, L_{lat} with D_{\text{vol}},
R_{\text{peak}}, L_{\text{lat}} in all QMD files and notation.qmd
to match the canonical notation convention. Also escape bare
FLOPs/$ to FLOPs/\$ in vol1 introduction. 288 replacements
across 24 files.
2026-03-05 11:04:34 -05:00
Vijay Janapa Reddi
048492d0e1 Move scaling regimes section from Vol1 intro to Vol2 intro.
The "Scaling the Machine: From Node to Fleet" section, including the
TikZ stack-comparison figure and layer walkthrough prose, belongs in
Vol2 where the reader crosses the scaling boundary. Vol1 now flows
directly from Samples/Dollar into ML vs. Traditional Software, with
a two-sentence scope statement in Book Organization. The fn-gpu-parallel
footnote is relocated next to its callsite on line 116.
2026-03-05 08:39:48 -05:00
Vijay Janapa Reddi
fc0290df44 Fix broken \right) in DAM appendix equation
The \right) delimiter was split across two lines, causing
a LaTeX compilation error ("Missing \right. inserted").
2026-03-04 16:41:08 -05:00
Vijay Janapa Reddi
c394766b98 Refines numerical output precision
Applies consistent decimal formatting to f-string representations of various metrics throughout the book, enhancing readability. Also updates specific hardcoded numerical examples for clarity.
2026-03-04 14:14:48 -05:00
Vijay Janapa Reddi
0600bf8633 Enhance content rendering and consistency
Improves math expression rendering in the Log-Sum-Exp example for clarity and LaTeX robustness.
Standardizes the display of "MTBF" by removing unnecessary `\text{}` commands throughout the 'Fault Tolerance' chapter.
Updates various internal cross-references and section IDs to ensure correct linking and improved navigation.
Clarifies explanations in the error feedback worked example and the communication-computation overlap condition.
Adds a new bibliography entry for the Goodfellow et al. (2016) Deep Learning book.
2026-03-04 13:53:41 -05:00
Vijay Janapa Reddi
da69ea1a69 Writing updates 2026-03-04 12:56:04 -05:00
Vijay Janapa Reddi
501ac92bb1 Adds SVG XML validation hook
Introduces a pre-commit hook to ensure SVG image files are well-formed XML,
preventing potential rendering or processing issues. This leverages `lxml` for
parsing, which has been added as a new dependency.

Corrects missing whitespace between attributes in existing SVG figures to
comply with the new validation requirements.
2026-03-04 11:07:06 -05:00
Vijay Janapa Reddi
4bd062c545 Standardizes citation formatting
Streamlines in-text references by removing redundant author mentions and consolidating to Quarto's native `@` syntax. Improves consistency and readability of academic citations.
2026-03-04 10:00:41 -05:00
Vijay Janapa Reddi
3097fe9931 Merge branch 'feature/book-volumes' into dev 2026-03-04 09:59:37 -05:00
Vijay Janapa Reddi
4b5a0a27f2 Enhances documentation readability and tone
Standardizes the narrative to a third-person, objective perspective.
Improves conciseness and flow of explanations throughout the content.
Refines punctuation for better readability and impact.
2026-03-04 09:29:46 -05:00
Zeljko Hrcek
9fa4cb214e Updated figures in chapter 9 2026-03-04 15:23:28 +01:00
Vijay Janapa Reddi
31ced18ec3 Refines conceptual language and generalizes examples
Updates various sections to use more general and impactful language.
Replaces specific numerical examples and ranges with qualitative descriptions (e.g., "orders of magnitude," "substantial fraction," "staggering capital expenditure").
Improves the timelessness and broad applicability of the content by reducing reliance on potentially outdated figures.
2026-03-04 08:57:36 -05:00
Vijay Janapa Reddi
870dc85a9f Installs rsvg-convert and refactors Quarto
Adds rsvg-convert to the Windows Dockerfile to enable SVG-to-PDF conversion for Quarto, including its verification.

Refactors Quarto document source:
- Renames a speculative decoding footnote for improved clarity.
- Standardizes an internal TikZ drawing macro boolean flag from `\ifbox@dashed` to `\ifboxdashed` across several files.
2026-03-04 08:08:39 -05:00
Vijay Janapa Reddi
210f8b173d Adds new inference SVG diagrams and unifies background styles
Enhances the `inference` chapter with several new SVG diagrams, providing visual explanations for complex topics. These figures illustrate:
- Tensor, pipeline, and expert parallelism request routing
- Horizontal scaling with shard groups
- Global load balancing across multiple regions
- Edge caching strategies (hit/miss paths)
- Spot-aware traffic distribution

Updates the `inference.qmd` document to integrate these new diagrams, replacing previous textual and ASCII-art descriptions for improved clarity and presentation.

Applies a widespread style standardization to existing SVG diagrams, uniformly setting the main background fill color to `#fff` (pure white) and a consistent corner radius (`rx="4"`) for the primary canvas rectangle to enhance visual consistency throughout the book.
2026-03-03 19:29:27 -05:00
Vijay Janapa Reddi
0b8e0209d0 Remove trailing blank lines and fix whitespace across chapters
Removes trailing blank lines from 14 chapters, fixes table column
alignment and missing newline at end of file in vol2 conclusion,
and adds missing section ID to dedication page.
2026-03-03 18:56:38 -05:00
Vijay Janapa Reddi
f98af8baae Fix QMD chapter structure: title order, chapter-start placement, div spacing
- Move chapter title (# Title) to immediately after YAML frontmatter in all vol1/vol2 chapters
- Move chapter-start Python cells to after Learning Objectives callout (not before cover image)
- Remove empty chapter-start cells (no executable code) from vol1 conclusion, data_engineering, introduction
- Move conclusion-roofline-setup cell (vol1 conclusion) to after Learning Objectives
- Add missing blank lines after chapter titles before ::: blocks
- Add missing blank lines before/after all ::: div markers across all chapter files (2028 insertions)
2026-03-03 18:55:11 -05:00
Vijay Janapa Reddi
bd5dd6f088 Enhances Quarto build for robustness and dynamic cross-referencing
Configures explicit `render` paths for both volumes to ensure complete and correct builds, particularly for selective rendering workflows.

Replaces the static cross-reference fix script with a dynamic version. This new script automatically discovers and resolves internal links from QMD sources, improving maintainability and ensuring links remain functional during partial book builds.

Adds a new script to check and auto-fix bibliography completeness, facilitating self-contained volumes.

Removes redundant empty Python code blocks from chapter QMDs and refines frontmatter content for consistency.
2026-03-03 16:04:25 -05:00
Vijay Janapa Reddi
0dfbba8f45 Removes generated book compilation files
Deletes temporary files generated during Quarto book compilation, including index files and the figure manifest. This keeps the repository clean by untracking build artifacts.
2026-03-03 15:03:11 -05:00
Vijay Janapa Reddi
d9c2906e40 Adds Windows book builds and refines Quarto content
Introduces Windows HTML, PDF, and EPUB build configurations for both Volume I and Volume II in the GitHub Actions workflow, expanding the available output formats for the book.

Updates Quarto callout and figure syntax from `::::` to `:::` across numerous content files for consistency and compatibility.

Removes unreferenced `war_stories.bib` and `data_engineering.bib` bibliography files and their corresponding entries in Quarto configuration.

Standardizes internal references to the 'Responsible AI' chapter by updating `@sec-responsible-engineering` to `@sec-responsible-ai` for improved linking accuracy throughout the text.
2026-03-03 14:50:20 -05:00
Vijay Janapa Reddi
91e5c320c5 Improves Quarto build and table rendering
Adds PYTHONPATH and MPLBACKEND environment variables to Quarto PDF configurations. This ensures Python code blocks execute reliably, particularly for plot generation.

Refactors table styling in appendix content to use direct Quarto block attributes for the `.column-page` class, simplifying markup and improving consistent layout.
2026-03-03 11:27:25 -05:00
Vijay Janapa Reddi
59b23a22c5 Activates appendices in PDF configurations
Uncomments the `appendices` section in Quarto PDF configuration files for both volumes. This ensures that the specified appendix content is included in the generated PDF output.
2026-03-03 11:19:13 -05:00
Vijay Janapa Reddi
96f03a672b fix(build): fix three container build failures across epub, pdf, and html targets
- Remove invalid `output-file` from `project:` block in both EPUB configs
  (Quarto schema only allows `output-file` under `book:`, not `project:`)
- Move `language` to top-level `lang:` and remove HTML-only keys from
  EPUB format blocks (`fig-caption`, `footnotes-hover`, `citations-hover`,
  `code-copy`, `code-line-numbers`, `description`) per Quarto EPUB spec
- Add `matplotlib>=3.7.0` to requirements.txt — was missing from container
  image, causing ModuleNotFoundError during figure rendering
- Add `_matplotlib_available` guard in `viz.setup_plot()` to raise a clear
  ImportError instead of a cryptic AttributeError when matplotlib is absent
2026-03-03 08:14:59 -05:00
Vijay Janapa Reddi
6cb39f40ab fix(build): set PYTHONPATH for mlsysim, move output-file to book:, add volume to job name 2026-03-03 07:32:40 -05:00
Vijay Janapa Reddi
b316005230 fix(ci): reformat Python blocks with Black 24.10.0 and fix PS string interpolation
CI pins black==24.10.0 but requirements.txt had black>=23.0.0, causing
pre-commit to reformat 11 QMD files on the CI run and fail. Format all
affected files locally with 24.10.0 to match CI expectations.

Also fix PowerShell PATH string interpolation in Windows Dockerfile:
use explicit concatenation instead of nested method call inside a
double-quoted string, which can be unreliable in some PS contexts.
2026-03-02 22:21:41 -05:00
Vijay Janapa Reddi
f64ba2962c chore: resolve pre-commit warning backlog and stabilize checks
Normalize book prose/style issues across touched chapters and remove remaining structural warnings so validation output is clean and reproducible in CI. Also tighten inline/times-spacing validation behavior to reduce noisy false positives while preserving strict checks.
2026-03-02 19:04:35 -05:00
Vijay Janapa Reddi
8129e4b31f Improves artifact verification and output naming
Updates the book publishing workflow to conditionally verify downloaded artifacts based on the `deploy_target` input, preventing failures during partial deployments.

Explicitly sets the output filenames for EPUB and PDF builds in Quarto configurations, ensuring consistent naming for generated book artifacts.
2026-03-02 17:51:04 -05:00
Vijay Janapa Reddi
354cb2000f chore: extract shared HTML footer and update announcement banner
- Add config/shared/html/footer-common.yml with common page-footer elements
  (copyright/license left, GitHub/star right, background, border)
- Reduce _quarto-html-vol1.yml and _quarto-html-vol2.yml page-footer to
  volume-specific center link only; shared elements imported via metadata-files
- Update announcement bar: lead with two-volume launch, keep four-line format
2026-03-02 17:38:30 -05:00
Vijay Janapa Reddi
38ec2d66fb Fix image reference and pre-commit auto-fixes
- Rename _regression_testing.png to regression_testing.png for fault_tolerance.qmd
- Collapse extra blank lines (security_privacy, fault_tolerance)
- Prettify pipe tables (appendix_machine)
2026-03-02 17:21:56 -05:00
Vijay Janapa Reddi
5ec92f5e6a Merge branch 'feature/book-volumes' into dev 2026-03-02 17:16:19 -05:00
Vijay Janapa Reddi
bd151e75ca Expands TikZ libraries and color palette
Incorporates additional TikZ libraries to provide more versatile tools for diagram creation. Also introduces a new `GreenL0` color definition to extend the available color palette for visual elements.
2026-03-02 17:15:57 -05:00
Vijay Janapa Reddi
12ed6525bf Remove root clutter, archive dirs, and build artifacts
- git rm 96 files: one-off scripts (test_simulator.py, list_figs_vol1.py,
  refactor_math_prompt.md), stale archive directories
  (book/tools/scripts/_archive/, book/quarto/scripts/_archive/)
- Move SEMINAL_PAPERS_CORPUS.md and SEMINAL_PAPERS_V2.md to
  .claude/docs/shared/ for proper organization
- Delete local build artifacts: all __pycache__ dirs, .pytest_cache,
  mlsysbook.egg-info, .tito/logs
2026-03-02 17:14:50 -05:00
Vijay Janapa Reddi
0d6b8fee7a feat: add unified memory hierarchy reference and data locality invariant 2026-03-02 17:14:11 -05:00
Vijay Janapa Reddi
2bd6ed1cf0 Prefix unused images with _ and restore TikZ figures from main
- Rename 409 unused image files with _ prefix across vol1 (272) and
  vol2 (137) so they are visually identifiable without being deleted
- Restore polished TikZ figures from main branch into vol2 chapters:
  fault_tolerance, edge_intelligence, security_privacy, distributed_training,
  responsible_ai, sustainable_ai, robust_ai
- Remove all tikz-source backup blocks (0 remaining across vol2)
- Prefix 33 SVG files superseded by restored TikZ with _
- Add GreenL0, chains, shapes.arrows, decorations.pathreplacing to diagram.yml
2026-03-02 15:19:16 -05:00
Vijay Janapa Reddi
a88b25a69c Activates full book content for PDF builds
Uncomments all chapters, parts, frontmatter, and appendices in both Volume 1 and Volume 2 Quarto PDF configuration files. This ensures that the complete book content is included when generating PDF outputs.
2026-03-02 12:23:58 -05:00
Vijay Janapa Reddi
1669a5a63e Refactors diagrams to external SVG files
Replaces embedded TikZ code with external SVG image references across various chapters. This change enhances rendering performance, reduces document file size, and improves compatibility.

Includes minor text formatting adjustments for numerical values and symbols.
2026-03-02 12:01:41 -05:00