Skip to content

Commit

Permalink
Improve output and skip tests if no performance reference can be found
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAUT committed Sep 30, 2024
1 parent 393aab8 commit a8e33fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/perf-kernels/tools/tune_gemm/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def teardown_class(self):
with open('gemm-performance-report.yaml', 'w') as out_file:
yaml.safe_dump(self.test_results, out_file)

def test_matmul_performance_regression(self, config):
def test_matmul_performance_regression(self, config, record_property):
# Get GPU ids
gpus = [0]
jobs = 1
Expand Down Expand Up @@ -147,6 +147,8 @@ def test_matmul_performance_regression(self, config):
if reference_run is not None:
performance_ratio = tri_tflops / reference_run['tflops']
slowdown_threshold = 0.97
assert performance_ratio > slowdown_threshold, f'Performance regressed by {(100.0 * (1.0 - performance_ratio)):.2f}% (threshold={((1.0 - slowdown_threshold) * 100.0 ):.2f}%)'
regression_percent = (100.0 * (1.0 - performance_ratio))
record_property("Performance difference (lower is better)", f"{regression_percent}%")
assert performance_ratio > slowdown_threshold, f'Performance regressed by {regression_percent:.2f}% (threshold={((1.0 - slowdown_threshold) * 100.0 ):.2f}%)'
else:
warnings.warn(f"No reference file found. There will be no regression detected for config = {config}")
pytest.skip("No performance reference found!")

0 comments on commit a8e33fe

Please sign in to comment.