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
46ecc579
Unverified
Commit
46ecc579
authored
Jun 06, 2025
by
Nick Hill
Committed by
GitHub
Jun 06, 2025
Browse files
[BugFix] Fix tpu_model_runner block_id concatenation (#19228)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
b6a3a9f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
tests/v1/tpu/worker/test_tpu_model_runner.py
tests/v1/tpu/worker/test_tpu_model_runner.py
+1
-1
vllm/v1/worker/gpu_model_runner.py
vllm/v1/worker/gpu_model_runner.py
+5
-2
vllm/v1/worker/tpu_model_runner.py
vllm/v1/worker/tpu_model_runner.py
+5
-1
No files found.
tests/v1/tpu/worker/test_tpu_model_runner.py
View file @
46ecc579
...
...
@@ -226,7 +226,7 @@ def test_update_states_request_resumed(model_runner):
req_id
=
req_id
,
resumed_from_preemption
=
False
,
new_token_ids
=
[],
new_block_ids
=
[],
new_block_ids
=
[
[]
],
num_computed_tokens
=
0
,
)
...
...
vllm/v1/worker/gpu_model_runner.py
View file @
46ecc579
...
...
@@ -460,8 +460,11 @@ class GPUModelRunner(LoRAModelRunnerMixin):
# Update the block IDs.
if
not
req_data
.
resumed_from_preemption
:
# Append the new blocks to the existing block IDs.
for
i
in
range
(
len
(
self
.
kv_cache_config
.
kv_cache_groups
)):
req_state
.
block_ids
[
i
].
extend
(
req_data
.
new_block_ids
[
i
])
for
block_ids
,
new_block_ids
in
zip
(
# type: ignore[call-overload]
req_state
.
block_ids
,
req_data
.
new_block_ids
,
strict
=
True
):
block_ids
.
extend
(
new_block_ids
)
else
:
# The request is resumed from preemption.
# Replace the existing block IDs with the new ones.
...
...
vllm/v1/worker/tpu_model_runner.py
View file @
46ecc579
...
...
@@ -413,7 +413,11 @@ class TPUModelRunner(LoRAModelRunnerMixin):
req_state
.
num_computed_tokens
=
req_data
.
num_computed_tokens
if
not
req_data
.
resumed_from_preemption
:
# Append the new blocks to the existing block IDs.
req_state
.
block_ids
.
extend
(
req_data
.
new_block_ids
)
for
block_ids
,
new_block_ids
in
zip
(
# type: ignore[call-overload]
req_state
.
block_ids
,
req_data
.
new_block_ids
,
strict
=
True
):
block_ids
.
extend
(
new_block_ids
)
else
:
# The request is resumed from preemption.
# Replace the existing block IDs with the new ones.
...
...
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