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
37e84a40
Unverified
Commit
37e84a40
authored
Apr 16, 2024
by
SangBin Cho
Committed by
GitHub
Apr 15, 2024
Browse files
[Typing] Fix Sequence type GenericAlias only available after Python 3.9. (#4092)
parent
4695397d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
+9
-7
vllm/core/block_manager_v1.py
vllm/core/block_manager_v1.py
+3
-2
vllm/core/block_manager_v2.py
vllm/core/block_manager_v2.py
+1
-1
vllm/core/interfaces.py
vllm/core/interfaces.py
+1
-1
vllm/utils.py
vllm/utils.py
+4
-3
No files found.
vllm/core/block_manager_v1.py
View file @
37e84a40
"""A block manager that manages token blocks."""
"""A block manager that manages token blocks."""
from
abc
import
ABC
,
abstractmethod
from
abc
import
ABC
,
abstractmethod
from
collections.abc
import
Sequence
as
GenericSequence
from
itertools
import
count
,
takewhile
from
itertools
import
count
,
takewhile
from
os.path
import
commonprefix
from
os.path
import
commonprefix
from
typing
import
Dict
,
List
,
Optional
,
Set
from
typing
import
Dict
,
List
,
Optional
from
typing
import
Sequence
as
GenericSequence
from
typing
import
Set
from
vllm.block
import
BlockTable
,
PhysicalTokenBlock
from
vllm.block
import
BlockTable
,
PhysicalTokenBlock
from
vllm.core.evictor
import
EvictionPolicy
,
Evictor
,
make_evictor
from
vllm.core.evictor
import
EvictionPolicy
,
Evictor
,
make_evictor
...
...
vllm/core/block_manager_v2.py
View file @
37e84a40
"""A block manager that manages token blocks."""
"""A block manager that manages token blocks."""
from
collections.abc
import
Sequence
as
GenericSequence
from
typing
import
Dict
,
List
,
Optional
from
typing
import
Dict
,
List
,
Optional
from
typing
import
Sequence
as
GenericSequence
from
vllm.core.block.block_table
import
BlockTable
from
vllm.core.block.block_table
import
BlockTable
from
vllm.core.block.cpu_gpu_block_allocator
import
CpuGpuBlockAllocator
from
vllm.core.block.cpu_gpu_block_allocator
import
CpuGpuBlockAllocator
...
...
vllm/core/interfaces.py
View file @
37e84a40
import
enum
import
enum
from
abc
import
ABC
,
abstractmethod
from
abc
import
ABC
,
abstractmethod
from
collections.abc
import
Sequence
as
GenericSequence
from
typing
import
Dict
,
List
from
typing
import
Dict
,
List
from
typing
import
Sequence
as
GenericSequence
from
vllm.sequence
import
Sequence
,
SequenceGroup
from
vllm.sequence
import
Sequence
,
SequenceGroup
...
...
vllm/utils.py
View file @
37e84a40
...
@@ -6,11 +6,12 @@ import socket
...
@@ -6,11 +6,12 @@ import socket
import
subprocess
import
subprocess
import
uuid
import
uuid
import
warnings
import
warnings
from
collections
import
OrderedDict
,
defaultdict
from
collections
import
defaultdict
from
functools
import
lru_cache
,
partial
from
functools
import
lru_cache
,
partial
from
platform
import
uname
from
platform
import
uname
from
typing
import
(
Any
,
AsyncIterator
,
Awaitable
,
Callable
,
Dict
,
Generic
,
from
typing
import
(
Any
,
AsyncIterator
,
Awaitable
,
Callable
,
Dict
,
Generic
,
Hashable
,
List
,
Optional
,
Tuple
,
TypeVar
,
Union
)
Hashable
,
List
,
Optional
,
OrderedDict
,
Tuple
,
TypeVar
,
Union
)
import
psutil
import
psutil
import
torch
import
torch
...
@@ -51,7 +52,7 @@ class Counter:
...
@@ -51,7 +52,7 @@ class Counter:
class
LRUCache
(
Generic
[
T
]):
class
LRUCache
(
Generic
[
T
]):
def
__init__
(
self
,
capacity
:
int
):
def
__init__
(
self
,
capacity
:
int
):
self
.
cache
=
OrderedDict
[
Hashable
,
T
]()
self
.
cache
:
OrderedDict
[
Hashable
,
T
]
=
OrderedDict
()
self
.
capacity
=
capacity
self
.
capacity
=
capacity
def
__contains__
(
self
,
key
:
Hashable
)
->
bool
:
def
__contains__
(
self
,
key
:
Hashable
)
->
bool
:
...
...
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