Commit Graph

10478 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
6f562fd003 Refactor: Port Chapters 4 & 5 to mlsys with Direct Access Pattern
- Refactored  (Chapter 4) to use  and .
- Refactored  (Chapter 5) to use  and  classes.
- Adopted the 'Direct Access' pattern: eliminating export blocks and referencing  directly in Markdown.
- Verified renders for both chapters.
2026-02-10 17:24:48 -05:00
Vijay Janapa Reddi
89a7b5305c Refactor: Port Chapter 2 (ML Systems) to mlsys Objects
- Refactored  to use , , and  registries.
- Expanded  with  devices (Coral, Jetson, NUC) and .
- Expanded  with  (DLRM) and  family.
- Fixed registry bugs (Coral bandwidth, GPT class definition).
- All unit tests passing.
2026-02-10 17:19:34 -05:00
Vijay Janapa Reddi
ad0e36f7c6 Harden with internal assertions and migrate Chapters 1, 13, 16
- Added  assertions to  and  to enforce physical plausibility.
- Introduced  registry for Cloud/Edge/Mobile/TinyML constraints.
- Refactored , , and  to use object-oriented Digital Twins.
- Replaced loose constants with registry-backed attributes (e.g. ).
- Verified build and unit tests pass.
2026-02-10 16:54:07 -05:00
Vijay Janapa Reddi
f136f96fd8 Refactor: Rename library to and introduce Digital Twins
Renamed the core physics engine from  to  to better align with
the book's title and pedagogical goals.

New features:
- Introduced  and  classes in  and .
- Digital twins now carry their own attributes (bandwidth, FLOPS) and
  methods (ridge_point, memory_size).
- Global search and replace updated all 16 chapters to use .
- Maintained backward compatibility for legacy constants during migration.
2026-02-10 16:46:37 -05:00
Vijay Janapa Reddi
073bee9f13 Cleanup: Remove legacy physx modules and test artifacts
Removed obsolete Python modules from  that were replaced
by the P.I.C.O. design pattern (logic moved directly into QMD files).
Deleted files include chapter-specific scripts (), unused
calculators (, , etc.), and manual audit tools.
2026-02-10 15:45:31 -05:00
Vijay Janapa Reddi
83ce92624e Editorial Corrections & Code Hardening (Volume 1)
This commit refactors the underlying Python calculation cells for Chapters 1-16
to strictly enforce mathematical consistency with the narrative.

**Key Text/Numeric Updates (For Editorial Review):**

1.  **Chapter 3 (Workflow) - Edge Necessity Scenario:**
    -   *Change:* Increased clinic patient count from **100** to **150**.
    -   *Reason:* With 100 patients, the calculated upload time was ~5.5 hours, which fits within the 8-hour clinic day, contradicting the chapter's conclusion that 'Edge is Mandatory.' Increasing to 150 pushes upload time to >8 hours, mathematically validating the narrative.

2.  **Chapter 1 (Introduction) - Model Drift Scenario:**
    -   *Change:* Reduced monthly accuracy drift rate from **8.0%** to **0.8%**.
    -   *Reason:* An 8% monthly drop is a catastrophic failure that would be immediately noticed. A 0.8% drop correctly models the 'silent failure' (boiling frog) scenario described in the text.

3.  **Chapter 3 (Workflow) - Velocity vs Quality:**
    -   *Change:* Reduced 'Large Model' accuracy gain per iteration from **0.5%** to **0.15%**.
    -   *Reason:* The original rate caused the large model to hit 99% accuracy almost instantly, invalidating the 'Velocity is a Feature' argument. The new rate correctly models diminishing returns, allowing the faster (small) model to win.

4.  **Chapter 15 (Responsible Engineering) - TCO Analysis:**
    -   *Verification:* Verified and stabilized the 3-year Total Cost of Ownership (TCO) calculations. Confirmed that Inference TCO (.5M) dominates Training TCO (8K) by ~40x, supporting the 'Efficiency as Responsibility' thesis.

**Technical Changes (Code Only):**
-   Refactored all calculation cells to use the **P.I.C.O. (Parameters, Invariants, Calculation, Outputs)** design pattern.
-   Added assertion guards (Invariants) to prevent future regressions where math contradicts prose.
-   Fixed variable scope issues in Chapter 10 (Model Compression) and Chapter 15.
-   Disabled false-positive linter warnings for standard LaTeX spacing.
2026-02-10 14:59:26 -05:00
Vijay Janapa Reddi
9d840fc1a0 Merge branch 'dev' into feature/book-volumes 2026-02-10 13:12:34 -05:00
kai
f05bb12cb2 updated the iframe login issues 2026-02-10 10:25:11 -05:00
kai
1178d21600 flow with particles as new timeline opening 2026-02-09 17:46:03 -05:00
Vijay Janapa Reddi
9797b74707 Improves figure list generation for book builds
Refactors figure list generation to reliably locate and clear LaTeX manifest files.

- Searches for the figure manifest in both the quarto root and build output directory,
  handling cases where the post-render step moves the file.
- Clears stale manifests from both locations to avoid incorrect figure counts from
  previous builds.
- Moves the LaTeX manifest to the build output directory to keep the source
  tree clean.
- Updates the merge script to find the manifest dynamically.

This prevents issues where figure counts are mismatched due to outdated or
missing manifest files.
2026-02-09 15:33:45 -05:00
Vijay Janapa Reddi
20b8bb51a4 fix: restore black uppercase styling for part page titles 2026-02-09 10:58:12 -05:00
Vijay Janapa Reddi
224e6ad00e WIP: editorial updates across Vol 1/Vol 2 chapters and LaTeX config 2026-02-09 10:55:46 -05:00
kai
e95c9d96c7 updating antialiasing ant crawl issue...arxiv 2026-02-09 08:15:18 -05:00
Vijay Janapa Reddi
4dd1bf70aa Fix pre-commit issues: cross-refs, footnotes, unreferenced tables, SVG hook
- Fix broken cross-refs in training.qmd (em-dash parsed as part of ID)
- Remove footnote from table cell in ml_systems.qmd
- Add @tbl- references for 22 unreferenced tables across 5 files
- Comment out stale SVG prevention hook in pre-commit config
- Auto-fixes from bibtex-tidy, blank-line collapse, pipe-table prettify
2026-02-09 07:57:16 -05:00
Vijay Janapa Reddi
6dc90adf82 grammar pass 2026-02-09 07:36:59 -05:00
Vijay Janapa Reddi
1160cc55b3 page location 2026-02-09 07:09:54 -05:00
Vijay Janapa Reddi
c6784f7dc5 fixes 2026-02-09 05:55:56 -05:00
Vijay Janapa Reddi
924c0d43a9 commmit 2026-02-09 00:10:38 -05:00
Vijay Janapa Reddi
25f5fd40ed fix title numbers, part size etc. 2026-02-08 23:27:07 -05:00
Vijay Janapa Reddi
a532e3e031 commit 2026-02-08 23:22:01 -05:00
Vijay Janapa Reddi
53193bad5a fixes 2026-02-08 22:17:31 -05:00
Vijay Janapa Reddi
19911441d7 Add smooth gradient data bar and layer-colored wires to ML Systems Stack
The data bar now uses a smooth vertical gradient derived from the layer
intensities: each color stop matches the wire flowing into it, and PGF
interpolates between stops. This makes data's cross-cutting role visible
— two distant bright layers produce a gradient that stays warm across
the space between them, revealing skip connections through data.

Each wire's color matches its layer's intensity, showing how strongly
each layer plugs into the shared data bus. The About page now shows
three example stacks (HW Acceleration, Training, Responsible Engineering)
to illustrate how the lens shifts across chapters.
2026-02-08 19:33:48 -05:00
Vijay Janapa Reddi
881cf8852e Explain data bar gradient behavior in About page
Add prose explaining how the ML Systems Stack's data bar shading
reflects cross-layer data flow and skip connections, priming readers
to interpret the visual cue as they progress through chapters.
2026-02-08 19:26:09 -05:00
Vijay Janapa Reddi
5376f1ffc1 Editorial and formatting updates across Vol 1 chapters 2026-02-08 18:05:51 -05:00
Vijay Janapa Reddi
b43f8e887d Editorial pass across Vol 1 chapters and config
- Revise prose, index entries, and references across all 16 chapters
- Update quarto config (epub/html) for vol1 and vol2
- Add render_figures.py testing script
- Update inject_parts.lua filter and header-includes.tex
- Update notation, appendix_dam, and references.bib
- Remove vol1/vol2 foreword files
2026-02-08 17:18:42 -05:00
Vijay Janapa Reddi
4f9409380d updates 2026-02-08 14:01:59 -05:00
Vijay Janapa Reddi
d88f88e045 Replace broken TikZ broadcasting diagram with clean SVG
The TikZ-rendered broadcasting diagram had clipping issues in result
cells (text overflow). Replace with a custom SVG using the book palette
that clearly shows A(3,1) + B(1,4) = Result(3,4) with dashed cells
for virtually expanded dimensions.
2026-02-08 12:57:43 -05:00
Vijay Janapa Reddi
2df1256d89 review pass 2026-02-08 12:45:52 -05:00
Vijay Janapa Reddi
3060382893 Revert ONNX and KWS image references back to original PNGs
Keep original raster images for onnx_new.jpg, data_engineering_kws.png,
and data_engineering_kws2.png rather than replacing with custom SVGs.
2026-02-08 12:31:06 -05:00
Vijay Janapa Reddi
1549e7aff4 Update chapter image references to new custom SVGs
Replace raster image paths with custom SVG equivalents:
- frameworks: onnx_new.jpg -> onnx_interop.svg
- data_engineering: data_engineering_kws.png -> kws_pipeline.svg
- data_engineering: data_engineering_kws2.png -> kws_multilingual.svg
- hw_acceleration: int8_tops_nvidia.png -> int8_tops.svg
- model_compression: efficientnumerics_calibrationcopy.png -> activation_histogram.svg
- model_compression: modeloptimization_quant_hist.png -> quantization_error.svg
- model_compression: color-mapping_9f68f817.jpeg -> kernel_weights.svg
- model_compression: sprase-heat-map_a50fe5a9.png -> sparsity_heatmap.svg
2026-02-08 12:27:52 -05:00
Vijay Janapa Reddi
d9a84900e1 Add 8 custom SVG diagrams replacing raster images across Vol 1
New SVGs in book palette (crimson/navy/green), replacing PNG/JPG:
- frameworks: onnx_interop.svg (hub-and-spoke ONNX interoperability)
- data_engineering: kws_pipeline.svg (keyword spotting system)
- data_engineering: kws_multilingual.svg (multilingual data prep)
- hw_acceleration: int8_tops.svg (NVIDIA INT8 TOPS log chart)
- optimizations: activation_histogram.svg (ResNet50 activations)
- optimizations: quantization_error.svg (quantization noise bell curve)
- optimizations: kernel_weights.svg (conv filter weight grid)
- optimizations: sparsity_heatmap.svg (pruning sparsity by layer)

All SVGs validated for well-formed XML.
2026-02-08 12:27:29 -05:00
Vijay Janapa Reddi
cae14a95d8 Update chapter image references from PNG/JPG to custom SVGs
Replace raster image paths with custom-drawn SVG equivalents:
- dl_primer: ai_dl_progress_nvidia.png -> ai_dl_progress.svg
- dl_primer: bio_nn2ai_nn.png -> bio_nn2ai_nn.svg
- ml_systems: edge_ml_iot.jpg -> edge_ml_iot.svg
- responsible_engr: human_centered_ai.png -> governance_layers.svg
- responsible_engr: fairness_cartoon.png -> fairness_threshold.svg
- responsible_engr: interpretability_model_spectrum.png -> interpretability_spectrum.svg
2026-02-08 12:20:25 -05:00
Vijay Janapa Reddi
2ebe162bfe Fix governance layers SVG annotation text overlapping ellipse strokes
Shift right-side annotations inward so text bounding boxes stay fully
within their containing ellipses. Verified programmatically that all
text elements are safely inside boundaries with no crossings.
2026-02-08 12:08:56 -05:00
Vijay Janapa Reddi
c2d0aa3e59 Fix governance layers bottom annotation overlapping ellipse
Move the directional arrow and annotation text below all ellipses
(y=455/473, well below the government ellipse bottom at y=445).
Combine the two separate annotations into a single clean line.
2026-02-08 12:06:45 -05:00
Vijay Janapa Reddi
879a487b58 Fix governance layers SVG text overlaps and match prose
Redesign layout to prevent text from crossing ellipse boundaries:
- Widen canvas, enlarge all four ellipses for breathing room
- Simplify detail items to match prose (audit trails, verification,
  explainable interfaces, SE workflows for Team; leadership, hiring,
  reviews for Organization; auditing firms, certification, professional
  societies for Industry)
- Place org-band items at x=530 y=260-316 (inside org, outside team)
- Place industry-band items at x=610 y=160-188 (inside industry)
- Add directional annotation: "Requirements flow inward" with arrow
- Add "Technical practices enable compliance" outward annotation
2026-02-08 12:06:03 -05:00
Vijay Janapa Reddi
28e37b0454 Add custom SVG replacements for governance layers and activity classification
- governance_layers.svg: nested ellipses showing Government Regulation
  (outermost, crimson), Industry certification, Organization safety
  culture (navy), and Team engineering practices (innermost, green).
  Replaces human_centered_ai.png.

- activity_classification.svg: four-panel progression showing how
  rule-based activity classification grows from 1 rule (walking) to
  unmanageable complexity (baseball?), motivating the shift to ML.
  Stick figures with code snippets. Replaces activities.png.

Both use the book's standard palette and are not yet wired into
chapter .qmd files.
2026-02-08 12:02:12 -05:00
Vijay Janapa Reddi
53b09492dc Redesign IoT edge devices SVG with book-consistent palette
Replace the solid blue background (copied from Edge Impulse source)
with a clean white/light background using the book's standard palette:
- Navy (#004c97) for edge device icons
- Forest green (#2e8b57) for the central "Edge Hub"
- Crimson (#a31f34) for cloud connectivity (visually distinct)
- Gray dashed lines for data links

Retitled to "Edge Device Deployment" with subtitle matching the
figure caption. Added a small legend. Prints well in grayscale.
2026-02-08 11:23:40 -05:00
Vijay Janapa Reddi
3173b403d6 first pass 2026-02-08 11:11:44 -05:00
Vijay Janapa Reddi
b0229977e8 Fix text overlaps in AI timeline SVG Deep Learning zone
Reorganize DL zone layout: put title on single line ("Deep Learning"),
subtitle directly below, icon centered at y=185 (well below subtitle),
and milestone markers starting at y=250+. Eliminates the collision
between title, icon binary text, "Image recognition" label, and
"2012 AlexNet" milestone that occurred when all occupied the same
vertical space.
2026-02-08 10:48:10 -05:00
Vijay Janapa Reddi
8a4ca982ff Improve custom SVG diagrams with richer iconography and layout fixes
- interpretability_spectrum: add small model icons (tree, line, sigmoid,
  forest, network, deep network) under each label, plus bottom annotations
- bio_nn2ai_nn: redesign artificial neuron with z|f combined node matching
  original PNG, separate Linear/Activation Function labels
- fairness_threshold: thicker dotted threshold lines, bolder plus-sign
  markers, bright blue/red matching original PNG style
- ai_dl_progress: replace abstract icons with era-specific illustrations
  (checkerboard for AI, email spam filter for ML, binary+magnifier for DL),
  widen SVG to 1100px for proper DL zone spacing
- edge_ml_iot: separate cloud icon from smartphone to fix overlap
2026-02-08 10:45:09 -05:00
Vijay Janapa Reddi
498ea392de Add custom SVG replacements for sourced PNG/JPG figures
Create original SVG diagrams to replace externally-sourced raster
images, eliminating licensing concerns for the textbook:

- ai_dl_progress.svg: AI/ML/DL timeline (replaces NVIDIA-sourced PNG)
- bio_nn2ai_nn.svg: biological-to-artificial neuron mapping
- fairness_threshold.svg: subgroup threshold effects diagram
- interpretability_spectrum.svg: model interpretability spectrum
- edge_ml_iot.svg: IoT edge devices (replaces Edge Impulse JPG)

All SVGs use consistent styling (Helvetica Neue, Harvard crimson/
navy/forest green palette) matching the existing dam_venn.svg.
Not yet wired into chapter .qmd files.
2026-02-08 10:19:35 -05:00
Vijay Janapa Reddi
3588828aaa Replace cryptic D≈20N with readable compute-optimal scaling laws label 2026-02-08 09:33:12 -05:00
Vijay Janapa Reddi
51e720714d Add D·A·M Venn diagram and widen ML stack data bar connectors
- Widen gap between ML systems stack layers and data bar in both
  margin and full-size variants so connector lines are clearly visible
- Add D·A·M Intersection Landscape Venn diagram (SVG + PNG) to the
  D·A·M Taxonomy appendix with reference table and explanatory prose
- Add forward references to the Venn from Introduction and Part III
- Add learning objective for intersection mapping
- Chapter prose refinements across multiple chapters
2026-02-08 09:30:47 -05:00
Vijay Janapa Reddi
532473fe74 Updates PDF config to use index file
Updates the PDF configuration file to correctly point to the index file for the first volume of the book.

This ensures the PDF generation process uses the correct entry point, which is crucial for structuring the book's content.
2026-02-08 08:09:25 -05:00
Vijay Janapa Reddi
5f2a4ee878 Refines discussion of model degradation over time
Clarifies the importance of understanding system behavior in the face of environmental changes that impact model performance.

Emphasizes the need for quantitative signals that connect distribution shift to expected performance loss and how data drift monitoring is crucial to preventing silent degradation.
2026-02-08 04:20:54 -05:00
Vijay Janapa Reddi
5c37de18ed format 2026-02-08 04:13:00 -05:00
Vijay Janapa Reddi
c39cfa72cc reset 2026-02-08 04:12:54 -05:00
Vijay Janapa Reddi
a3ece62330 Adds appendix intros, key takeaways, and more
Adds introductory sections ("Purpose" and "How to Use This Appendix") to several appendices, providing context and guidance for readers.

Improves overall structure and clarity by adding Key Takeaways callouts to chapters and implementing minor textual edits.

Refines rule for usage of `.unnumbered` on sub-headers in `CLAUDE.md`.

Addresses minor bugs and enhances indexing for improved searchability.
2026-02-08 03:42:25 -05:00
Vijay Janapa Reddi
fdebf9cd51 Improve math presentation in Vol 1 chapters
Clarify variables, units, and equation context so students can follow results.
2026-02-08 02:30:25 -05:00
Vijay Janapa Reddi
3dbaa04ebf fix: resolve all pre-commit hook failures across Vol 1 and Vol 2
Content fixes:
- Add references for all 8 appendix_machine tables in surrounding prose
- Remove cross-volume refs (@sec-distributed-training, @sec-security-privacy)
  and replace with self-contained prose
- Fix broken cross-refs (em-dashes, @sec-data-engineering → @sec-data-engineering-ml)
- Fix unreferenced equations (@eq-memory-wall, @eq-training-iron-law)
- Fix nested/forbidden footnotes (hw_acceleration, introduction, dl_primer)
- Fix drop cap incompatibility in conclusion.qmd
- Fix codespell false positive ("trough" added to ignore list)
- Add closer @tbl/@fig references near definitions across all chapters
- Replace inline fmt() calls with pre-computed _str variables (dl_primer)

Checker improvements:
- figure_table_flow_audit.py: exclude code block lines from gap calculation,
  add forward-reference tolerance, broaden code block detection to all fenced
  blocks (tikz, etc.)
- check_render_patterns.py: improve $...$ parsing with shortest-match spans,
  add exponent exception for {python} in ^{...}, exit 0 on warnings-only
2026-02-08 02:01:49 -05:00