Skip to content

fix(scheduler): count shared DRA GPU device once per node - #2024

Merged
enoodle merged 2 commits into
v0.17from
backport-1931-to-v0.17
Aug 6, 2026
Merged

fix(scheduler): count shared DRA GPU device once per node#2024
enoodle merged 2 commits into
v0.17from
backport-1931-to-v0.17

Conversation

@KaiPilotBot

Copy link
Copy Markdown
Collaborator

Description

Backport of #1931 to v0.17.

Raya Solano and others added 2 commits August 6, 2026 13:17
When one physical GPU is shared by several pods through a single
ResourceClaim (status.reservedFor lists more than one consumer, as with
MPS or time-slicing), every consuming pod carries the same allocated
device. The node accounting added that device to the used vector once
per pod, so a 1-GPU node shared by two pods reported used: 2, capacity:
1. IdleVector then went negative and MaxNodeResourcesPredicate rejected
the node for every task, even ones requesting no GPU at all, which
showed up as a confusing "didn't have enough resources: GPUs" on a node
that clearly had one.

Keep a per-device reference count on the node, keyed by
driver/pool/device from the allocation result, and skip a device that
another pod on the node already contributed. Removal mirrors this: the
device stays counted until the last consumer leaves. Exclusive claims
and non-DRA GPUs are untouched.

Reservation pods are a special case worth calling out: addTaskResources
zeroes their GPU index before the dedup runs, so counting their shared
devices would subtract from zero and drive the used count negative.
Both the dedup and release paths now leave a zero-GPU task's accounting
alone.

Signed-off-by: Raya Solano <raya@mbinf.de>
(cherry picked from commit 8dc2871)
Signed-off-by: Erez Freiberger <enoodle@gmail.com>
Signed-off-by: Raya Solano <raya.solano@mbinf.de>
(cherry picked from commit 4e9cf1e)
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ff848bbd-98b2-43f4-a97e-c4818ab7bf3f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@enoodle
enoodle enabled auto-merge (squash) August 6, 2026 14:11
@enoodle
enoodle merged commit 95e496b into v0.17 Aug 6, 2026
16 checks passed
@enoodle
enoodle deleted the backport-1931-to-v0.17 branch August 6, 2026 14:11
@KaiPilotBot

Copy link
Copy Markdown
Collaborator Author

📝 Changelog fragment recorded

Thanks! This PR added the changelog fragment(s) below. Pending fragments are folded into CHANGELOG.md at release time, so it was intentionally not modified by this PR — your entry will appear in the next release:

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.

shared DRA ResourceClaim double-counted per pod makes node unschedulable

2 participants