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
e585b583
Unverified
Commit
e585b583
authored
Sep 28, 2024
by
Chen Zhang
Committed by
GitHub
Sep 28, 2024
Browse files
[Bugfix] Support testing prefill throughput with benchmark_serving.py --hf-output-len 1 (#8891)
parent
090e945e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
benchmarks/benchmark_serving.py
benchmarks/benchmark_serving.py
+4
-5
No files found.
benchmarks/benchmark_serving.py
View file @
e585b583
...
...
@@ -89,8 +89,6 @@ def sample_sharegpt_requests(
tokenizer
:
PreTrainedTokenizerBase
,
fixed_output_len
:
Optional
[
int
]
=
None
,
)
->
List
[
Tuple
[
str
,
int
,
int
,
None
]]:
if
fixed_output_len
is
not
None
and
fixed_output_len
<
4
:
raise
ValueError
(
"output_len too small"
)
# Load the dataset.
with
open
(
dataset_path
)
as
f
:
dataset
=
json
.
load
(
f
)
...
...
@@ -117,7 +115,7 @@ def sample_sharegpt_requests(
prompt_len
=
len
(
prompt_token_ids
)
output_len
=
len
(
completion_token_ids
)
if
fixed_output_len
is
None
else
fixed_output_len
if
prompt_len
<
4
or
output_len
<
4
:
if
prompt_len
<
4
or
(
fixed_output_len
is
None
and
output_len
<
4
)
:
# Prune too short sequences.
continue
if
prompt_len
>
1024
or
prompt_len
+
output_len
>
2048
:
...
...
@@ -228,10 +226,11 @@ def sample_hf_requests(
prompt_len
=
len
(
prompt_token_ids
)
output_len
=
len
(
completion_token_ids
)
if
fixed_output_len
is
None
else
fixed_output_len
if
prompt_len
<
4
or
output_len
<
4
:
if
fixed_output_len
is
None
and
(
prompt_len
<
4
or
output_len
<
4
)
:
# Prune too short sequences.
continue
if
prompt_len
>
1024
or
prompt_len
+
output_len
>
2048
:
if
fixed_output_len
is
None
and
\
(
prompt_len
>
1024
or
prompt_len
+
output_len
>
2048
):
# Prune too long sequences.
continue
...
...
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