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
7a68b422
Unverified
Commit
7a68b422
authored
Sep 18, 2025
by
zhannngchen
Committed by
GitHub
Sep 18, 2025
Browse files
[improvement] add average input/output token length for hicache benchmark stats output (#10525)
parent
60fc5b51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
benchmark/hicache/bench_multiturn.py
benchmark/hicache/bench_multiturn.py
+18
-0
No files found.
benchmark/hicache/bench_multiturn.py
View file @
7a68b422
...
...
@@ -479,6 +479,18 @@ class WorkloadGenerator:
"summary"
:
{
"total_requests"
:
len
(
self
.
performance_metrics
[
"ttft"
]),
"request_rate"
:
self
.
request_rate
,
"average_prompt_len"
:
(
sum
(
self
.
performance_metrics
[
"prompt_len"
])
/
len
(
self
.
performance_metrics
[
"prompt_len"
])
if
self
.
performance_metrics
[
"prompt_len"
]
else
0.0
),
"average_output_len"
:
(
sum
(
self
.
performance_metrics
[
"generated_len"
])
/
len
(
self
.
performance_metrics
[
"generated_len"
])
if
self
.
performance_metrics
[
"generated_len"
]
else
0.0
),
"average_ttft"
:
sum
(
self
.
performance_metrics
[
"ttft"
])
/
len
(
self
.
performance_metrics
[
"ttft"
]),
"p90_ttft"
:
sorted
(
self
.
performance_metrics
[
"ttft"
])[
...
...
@@ -534,6 +546,12 @@ class WorkloadGenerator:
print
(
f
" Total requests:
{
performance_data
[
'summary'
][
'total_requests'
]
}
at
{
performance_data
[
'summary'
][
'request_rate'
]
}
requests per second"
)
print
(
f
" Average Prompt Length:
{
performance_data
[
'summary'
][
'average_prompt_len'
]:.
2
f
}
tokens"
)
print
(
f
" Average Output Length:
{
performance_data
[
'summary'
][
'average_output_len'
]:.
2
f
}
tokens"
)
print
(
f
" Average TTFT:
{
performance_data
[
'summary'
][
'average_ttft'
]:.
2
f
}
"
)
print
(
f
" P90 TTFT:
{
performance_data
[
'summary'
][
'p90_ttft'
]:.
2
f
}
"
)
print
(
f
" Median TTFT:
{
performance_data
[
'summary'
][
'median_ttft'
]:.
2
f
}
"
)
...
...
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