Skip to content

Project-HAMi/ascend-device-plugin

Repository files navigation

Ascend Device Plugin

Introduction

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

Prerequisites

ascend-docker-runtime

Compile

make all

Build

docker buildx build -t $IMAGE_NAME .

Deployment

Label the Node with ascend=on

kubectl label node {ascend-node} ascend=on

Deploy ConfigMap

kubectl apply -f ascend-device-configmap.yaml

Deploy ascend-device-plugin

kubectl apply -f ascend-device-plugin.yaml

If 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

Usage

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.

Usage in HAMi

...
    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

Usage in volcano

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"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 8