Skip to content

Commit

Permalink
Support dumping of json summary for result summarizer (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh authored Dec 3, 2024
1 parent 0f8e59c commit e8f8062
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mlperf_logging/result_summarizer/result_summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,11 @@ def _print_and_write(summaries, weak_scaling=False, mode='w', power = False):
summaries.groupby(specs_and_notes).apply(lambda x: agg_columns_fn(x, benchmarks)).to_csv(csv, mode=mode)
else:
summaries.to_csv(csv, index=False, mode=mode)

json_df = summaries.to_json(orient="records")
json_data = json.loads(json_df)
with open(f"""{csv.replace(".csv", ".json")}""", "w") as f:
f.write(json.dumps(json_data, indent=2))

if args.xlsx is not None:
_summaries_to_xlsx(summaries, args.xlsx, args.ruleset[:3])

Expand Down

0 comments on commit e8f8062

Please sign in to comment.