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
- func AgentConfig(state string) agent.Config
- func Describe(m manifest.Manifest) string
- func Hardware(table profile.HardwareTable, gpus []host.GPU, ranks int) (profile.Hardware, error)
- func Publish(ctx context.Context, s store.Store, sources []source, output string, ...) ([]manifest.File, error)
- func Run(ctx context.Context, o Options) (manifest.Manifest, error)
- func ServedName(options map[string]any) (string, error)
- func Surviving(exported []manifest.Allocation, table []vllm.Allocation) ([]manifest.Allocation, int)
- func Tools(work, criuPath, helperPath string) (agent.Config, error)
- type Options
Constants ¶
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.
const EngineAddr = "127.0.0.1:8000"
EngineAddr is where the engine listens inside its container.
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 ¶
This section is empty.
Functions ¶
func AgentConfig ¶
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 Hardware ¶
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 ServedName ¶
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.
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
// 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
}
Options of one bake.