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
bd7599d3
Unverified
Commit
bd7599d3
authored
Apr 03, 2025
by
Nicolò Lucchesi
Committed by
GitHub
Apr 03, 2025
Browse files
[V1][TPU] Do not compile sampling more than needed (#15883)
Signed-off-by:
NickLucche
<
nlucches@redhat.com
>
parent
01b61136
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
vllm/v1/worker/tpu_model_runner.py
vllm/v1/worker/tpu_model_runner.py
+3
-1
No files found.
vllm/v1/worker/tpu_model_runner.py
View file @
bd7599d3
...
...
@@ -862,7 +862,9 @@ class TPUModelRunner:
out
=
self
.
model
.
sample_from_hidden
(
dummy_hidden
,
sampling_meta
)
out
=
out
.
cpu
()
if
num_reqs_to_sample
>=
self
.
max_num_reqs
:
# Requests can't be more than tokens. But do compile for the
# next bigger value in case num_tokens uses bucketed padding.
if
num_reqs_to_sample
>=
min
(
num_tokens
,
self
.
max_num_reqs
):
break
# Make sure to compile the `max_num_reqs` upper-limit case
num_reqs_to_sample
=
_get_padded_num_reqs_with_upper_limit
(
...
...
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