Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
bae9541e
"vscode:/vscode.git/clone" did not exist on "532d4ac3d9310855ccbf9f13907b5172acf2eca8"
Commit
bae9541e
authored
Jul 14, 2024
by
Ying Sheng
Browse files
Update benchmark script (#621)
parent
a56858ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
benchmark/latency_throughput/bench_one.py
benchmark/latency_throughput/bench_one.py
+5
-1
No files found.
benchmark/latency_throughput/bench_one.py
View file @
bae9541e
...
...
@@ -97,7 +97,10 @@ def run_one_batch_size(bs):
print
(
ret
)
output_throughput
=
bs
*
max_new_tokens
/
latency
print
(
f
"latency:
{
latency
:.
2
f
}
s, speed:
{
output_throughput
:.
2
f
}
token/s"
)
overall_throughput
=
bs
*
(
args
.
input_len
+
max_new_tokens
)
/
latency
print
(
f
"latency:
{
latency
:.
2
f
}
s"
)
print
(
f
"decode throughput:
{
output_throughput
:.
2
f
}
token/s"
)
print
(
f
"overall throughput:
{
overall_throughput
:.
2
f
}
token/s"
)
with
open
(
"results.jsonl"
,
"a"
)
as
fout
:
res
=
{
...
...
@@ -107,6 +110,7 @@ def run_one_batch_size(bs):
"batch_size"
:
bs
,
"latency"
:
latency
,
"output_throughput"
:
output_throughput
,
"overall_throughput"
:
overall_throughput
,
}
fout
.
write
(
json
.
dumps
(
res
)
+
"
\n
"
)
...
...
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