Skip to content

vllm.snapshot.runtime

Host runtime operations for local snapshots.

Classes:

LocalSnapshotTools

Host-owned CRIU and cuda-checkpoint implementation.

Methods:

  • create_work_dir –

    Return the work directory and whether to remove it after create/restore.

_descriptor_inventory(process_tree)

Collect io_uring holders and each socket inode's owning pid.

_external_cache_files(process_tree, artifact)

Fingerprint the generated-cache files the captured tree holds open.

CRIU reopens these by path on restore, so a JIT cache that rotates between capture and restore fails the restore permanently. Recording them lets restore fail early and name the file that changed. Files inside the artifact are excluded: they belong to the snapshot itself. Deleted targets are excluded too, because CRIU remaps those links.

_prepare_restore_work_dir(manifest)

The directory a restore's control files and logs live in.

The manifest is the only source for the path. An existing directory must be private, and this restore's transaction files replace whatever an earlier run left in them, so the work directory can be reused once its previous restored tree stops.

_verify_external_cache_files(manifest)

Reject a rotated generated cache before CRIU reopens it by path.

Like the PID probe above this reports a stale host early rather than guarding it: CRIU stays authoritative for a cache replaced afterwards.

create_work_dir(requested, artifact, *, portable)

Return the work directory and whether to remove it after create/restore. Explicitly requested directories and in-place artifact directories are kept.

SnapshotCreateError

Bases: RuntimeError

Snapshot creation did not produce a complete artifact.

SnapshotRestoreError

Bases: RuntimeError

Snapshot restore failed.

_decode_endpoint(family, raw)

Render a /proc/net/tcp HEXADDR:HEXPORT field as ip:port.

The kernel prints the address as little-endian 32-bit words: one for IPv4, four in order for IPv6.

_generated_cache_prefixes()

Path prefixes of the generated caches an engine process keeps open.

vLLM redirects Inductor and Triton under VLLM_CACHE_ROOT when it compiles, but a process can still hold their upstream defaults open. A cache root is resolved and separator-terminated so that it still matches the kernel-canonical descriptor targets under a symlinked root, and so that a sibling directory sharing its name does not. Inductor's default location is a bare prefix instead, because its directory carries a per-user suffix.