snapshot

package
v2.0.0-beta.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package snapshot bakes a snapshot: it starts the engine in a donor container, warms it up, records a canary, exports the weights pool, puts the engine to sleep, checkpoints CUDA, dumps the process tree with CRIU, archives the trees it wrote and publishes everything with one manifest.

Index

Constants

View Source
const DriverCheckEnv = "__RM_NO_VERSION_CHECK"

DriverCheckEnv is set in the engine at build time: it makes the NVIDIA driver skip its client/kernel version comparison. libcuda remembers the kernel module version it met at init and presents it again when cuda-checkpoint restores, so without it a snapshot restores only under the exact driver it was built on. With it, a restore under another release of the same branch works; another branch is still refused by the kernel module.

View Source
const EngineAddr = "127.0.0.1:8000"

EngineAddr is where the engine listens inside its container.

View Source
const EngineLog = guestWorkspace + "/logs/engine.log"

EngineLog is the engine's log file, in a tree the snapshot carries: a restored engine keeps writing it.

Variables

View Source
var PeerOff = []string{
	"vllm.disable-custom-all-reduce=true",
	"env.NCCL_P2P_DISABLE=1",
	"env.VLLM_ALLREDUCE_USE_FLASHINFER_PCIE_IPC=0",
	"env.VLLM_ALLREDUCE_USE_SYMM_MEM=0",
}

PeerOff keeps an engine's collectives off the GPUs' peer path: vLLM's custom all-reduce and its FlashInfer and symmetric-memory all-reduces map the other ranks' memory through CUDA IPC, and NCCL_P2P_DISABLE reaches only NCCL, which then goes through shared host memory.

Functions

func AgentConfig

func AgentConfig(state string) agent.Config

AgentConfig is what every agent needs, its sockets in state: the image's CRIU and cuda-checkpoint, the engine's address and the trees.

func Compress

func Compress(ctx context.Context, src, dst string) (manifest.Manifest, error)

Compress writes a copy of the snapshot in src to dst with its process images, runtime trees and weights stored as zstd frames, as a build with --compress would have: the same snapshot in fewer bytes, for network storage. src keeps its files as they are, so it can still be pushed.

func Describe

func Describe(m manifest.Manifest) string

Describe is a one-line summary of a published snapshot.

func Hardware

func Hardware(table profile.HardwareTable, gpus []host.GPU, ranks int) (profile.Hardware, error)

Hardware finds the hardware row of the selected GPUs: all of one model, as many as the profile has ranks.

func Publish

func Publish(ctx context.Context, s store.Store, sources []source, output string,
	workers int) ([]manifest.File, error)

Publish stores and links every source with up to workers files at once and returns the manifest's file list, sorted by path.

func Run

Run bakes and returns the published manifest.

func ServedName

func ServedName(options map[string]any) (string, error)

ServedName is the first served model name of a launch.

func Surviving

func Surviving(exported []manifest.Allocation, table []vllm.Allocation) ([]manifest.Allocation, int)

Surviving keeps the exported allocations the asleep table still has, renumbered, and reports how many went.

func Tools

func Tools(work, criuPath, helperPath string) (agent.Config, error)

Tools fills a container agent's config and puts this binary and the optional host CRIU and cuda-checkpoint into work.

Types

type Options

type Options struct {
	Profile        string
	ProfileDirs    []string
	ModelDir       string
	GPUs           string
	Output         string
	ID             string
	StateDir       string
	DockerSocket   string
	CRIU           string
	CUDACheckpoint string
	// CUDABackend is the agent's cuda.Select mode: auto, driver or cli.
	CUDABackend string
	// Cuinterpose is a cuInterpose build directory, for profiles whose ipc
	// is not native; default: cuinterpose/ next to this executable.
	Cuinterpose  string
	Set          []string
	NoVerify     bool
	PartBytes    int64
	Threads      int
	ReadyTimeout time.Duration
	// CPUTest runs without GPU devices or the io_uring check: the
	// end-to-end test on a CPU host with a stand-in engine.
	CPUTest  bool
	Version  string
	Progress *run.Progress
	// InPlace bakes in this container, without Docker: the engine runs as a
	// child of the agent, itself a child of this process, and sees real
	// paths (docs/dmtcp.md).
	InPlace bool
	// Backend snapshots the process tree in place: auto, criu or dmtcp. A
	// donor container always runs CRIU.
	Backend string
	// Compress stores the process images, runtime trees and weights in Output
	// as zstd frames, for a snapshot restored from network storage: about
	// 2.8x fewer bytes of images and 1.45x of BF16 weights to read, decoded
	// in parallel as up stages its copy.
	Compress bool
	DMTCP    dmtcp.Tools
}

Options of one bake.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL