vllm.model_executor.model_loader.weight_cache.utils
¶
Helpers shared by the weight cache daemon, the IPC loader and the engine.
These live outside protocol so callers that only need to know whether a
draft is cached, or how a daemon group is named, do not have to import the
wire format.
Classes:
-
ExternalWeightCharges–Track a worker's external weight charges and those freed by disk fallback.
Functions:
-
build_warmup_runner–Create a model runner for the daemon's warmup dummy runs.
-
format_daemon_role–Name of a daemon group: the target model or the draft.
-
format_socket_role_suffix–Socket-name suffix keeping the draft group distinct from the target.
-
is_draft_model_cacheable–Whether the daemon serves the speculative draft as a separate role.
ExternalWeightCharges
dataclass
¶
Track a worker's external weight charges and those freed by disk fallback.
Attributes:
-
current_bytes(int) –External bytes held right now: charges minus fallback removals.
Source code in vllm/model_executor/model_loader/weight_cache/utils.py
current_bytes
property
¶
External bytes held right now: charges minus fallback removals.
build_warmup_runner(vllm_config, local_rank, *, is_draft, model_config)
¶
Create a model runner for the daemon's warmup dummy runs.
Source code in vllm/model_executor/model_loader/weight_cache/utils.py
format_daemon_role(is_draft)
¶
format_socket_role_suffix(is_draft)
¶
Socket-name suffix keeping the draft group distinct from the target.
is_draft_model_cacheable(speculative_config)
¶
Whether the daemon serves the speculative draft as a separate role.