Skip to content

vllm.model_executor.model_loader.reload.inplace

Functions:

_get_reload_loader(model, load_config)

Reuse the loader that loaded model if it overrides reload_model, so state it keeps across sleep/wake sees the reload. Other loaders are created fresh, so per-load state (e.g. EP expert filters) cannot go stale.

get_parameter_for_reload(model, name)

Resolve checkpoint names without changing the model's module tree.

reload_weights(vllm_config, model, weights_iterator, weights_path, is_checkpoint_format)

Reload a model's weights in place from a weights iterator, or else through the model loader's reload_model.

Callers are responsible for invalidating any state derived from the old weights (e.g. LoRA, encoder and multimodal caches). Modules that implement WeightReloadValidator can reject reload before either format writes.

Parameters:

  • vllm_config

    (VllmConfig) –

    config of the model being reloaded. If weights_path is given, vllm_config.model_config is 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.)

reload_weights_from_iterator(vllm_config, model, weights_iterator, is_checkpoint_format)

Reload a model's weights in place from (name, tensor) pairs.