# Does Ray2.7.0 support Ascend NPU？

**URL:** <https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921>\
**Category:** Ray Core\
**Created:** [March 6, 2024, 8:23am UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921 "2024-03-06T08:23:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pengxiang\_chen](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/pengxiang_chen/32/5803_2.png) [@pengxiang\_chen](https://discuss.ray.io/u/pengxiang_chen)\
**Post date:** [March 6, 2024, 8:23am UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921/1 "2024-03-06T08:23:55Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- High: It blocks me to complete my task.

I’m using this demo(ray-service.text-summarizer.yaml) to test

I had edited yaml’s workerGroupSpecs section,like this  
workerGroupSpecs:  
# The pod replicas in this group typed worker  
- replicas: 1  
minReplicas: 1  
maxReplicas: 10  
groupName: gpu-group  
rayStartParams:  
resources: ‘{“NPU”: 1}’  
# Pod template  
template:  
spec:  
nodeName: npu-1  
containers:  
- name: ray-worker  
image: registry.paas/cmss/rayproject/ray-ml:2.7.0  
volumeMounts:  
- mountPath: /tmp/ray  
name: ray-logs  
- mountPath: /mnt  
name: zip  
resources:  
limits:  
cpu: 4  
memory: “16G”  
[Huawei - Building a Fully Connected, Intelligent World](http://huawei.com/Ascend910:) 1  
requests:  
cpu: 3  
memory: “12G”  
[Huawei - Building a Fully Connected, Intelligent World](http://huawei.com/Ascend910:) 1  
…  
when i use kubectl apply this file, I found the worker pod’s Status is CrashLoopBackOff. I got this error:

kubectl --namespace ray-system logs pod/text-summarizer-raycluster-mzs2d-worker-gpu-group-kk2sr  
Defaulted container “ray-worker” out of: ray-worker, wait-gcs-ready (init)  
Usage: ray start [OPTIONS]  
Try ‘ray start --help’ for help.

Error: Got unexpected extra argument (1})

---

<div class="post-metadata">

**Author:** ![pengxiang\_chen](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/pengxiang_chen/32/5803_2.png) [@pengxiang\_chen](https://discuss.ray.io/u/pengxiang_chen)\
**Post date:** [March 6, 2024, 10:26am UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921/2 "2024-03-06T10:26:04Z")

</div>

`resources: "'{\"NPU\": 1}'"`

---

<div class="post-metadata">

**Author:** ![jjyao](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jjyao/32/1799_2.png) [@jjyao](https://discuss.ray.io/u/jjyao)\
**Post date:** [March 17, 2024, 5:02am UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921/3 "2024-03-17T05:02:21Z")

</div>

Hi @pengxiang_chen Latest Ray supports Ascend NPU.

---

<div class="post-metadata">

**Author:** ![pengxiang\_chen](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/pengxiang_chen/32/5803_2.png) [@pengxiang\_chen](https://discuss.ray.io/u/pengxiang_chen)\
**Post date:** [July 10, 2024, 9:21am UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921/4 "2024-07-10T09:21:06Z")

</div>

When use ray train, ray train use transformer+accelerate to set device, accelerate get os.environ[“ACCELERATE\_TORCH\_DEVICE”] setted by ray/train/torch/config.py——in fact, ray/air/\_internal/torch\_utils.py, but there only get CUDA devices…

---

<div class="post-metadata">

**Author:** ![liuxsh9](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/liuxsh9/32/6219_2.png) [@liuxsh9](https://discuss.ray.io/u/liuxsh9)\
**Post date:** [July 16, 2024, 2:42am UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921/5 "2024-07-16T02:42:57Z")

</div>

Hi @pengxiang_chen, Ray Train “currently” only supports CPU and GPU. We are working hard to make Ray Train support Huawei Ascend NPU and more third-party devices, the relevant PR is: [[Train] Decouple device-related modules and add Huawei NPU support to Ray Train #44086](https://github.com/ray-project/ray/pull/44086).

Please feel free to follow this PR and provide any of your requirements or suggestions. Once this PR is merged and released, `ACCELERATE_TORCH_DEVICE` will be able to access NPU, and we will also test running transformer+accelerate on NPUs.

We appreciate your interest and look forward to your feedback.

---

<div class="post-metadata">

**Author:** ![Sam\_Chan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sam_chan/32/5011_2.png) [@Sam\_Chan](https://discuss.ray.io/u/Sam_Chan)\
**Post date:** [July 16, 2024, 4:33pm UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921/6 "2024-07-16T16:33:29Z")

</div>

PR looks active here (TY @liuxsh9 for contribution as always) cc @yunxuanx for the context on the community desire for it.

---

<div class="post-metadata">

**Author:** ![yunxuanx](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yunxuanx/32/4354_2.png) [@yunxuanx](https://discuss.ray.io/u/yunxuanx)\
**Post date:** [September 4, 2024, 9:42pm UTC](https://discuss.ray.io/t/does-ray2-7-0-support-ascend-npu/13921/7 "2024-09-04T21:42:21Z")

</div>

The PR on Ray Train side has been merged! [[Train] Decouple device-related modules and add Huawei NPU support to Ray Train by liuxsh9 · Pull Request #44086 · ray-project/ray · GitHub](https://github.com/ray-project/ray/pull/44086)
