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 14, 05:30 UTC
[Chore] Rename `utils` submodules (#26920)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Oct 16, 2025 at 11:58 UTC
f6cdc9a02fcb15eee6c7511eef657bc118c2db90
24 files changed
+28
-24
tests/lora/test_add_lora.py
+1
-1
@@ -12,7 +12,7 @@ from vllm.entrypoints.openai.api_server import (
12
from vllm.inputs import TextPrompt
13
from vllm.lora.request import LoRARequest
14
from vllm.sampling_params import SamplingParams
15
-from vllm.utils.async_utils import merge_async_iterators
15
+from vllm.utils.asyncio import merge_async_iterators
16
17
MODEL_PATH = "zai-org/chatglm3-6b"
18
LORA_RANK = 64
tests/models/multimodal/generation/test_common.py
+1
-1
@@ -17,7 +17,7 @@ from transformers import (
17
)
18
19
from vllm.platforms import current_platform
20
-from vllm.utils.func import identity
20
+from vllm.utils.functools import identity
21
22
from ....conftest import (
23
IMAGE_ASSETS,
tests/utils_/test_async_utils.py
+1
-1
@@ -5,7 +5,7 @@ from collections.abc import AsyncIterator
5
6
import pytest
7
8
-from vllm.utils.async_utils import merge_async_iterators
8
+from vllm.utils.asyncio import merge_async_iterators
9
10
11
async def _mock_async_iterator(idx: int):
tests/utils_/test_func_utils.py
+1
-1
@@ -4,7 +4,7 @@
4
5
import pytest
6
7
-from vllm.utils.func import deprecate_kwargs, supports_kw
7
+from vllm.utils.functools import deprecate_kwargs, supports_kw
8
9
from ..utils import error_on_warning
10
vllm/benchmarks/throughput.py
+1
-1
@@ -34,7 +34,7 @@ from vllm.inputs import TextPrompt, TokensPrompt
34
from vllm.lora.request import LoRARequest
35
from vllm.outputs import RequestOutput
36
from vllm.sampling_params import BeamSearchParams
37
-from vllm.utils.async_utils import merge_async_iterators
37
+from vllm.utils.asyncio import merge_async_iterators
38
39
40
def run_vllm(
vllm/entrypoints/chat_utils.py
+1
-1
@@ -51,7 +51,7 @@ from vllm.transformers_utils.chat_templates import get_chat_template_fallback_pa
51
from vllm.transformers_utils.processor import cached_get_processor
52
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
53
from vllm.utils import random_uuid
54
-from vllm.utils.func import supports_kw
54
+from vllm.utils.functools import supports_kw
55
56
logger = init_logger(__name__)
57
vllm/entrypoints/openai/serving_completion.py
+1
-1
@@ -35,7 +35,7 @@ from vllm.outputs import RequestOutput
35
from vllm.sampling_params import BeamSearchParams, SamplingParams
36
from vllm.transformers_utils.tokenizer import AnyTokenizer
37
from vllm.utils import as_list
38
-from vllm.utils.async_utils import merge_async_iterators
38
+from vllm.utils.asyncio import merge_async_iterators
39
40
logger = init_logger(__name__)
41
vllm/entrypoints/openai/serving_embedding.py
+1
-1
@@ -40,7 +40,7 @@ from vllm.outputs import (
40
)
41
from vllm.pooling_params import PoolingParams
42
from vllm.utils import chunk_list
43
-from vllm.utils.async_utils import merge_async_iterators
43
+from vllm.utils.asyncio import merge_async_iterators
44
45
logger = init_logger(__name__)
46
vllm/entrypoints/openai/serving_engine.py
+1
-1
@@ -91,7 +91,7 @@ from vllm.tracing import (
91
)
92
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
93
from vllm.utils import is_list_of, random_uuid
94
-from vllm.utils.async_utils import (
94
+from vllm.utils.asyncio import (
95
AsyncMicrobatchTokenizer,
96
collect_from_async_generator,
97
make_async,
vllm/entrypoints/openai/serving_pooling.py
+1
-1
@@ -36,7 +36,7 @@ from vllm.entrypoints.utils import _validate_truncation_size
36
from vllm.logger import init_logger
37
from vllm.outputs import PoolingOutput, PoolingRequestOutput
38
from vllm.tasks import SupportedTask
39
-from vllm.utils.async_utils import merge_async_iterators
39
+from vllm.utils.asyncio import merge_async_iterators
40
41
logger = init_logger(__name__)
42
vllm/entrypoints/openai/serving_score.py
+1
-1
@@ -37,7 +37,7 @@ from vllm.logger import init_logger
37
from vllm.lora.request import LoRARequest
38
from vllm.outputs import PoolingRequestOutput, ScoringRequestOutput
39
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
40
-from vllm.utils.async_utils import make_async, merge_async_iterators
40
+from vllm.utils.asyncio import make_async, merge_async_iterators
41
42
logger = init_logger(__name__)
43
vllm/entrypoints/renderer.py
+1
-1
@@ -17,7 +17,7 @@ from vllm.inputs.data import TextPrompt as EngineTextPrompt
17
from vllm.inputs.data import TokensPrompt as EngineTokensPrompt
18
from vllm.inputs.parse import get_prompt_components, parse_raw_prompts
19
from vllm.transformers_utils.tokenizer import AnyTokenizer
20
-from vllm.utils.async_utils import AsyncMicrobatchTokenizer
20
+from vllm.utils.asyncio import AsyncMicrobatchTokenizer
21
22
23
@dataclass(frozen=True)
vllm/executor/executor_base.py
+1
-1
@@ -17,7 +17,7 @@ from vllm.logger import init_logger
17
from vllm.lora.request import LoRARequest
18
from vllm.sequence import ExecuteModelRequest
19
from vllm.tasks import SupportedTask
20
-from vllm.utils.async_utils import make_async
20
+from vllm.utils.asyncio import make_async
21
from vllm.v1.outputs import SamplerOutput
22
from vllm.v1.worker.worker_base import WorkerBase
23
vllm/executor/ray_distributed_executor.py
+1
-1
@@ -24,7 +24,7 @@ from vllm.utils import (
24
get_ip,
25
get_open_port,
26
)
27
-from vllm.utils.async_utils import make_async
27
+from vllm.utils.asyncio import make_async
28
from vllm.v1.outputs import SamplerOutput
29
30
if ray is not None:
vllm/model_executor/layers/fused_moe/deep_gemm_moe.py
+1
-1
@@ -29,7 +29,7 @@ from vllm.model_executor.layers.quantization.utils.fp8_utils import (
29
)
30
from vllm.utils import has_deep_gemm
31
from vllm.utils.deep_gemm import m_grouped_fp8_gemm_nt_contiguous
32
-from vllm.utils.func import run_once
32
+from vllm.utils.functools import run_once
33
34
logger = init_logger(__name__)
35
vllm/model_executor/models/interfaces.py
+1
-1
@@ -24,7 +24,7 @@ from vllm.inputs import TokensPrompt
24
from vllm.inputs.data import PromptType
25
from vllm.logger import init_logger
26
from vllm.model_executor.layers.quantization import QuantizationConfig
27
-from vllm.utils.func import supports_kw
27
+from vllm.utils.functools import supports_kw
28
29
from .interfaces_base import VllmModel, is_pooling_model
30
vllm/model_executor/models/interfaces_base.py
+1
-1
@@ -15,7 +15,7 @@ import torch.nn as nn
15
from typing_extensions import TypeIs, TypeVar
16
17
from vllm.logger import init_logger
18
-from vllm.utils.func import supports_kw
18
+from vllm.utils.functools import supports_kw
19
20
if TYPE_CHECKING:
21
from vllm.config import VllmConfig
vllm/multimodal/processing.py
+1
-1
@@ -26,7 +26,7 @@ from vllm.logger import init_logger
26
from vllm.transformers_utils.processor import cached_processor_from_config
27
from vllm.transformers_utils.tokenizer import AnyTokenizer, decode_tokens, encode_tokens
28
from vllm.utils import flatten_2d_lists, full_groupby
29
-from vllm.utils.func import get_allowed_kwarg_only_overrides
29
+from vllm.utils.functools import get_allowed_kwarg_only_overrides
30
from vllm.utils.jsontree import JSONTree, json_map_leaves
31
32
from .hasher import MultiModalHasher
vllm/tracing.py
+1
-1
@@ -5,7 +5,7 @@ import os
5
from collections.abc import Mapping
6
7
from vllm.logger import init_logger
8
-from vllm.utils.func import run_once
8
+from vllm.utils.functools import run_once
9
10
TRACE_HEADERS = ["traceparent", "tracestate"]
11
vllm/transformers_utils/processor.py
+1
-1
@@ -16,7 +16,7 @@ from transformers.processing_utils import ProcessorMixin
16
from transformers.video_processing_utils import BaseVideoProcessor
17
from typing_extensions import TypeVar
18
19
-from vllm.utils.func import get_allowed_kwarg_only_overrides
19
+from vllm.utils.functools import get_allowed_kwarg_only_overrides
20
21
if TYPE_CHECKING:
22
from vllm.config import ModelConfig
vllm/utils/asyncio.py
renamed
+5
-1
@@ -1,6 +1,10 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-"""Contains helpers related to asynchronous code."""
3
+"""
4
+Contains helpers related to asynchronous code.
5
+
6
+This is similar in concept to the `asyncio` module.
7
+"""
8
9
import asyncio
10
import contextlib
vllm/utils/functools.py
renamed
vllm/v1/engine/async_llm.py
+2
-2
@@ -30,8 +30,8 @@ from vllm.transformers_utils.config import maybe_register_config_serialize_by_va
30
from vllm.transformers_utils.tokenizer import AnyTokenizer, init_tokenizer_from_configs
31
from vllm.usage.usage_lib import UsageContext
32
from vllm.utils import Device, as_list, cdiv
33
-from vllm.utils.async_utils import cancel_task_threadsafe
34
-from vllm.utils.func import deprecate_kwargs
33
+from vllm.utils.asyncio import cancel_task_threadsafe
34
+from vllm.utils.functools import deprecate_kwargs
35
from vllm.v1.engine import EngineCoreRequest
36
from vllm.v1.engine.core_client import EngineCoreClient
37
from vllm.v1.engine.exceptions import EngineDeadError, EngineGenerateError
vllm/v1/engine/core_client.py
+1
-1
@@ -29,7 +29,7 @@ from vllm.utils import (
29
get_open_zmq_inproc_path,
30
make_zmq_socket,
31
)
32
-from vllm.utils.async_utils import in_loop
32
+from vllm.utils.asyncio import in_loop
33
from vllm.v1.engine import (
34
EngineCoreOutputs,
35
EngineCoreRequest,