Skip to content

Add unallocated_resources option to Compute.get_offers()#4067

Open
un-def wants to merge 1 commit into
masterfrom
pr_offers_exclude_allocated_resources
Open

Add unallocated_resources option to Compute.get_offers()#4067
un-def wants to merge 1 commit into
masterfrom
pr_offers_exclude_allocated_resources

Conversation

@un-def

@un-def un-def commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Adds a new unallocated_resources argument alongside full_offers. When set, backends that pack multiple jobs onto a node (Kubernetes; not yet Slurm) subtract already-allocated resources so offers reflect only unallocated (available) capacity. Exposed as the --unallocated CLI flag (dstack offer and dstack apply) and the unallocated_resources API parameter of get_plan/list_gpus. It is a discovery-only knob: the scheduling path always passes False.

Kubernetes previously subtracted allocated resources unconditionally. That is now off: the cached allocation view can lag reality (e.g. a node whose previous job already terminated still looks allocated), which blocked provisioning of nodes that were actually free. Provisioning is now optimistic and lets the scheduler decide; the short JOB_POD_SCHEDULING_TIMEOUT makes a retry cheap.

Adds a new `unallocated_resources` argument alongside `full_offers`.
When set, backends that pack multiple jobs onto a node (Kubernetes; not
yet Slurm) subtract already-allocated resources so offers reflect only
unallocated (available) capacity. Exposed as the `--unallocated` CLI flag
(`dstack offer` and `dstack apply`) and the `unallocated_resources` API
parameter of `get_plan`/`list_gpus`. It is a discovery-only knob: the
scheduling path always passes `False`.

Kubernetes previously subtracted allocated resources unconditionally.
That is now off: the cached allocation view can lag reality
(e.g. a node whose previous job already terminated still looks allocated),
which blocked provisioning of nodes that were actually free. Provisioning
is now optimistic and lets the scheduler decide; the short
`JOB_POD_SCHEDULING_TIMEOUT` makes a retry cheap.
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.

1 participant