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
fd0e2cfd
Unverified
Commit
fd0e2cfd
authored
Oct 23, 2024
by
Michael Goin
Committed by
GitHub
Oct 23, 2024
Browse files
[Misc] Separate total and output tokens in benchmark_throughput.py (#8914)
parent
e5ac6a41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
benchmarks/benchmark_throughput.py
benchmarks/benchmark_throughput.py
+3
-1
No files found.
benchmarks/benchmark_throughput.py
View file @
fd0e2cfd
...
@@ -272,8 +272,10 @@ def main(args: argparse.Namespace):
...
@@ -272,8 +272,10 @@ def main(args: argparse.Namespace):
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
raise
ValueError
(
f
"Unknown backend:
{
args
.
backend
}
"
)
total_num_tokens
=
sum
(
prompt_len
+
output_len
total_num_tokens
=
sum
(
prompt_len
+
output_len
for
_
,
prompt_len
,
output_len
in
requests
)
for
_
,
prompt_len
,
output_len
in
requests
)
total_output_tokens
=
sum
(
output_len
for
_
,
_
,
output_len
in
requests
)
print
(
f
"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"
)
f
"
{
total_num_tokens
/
elapsed_time
:.
2
f
}
total tokens/s, "
f
"
{
total_output_tokens
/
elapsed_time
:.
2
f
}
output tokens/s"
)
# Output JSON results if specified
# Output JSON results if specified
if
args
.
output_json
:
if
args
.
output_json
:
...
...
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