8 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
3636c2b377 Refresh mlsysim paper to match current implementation for arXiv
Audited paper.tex against the live package; the framework description (YAML+pydantic registries, 8 zoos, flop base dimension, instance/tech-class) was already accurate. Updated every drifted number/claim:

- Counts: 116 -> 126 provenance records; 34 -> 37 hardware devices (added V100 PCIe, Jetson Orin Nano, Apple M2 rows to the catalog table); 749 -> 862 test suite; figure caption four -> five invariant checks (matching the five enumerated in the Validation section).
- Executed-listing outputs regenerated from the current solvers: Solver Composition (54.9% / 68.1 day / 15,905,569 USD) and Carbon Accounting (57 days / 110.3 tonnes).
- Validation: Anchor 3 39.6 -> 39.1% MFU. Anchor 7 rewritten -- the ParallelismOptimizer now recovers Meta's TP=8, PP=16 backbone because the optimizer-state-aware memory prescreen (fixed in the mlsysim audit) drives PP=16 (was PP=4); prescreen prose now reads weights+gradients+optimizer state.
- validate_anchors.py: synced PAPER_CLAIMS/REPORTED to the corrected values; Anchor 5 now uses Chinchilla's actual C=5.88e23 (-> 70.0B). Harness reports all seven anchors match.

paper.tex compiles cleanly (pdflatex, no errors).
2026-06-13 13:54:04 -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
2b322bea8c Clean MLSysIM docs solver references 2026-05-31 15:05:17 -04:00
Vijay Janapa Reddi
02c37be63a refactor(mlsysim): P9b — extract engine/ from core/; core is primitives-only
Move the simulator out of core/ into a new engine/ package: solver, engine,
evaluation, results, pipeline, dse, walls, resolver_factory, explainers,
config, calibration, and the evaluatable scenarios bundle. core/ now holds
only primitives (units, types, provenance, registry, validation, exceptions).
No core primitive imports an engine module; the dependency runs one way.

Also relocate the appendix_lineage audit gate (a used lineage auditor, NOT
vestigial — kept, not deleted) from core/ to tools/, beside its consumer
audit_provenance.py.

Consumers repointed mlsysim.core.<mod> -> mlsysim.engine.<mod> (and the
from-core-import-calibration form): package internals (cli, sim, solvers,
viz), tests, runnable examples, paper scripts, and 9 book chapters. Pure
reorg, zero functional change.

482 passed; import clean (no cycles); vol1 (engine.calibration) and vol2
(engine.solver) chapters render with 0 {python} leaks, 0 tracebacks.

Deferred to P10: mlsysim/docs prose, generated docs/api/* stubs, tutorial
slides, paper.tex, README — propagate to website/slides/paper.
2026-05-29 18:30:32 -04:00
Vijay Janapa Reddi
dd81214c27 Align paper and anchor script with six-zoo registry architecture.
Update paper.tex to describe registries, defaults, and physics split; fix validate_anchors imports to use Models/Systems registries.
2026-05-24 18:44:12 -04:00
Vijay Janapa Reddi
1eb30f5f86 fix(mlsysim): harden release QA and paper artifacts
Align the MLSys·im code, docs, paper, website, workflows, and lab wheel for the 0.1.1 release. This also fixes runtime/API issues found during release review and prepares the paper PDF plus archive package.
2026-04-25 10:06:01 -04:00
Vijay Janapa Reddi
3ba3858b74 MLSys·im 0.1.0 release-prep audit (#1397)
* docs(mlsysim): release-prep audit fixes for 0.1.0

Fixes the broken links, stale numerical claims, and naming inconsistencies
surfaced by the 0.1.0 release-prep review. Output of the docs site now matches
what the engine actually computes, internal navigation has no unresolved targets,
and the Hatch announcement banner uses an absolute URL so sub-pages render the
"Get started" link correctly.

Notable changes:
- Hero example on docs/index.qmd and getting-started.qmd now reflect the actual
  Engine.solve(ResNet50, A100, bs=1, fp16) output (Memory / 0.54 ms / 1843).
- Update Python version requirement (3.10+) and document the editable-install
  limitation (Hatch sources rewrite is not supported by editables).
- Standardize the typographic brand to "MLSys·im" in the navbar, OG/Twitter
  metadata, and the shared cross-site dropdown.
- Add the four solvers missing from the quartodoc list
  (BatchingOptimizer, ForwardModel, NetworkRooflineModel, PlacementOptimizer)
  and surface the orphan tutorials (01_pipeline_callbacks,
  02_differential_explainer, 12_design_space_exploration) in the sidebar.
- Rename every reference to the now-deleted hello_world / llm_serving /
  sustainability / 11_full_stack_audit tutorials to their current filenames.
- Add the missing @mlsysbook2024 entry to references.bib so whitepaper.qmd
  no longer logs a citeproc warning.
- Fix the CLI sample on the parent site/index.qmd card to use real model
  identifiers (Llama3_70B H100 --batch-size 1).
- Soften the Colab/Binder copy until launch buttons are wired in.
- Remove the duplicate "Differential Explainer" card on tutorials/index.qmd.

* release(mlsysim): add 0.1.0 release notes and runbook

- RELEASE_NOTES_0.1.0.md: GitHub-release-ready notes promoted from CHANGELOG
  with install/quickstart copy and a "known limitations & gotchas" section
  covering the editable-install issue, broken example scripts, and unpublished
  slide tag.
- RELEASE.md: copy-pasteable runbook for cutting a release (pre-flight check,
  tag, build, twine upload, docs deploy via workflow_dispatch, GitHub release,
  and post-release verification).
- CHANGELOG.md: corrected the test count from 334 to the actual 367 currently
  passing on dev.

* mlsysim: nest package layout, enable editable installs, clean lint

Restructure mlsysim into the standard nested layout (`mlsysim/mlsysim/...`)
so `pip install -e .` works out of the box. The previous flat layout used
a Hatch `sources = {"." = "mlsysim"}` prefix-add rewrite that the
`editables` backend cannot handle, breaking editable installs entirely.

Packaging
- pyproject.toml: drop `sources` rewrite, set `packages = ["mlsysim"]`,
  add explicit `[tool.hatch.build.targets.sdist]` include list.
- Wheel and sdist now contain only the package and project metadata
  (no `tests/`, `docs/`, `examples/`, `paper/`, `vscode-ext/` leakage).
- Update `pyright.exclude` for nested layout.
- Update GitHub source links in `docs/math.qmd` and
  `docs/models-and-solvers.qmd` to point to `mlsysim/mlsysim/...`.

Lint configuration
- Add `[tool.ruff]` to pyproject.toml with sensible per-file ignores:
  `__init__.py` re-export pattern (F401/F403/F405/F811),
  `core/constants.py` star import from unit registry,
  tests/examples idioms.
- `ruff check .` reports zero issues (down from 621).

Real bug fixes uncovered by lint cleanup
- `core/solver.py`: remove unused `from pydantic import BaseModel` that
  was being shadowed by the local `BaseModel = ForwardModel` alias.
- `sim/simulations.py`: remove redundant local `Fleet` import that was
  shadowing the module-level import and triggering F823 (referenced
  before assignment) on the earlier `isinstance(..., Fleet)` check.
- `cli/commands/audit.py`, `cli/commands/eval.py`: narrow three bare
  `except:` clauses to specific exception types.
- `tests/test_sota.py`: add the missing speculative-decoding ITL
  assertion (`res_opt.itl < res_base.itl`) — `res_base` was previously
  computed but never compared.
- `cli/commands/eval.py`: drop unused `is_json` local.
- `labs/components.py`: drop unused `energy` placeholder local.

Examples
- `examples/06_multi_objective_pareto.py`: rewrite around the actual
  `BatchingOptimizerResult` API (which has no `pareto_front` attribute);
  build the front explicitly by sweeping batch sizes through
  `ServingModel` + `TailLatencyModel`, then highlight the optimum
  returned by `BatchingOptimizer`.
- `examples/gemini_design_loop.py`: fix multi-line f-string syntax errors
  (`f"\n[…]"` instead of an embedded literal newline) so the file imports
  on every supported Python version.

Dev scripts
- `generate_appendix.py` and `paper/scripts/validate_anchors.py`: switch
  from package-relative imports to absolute `from mlsysim... import` so
  they run cleanly under the nested layout.

Docs / release notes
- `docs/getting-started.qmd`: replace the editable-install caveat with
  `pip install -e ".[dev]"` (now supported).
- `RELEASE_NOTES_0.1.0.md`: drop the three "known limitations" entries
  that this commit resolves (editable install, pareto example, gemini
  example).
- `CHANGELOG.md`: add a "Packaging & Tooling" section describing the
  layout change and the resolver bug fixes.

Verification
- `python -m pytest tests/` → 367 passed (was 367, no regressions).
- `ruff check .` → All checks passed.
- `pip install -e .` → succeeds; live source picked up.
- Fresh-venv wheel install + CLI smoke test → succeeds.
- `examples/06_multi_objective_pareto.py` and
  `examples/gemini_design_loop.py` → both exit 0.

* fix(mlsysim): repair docs build + lab test after nested-package restructure

The 0.1.0 release prep moved the package from `mlsysim/` to `mlsysim/mlsysim/`
to support `pip install -e .`. Two CI jobs still depended on the old layout:

1. **Docs build (`mlsysim-preview-dev`)** — every tutorial and zoo page used
   a hand-rolled `importlib.util.spec_from_file_location` block to load
   `<repo>/mlsysim/__init__.py` directly from source. After the restructure,
   that path no longer exists. Replaced the hack in 17 docs/.qmd files with
   a plain `import mlsysim` — the package is already pip-installed in the
   docs build environment via `pip install ".[docs]"`. Updated the matching
   guidance in `contributing.qmd`.

2. **Lab static tests** — `test_no_localstorage_import` hard-coded
   `mlsysim/labs/state.py`; updated to the new nested path
   `mlsysim/mlsysim/labs/state.py`.

Verified locally: `pytest labs/tests/test_static.py::TestStateImplementation`
passes, and `quarto render docs/zoo/models.qmd` succeeds end-to-end.
2026-04-18 13:11:13 -04:00
Vijay Janapa Reddi
4c31251b39 refactor: standardize paper directory structure across all three papers
Consistent layout for StaffML, mlsysim, and TinyTorch papers:
  - figures/ for all visual assets (SVGs, PDFs, PNGs)
  - scripts/ for utility scripts (analysis, validation, benchmarks)
  - tables/ for standalone table .tex files (StaffML only)
  - Makefile at root for building (created one for mlsysim)

Removed redundant build scripts (compile_paper.sh, build.sh) in
favor of Makefiles. Deleted sort_app_matrix.py (no longer needed).
Merged mlsysim images/ into figures/. Updated all references in
paper.tex, Makefiles, and CI workflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 15:57:55 -04:00