-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix: vNPU HAMi mode may not work with multi-type NPUs cluster #4779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Welcome @kiritoxkiriko! It looks like this is your first PR to volcano-sh/volcano 🎉 |
Summary of ChangesHello @kiritoxkiriko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug impacting the vNPU HAMi mode's functionality within clusters containing multiple NPU types. The core problem stemmed from the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request fixes a bug where IgnoredDevicesList was being overwritten for each node in a multi-type NPU cluster, causing only the last node's devices to be considered. The fix correctly changes the logic to append devices from all nodes.
My review focuses on the correctness and maintainability of the new implementation. I've identified a potential issue where the global IgnoredDevicesList can accumulate stale entries, and I've suggested a strategy to address this. Additionally, I've provided a recommendation to improve the efficiency of the new AppendList method and a suggestion to add unit tests for the new functionality to ensure its robustness. Overall, the change is in the right direction to fix the reported bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical bug in vNPU HAMi mode where the scheduler failed to properly ignore device-specific resources in multi-type NPU clusters. The issue occurred because IgnoredDevicesList.Set() was overwriting the list on each node evaluation instead of accumulating device types across all nodes. The fix introduces Append() and AppendList() methods that accumulate unique device types using a map-based deduplication strategy.
Key changes:
- Added
ignoredIndexmap toignoredDevicesListfor efficient deduplication - Modified
Set()to deduplicate devices and filter empty strings - Added
Append(),AppendList(), andList()methods for accumulation-based operations - Changed
node_info.goto useAppendList()instead ofSet()when registering ignored devices
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/scheduler/api/shared_device_pool.go | Core fix: added deduplication logic and new append methods for accumulating ignored device types across nodes |
| pkg/scheduler/api/node_info.go | Changed from Set() to AppendList() to accumulate devices from all nodes; added debug logging |
| pkg/scheduler/api/shared_device_pool_test.go | Updated tests to use new newIgnoredDevicesList() constructor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
please sign-off your commit to pass the DCO check |
24ebf41 to
e14ab7b
Compare
43c6699 to
24c48c2
Compare
Signed-off-by: kiritoxkiriko <[email protected]> # Conflicts: # pkg/scheduler/api/node_info.go
Signed-off-by: kiritoxkiriko <[email protected]>
24c48c2 to
34558af
Compare
| } | ||
| } | ||
| IgnoredDevicesList.Set(ignored_list) | ||
| klog.V(5).Infof("ascend_ignored_list is %v", ignored_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignored_list includes all devices, not just ascend.
What type of PR is this?
BugFix
What this PR does / why we need it:
vNPU HAMi mode may not work with multi-type NPUs cluster
Which issue(s) this PR fixes:
Fixes #4778
Special notes for your reviewer:
According to the problem described in this issue #4778
I address this bug should related with IgnoredDevicesList, since the
${card_type}-memoryresource should be ignored in scheduling.After checking out the codes, I found out the old IgnoredDevicesList.Set method will refresh all of device in the list, which will be used for setting node resource
Only one node's device will be ignore here, and we may have multiple nodes, but the
Setmethod will refresh the list very time it calls, so the ignore list will only keep last evaluated node's device in the end. That's why only one kind of NPU mem will be ignore in this case.I tried to keep the orignial IgnoredDevicesList functions, and add new methods in this commit, and also use map to keep the list items unique since we don't want add duplicated resource in this list
Please take a look @archlitchi
Does this PR introduce a user-facing change?