Skip to content

Commit

Permalink
[Misc] Remove deprecated names (vllm-project#10817)
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <[email protected]>
  • Loading branch information
DarkLight1337 authored and BKitor committed Dec 30, 2024
1 parent a4995a1 commit 2500810
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 102 deletions.
8 changes: 6 additions & 2 deletions vllm/engine/async_llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
List, Mapping, Optional, Set, Tuple, Type, Union, overload)
from weakref import ReferenceType

from typing_extensions import deprecated

import vllm.envs as envs
from vllm.config import (DecodingConfig, LoRAConfig, ModelConfig,
ParallelConfig, SchedulerConfig, VllmConfig)
Expand Down Expand Up @@ -422,7 +424,8 @@ async def get_tokenizer_async(self,
return await (
self.get_tokenizer_group().get_lora_tokenizer_async(lora_request))

@overload # DEPRECATED
@overload
@deprecated("'inputs' will be renamed to 'prompt")
async def add_request_async(
self,
request_id: str,
Expand Down Expand Up @@ -894,7 +897,8 @@ async def run_engine_loop(engine_ref: ReferenceType):

# This method does not need to be async, but kept that way
# for backwards compatibility.
@overload # DEPRECATED
@overload
@deprecated("'inputs' will be renamed to 'prompt")
def add_request(
self,
request_id: str,
Expand Down
5 changes: 3 additions & 2 deletions vllm/engine/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Set, Type, Union, cast, overload

import torch
from typing_extensions import TypeVar
from typing_extensions import TypeVar, deprecated

import vllm.envs as envs
from vllm.config import (DecodingConfig, LoRAConfig, ModelConfig,
Expand Down Expand Up @@ -719,7 +719,8 @@ def _add_processed_request(
def stop_remote_worker_execution_loop(self) -> None:
self.model_executor.stop_remote_worker_execution_loop()

@overload # DEPRECATED
@overload
@deprecated("'inputs' will be renamed to 'prompt")
def add_request(
self,
request_id: str,
Expand Down
5 changes: 4 additions & 1 deletion vllm/engine/multiprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from enum import Enum
from typing import List, Mapping, Optional, Union, overload

from typing_extensions import deprecated

from vllm import PoolingParams
from vllm.inputs import PromptType
from vllm.lora.request import LoRARequest
Expand Down Expand Up @@ -32,7 +34,8 @@ class RPCProcessRequest:
prompt_adapter_request: Optional[PromptAdapterRequest] = None
priority: int = 0

@overload # DEPRECATED
@overload
@deprecated("'inputs' will be renamed to 'prompt")
def __init__(
self,
*,
Expand Down
7 changes: 5 additions & 2 deletions vllm/engine/multiprocessing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import psutil
import zmq
import zmq.asyncio
from typing_extensions import deprecated
from zmq import Frame # type: ignore[attr-defined]
from zmq.asyncio import Socket

Expand Down Expand Up @@ -414,7 +415,8 @@ def errored(self) -> bool:
def dead_error(self) -> BaseException:
return ENGINE_DEAD_ERROR(self._errored_with)

@overload # DEPRECATED
@overload
@deprecated("'inputs' will be renamed to 'prompt")
def generate(
self,
*,
Expand Down Expand Up @@ -485,7 +487,8 @@ def generate(
lora_request, trace_headers,
prompt_adapter_request, priority)

@overload # DEPRECATED
@overload
@deprecated("'inputs' will be renamed to 'prompt")
def encode(
self,
*,
Expand Down
11 changes: 11 additions & 0 deletions vllm/entrypoints/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Union, cast, overload)

from tqdm import tqdm
from typing_extensions import deprecated

from vllm import envs
from vllm.beam_search import (BeamSearchInstance, BeamSearchOutput,
Expand Down Expand Up @@ -256,6 +257,7 @@ def set_tokenizer(self, tokenizer: AnyTokenizer) -> None:
tokenizer_group.tokenizer = get_cached_tokenizer(tokenizer)

@overload # LEGACY: single (prompt + optional token ids)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def generate(
self,
prompts: str,
Expand All @@ -268,6 +270,7 @@ def generate(
...

@overload # LEGACY: multi (prompt + optional token ids)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def generate(
self,
prompts: List[str],
Expand All @@ -280,6 +283,7 @@ def generate(
...

@overload # LEGACY: single (token ids + optional prompt)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def generate(
self,
prompts: Optional[str] = None,
Expand All @@ -293,6 +297,7 @@ def generate(
...

@overload # LEGACY: multi (token ids + optional prompt)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def generate(
self,
prompts: Optional[List[str]] = None,
Expand All @@ -306,6 +311,7 @@ def generate(
...

@overload # LEGACY: single or multi token ids [pos-only]
@deprecated("'prompt_token_ids' will become part of 'prompts")
def generate(
self,
prompts: None,
Expand Down Expand Up @@ -671,6 +677,7 @@ def chat(
)

@overload # LEGACY: single (prompt + optional token ids)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def encode(
self,
prompts: str,
Expand All @@ -683,6 +690,7 @@ def encode(
...

@overload # LEGACY: multi (prompt + optional token ids)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def encode(
self,
prompts: List[str],
Expand All @@ -695,6 +703,7 @@ def encode(
...

@overload # LEGACY: single (token ids + optional prompt)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def encode(
self,
prompts: Optional[str] = None,
Expand All @@ -708,6 +717,7 @@ def encode(
...

@overload # LEGACY: multi (token ids + optional prompt)
@deprecated("'prompt_token_ids' will become part of 'prompts")
def encode(
self,
prompts: Optional[List[str]] = None,
Expand All @@ -721,6 +731,7 @@ def encode(
...

@overload # LEGACY: single or multi token ids [pos-only]
@deprecated("'prompt_token_ids' will become part of 'prompts")
def encode(
self,
prompts: None,
Expand Down
31 changes: 0 additions & 31 deletions vllm/inputs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,3 @@
"InputProcessingContext",
"InputRegistry",
]


def __getattr__(name: str):
import warnings

if name == "PromptInput":
msg = ("PromptInput has been renamed to PromptType. "
"The original name will be removed in an upcoming version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return PromptType

if name == "LLMInputs":
msg = ("LLMInputs has been renamed to DecoderOnlyInputs. "
"The original name will be removed in an upcoming version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return DecoderOnlyInputs

if name == "EncoderDecoderLLMInputs":
msg = (
"EncoderDecoderLLMInputs has been renamed to EncoderDecoderInputs. "
"The original name will be removed in an upcoming version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return EncoderDecoderInputs

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
31 changes: 0 additions & 31 deletions vllm/inputs/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,34 +358,3 @@ def to_enc_dec_tuple_list(
return [(enc_dec_prompt["encoder_prompt"],
enc_dec_prompt["decoder_prompt"])
for enc_dec_prompt in enc_dec_prompts]


def __getattr__(name: str):
import warnings

if name == "PromptInput":
msg = ("PromptInput has been renamed to PromptType. "
"The original name will be removed in an upcoming version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return PromptType

if name == "LLMInputs":
msg = ("LLMInputs has been renamed to DecoderOnlyInputs. "
"The original name will be removed in an upcoming version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return DecoderOnlyInputs

if name == "EncoderDecoderLLMInputs":
msg = (
"EncoderDecoderLLMInputs has been renamed to EncoderDecoderInputs. "
"The original name will be removed in an upcoming version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return EncoderDecoderInputs

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
5 changes: 2 additions & 3 deletions vllm/model_executor/models/aria.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
maybe_prefix,
merge_multimodal_embeddings)
from vllm.multimodal import MULTIMODAL_REGISTRY
from vllm.multimodal.base import MultiModalInputs
from vllm.multimodal.image import cached_get_image_processor
from vllm.multimodal.inputs import NestedTensors
from vllm.multimodal.inputs import MultiModalKwargs, NestedTensors
from vllm.multimodal.utils import (cached_get_tokenizer,
repeat_and_pad_placeholder_tokens)
from vllm.sequence import IntermediateTensors
Expand Down Expand Up @@ -451,7 +450,7 @@ def get_max_multimodal_tokens(ctx):


def input_mapper_for_aria(ctx, data):
return MultiModalInputs(data)
return MultiModalKwargs(data)


def input_processor(ctx, llm_inputs):
Expand Down
15 changes: 0 additions & 15 deletions vllm/multimodal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,3 @@
"MULTIMODAL_REGISTRY",
"MultiModalRegistry",
]


def __getattr__(name: str):
import warnings

if name == "MultiModalInputs":
msg = ("MultiModalInputs has been renamed to MultiModalKwargs. "
"The original name will take another meaning in an upcoming "
"version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return MultiModalKwargs

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
15 changes: 0 additions & 15 deletions vllm/multimodal/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,18 +433,3 @@ def index_map(self) -> "IndexMap":

return MultiModalPlaceholderMap.IndexMap(src=src_indices,
dest=dest_indices)


def __getattr__(name: str):
import warnings

if name == "MultiModalInputs":
msg = ("MultiModalInputs has been renamed to MultiModalKwargs. "
"The original name will take another meaning in an upcoming "
"version.")

warnings.warn(DeprecationWarning(msg), stacklevel=2)

return MultiModalKwargs

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

0 comments on commit 2500810

Please sign in to comment.