-
Notifications
You must be signed in to change notification settings - Fork 12
docs: Snapshot alpha documentation (README + usage/reference/operations guides) #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 80 commits
f7d649d
170e00b
af747f1
4da96e1
0a2a13c
d8d9304
c8232c9
a1689b5
7d7605d
124ca40
4ec6015
124ae3a
94a8e7e
6295d1d
e670481
9d3ff28
b82caff
2c6c303
1aa29d2
80524f4
0f51ed9
0ed2b64
1042695
205d65d
186537b
3443b7d
1e87a4b
12a12fa
7851aa1
3429150
f68ea88
0fc19b9
b30a0fb
692421b
a93a108
dcfbf05
12f6b08
8c0ee4f
62acca2
20d8ec5
663f184
d03a0bd
6c9d294
770cafd
afc801b
8d1fff5
ccde7dd
24f13a8
190d70f
2405466
87292c5
c612fb2
6d114bd
8c3eb41
5b8a859
c824f9e
f1fd1d7
c7b93c6
7af24a6
9cd0647
65def65
9710a5f
d919b4c
28b9574
04cbbda
f093512
10458f8
197fc57
060fa22
43c1f61
46ac918
87bf06f
e47aae2
2fecfda
a602505
7f4718b
2ddc63e
0f41eb7
83978bf
b2c17f4
c974a87
8295911
cf2ef90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,94 +1,202 @@ | ||
| # Snapshot | ||
|
|
||
| > **This project is under construction.** | ||
| Snapshot is a Kubernetes-native checkpoint and restore system for NVIDIA GPU | ||
| workloads. It checkpoints a fully initialized GPU pod — its running process, with | ||
| CPU and GPU memory — and restores that state on any compatible node, so a pod | ||
| becomes ready in seconds instead of minutes. | ||
|
|
||
| Snapshot provides the checkpoint and restore primitives for GPU pods. | ||
| Orchestration — which pods to checkpoint, when, and how the checkpoints are | ||
| restored — is left to the systems that integrate it. | ||
|
|
||
| Snapshot is a Kubernetes-native checkpoint and restore system for NVIDIA GPU workloads. | ||
| It enables AI frameworks and platforms to capture a fully initialized GPU worker and restore that state on any compatible node, allowing new pods to become ready in seconds instead of minutes. | ||
| > [!NOTE] | ||
| > Snapshot's APIs may still change, so it is not yet recommended for | ||
| > production-critical workloads. | ||
|
|
||
| Snapshot focuses on one responsibility: reliably capturing and restoring running GPU workloads. Higher-level decisions - such as which workloads to checkpoint, when to create snapshots, or when to restore them - are left to the systems integrating with Snapshot. | ||
| ## The Problem | ||
|
|
||
| In inference serving, a replica can't answer a single request until it is fully | ||
| initialized — model weights loaded into GPU memory, CUDA and runtime libraries | ||
| initialized, execution kernels warmed up, and computation graphs compiled. For | ||
| large models, this **cold start** takes minutes. | ||
|
|
||
| ## Why Snapshot? | ||
| That cost is paid over and over. Every replica added to meet demand, every | ||
| scale-up from zero, every restart or reschedule pays the full cold start again | ||
| before it can serve traffic: | ||
|
|
||
| GPU inference workers are expensive to start. Before serving a single request, a worker typically needs to load large model weights into GPU memory, initialize CUDA and other runtime libraries, warm up execution kernels, and compile or optimize computation graphs. | ||
| - New replicas take minutes to become ready, so autoscaling lags behind demand. | ||
| - Teams over-provision idle GPUs just to absorb demand spikes. | ||
| - Restarts and reschedules stall serving capacity exactly when it is needed. | ||
|
|
||
| For large models, this initialization can take several minutes. Every new replica, pod restart, reschedule, or scale-up event repeats the entire process, paying that cost from scratch. | ||
| Snapshot eliminates most of this overhead by restoring a previously initialized worker instead of starting a new one. | ||
| ## The Solution | ||
|
|
||
| ## How it Works | ||
| Snapshot checkpoints a fully initialized pod once and restores it on demand, so a | ||
| new replica comes online in seconds instead of minutes. | ||
|
|
||
| Snapshot exposes checkpoint and restore as Kubernetes resources. | ||
| - **Checkpoint** — pause a running pod and save its complete execution state (CPU | ||
| and GPU memory) as a portable artifact. | ||
| - **Restore** — start a new pod from that artifact on any node with matching GPU | ||
| hardware and driver versions, skipping model loading and warm-up; the process | ||
| resumes from where it was checkpointed. | ||
|
|
||
| #### Capture | ||
| ## Benchmarks | ||
|
|
||
| To create a snapshot, a caller identifies the pod to checkpoint. Snapshot pauses the running process and captures its complete execution state, including both CPU memory and GPU memory, into a persistent artifact. | ||
| This artifact is not a container image, a filesystem snapshot, or a volume snapshot. Instead, it represents the complete in-memory state of a live, fully initialized GPU worker. | ||
| <div align="center"> | ||
| <picture> | ||
| <source media="(prefers-color-scheme: dark)" srcset="docs/development/img/cold-start-vs-snapshot-dark.svg"> | ||
| <source media="(prefers-color-scheme: light)" srcset="docs/development/img/cold-start-vs-snapshot-light.svg"> | ||
| <img width="900" alt="Paired column chart comparing cold start against Snapshot for each model. Cold start ranges from 52 to 102 seconds, Snapshot from 3.5 to 40.9 seconds." src="docs/development/img/cold-start-vs-snapshot-light.svg"> | ||
| </picture> | ||
| </div> | ||
|
|
||
| #### Restore | ||
| <p align="center"><i><b>Figure 1.</b> Restoring a captured workload is 2.4 to 14.9 times faster than starting the same workload from scratch on the same hardware.</i></p> | ||
|
|
||
| To restore a worker, a new pod references a previously captured snapshot artifact. During pod startup, Snapshot restores the captured process state directly into the container, bypassing model loading, kernel warm-up, and other initialization steps. The restored process resumes execution from the exact point where it was captured. | ||
| Snapshots are portable across compatible machines and can be restored on any node with matching GPU hardware and driver versions. They are not tied to the node where they were originally created. | ||
| For the experiment setup, the per stage breakdown, and the full results, see [benchmarks](docs/development/benchmarks.md). | ||
|
|
||
| | ||
| ## When to use it | ||
|
|
||
| ## APIs | ||
| | Resource | Scope | Role | | ||
| |------------------------------------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `PodSnapshot` | Namespaced | Created by callers to request a capture or reference an artifact for restore. | | ||
| | `PodSnapshotContent` | Cluster-scoped | System-managed record of the physical artifact, bound to a `PodSnapshot`. Created by the Snapshot operator, never by the caller. | | ||
| | `SnapshotJob` | Namespaced | Created by callers to run a workload pod from a template and capture it into a `PodSnapshot` in one declarative, one-shot object. | | ||
| | `nvidia.com/restore-from` | Namespaced | Added as a pod annotation to trigger restore from a named `PodSnapshot` in the same namespace. | | ||
| | `nvidia.com/restore-container-map` | Namespaced | Optional comma-separated `source=destination` mappings used to clone the single captured container into one or more restore containers. | | ||
| - **Autoscaling inference** — scale out from an existing snapshot: bring the N+1 | ||
| replica and beyond online in seconds to keep pace with demand. | ||
| - **Scale-to-zero** — park idle models at zero replicas and restore them quickly | ||
| when capacity is needed again. | ||
| - **Faster restarts and reschedules** — recover a pod's initialized state after a | ||
| restart or a move to another node. | ||
|
|
||
| | ||
| Snapshot currently focuses on inference cold-start; further use cases are on the | ||
| roadmap. | ||
|
|
||
| ## Who it's for | ||
|
|
||
| ## Architecture | ||
| Snapshot is a building block for the teams that build and operate inference | ||
| infrastructure: | ||
|
|
||
| Snapshot consists of two main components. | ||
| - **Developers** building Kubernetes controllers, operators, or serving platforms. | ||
| - **MLOps and platform engineers** who assemble deployment pipelines declaratively | ||
| with GitOps or workflow tools. | ||
|
|
||
| #### Operator | ||
| ## Prerequisites | ||
|
|
||
| The Kubernetes operator manages the control plane. | ||
| Before installing Snapshot, make sure the following are in place: | ||
|
|
||
| It is responsible for: | ||
| - A Kubernetes cluster with NVIDIA GPU nodes | ||
| - containerd or CRI-O as the container runtime | ||
| - [NVIDIA GPU Operator](https://github.com/NVIDIA/gpu-operator) 26.3 or newer, with CUDA driver 580 or newer and MIG disabled | ||
| - A `ReadWriteMany` (RWX) storage class | ||
| - The [Helm](https://helm.sh/docs/intro/install) CLI | ||
| - A cluster that permits privileged pods for the node agent — see [Security](docs/operations/security.md) | ||
|
|
||
| * Orchestrating checkpoint and restore operations. | ||
| * Tracking snapshot lifecycle. | ||
| * Exposing status through Kubernetes resources. | ||
| * Managing cleanup. | ||
| ## Installation | ||
|
|
||
| Snapshot installs as a single per-cluster Helm release — a control-plane operator | ||
| plus a privileged node agent (DaemonSet) on GPU nodes. Install it in its own | ||
| namespace, and run GPU workloads in separate namespaces. | ||
|
|
||
| #### Node Agent | ||
| Snapshot can be installed: | ||
|
|
||
| A privileged node agent runs on every GPU node. | ||
| - **From a release** (recommended) | ||
| - **From source** (build the images and install locally) | ||
|
|
||
| It performs the actual checkpoint and restore operations by invoking CRIU and cuda-checkpoint against live processes. | ||
| ### From a release | ||
|
|
||
| The node agent is intentionally an implementation detail. Clients never communicate with it directly. | ||
| Find the latest version on the [releases page](https://github.com/ai-dynamo/snapshot/releases), | ||
| then install the published chart, replacing `<VERSION>`: | ||
|
|
||
| | ||
| ```bash | ||
| helm install snapshot oci://ghcr.io/ai-dynamo/snapshot/snapshot \ | ||
| --version <VERSION> \ | ||
| --namespace snapshot --create-namespace | ||
| ``` | ||
|
|
||
| ## Design Principles | ||
| By default the chart provisions its own RWX checkpoint volume, shared by every | ||
| checkpoint. See [Storage](docs/operations/storage.md) for the volume model and options | ||
| (including reusing an existing claim), and [Installation](docs/operations/install.md) | ||
| for install and uninstall. | ||
|
|
||
| Snapshot owns the mechanics of checkpoint and restore—not the policy. | ||
| ### From source | ||
|
|
||
| Systems integrating with Snapshot decide: | ||
| Follow the instructions in [Building from source](docs/development/build-from-source.md). | ||
|
|
||
| * Which workloads should be checkpointed. | ||
| * When snapshots should be created. | ||
| * When they should be restored. | ||
| * How failures should be handled. | ||
| ## How to use it | ||
|
|
||
| Snapshot executes those requests and exposes the resulting state. | ||
| Snapshot is driven entirely through Kubernetes resources, with standard tooling. | ||
| Create a `PodSnapshot` to checkpoint a running pod, and annotate a new pod with | ||
| `nvidia.com/restore-from` to restore it. Higher-level systems wire these | ||
| primitives into their own control loop. | ||
|
|
||
| Everything Snapshot manages is represented as Kubernetes resources. Snapshot metadata, capture progress, restore status, and lifecycle information are all observable through the Kubernetes API using standard Kubernetes tooling. | ||
| | Resource | Scope | Role | | ||
| |----------|-------|------| | ||
| | `PodSnapshot` | Namespaced | Created by callers to request a checkpoint, or to reference an artifact for restore. | | ||
| | `PodSnapshotContent` | Cluster-scoped | System-managed record of the physical artifact, bound to a `PodSnapshot`. Created by the operator, never by the caller. | | ||
| | `SnapshotJob` | Namespaced | Runs a pod from a template and checkpoints it into a `PodSnapshot` once ready — a self-contained checkpoint job. | | ||
| | `nvidia.com/restore-from` | Namespaced | Pod annotation that triggers a restore from a named `PodSnapshot` in the same namespace. | | ||
|
Comment on lines
126
to
+131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- repository conventions ---'
find /tmp/coderabbit-repo-knowledge/ai-dynamo-snapshot-44b65c85 -maxdepth 2 -type f -name '*.md' -print
for f in /tmp/coderabbit-repo-knowledge/ai-dynamo-snapshot-44b65c85/*/*.md; do
[ -f "$f" ] || continue
printf '\n--- %s ---\n' "$f"
head -120 "$f"
done
printf '%s\n' '--- README relevant references ---'
rg -n -C 4 'restore-container-map|restore-from|PodSnapshotContent|SnapshotJob' README.md
printf '%s\n' '--- tracked files likely defining the annotation ---'
rg -n -C 5 'restore-container-map|RestoreContainer|container.map|container_map' --glob '!README.md' --glob '!**/vendor/**' .Repository: ai-dynamo/snapshot Length of output: 40326 Add
🤖 Prompt for AI AgentsSource: MCP tools |
||
|
|
||
| Clients interact exclusively through the Kubernetes API. No platform-specific APIs, direct node communication, or custom protocols are required. | ||
| Under the hood, a control-plane operator and a per-node agent perform the CRIU | ||
| and `cuda-checkpoint` work; see [Architecture](docs/reference/architecture.md). | ||
| The [API reference](docs/reference/api.md) covers the resources and the | ||
| checkpoint/restore lifecycle. | ||
|
|
||
| | ||
| Once Snapshot is installed, follow the **[usage guides](docs/guides/README.md)** | ||
| to checkpoint and restore a pod. | ||
|
|
||
| ## Status | ||
| ## Limitations | ||
|
|
||
| The project is in early development. API types and control plane components are scaffolded but not yet feature-complete. Not ready for production use. | ||
| Current limitations: | ||
|
|
||
| - Single-GPU workloads only. | ||
| - x86_64 nodes only. | ||
| - vGPU is not supported. | ||
| - Runs only on NVIDIA GPUs supported by the required CUDA driver. | ||
|
|
||
| Multi-GPU and Arm support are on the roadmap. | ||
|
|
||
| ## Documentation | ||
|
|
||
| **Get started** | ||
|
|
||
| - [Usage guides](docs/guides/README.md) — build a snapshot-ready image per inference framework, then checkpoint and restore. | ||
|
|
||
| **Reference** | ||
|
|
||
| - [API](docs/reference/api.md) — `PodSnapshot`, `PodSnapshotContent`, `SnapshotJob`, and the `restore-from` annotation. | ||
| - [Architecture](docs/reference/architecture.md) — operator and node-agent design, and the checkpoint/restore internals. | ||
| - [CLI (`snapshotctl`)](docs/reference/cli.md) — lower-level checkpoint/restore from a pod manifest. | ||
|
|
||
| **Operations** | ||
|
|
||
| - [Installation](docs/operations/install.md) — Helm install and uninstall. | ||
| - [Storage](docs/operations/storage.md) — the shared checkpoint volume and how to configure it. | ||
| - [Troubleshooting](docs/operations/troubleshooting.md) — common failures and where to look. | ||
| - [Security](docs/operations/security.md) — the privileged agent, seccomp, and Pod Security. | ||
|
|
||
| **Development** | ||
|
|
||
| - [Building from source](docs/development/build-from-source.md) — build the images and install locally. | ||
| - [Benchmarks](docs/development/benchmarks.md) — how startup performance is measured. | ||
|
|
||
| **More** | ||
|
|
||
| - [Limitations & known issues](docs/limitations.md) — current limitations and what's on the roadmap. | ||
|
|
||
| ## Adopters | ||
|
|
||
| [NVIDIA Dynamo](https://github.com/ai-dynamo/dynamo), the open-source | ||
| inference-serving stack, integrates Snapshot for GPU cold-start. On Dynamo, Snapshot is available through it directly — see | ||
| [Snapshotting GPU Workers](https://docs.nvidia.com/dynamo/latest/kubernetes/operations/cold-start-optimizations/dynamo-snapshot) | ||
| in the Dynamo docs. | ||
|
|
||
| ## Contributing | ||
|
|
||
| Contributions are welcome under the project's [Apache 2.0 license](LICENSE). See | ||
| [CONTRIBUTING.md](CONTRIBUTING.md) — all commits must be signed off (DCO). | ||
|
|
||
| ## Security | ||
|
|
||
| To report a security vulnerability, follow the process in [SECURITY.md](SECURITY.md). | ||
|
|
||
| ## Feedback | ||
|
|
||
| Feedback and issues are welcome — please [open an issue](https://github.com/ai-dynamo/snapshot/issues). | ||
|
|
||
| ## License | ||
|
|
||
| Snapshot is licensed under the [Apache License 2.0](LICENSE). | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use hyphenated compound modifiers throughout.
Change “per stage breakdown” to “per-stage breakdown” in the README. In the benchmark guide, use “GPU-side,” “warm-up,” and “end-to-end” at the cited locations.
📍 Affects 2 files
README.md#L54-L54(this comment)docs/development/benchmarks.md#L46-L46🤖 Prompt for AI Agents
Source: Linters/SAST tools