From ef5c3cf78042d8a98092775b4b407e04992d1d04 Mon Sep 17 00:00:00 2001 From: colramos-amd Date: Tue, 10 Oct 2023 14:01:50 -0500 Subject: [PATCH] Fixed baseline compare pct change issue occuring with small values Signed-off-by: colramos-amd [ROCm/rocprofiler-compute commit: ef2e460952a9de39ec35d074448e9be45caf376b] --- .../src/omniperf_analyze/utils/tty.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py b/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py index 015d8af421..f4a42032fe 100644 --- a/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py +++ b/projects/rocprofiler-compute/src/omniperf_analyze/utils/tty.py @@ -26,6 +26,7 @@ import pandas as pd from pathlib import Path from tabulate import tabulate import sys +import copy from omniperf_analyze.utils import schema, parser @@ -139,6 +140,8 @@ def show_all(args, runs, archConfigs, output): + t_df_pretty.map(str) + "%)" ) + df = pd.concat([df, t_df], axis=1) + # DEBUG: When in a CI setting and flag is set, # then verify metrics meet threshold requirement if args.report_diff: @@ -147,23 +150,24 @@ def show_all(args, runs, archConfigs, output): .gt(args.report_diff) .any() ): + violation_idx = t_df_pretty.index[t_df_pretty.abs() > args.report_diff] print( - "DEBUG ERROR: Dataframe diff exceeds {} threshold requirement".format( - str(args.report_diff) + "%" + "DEBUG ERROR: Dataframe diff exceeds {} threshold requirement\nSee metric {}".format( + str(args.report_diff) + "%", + violation_idx.to_numpy() ) ) + print(df) sys.exit(1) - - df = pd.concat([df, t_df], axis=1) else: - cur_df[header] = [ + cur_df_copy = copy.deepcopy(cur_df) + cur_df_copy[header] = [ round(float(x), args.decimal) if x != "" else x for x in base_df[header] ] - - df = pd.concat([df, cur_df[header]], axis=1) + df = pd.concat([df, cur_df_copy[header]], axis=1) if not df.empty: # subtitle for each table in a panel if existing