mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-18 17:03:56 -05:00
Introduce 13 LaTeX-typeset algorithm blocks across 8 chapters (Adam update,
gradient checkpointing, FlashAttention, backpropagation, mini-batch SGD,
reverse-mode AD, PTQ calibration, tiled GEMM, ring all-reduce, 1F1B pipeline,
continuous-batching scheduler, speculative decoding, power-of-two routing),
each integrated into existing prose with a motivating lead-in and a
systems-consequence follow-up.
Extension (book/quarto/_extensions/mlsysbook-ext/pseudocode):
- Vendored under the owned mlsysbook-ext/ namespace (moved from leovan/,
version -mlsysbook-custom) and wired into the html, pdf, and epub filters.
- MIT Press cross-ref casing: @algo- -> 'algorithm N' mid-sentence,
@Algo- -> 'Algorithm N' at sentence start.
- Right-aligned italic triangle comments (CLRS column convention).
- Static EPUB renderer (upstream supports only HTML via pseudocode.js and PDF
via algpseudocodex; EPUB previously emitted raw \begin{algorithm}).
- Uses the algo- prefix: native @alg- collides with Quarto's algorithm theorem
environment and FATALs the build.
Ref tooling (book/cli/commands): teach validate.py, bib.py, and info.py the
algo-/Algo- crossref prefix (LABEL_REF_PATTERN, EXCLUDED_CITATION_PREFIXES,
Algorithm label-def patterns, and a chunk-option label harvest that runs inside
the pseudocode fence) so check refs and check labels resolve @algo-/@Algo-
instead of misreading them as missing citations.
Verified rendering in HTML, PDF, and EPUB; check refs and check labels pass
book-wide.
1.7 KiB
1.7 KiB
MLSysBook Extensions
This directory contains Quarto extensions used by the MLSysBook project.
⚠️ CRITICAL WARNING - READ BEFORE MAKING CHANGES
Some extensions in this directory are HEAVILY CUSTOMIZED and should NEVER be reinstalled using quarto add.
🔍 Quick Safety Check
Before installing or updating any extension, ALWAYS check for:
.CUSTOM_LOCKfiles in extension directories- Version numbers ending in
-mlsysbook-custom - Warnings in extension
_extension.ymlfiles
📋 Extension Inventory
| Extension | Status | Safe to Update? |
|---|---|---|
| `margin-video` | 🚫 **100% Custom** | Never (MLSysBook only) |
| `mlsysbook-ext/pseudocode` | 🚫 **Customized** (casing, ▷ comments, EPUB) | Never |
| `ute/custom-numbered-blocks` | 🚫 **Heavy Customization** | Never |
| `nmfs-opensci/titlepage` | 🚫 **Customized** | Never |
| `pandoc-ext/diagram` | ✅ Standard | Yes |
| `quarto-ext/lightbox` | ✅ Standard | Yes |
🚨 Emergency Recovery
If you accidentally overwrote a custom extension:
# Check what changed
git status
# Restore from git if needed
git checkout HEAD -- book/_extensions/EXTENSION_NAME/
# Run protection check
python tools/scripts/check_custom_extensions.py
📚 Full Documentation
For complete details, see: CUSTOM_EXTENSIONS.md
When in doubt, DON'T reinstall - ask the team first!