Skip to content

Commit

Permalink
Output regression results as csv
Browse files Browse the repository at this point in the history
Change-Id: Ibda3bdfee8de50a5d15ac6562a60b00da8e770d4
  • Loading branch information
Ryo-not-rio committed Jan 10, 2025
1 parent 3556e02 commit 45d6ff0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/regression/benchdnn_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,24 @@ def compare_two_benchdnn(file1, file2, tolerance=0.05):
if len(r1) != len(r2):
raise Exception("The number of benchdnn runs do not match")

passed = True
results = {}
for prb, time1 in r1.items():
if prb not in r2:
raise Exception(f"{prb} exists in {file1} but not {file2}")

results[prb] = (time1, r2[prb])
if r2[prb] / time1 > 1 + tolerance:
raise Exception(f"{prb} has regressed by {round(r2[prb] / time1, 2)}x")
passed = False

print("Regression test passed")
print("%prb%,%-time(old)%,&-time(new)%")
for k, v in results.items():
print(f"{k},{v[0]},{v[1]}")

if passed:
print("Regression tests passed")
else:
raise Exception("Some regression tests did not pass")

if __name__ == "__main__":
compare_two_benchdnn(sys.argv[1], sys.argv[2])

0 comments on commit 45d6ff0

Please sign in to comment.