Replace time.time() to time.perf_counter() for benchmarking. (#6178)

Signed-off-by: Lifu Huang <lifu.hlf@gmail.com>
This commit is contained in:
Lifu Huang
2025-05-11 14:32:49 -07:00
committed by GitHub
parent e9a47f4cb5
commit 6e2da51561
61 changed files with 158 additions and 158 deletions

View File

@@ -119,7 +119,7 @@ async def eval_mmmu(args) -> None:
api_key="sk", base_url=f"http://127.0.0.1:{args.port}/v1"
)
semaphore = asyncio.Semaphore(args.concurrency)
start = time.time()
start = time.perf_counter()
base_url = f"http://127.0.0.1:{args.port}"
if args.profile:
@@ -147,7 +147,7 @@ async def eval_mmmu(args) -> None:
if profile_output.success:
print("Profiler stopped")
print(f"Benchmark time: {time.time() - start}")
print(f"Benchmark time: {time.perf_counter() - start}")
args.output_path = f"./val_sglang.json"
save_json(args.output_path, out_samples)
eval_result(model_answer_path=args.output_path, answer_dict=answer_dict)