# stas00/ml-engineering architecture

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

- Interactive diagram: https://gitdiagram.com/stas00/ml-engineering
- Repository: https://github.com/stas00/ml-engineering

## Overview

This repository is an open technical book and toolbox for LLM/VLM training engineers and operators, not a single executable application. The principal reader journey is to find a training or operations problem, consult guidance on infrastructure and orchestration, apply relevant training or inference practices, then use debugging and testing material to investigate results. The graph reflects the README’s documented sections and shortcuts; it does not imply that these chapters call one another. Source excerpts also identify concrete scripts, but most chapter implementations are documentation and were not sampled.

Main entry points: [`debug`](https://github.com/stas00/ml-engineering/tree/master/debug) (Debugging guidance), [`insights`](https://github.com/stas00/ml-engineering/tree/master/insights) (Engineering insights), [`training`](https://github.com/stas00/ml-engineering/tree/master/training) (Training guidance), [`compute`](https://github.com/stas00/ml-engineering/tree/master/compute) (Compute guidance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guidance["Orientation and guidance"]
  node_insights["Engineering insights"]
  node_gpu_upgrade["GPU upgrade analysis"]
  node_gpu_bench["GPU step benchmark<br/>[bench_decompose.py]"]
end

subgraph group_infrastructure["Compute and infrastructure"]
  node_compute["Compute guidance"]
  node_storage["Storage guidance"]
  node_network["Network guidance"]
  node_orchestration["Orchestration guidance"]
  node_slurm["SLURM guidance"]
end

subgraph group_lifecycle["Model lifecycle"]
  node_training["Training guidance"]
  node_checkpoints["Checkpoint tools"]
  node_fault_tolerance["Fault tolerance"]
  node_watchdog["Filesystem watchdog<br/>[fs-watchdog.py]"]
  node_inference["Inference guidance"]
end

subgraph group_engineering["Engineering tools"]
  node_debug["Debugging guidance"]
  node_trace["Python trace tool<br/>[NicerTrace.py]"]
  node_overflow["Numerical overflow debugger"]
  node_synthetic_data["Synthetic data scripts"]
  node_testing["Testing guidance"]
  node_test_utils["Testing utilities<br/>[testing_utils.py]"]
end

subgraph group_learning["Learning resources"]
  node_resources["ML resources"]
  node_courses["Lessons learned course"]
  node_skills["Engineering skills"]
end

node_engineer(("ML engineer"))

node_engineer -->|"consults"| node_insights
node_engineer -->|"consults"| node_compute
node_engineer -->|"consults"| node_storage
node_engineer -->|"consults"| node_network
node_engineer -->|"consults"| node_orchestration
node_engineer -->|"consults"| node_training
node_engineer -->|"consults"| node_inference
node_engineer -->|"consults"| node_debug
node_engineer -->|"consults"| node_testing
node_engineer -->|"consults"| node_resources
node_engineer -->|"consults"| node_courses
node_engineer -->|"consults"| node_skills
node_insights -->|"links to"| node_gpu_upgrade
node_insights -->|"links to"| node_gpu_bench
node_compute -->|"links to"| node_gpu_bench
node_orchestration -->|"links to"| node_slurm
node_training -->|"covers"| node_checkpoints
node_training -->|"covers"| node_fault_tolerance
node_fault_tolerance -->|"includes"| node_watchdog
node_debug -->|"includes"| node_trace
node_debug -->|"includes"| node_overflow
node_debug -->|"includes"| node_synthetic_data
node_testing -->|"includes"| node_test_utils

click node_insights "https://github.com/stas00/ml-engineering/tree/master/insights"
click node_gpu_upgrade "https://github.com/stas00/ml-engineering/tree/master/insights/when-to-upgrade-gpus"
click node_compute "https://github.com/stas00/ml-engineering/tree/master/compute"
click node_storage "https://github.com/stas00/ml-engineering/tree/master/storage"
click node_network "https://github.com/stas00/ml-engineering/tree/master/network"
click node_orchestration "https://github.com/stas00/ml-engineering/tree/master/orchestration"
click node_slurm "https://github.com/stas00/ml-engineering/tree/master/orchestration/slurm"
click node_training "https://github.com/stas00/ml-engineering/tree/master/training"
click node_checkpoints "https://github.com/stas00/ml-engineering/tree/master/training/checkpoints"
click node_fault_tolerance "https://github.com/stas00/ml-engineering/tree/master/training/fault-tolerance"
click node_watchdog "https://github.com/stas00/ml-engineering/blob/master/training/fault-tolerance/fs-watchdog.py"
click node_inference "https://github.com/stas00/ml-engineering/tree/master/inference"
click node_debug "https://github.com/stas00/ml-engineering/tree/master/debug"
click node_trace "https://github.com/stas00/ml-engineering/blob/master/debug/NicerTrace.py"
click node_overflow "https://github.com/stas00/ml-engineering/blob/master/debug/underflow_overflow.py"
click node_synthetic_data "https://github.com/stas00/ml-engineering/blob/master/debug/tiny-scripts/cm4-synthetic-testing.py"
click node_testing "https://github.com/stas00/ml-engineering/tree/master/testing"
click node_test_utils "https://github.com/stas00/ml-engineering/blob/master/testing/testing_utils.py"
click node_resources "https://github.com/stas00/ml-engineering/tree/master/resources"
click node_courses "https://github.com/stas00/ml-engineering/tree/master/courses/lesson-learned"
click node_skills "https://github.com/stas00/ml-engineering/tree/master/skills"
click node_gpu_bench "https://github.com/stas00/ml-engineering/blob/master/insights/when-to-upgrade-gpus/bench_decompose.py"

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_insights,node_gpu_upgrade,node_gpu_bench toneBlue
class node_compute,node_storage,node_network,node_orchestration,node_slurm toneAmber
class node_training,node_checkpoints,node_fault_tolerance,node_watchdog,node_inference toneMint
class node_debug,node_trace,node_overflow,node_synthetic_data,node_testing,node_test_utils toneRose
class node_resources,node_courses,node_skills,node_engineer toneIndigo
```

## Components

### Orientation and guidance

- [Engineering insights](https://github.com/stas00/ml-engineering/tree/master/insights): `insights`
- [GPU upgrade analysis](https://github.com/stas00/ml-engineering/tree/master/insights/when-to-upgrade-gpus): `insights/when-to-upgrade-gpus`
- [GPU step benchmark](https://github.com/stas00/ml-engineering/blob/master/insights/when-to-upgrade-gpus/bench_decompose.py): `insights/when-to-upgrade-gpus/bench_decompose.py`

### Compute and infrastructure

- [Compute guidance](https://github.com/stas00/ml-engineering/tree/master/compute): `compute`
- [Storage guidance](https://github.com/stas00/ml-engineering/tree/master/storage): `storage`
- [Network guidance](https://github.com/stas00/ml-engineering/tree/master/network): `network`
- [Orchestration guidance](https://github.com/stas00/ml-engineering/tree/master/orchestration): `orchestration`
- [SLURM guidance](https://github.com/stas00/ml-engineering/tree/master/orchestration/slurm): `orchestration/slurm`

### Model lifecycle

- [Training guidance](https://github.com/stas00/ml-engineering/tree/master/training): `training`
- [Checkpoint tools](https://github.com/stas00/ml-engineering/tree/master/training/checkpoints): `training/checkpoints`
- [Fault tolerance](https://github.com/stas00/ml-engineering/tree/master/training/fault-tolerance): `training/fault-tolerance`
- [Filesystem watchdog](https://github.com/stas00/ml-engineering/blob/master/training/fault-tolerance/fs-watchdog.py): `training/fault-tolerance/fs-watchdog.py`
- [Inference guidance](https://github.com/stas00/ml-engineering/tree/master/inference): `inference`

### Engineering tools

- [Debugging guidance](https://github.com/stas00/ml-engineering/tree/master/debug): `debug`
- [Python trace tool](https://github.com/stas00/ml-engineering/blob/master/debug/NicerTrace.py): `debug/NicerTrace.py`
- [Numerical overflow debugger](https://github.com/stas00/ml-engineering/blob/master/debug/underflow_overflow.py): `debug/underflow_overflow.py`
- [Synthetic data scripts](https://github.com/stas00/ml-engineering/blob/master/debug/tiny-scripts/cm4-synthetic-testing.py): `debug/tiny-scripts/cm4-synthetic-testing.py`
- [Testing guidance](https://github.com/stas00/ml-engineering/tree/master/testing): `testing`
- [Testing utilities](https://github.com/stas00/ml-engineering/blob/master/testing/testing_utils.py): `testing/testing_utils.py`

### Learning resources

- [ML resources](https://github.com/stas00/ml-engineering/tree/master/resources): `resources`
- [Lessons learned course](https://github.com/stas00/ml-engineering/tree/master/courses/lesson-learned): `courses/lesson-learned`
- [Engineering skills](https://github.com/stas00/ml-engineering/tree/master/skills): `skills`

### Other components

- **ML engineer**

## Connections

- ML engineer → Engineering insights: consults (evidence: `README.md`)
- ML engineer → Compute guidance: consults (evidence: `README.md`)
- ML engineer → Storage guidance: consults (evidence: `README.md`)
- ML engineer → Network guidance: consults (evidence: `README.md`)
- ML engineer → Orchestration guidance: consults (evidence: `README.md`)
- ML engineer → Training guidance: consults (evidence: `README.md`)
- ML engineer → Inference guidance: consults (evidence: `README.md`)
- ML engineer → Debugging guidance: consults (evidence: `README.md`)
- ML engineer → Testing guidance: consults (evidence: `README.md`)
- ML engineer → ML resources: consults (evidence: `README.md`)
- ML engineer → Lessons learned course: consults (evidence: `README.md`)
- ML engineer → Engineering skills: consults (evidence: `README.md`)
- Engineering insights → GPU upgrade analysis: links to (evidence: `README.md`)
- Engineering insights → GPU step benchmark: links to (evidence: `README.md`)
- Compute guidance → GPU step benchmark: links to (evidence: `README.md`)
- Orchestration guidance → SLURM guidance: links to (evidence: `README.md`)
- Training guidance → Checkpoint tools: covers (evidence: `README.md`)
- Training guidance → Fault tolerance: covers (evidence: `README.md`)
- Fault tolerance → Filesystem watchdog: includes (evidence: `README.md`)
- Debugging guidance → Python trace tool: includes (evidence: `README.md`)
- Debugging guidance → Numerical overflow debugger: includes (evidence: `README.md`)
- Debugging guidance → Synthetic data scripts: includes (evidence: `README.md`)
- Testing guidance → Testing utilities: includes (evidence: `README.md`)
