Replace time.time() to time.perf_counter() for benchmarking. (#6178)
Signed-off-by: Lifu Huang <lifu.hlf@gmail.com>
This commit is contained in:
@@ -121,7 +121,7 @@ def main(args):
|
||||
def get_one_answer(i):
|
||||
states[i] = tree_search(**arguments[i], call_generate=call_generate)
|
||||
|
||||
tic = time.time()
|
||||
tic = time.perf_counter()
|
||||
if args.parallel == 1:
|
||||
for i in tqdm(range(len(questions))):
|
||||
get_one_answer(i)
|
||||
@@ -134,7 +134,7 @@ def main(args):
|
||||
)
|
||||
)
|
||||
|
||||
latency = time.time() - tic
|
||||
latency = time.perf_counter() - tic
|
||||
|
||||
answers_text = []
|
||||
for s in states:
|
||||
|
||||
@@ -107,7 +107,7 @@ def main(args):
|
||||
backend = select_sglang_backend(args)
|
||||
|
||||
# Run requests
|
||||
tic = time.time()
|
||||
tic = time.perf_counter()
|
||||
states = tree_search.run_batch(
|
||||
arguments,
|
||||
temperature=0,
|
||||
@@ -115,7 +115,7 @@ def main(args):
|
||||
num_threads=args.parallel,
|
||||
progress_bar=True,
|
||||
)
|
||||
latency = time.time() - tic
|
||||
latency = time.perf_counter() - tic
|
||||
answers_text = []
|
||||
for s in states:
|
||||
answers_text.append([x for xs in s["answer"] for x in xs])
|
||||
|
||||
Reference in New Issue
Block a user