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
b9fb74f3
"vscode:/vscode.git/clone" did not exist on "88a60c40db75f9de726807754d022ff98a69e83e"
Unverified
Commit
b9fb74f3
authored
Oct 24, 2025
by
Xinyuan Tong
Committed by
GitHub
Oct 24, 2025
Browse files
fix: bench_serving ITL calculation when using spec-decoding (#12064)
parent
e15b63a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
python/sglang/bench_serving.py
python/sglang/bench_serving.py
+10
-1
No files found.
python/sglang/bench_serving.py
View file @
b9fb74f3
...
...
@@ -1626,6 +1626,7 @@ def calculate_metrics(
dur_s
:
float
,
tokenizer
:
PreTrainedTokenizerBase
,
backend
:
str
,
accept_length
:
Optional
[
float
]
=
None
,
)
->
Tuple
[
BenchmarkMetrics
,
List
[
int
]]:
output_lens
:
List
[
int
]
=
[]
retokenized_output_lens
:
List
[
int
]
=
[]
...
...
@@ -1650,7 +1651,14 @@ def calculate_metrics(
total_input_vision
+=
input_requests
[
i
].
vision_prompt_len
if
output_len
>
1
:
tpots
.
append
((
outputs
[
i
].
latency
-
outputs
[
i
].
ttft
)
/
(
output_len
-
1
))
itls
+=
outputs
[
i
].
itl
if
(
accept_length
and
accept_length
>
0
and
backend
in
(
"sglang-oai"
,
"sglang-oai-chat"
)
):
itls
+=
[
v
/
accept_length
for
v
in
outputs
[
i
].
itl
]
else
:
itls
+=
outputs
[
i
].
itl
ttfts
.
append
(
outputs
[
i
].
ttft
)
e2e_latencies
.
append
(
outputs
[
i
].
latency
)
...
...
@@ -1929,6 +1937,7 @@ async def benchmark(
dur_s
=
benchmark_duration
,
tokenizer
=
tokenizer
,
backend
=
backend
,
accept_length
=
accept_length
,
)
print
(
"
\n
{s:{c}^{n}}"
.
format
(
s
=
" Serving Benchmark Result "
,
n
=
50
,
c
=
"="
))
...
...
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