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.)
Source code in vllm/model_executor/model_loader/reload/inplace.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |