Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
e81fbefe
Unverified
Commit
e81fbefe
authored
Jul 01, 2025
by
Wentao Ye
Committed by
GitHub
Jul 01, 2025
Browse files
[Refactor] Refactor import utils (#20269)
Signed-off-by:
yewentao256
<
zhyanwentao@126.com
>
parent
9290de56
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
11 deletions
+10
-11
pyproject.toml
pyproject.toml
+1
-1
tests/build_cython.py
tests/build_cython.py
+1
-1
tools/check_pickle_imports.py
tools/check_pickle_imports.py
+1
-2
vllm/utils/__init__.py
vllm/utils/__init__.py
+7
-7
No files found.
pyproject.toml
View file @
e81fbefe
...
...
@@ -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
=
[
...
...
tests/build_cython.py
View file @
e81fbefe
...
...
@@ -25,7 +25,7 @@ infiles += [
infiles
+=
[
"vllm/model_executor/layers/sampler.py"
,
"vllm/sampling_params.py"
,
"vllm/utils.py"
,
"vllm/utils
/__init__
.py"
,
]
setup
(
ext_modules
=
cythonize
(
infiles
,
...
...
tools/check_pickle_imports.py
View file @
e81fbefe
...
...
@@ -26,7 +26,6 @@ except ImportError:
# 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'
,
...
...
@@ -54,7 +53,7 @@ ALLOWED_FILES = set([
'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'
,
...
...
vllm/utils.py
→
vllm/utils
/__init__
.py
View file @
e81fbefe
...
...
@@ -39,14 +39,14 @@ from argparse import (Action, ArgumentDefaultsHelpFormatter, ArgumentParser,
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
...
...
@@ -1921,9 +1921,9 @@ class LazyDict(Mapping[str, T], Generic[T]):
return
len
(
self
.
_factory
)
class
ClassRegistry
(
UserDict
[
T
ype
[
T
],
_V
]):
class
ClassRegistry
(
UserDict
[
t
ype
[
T
],
_V
]):
def
__getitem__
(
self
,
key
:
T
ype
[
T
])
->
_V
:
def
__getitem__
(
self
,
key
:
t
ype
[
T
])
->
_V
:
for
cls
in
key
.
mro
():
if
cls
in
self
.
data
:
return
self
.
data
[
cls
]
...
...
@@ -2234,7 +2234,7 @@ def direct_register_custom_op(
fake_impl
:
Optional
[
Callable
]
=
None
,
target_lib
:
Optional
[
Library
]
=
None
,
dispatch_key
:
str
=
"CUDA"
,
tags
:
T
uple
[
torch
.
Tag
,
...]
=
(),
tags
:
t
uple
[
torch
.
Tag
,
...]
=
(),
):
"""
`torch.library.custom_op` can have significant overhead because it
...
...
@@ -2489,7 +2489,7 @@ def get_exception_traceback():
return
err_str
def
split_zmq_path
(
path
:
str
)
->
T
uple
[
str
,
str
,
str
]:
def
split_zmq_path
(
path
:
str
)
->
t
uple
[
str
,
str
,
str
]:
"""Split a zmq path into its parts."""
parsed
=
urlparse
(
path
)
if
not
parsed
.
scheme
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment