fix(benchmark): store 'compare' and 'one' perf results in csv files and visualize them

This commit is contained in:
yangsijia.614
2025-02-25 23:52:54 +08:00
parent 4edea86f9e
commit b67980309b
2 changed files with 24 additions and 8 deletions

View File

@@ -1,7 +1,17 @@
import argparse
import matplotlib.pyplot as plt
import pandas as pd
file_path = 'all_perf.csv'
def parse_args():
parser = argparse.ArgumentParser(description='Visualize benchmark results')
parser.add_argument('--file', type=str, default='all_perf.csv',
help='Path to the CSV file with benchmark results (default: all_perf.csv)')
return parser.parse_args()
args = parse_args()
file_path = args.file
df = pd.read_csv(file_path)
@@ -16,4 +26,4 @@ plt.xlabel('seqlen')
plt.ylabel('bw (GB/s)')
plt.legend()
plt.savefig('bandwidth_vs_seqlen.png')
plt.savefig(f'{file_path.split(".")[0].split("/")[-1]}_bandwidth_vs_seqlen.png')