Skip to content

Commit e9f2bc0

Browse files
abhimanyumetafacebook-github-bot
authored andcommitted
Adding date time to saved file name
Summary: Updating export_csv file name to include data time and second, so mupltiple run may not overwrite the exsisting profiled data. X-link: facebookresearch/FBGEMM#1542 Reviewed By: q10 Differential Revision: D78190867 Pulled By: abhimanyumeta fbshipit-source-id: 861ba04885e7f3773381e1e6d58a7e45890c36c5
1 parent 0aab31f commit e9f2bc0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fbgemm_gpu/experimental/gen_ai/bench/quantize_bench.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import os
1111

1212
from dataclasses import dataclass
13+
from datetime import datetime
1314
from typing import Any, Dict, List, Optional, Tuple
1415

1516
import matplotlib.pyplot as plt
@@ -491,7 +492,10 @@ def main(args: Any):
491492
os.makedirs(args.output_dir, exist_ok=True)
492493
print("csv and images will be saved to " + args.output_dir)
493494
if args.export_csv:
494-
csv_file = os.path.join(args.output_dir, "quantize_ops_benchmark.csv")
495+
datetime_str = datetime.now().strftime("%Y%m%d_%H%M%S")
496+
csv_file = os.path.join(
497+
args.output_dir, f"quantize_ops_benchmark_{datetime_str}.csv"
498+
)
495499
# Export results to a CSV file.
496500
df = pd.DataFrame(benchmark_results)
497501
df.to_csv(csv_file, index=False)

0 commit comments

Comments
 (0)