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
70ad3f9e
Unverified
Commit
70ad3f9e
authored
Apr 04, 2025
by
Michael Goin
Committed by
GitHub
Apr 04, 2025
Browse files
[Bugfix][TPU] Fix V1 TPU worker for sliding window (#16059)
Signed-off-by:
Michael Goin
<
mgoin64@gmail.com
>
parent
d6fc629f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
vllm/v1/worker/tpu_worker.py
vllm/v1/worker/tpu_worker.py
+4
-3
No files found.
vllm/v1/worker/tpu_worker.py
View file @
70ad3f9e
...
...
@@ -18,7 +18,7 @@ from vllm.logger import init_logger
from
vllm.model_executor
import
set_random_seed
from
vllm.utils
import
STR_DTYPE_TO_TORCH_DTYPE
from
vllm.v1.core.sched.output
import
SchedulerOutput
from
vllm.v1.kv_cache_interface
import
(
Full
AttentionSpec
,
KVCacheConfig
,
from
vllm.v1.kv_cache_interface
import
(
AttentionSpec
,
KVCacheConfig
,
KVCacheSpec
)
from
vllm.v1.outputs
import
ModelRunnerOutput
from
vllm.v1.utils
import
bind_kv_cache
...
...
@@ -137,7 +137,7 @@ class TPUWorker:
kv_caches
:
dict
[
str
,
torch
.
Tensor
]
=
{}
kv_cache_spec
=
self
.
model_runner
.
get_kv_cache_spec
()
for
layer_name
,
layer_spec
in
kv_cache_spec
.
items
():
if
isinstance
(
layer_spec
,
Full
AttentionSpec
):
if
isinstance
(
layer_spec
,
AttentionSpec
):
dtype
=
layer_spec
.
dtype
# Use an empty tensor instead of `None`` to force Dynamo to pass
...
...
@@ -147,7 +147,8 @@ class TPUWorker:
device
=
self
.
device
)
kv_caches
[
layer_name
]
=
tpu_kv_cache
else
:
raise
NotImplementedError
raise
NotImplementedError
(
f
"Unsupported KV cache spec '
{
type
(
layer_spec
)
}
'"
)
runner_kv_caches
:
list
[
torch
.
Tensor
]
=
[]
bind_kv_cache
(
...
...
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