Commit Graph

10382 Commits

Author SHA1 Message Date
kai
0cfebb6f42 index.html comm site with arxiv 2026-02-04 22:23:11 -05:00
Vijay Janapa Reddi
20b54a774e chore: update volume configs and frontmatter assets
Remove legacy _quarto.yml and figure index, adjust volume config files,
refresh acknowledgements/references, and add theme and epub assets.
2026-02-04 17:42:17 -05:00
Vijay Janapa Reddi
0fba57e1b0 docs: annotate egress pricing baseline
Document AWS 2024 egress pricing as the baseline and note it in the data gravity callout.
2026-02-04 17:41:07 -05:00
Vijay Janapa Reddi
354bbeee31 refactor: standardize vol1 constants and conversions
Route canonical time, precision, pricing, and reference values through physx.
Update vol1 QMDs to use shared constants and conversion factors.
2026-02-04 17:32:43 -05:00
Vijay Janapa Reddi
563061a0aa refactor: centralize canonical constants in physx
Move energy, network, AlexNet, and carbon baselines into physx constants.
Wire vol1 QMDs to consume those constants for consistent formatting.
2026-02-04 17:21:11 -05:00
Vijay Janapa Reddi
19fb2fba78 fix: use accelerator-first terminology in purpose sections
Purpose sections are abstract by design—they teach principles,
not specific hardware. Replace GPU/TPU references with
"accelerators" in the three Vol 1 purpose sections that
named specific hardware (serving, hw_acceleration, dl_primer).
2026-02-04 17:20:10 -05:00
Vijay Janapa Reddi
47bd285d29 fix: clarify carbon conversion and derive low-util energy
Make the CO2 conversion formula explicit about the hour term.
Compute low-utilization joules/token from idle power and throughput.
2026-02-04 16:38:22 -05:00
Vijay Janapa Reddi
668cc25030 refactor: inline QMD plots and slim viz helpers
Move remaining plot logic into QMD blocks and keep physx/viz styling-only.
Update preview scripts to use local plot code.
2026-02-04 16:34:31 -05:00
Vijay Janapa Reddi
ab9d9b49a5 feat: Add volume-specific theming system
- Vol1: Harvard Crimson (#A51C30)
- Vol2: ETH Zurich Blue (#1F407A)

Architecture:
- themes/_theme-harvard.scss, _theme-eth.scss: Color variables
- _base-styles.scss, _dark-mode-base.scss: Shared styles using $accent
- style-vol1/2.scss, dark-mode-vol1/2.scss: Entry points per volume

Each volume now has its own distinct visual identity while sharing
the same underlying style rules.
2026-02-04 15:48:52 -05:00
Vijay Janapa Reddi
e236277925 Move shelved AutoML section from vol1 to vol2 optimization
AutoML content is better suited for Volume II's optimization chapter
(distributed-scale model search). Moved from vol1/optimizations/ to
vol2/optimization/ to keep it accessible for future integration.
2026-02-04 15:16:47 -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.
mit-submission-v1
2026-02-04 15:03:17 -05:00
Vijay Janapa Reddi
118df45d41 ci: trigger validation workflow after bibtex tidy fix 2026-02-04 11:59:29 -05:00
github-actions[bot]
1c0fac8aae Update contributors list [skip ci] 2026-02-04 16:42:46 +00:00
Vijay Janapa Reddi
ddca8652ce fix(contributors): merge duplicate Andrea entries in TinyTorch
AndreaMattiaGaravagn (truncated) and AndreaMattiaGaravagno were listed
as separate contributors. Merged into a single entry with the correct
username, avatar, and combined contributions (code + doc).
2026-02-04 11:29:34 -05:00
Vijay Janapa Reddi
299fcc14e1 style(paper): tidy references.bib for pre-commit compliance
Fix line wrapping and add trailing newline to pass bibtex-tidy
pre-commit hook.
2026-02-04 10:44:02 -05:00
github-actions[bot]
ee0c1a75f3 Update contributors list [skip ci] 2026-02-04 15:35:29 +00:00
Vijay Janapa Reddi
d01b1acd4b Merge feature/tinytorch-core: fix Jupyter kernel mismatch (#1147) 2026-02-04 10:28:52 -05:00
Vijay Janapa Reddi
25fc9e4848 fix(tito): resolve Jupyter kernel mismatch causing ModuleNotFoundError (#1147)
Students hit "No module named 'tinytorch.core.tensor'" in notebooks because
the Jupyter kernel used a different Python than where tinytorch was installed.

- setup: install ipykernel + nbdev, register named kernel during tito setup
- health: add Notebook Readiness checks (import, kernel, Python match)
- export: verify exported file exists and has content (fail loudly)
- Windows: add get_venv_bin_dir() helper for cross-platform venv paths
2026-02-04 10:24:37 -05:00
Vijay Janapa Reddi
3a2b1bf482 fix(ci): use head_ref for PR branch in fresh install test
On PR events, github.ref_name resolves to the merge ref (e.g.
"1159/merge") which doesn't exist on raw.githubusercontent.com,
causing a 404. Use github.head_ref (the actual source branch)
for PRs, falling back to ref_name for push events.

Also adds -f flag to curl so HTTP errors fail immediately with
a clear message instead of silently saving the 404 HTML page.
2026-02-04 10:06:25 -05:00
Vijay Janapa Reddi
24ab7599c6 fix(paper): escape special LaTeX characters breaking PDF build
Escape unescaped & characters in references.bib (Taylor & Francis,
AI & Machine-Learning) and replace Unicode em-dashes (U+2014) with
LaTeX --- ligatures in paper.tex for T1 font compatibility.
2026-02-04 10:05:32 -05:00
Vijay Janapa Reddi
0be9325fbe fix(workflow): deterministic project detection in all-contributors
LLM now only parses username + contribution types (strict 2-field JSON).
Project detection is fully deterministic from file paths:
  tinytorch/ → tinytorch, book/ → book, kits/ → kits, labs/ → labs

If project cannot be determined, the bot asks the user instead of
silently defaulting to book. Also removes @AndreaMattiaGaravagno
from book/.all-contributorsrc (was incorrectly added there by the
old workflow — their PR only touched tinytorch/ files).
2026-02-04 10:03:20 -05:00
Vijay Janapa Reddi
d2c875c919 fix(ci): handle branch names with slashes in fresh install test
fix(ci): handle branch names with slashes in fresh install test
2026-02-04 09:00:38 -05:00
Vijay Janapa Reddi
19093cec1b fix(ci): use pipe delimiter in sed to handle branch names with slashes
The fresh install test script used / as the sed delimiter when
substituting the branch name, which breaks on any branch containing /
(e.g. feature/foo, fix/bar, or GitHub merge refs like 1156/merge).
2026-02-04 09:00:20 -05:00
Vijay Janapa Reddi
0ae32c9f6a Merge feature/tinytorch-core: expand GELU docs with both approximation forms
docs(activations): expand GELU explanation with both approximation forms
2026-02-04 08:49:59 -05:00
Vijay Janapa Reddi
4fb5173503 docs(activations): expand GELU explanation with both approximation forms
Show the exact definition, tanh approximation, and sigmoid approximation
side by side so students understand where 1.702 comes from and why we
chose the sigmoid form. Avoids erf notation in favor of plain-language
description of Φ(x) appropriate for Module 2 students.

Related to harvard-edge/cs249r_book#1154
2026-02-04 08:49:41 -05:00
Vijay Janapa Reddi
1d8d76bd95 Merge feature/tinytorch-core: fix GELU hint about 1.702 constant (fixes #1154)
fix(activations): correct GELU hint about 1.702 constant
2026-02-04 08:43:17 -05:00
Vijay Janapa Reddi
c3a9230ea8 fix(activations): correct misleading GELU hint about 1.702 constant
The hint claimed 1.702 comes from √(2/π) ≈ 0.798, which is incorrect.
The 1.702 constant is empirically fitted so that sigmoid(1.702x) ≈ Φ(x),
the Gaussian CDF. The √(2/π) constant appears in the separate tanh-based
GELU approximation, not the sigmoid approximation used here.

Fixes harvard-edge/cs249r_book#1154
2026-02-04 08:42:58 -05:00
Vijay Janapa Reddi
85ed754354 Merge feature/tinytorch-core: fix attention complexity and memory table (fixes #1150)
fix(attention): correct complexity explanation and memory table bug
2026-02-04 08:37:57 -05:00
Vijay Janapa Reddi
20a4ba2379 fix(attention): correct O(n²) complexity explanation and memory table bug
- Clarify that attention time complexity is O(n²×d), not O(n²), since each
  of the n² query-key pairs requires a d-dimensional dot product
- Fix Total Memory column in analyze_attention_memory_overhead() which was
  duplicating the Optimizer column instead of summing all components
- Update KEY INSIGHT multiplier from 4x to 7x to match corrected total

Fixes harvard-edge/cs249r_book#1150
2026-02-04 08:37:32 -05:00
Vijay Janapa Reddi
f0edc97e0d remove vol 1 title 2026-02-04 08:19:32 -05:00
Vijay Janapa Reddi
8fb27cc973 mit release (after fig alt issue fix) 2026-02-04 08:14:34 -05:00
Vijay Janapa Reddi
c63e1429f2 figure listing 2026-02-04 07:25:56 -05:00
Vijay Janapa Reddi
765896b90d fix principle references 2026-02-04 07:25:42 -05:00
Vijay Janapa Reddi
ace5f2f673 Fix malformed equation in serving.qmd
Convert plain text equation to proper LaTeX math block with label
for @eq-precision-throughput cross-reference to work.
2026-02-04 02:32:52 -05:00
Vijay Janapa Reddi
7f0e31bfb4 Fix fenced div and footnote warnings
- Fix malformed div in networking.qmd: :::.column-margin -> ::: {.column-margin}
- Add missing footnote reference [^fn-box-model] in introduction.qmd
2026-02-04 02:25:22 -05:00
Vijay Janapa Reddi
9d0eb24fa3 Enable all chapters in PDF vol1 config for full book builds
Uncomment all frontmatter, chapters, and appendices so future
builds include the complete book with all figure numbers.
2026-02-04 02:21:19 -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
6c5ffae4cb stale 2026-02-04 01:23:41 -05:00
Vijay Janapa Reddi
9e857f318d fixes 2026-02-04 01:18:33 -05:00
Vijay Janapa Reddi
d29965a0c3 Fix: move #| directives before imports in all code blocks
Quarto requires #| directives to be at the start of code blocks.
Fixed 93+ code blocks across 15 files where imports came before
the echo: false directive, causing code to be visible in PDFs.
2026-02-04 00:36:33 -05:00
Vijay Janapa Reddi
8094efe659 Simplify plotting code: project-wide PYTHONPATH + viz returns plt
- Added PYTHONPATH='.' to quarto execute config
- Modified viz.setup_plot() to return (fig, ax, COLORS, plt)
- Cleaned up all plotting cells to use simple imports
- No more sys.path manipulation needed in individual cells
2026-02-04 00:30:16 -05:00
Vijay Janapa Reddi
0ef4842d91 Fix: use '.' for sys.path to import physx module
sys.path.insert(0, '.') adds the project root to Python's module search
path, allowing 'from physx import viz' to find the physx package.
2026-02-04 00:26:27 -05:00
Vijay Janapa Reddi
e1f623c212 Fix: use simple 'physx' path for sys.path.insert
Since quarto config has execute-dir: project, the working directory
during rendering is book/quarto/, so 'physx' path is correct.
2026-02-04 00:25:39 -05:00
Vijay Janapa Reddi
e971272c2d Fix: list formatting issue in data_engineering.qmd 2026-02-04 00:21:10 -05:00
Vijay Janapa Reddi
39c67fcd5d Auto-fix: additional formatting from pre-commit 2026-02-04 00:20:19 -05:00
Vijay Janapa Reddi
5356c07e41 Auto-fix: formatting cleanup from pre-commit hooks
- Trailing whitespace removed
- Python code blocks formatted with Black
- List spacing and blank lines normalized
2026-02-04 00:19:57 -05:00
Vijay Janapa Reddi
5ed99c9b99 Inline remaining viz.py plotting code into QMD files
Completes the refactoring of viz.plot_*() calls into inline plotting
code. All plots now use viz.setup_plot() for consistent styling while
keeping data and plotting logic visible in each QMD file.

Files updated:
- serving.qmd (4 plots: tail_latency, intelligence_deflation,
  throughput_latency_knee, kv_cache_growth)
- benchmarking.qmd (2 plots: power_differentials, imagenet_challenge)
- responsible_engr.qmd (1 plot: fairness_frontier)
- training.qmd (3 plots: communication_tax, training_roofline,
  linear_scaling_failure)
- ops.qmd (2 plots: rotting_asset_curve, business_cost)
2026-02-04 00:15:39 -05:00
Vijay Janapa Reddi
36cc9cbadc Inline viz.py plotting code into QMD files (partial)
Replaces viz.plot_*() calls with actual plotting code while keeping
viz.setup_plot() for consistent styling. Pattern: data and plotting
logic is now visible in QMD, style comes from viz module.

Files updated:
- data_engineering.qmd (2 plots)
- dnn_architectures.qmd (2 plots)
- data_selection.qmd (3 plots)
- frameworks.qmd (2 plots)
- model_compression.qmd (1 plot)
- hw_acceleration.qmd (4 plots)
- dl_primer.qmd (1 plot)
2026-02-04 00:11:55 -05:00