Repository navigation
fix(deviceplugin): preserve preferred accelerator order and cap hint size - #804
Merged
Merged
Conversation
…size - preserve annotation order in preferredAcceleratorIDsOf for preferred-id and preferred-index - order matched preferred accelerators by priority, cap selection at allocationSize, and sort returned tokens in ascending hardware order - only fall back to unselected accelerators or return empty when remainingSize is still positive - add table-driven unit tests for preferred-index priority order, size cap, and empty-unselected fallback Task 1 of preferred-index-order-and-size. Signed-off-by: thxCode <thxcode0824@gmail.com>
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
📄
|
Collaborator
Author
Review Triage Summary
|
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.
What type of PR is this?
/kind bug
/area devicemanager
What this PR does / why we need it:
Fix three edge cases in
GetPreferredAllocationwhen honoringdevice.gpustack.ai/accelerator.preferred-indexanddevice.gpustack.ai/accelerator.preferred-idannotations:preferredAcceleratorIDsOfby returning an ordered, deduplicated[]stringinstead of an unorderedsets.Set[string].mustIncludeaccelerators), capsel.SelectedtoallocationSizeso kubelet does not receive more tokens than requested and pick among them in randommaporder, and sort the final hinted tokens in ascending hardware order.sel.Unselected(or return an empty hint whenlen(sel.Unselected) == 0) whenremainingSize > 0, preventing a satisfied preferred selection from being discarded when all available accelerators on the node are listed inpreferred-indexand one listed accelerator is unavailable.pkg/deviceplugin/server_test.gocovering out-of-order priority selection, over-specified preferred lists, and empty-unselected fallback.Which issue(s) this PR links to:
NONE
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?