feat(scheduler): support per-pod device scoring weights - #2469
Conversation
Signed-off-by: blackdragoon26 <sankalp.jha9643@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe scheduler supports per-Pod GPU device scoring weights for slot, core, and memory utilization. It validates annotations, preserves equal-weight defaults, applies weights during device scoring, tests allocation and topology behavior, and documents the configuration. ChangesDevice scoring weights
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant calcScoreWithOptions
participant GetDeviceScoringWeightsByPod
participant fitInDevices
participant DeviceListsScore.ComputeScore
calcScoreWithOptions->>GetDeviceScoringWeightsByPod: resolve Pod annotation
GetDeviceScoringWeightsByPod-->>calcScoreWithOptions: return weights or validation error
calcScoreWithOptions->>fitInDevices: pass DeviceScoringWeights
fitInDevices->>DeviceListsScore.ComputeScore: compute weighted device score
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
|
@CodeRabbit review |
✅ Action performedReview finished.
|
Signed-off-by: blackdragoon26 <sankalp.jha9643@gmail.com>
Signed-off-by: blackdragoon26 <sankalp.jha9643@gmail.com>
|
@blackdragoon26 This is a useful feature. Before merging, can you post a doc about how to use it at https://github.com/Project-HAMi/website? |
i think i said it before, pls do NOT use manually coderrabbit. |
|
Tip For best results, initiate chat on the files or code changes.
🐇 ✏️ Learnings added
You are interacting with an AI system. |
|
Tip For best results, initiate chat on the files or code changes.
🐇 You are interacting with an AI system. |
Yesss, Sure thing, I will be doing that. |
Oh yes, I am so sorry about that. |
|
Tip For best results, initiate chat on the files or code changes.
🐇 You are interacting with an AI system. |
|
Tip For best results, initiate chat on the files or code changes.
🐇 You are interacting with an AI system. |
Signed-off-by: blackdragoon26 <sankalp.jha9643@gmail.com>
|
I have created the issue, at @FouoF Project-HAMi/website#758 for the same.
|
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: blackdragoon26, FouoF The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds optional per-Pod resource weights for HAMi's device-level
binpackandspreadscoring.A workload can configure the relative influence of virtual-device slots, accelerator cores, and device memory using:
When the annotation is absent, HAMi uses
slot=1,core=1,memory=1, preserving the existing scoring behavior.The annotation is parsed and validated once before device scoring.
DeviceListsScore.ComputeScorereceives only the validated typed weights and remains independent of Pod annotations and scheduler-policy composition.The annotation must provide all three non-negative integer weights, with at least one positive value. Malformed, negative, incomplete, duplicate, or all-zero values are rejected.
This changes only the scalar device score. Existing device capacity checks, vendor
Fitbehavior, mutex handling, NUMA binding, topology-aware selection, and the establishedbinpack/spreadordering remain unchanged.Which issue(s) this PR fixes:
Fixes #2220
And this comment: #2220 (comment)
Special notes for your reviewer:
The implementation follows the revised scope discussed during the community meeting:
Tests cover:
Verification completed:
Does this PR introduce a user-facing change?:
Yes. Now, workloads can optionally influence HAMi's device-level placement by specifying slot, core, and memory scoring weights through a Pod annotation.
But, existing workloads without this annotation retain the current behaviour.
AI assistance notice: I used OpenAI Codex to help inspect the relevant scheduler paths, implement the parser, scoring changes, tests and documentation, and execute verification commands. I reviewed the resulting changes and take responsibility for the implementation.
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Documentation