# harvard-edge/cs249r_book architecture

> Architecture diagram of the GitHub repository harvard-edge/cs249r_book, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harvard-edge/cs249r_book
- Repository: https://github.com/harvard-edge/cs249r_book

## Overview

This repository is an integrated machine-learning-systems curriculum: a four-volume textbook is complemented by hands-on labs, coding exercises, hardware kits, simulation, and learning assessment. The principal learner workflow is to study concepts, explore system trade-offs in labs, implement components in TinyTorch, and test understanding with StaffML; Socratiq adds guided reading and review. The graph combines README-described curriculum links with a few source-visible internal relations. Many subsystems are represented at product level because their implementation was not sampled.

Main entry points: [`labs/vol1`](https://github.com/harvard-edge/cs249r_book/tree/dev/labs/vol1) (Interactive labs), [`mlsysim/mlsysim`](https://github.com/harvard-edge/cs249r_book/tree/dev/mlsysim/mlsysim) (MLSys·im), [`books`](https://github.com/harvard-edge/cs249r_book/tree/dev/books) (Textbook series), [`socratiq/src_shadow/js`](https://github.com/harvard-edge/cs249r_book/tree/dev/socratiq/src_shadow/js) (Socratiq)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_curriculum["Curriculum content"]
  node_textbook["Textbook series"]
end

subgraph group_learning["Interactive learning"]
  node_labs["Interactive labs"]
  node_lab_logic["Lab framework"]
  node_socratiq["Socratiq"]
  node_quiz_storage["Quiz history<br/>[quiz-storage.js]"]
  node_db[("Browser database<br/>[indexDb.js]")]
end

subgraph group_engineering["Engineering tools"]
  node_mlsysim["MLSys·im"]
  node_sim_engine["Modeling engine<br/>[engine.py]"]
  node_sim_pipeline["Solver pipeline<br/>[pipeline.py]"]
  node_units["Units system<br/>[units.py]"]
  node_kits["Hardware kits"]
  node_binder["Book CLI"]
  node_cli_entry["CLI entry point<br/>[main.py]"]
  node_build_command["Book build<br/>[build.py]"]
end

subgraph group_assessment["Practice and assessment"]
  node_tinytorch["TinyTorch"]
  node_tito["TinyTorch CLI<br/>[main.py]"]
  node_staffml["StaffML"]
end

subgraph group_educators["Educator resources"]
  node_instructors["Instructor hub"]
  node_slides["Teaching slides"]
  node_newsletter["Newsletter"]
end

node_learner(("Learner"))

node_learner -->|"studies concepts"| node_textbook
node_learner -->|"explores trade-offs"| node_labs
node_labs -->|"uses modeling"| node_mlsysim
node_learner -->|"builds internals"| node_tinytorch
node_learner -->|"tests deployment"| node_kits
node_learner -->|"checks understanding"| node_staffml
node_learner -->|"reviews with guidance"| node_socratiq
node_instructors -->|"supports teaching"| node_textbook
node_slides -->|"supports teaching"| node_textbook
node_newsletter -.->|"shares updates"| node_learner
node_labs -.->|"uses lab helpers"| node_lab_logic
node_mlsysim -.->|"models workloads"| node_sim_engine
node_sim_engine -->|"imports units"| node_units
node_sim_pipeline -.->|"provides solver pipeline"| node_mlsysim
node_tinytorch -.->|"offers workflow CLI"| node_tito
node_socratiq -.->|"records quiz results"| node_quiz_storage
node_quiz_storage -->|"reads and writes"| node_db
node_binder -.->|"enters through"| node_cli_entry
node_cli_entry -->|"dispatches build"| node_build_command

click node_textbook "https://github.com/harvard-edge/cs249r_book/tree/dev/books"
click node_labs "https://github.com/harvard-edge/cs249r_book/tree/dev/labs/vol1"
click node_lab_logic "https://github.com/harvard-edge/cs249r_book/tree/dev/labs/mlsysbook_labs"
click node_mlsysim "https://github.com/harvard-edge/cs249r_book/tree/dev/mlsysim/mlsysim"
click node_sim_engine "https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/mlsysim/engine/engine.py"
click node_sim_pipeline "https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/mlsysim/engine/pipeline.py"
click node_units "https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/mlsysim/core/units.py"
click node_tinytorch "https://github.com/harvard-edge/cs249r_book/tree/dev/tinytorch/src"
click node_tito "https://github.com/harvard-edge/cs249r_book/blob/dev/tinytorch/tito/main.py"
click node_kits "https://github.com/harvard-edge/cs249r_book/tree/dev/kits"
click node_staffml "https://github.com/harvard-edge/cs249r_book/tree/dev/staffml/app/src/app"
click node_socratiq "https://github.com/harvard-edge/cs249r_book/tree/dev/socratiq/src_shadow/js"
click node_quiz_storage "https://github.com/harvard-edge/cs249r_book/blob/dev/socratiq/src_shadow/js/components/quiz/quiz-storage.js"
click node_db "https://github.com/harvard-edge/cs249r_book/blob/dev/socratiq/src_shadow/js/libs/utils/indexDb.js"
click node_binder "https://github.com/harvard-edge/cs249r_book/tree/dev/binder/cli"
click node_cli_entry "https://github.com/harvard-edge/cs249r_book/blob/dev/binder/cli/main.py"
click node_build_command "https://github.com/harvard-edge/cs249r_book/blob/dev/binder/cli/commands/build.py"
click node_instructors "https://github.com/harvard-edge/cs249r_book/tree/dev/instructors"
click node_slides "https://github.com/harvard-edge/cs249r_book/tree/dev/slides"
click node_newsletter "https://github.com/harvard-edge/cs249r_book/tree/dev/site/newsletter"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_textbook toneBlue
class node_labs,node_lab_logic,node_socratiq,node_quiz_storage,node_db toneAmber
class node_mlsysim,node_sim_engine,node_sim_pipeline,node_units,node_kits,node_binder,node_cli_entry,node_build_command toneMint
class node_tinytorch,node_tito,node_staffml toneRose
class node_instructors,node_slides,node_newsletter,node_learner toneIndigo
```

## Components

### Curriculum content

- [Textbook series](https://github.com/harvard-edge/cs249r_book/tree/dev/books): `books`

### Interactive learning

- [Interactive labs](https://github.com/harvard-edge/cs249r_book/tree/dev/labs/vol1): `labs/vol1`
- [Lab framework](https://github.com/harvard-edge/cs249r_book/tree/dev/labs/mlsysbook_labs): `labs/mlsysbook_labs`
- [Socratiq](https://github.com/harvard-edge/cs249r_book/tree/dev/socratiq/src_shadow/js): `socratiq/src_shadow/js`
- [Quiz history](https://github.com/harvard-edge/cs249r_book/blob/dev/socratiq/src_shadow/js/components/quiz/quiz-storage.js): `socratiq/src_shadow/js/components/quiz/quiz-storage.js`
- [Browser database](https://github.com/harvard-edge/cs249r_book/blob/dev/socratiq/src_shadow/js/libs/utils/indexDb.js): `socratiq/src_shadow/js/libs/utils/indexDb.js`

### Engineering tools

- [MLSys·im](https://github.com/harvard-edge/cs249r_book/tree/dev/mlsysim/mlsysim): `mlsysim/mlsysim`
- [Modeling engine](https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/mlsysim/engine/engine.py): `mlsysim/mlsysim/engine/engine.py`
- [Solver pipeline](https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/mlsysim/engine/pipeline.py): `mlsysim/mlsysim/engine/pipeline.py`
- [Units system](https://github.com/harvard-edge/cs249r_book/blob/dev/mlsysim/mlsysim/core/units.py): `mlsysim/mlsysim/core/units.py`
- [Hardware kits](https://github.com/harvard-edge/cs249r_book/tree/dev/kits): `kits`
- [Book CLI](https://github.com/harvard-edge/cs249r_book/tree/dev/binder/cli): `binder/cli`
- [CLI entry point](https://github.com/harvard-edge/cs249r_book/blob/dev/binder/cli/main.py): `binder/cli/main.py`
- [Book build](https://github.com/harvard-edge/cs249r_book/blob/dev/binder/cli/commands/build.py): `binder/cli/commands/build.py`

### Practice and assessment

- [TinyTorch](https://github.com/harvard-edge/cs249r_book/tree/dev/tinytorch/src): `tinytorch/src`
- [TinyTorch CLI](https://github.com/harvard-edge/cs249r_book/blob/dev/tinytorch/tito/main.py): `tinytorch/tito/main.py`
- [StaffML](https://github.com/harvard-edge/cs249r_book/tree/dev/staffml/app/src/app): `staffml/app/src/app`

### Educator resources

- [Instructor hub](https://github.com/harvard-edge/cs249r_book/tree/dev/instructors): `instructors`
- [Teaching slides](https://github.com/harvard-edge/cs249r_book/tree/dev/slides): `slides`
- [Newsletter](https://github.com/harvard-edge/cs249r_book/tree/dev/site/newsletter): `site/newsletter`

### Other components

- **Learner**

## Connections

- Learner → Textbook series: studies concepts (evidence: `README.md`)
- Learner → Interactive labs: explores trade-offs (evidence: `README.md`)
- Interactive labs → MLSys·im: uses modeling (evidence: `README.md`)
- Learner → TinyTorch: builds internals (evidence: `README.md`)
- Learner → Hardware kits: tests deployment (evidence: `README.md`)
- Learner → StaffML: checks understanding (evidence: `README.md`)
- Learner → Socratiq: reviews with guidance (evidence: `README.md`)
- Instructor hub → Textbook series: supports teaching (evidence: `README.md`)
- Teaching slides → Textbook series: supports teaching (evidence: `README.md`)
- Newsletter → Learner: shares updates
- Interactive labs → Lab framework: uses lab helpers
- MLSys·im → Modeling engine: models workloads (evidence: `mlsysim/mlsysim/engine/engine.py`)
- Modeling engine → Units system: imports units (evidence: `mlsysim/mlsysim/engine/engine.py`)
- Solver pipeline → MLSys·im: provides solver pipeline (evidence: `mlsysim/mlsysim/engine/pipeline.py`)
- TinyTorch → TinyTorch CLI: offers workflow CLI
- Socratiq → Quiz history: records quiz results (evidence: `socratiq/src_shadow/js/components/quiz/quiz-storage.js`)
- Quiz history → Browser database: reads and writes (evidence: `socratiq/src_shadow/js/components/quiz/quiz-storage.js`)
- Book CLI → CLI entry point: enters through (evidence: `binder/cli/main.py`)
- CLI entry point → Book build: dispatches build (evidence: `binder/cli/main.py`)
