This Ascend device plugin is implemented for HAMi and volcano scheduling.
Memory slicing is supported based on virtualization template, lease available template is automatically used. For detailed information, check template
make alldocker buildx build -t $IMAGE_NAME .kubectl label node {ascend-node} ascend=on
kubectl apply -f ascend-device-configmap.yaml
kubectl apply -f ascend-device-plugin.yamlIf scheduling Ascend devices in HAMi, simply set devices.ascend.enabled to true when deploying HAMi, and the ConfigMap and ascend-device-plugin will be automatically deployed. refer https://github.com/Project-HAMi/HAMi/blob/master/charts/hami/README.md#huawei-ascend
To exclusively use an entire card or request multiple cards, you only need to set the corresponding resourceName. If multiple tasks need to share the same NPU, you need to set the corresponding resource request to 1 and configure the appropriate ResourceMemoryName.
...
containers:
- name: npu_pod
...
resources:
limits:
huawei.com/Ascend910B: "1"
# if you don't specify Ascend910B-memory, it will use a whole NPU.
huawei.com/Ascend910B-memory: "4096"For more examples, see examples
Volcano must be installed prior to usage, for more information see here
apiVersion: v1
kind: Pod
metadata:
name: ascend-pod
spec:
schedulerName: volcano
containers:
- name: ubuntu-container
image: swr.cn-south-1.myhuaweicloud.com/ascendhub/ascend-pytorch:24.0.RC1-A2-1.11.0-ubuntu20.04
command: ["sleep"]
args: ["100000"]
resources:
limits:
huawei.com/Ascend310P: "1"
huawei.com/Ascend310P-memory: "4096"