NPU Scheduling
You can use NPUs in CCE containers.
Prerequisites
- An NPU node has been ready for use. For details, see Buying a Node.
- The huawei-npu has been installed. For details, see huawei-npu.
Using NPUs
Create a workload and request NPUs. You can specify the number of NPUs as follows:
kind: Deployment
apiVersion: apps/v1
metadata:
name: npu-test
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: npu-test
template:
metadata:
labels:
app: npu-test
spec:
containers:
- name: container-0
image: nginx:perl
resources:
limits:
cpu: 250m
huawei.com/ascend-310: '1'
memory: 512Mi
requests:
cpu: 250m
huawei.com/ascend-310: '1'
memory: 512Mi
imagePullSecrets:
- name: default-secret
Specify the number of NPUs to be requested in huawei.com/ascend-310.
After huawei.com/ascend-310 is specified, workloads will not be scheduled to nodes without NPUs. If NPUs are insufficient, a Kubernetes event similar to "0/2 nodes are available: 2 Insufficient huawei.com/ascend-310." will be reported.
To use NPUs on the CCE console, select the Ascend 310 quota and specify the number of Ascend chips to be used when creating a workload.
NPU Node Labels
CCE will label NPU-enabled nodes that are ready to use.
kind: Deployment
apiVersion: apps/v1
metadata:
name: npu-test
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: npu-test
template:
metadata:
labels:
app: npu-test
spec:
nodeSelector:
accelerator/huawei-npu: ascend-310
containers:
- name: container-0
image: nginx:perl
resources:
limits:
cpu: 250m
huawei.com/ascend-310: '1'
memory: 512Mi
requests:
cpu: 250m
huawei.com/ascend-310: '1'
memory: 512Mi
imagePullSecrets:
- name: default-secret
Last Article: GPU Scheduling
Next Article: Managing Workloads and Jobs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.