Skip to content

[Ready for review] Use default CPU resources when GPU type is None #1722

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ndeepak-baseten
Copy link
Contributor

@ndeepak-baseten ndeepak-baseten commented Jun 19, 2025

Ready for review.

🚀 What

When user specifies GPU type as "None", use default CPU count and memory size. Without this, truss sends "0" CPU and "0 MB" memory, causing deployment to fail with insufficient resources.

💻 How

Add code to set CPU count and memory, if accelerator is not specified.

🔬 Testing

Add mock for CPU config, add test

@ndeepak-baseten ndeepak-baseten changed the title [WIP] Use default CPU resources when GPU type is None [Ready for review] Use default CPU resources when GPU type is None Jun 19, 2025
@ndeepak-baseten ndeepak-baseten marked this pull request as ready for review June 19, 2025 15:47
Copy link
Contributor

@rcano-baseten rcano-baseten left a comment

Choose a reason for hiding this comment

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

left a comment

@@ -284,6 +284,10 @@ def _get_compute(compute: Optional[Compute]) -> Compute:
if not compute:
compute = Compute(cpu_count=0, memory="0Mi")
compute.accelerator = _get_accelerator_if_specified(compute.accelerator)
# User did not specify an accelerator, so we default to CPU.
if not compute.accelerator:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this going to overwrite the compute provided by the customer?

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