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
ce86e201
Unverified
Commit
ce86e201
authored
Jul 23, 2025
by
Zhiqiang Xie
Committed by
GitHub
Jul 23, 2025
Browse files
bug fix and tag (#8282)
parent
b4326330
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
benchmark/hicache/bench_multiturn.py
benchmark/hicache/bench_multiturn.py
+11
-5
No files found.
benchmark/hicache/bench_multiturn.py
View file @
ce86e201
...
@@ -121,6 +121,12 @@ def parse_args():
...
@@ -121,6 +121,12 @@ def parse_args():
default
=
"random"
,
default
=
"random"
,
help
=
"Policy for popping requests from the ready queue (random or fifo)"
,
help
=
"Policy for popping requests from the ready queue (random or fifo)"
,
)
)
parser
.
add_argument
(
"--tag"
,
type
=
str
,
default
=
""
,
help
=
"Tag of a certain run in the log file"
,
)
parser
.
add_argument
(
"--seed"
,
type
=
int
,
default
=
1
,
help
=
"The random seed."
)
parser
.
add_argument
(
"--seed"
,
type
=
int
,
default
=
1
,
help
=
"The random seed."
)
return
parser
.
parse_args
()
return
parser
.
parse_args
()
...
@@ -202,9 +208,9 @@ def gen_payload(prompt, output_len):
...
@@ -202,9 +208,9 @@ def gen_payload(prompt, output_len):
return
payload
return
payload
def
log_to_jsonl_file
(
data
,
file_path
=
"performance_metrics.jsonl"
):
def
log_to_jsonl_file
(
data
,
file_path
=
"performance_metrics.jsonl"
,
tag
=
""
):
"""Append the data with a timestamp to the specified JSONL file."""
"""Append the data with a timestamp
and tag
to the specified JSONL file."""
timestamped_data
=
{
"timestamp"
:
datetime
.
now
().
isoformat
(),
**
data
}
timestamped_data
=
{
"timestamp"
:
datetime
.
now
().
isoformat
(),
"tag"
:
tag
,
**
data
}
try
:
try
:
with
open
(
file_path
,
"a"
)
as
file
:
with
open
(
file_path
,
"a"
)
as
file
:
file
.
write
(
file
.
write
(
...
@@ -360,7 +366,7 @@ class WorkloadGenerator:
...
@@ -360,7 +366,7 @@ class WorkloadGenerator:
# append new request to client's history
# append new request to client's history
self
.
client_records
[
client_id
][
self
.
client_records
[
client_id
][
"history"
"history"
]
+=
self
.
sub_question_inputs
.
pop
()
]
+=
self
.
sub_question_inputs
.
pop
()
.
prompt
self
.
ready_queue
.
append
(
self
.
ready_queue
.
append
(
(
(
client_id
,
client_id
,
...
@@ -428,7 +434,7 @@ class WorkloadGenerator:
...
@@ -428,7 +434,7 @@ class WorkloadGenerator:
print
(
print
(
f
" Throughput:
{
performance_data
[
'summary'
][
'throughput'
]:.
2
f
}
requests per second"
f
" Throughput:
{
performance_data
[
'summary'
][
'throughput'
]:.
2
f
}
requests per second"
)
)
log_to_jsonl_file
(
performance_data
,
args
.
log_file
)
log_to_jsonl_file
(
performance_data
,
args
.
log_file
,
tag
=
args
.
tag
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
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