cleanup(metax): decouple MetaxDevices.ScoreNode from scheduler policy - #2635
cleanup(metax): decouple MetaxDevices.ScoreNode from scheduler policy#2635Rickydama3 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Rickydama3 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (1)
📝 WalkthroughWalkthroughMetax-GPU node scoring now ignores scheduler policy, prefers valid topology scores, and falls back to converted topology losses. The implementation adds a shared loss conversion constant and a policy-neutral scorer marker. Tests cover parsing, fallback behavior, policy independence, and scheduler score scaling. ChangesMetax-GPU topology scoring
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The PR decouples Metax-GPU scoring from scheduler policy and adds fallback handling for node annotations; no actionable merge-blocking risk remains after normal checks and review. Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/device/metax/device.go`:
- Around line 207-211: Update parseMetaxAnnos to return both the parsed loss and
a validity flag, distinguishing malformed JSON or a missing key from a valid
loss value of 0. In the MetaxAnnotationLoss handling block, return a topology
score of 0 when parsing is invalid, while preserving MetaxMaxTopologyLoss - loss
for valid values, including zero; add coverage for malformed loss JSON and a
missing loss key.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 79ef3b83-f7bc-411e-8a61-2442e63363df
📒 Files selected for processing (2)
pkg/device/metax/device.gopkg/device/metax/device_test.go
e23aa61 to
4df5635
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
4df5635 to
0a93184
Compare
Fixes Project-HAMi#2572 and fixes Project-HAMi#2566 by reading the available topology annotation independent of the active scheduler policy and deferring weighting to the shared policy layer via PolicyNeutralScorer. Signed-off-by: Ricky Dama <rickydama2006@gmail.com>
0a93184 to
327cc7d
Compare
|
This is being closed because it does not comply with the contribution guidelines. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
I noticed that the
Metax-GPUbackend was still handling thebinpackandspreadpolicy checks directly insideScoreNode. This was causing the issue reported in #2566, where nodes could be completely ignored if they only had one of the two topology annotations.Since we already decoupled the
Metax-SGPUbackend in #2413, I followed the same approach here forMetax-GPU.I removed the policy checks from the backend. It now uses the
scoresannotation when available and falls back tolosseswhen needed, converting it to the standard higher-is-better scale. I also added thePolicyNeutralScorermarker to the device so the shared scheduler'sOverrideScorelayer can handle the10000weighting and spread sign flip, the same way it does for SGPU.I also added tests in
device_test.goto cover the policy-independent scoring and the fallback logic.Which issue(s) this PR fixes:
Fixes #2566
Fixes #2572
Special notes for your reviewer:
I also added some tests to make sure it doesn't crash if the node annotations are missing or broken.
Does this PR introduce a user facing change?: