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
b88fab31
Unverified
Commit
b88fab31
authored
Nov 04, 2025
by
yinghui
Committed by
GitHub
Nov 04, 2025
Browse files
fix: add `seed` bench_serving to cache key, remove redundant function definition. (#12680)
parent
36942660
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
22 deletions
+1
-22
benchmark/hicache/data_processing.py
benchmark/hicache/data_processing.py
+0
-21
python/sglang/bench_serving.py
python/sglang/bench_serving.py
+1
-1
No files found.
benchmark/hicache/data_processing.py
View file @
b88fab31
...
...
@@ -2,7 +2,6 @@ import json
import
os
import
pickle
import
random
from
pathlib
import
Path
from
typing
import
List
,
Optional
,
Tuple
,
Union
import
numpy
as
np
...
...
@@ -426,26 +425,6 @@ def sample_random_requests(
return
input_requests
def
gen_prompt
(
tokenizer
,
token_num
):
"""Generate a random prompt of specified token length using tokenizer vocabulary."""
all_available_tokens
=
list
(
tokenizer
.
get_vocab
().
values
())
selected_tokens
=
random
.
choices
(
all_available_tokens
,
k
=
token_num
)
return
tokenizer
.
decode
(
selected_tokens
)
def
get_gen_prefix_cache_path
(
args
,
tokenizer
):
"""Create cache directory under ~/.cache/sglang/benchmark"""
cache_dir
=
Path
.
home
()
/
".cache"
/
"sglang"
/
"benchmark"
# Create a unique cache filename based on the generation parameters
cache_key
=
(
f
"gsp_prefix_
{
args
.
gsp_num_groups
}
_
{
args
.
gsp_prompts_per_group
}
_"
f
"
{
args
.
gsp_system_prompt_len
}
_
{
args
.
gsp_question_len
}
_
{
args
.
gsp_output_len
}
_"
f
"
{
tokenizer
.
__class__
.
__name__
}
.pkl"
)
return
cache_dir
/
cache_key
def
sample_generated_shared_prefix_requests
(
num_groups
:
int
,
prompts_per_group
:
int
,
...
...
python/sglang/bench_serving.py
View file @
b88fab31
...
...
@@ -1507,7 +1507,7 @@ def get_gen_prefix_cache_path(args, tokenizer):
# Create a unique cache filename based on the generation parameters
cache_key
=
(
f
"gen_shared_prefix_
{
args
.
gsp_num_groups
}
_
{
args
.
gsp_prompts_per_group
}
_"
f
"gen_shared_prefix_
{
args
.
seed
}
_
{
args
.
gsp_num_groups
}
_
{
args
.
gsp_prompts_per_group
}
_"
f
"
{
args
.
gsp_system_prompt_len
}
_
{
args
.
gsp_question_len
}
_
{
args
.
gsp_output_len
}
_"
f
"
{
tokenizer
.
__class__
.
__name__
}
.pkl"
)
...
...
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