You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-28Lines changed: 33 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,28 +4,23 @@
4
4
5
5
## Introduction
6
6
7
-
This Ascend device plugin is implemented for [HAMi](https://github.com/Project-HAMi/HAMi) and [volcano](https://github.com/volcano-sh/volcano) scheduling.
7
+
This Ascend device plugin is implemented for NPU-Slicing for [HAMi](https://github.com/Project-HAMi/HAMi) and [volcano](https://github.com/volcano-sh/volcano). It supports two modes:
8
8
9
9
#### 1. Template-based Hard Slicing (vNPU)
10
10
11
-
Memory slicing is supported based on virtualization template, lease available template is automatically used. For detailed information, check [template](./ascend-device-configmap.yaml)
11
+
Memory slicing is supported based on virtualization template, least available template is automatically used. For detailed information, check [template](https://github.com/Project-HAMi/ascend-device-plugin/blob/main/ascend-device-configmap.yaml)
12
12
13
13
#### 2. Soft Slicing with Runtime Interception (hami-vnpu-core)
14
14
15
15
This project implements a soft slicing mechanism based on `libvnpu.so` interception and `limiter` token scheduling, enabling fine-grained resource sharing. For detailed information, check [hami-vnpu-core](https://github.com/Project-HAMi/hami-vnpu-core)
16
16
17
-
**Note:**`hami-vnpu-core` currently only supports ARM platforms.
17
+
**Note 1:**`hami-vnpu-core` currently only supports ARM platforms.
18
+
**Note 2:**`hami-vnpu-core` currently only supports HAMi scheduler.
The `hami-device-node-config` is used to enable hami-vnpu-core for specific nodes within the cluster.
74
-
* By setting `hami-vnpu-core: true`, the specified node will enable soft-partitioning based on `hami-vnpu-core`.
75
-
* Specify the number of virtual devices reported to Kubernetes for each physical chip via the `vDeviceCount` field.
76
-
* Nodes without specific configurations will default to template-based hard-partitioning.
67
+
### Deploy ConfigMap
68
+
69
+
This configMap is used for global configurations, like resourceName, mode, templates.
70
+
* Under `vnpus`, set `hamiVnpuCore: true` so **all nodes** advertise soft-partitioning based on `hami-vnpu-core` to the scheduler (unless overridden per node in `hami-device-node-config`).
The `hami-device-node-config` is used to enable or override hami-vnpu-core for specific nodes within the cluster. Node-level settings take higher priority than the global `vnpus.hamiVnpuCore` switch.
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
93
+
## Usage
95
94
96
95
If you require HAMi to automatically add the `runtimeClassName` configuration to Pods requesting Ascend resources (this is disabled by default), you should set `devices.ascend.runtimeClassName` value to **a non-empty string** in HAMi’s `values.yaml` file, ensuring it matches the name of the `RuntimeClass` resource. For example:
97
96
@@ -101,14 +100,18 @@ devices:
101
100
runtimeClassName: ascend
102
101
```
103
102
104
-
## Usage
105
-
106
103
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.
107
104
108
105
### Usage in HAMi
109
106
107
+
**How HAMi chooses soft vs legacy vNPU:** The device plugin applies **soft slicing** (`libvnpu` / `hami-vnpu-core` mounts and environment) **only** when the Pod sets `huawei.com/vnpu-mode: hami-core`. Pods **without** this annotation still follow the **original vNPU** path (virtualization templates and `ASCEND_VNPU_SPECS`). These two paths are different. If your cluster effectively has **only** soft-slicing–oriented Ascend capacity (for example every node is configured for `hami-vnpu-core` and workloads are expected to use soft slicing), Pods that **omit** `vnpu-mode=hami-core` may remain **Pending** because they still request the legacy vNPU allocation model, which may not match what those nodes expose or how the scheduler pairs Pods to nodes.
108
+
110
109
```yaml
111
110
...
111
+
metadata:
112
+
name: ascend-soft-slice-pod
113
+
annotations:
114
+
huawei.com/vnpu-mode: 'hami-core' # Enables hami-vnpu-core soft-segmentation for this pod
112
115
containers:
113
116
- name: npu_pod
114
117
...
@@ -119,10 +122,12 @@ To exclusively use an entire card or request multiple cards, you only need to se
119
122
huawei.com/Ascend910B-memory: "4096"
120
123
```
121
124
122
-
For more examples, see [examples](./examples/)
125
+
For more examples, see [examples](https://github.com/Project-HAMi/ascend-device-plugin/tree/main/examples)
123
126
124
127
### Soft Slicing Configuration (HAMi)
125
128
129
+
Use the annotation below whenever you intend **soft** slicing; omitting it keeps **template-based vNPU** behavior (see the note under [Usage in HAMi](#usage-in-hami)).
0 commit comments