[Feature] Add resource mapping for Huawei Ascend NPUs - #5071
[Feature] Add resource mapping for Huawei Ascend NPUs#5071bakhovaddinov wants to merge 1 commit into
Conversation
3d6a610 to
9f61605
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 9f61605. Configure here.
9f61605 to
08a956e
Compare
08a956e to
7e18a52
Compare
7e18a52 to
dda4d17
Compare
|
@win5923 @machichima I think the failed test in the pipeline is flaky or something. Any way to merge without it passing or trigger a new run? |
|
Have you rebase onto latest main branch? We recently fixed some flaky tests. |
dda4d17 to
ef5e735
Compare
sorry, I was afk. I've rebased just now and now a new test fails |
|
Sorry for the inconvenience. We have a PR fixes this. You can rebase again once #5084 is merged. |
04eda9d to
e87ca84
Compare
|
@win5923 @machichima @rueian @andrewsykim can we merge this please? |
|
Overall LGTM, just few comments |
This adds prefix-based resource mapping for Huawei Ascend NPUs to properly inject Ray NPU limits. Resolves ray-project#5039. Signed-off-by: Iskandar Bahovaddinov <bakhovaddinov@gmail.com>
e87ca84 to
50a8692
Compare
There was a problem hiding this comment.
LGTM! cc @rueian or @andrewsykim to merge. The CI failure is not related to this PR
is there an issue regarding the CI failure problem? It's quite annoying honestly, I could have a look at the weekends |
Yeah agree. There's an issue for this #4782 and someone is working on it |
86ed1cc to
50a8692
Compare
|
@rueian @andrewsykim could we merge please? |
|
@machichima @win5923 @rueian @andrewsykim I'm sorry to bother you again, guys. Is there anything I can do to make this PR closer to merge? Kinda confused if the problem is on my end or CI related. I've triggered CI a few times, something keeps failing. Does it prevent the merge? |

This adds prefix-based resource mapping for Huawei Ascend NPUs to properly inject Ray NPU limits. Resolves #5039.
Why are these changes needed?
This PR adds native support for Huawei Ascend NPUs in KubeRay by mapping Kubernetes Ascend device resources to Ray's logical
NPUresource.Because Huawei device plugins and virtualization schedulers (like HAMi) expose several variations of resource names depending on the chip model and slicing (e.g.,
huawei.com/Ascend910B,huawei.com/ascend-1980,huawei.com/npu), this change introduces a case-insensitive prefix check (huawei.com/ascend) instead of hardcoding exact exact model names in thecustomAcceleratorToRayResourceMap.This ensures that the operator correctly parses the limits and automatically injects
--resources='{"NPU": X}'into the Ray worker startup parameters for all current and future Ascend hardware generations.The refactor also unifies the accelerator resource mapping logic across both code paths that populate
rayStartParams(top-levelResourcesfield and containerresources.limits). Previously, custom accelerators likegoogle.com/tpuandaws.amazon.com/neuroncorecould end up under different keys in--resourcesdepending on which field was used. Both paths now go throughgetCustomAcceleratorRayResourceName, producing consistent Ray resource names (TPU,neuron_cores) regardless of the input field.Related issue number
Closes #5039
Labels
doc-updates-requiredlabel.breaking-changelabel.Checks