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
b2ce859b
Unverified
Commit
b2ce859b
authored
Apr 09, 2025
by
Michael Goin
Committed by
GitHub
Apr 09, 2025
Browse files
Fix `benchmark_throughput.py --backend=hf` (#16352)
Signed-off-by:
mgoin
<
mgoin64@gmail.com
>
parent
566f10a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
benchmarks/benchmark_throughput.py
benchmarks/benchmark_throughput.py
+5
-2
No files found.
benchmarks/benchmark_throughput.py
View file @
b2ce859b
...
@@ -213,14 +213,17 @@ def run_hf(
...
@@ -213,14 +213,17 @@ def run_hf(
max_prompt_len
=
0
max_prompt_len
=
0
max_output_len
=
0
max_output_len
=
0
for
i
in
range
(
len
(
requests
)):
for
i
in
range
(
len
(
requests
)):
prompt
,
prompt_len
,
output_len
=
requests
[
i
]
prompt
=
requests
[
i
].
prompt
prompt_len
=
requests
[
i
].
prompt_len
output_len
=
requests
[
i
].
expected_output_len
# Add the prompt to the batch.
# Add the prompt to the batch.
batch
.
append
(
prompt
)
batch
.
append
(
prompt
)
max_prompt_len
=
max
(
max_prompt_len
,
prompt_len
)
max_prompt_len
=
max
(
max_prompt_len
,
prompt_len
)
max_output_len
=
max
(
max_output_len
,
output_len
)
max_output_len
=
max
(
max_output_len
,
output_len
)
if
len
(
batch
)
<
max_batch_size
and
i
!=
len
(
requests
)
-
1
:
if
len
(
batch
)
<
max_batch_size
and
i
!=
len
(
requests
)
-
1
:
# Check if we can add more requests to the batch.
# Check if we can add more requests to the batch.
_
,
next_prompt_len
,
next_output_len
=
requests
[
i
+
1
]
next_prompt_len
=
requests
[
i
+
1
].
prompt_len
next_output_len
=
requests
[
i
+
1
].
expected_output_len
if
(
max
(
max_prompt_len
,
next_prompt_len
)
+
if
(
max
(
max_prompt_len
,
next_prompt_len
)
+
max
(
max_output_len
,
next_output_len
))
<=
2048
:
max
(
max_output_len
,
next_output_len
))
<=
2048
:
# We can add more requests to the batch.
# We can add more requests to the batch.
...
...
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