Unverified Commit 26471636 authored by Huy Do's avatar Huy Do Committed by GitHub
Browse files

Save startup benchmark results as a list of values (#33629)


Signed-off-by: default avatarHuy Do <huydhn@gmail.com>
parent 9fb27dd3
...@@ -47,6 +47,12 @@ def convert_to_pytorch_benchmark_format( ...@@ -47,6 +47,12 @@ def convert_to_pytorch_benchmark_format(
return records return records
for name, benchmark_values in metrics.items(): for name, benchmark_values in metrics.items():
if not isinstance(benchmark_values, list):
raise TypeError(
f"benchmark_values for metric '{name}' must be a list, "
f"but got {type(benchmark_values).__name__}"
)
record = { record = {
"benchmark": { "benchmark": {
"name": "vLLM benchmark", "name": "vLLM benchmark",
......
...@@ -101,7 +101,7 @@ def save_to_pytorch_benchmark_format( ...@@ -101,7 +101,7 @@ def save_to_pytorch_benchmark_format(
cold_startup_records = convert_to_pytorch_benchmark_format( cold_startup_records = convert_to_pytorch_benchmark_format(
args=args, args=args,
metrics={ metrics={
"avg_cold_startup_time": results["avg_cold_startup_time"], "avg_cold_startup_time": [results["avg_cold_startup_time"]],
}, },
extra_info={ extra_info={
"cold_startup_times": results["cold_startup_times"], "cold_startup_times": results["cold_startup_times"],
...@@ -114,7 +114,7 @@ def save_to_pytorch_benchmark_format( ...@@ -114,7 +114,7 @@ def save_to_pytorch_benchmark_format(
cold_compilation_records = convert_to_pytorch_benchmark_format( cold_compilation_records = convert_to_pytorch_benchmark_format(
args=args, args=args,
metrics={ metrics={
"avg_cold_compilation_time": results["avg_cold_compilation_time"], "avg_cold_compilation_time": [results["avg_cold_compilation_time"]],
}, },
extra_info={ extra_info={
"cold_compilation_times": results["cold_compilation_times"], "cold_compilation_times": results["cold_compilation_times"],
...@@ -129,7 +129,7 @@ def save_to_pytorch_benchmark_format( ...@@ -129,7 +129,7 @@ def save_to_pytorch_benchmark_format(
warm_startup_records = convert_to_pytorch_benchmark_format( warm_startup_records = convert_to_pytorch_benchmark_format(
args=args, args=args,
metrics={ metrics={
"avg_warm_startup_time": results["avg_warm_startup_time"], "avg_warm_startup_time": [results["avg_warm_startup_time"]],
}, },
extra_info={ extra_info={
"warm_startup_times": results["warm_startup_times"], "warm_startup_times": results["warm_startup_times"],
...@@ -142,7 +142,7 @@ def save_to_pytorch_benchmark_format( ...@@ -142,7 +142,7 @@ def save_to_pytorch_benchmark_format(
warm_compilation_records = convert_to_pytorch_benchmark_format( warm_compilation_records = convert_to_pytorch_benchmark_format(
args=args, args=args,
metrics={ metrics={
"avg_warm_compilation_time": results["avg_warm_compilation_time"], "avg_warm_compilation_time": [results["avg_warm_compilation_time"]],
}, },
extra_info={ extra_info={
"warm_compilation_times": results["warm_compilation_times"], "warm_compilation_times": results["warm_compilation_times"],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment