vllm.model_executor.model_loader.reload.inplace
¶
Functions:
-
get_parameter_for_reload–Resolve checkpoint names without changing the model's module tree.
-
reload_weights–Reload a model's weights in place from a weights iterator or from disk.
get_parameter_for_reload(model, name)
¶
Resolve checkpoint names without changing the model's module tree.
Source code in vllm/model_executor/model_loader/reload/inplace.py
reload_weights(vllm_config, model, weights_iterator, weights_path, is_checkpoint_format)
¶
Reload a model's weights in place from a weights iterator or from disk.
Callers are responsible for invalidating any state derived from the old weights (e.g. LoRA, encoder and multimodal caches).
Parameters:
-
(vllm_config¶VllmConfig) –config of the model being reloaded. If
weights_pathis given,vllm_config.model_configis updated to point at it. -
(model¶Module) –model to load weights into
-
(weights_iterator¶Iterable[tuple[str, Tensor]] | None) –weights to load into model
-
(weights_path¶str | None) –path to load weights from if weights_iterator is not provided. Use path of original model if neither is provided.
-
(is_checkpoint_format¶bool) –set to False if weights have already been processed into kernel format (repacking, renaming, etc.)