fix(scheduler): count a shared DRA GPU device once per node (backport #1931 to v0.16) - #2025
Open
TensorRaya wants to merge 2 commits into
Open
fix(scheduler): count a shared DRA GPU device once per node (backport #1931 to v0.16)#2025TensorRaya wants to merge 2 commits into
TensorRaya wants to merge 2 commits into
Conversation
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)
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
enoodle
approved these changes
Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #1931 to
v0.16. The automated backport could not cherry-pick cleanly.Conflict and resolution: on
main,addTaskResources/removeTaskResourcesalsocarry the "DRA-backed extended resources are absent from node.Status.Allocatable"
zeroing loop, which does not exist on
v0.16. Only the two dedup/release callsfrom this PR were taken; the unrelated zeroing loop was left out. The
lessEqualTaskToNodeResourcesdiscount hunk and the new files applied cleanly.Both original commits are preserved with
-xreferences.Related Issues
Backport of #1931
Checklist
make changelog— the fragment from the original commit is includedBreaking Changes
None.
Additional Notes
Verified on the backport branch (Go 1.x, local):
go build ./...cleangofmt -l pkg/scheduler/api/node_info/empty,go vet ./pkg/scheduler/api/node_info/...cleango test ./pkg/scheduler/api/node_info/... ./pkg/scheduler/actions/integration_tests/...all green(node_info, allocate, consolidation, consolidation_and_reclaim, deletion_tests, numa, preempt,
reclaim, stalegangeviction)