Commit Graph

10643 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
5b0b2235f3 vol2: comprehensive footnote pass (25+ new high-signal footnotes across 16 chapters) 2026-02-23 17:58:08 -05:00
Vijay Janapa Reddi
f6f98266a0 vol2: comprehensive transformation pass (P.I.C.O. refactor, archetypes, hardware trajectories) 2026-02-23 17:38:37 -05:00
Vijay Janapa Reddi
2d887c5778 vol1: content updates (intro, data_selection, nn_architectures, model_compression, appendix_machine, responsible_engr, foundations_principles) 2026-02-23 17:22:47 -05:00
Vijay Janapa Reddi
913c616177 vol1: add IDs to all principle callouts, use \ref in conclusion table and prose 2026-02-23 16:39:33 -05:00
Vijay Janapa Reddi
951669d356 fix: inline math × — dimensions as $N\times M$, multipliers as N$\times$
- Fix rendering: dimensions (e.g. 224×224) use single math span $N\times M$
- Revert multipliers to N$\times$ / N--M$\times$ per LaTeX convention
- Fix malformed $N\times$ M → $N\times M$ across vol1/vol2
- Add revert_times_multipliers.py (one-off) and fix_times_math.py (dimension-only)
- Update book-prose guidelines in .claude/rules (dimension vs multiplier)
2026-02-23 14:51:24 -05:00
Vijay Janapa Reddi
97e21d21ce Adds constants for book consistency
Introduces a set of constants to ensure consistency across the book's code and prose.

These constants include:
- Memory capacities, interconnect bandwidths, model sizes
- Useful measures (GiB, GB, second, etc.)
- Formatting tools
- Deployment tiers (cloud, edge, mobile)
2026-02-23 13:08:56 -05:00
Vijay Janapa Reddi
689b040fde Pull in PR #1199: Updated figure in chapter 11 (hw_acceleration war story) 2026-02-23 09:40:05 -05:00
Vijay Janapa Reddi
5247736ce3 Centralizes constants and formatting for consistency
Refactors various sections to utilize centralized constants and formatting functions, improving code maintainability and consistency across the book.

Specifically:

- Replaces hardcoded values with constants defined in `mlsys.constants`.
- Uses the `fmt` function for consistent number formatting.
- Removes redundant calculations and string conversions by leveraging existing functions and constants.
- Introduces a `TransformerScaling` namespace to encapsulate transformer scaling logic.
- Adds invariants (guardrails) to ensure calculations match the book's narrative.
- Refactors MNIST example and moves the inference calculation to MNISTInference.
- Integrates responsible AI principles with lifecycle stages.

This reduces code duplication and ensures a unified representation of key parameters and calculations throughout the book.
2026-02-23 09:33:35 -05:00
Vijay Janapa Reddi
a392f073af fix(vol2): apply book-prose rules — section opener, contractions, leverage/utilize 2026-02-22 19:03:42 -05:00
Vijay Janapa Reddi
5005c14cd6 style(prose): eliminate 'the fact that' where possible (book-prose)
- Replace with 'that' or rephrase clause as subject; fix one remaining But→However in nn_architectures
2026-02-22 19:00:37 -05:00
Vijay Janapa Reddi
f661814f4c style(prose): fix sentence-initial But/And/Or (book-prose)
- Replace But with However or rephrase; And with Furthermore/restructure; Or with Alternatively where appropriate
2026-02-22 18:59:48 -05:00
Vijay Janapa Reddi
c9959e4689 style(prose): expand contractions in body prose (book-prose)
- can't→cannot, don't→do not, it's→it is, won't→will not, etc.
- Skip code/check()/comments; fix narrative and callouts only
2026-02-22 18:58:39 -05:00
Vijay Janapa Reddi
f4a006ce71 style(prose): apply book-prose rules across vol1 and vol2
- Replace recap-style openers (Having established… we now turn to)
- Replace section meta-openers (This section examines/presents…) with concrete openings
- Remove announcement transitions (We will examine, we now turn to)
- Remove Importantly/Most importantly at sentence start
- Remove In summary, bleeding edge, the lesson is clear
- Replace leverage/utilize (verb) with use; keep high-leverage
- Replace building upon with building on; remove as noted there
- Sample fixes: can't→can we not, it's→it is, So,→Thus, (contractions/sentence-openers)
2026-02-22 18:57:12 -05:00
Vijay Janapa Reddi
ca33f2f758 chore: checkpoint staged state before prose-style audit fixes 2026-02-22 18:47:52 -05:00
Vijay Janapa Reddi
3bde64caf0 refactor: gold-standard footnote overhaul across all 30 Vol1+Vol2 chapters
- Rewrote ~1,026 footnotes to MIT Press gold standard (ML Systems Tether,
  Three-Question Audit, Five Types A-E)
- Fixed 16 cross-chapter duplicate fn- keys with chapter-specific suffixes
- Pruned footnotes that failed Three-Question Audit (prerequisites,
  navigation aids, tool catalog entries)
- Restored fn-goodharts-law with Strathern attribution and ML failure modes
- Added 9 gold-standard footnotes to performance_engineering.qmd (previously zero)
2026-02-22 18:31:50 -05:00
Vijay Janapa Reddi
4ac473278e Adds citations and clarifies energy/scaling laws
Adds missing citations and clarifies the text in the appendix on machine learning,
specifically around the energy hierarchy and scaling laws. It also updates the
fault tolerance section to include a reference to the backpropagation paper.
2026-02-22 16:11:26 -05:00
github-actions[bot]
e1e3922972 Update contributors list [skip ci] 2026-02-22 19:08:36 +00:00
Vijay Janapa Reddi
ecb3af7fd2 fix(ci): pull before push in all-contributors workflow; add @salmanmkc to tinytorch and kits
- Add git pull --rebase before push so concurrent comment-triggered runs
  don't reject each other (only one of three runs had succeeded for PR 1179).
- Manually add @salmanmkc as code contributor to tinytorch and kits
  (labs was already added by the single successful run).
2026-02-22 14:05:31 -05:00
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
github-actions[bot]
31f82575e7 docs: add @salmanmkc as labs contributor for code 2026-02-22 18:57:22 +00:00
Vijay Janapa Reddi
7df97bd1a4 Merge pull request #1179 from salmanmkc/upgrade-github-actions-node24-general
Upgrade GitHub Actions to latest versions
2026-02-22 13:44:58 -05:00
Vijay Janapa Reddi
ab697a84f2 refactor(milestones): use stdlib tar filter='data' for safe CIFAR-10 extraction 2026-02-22 13:40:09 -05:00
Vijay Janapa Reddi
3a149a06a6 Merge pull request #1182 from RinZ27/fix/safe-data-extraction
Improve dataset extraction robustness
2026-02-22 13:34:06 -05:00
Vijay Janapa Reddi
ddbc0a45e3 Merge branch 'dev' of https://github.com/harvard-edge/cs249r_book into dev 2026-02-22 13:22:49 -05:00
Vijay Janapa Reddi
85c0cd4c83 Merge branch 'feature/tinytorch-core' into dev 2026-02-22 13:22:37 -05:00
Vijay Janapa Reddi
1733596996 style(module 19): fix table alignment in MLPerf benchmark docs 2026-02-22 13:22:31 -05:00
Vijay Janapa Reddi
55007e1f6e docs(module 19): add educational purposes disclaimer for MLPerf 2026-02-22 13:20:12 -05:00
Vijay Janapa Reddi
68d446edcf docs(module 19): add MLPerf trademark attribution and pedagogical framing
- MLPerf® is a trademark of MLCommons
- This module teaches the principles of MLPerf-style benchmarking
2026-02-22 13:19:43 -05:00
Vijay Janapa Reddi
335bad8cd0 fix(module 19): address benchmarking feedback from issue #1196
- Fix Pareto diagram: swap A/C so line has positive slope (latency vs accuracy)
- Add missing Image Classification writeup to Standard Benchmark Tasks
- Treat anomaly_detection as binary classification (np.rand(2))
- Convert MLPerf inputs to Tensors + transpose HWC→CHW for TinyTorch models

Fixes harvard-edge/cs249r_book#1196
2026-02-22 13:18:08 -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
9ab80d7cc0 fix: replace broken research paper link with arXiv PDF
The GitHub link (github.com/harvard-edge/TinyTorch/blob/main/paper/paper.pdf)
returns 404. Use arxiv.org/pdf/2601.19107 instead.

Fixes harvard-edge/cs249r_book#1198
2026-02-22 12:52:11 -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