mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-11 13:05:01 +08:00
[Misc] Add random seed for prefix cache benchmark (#9081)
This commit is contained in:
parent
05c531be47
commit
0cc566ca8f
@ -113,7 +113,7 @@ def repeat_and_sort_requests(requests: List[Tuple[str, int, int]],
|
|||||||
def main(args):
|
def main(args):
|
||||||
tokenizer = get_tokenizer(args.model, trust_remote_code=True)
|
tokenizer = get_tokenizer(args.model, trust_remote_code=True)
|
||||||
input_length_range = tuple(map(int, args.input_length_range.split(':')))
|
input_length_range = tuple(map(int, args.input_length_range.split(':')))
|
||||||
|
random.seed(args.seed)
|
||||||
if args.dataset_path is not None:
|
if args.dataset_path is not None:
|
||||||
print(f"Start to sample {args.num_prompts} prompts"
|
print(f"Start to sample {args.num_prompts} prompts"
|
||||||
"from {args.dataset_path}")
|
"from {args.dataset_path}")
|
||||||
@ -194,5 +194,7 @@ if __name__ == "__main__":
|
|||||||
default='128:256',
|
default='128:256',
|
||||||
help='Range of input lengths for sampling prompts,'
|
help='Range of input lengths for sampling prompts,'
|
||||||
'specified as "min:max" (e.g., "128:256").')
|
'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()
|
args = parser.parse_args()
|
||||||
main(args)
|
main(args)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user