Commit Graph

19 Commits

Author SHA1 Message Date
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
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
73a956a09b chore(volumes,vscode-ext): batch volume updates and tooling improvements
Checkpoint the branch-wide content/config revisions together with workbench enhancements so chapter rendering and developer workflows stay aligned. This captures the current validation-driven formatting and parallel build/debug improvements in one commit.
2026-02-15 14:03:27 -05:00
Vijay Janapa Reddi
e3cc9f7af3 refactor: rename ml_ml_workflow files, consolidate CLI, and clean up scripts
Remove redundant ml_ prefix from ml_workflow chapter files and update all
Quarto config references. Consolidate custom scripts into native binder
subcommands and archive obsolete tooling.
2026-02-13 11:06:28 -05:00
Vijay Janapa Reddi
2390c3ab31 Refactor: consolidate Quarto config layers and content reorganization.
Unifies Quarto metadata into shared base/format/volume fragments while carrying through chapter path, asset, and tooling updates to keep the repository consistent and easier to maintain.
2026-02-12 15:38:55 -05:00
Vijay Janapa Reddi
c015b9d80a Refactor: stabilize non-PDF build workflows and semantic editor cues.
Standardize Quarto config/style handling for HTML/EPUB volume builds, add explicit binder reset commands by format, and align QMD reference/label highlighting so structural tokens share consistent visual semantics.
2026-02-11 20:36:16 -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
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
Vijay Janapa Reddi
29fabf35c1 Fix figure list to handle appendix figures and exclude shelved files
Two issues:
1. LaTeX parser regex only matched numeric figure numbers (e.g., 1.1)
   but appendices use letter prefixes (B.1, C.2, D.1). Changed \d+ to
   [A-Z\d]+ so all 214 figures are captured.
2. --scan-all mode picked up _shelved QMD files that aren't in the
   actual build, causing a count mismatch. Added _shelved to skip list.
2026-02-04 15:14:36 -05:00
Vijay Janapa Reddi
ac3c9ab2e5 Fix figure list regex to handle LaTeX braces and apostrophes
Three regex bugs caused missing/truncated captions in the figure list:
1. div_pattern broke on LaTeX {} (e.g., $W_{hh}$, \index{...}) — fixed
   with greedy .* anchored to end-of-line
2. Caption/alt regex [^"']+ truncated at apostrophes (e.g., Moore's) —
   fixed by matching double-quote delimiters only: "([^"]*)"
3. Duplicate figures when ::: div wraps a code block — added dedup logic

Fixes applied to both generate_figure_list.py and figure_list_for_press.py.
Regenerated FIGURE_LIST_VOL1.csv: 182 figures, 0 empty captions.
2026-02-04 15:03:17 -05:00
Vijay Janapa Reddi
c63e1429f2 figure listing 2026-02-04 07:25:56 -05:00
Vijay Janapa Reddi
1a36108b49 Consolidate figure list scripts into single file with --clear flag
- Merge clear_figure_cache.py into generate_figure_list.py
- Pre-render: generate_figure_list.py --clear
- Post-render: generate_figure_list.py
- Single file easier to maintain
2026-02-04 02:17:56 -05:00
Vijay Janapa Reddi
a702f879ae Add automatic figure list generation for MIT Press
- Add pre-render hook to clear stale LaTeX data between builds
- Add post-render hook to generate FIGURE_LIST.txt in output dir
- LaTeX captures figure numbers and pages during compilation
- Use deferred write for accurate page numbers (after float placement)
- Python merges with QMD captions and alt-text
- Output automatically appears in _build/pdf-vol1/ after each build
2026-02-04 02:13:16 -05:00
Vijay Janapa Reddi
05a184459d Refactors code to use constants and formulas
Replaces hardcoded numerical values with symbolic Python variables derived from defined constants and formulas.

This improves code maintainability and consistency, ensuring calculations are based on accurate and up-to-date physical values.
2026-02-03 19:48:11 -05:00
Vijay Janapa Reddi
3750ee12e9 Enforce Computed Arithmetic Rule across all chapters (1,064 inline refs, 0 unresolved)
Replace every hand-typed derived number with Python-computed inline
references. Add just-in-time compute cells before prose so that changing
any input constant automatically propagates to all derived values.

Vol 1 chapters fixed: dl_primer, dnn_architectures, serving,
model_compression, hw_acceleration, benchmarking, ops, appendix_machine,
appendix_data, frameworks, data_engineering, training, ml_systems,
responsible_engr, data_selection, workflow, introduction.

Vol 2 chapters fixed: distributed_training, inference, infrastructure,
storage, sustainable_ai, fault_tolerance, ops_scale, edge_intelligence,
ai_for_good, privacy_security.

Key corrections caught by forcing computation:
- training.qmd carbon footprint: 64 GPUs → 1024 GPUs (original was
  mathematically impossible for 7B params × 1T tokens)
- hw_acceleration.qmd systolic energy: 10 pJ/250× → 11 pJ/233× (exact)
- hw_acceleration.qmd GPT-2 utilization: 0.6% → 0.7% (exact)
- serving.qmd tokens/hour: ~190M → ~192M (exact)

Also adds calc/validate_inline_refs.py pre-render guardrail and
extends calc/viz.py with Harvard Crimson plotting palette.
2026-02-01 11:13:42 -05:00
Vijay Janapa Reddi
592edefb00 refactor: update chapter section ID mappings in build scripts
Update fix_cross_references.py and generate_glossary.py to reflect
the renamed chapter sections in Vol 1 (e.g., sec-ml-systems to
sec-ml-system-architecture, sec-dl-primer to
sec-deep-learning-systems-foundations).
2026-01-26 15:56:25 -05:00
Vijay Janapa Reddi
9781727d60 refactor: rename advanced_intro to introduction and update scripts
- Renamed vol2/advanced_intro to vol2/introduction for consistency
- Updated all scripts and configs to use vol1/ instead of core/
- Updated pre-commit config to check all contents/ not just vol1/
- Updated path references in Lua filters, Python scripts, and configs
2026-01-01 14:46:52 -05:00
Vijay Janapa Reddi
853eb03ee8 style: apply consistent whitespace and formatting across codebase 2025-12-13 14:05:34 -05:00
Vijay Janapa Reddi
7b92e11193 Repository Restructuring: Prepare for TinyTorch Integration (#1068)
* Restructure: Move book content to book/ subdirectory

- Move quarto/ → book/quarto/
- Move cli/ → book/cli/
- Move docker/ → book/docker/
- Move socratiQ/ → book/socratiQ/
- Move tools/ → book/tools/
- Move scripts/ → book/scripts/
- Move config/ → book/config/
- Move docs/ → book/docs/
- Move binder → book/binder

Git history fully preserved for all moved files.

Part of repository restructuring to support MLSysBook + TinyTorch.

Pre-commit hooks bypassed for this commit as paths need updating.

* Update pre-commit hooks for book/ subdirectory

- Update all quarto/ paths to book/quarto/
- Update all tools/ paths to book/tools/
- Update config/linting to book/config/linting
- Update project structure checks

Pre-commit hooks will now work with new directory structure.

* Update .gitignore for book/ subdirectory structure

- Update quarto/ paths to book/quarto/
- Update assets/ paths to book/quarto/assets/
- Maintain all existing ignore patterns

* Update GitHub workflows for book/ subdirectory

- Update all quarto/ paths to book/quarto/
- Update cli/ paths to book/cli/
- Update tools/ paths to book/tools/
- Update docker/ paths to book/docker/
- Update config/ paths to book/config/
- Maintain all workflow functionality

* Update CLI config to support book/ subdirectory

- Check for book/quarto/ path first
- Fall back to quarto/ for backward compatibility
- Maintain full CLI functionality

* Create new root and book READMEs for dual structure

- Add comprehensive root README explaining both projects
- Create book-specific README with quick start guide
- Document repository structure and navigation
- Prepare for TinyTorch integration
2025-12-05 14:04:21 -08:00