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 deprecated names (#10817)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Dec 3, 2024 at 14:52 UTC
3257d449fa0fd3e05aa20cc8c5fff79ad101984f
10 files changed
+31
-102
vllm/engine/async_llm_engine.py
+6
-2
@@ -6,6 +6,8 @@ from typing import (Any, AsyncGenerator, Callable, Coroutine, Dict, Iterable,
6
List, Mapping, Optional, Set, Tuple, Type, Union, overload)
7
from weakref import ReferenceType
8
9
+from typing_extensions import deprecated
10
+
11
import vllm.envs as envs
12
from vllm.config import (DecodingConfig, LoRAConfig, ModelConfig,
13
ParallelConfig, SchedulerConfig, VllmConfig)
@@ -422,7 +424,8 @@ class _AsyncLLMEngine(LLMEngine):
424
return await (
425
self.get_tokenizer_group().get_lora_tokenizer_async(lora_request))
426
425
- @overload # DEPRECATED
427
+ @overload
428
+ @deprecated("'inputs' will be renamed to 'prompt")
429
async def add_request_async(
430
self,
431
request_id: str,
@@ -894,7 +897,8 @@ class AsyncLLMEngine(EngineClient):
897
898
# This method does not need to be async, but kept that way
899
# for backwards compatibility.
897
- @overload # DEPRECATED
900
+ @overload
901
+ @deprecated("'inputs' will be renamed to 'prompt")
902
def add_request(
903
self,
904
request_id: str,
vllm/engine/llm_engine.py
+3
-2
@@ -10,7 +10,7 @@ from typing import Sequence as GenericSequence
10
from typing import Set, Type, Union, cast, overload
11
12
import torch
13
-from typing_extensions import TypeVar
13
+from typing_extensions import TypeVar, deprecated
14
15
import vllm.envs as envs
16
from vllm.config import (DecodingConfig, LoRAConfig, ModelConfig,
@@ -719,7 +719,8 @@ class LLMEngine:
719
def stop_remote_worker_execution_loop(self) -> None:
720
self.model_executor.stop_remote_worker_execution_loop()
721
722
- @overload # DEPRECATED
722
+ @overload
723
+ @deprecated("'inputs' will be renamed to 'prompt")
724
def add_request(
725
self,
726
request_id: str,
vllm/engine/multiprocessing/__init__.py
+4
-1
@@ -2,6 +2,8 @@ from dataclasses import dataclass
2
from enum import Enum
3
from typing import List, Mapping, Optional, Union, overload
4
5
+from typing_extensions import deprecated
6
+
7
from vllm import PoolingParams
8
from vllm.inputs import PromptType
9
from vllm.lora.request import LoRARequest
@@ -32,7 +34,8 @@ class RPCProcessRequest:
34
prompt_adapter_request: Optional[PromptAdapterRequest] = None
35
priority: int = 0
36
35
- @overload # DEPRECATED
37
+ @overload
38
+ @deprecated("'inputs' will be renamed to 'prompt")
39
def __init__(
40
self,
41
*,
vllm/engine/multiprocessing/client.py
+5
-2
@@ -9,6 +9,7 @@ import cloudpickle
9
import psutil
10
import zmq
11
import zmq.asyncio
12
+from typing_extensions import deprecated
13
from zmq import Frame # type: ignore[attr-defined]
14
from zmq.asyncio import Socket
15
@@ -414,7 +415,8 @@ class MQLLMEngineClient(EngineClient):
415
def dead_error(self) -> BaseException:
416
return ENGINE_DEAD_ERROR(self._errored_with)
417
417
- @overload # DEPRECATED
418
+ @overload
419
+ @deprecated("'inputs' will be renamed to 'prompt")
420
def generate(
421
self,
422
*,
@@ -485,7 +487,8 @@ class MQLLMEngineClient(EngineClient):
487
lora_request, trace_headers,
488
prompt_adapter_request, priority)
489
488
- @overload # DEPRECATED
490
+ @overload
491
+ @deprecated("'inputs' will be renamed to 'prompt")
492
def encode(
493
self,
494
*,
vllm/entrypoints/llm.py
+11
@@ -6,6 +6,7 @@ from typing import (Any, ClassVar, Dict, List, Optional, Sequence, Tuple, Type,
6
Union, cast, overload)
7
8
from tqdm import tqdm
9
+from typing_extensions import deprecated
10
11
from vllm import envs
12
from vllm.beam_search import (BeamSearchInstance, BeamSearchOutput,
@@ -256,6 +257,7 @@ class LLM:
257
tokenizer_group.tokenizer = get_cached_tokenizer(tokenizer)
258
259
@overload # LEGACY: single (prompt + optional token ids)
260
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
261
def generate(
262
self,
263
prompts: str,
@@ -268,6 +270,7 @@ class LLM:
270
...
271
272
@overload # LEGACY: multi (prompt + optional token ids)
273
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
274
def generate(
275
self,
276
prompts: List[str],
@@ -280,6 +283,7 @@ class LLM:
283
...
284
285
@overload # LEGACY: single (token ids + optional prompt)
286
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
287
def generate(
288
self,
289
prompts: Optional[str] = None,
@@ -293,6 +297,7 @@ class LLM:
297
...
298
299
@overload # LEGACY: multi (token ids + optional prompt)
300
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
301
def generate(
302
self,
303
prompts: Optional[List[str]] = None,
@@ -306,6 +311,7 @@ class LLM:
311
...
312
313
@overload # LEGACY: single or multi token ids [pos-only]
314
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
315
def generate(
316
self,
317
prompts: None,
@@ -671,6 +677,7 @@ class LLM:
677
)
678
679
@overload # LEGACY: single (prompt + optional token ids)
680
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
681
def encode(
682
self,
683
prompts: str,
@@ -683,6 +690,7 @@ class LLM:
690
...
691
692
@overload # LEGACY: multi (prompt + optional token ids)
693
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
694
def encode(
695
self,
696
prompts: List[str],
@@ -695,6 +703,7 @@ class LLM:
703
...
704
705
@overload # LEGACY: single (token ids + optional prompt)
706
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
707
def encode(
708
self,
709
prompts: Optional[str] = None,
@@ -708,6 +717,7 @@ class LLM:
717
...
718
719
@overload # LEGACY: multi (token ids + optional prompt)
720
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
721
def encode(
722
self,
723
prompts: Optional[List[str]] = None,
@@ -721,6 +731,7 @@ class LLM:
731
...
732
733
@overload # LEGACY: single or multi token ids [pos-only]
734
+ @deprecated("'prompt_token_ids' will become part of 'prompts")
735
def encode(
736
self,
737
prompts: None,
vllm/inputs/__init__.py
-31
@@ -38,34 +38,3 @@ __all__ = [
38
"InputProcessingContext",
39
"InputRegistry",
40
]
41
-
42
-
43
-def __getattr__(name: str):
44
- import warnings
45
-
46
- if name == "PromptInput":
47
- msg = ("PromptInput has been renamed to PromptType. "
48
- "The original name will be removed in an upcoming version.")
49
-
50
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
51
-
52
- return PromptType
53
-
54
- if name == "LLMInputs":
55
- msg = ("LLMInputs has been renamed to DecoderOnlyInputs. "
56
- "The original name will be removed in an upcoming version.")
57
-
58
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
59
-
60
- return DecoderOnlyInputs
61
-
62
- if name == "EncoderDecoderLLMInputs":
63
- msg = (
64
- "EncoderDecoderLLMInputs has been renamed to EncoderDecoderInputs. "
65
- "The original name will be removed in an upcoming version.")
66
-
67
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
68
-
69
- return EncoderDecoderInputs
70
-
71
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
vllm/inputs/data.py
-31
@@ -358,34 +358,3 @@ def to_enc_dec_tuple_list(
358
return [(enc_dec_prompt["encoder_prompt"],
359
enc_dec_prompt["decoder_prompt"])
360
for enc_dec_prompt in enc_dec_prompts]
361
-
362
-
363
-def __getattr__(name: str):
364
- import warnings
365
-
366
- if name == "PromptInput":
367
- msg = ("PromptInput has been renamed to PromptType. "
368
- "The original name will be removed in an upcoming version.")
369
-
370
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
371
-
372
- return PromptType
373
-
374
- if name == "LLMInputs":
375
- msg = ("LLMInputs has been renamed to DecoderOnlyInputs. "
376
- "The original name will be removed in an upcoming version.")
377
-
378
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
379
-
380
- return DecoderOnlyInputs
381
-
382
- if name == "EncoderDecoderLLMInputs":
383
- msg = (
384
- "EncoderDecoderLLMInputs has been renamed to EncoderDecoderInputs. "
385
- "The original name will be removed in an upcoming version.")
386
-
387
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
388
-
389
- return EncoderDecoderInputs
390
-
391
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
vllm/model_executor/models/aria.py
+2
-3
@@ -32,9 +32,8 @@ from vllm.model_executor.models.utils import (AutoWeightsLoader, WeightsMapper,
32
maybe_prefix,
33
merge_multimodal_embeddings)
34
from vllm.multimodal import MULTIMODAL_REGISTRY
35
-from vllm.multimodal.base import MultiModalInputs
35
from vllm.multimodal.image import cached_get_image_processor
37
-from vllm.multimodal.inputs import NestedTensors
36
+from vllm.multimodal.inputs import MultiModalKwargs, NestedTensors
37
from vllm.multimodal.utils import (cached_get_tokenizer,
38
repeat_and_pad_placeholder_tokens)
39
from vllm.sequence import IntermediateTensors
@@ -451,7 +450,7 @@ def get_max_multimodal_tokens(ctx):
450
451
452
def input_mapper_for_aria(ctx, data):
454
- return MultiModalInputs(data)
453
+ return MultiModalKwargs(data)
454
455
456
def input_processor(ctx, llm_inputs):
vllm/multimodal/__init__.py
-15
@@ -27,18 +27,3 @@ __all__ = [
27
"MULTIMODAL_REGISTRY",
28
"MultiModalRegistry",
29
]
30
-
31
-
32
-def __getattr__(name: str):
33
- import warnings
34
-
35
- if name == "MultiModalInputs":
36
- msg = ("MultiModalInputs has been renamed to MultiModalKwargs. "
37
- "The original name will take another meaning in an upcoming "
38
- "version.")
39
-
40
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
41
-
42
- return MultiModalKwargs
43
-
44
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
vllm/multimodal/base.py
-15
@@ -433,18 +433,3 @@ class MultiModalPlaceholderMap:
433
434
return MultiModalPlaceholderMap.IndexMap(src=src_indices,
435
dest=dest_indices)
436
-
437
-
438
-def __getattr__(name: str):
439
- import warnings
440
-
441
- if name == "MultiModalInputs":
442
- msg = ("MultiModalInputs has been renamed to MultiModalKwargs. "
443
- "The original name will take another meaning in an upcoming "
444
- "version.")
445
-
446
- warnings.warn(DeprecationWarning(msg), stacklevel=2)
447
-
448
- return MultiModalKwargs
449
-
450
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")