vllm.lora.layers.base ¶
Classes:
BaseLayerWithLoRA ¶
Bases: Module
Methods:
-
can_replace_layer–Returns True if the layer can be replaced by this LoRA layer.
-
create_lora_weights–Initializes lora matrices.
-
load_weights–Load checkpoint weights into the wrapped base layer.
-
reset_lora–Resets the lora weights at index back to 0.
-
set_lora–Overwrites lora tensors at index.
-
slice_lora_a–Slice lora a if splitting for tensor parallelism.
-
slice_lora_b–Slice lora b if splitting with tensor parallelism.
Source code in vllm/lora/layers/base.py
can_replace_layer(source_layer, lora_config, packed_modules_list, model_config=None) classmethod ¶
Returns True if the layer can be replaced by this LoRA layer.
Source code in vllm/lora/layers/base.py
create_lora_weights(max_loras, lora_config, model_config=None) ¶
load_weights(weights) ¶
Load checkpoint weights into the wrapped base layer.