[Core] Optimize SPMD architecture with delta + serialization optimization (#7109)

This commit is contained in:
SangBin Cho
2024-08-18 17:57:20 -07:00
committed by GitHub
parent 200a2ffa6b
commit ff7ec82c4d
36 changed files with 722 additions and 346 deletions
+9 -5
View File
@@ -1,12 +1,15 @@
import warnings
from dataclasses import dataclass, field
from typing import Optional
import msgspec
from vllm.adapter_commons.request import AdapterRequest
@dataclass
class LoRARequest(AdapterRequest):
class LoRARequest(
msgspec.Struct,
omit_defaults=True, # type: ignore[call-arg]
array_like=True): # type: ignore[call-arg]
"""
Request for a LoRA adapter.
@@ -18,16 +21,17 @@ class LoRARequest(AdapterRequest):
lora_int_id must be globally unique for a given adapter.
This is currently not enforced in vLLM.
"""
__metaclass__ = AdapterRequest
lora_name: str
lora_int_id: int
lora_path: str = ""
lora_local_path: Optional[str] = field(default=None, repr=False)
lora_local_path: Optional[str] = msgspec.field(default=None)
long_lora_max_len: Optional[int] = None
__hash__ = AdapterRequest.__hash__
def __post_init__(self):
if 'lora_local_path' in self.__dict__:
if 'lora_local_path' in self.__struct_fields__:
warnings.warn(
"The 'lora_local_path' attribute is deprecated "
"and will be removed in a future version. "