Commit Graph

10415 Commits

Author SHA1 Message Date
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
Vijay Janapa Reddi
7e1c74dff2 style: cleanup stray anchors and .unnumbered attributes
- dnn_architectures: removed .unnumbered from 6 content headers that
  have numbered siblings (normalization variants, gradient flow topics)
- training: removed .unnumbered from Benchmark Results header
- ml_systems: removed 3 floating []{#sec-...} anchors left from
  earlier lone sub-header removal (already referenced by parent headers)
- appendix_machine: added .unnumbered to match sibling consistency
2026-02-07 22:57:39 -05:00
Vijay Janapa Reddi
4ec84f0316 style: final consistency audit across all 16 chapters
Second pass fixing remaining issues found by comprehensive audit:

- benchmarking: converted ~38 bold pseudo-headers to proper #### headers
  for training metrics, inference metrics, benchmark pitfalls, MLPerf
  scenarios, and organizational issues sections
- responsible_engr: removed 7 overly-granular #### headers (each only
  1 paragraph) under "When Responsible Engineering Succeeds" and "Why
  Engineers Must Lead", converted to flowing prose
- frameworks: removed one remaining bold lead in body text
- training: moved footnotes closer to their references, consolidated
  summary paragraph

12 chapters confirmed CLEAN with no issues.
2026-02-07 21:51:04 -05:00
Vijay Janapa Reddi
24bf40d681 style(data_engineering): add headers for drift type concepts
Covariate Shift, Label Shift, Concept Drift, and Label Quality Drift
each get their own #### header under "Detecting and Responding to
Data Drift". These are important named concepts with multi-paragraph
discussion, equations, and footnotes — exactly the case where sibling
headers are justified.

Also updated CLAUDE.md decision tree with guidance on when parallel
named concepts should get their own headers.
2026-02-07 21:30:15 -05:00
Vijay Janapa Reddi
088dd09c36 docs: add lone sub-header rule (Rule 8) to CLAUDE.md style guide
A section with exactly one child header should have the child removed,
letting content flow under the parent. Also renumbered Rule 8→9 for
header level decisions and updated the decision tree.
2026-02-07 21:25:37 -05:00
Vijay Janapa Reddi
78fe9e4615 style: remove 64 lone sub-headers that fragmented prose across all chapters
A lone sub-header is the only child at its level under a parent header,
adding no navigational value while fragmenting continuous prose. Removed
all 64 instances across 14 chapters, letting content flow directly under
the parent header.

Cross-reference IDs preserved as []{#sec-...} anchors where needed.

Affected: introduction, dl_primer, dnn_architectures, training,
frameworks, workflow, data_engineering, data_selection, hw_acceleration,
benchmarking, serving, ops, model_compression, responsible_engr.
2026-02-07 21:25:10 -05:00
Vijay Janapa Reddi
3bb6c5d8da style(ml_systems): remove lone sub-headers that fragment prose
Removed three #### headers (Distributed Processing Architecture,
Battery and Thermal Constraints, Extreme Resource Constraints) that
were the only sub-header under their parent ### section. The content
flows directly as prose under the parent header instead.
2026-02-07 21:17:48 -05:00
Vijay Janapa Reddi
3efe11dff4 style: convert overly granular headers to narrative prose in introduction
The ##### headers under Data/Model/System/Ethical Challenges sections
were too fine-grained — each covered only 1-2 paragraphs under a parent
#### that already named the theme. Converted to flowing prose with
inline emphasis for key terms.

Also updated CLAUDE.md style guide with "too granular for headers"
exception to prevent this pattern in future edits.
2026-02-07 21:16:59 -05:00
Vijay Janapa Reddi
309144ab90 style: convert bold pseudo-headers to proper section headers across all vol1 chapters
Apply consistent formatting rules from the new style guide (CLAUDE.md):
- Bold-start paragraphs that introduce topics with their own discussion
  converted to proper Markdown headers at the appropriate level
- Bold labels inside callout boxes preserved (pedagogical structure)
- Fallacy/Pitfall format preserved (established pattern)
- Bold terms in list items preserved
- Parallel definition-style lists preserved (3+ items, 1-2 sentences)
- Header hierarchy verified strict (no skipped levels)

Affects all 16 main chapters: introduction, ml_systems, dl_primer,
dnn_architectures, training, frameworks, workflow, data_engineering,
data_selection, hw_acceleration, benchmarking, serving, ops,
model_compression, responsible_engr, conclusion.

~200+ individual conversions across 826 insertions, 373 deletions.
2026-02-07 21:14:50 -05:00
Vijay Janapa Reddi
9f786c1879 docs: add section header and bold text style guide to CLAUDE.md
Codifies rules for consistent use of headers vs bold text across
all QMD chapters. Headers for section divisions, bold only inside
callouts, definition lists, fallacy/pitfall labels, and list items.
2026-02-07 20:35:55 -05:00
Vijay Janapa Reddi
a517ef5df6 refactor: editorial improvements across vol1 chapters
Training and Frameworks chapters restructured for clarity.
Data Selection chapter expanded. Header-includes.tex updated.
Various minor fixes across all chapter files.
2026-02-07 20:35:14 -05:00
github-actions[bot]
2ac790601e chore(tinytorch): bump version to tinytorch-v0.1.8 2026-02-07 20:55:09 +00:00
Vijay Janapa Reddi
419eeeb9cf refactor(dnn_architectures): three editorial passes, restructure Evolution section, add cross-chapter hooks
- Fix factual error: FLOPs misconception callout used parameter ratio instead of FLOPs ratio
- Harmonize contradictory energy figures (1 pJ vs 4.6 pJ MAC) with process-node context
- Eliminate six redundancies: RNN memory discussion, information-theoretic restatement,
  double model-compression forward-refs, skip-connection re-introduction, two architecture
  recap paragraphs in Selection Framework
- Fix formatting: Unicode N² → LaTeX $N^2$, inconsistent × notation, empty table row
- Fix self-referential cross-reference, clarify O(1) depth → O(1) sequential steps
- Restructure "Architectural Evolution" → "Cross-Architecture Building Blocks":
  organize by portable engineering primitive (GEMM, skip connections, normalization,
  gating) instead of architecture chronology, with new Born-In/Problem-Solved table
- Add targeted cross-chapter hooks to Vol 1 chapters: @sec-ai-acceleration (8→14),
  @sec-ai-training (1→3), @sec-ai-frameworks (1→3) at natural pedagogical points
- Update dl_primer intro paragraph and other Vol 1 chapter refinements
2026-02-07 15:52:07 -05:00
Vijay Janapa Reddi
967f07cc09 refactor: standardize vol1 cover images and update chapter content
Downscale 3 cover images (hw_acceleration, workflow, conclusion) to
1000x571 to match the majority of chapters. Data_engineering, serving,
and data_selection covers left at original dimensions due to different
aspect ratios requiring lossy cropping. Also includes prose and LaTeX
updates across multiple chapters.
2026-02-07 12:54:39 -05:00