Skip to content

Commit 02e7a20

Browse files
wawa0210wawa0210
wawa0210
authored andcommitted
Fixed Ascend configuration file being placed outside helm charts template
Signed-off-by: wawa0210 <xiao.zhang@daocloud.io>
1 parent 45051ef commit 02e7a20

File tree

4 files changed

+234
-60
lines changed

4 files changed

+234
-60
lines changed

charts/hami/device-spec/ascend-config.yaml

Lines changed: 0 additions & 59 deletions
This file was deleted.

charts/hami/templates/scheduler/device-configmap.yaml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,68 @@ metadata:
88
{{- include "hami-vgpu.labels" . | nindent 4 }}
99
data:
1010
ascend-config.yaml: |-
11-
{{ .Files.Get "device-spec/ascend-config.yaml" | nindent 4}}
11+
{{- if .Files.Glob "files/ascend-config.yaml" }}
12+
{{- .Files.Get "files/ascend-config.yaml" | nindent 4}}
13+
{{- else }}
14+
vnpus:
15+
- chipName: 910B
16+
commonWord: Ascend910A
17+
resourceName: huawei.com/Ascend910A
18+
resourceMemoryName: huawei.com/Ascend910A-memory
19+
memoryAllocatable: 32768
20+
memoryCapacity: 32768
21+
aiCore: 30
22+
templates:
23+
- name: vir02
24+
memory: 2184
25+
aiCore: 2
26+
- name: vir04
27+
memory: 4369
28+
aiCore: 4
29+
- name: vir08
30+
memory: 8738
31+
aiCore: 8
32+
- name: vir16
33+
memory: 17476
34+
aiCore: 16
35+
- chipName: 910B3
36+
commonWord: Ascend910B
37+
resourceName: huawei.com/Ascend910B
38+
resourceMemoryName: huawei.com/Ascend910B-memory
39+
memoryAllocatable: 65536
40+
memoryCapacity: 65536
41+
aiCore: 20
42+
aiCPU: 7
43+
templates:
44+
- name: vir05_1c_16g
45+
memory: 16384
46+
aiCore: 5
47+
aiCPU: 1
48+
- name: vir10_3c_32g
49+
memory: 32768
50+
aiCore: 10
51+
aiCPU: 3
52+
- chipName: 310P3
53+
commonWord: Ascend310P
54+
resourceName: huawei.com/Ascend310P
55+
resourceMemoryName: huawei.com/Ascend310P-memory
56+
memoryAllocatable: 21527
57+
memoryCapacity: 24576
58+
aiCore: 8
59+
aiCPU: 7
60+
templates:
61+
- name: vir01
62+
memory: 3072
63+
aiCore: 1
64+
aiCPU: 1
65+
- name: vir02
66+
memory: 6144
67+
aiCore: 2
68+
aiCPU: 2
69+
- name: vir04
70+
memory: 12288
71+
aiCore: 4
72+
aiCPU: 4
73+
{{ end }}
74+
1275
{{- end }}

docs/ascend910b-support.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,92 @@ wget https://raw.githubusercontent.com/Project-HAMi/ascend-device-plugin/master/
3333
kubectl apply -f ascendplugin-910-hami.yaml
3434
```
3535

36+
## Custom ascend share configuration
37+
HAMi currently has a [built-in share configuration](https://github.com/Project-HAMi/HAMi/blob/master/charts/hami/templates/scheduler/device-configmap.yaml) for ascend.
38+
39+
You can customize the ascend share configuration by following the steps below:
40+
41+
<details>
42+
<summary>customize ascend config</summary>
43+
44+
### Create a new directory files in hami charts, the directory structure is as follows
45+
46+
```bash
47+
tree -L 1
48+
.
49+
├── Chart.yaml
50+
├── files
51+
├── templates
52+
└── values.yaml
53+
```
54+
55+
### Create the ascend-config.yaml file, the content is as follows
56+
57+
```yaml
58+
vnpus:
59+
- chipName: 910B
60+
commonWord: Ascend910A
61+
resourceName: huawei.com/Ascend910A
62+
resourceMemoryName: huawei.com/Ascend910A-memory
63+
memoryAllocatable: 32768
64+
memoryCapacity: 32768
65+
aiCore: 30
66+
templates:
67+
- name: vir02
68+
memory: 2184
69+
aiCore: 2
70+
- name: vir04
71+
memory: 4369
72+
aiCore: 4
73+
- name: vir08
74+
memory: 8738
75+
aiCore: 8
76+
- name: vir16
77+
memory: 17476
78+
aiCore: 16
79+
- chipName: 910B3
80+
commonWord: Ascend910B
81+
resourceName: huawei.com/Ascend910B
82+
resourceMemoryName: huawei.com/Ascend910B-memory
83+
memoryAllocatable: 65536
84+
memoryCapacity: 65536
85+
aiCore: 20
86+
aiCPU: 7
87+
templates:
88+
- name: vir05_1c_16g
89+
memory: 16384
90+
aiCore: 5
91+
aiCPU: 1
92+
- name: vir10_3c_32g
93+
memory: 32768
94+
aiCore: 10
95+
aiCPU: 3
96+
- chipName: 310P3
97+
commonWord: Ascend310P
98+
resourceName: huawei.com/Ascend310P
99+
resourceMemoryName: huawei.com/Ascend310P-memory
100+
memoryAllocatable: 21527
101+
memoryCapacity: 24576
102+
aiCore: 8
103+
aiCPU: 7
104+
templates:
105+
- name: vir01
106+
memory: 3072
107+
aiCore: 1
108+
aiCPU: 1
109+
- name: vir02
110+
memory: 6144
111+
aiCore: 2
112+
aiCPU: 2
113+
- name: vir04
114+
memory: 12288
115+
aiCore: 4
116+
aiCPU: 4
117+
```
118+
### Helm installation and updates will be based on the configuration in this file, overwriting the built-in configuration of Helm
119+
</details>
120+
121+
36122
## Running Ascend jobs
37123
38124
Ascend 910Bs can now be requested by a container

docs/ascend910b-support_cn.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,90 @@ wget https://raw.githubusercontent.com/Project-HAMi/ascend-device-plugin/master/
3232
kubectl apply -f ascendplugin-910-hami.yaml
3333
```
3434

35+
## 自定义 NPU 虚拟化参数
36+
HAMi 目前有一个 NPU 内置[虚拟化配置文件](https://github.com/Project-HAMi/HAMi/blob/master/charts/hami/templates/scheduler/device-configmap.yaml).
37+
38+
当然 HAMi 也支持通过以下方式自定义虚拟化参数:
39+
<details>
40+
<summary>自定义配置</summary>
41+
42+
### 在 HAMi charts 创建 files 的目录,创建后的目录架构应为如下所示
43+
44+
```bash
45+
tree -L 1
46+
.
47+
├── Chart.yaml
48+
├── files
49+
├── templates
50+
└── values.yaml
51+
```
52+
53+
### 在 files 目录下创建 Create the ascend-config.yaml 文件,配置文件如下所示, 可以按需调整
54+
55+
```yaml
56+
vnpus:
57+
- chipName: 910B
58+
commonWord: Ascend910A
59+
resourceName: huawei.com/Ascend910A
60+
resourceMemoryName: huawei.com/Ascend910A-memory
61+
memoryAllocatable: 32768
62+
memoryCapacity: 32768
63+
aiCore: 30
64+
templates:
65+
- name: vir02
66+
memory: 2184
67+
aiCore: 2
68+
- name: vir04
69+
memory: 4369
70+
aiCore: 4
71+
- name: vir08
72+
memory: 8738
73+
aiCore: 8
74+
- name: vir16
75+
memory: 17476
76+
aiCore: 16
77+
- chipName: 910B3
78+
commonWord: Ascend910B
79+
resourceName: huawei.com/Ascend910B
80+
resourceMemoryName: huawei.com/Ascend910B-memory
81+
memoryAllocatable: 65536
82+
memoryCapacity: 65536
83+
aiCore: 20
84+
aiCPU: 7
85+
templates:
86+
- name: vir05_1c_16g
87+
memory: 16384
88+
aiCore: 5
89+
aiCPU: 1
90+
- name: vir10_3c_32g
91+
memory: 32768
92+
aiCore: 10
93+
aiCPU: 3
94+
- chipName: 310P3
95+
commonWord: Ascend310P
96+
resourceName: huawei.com/Ascend310P
97+
resourceMemoryName: huawei.com/Ascend310P-memory
98+
memoryAllocatable: 21527
99+
memoryCapacity: 24576
100+
aiCore: 8
101+
aiCPU: 7
102+
templates:
103+
- name: vir01
104+
memory: 3072
105+
aiCore: 1
106+
aiCPU: 1
107+
- name: vir02
108+
memory: 6144
109+
aiCore: 2
110+
aiCPU: 2
111+
- name: vir04
112+
memory: 12288
113+
aiCore: 4
114+
aiCPU: 4
115+
```
116+
### Helm 安装、更新将基于该配置文件,覆盖默认的配置文件
117+
</details>
118+
35119
36120
## 运行NPU任务
37121

0 commit comments

Comments
 (0)