Skip to content

Commit 45d6ff0

Browse files
committedJan 10, 2025
Output regression results as csv
Change-Id: Ibda3bdfee8de50a5d15ac6562a60b00da8e770d4
1 parent 3556e02 commit 45d6ff0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎tests/regression/benchdnn_comparison.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,24 @@ def compare_two_benchdnn(file1, file2, tolerance=0.05):
4141
if len(r1) != len(r2):
4242
raise Exception("The number of benchdnn runs do not match")
4343

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

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

51-
print("Regression test passed")
54+
print("%prb%,%-time(old)%,&-time(new)%")
55+
for k, v in results.items():
56+
print(f"{k},{v[0]},{v[1]}")
57+
58+
if passed:
59+
print("Regression tests passed")
60+
else:
61+
raise Exception("Some regression tests did not pass")
5262

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

0 commit comments

Comments
 (0)