95 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
75c25583ee fix(vol1): correct camera-ready technical content 2026-07-15 06:37:14 +02:00
Vijay Janapa Reddi
70a6ec5f84 feat(binder): add markdown list-spacing check for bold lead-ins
A bold lead-in paragraph (e.g. **Step 2**: ...) immediately followed by a
list item with no blank line between them is parsed by Pandoc as one
paragraph, so the list marker can render inline. Add a markup check
(check markup --scope list-spacing) that flags this, extend the
format lists fixer to insert the blank line for bold lead-ins (not just
colon-terminated lead-ins), and cover both with tests.
2026-06-28 21:54:40 -04:00
Vijay Janapa Reddi
ce49f17928 fix: clean volume links after URL flattening 2026-06-22 22:08:40 -04:00
Vijay Janapa Reddi
e3e16d3514 Handle version names in spurious zero audit 2026-06-21 14:27:52 -04:00
Vijay Janapa Reddi
d02c5e8aaf Fix margin offset handling in PDF output 2026-06-20 12:32:52 -04:00
Vijay Janapa Reddi
d539b78da5 test(binder): fix footnote cross-chapter false positives 2026-06-19 09:39:46 -04:00
Vijay Janapa Reddi
5e95ebb9aa Enforce bottom pipe table captions 2026-06-18 06:57:53 -04:00
Vijay Janapa Reddi
d7c8a82a77 Merge branch 'dev' into chore/betterbib-june
# Conflicts:
#	book/quarto/contents/vol1/benchmarking/benchmarking.qmd
#	book/quarto/contents/vol1/conclusion/conclusion.qmd
#	book/quarto/contents/vol1/data_engineering/data_engineering.qmd
#	book/quarto/contents/vol1/introduction/introduction.qmd
#	book/quarto/contents/vol1/model_serving/model_serving.qmd
#	book/quarto/contents/vol1/nn_architectures/nn_architectures.qmd
#	book/quarto/contents/vol2/collective_communication/collective_communication.qmd
#	book/quarto/contents/vol2/network_fabrics/network_fabrics.qmd
#	book/quarto/contents/vol2/sustainable_ai/sustainable_ai.qmd
2026-06-14 19:52:18 -04:00
Vijay Janapa Reddi
45aeb6b026 Audit citations and consolidate bibliography 2026-06-14 19:41:26 -04:00
Vijay Janapa Reddi
9f9c0d889b Fix inline Python math validation 2026-06-13 14:00:34 -04:00
Vijay Janapa Reddi
83f816f38e Harden percent formatter prose contract 2026-06-13 13:50:38 -04:00
Vijay Janapa Reddi
69794c0aa5 Merge branch 'fix/audit-integration' into dev 2026-06-12 06:34:33 -04:00
Vijay Janapa Reddi
efab848914 layout: add two-phase auto layout planner 2026-06-11 20:55:44 -04:00
Vijay Janapa Reddi
9969659b0e Remove stale MLSysIM reference aliases 2026-06-11 20:09:00 -04:00
Vijay Janapa Reddi
47f0c9744f Fix vol1 indexed prose audit precision 2026-06-11 17:43:09 -04:00
Vijay Janapa Reddi
92f9165d03 fix(book): harden LEGO formatting across volumes
Add native Binder checks for LEGO formatting/unit/prose contracts, extend mlsysim formatter helpers, and normalize Vol1/Vol2 LEGO output strings through typed formatters.

Validate precision-sensitive prose rendering across both volumes and promote direct math/string assembly to fmt_math, fmt_display_math, fmt_text, and domain-specific helpers.
2026-06-11 14:36:35 -04:00
Vijay Janapa Reddi
b18103d3ac Harden closed-export prose-unit checker and fix duplicate g/kWh.
Expand lego-prose-units for FLOP/byte and carbon-intensity glyphs, add regression tests and an explicit audit report, and strip redundant g/kWh after fmt_carbon_intensity refs in sustainable_ai.
2026-06-06 14:09:24 -04:00
Vijay Janapa Reddi
967d0c5f5a Give compute work its own pint dimension
flop (and the OPS/TOPS integer-op family, which shares compute-rate
fields with TFLOP/s) now lives on a dedicated [flop] base dimension
instead of being a dimensionless count alias. Compute throughput can
no longer silently add to or convert into memory bandwidth — the
category error pint previously accepted ('989 TFLOP/s + 3.35 TB/s')
now raises DimensionalityError at the expression. Bytes, counts,
params, and dollars stay dimensionless so params x bytes/param and
similar compositions are unchanged; arithmetic intensity carries
[flop] and divides cleanly; MFU reduces to a dimensionless fraction.

- Seven schema validators updated to the honest families (peak_flops,
  precision_flops, inference_flops, total_ops, training_ops,
  compute_threshold -> flop-rate/flop; arithmetic_intensity ->
  flop/byte)
- tech/op.yaml normalized: per-op energies were inconsistently 'pJ',
  'pJ/flop', and 'pJ/count' (identical under the old aliasing, three
  different dimensions now); all are pJ/flop, so N flop x pJ/flop
  composes to energy directly; Op.energy validator matches
- book/tests/test_units.py: 6PD training ops now via the canonical
  calc_transformer_training_flops (a bare params x tokens product is a
  count, not work); INT8 energy read in pJ/flop

Verification: 749 mlsysim tests + 20 book unit tests pass; whole-book
lego_focal_verify identical to baseline (zero cell fallout — the May
unit-hardening had already put cells on .to(unit).magnitude
discipline); registry gate green; examples + paper anchors pass.
2026-06-06 13:27:52 -04:00
Vijay Janapa Reddi
6aed5b4e1e Migrate the last core.constants stragglers (examples, paper validator)
Five references outside the gate scopes: the two runnable examples,
the paper's anchor validator, book/tests/test_registry.py, and a
LEGO_CELLS.md prose mention. All verified executable post-migration
(examples 03/04 run; validate_anchors: all 7 anchors match).
2026-06-06 11:36:23 -04:00
Vijay Janapa Reddi
9c3dce60dc Delete the core/constants.py compat shim; migrate the whole corpus
No-backward-compat sweep, part 2. The module had been reduced to a
units-only re-export ('retired, do not add values'); per policy it is
now gone and every consumer reads the real home:

- 32 internal modules, the package __init__, and core/__init__ import
  core.units (physics modules keep their own physics/constants)
- 43 book chapters' LEGO cells migrated (star imports, named imports,
  and the appendix attribute style 'constants.VIDEO_*' -> units.*);
  lego_focal_verify confirms identical pass/flag state to pre-sweep
  (8 pre-existing structural flags, A/B-verified unchanged)
- tutorial/tools/test imports migrated (incl. binder test_units.py);
  book tests' legacy-symbol scanner treats a missing constants.py as
  'nothing defined'
- test_constants_allowlist.py rewritten as a deletion pin: the module
  (and any shim for it) must never return; core.units must keep the
  measurement surface (ureg, Q_, GB, BYTES_FP16, PRECISION_MAP, ...)
- test_mlsysim_registry_parity.py deleted: it compared registry values
  against legacy constants 'before deletion' — that migration is
  complete (registry gate list updated)
- Docs prose (DATA_MODEL, architecture, contributing) states the
  deletion instead of describing a retired shim

749 passed; binder registry gate green; star import intact.
2026-06-06 11:34:47 -04:00
Vijay Janapa Reddi
46aab52b38 Fix broken docs links and stale LEGO header comments
- math.qmd: three GitHub links had a tripled mlsysim/ path segment
- models-and-solvers.qmd: DSE link pointed at deleted core/dse.py
  (now engine/dse.py)
- data_engineering/benchmarking LEGO headers still cited retired
  core.constants names (NETWORK_100G_BW, GPT3_TRAINING_TOKENS,
  GPT3_TRAINING_ENERGY_MWH); comments now name the actual registry
  sources the cells read
- book/tests/test_units.py: fmt_unit FLOP-count expectation updated to
  the shared-label singular form ('GFLOP'), matching the fmt dedup
2026-06-06 09:24:19 -04:00
Vijay Janapa Reddi
245426f104 Align cross-reference casing after colons 2026-06-05 16:03:20 -04:00
Vijay Janapa Reddi
05215e74b8 Enforce algorithm reference rendering 2026-06-04 15:44:10 -04:00
Vijay Janapa Reddi
ebb14bcf16 Merge dev into narrative audit branch 2026-06-03 15:26:58 -04:00
Vijay Janapa Reddi
307f5a7322 Source Oura case figures from MLSysIM 2026-06-03 14:30:39 -04:00
Vijay Janapa Reddi
bb971aab05 Enforce footnote term head capitalization 2026-06-03 13:40:01 -04:00
Vijay Janapa Reddi
2645676f64 Add Binder table layout audit 2026-06-03 09:32:43 -04:00
Vijay Janapa Reddi
39ee6ce9fd Merge branch 'dev' into codex/auto-layout
# Conflicts:
#	book/quarto/contents/vol1/frameworks/frameworks.qmd
#	book/quarto/contents/vol1/nn_computation/nn_computation.qmd
#	book/quarto/contents/vol2/compute_infrastructure/compute_infrastructure.qmd
#	book/quarto/contents/vol2/responsible_ai/responsible_ai.qmd
2026-06-03 03:32:37 -04:00
Vijay Janapa Reddi
6dd3c04ebc Apply Design B multiplier formatting 2026-06-02 22:17:41 -04:00
Vijay Janapa Reddi
26e96f5b21 Improve PDF margin layout diagnostics 2026-06-02 21:22:22 -04:00
Vijay Janapa Reddi
41348ef0fe Normalize fmt output conventions 2026-06-02 21:14:54 -04:00
Vijay Janapa Reddi
d2974139f2 Pilot chapter layout collision repair 2026-06-02 11:10:24 -04:00
Vijay Janapa Reddi
96a73aab60 Enhance binder layout margin diagnostics 2026-06-02 08:16:08 -04:00
Vijay Janapa Reddi
bf733c5781 Merge dev into fmt-fix 2026-06-01 22:34:40 -04:00
Vijay Janapa Reddi
a0b719c1d4 Harden LEGO unit audit gates 2026-06-01 07:08:06 -04:00
Vijay Janapa Reddi
6a771e6e4f Clean MLSysIM registry boundaries 2026-05-31 13:54:25 -04:00
Vijay Janapa Reddi
8192657159 Migrate direct quantity unit suffixes 2026-05-31 13:22:24 -04:00
Vijay Janapa Reddi
e7fea49e8a Migrate word-form time suffixes 2026-05-31 11:50:21 -04:00
Vijay Janapa Reddi
965a328981 Migrate exact scale-word suffixes 2026-05-31 11:36:11 -04:00
Vijay Janapa Reddi
c33f10c4b8 Migrate service rate suffixes 2026-05-31 11:19:08 -04:00
Vijay Janapa Reddi
e270c36044 Migrate clean quantity-backed unit suffixes 2026-05-31 11:14:50 -04:00
Vijay Janapa Reddi
ab3ae0086b Complete time unit suffix migration 2026-05-31 11:10:42 -04:00
Vijay Janapa Reddi
0e80229516 Catch pp suffixes in semantic formatter audit 2026-05-31 10:27:47 -04:00
Vijay Janapa Reddi
4d34957a66 Migrate USD scale and range suffixes 2026-05-31 09:30:20 -04:00
Vijay Janapa Reddi
abcd39e3c2 Migrate distributed training units to fmt_qty 2026-05-31 08:13:28 -04:00
Vijay Janapa Reddi
ab1fffca1f Resolve scale count spacing with fmt_count 2026-05-31 07:29:10 -04:00
Vijay Janapa Reddi
b216587485 Add byte-identical unit fmt lane 2026-05-31 07:04:50 -04:00
Vijay Janapa Reddi
e58fcdf0f2 fmt: add numeric-aware semantic checks + regression tests for scanner
Extend audit_prose_semantics.py with checks that need the substituted value:
- mult_direction: a sub-unit multiple asserted to go UP ("0.5x faster",
  "0.3 times larger") is self-contradictory.
- currency_as_percent: a "$N percent" value-kind mismatch.

Add book/tests/test_audit_prose_semantics.py (7 cases) pinning every pattern to
fire on known-bad rendered prose and stay quiet on legitimate sentences
(including display-math lines that carry an inline ref). Corpus clean.
2026-05-30 22:04:45 -04:00
Vijay Janapa Reddi
bc3729c676 fmt: class-aware prose contract; fix real "26 percent percentage points" bug
Make fmt_prose_contract key its formatter map by QUALIFIED name (Class.attr)
with an ambiguity-safe lookup, fixing two usd_dup false positives where two
classes export the same bare attr with different formatters (one fmt no-$, one
fmt_usd with-$) — a qualified prose ref must use its own class's glyph rule.

With the checker now trustworthy, it caught a genuine pre-existing bug in
robust_ai: acc_drop (76-50 = 26 percentage POINTS) was formatted as a percent
("26 percent") while the prose appends "percentage points" -> "26 percent
percentage points". Fixed to a bare number (prose supplies the unit), matching
the sibling RobustnessTaxRecap.acc_drop_str. Corpus contract now fully clean.
2026-05-30 21:54:04 -04:00
Vijay Janapa Reddi
203851e5f8 fmt(WS1): scale division -> fmt_count across 10 chapters (byte-identical)
fmt(x / MILLION, suffix='M') -> fmt_count(x, scale='M', precision=...): strip
the division and declare the scale once (fmt_count divides by the same factor
and guards counts >= 0). Only the clean case migrates — the divisor magnitude
must match the glyph, so output is unchanged; 41 sites across 10 chapters pass
the byte-identical gate.

Generalize run_percent_lane's gate into a reusable lane_process(scan_fn,
fn_name, dup_codes) + _ensure_import(fn_name); run_scale_lane reuses it. The
pre-scaled / lowercase-'k' / spaced-glyph / fmt_int sites are queued for a
source-level decision (keep the raw count) rather than re-multiplied.
2026-05-30 21:48:33 -04:00