[bench] Fix benchmark/serve.py to ignore unavailable results (#22382)

Signed-off-by: Linkun <github@lkchen.net>
This commit is contained in:
lkchen 2025-08-07 23:15:50 -07:00 committed by GitHub
parent 099c046463
commit 808a7b69df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -665,7 +665,7 @@ def save_to_pytorch_benchmark_format(args: argparse.Namespace,
pt_records = convert_to_pytorch_benchmark_format(
args=args,
metrics={k: [results[k]]
for k in metrics},
for k in metrics if k in results},
extra_info={
k: results[k]
for k in results if k not in metrics and k not in ignored_metrics