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 ¶
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.
const Schema = "warmctl.snapshot/v2"
Schema identifies manifest.json.
Variables ¶
This section is empty.
Functions ¶
func DriverBranch ¶
DriverBranch is the branch of an NVIDIA driver version: 580 of 580.173.02.
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 (Manifest) FirstLane ¶
FirstLane are the files a restore needs before the weights: everything but the exported parts.
func (Manifest) WeightBytes ¶
WeightBytes is the size of the exported pools.
func (Manifest) WeightLane ¶
WeightLane are the exported parts and host tables, in rank order.
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.