mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-05 12:49:09 +08:00
update
Signed-off-by: bk-201 <joy25810@foxmail.com>
This commit is contained in:
parent
0fa9111e82
commit
882213cca2
@ -336,7 +336,7 @@ class LoRAModelManager:
|
|||||||
max_num_batched_tokens: int,
|
max_num_batched_tokens: int,
|
||||||
vocab_size: int,
|
vocab_size: int,
|
||||||
lora_config: LoRAConfig,
|
lora_config: LoRAConfig,
|
||||||
model_config: Optional[ModelConfig],
|
model_config: ModelConfig | None,
|
||||||
device: torch.device,
|
device: torch.device,
|
||||||
):
|
):
|
||||||
"""Create a LoRAModelManager and adapter for a given model.
|
"""Create a LoRAModelManager and adapter for a given model.
|
||||||
@ -709,7 +709,7 @@ class LoRAModelManager:
|
|||||||
return any([module_name.startswith(prefix) for prefix in prefix_lst])
|
return any([module_name.startswith(prefix) for prefix in prefix_lst])
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _get_mm_punica_wrapper(self, module_name: str) -> Optional[PunicaWrapperBase]:
|
def _get_mm_punica_wrapper(self, module_name: str) -> PunicaWrapperBase | None:
|
||||||
"""
|
"""
|
||||||
Match the corresponding punica_wrapper based on module_name,
|
Match the corresponding punica_wrapper based on module_name,
|
||||||
and return None if lora is not supported for this module.
|
and return None if lora is not supported for this module.
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class WorkerLoRAManager:
|
|||||||
def create_lora_manager(
|
def create_lora_manager(
|
||||||
self,
|
self,
|
||||||
model: torch.nn.Module,
|
model: torch.nn.Module,
|
||||||
model_config: Optional[ModelConfig] = None,
|
model_config: ModelConfig | None = None,
|
||||||
) -> Any:
|
) -> Any:
|
||||||
lora_manager = create_lora_manager(
|
lora_manager = create_lora_manager(
|
||||||
model,
|
model,
|
||||||
@ -222,7 +222,7 @@ class LRUCacheWorkerLoRAManager(WorkerLoRAManager):
|
|||||||
def create_lora_manager(
|
def create_lora_manager(
|
||||||
self,
|
self,
|
||||||
model: torch.nn.Module,
|
model: torch.nn.Module,
|
||||||
model_config: Optional[ModelConfig] = None,
|
model_config: ModelConfig | None = None,
|
||||||
) -> Any:
|
) -> Any:
|
||||||
lora_manager = create_lora_manager(
|
lora_manager = create_lora_manager(
|
||||||
model,
|
model,
|
||||||
|
|||||||
@ -131,7 +131,10 @@ class LoRAModelRunnerMixin:
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def maybe_select_dummy_loras(
|
def maybe_select_dummy_loras(
|
||||||
self, lora_config: LoRAConfig | None, num_scheduled_tokens: np.ndarray, is_mm_input: bool = False
|
self,
|
||||||
|
lora_config: LoRAConfig | None,
|
||||||
|
num_scheduled_tokens: np.ndarray,
|
||||||
|
is_mm_input: bool = False,
|
||||||
):
|
):
|
||||||
if lora_config is None:
|
if lora_config is None:
|
||||||
yield
|
yield
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user