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
17928589
Commit
17928589
authored
Aug 15, 2024
by
zhuwenwen
Browse files
update benchmark_throughput.py
parent
8ae929fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
benchmarks/benchmark_throughput.py
benchmarks/benchmark_throughput.py
+10
-7
vllm/benchmark_throughput.py
vllm/benchmark_throughput.py
+10
-7
No files found.
benchmarks/benchmark_throughput.py
View file @
17928589
...
...
@@ -287,14 +287,17 @@ def main(args: argparse.Namespace):
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
total_num_tokens
=
sum
(
prompt_len
+
output_len
for
_
,
prompt_len
,
output_len
in
requests
)
if
args
.
dataset
is
None
:
total_out_tokens
=
args
.
output_len
*
args
.
num_prompts
else
:
total_out_tokens
=
sum
(
output_len
for
_
,
_
,
output_len
in
requests
)
print
(
f
"Latency:
{
elapsed_time
:.
2
f
}
s"
)
print
(
f
"All Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
print
(
f
"Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
f
"
{
total_num_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
print
(
f
"Generate Throughput:
{
total_out_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
# if args.dataset is None:
# total_out_tokens = args.output_len * args.num_prompts
# else:
# total_out_tokens = sum(output_len for _, _, output_len in requests)
# print(f"Latency: {elapsed_time:.2f} s")
# print(f"All Throughput: {len(requests) / elapsed_time:.2f} requests/s, "
# f"{total_num_tokens / elapsed_time:.2f} tokens/s")
# print(f"Generate Throughput: {total_out_tokens / elapsed_time:.2f} tokens/s")
# Output JSON results if specified
...
...
vllm/benchmark_throughput.py
View file @
17928589
...
...
@@ -287,14 +287,17 @@ def main(args: argparse.Namespace):
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
total_num_tokens
=
sum
(
prompt_len
+
output_len
for
_
,
prompt_len
,
output_len
in
requests
)
if
args
.
dataset
is
None
:
total_out_tokens
=
args
.
output_len
*
args
.
num_prompts
else
:
total_out_tokens
=
sum
(
output_len
for
_
,
_
,
output_len
in
requests
)
print
(
f
"Latency:
{
elapsed_time
:.
2
f
}
s"
)
print
(
f
"All Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
print
(
f
"Throughput:
{
len
(
requests
)
/
elapsed_time
:.
2
f
}
requests/s, "
f
"
{
total_num_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
print
(
f
"Generate Throughput:
{
total_out_tokens
/
elapsed_time
:.
2
f
}
tokens/s"
)
# if args.dataset is None:
# total_out_tokens = args.output_len * args.num_prompts
# else:
# total_out_tokens = sum(output_len for _, _, output_len in requests)
# print(f"Latency: {elapsed_time:.2f} s")
# print(f"All Throughput: {len(requests) / elapsed_time:.2f} requests/s, "
# f"{total_num_tokens / elapsed_time:.2f} tokens/s")
# print(f"Generate Throughput: {total_out_tokens / elapsed_time:.2f} tokens/s")
# Output JSON results if specified
...
...
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