Skip to content

vllm.model_executor.model_loader.weight_cache.ipc_loader

Map post-processed weights from a local daemon's pluggable sharing backend.

Classes:

  • IpcModelLoader –

    Zero-copy loads a model using the weight cache daemon's sharing backend.

IpcModelLoader

Bases: BaseModelLoader

Zero-copy loads a model using the weight cache daemon's sharing backend.

The model is initialized on the meta device and receives the daemon's post-processed tensors. Post-load hooks can recreate process-local state such as accelerator views over shared pinned CPU weights.

Extra config keys (via --model-loader-extra-config):

  • socket_path: explicit daemon socket path. Defaults to a per-GPU path derived from the physical GPU uuid and the cache role (target/draft).
  • socket_dir: directory containing the daemon sockets.
  • fallback: fall back to disk loading when fetching state fails because the daemon is unavailable or the fingerprints mismatch (default: True).
  • connect_timeout_s: socket connect timeout (default: 5.0).
  • state_timeout_s: timeout for the weight-transfer request (default: 300.0).

The weights live in externally held backend allocations, so sleep mode (CuMemAllocator weight offloading) must not be used with this loader. If the daemon exits, the CUDA driver keeps the mapped weights alive until the engine exits, so the engine keeps serving; the loader watches the daemon and warns since a restarted daemon then holds a second copy of the weights on the GPU.

_rebuild_storages(state)

Rebuild manifest tensors from one imported buffer per storage.

_watch_daemon()

Watch for the exit of the daemon serving the zero-copy weights.

The daemon holds the watch connection open for its lifetime, so the connection closes exactly when that daemon instance exits; a daemon restarted on the same socket does not mask the loss.

_with_startup_wait(op)

Retry op until the daemon answers or the state timeout elapses; the daemon may still be loading the model when the engine starts.