Skip to content

Commit

Permalink
[Misc] Add random seed for prefix cache benchmark (vllm-project#9081)
Browse files Browse the repository at this point in the history
Signed-off-by: Alvant <alvasian@yandex.ru>
  • Loading branch information
Imss27 authored and Alvant committed Oct 26, 2024
1 parent 94909d4 commit 55fe153
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion benchmarks/benchmark_prefix_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def repeat_and_sort_requests(requests: List[Tuple[str, int, int]],
def main(args):
tokenizer = get_tokenizer(args.model, trust_remote_code=True)
input_length_range = tuple(map(int, args.input_length_range.split(':')))

random.seed(args.seed)
if args.dataset_path is not None:
print(f"Start to sample {args.num_prompts} prompts"
"from {args.dataset_path}")
Expand Down Expand Up @@ -194,5 +194,7 @@ def main(args):
default='128:256',
help='Range of input lengths for sampling prompts,'
'specified as "min:max" (e.g., "128:256").')
parser.add_argument("--seed", type=int, default=0,
help='Random seed for reproducibility')
args = parser.parse_args()
main(args)

0 comments on commit 55fe153

Please sign in to comment.