manifest

package
v2.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 10 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 manifest defines manifest.json, the one description of a snapshot. A restore reads everything it needs from it and never derives a launch from code: the effective profile, the argv and environment the donor ran, the hardware it ran on, the processes that own CUDA state, the files of the snapshot and, per rank, how the weights pool was exported.

Index

Constants

View Source
const (
	RoleCRIU      = "criu"
	RoleRuntimeFS = "runtimefs"
	RoleFSMeta    = "runtimefs-meta"
	RoleRemaps    = "remaps"
	RoleJITCache  = "jitcache"
	RoleWeights   = "weights"
	RoleHostTable = "host-table"
	RoleAdapter   = "adapter"
	RoleIPC       = "ipc"
	RoleDriver    = "driver"
)

File roles.

View Source
const Schema = "warmctl.snapshot/v2"

Schema identifies manifest.json.

Variables

This section is empty.

Functions

func DriverBranch

func DriverBranch(v string) string

DriverBranch is the branch of an NVIDIA driver version: 580 of 580.173.02.

func IsDigest

func IsDigest(s string) bool

IsDigest reports a lowercase hex SHA-256.

Types

type Allocation

type Allocation struct {
	Index  int    `json:"index"`
	Ptr    string `json:"ptr"`
	Bytes  int64  `json:"bytes"`
	Tag    string `json:"tag"`
	Part   int    `json:"part"`
	Offset int64  `json:"offset"`
	// Sum is the allocation's fingerprint read from donor device memory:
	// sum, sum of squares and position-weighted sum of its bytes.
	Sum [3]int64 `json:"sum"`
}

Allocation is one entry of the sleep-mode allocator's weights pool: the virtual address it must come back at, its size and where its bytes sit in the rank's part stream.

type Canary

type Canary struct {
	PromptTokens int     `json:"prompt_tokens"`
	MaxTokens    int     `json:"max_tokens"`
	Miss         Row     `json:"miss"`
	Hit          Row     `json:"hit"`
	MissCached   int     `json:"miss_cached_tokens"`
	HitCached    int     `json:"hit_cached_tokens"`
	MissSeconds  float64 `json:"miss_seconds"`
	HitSeconds   float64 `json:"hit_seconds"`
}

Canary is a miss and a hit of the same token-ID prompt: the donor's baseline, and what a restored engine must reproduce.

type File

type File struct {
	Path   string `json:"path"`
	Size   int64  `json:"size"`
	SHA256 string `json:"sha256"`
	Role   string `json:"role"`
	Root   string `json:"root,omitempty"`
}

File is one member of the snapshot directory, relative to it.

type Fingerprint

type Fingerprint struct {
	Sum         [3]int64 `json:"sum"`
	Allocations int      `json:"allocations"`
	Bytes       int64    `json:"bytes"`
}

Fingerprint totals a rank's allocation fingerprints, for the record.

type GPU

type GPU struct {
	Rank      int    `json:"rank"`
	Index     int    `json:"index"`
	UUID      string `json:"uuid"`
	PCIBusID  string `json:"pci_bus_id"`
	Name      string `json:"name"`
	MemoryMiB int64  `json:"memory_mib"`
}

GPU is one device of the donor, in rank order.

type Hardware

type Hardware struct {
	Row            profile.Hardware `json:"row"`
	GPUs           []GPU            `json:"gpus"`
	Topology       string           `json:"topology"`
	TopologySHA256 string           `json:"topology_sha256"`
	Driver         string           `json:"driver"`
	Kernel         string           `json:"kernel"`
	CPUFlags       []string         `json:"cpu_flags"`
	VLLM           string           `json:"vllm"`
	CRIU           string           `json:"criu"`
	CUDACheckpoint string           `json:"cuda_checkpoint"`
	// DriverPortable: built with the driver's version check off, so the
	// snapshot restores under any release of the same driver branch.
	// DriverFiles are the host driver libraries the dump maps, kept under
	// driver/ and mounted back at these paths under another release.
	DriverPortable bool     `json:"driver_portable,omitempty"`
	DriverFiles    []string `json:"driver_files,omitempty"`
}

Hardware is what a restore host has to match.

type HostTable

type HostTable struct {
	Name  string `json:"name"`
	Bytes int64  `json:"bytes"`
	Parts []Part `json:"parts"`
}

HostTable is a pinned host table released before the dump.

type Launch

type Launch struct {
	Image string `json:"image"`
	// Model is the served name requests use.
	Model string `json:"model"`
	// ModelDir is the donor host's model directory.
	ModelDir     string            `json:"model_dir"`
	ModelSHA256  string            `json:"model_sha256"`
	Argv         []string          `json:"argv"`
	Env          map[string]string `json:"env"`
	CaptureSizes []int             `json:"capture_sizes"`
	Ranks        int               `json:"ranks"`
}

Launch is the engine launch exactly as the donor ran it.

type Manifest

type Manifest struct {
	Schema    string          `json:"schema"`
	ID        string          `json:"id"`
	CreatedAt time.Time       `json:"created_at"`
	Tool      string          `json:"warmctl"`
	Profile   profile.Profile `json:"profile"`
	Launch    Launch          `json:"launch"`
	Hardware  Hardware        `json:"hardware"`
	Process   Process         `json:"process"`
	Files     []File          `json:"files"`
	Weights   Weights         `json:"weights"`
	Canary    *Canary         `json:"canary,omitempty"`
}

Manifest is manifest.json.

func Read

func Read(name string) (Manifest, error)

Read loads and validates manifest.json.

func (Manifest) Bytes

func (m Manifest) Bytes() int64

Bytes is the size of every listed file.

func (Manifest) File

func (m Manifest) File(name string) (File, bool)

File finds a listed file.

func (Manifest) FirstLane

func (m Manifest) FirstLane() []File

FirstLane are the files a restore needs before the weights: everything but the exported parts.

func (Manifest) Validate

func (m Manifest) Validate() error

Validate checks what a restore depends on.

func (Manifest) WeightBytes

func (m Manifest) WeightBytes() int64

WeightBytes is the size of the exported pools.

func (Manifest) WeightLane

func (m Manifest) WeightLane() []File

WeightLane are the exported parts and host tables, in rank order.

func (Manifest) Write

func (m Manifest) Write(name string) error

Write stores the manifest atomically.

type Owner

type Owner struct {
	PID        int    `json:"pid"`
	StartTicks uint64 `json:"start_ticks"`
	Rank       int    `json:"rank"`
	Role       string `json:"role"`
}

Owner is a process of the dumped tree that holds CUDA state. Rank is -1 for the engine core and the API server.

type Part

type Part struct {
	Index  int    `json:"index"`
	Path   string `json:"path"`
	Size   int64  `json:"size"`
	SHA256 string `json:"sha256"`
}

Part is one exported file. The parts of a rank, concatenated in order, are its pool stream: every allocation's bytes in address order.

type Process

type Process struct {
	RootPID             int      `json:"root_pid"`
	MaxID               int      `json:"max_id"`
	PIDFloor            int      `json:"pid_floor"`
	NeedsModel          bool     `json:"needs_model"`
	Owners              []Owner  `json:"cuda_owners"`
	VisibleUUIDs        []string `json:"visible_uuids"`
	CollectivesDetached bool     `json:"collectives_detached"`
	NCCLMode            string   `json:"nccl_mode"`
	EngineURL           string   `json:"engine_url"`
	// IPC is "interpose" when the engine ran under cuInterpose: the restore
	// mounts the snapshot's ipc/ where the donor had the build and runs the
	// coordinator after the CUDA restore.
	IPC string `json:"ipc,omitempty"`
	// IPCProcesses are the processes the coordinator prepared and restores.
	IPCProcesses []int `json:"ipc_processes,omitempty"`
}

Process describes the dumped process tree.

type Rank

type Rank struct {
	Rank        int          `json:"rank"`
	Allocations []Allocation `json:"allocations"`
	Parts       []Part       `json:"parts"`
	Fingerprint Fingerprint  `json:"fingerprint"`
	HostTables  []HostTable  `json:"host_tables,omitempty"`
}

Rank is one worker's export.

type Row

type Row struct {
	Tokens   []int     `json:"tokens"`
	Logprobs []float64 `json:"logprobs"`
}

Row is one generated sequence: token IDs and their logprobs.

type Weights

type Weights struct {
	PartBytes int64  `json:"part_bytes"`
	Ranks     []Rank `json:"ranks"`
}

Weights is the whole export.

Jump to

Keyboard shortcuts

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