Commit Graph

1410 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
15a7ef57fa fix: prose edits — index placement, definition titles, dimension spacing
- introduction: consolidate index tags, fix 224×224 spacing, definition callout titles
- data_selection, fault_tolerance, vol2 intro, responsible_ai, robust_ai: misc prose fixes
2026-02-22 14:01:43 -05:00
Vijay Janapa Reddi
4d53b7af4d Merge remote-tracking branch 'origin/feature/book-volumes' into feature/book-volumes 2026-02-22 14:00:56 -05:00
Vijay Janapa Reddi
aff8a0fc0d fix: × consistency — compound OK for a×b, LaTeX in prose/tables, Unicode only in fig-alt
- book-prose: allow compound × for simple products; require × alone only when
  followed by word/unit; Unicode × only in fig-alt
- Revert split × back to compound (e.g. $3 \times 10^{-4}$)
- data_engineering: 8× A100 → 8$\times$ A100 (LaTeX in table)
- appendix_dam: Python outputs use LaTeX ×
- hw_acceleration: table dimensions use compound math ($4\times4\times4$)
- benchmarking: fix Python equation string
2026-02-22 14:00:34 -05:00
Vijay Janapa Reddi
bee7db3a22 Merge pull request #1197 from harvard-edge/fix/ch10
Updated figures in chapter 10: model_compression
2026-02-22 13:09:20 -05:00
Vijay Janapa Reddi
95956dee3c Scales cover images to 100% width
Ensures cover images in Vol. 2 chapters fill the available width, improving visual presentation across different screen sizes.

Removes duplicate cover image from the introduction chapter.

Corrects a typographical error in Appendix Machine regarding energy ratios.
2026-02-22 12:48:37 -05:00
Vijay Janapa Reddi
77d0081e38 Refactors build process and validation logic
Refactors the build process to leverage shared output file resolution logic, ensuring consistency across build and debug commands.

Improves validation by streamlining bibliography handling and adding stricter citation matching.

Updates diagram dependencies and adjusts content for clarity and accuracy.
2026-02-22 12:06:46 -05:00
Zeljko Hrcek
4884d40b76 Updated figures in chapter 10: model_compression 2026-02-22 18:00:03 +01:00
Vijay Janapa Reddi
e9171b1379 fix: remove duplicate figure captions in vol2
Figures should have caption only in fig-cap attribute, not duplicated
as trailing text. Removed redundant captions from:
- introduction.qmd: fig-loss-vs-n-d, fig-data-scaling-regimes, fig-scaling-regimes
- sustainable_ai.qmd: fig-datacenter-energy-usage
2026-02-22 11:18:32 -05:00
Vijay Janapa Reddi
1a22405288 fix(vol2): correct fenced div closers (:::: → :::) in security_privacy 2026-02-22 10:31:21 -05:00
Vijay Janapa Reddi
e1a667e06f refactor(vol2): convert bold pseudo-headers in collective_communication and robust_ai
- collective_communication: Torus Topology (TPU Pods), Rail-Optimized Routing (NVIDIA DGX) → ####
- robust_ai: Conceptual Foundation, Fast Gradient Sign Method (FGSM) → ######
2026-02-22 10:09:35 -05:00
Vijay Janapa Reddi
1d087503a0 refactor(vol2): convert bold pseudo-headers to proper headers per book-prose rules
- inference: Pattern 1/2/3, Example 8-way tensor parallelism
- sustainable_ai: Hardware/Mobile/Edge measurement, Cascade/Wake-word/Federated
  patterns, TinyML stack, MLPerf benchmarks, Energy Delay Product
- edge_intelligence: Peak Memory Usage, Convergence/Non-IID/Heterogeneity,
  Communication-Computation Trade-off, When Does FL Work?
- ops_scale, fault_tolerance, security_privacy: prior bold-to-header conversions
2026-02-22 10:05:33 -05:00
Vijay Janapa Reddi
266079c816 Enables appendices in PDF output
Uncomments the appendices section in the PDF configuration
file to ensure that appendices are included in the PDF output.
2026-02-22 09:29:45 -05:00
Vijay Janapa Reddi
bccc4d2646 Misc: quarto config, vol2 chapters, vscode-ext utils, remove site_libs clipboard 2026-02-21 19:45:46 -05:00
Vijay Janapa Reddi
4053b73384 Vol2 Fleet Stack: remove vertical line, center three-column example 2026-02-21 19:44:18 -05:00
Vijay Janapa Reddi
f0ddc607d6 Improve vol2 Fleet Stack: subtitles, Part labels, Distribution icon, line wraps 2026-02-21 19:34:05 -05:00
Vijay Janapa Reddi
f44ead20bf Standardize cover images across Vol1 and Vol2; fix Vol2 PDF config
- Cover images: no caption, no fig label, consistent images/ path, fig-alt for all
- Vol1: remove captions from conclusion, data_selection
- Vol2: remove half-title, fix intro/ conclusion/ fleet_orchestration covers;
  add fig-alt to 11 chapters; fix robust_ai path ./images/ -> images/
- Vol2 PDF: use before-body-includes.tex (match Vol1, no half-title)
2026-02-21 19:25:27 -05:00
Vijay Janapa Reddi
40d606fda0 Match Vol2 PDF config to Vol1; sync about.qmd format blocks
- Vol2 PDF: remove half-title, disable lof/lot/lol, toc/number-depth 2, align titlepage
- Vol2 about.qmd: add Beyond This Book and Using This Book supplementary blocks
2026-02-21 19:13:40 -05:00
Vijay Janapa Reddi
17117adc70 fix(vol2): use ETH Zurich Blue intensity gradient for Fleet Stack diagrams
Replace four distinct colors (Brown, Blue, Green, Red) with ETHZ Blue
intensity gradient (25%→50%→75%→100%) in fig-fleet-stack and
fig-vol2-roadmap, matching vol1 mlsysstack crimson gradient pattern.
2026-02-21 19:07:08 -05:00
Vijay Janapa Reddi
f954de69d2 fix: replace directional figure/table refs with explicit @tbl- cross-refs
Replace 'above'/'below' references with stable @tbl- and @fig- IDs
to avoid broken refs when content or layout changes.

Vol 1: model_compression.qmd - deployment gap table
Vol 2: collective_communication, compute_infrastructure, introduction,
       ops_scale
2026-02-21 19:00:36 -05:00
Vijay Janapa Reddi
b1d7fa6778 docs: refactor all 134 definitions across Vol 1 & 2 to Platinum Standard template 2026-02-21 18:54:57 -05:00
Vijay Janapa Reddi
8f6950a257 feat(pdf): align cover layout across volumes, add logo recolor script
- Vol 2: reference/citation at document end, sky-blue logo, cover image position
- Vol 1: match cover image position (bg-image-left 0.175, bg-image-bottom 8)
- Add recolor_cover_logo.py for hue-shift variants of cover logo
2026-02-21 16:20:05 -05:00
Vijay Janapa Reddi
417f47722a fix(pdf): align Vol 2 reference/citation location with Vol 1 (document) 2026-02-21 15:59:29 -05:00
Vijay Janapa Reddi
218ad6ad93 style(tables): use • and <br> for list cells in pipe tables
- edge_intelligence: Constraint-Solution Mapping (•&nbsp; → •<br>)
- security_privacy: Defense Selection Framework (- Item → •<br>)
- sustainable_ai: Critical Materials (semicolons → •<br>)

Consistent with hw_acceleration pattern for HTML/PDF/EPUB.
2026-02-21 15:58:32 -05:00
Vijay Janapa Reddi
b4c86de3f1 refactor(figures): div wrapper pattern, responsive CSS, remove redundant labels
- Wrap Python figures in div with fig-env, fig-pos, fig-cap, fig-alt
- Remove #| label from blocks when div has #fig-xxx
- Add responsive figure CSS (max-width, height: auto) for HTML
- Add figure headers to Python blocks (Context, Goal, Show, How, Imports, Exports)
2026-02-21 15:52:26 -05:00
Vijay Janapa Reddi
99661315eb feat(pdf): pipe table cell line breaks with <br> and makecell
- Add Lua filter to convert <br> in table cells to \makecell for PDF
- Use pipe table with • and <br> in hw_acceleration hardware evolution table
- Add makecell package; set arraystretch to 1.6; top-align makecell cells
- Register filter in PDF config
2026-02-21 15:50:37 -05:00
Vijay Janapa Reddi
eaa545f115 docs: add documentation-style headers to Python figure blocks
Add Context/Goal/Show/How/Imports/Exports headers to all Python figure
blocks (#| label: fig-*) in Vol 1 and Vol 2, matching the setup-block
pattern. Headers placed after Quarto options and before imports.
2026-02-21 14:44:24 -05:00
Vijay Janapa Reddi
b756cb7da3 fix: vscode extension activation error handling and workspace detection
- extension.ts: wrap activate() body in try/catch so activation failures
  surface in the Output channel instead of crashing silently
- workspace.ts: return undefined when no book/binder marker is found
  instead of returning the first workspace folder unconditionally
2026-02-21 14:33:43 -05:00
Vijay Janapa Reddi
9e809d21c4 feat: full-stack Pint robustness and class-based namespace isolation
Python library (mlsys/):
- constants.py: add ureg.default_format, set_application_registry, MS alias comment
- formatting.py: isinstance checks, add fmt_full(), fmt_split(), .m_as() modernization
- formulas.py: fleet formulas return Quantity, @ureg.check() decorators, .m_as() everywhere
- hardware.py: dimension-first validation in __post_init__, Quantity[float] annotations
- models.py: __post_init__ dimension checks, size_in_bytes() enforcement, ureg.count→ureg.param
- test_units.py: +50 robustness tests (wrong-unit HardwareSpec, fleet formulas, fmt_full)
- validate_pint_usage.py: new static analysis script for Pint anti-patterns in QMD files
- transform_pico_cells.py: transformation script for PICO cell restructuring

QMD chapters (Vol1 + Vol2 — all 43 chapters with Python cells):
- Wrapped all Python compute cells in class-based namespace isolation (PICO pattern)
- Added EXPORTS bridges so class-internal values are accessible to prose inline Python
- Modernized .to(unit).magnitude → .m_as(unit) throughout
- Removed bare .magnitude calls; all unit extractions now explicit
- Fleet appendices (appendix_fleet, appendix_communication, appendix_reliability):
  full Quantity-return cascade for MTBF, AllReduce, Young-Daly, checkpoint formulas

All 43 chapters verified building cleanly (HTML) after changes.
2026-02-21 14:33:36 -05:00
Vijay Janapa Reddi
b887b91a2c fix: resolve cross-cell export gaps found during comprehensive HTML build verification
After the class-based namespace isolation pass, missing EXPORTS bridge
variables were discovered by running all chapters through the HTML build pipeline.

Vol1 fixes:
- nn_computation: add hog_grid_str/hog_bins_str exports; convert generator
  expressions to for-loops (Python 3 class scope skips class namespace);
  add mnist_large/small_l1/l2 exports for footnote inline Python
- ml_systems: add cloud_compute/memory/ai_frac, mobile_tops/bw/ratio/
  bottleneck/compute/memory_frac, cloud_thresh_bw_str, edge_thresh_bw_str
  exports; complete ResnetMobile EXPORTS section
- data_selection: fix FpScalingCalc invariant (min_samples_threshold 50→150
  so 100 expected rare samples < 150 threshold holds true)
- model_compression: FusionCalc bandwidth_reduction invariant 50→40%
- nn_architectures: add 'param' unit to lighthouse-table-specs imports

Vol2 fixes:
- data_storage: add missing 'watt' import to chapter setup cell
- fault_tolerance: export per_node_gbs raw float for prose arithmetic
- appendix_fleet: export rho_7b raw float for fmt() call in prose
- appendix_c3: add .magnitude to calc_effective_flops() result (returns
  Quantity since formulas.py upgrade, not raw float)
- appendix_reliability: wrap worked-example-young-daly in class with EXPORTS

All 43 chapters with Python cells verified passing after fixes.
2026-02-21 14:20:43 -05:00
Vijay Janapa Reddi
5677633b4c Update symlinks to point to vol1 build config after Vol1 build run 2026-02-21 10:51:05 -05:00
Vijay Janapa Reddi
edb2dd17b0 Fix Vol1 standalone PDF build errors across 4 chapters
- hw_acceleration: escape % in callout title 'The Five-Percent Utilization Mystery'
  (LaTeX treats % as comment char in div attribute titles, truncating the box)
- data_selection: escape % in callout title 'The Ninety-Nine Percent Sparsity Trap'
  (same \fbxSimple runaway argument error)
- model_compression: remove 28-line orphaned stale class body (merge artifact);
  add missing mat_dim=4096 to LowRankFactorization class parameters
- model_serving: move littles-law-calc code cell before the prose that references
  its exported variables (serving_qps_str etc. used before they were defined)
2026-02-21 10:48:12 -05:00
Vijay Janapa Reddi
35cc915041 fix: ensure all 36 Vol2 chapters build as standalone PDFs
Fixes a series of LaTeX/Pandoc compilation errors across Vol2 so every
chapter builds cleanly with `binder build pdf <chapter> --vol2 -v`.

Key fixes applied:

- Citations removed from fig-caps, table cells, and footnote definitions
  (Quarto 1.8 `marginCitePlaceholderInlineWithProtection` bug with
  `citation-location: margin`); citations restored to surrounding prose
- TikZ nodes with `\\` line breaks given `align=center/left` to exit
  LR mode (robust_ai, sustainable_ai)
- `\argmax` → `\operatorname{arg\,max}` (undefined in amsmath)
- `\texorpdfstring` wrapping for math in section headers (notation)
- Multi-line `{python}` inline expressions in grid tables converted to
  pipe tables (appendix_communication)
- Math expressions split across grid table row boundaries converted to
  pipe tables to avoid `\{\beta\}\$` rendering corruption
- Stale class references (`ImageNetBottleneck`, `PrefetchBuffer`,
  `CheckpointStorage`) fixed → `StorageEconomics.*` (data_storage)
- Missing `batch_per_gpu` factor in aggregate bandwidth formula (data_storage)
- Duplicate `xytext` keyword in `ax.annotate()` call (edge_intelligence)
- `&lt;` HTML entity mixed with unescaped `$` in table cells fixed (security_privacy)
- Incorrect `check()` invariant corrected (appendix_fleet)
2026-02-21 09:44:46 -05:00
Vijay Janapa Reddi
fc093ab8de Merge pull request #1194 from harvard-edge/fix/ch5
Update figure in chapter 5
2026-02-21 09:30:09 -05:00
Zeljko Hrcek
678a218372 Update figure in chapter 5 2026-02-21 15:20:35 +01:00
Vijay Janapa Reddi
62b98edee1 Updates book content and configuration
Refines book abstracts, table of contents, and diagram configurations for improved clarity and structure.

This commit enhances the descriptions of both Volume I and Volume II, emphasizing their respective focuses. It also introduces a framework decision tree to guide the selection of parallel training strategies and inference frameworks, and diagrams for visualizing hardware constraints.
2026-02-21 08:19:01 -05:00
Vijay Janapa Reddi
0614676798 Adds PDF config for Volume II of the book
Creates a YAML configuration file specifically for generating the PDF version of Volume II: Machine Learning Systems at Scale.

This configuration defines the project structure, book metadata (title, author, abstract), chapter organization, and PDF-specific settings like cover page design, table of contents depth, and inclusion of LaTeX files for custom styling.

This allows for independent building and customization of the PDF output for Volume II.
2026-02-21 08:17:13 -05:00
Vijay Janapa Reddi
9e35563d00 Merge remote-tracking branch 'origin/feature/book-volumes' into feature/book-volumes 2026-02-21 08:16:50 -05:00
Vijay Janapa Reddi
c68ca02d9e Enhances data pipeline debugging flowchart
Improves the data pipeline debugging flowchart by adding visual cues.

These cues help to highlight the type of data issue being investigated
and make the flowchart easier to understand.
2026-02-21 08:15:29 -05:00
Vijay Janapa Reddi
87ffaf288d Refines content for Volume 1 conclusion
Enhances the conclusion of Volume 1, improving clarity and flow by:

- Refining wording and structure for better readability
- Clarifying the connection between theoretical invariants and practical applications
- Adding information for clarity and context
2026-02-21 07:59:34 -05:00
Vijay Janapa Reddi
718f867039 Vol1: improve book abstracts and chapter content
- Config: academic, standalone abstracts for PDF/EPUB/copyedit
- Chapters: ml_systems, nn_architectures, nn_computation, training
2026-02-21 06:58:22 -05:00
Zeljko Hrcek
ae2ef83dd3 Merge branch 'feature/book-volumes' into fix/training 2026-02-21 09:54:24 +01:00
Zeljko Hrcek
403994ea2e Update training chapter and add missing color definition 2026-02-21 09:28:04 +01:00
Vijay Janapa Reddi
09602445de chore: update book content, config, appendices, and tooling
- Vol1: chapter updates across backmatter, benchmarking, data, frameworks, etc.
- Vol2: content updates, new appendices (assumptions, communication, fleet, reliability)
- Quarto: config, styles, formulas, constants
- Add SEMINAL_PAPERS_V2.md, learning_objectives_bolding_parallel.sh
- VSCode extension: package.json, chapterNavigatorProvider
- Landing page and docs updates
2026-02-20 18:55:24 -05:00
Vijay Janapa Reddi
b5a9e590db Standardizes P.I.C.O. code blocks and consolidates specifications across Volume 2
Audits and refactors Volume 2 chapters to ensure all Python calculation cells adhere to the P.I.C.O. (Parameters, Invariants, Calculation, Outputs) standard.

- Consolidates storage specifications and economics into StorageSetup and StorageEconomics classes in data_storage.qmd.
- Refactors collective communication math into the AllReduceCost class in collective_communication.qmd.
- Standardizes infrastructure and performance engineering setups in compute_infrastructure.qmd and performance_engineering.qmd.
- Corrects NameErrors and missing imports in benchmarking and platform ROI calculations.
- Ensures all prose variables are correctly exported and scoped within Safe Class Namespaces to prevent global pollution and ensure mathematical consistency across the fleet-scale narrative.
2026-02-20 16:53:20 -05:00
Vijay Janapa Reddi
abc7ef01d8 Fixes broken P.I.C.O. code blocks and missing imports across Volume 1
Audits all Volume 1 chapters to identify and repair structural errors in Python calculation cells introduced during the P.I.C.O. refactor.

- Consolidates redundant memory calculations and fixes missing imports in nn_computation.qmd.
- Refactors AttentionMemory in nn_architectures.qmd to resolve NameErrors and duplicated blocks.
- Cleans up QuantizationSpeedup and restores MobileNetCompressionAnchor in model_compression.qmd.
- Resolves missing Models and Hardware imports in benchmarking.qmd.
- Updates LighthouseModels in ml_systems.qmd with missing variables for MobileNet and KWS.
- Corrects indentation and structural integrity across all Volume 1 calculation scenarios to ensure valid rendering and mathematical consistency.
2026-02-20 15:43:42 -05:00
Vijay Janapa Reddi
b6b2c94988 Refactors Volume II content and structure
Restructures Volume II to improve narrative flow and address scale impediments, including reordering of sections and addition of introductory material.

Introduces "Master Map" to guide readers through the volume's layered progression.

Adds callout notes to bridge concepts between sections.

Moves references.qmd to backmatter and adjusts chapter organization for clarity.

Updates hardware parameterization and network performance modeling within code blocks.
2026-02-19 14:39:54 -05:00
Vijay Janapa Reddi
45f46ad70d Reinforces key concepts with concrete examples
Deepens understanding of abstract principles by adding concrete examples and numerical anchors.

These additions provide tangible context and illustrate the practical implications of the discussed concepts, which aids in comprehension and application. It also adds context to constraints, economics and performance.
2026-02-19 14:35:48 -05:00
Vijay Janapa Reddi
13b29eb0ea Refactors concept maps for volume 1 chapters
Updates concept map YAML files for various chapters in volume 1, including introduction, benchmarking, data engineering, data selection, frameworks, hardware acceleration, ML systems, MLOps, ML workflow, model serving, NN architectures, NN computation, optimizations, responsible engineering, and training.

Replaces the old YAML structure with a new structure that focuses on primary, secondary concepts, technical terms, methodologies, and formulas. The change emphasizes the core concepts and their relationships within each chapter. The generated dates are updated to reflect a future date.
2026-02-19 13:49:04 -05:00
Vijay Janapa Reddi
e11ad3d44c Strengthen Vol1 intellectual spine with nine micro-insertions across 12 chapters
Insert thesis declarations, spine reconnections, and evidence elevations
that make the book's central claim explicit: ML systems engineering is a
distinct discipline governed by permanent physical laws. No restructuring
or deletions; insertions only, matching the surrounding rhetorical register.
2026-02-19 13:03:05 -05:00
Vijay Janapa Reddi
717dcebc31 Consolidate bib files and rename responsible_engineering to responsible_ai
- Remove 17 empty per-chapter .bib files (all contained only newlines)
- Consolidate HTML and EPUB configs to use central backmatter/references.bib
  (matching the pattern already used by PDF configs and Vol1)
- Rename responsible_engineering/ to responsible_ai/ for consistency with
  robust_ai/ and sustainable_ai/ in Part IV: The Responsible Fleet
- Update all 4 Quarto config files with new path
2026-02-19 09:39:07 -05:00