Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qualification tool can error out from a divide by zero #638

Closed
wants to merge 1 commit into from

Conversation

kuhushukla
Copy link
Collaborator

Fixes #637 , needs a unit test.

Copy link
Collaborator

@cindyyuanjiang cindyyuanjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @kuhushukla !

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we additionally add a note/comment in the output saying that CPU cost calculation was 0 as that likely indicates an issue with provided cluster shape from the user?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense. Let me add that.

@kuhushukla kuhushukla marked this pull request as ready for review January 2, 2024 16:18
@amahussein amahussein added bug Something isn't working core_tools Scope the core module (scala) user_tools Scope the wrapper module running CSP, QualX, and reports (python) and removed core_tools Scope the core module (scala) labels Jan 2, 2024
Copy link
Collaborator

@amahussein amahussein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kuhushukla

I think we need to look for what caused the CPU_COST to be zro in first place.
Then, put up a change that will disable cost-savings calculations when the CPU-cost was not available.

I have intuition that this happened because of using a CPU cluster that cannot be mapped to a GPU. See issue #637 and Pr #707

Somewhere in the qualification.py we should call self.ctxt.set_ctxt('enableSavingsCalculations', false) when the CPU to GPU cluster fails. For some reason, we do not detect that there is no mapping and we need to fix that for good.
I need to investigate deeper by reproducing the error.

@kuhushukla kuhushukla changed the title [WIP] Qualification tool: qualification tool can error out from a divide by… Qualification tool: qualification tool can error out from a divide by… Jan 3, 2024
@amahussein amahussein changed the title Qualification tool: qualification tool can error out from a divide by… Qualification tool can error out from a divide by… Jan 24, 2024
@amahussein amahussein changed the title Qualification tool can error out from a divide by… Qualification tool can error out from a divide by zero Jan 24, 2024
@amahussein
Copy link
Collaborator

Closing as we could not verify the root reason

@amahussein amahussein closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user_tools Scope the wrapper module running CSP, QualX, and reports (python)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] qualification tool can error out from a divide by zero
4 participants