Skip to content

Commit e38c28f

Browse files
authored
Merge pull request Project-HAMi#73 from Project-HAMi/release-v1.3
Update document and device-plugin for release-v1.3
2 parents e12118b + 967c7cc commit e38c28f

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-pl
6767
### Deploy ConfigMap
6868

6969
This configMap is used for global configurations, like resourceName, mode, templates.
70-
* By setting `hamiVnpuCore: true` at the top level, **all nodes** will enable soft-partitioning based on `hami-vnpu-core`.
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`).
7171

7272
```bash
7373
kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-plugin/main/ascend-device-configmap.yaml
@@ -78,7 +78,7 @@ kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-pl
7878

7979
#### (Optional) **Node Custom Configuration Description**
8080

81-
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 `hamiVnpuCore` switch.
81+
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.
8282

8383
```bash
8484
kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-plugin/main/ascend-device-node-configmap.yaml
@@ -104,8 +104,14 @@ To exclusively use an entire card or request multiple cards, you only need to se
104104
105105
### Usage in HAMi
106106
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+
107109
```yaml
108110
...
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
109115
containers:
110116
- name: npu_pod
111117
...
@@ -120,6 +126,8 @@ For more examples, see [examples](https://github.com/Project-HAMi/ascend-device-
120126

121127
### Soft Slicing Configuration (HAMi)
122128

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)).
130+
123131
```yaml
124132
apiVersion: v1
125133
kind: Pod

README_cn.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-pl
7070
### 部署 ConfigMap
7171

7272
该 ConfigMap 用于全局配置,包括 resourceName、模式、模板等。
73-
* 在顶层设置 `hamiVnpuCore: true`**所有节点**将启用基于 `hami-vnpu-core` 的软切分
73+
* `vnpus` 下设置 `hamiVnpuCore: true`**所有节点**会向调度器声明基于 `hami-vnpu-core` 的软切分能力(可被 `hami-device-node-config` 按节点覆盖)
7474

7575
```bash
7676
kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-plugin/main/ascend-device-configmap.yaml
@@ -80,7 +80,7 @@ kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-pl
8080

8181
#### (可选)节点自定义配置说明
8282

83-
`hami-device-node-config` 用于对集群中特定节点的 hami-vnpu-core 进行启用或覆盖。节点级配置的优先级高于全局 `hamiVnpuCore` 开关。
83+
`hami-device-node-config` 用于对集群中特定节点的 hami-vnpu-core 进行启用或覆盖。节点级配置的优先级高于全局 `vnpus.hamiVnpuCore` 开关。
8484

8585
```bash
8686
kubectl apply -f https://raw.githubusercontent.com/Project-HAMi/ascend-device-plugin/main/ascend-device-node-configmap.yaml
@@ -108,6 +108,8 @@ devices:
108108
109109
### 在 HAMi 中使用
110110
111+
**HAMi 与 vNPU 模式说明:** 只有为 Pod 配置了注解 `huawei.com/vnpu-mode: hami-core` 时,设备插件才会按 **软切分**(`libvnpu` / `hami-vnpu-core` 的挂载与环境变量)处理。**未添加**该注解的任务仍走 **原有 vNPU** 方案(虚拟化模板与 `ASCEND_VNPU_SPECS` 等)。两种路径不同。当集群里 Ascend 节点 **只有** 面向软切分的部署或调度预期(例如节点均按 `hami-vnpu-core` 配置、工作负载预期都使用软切分)时,**未**设置 `vnpu-mode=hami-core` 的任务可能一直处于 **Pending**,因为其仍按旧版 vNPU 申请与分配逻辑,可能与当前节点暴露的资源或调度匹配方式不一致。
112+
111113
```yaml
112114
...
113115
containers:
@@ -124,6 +126,8 @@ devices:
124126

125127
### 软切分配置 (HAMi)
126128

129+
需要 **软切分** 时请显式加上下文中的注解;不加则仍为 **模板硬切分 vNPU**(与上一节「在 HAMi 中使用」中的说明一致)。
130+
127131
```yaml
128132
apiVersion: v1
129133
kind: Pod

ascend-device-plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec:
5353
priorityClassName: "system-node-critical"
5454
serviceAccountName: hami-ascend
5555
containers:
56-
- image: projecthami/ascend-device-plugin:v1.2.0
56+
- image: projecthami/ascend-device-plugin:v1.3.0
5757
imagePullPolicy: IfNotPresent
5858
name: device-plugin
5959
resources:

0 commit comments

Comments
 (0)