A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 05:45 UTC
[Misc] Remove outdated init protocols (#10655)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Nov 26, 2024 at 14:55 UTC
940635343a087a5fb6548449989b84de77af5e73
2 files changed
+1
-31
vllm/model_executor/models/interfaces.py
-30
@@ -10,7 +10,6 @@ from vllm.utils import supports_kw
10
from .interfaces_base import is_embedding_model
11
12
if TYPE_CHECKING:
13
- from vllm.config import LoRAConfig, MultiModalConfig, SchedulerConfig
13
from vllm.sequence import IntermediateTensors
14
15
logger = init_logger(__name__)
@@ -29,9 +28,6 @@ class SupportsMultiModal(Protocol):
28
MRO of your model class.
29
"""
30
32
- def __init__(self, *, multimodal_config: "MultiModalConfig") -> None:
33
- ...
34
-
31
32
# We can't use runtime_checkable with ClassVar for issubclass checks
33
# so we need to treat the class as an instance and use isinstance instead
@@ -39,9 +35,6 @@ class SupportsMultiModal(Protocol):
35
class _SupportsMultiModalType(Protocol):
36
supports_multimodal: Literal[True]
37
42
- def __call__(self, *, multimodal_config: "MultiModalConfig") -> None:
43
- ...
44
-
38
39
@overload
40
def supports_multimodal(
@@ -81,10 +74,6 @@ class SupportsLoRA(Protocol):
74
embedding_modules: ClassVar[Dict[str, str]]
75
embedding_padding_modules: ClassVar[List[str]]
76
84
- # lora_config is None when LoRA is not enabled
85
- def __init__(self, *, lora_config: Optional["LoRAConfig"] = None) -> None:
86
- ...
87
-
77
78
# We can't use runtime_checkable with ClassVar for issubclass checks
79
# so we need to treat the class as an instance and use isinstance instead
@@ -97,9 +86,6 @@ class _SupportsLoRAType(Protocol):
86
embedding_modules: Dict[str, str]
87
embedding_padding_modules: List[str]
88
100
- def __call__(self, *, lora_config: Optional["LoRAConfig"] = None) -> None:
101
- ...
102
-
89
90
@overload
91
def supports_lora(model: Type[object]) -> TypeIs[Type[SupportsLoRA]]:
@@ -276,21 +262,11 @@ class HasInnerState(Protocol):
262
for max_num_seqs, etc. True for e.g. both Mamba and Jamba.
263
"""
264
279
- def __init__(self,
280
- *,
281
- scheduler_config: Optional["SchedulerConfig"] = None) -> None:
282
- ...
283
-
265
266
@runtime_checkable
267
class _HasInnerStateType(Protocol):
268
has_inner_state: ClassVar[Literal[True]]
269
289
- def __init__(self,
290
- *,
291
- scheduler_config: Optional["SchedulerConfig"] = None) -> None:
292
- ...
293
-
270
271
@overload
272
def has_inner_state(model: object) -> TypeIs[HasInnerState]:
@@ -323,17 +299,11 @@ class IsAttentionFree(Protocol):
299
True for Mamba but not Jamba.
300
"""
301
326
- def __init__(self) -> None:
327
- ...
328
-
302
303
@runtime_checkable
304
class _IsAttentionFreeType(Protocol):
305
is_attention_free: ClassVar[Literal[True]]
306
334
- def __init__(self) -> None:
335
- ...
336
-
307
308
@overload
309
def is_attention_free(model: object) -> TypeIs[IsAttentionFree]:
vllm/model_executor/models/interfaces_base.py
+1
-1
@@ -71,7 +71,7 @@ def _check_vllm_model_forward(model: Union[Type[object], object]) -> bool:
71
and issubclass(model, nn.Module)):
72
logger.warning(
73
"The model (%s) is missing "
74
- "vLLM-specific keywords from its initializer: %s",
74
+ "vLLM-specific keywords from its `forward` method: %s",
75
model,
76
missing_kws,
77
)