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

Only use a GPU value for Kubernetes that is non-null and non-zero #2006

Closed

Conversation

dmcguire81
Copy link

Fix for #2005

# If GPU count is specified, explicitly set it in self.attributes.
if k == "gpu" and v != None:
# If GPU count is specified and non-zero, explicitly set it in self.attributes.
if k == "gpu" and v:
Copy link
Collaborator

Choose a reason for hiding this comment

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

looking into alternatives for this at the moment. Note that the default from resources deco is actually "0" and not int, so it will pass this check.

Copy link
Author

@dmcguire81 dmcguire81 Oct 15, 2024

Choose a reason for hiding this comment

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

Hmm, I wonder if it's cast before it ends up here, because the type in the comments in int. Also, this seems to fix the problem, which is my biggest priority for removing the footgun; setting the default in the decorator to None would also expedite the fix, so that works, as well.

I can add some logging to capture the default values, here, to demonstrate.

@dmcguire81
Copy link
Author

Fixed by #2100

@dmcguire81 dmcguire81 closed this Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants