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
af35d3a3
Unverified
Commit
af35d3a3
authored
Mar 18, 2025
by
Nicolò Lucchesi
Committed by
GitHub
Mar 18, 2025
Browse files
[TPU][V1][Bugfix] Fix chunked prefill with padding (#15037)
Signed-off-by:
NickLucche
<
nlucches@redhat.com
>
parent
3b457143
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
vllm/v1/worker/tpu_model_runner.py
vllm/v1/worker/tpu_model_runner.py
+3
-0
No files found.
vllm/v1/worker/tpu_model_runner.py
View file @
af35d3a3
...
@@ -410,6 +410,9 @@ class TPUModelRunner:
...
@@ -410,6 +410,9 @@ class TPUModelRunner:
# Do the padding and copy the tensors to the TPU.
# Do the padding and copy the tensors to the TPU.
padded_total_num_scheduled_tokens
=
_get_padded_token_len
(
padded_total_num_scheduled_tokens
=
_get_padded_token_len
(
total_num_scheduled_tokens
)
total_num_scheduled_tokens
)
# Zero out to avoid spurious values from prev iteration (last cp chunk)
self
.
input_ids_cpu
[
total_num_scheduled_tokens
:
padded_total_num_scheduled_tokens
]
=
0
self
.
input_ids
=
self
.
input_ids_cpu
[:
self
.
input_ids
=
self
.
input_ids_cpu
[:
padded_total_num_scheduled_tokens
].
to
(
padded_total_num_scheduled_tokens
].
to
(
self
.
device
)
self
.
device
)
...
...
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