Skip to content

Commit

Permalink
Qualification tool: qualification tool can error out from a divide by…
Browse files Browse the repository at this point in the history
… zero

Signed-off-by: Kuhu Shukla <[email protected]>
  • Loading branch information
kuhushukla committed Oct 27, 2023
1 parent 0163eb8 commit 0bcacf9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def get_costs_for_single_app(df_row, estimator: SavingsEstimator) -> pd.Series:
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)
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'
Expand Down

0 comments on commit 0bcacf9

Please sign in to comment.