[LoRA] Support modules_to_save for sequence classification (#53555)

Signed-off-by: linitra24 <Joy25810@foxmail.com>
Signed-off-by: linitra24 <renshuang.zhou@daocloud.io>
Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
linitra24
2026-09-16 07:15:42 -07:00
committed by GitHub
co-authored by Jee Jee Li
parent ec4a3a5370
commit c81eb3e69c
20 changed files with 681 additions and 21 deletions
+15
View File
@@ -2,6 +2,7 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from collections.abc import Sequence as GenericSequence
from dataclasses import dataclass
import torch
import torch.types
@@ -281,3 +282,17 @@ class PackedLoRALayerWeights(LoRALayerWeights):
@property
def is_packed(self) -> bool:
return True
@dataclass
class LoRAFullModuleWeights:
"""LoRA weights for classification layers."""
module_name: str
weight: torch.Tensor
bias: torch.Tensor | None = None
def pin_memory(self) -> None:
self.weight = self.weight.pin_memory()
if self.bias is not None:
self.bias = self.bias.pin_memory()