mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-09 07:15:51 -05:00
- Elevate 5-Layer Progressive Lowering mental model to architecture.qmd - Clean up landing page copy to be a punchy one-liner - Re-render architecture composition diagram as SVG for reliability - Move math derivations out of tutorials and into math.qmd with citations - Add DGX Spark to Silicon Zoo
97 lines
4.4 KiB
Plaintext
97 lines
4.4 KiB
Plaintext
---
|
|
title: "For Instructors"
|
|
subtitle: "Reproducible, hardware-independent exercises for ML systems courses."
|
|
---
|
|
MLSYSIM provides a framework for assigning analytically grounded problem sets where every answer is deterministic and reproducible — regardless of what hardware your students have access to.
|
|
|
|
---
|
|
|
|
## Why MLSYSIM for Teaching?
|
|
|
|
| Challenge | How MLSYSIM Helps |
|
|
|:----------|:------------------|
|
|
| Students lack GPU access | All analysis runs on a laptop — no cloud credits needed |
|
|
| Homework answers vary by hardware | Vetted registry specs produce identical results everywhere |
|
|
| Hard to grade open-ended systems questions | Analytical solvers give deterministic, verifiable outputs |
|
|
| Specifications become stale | Registry updated from official datasheets; one update propagates everywhere |
|
|
| Students memorize without understanding | "Predict first" exercises build genuine intuition |
|
|
|
|
---
|
|
|
|
## Course Integration Patterns
|
|
|
|
### Pattern 1: Textbook Companion
|
|
|
|
MLSYSIM maps directly to chapters in the [Machine Learning Systems](https://mlsysbook.ai) textbook. Assign tutorials alongside readings:
|
|
|
|
| Week | Textbook Chapter | MLSYSIM Assignment |
|
|
|:-----|:-----------------|:-------------------|
|
|
| 3 | Hardware Acceleration | [Hello World](tutorials/hello_world.qmd) — Roofline analysis, batch size sweep |
|
|
| 5 | Model Serving | [LLM Serving](tutorials/llm_serving.qmd) — TTFT/ITL analysis |
|
|
| 7 | Distributed Training | [Distributed Training](tutorials/distributed.qmd) — 3D parallelism |
|
|
| 9 | Sustainable AI | [Sustainability Lab](tutorials/sustainability.qmd) — Carbon footprint |
|
|
| 11 | Compute Infrastructure | [Solver Guide](solver-guide.qmd) — Composing solvers for TCO analysis |
|
|
|
|
### Pattern 2: Standalone Labs
|
|
|
|
Use individual tutorials as self-contained lab assignments in any systems course. Each tutorial includes exercises with clear expected outputs.
|
|
|
|
### Pattern 3: Capstone Projects
|
|
|
|
Advanced students can write custom solvers (see [Extending MLSYSIM](solver-guide.qmd#extending-mlsysim)) or compose multiple solvers to answer research-style questions.
|
|
|
|
---
|
|
|
|
## Assignment Ideas
|
|
|
|
### Homework: Hardware Comparison (30 min)
|
|
> Using `Engine.solve()`, compare ResNet-50 inference latency on the A100, H100, and Jetson AGX at batch sizes 1, 32, and 256. For each configuration, state whether the workload is memory-bound or compute-bound and explain why the bottleneck changes.
|
|
|
|
### Lab: Carbon-Aware Training (45 min)
|
|
> Using the SustainabilitySolver, calculate the carbon footprint of training GPT-3 on a 256-GPU H100 cluster in Quebec vs. US Average vs. Poland. Produce a table and a 2-paragraph analysis of why location matters.
|
|
|
|
### Exam Question: Back-of-Envelope
|
|
> The NVIDIA H100 has 1,979 TFLOP/s (FP16) and 3.35 TB/s bandwidth. What is the ridge point in FLOP/Byte? If a model has arithmetic intensity of 50 FLOP/Byte, is it compute-bound or memory-bound? Show your work.
|
|
|
|
---
|
|
|
|
## Reproducibility Guarantee
|
|
|
|
All specifications in the [MLSys Zoo](zoo/index.qmd) are:
|
|
|
|
- **Sourced** from official manufacturer datasheets and published benchmarks
|
|
- **Typed** with `pint.Quantity` for dimensional correctness
|
|
- **Frozen** per release — `mlsysim==0.1.0` always produces the same answers
|
|
|
|
This means your answer key works for every student, every semester.
|
|
|
|
---
|
|
|
|
## Jupyter & Quarto Compatibility
|
|
|
|
All tutorials are designed to run in:
|
|
|
|
- **Jupyter Notebooks** — Standard `.ipynb` workflow
|
|
- **Quarto documents** — Render to HTML, PDF, or slides with `quarto render`
|
|
- **Google Colab** — `pip install mlsysim` in the first cell, then go
|
|
|
|
No GPU runtime required. CPU-only environments work perfectly because MLSYSIM computes from equations, not empirical profiling.
|
|
|
|
---
|
|
|
|
## Getting Started
|
|
|
|
1. Point students to the [Getting Started](getting-started.qmd) guide for installation
|
|
2. Assign the [Hello World](tutorials/hello_world.qmd) tutorial as a warmup
|
|
3. Use the [Solver Guide](solver-guide.qmd) to select solvers for your course topics
|
|
4. Browse the [MLSys Zoo](zoo/index.qmd) for available hardware and model specifications
|
|
|
|
---
|
|
|
|
## Next Steps
|
|
|
|
- **[Solver Guide](solver-guide.qmd)** — Which solver maps to which topic
|
|
- **[Math Foundations](math.qmd)** — All equations, for your own reference and exam prep
|
|
- **[Accuracy & Validation](accuracy.qmd)** — How close are analytical estimates to empirical results?
|
|
- **[Whitepaper](whitepaper.qmd)** — The academic paper describing MLSYSIM's design and pedagogy
|