Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ line-length = 80
"vllm/spec_decode/**/*.py" = ["UP006", "UP035"]
"vllm/worker/**/*.py" = ["UP006", "UP035"]
# Python 3.8 typing - skip utils for ROCm
"vllm/utils.py" = ["UP006", "UP035"]
"vllm/utils/__init__.py" = ["UP006", "UP035"]

[tool.ruff.lint]
select = [
Expand Down
2 changes: 1 addition & 1 deletion tests/build_cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
infiles += [
"vllm/model_executor/layers/sampler.py",
"vllm/sampling_params.py",
"vllm/utils.py",
"vllm/utils/__init__.py",
]

setup(ext_modules=cythonize(infiles,
Expand Down
3 changes: 1 addition & 2 deletions tools/check_pickle_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# add to this list if absolutely necessary and after careful security review.
ALLOWED_FILES = set([
# pickle
'vllm/utils.py',
'vllm/v1/serial_utils.py',
'vllm/v1/executor/multiproc_executor.py',
'vllm/multimodal/hasher.py',
Expand Down Expand Up @@ -54,7 +53,7 @@
'vllm/entrypoints/llm.py',
'tests/utils.py',
# pickle and cloudpickle
'vllm/utils.py',
'vllm/utils/__init__.py',
'vllm/v1/serial_utils.py',
'vllm/v1/executor/multiproc_executor.py',
'vllm/transformers_utils/config.py',
Expand Down
14 changes: 7 additions & 7 deletions vllm/utils.py → vllm/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
from asyncio import FIRST_COMPLETED, AbstractEventLoop, Task
from collections import UserDict, defaultdict
from collections.abc import (AsyncGenerator, Awaitable, Collection, Generator,
Hashable, Iterable, Iterator, KeysView, Mapping)
Hashable, Iterable, Iterator, KeysView, Mapping,
Sequence)
from concurrent.futures.process import ProcessPoolExecutor
from dataclasses import dataclass, field
from functools import cache, lru_cache, partial, wraps
from types import MappingProxyType
from typing import (TYPE_CHECKING, Any, Callable, Generic, Literal, NamedTuple,
Optional, Sequence, Tuple, Type, TypeVar, Union, cast,
overload)
Optional, TypeVar, Union, cast, overload)
from urllib.parse import urlparse
from uuid import uuid4

Expand Down Expand Up @@ -1921,9 +1921,9 @@ def __len__(self):
return len(self._factory)


class ClassRegistry(UserDict[Type[T], _V]):
class ClassRegistry(UserDict[type[T], _V]):

def __getitem__(self, key: Type[T]) -> _V:
def __getitem__(self, key: type[T]) -> _V:
for cls in key.mro():
if cls in self.data:
return self.data[cls]
Expand Down Expand Up @@ -2234,7 +2234,7 @@ def direct_register_custom_op(
fake_impl: Optional[Callable] = None,
target_lib: Optional[Library] = None,
dispatch_key: str = "CUDA",
tags: Tuple[torch.Tag, ...] = (),
tags: tuple[torch.Tag, ...] = (),
):
"""
`torch.library.custom_op` can have significant overhead because it
Expand Down Expand Up @@ -2489,7 +2489,7 @@ def get_exception_traceback():
return err_str


def split_zmq_path(path: str) -> Tuple[str, str, str]:
def split_zmq_path(path: str) -> tuple[str, str, str]:
"""Split a zmq path into its parts."""
parsed = urlparse(path)
if not parsed.scheme:
Expand Down