diff --git a/user_tools/src/spark_rapids_pytools/rapids/qualification.py b/user_tools/src/spark_rapids_pytools/rapids/qualification.py index 7b5ed96b1..9bd0ca7b6 100644 --- a/user_tools/src/spark_rapids_pytools/rapids/qualification.py +++ b/user_tools/src/spark_rapids_pytools/rapids/qualification.py @@ -572,9 +572,9 @@ def __calc_apps_cost(self, def get_costs_for_single_app(df_row, estimator: SavingsEstimator) -> pd.Series: raw_cpu_cost, raw_gpu_cost, _ = estimator.get_costs_and_savings(df_row['App Duration'], df_row['Estimated GPU Duration']) - cpu_cost = (100 - self.ctxt.get_ctxt('cpu_discount')) / 100 * raw_cpu_cost - gpu_cost = (100 - self.ctxt.get_ctxt('gpu_discount')) / 100 * raw_gpu_cost - est_savings = 100.0 - ((100.0 * gpu_cost) / cpu_cost) + cpu_cost = (100 - self.ctxt.get_ctxt('cpu_discount')) / 100 * raw_cpu_cost if raw_cpu_cost > 0 else 0 + gpu_cost = (100 - self.ctxt.get_ctxt('gpu_discount')) / 100 * raw_gpu_cost if raw_gpu_cost > 0 else 0 + est_savings = 100.0 - ((100.0 * gpu_cost) / cpu_cost) if cpu_cost > 0 else 0 # We do not want to mistakenly mark a Not-applicable app as Recommended in the savings column if df_row[speedup_rec_col] == 'Not Applicable': savings_recommendations = 'Not Applicable'