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
a395a638
Unverified
Commit
a395a638
authored
Apr 24, 2024
by
zifeitong
Committed by
GitHub
Apr 24, 2024
Browse files
[Misc] Use public API in benchmark_throughput (#4300)
parent
2768884a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
benchmarks/benchmark_throughput.py
benchmarks/benchmark_throughput.py
+13
-16
No files found.
benchmarks/benchmark_throughput.py
View file @
a395a638
...
...
@@ -103,25 +103,22 @@ def run_vllm(
)
# Add the requests to the engine.
prompts
=
[]
sampling_params
=
[]
for
prompt
,
_
,
output_len
in
requests
:
sampling_params
=
SamplingParams
(
n
=
n
,
temperature
=
0.0
if
use_beam_search
else
1.0
,
top_p
=
1.0
,
use_beam_search
=
use_beam_search
,
ignore_eos
=
True
,
max_tokens
=
output_len
,
)
# FIXME(woosuk): Do not use internal method.
llm
.
_add_request
(
prompt
=
prompt
,
prompt_token_ids
=
None
,
sampling_params
=
sampling_params
,
)
prompts
.
append
(
prompt
)
sampling_params
.
append
(
SamplingParams
(
n
=
n
,
temperature
=
0.0
if
use_beam_search
else
1.0
,
top_p
=
1.0
,
use_beam_search
=
use_beam_search
,
ignore_eos
=
True
,
max_tokens
=
output_len
,
))
start
=
time
.
perf_counter
()
# FIXME(woosuk): Do not use internal method.
llm
.
_run_engine
(
use_tqdm
=
True
)
llm
.
generate
(
prompts
,
sampling_params
,
use_tqdm
=
True
)
end
=
time
.
perf_counter
()
return
end
-
start
...
...
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