Skip to content

Commit

Permalink
Update documents for config & config_cn (#729)
Browse files Browse the repository at this point in the history
* update documents for config

Signed-off-by: limengxuan <[email protected]>
  • Loading branch information
archlitchi authored Dec 24, 2024
1 parent cd12260 commit 311d18b
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 180 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ HAMi provides device virtualization for several heterogeneous devices including
### Device sharing

- Allows partial device allocation by specifying device core usage.
- Allows partial device allocation by specifying device memory.
- Allows partial device allocation by specifying device memory.
- Imposes a hard limit on streaming multiprocessors.
- Requires zero changes to existing programs.
- Support [dynamic-mig](docs/dynamic-mig-support.md) feature, [example](examples/nvidia/dynamic_mig_example.yaml)

<img src="./imgs/example.png" width = "500" />

Expand Down
1 change: 1 addition & 0 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ HAMi 可为多种异构设备提供虚拟化功能,支持设备共享和资源
- 通过设置显存(单位:MB),进行设备的部分分配
- 对流式多处理器进行硬限制
- 无需对现有程序进行任何修改
- 支持[动态MIG切片](docs/dynamic-mig-support_cn.md)能力,[样例](examples/nvidia/dynamic_mig_example.yaml)

<img src="./imgs/example.png" width = "500" />

Expand Down
135 changes: 0 additions & 135 deletions device-config.yaml

This file was deleted.

56 changes: 31 additions & 25 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Global Config

## Device Configs: ConfigMap

**Note:**
All the configurations listed below are managed within the hami-scheduler-device ConfigMap.
You can update these configurations using one of the following methods:
Expand All @@ -10,42 +13,45 @@ You can update these configurations using one of the following methods:
After making changes, restart the related HAMi components to apply the updated configurations.
2. Modify Helm Chart: Update the corresponding values in the [ConfigMap](../charts/hami/templates/scheduler/device-configmap.yaml), then reapply the Helm Chart to regenerate the ConfigMap.

you can customize your vGPU support by setting the following parameters using `-set`, for example

```
helm install hami hami-charts/hami --set devicePlugin.deviceMemoryScaling=5 ...
```
* `devicePlugin.service.schedulerPort:`
Integer type, by default: 31998, scheduler webhook service nodePort.
* `devicePlugin.deviceMemoryScaling:`
Float type, by default: 1. The ratio for NVIDIA device memory scaling, can be greater than 1 (enable virtual device memory, experimental feature). For NVIDIA GPU with *M* memory, if we set `devicePlugin.deviceMemoryScaling` argument to *S*, vGPUs splitted by this GPU will totally get `S * M` memory in Kubernetes with our device plugin.
* `devicePlugin.deviceSplitCount:`
* `nvidia.deviceMemoryScaling:`
Float type, by default: 1. The ratio for NVIDIA device memory scaling, can be greater than 1 (enable virtual device memory, experimental feature). For NVIDIA GPU with *M* memory, if we set `nvidia.deviceMemoryScaling` argument to *S*, vGPUs splitted by this GPU will totally get `S * M` memory in Kubernetes with our device plugin.
* `nvidia.deviceSplitCount:`
Integer type, by default: equals 10. Maximum tasks assigned to a simple GPU device.
* `devicePlugin.migstrategy:`
* `nvidia.migstrategy:`
String type, "none" for ignoring MIG features or "mixed" for allocating MIG device by seperate resources. Default "none"
* `devicePlugin.disablecorelimit:`
* `nvidia.disablecorelimit:`
String type, "true" for disable core limit, "false" for enable core limit, default: false
* `scheduler.defaultMem:`
* `nvidia.defaultMem:`
Integer type, by default: 0. The default device memory of the current task, in MB.'0' means use 100% device memory
* `scheduler.defaultCores:`
* `nvidia.defaultCores:`
Integer type, by default: equals 0. Percentage of GPU cores reserved for the current task. If assigned to 0, it may fit in any GPU with enough device memory. If assigned to 100, it will use an entire GPU card exclusively.
* `scheduler.defaultGPUNum:`
* `nvidia.defaultGPUNum:`
Integer type, by default: equals 1, if configuration value is 0, then the configuration value will not take effect and will be filtered. when a user does not set nvidia.com/gpu this key in pod resource, webhook should check nvidia.com/gpumem、resource-mem-percentage、nvidia.com/gpucores this three key, anyone a key having value, webhook should add nvidia.com/gpu key and this default value to resources limits map.
* `scheduler.defaultSchedulerPolicy.nodeSchedulerPolicy:` String type, default value is "binpack", representing the GPU node scheduling policy. "binpack" means trying to allocate tasks to the same GPU node as much as possible, while "spread" means trying to allocate tasks to different GPU nodes as much as possible.
* `scheduler.defaultSchedulerPolicy.gpuSchedulerPolicy:` String type, default value is "spread", representing the GPU scheduling policy. "binpack" means trying to allocate tasks to the same GPU as much as possible, while "spread" means trying to allocate tasks to different GPUs as much as possible.
* `resourceName:`
* `nvidia.resourceCountName:`
String type, vgpu number resource name, default: "nvidia.com/gpu"
* `resourceMem:`
* `nvidia.resourceMemoryName:`
String type, vgpu memory size resource name, default: "nvidia.com/gpumem"
* `resourceMemPercentage:`
* `nvidia.resourceMemoryPercentageName:`
String type, vgpu memory fraction resource name, default: "nvidia.com/gpumem-percentage"
* `resourceCores:`
* `nvidia.resourceCoreName:`
String type, vgpu cores resource name, default: "nvidia.com/cores"
* `resourcePriority:`
* `nvidia.resourcePriorityName:`
String type, vgpu task priority name, default: "nvidia.com/priority"

# Pod configs: annotations
## Chart Configs: parameters

you can customize your vGPU support by setting the following parameters using `-set`, for example

```
helm install hami hami-charts/hami --set devicePlugin.deviceMemoryScaling=5 ...
```

* `devicePlugin.service.schedulerPort:`
Integer type, by default: 31998, scheduler webhook service nodePort.
* `scheduler.defaultSchedulerPolicy.nodeSchedulerPolicy:` String type, default value is "binpack", representing the GPU node scheduling policy. "binpack" means trying to allocate tasks to the same GPU node as much as possible, while "spread" means trying to allocate tasks to different GPU nodes as much as possible.
* `scheduler.defaultSchedulerPolicy.gpuSchedulerPolicy:` String type, default value is "spread", representing the GPU scheduling policy. "binpack" means trying to allocate tasks to the same GPU as much as possible, while "spread" means trying to allocate tasks to different GPUs as much as possible.

## Pod configs: annotations

* `nvidia.com/use-gpuuuid:`
String type, ie: "GPU-AAA,GPU-BBB"
Expand All @@ -72,7 +78,7 @@ helm install hami hami-charts/hami --set devicePlugin.deviceMemoryScaling=5 ...
Which type of vgpu instance this pod wish to use


# Container configs: env
## Container configs: env

* `GPU_CORE_UTILIZATION_POLICY:`
String type, "default", "force", "disable"
Expand Down
54 changes: 35 additions & 19 deletions docs/config_cn.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
# 全局配置

你可以在安装过程中,通过`-set`来修改以下的客制化参数,例如:
## 设备配置

```
helm install vgpu vgpu-charts/vgpu --set devicePlugin.deviceMemoryScaling=5 ...
```
**注意:**
以下所有配置均在名称为`hami-scheduler-device`的configMap中进行定义,你可以通过以下的方式进行更新:

1. 直接热更新ConfigMap: 成功部署HAMi后, 你可以通过`kubectl edit`指令手动热更新hami-scheduler中的数据,如以下指令所示:
```bash
kubectl edit configmap hami-scheduler-device -n <namespace>
```
更新完毕后,需要重启hami-Scheduler和对应节点上的hami-device-plugin

* `devicePlugin.deviceSplitCount:`
2. 修改Helm Chart: 在[这里](../charts/hami/templates/scheduler/device-configmap.yaml)更新对应的字段,并进行部署

* `nvidia.deviceSplitCount:`
整数类型,预设值是10。GPU的分割数,每一张GPU都不能分配超过其配置数目的任务。若其配置为N的话,每个GPU上最多可以同时存在N个任务。
* `devicePlugin.deviceMemoryScaling:`
浮点数类型,预设值是1。NVIDIA装置显存使用比例,可以大于1(启用虚拟显存,实验功能)。对于有*M*显存大小的NVIDIA GPU,如果我们配置`devicePlugin.deviceMemoryScaling`参数为*S*,在部署了我们装置插件的Kubenetes集群中,这张GPU分出的vGPU将总共包含 `S * M` 显存。
* `devicePlugin.migStrategy:`
* `nvidia.deviceMemoryScaling:`
浮点数类型,预设值是1。NVIDIA装置显存使用比例,可以大于1(启用虚拟显存,实验功能)。对于有*M*显存大小的NVIDIA GPU,如果我们配置`nvidia.deviceMemoryScaling`参数为*S*,在部署了我们装置插件的Kubenetes集群中,这张GPU分出的vGPU将总共包含 `S * M` 显存。
* `nvidia.migStrategy:`
字符串类型,目前支持"none“与“mixed“两种工作方式,前者忽略MIG设备,后者使用专门的资源名称指定MIG设备,使用详情请参考mix_example.yaml,默认为"none"
* `devicePlugin.disablecorelimit:`
* `nvidia.disablecorelimit:`
字符串类型,"true"为关闭算力限制,"false"为启动算力限制,默认为"false"
* `scheduler.defaultMem:`
* `nvidia.defaultMem:`
整数类型,预设值为0,表示不配置显存时使用的默认显存大小,单位为MB。当值为0时,代表使用全部的显存。
* `scheduler.defaultCores:`
* `nvidia.defaultCores:`
整数类型(0-100),默认为0,表示默认为每个任务预留的百分比算力。若设置为0,则代表任务可能会被分配到任一满足显存需求的GPU中,若设置为100,代表该任务独享整张显卡
* `scheduler.defaultGPUNum:`
* `nvidia.defaultGPUNum:`
整数类型,默认为1,如果配置为0,则配置不会生效。当用户在 pod 资源中没有设置 nvidia.com/gpu 这个 key 时,webhook 会检查 nvidia.com/gpumem、resource-mem-percentage、nvidia.com/gpucores 这三个 key 中的任何一个 key 有值,webhook 都会添加 nvidia.com/gpu 键和此默认值到 resources limit中。
* `scheduler.defaultSchedulerPolicy.nodeSchedulerPolicy:` 字符串类型,预设值为"binpack", 表示GPU节点调度策略,"binpack"表示尽量将任务分配到同一个GPU节点上,"spread"表示尽量将任务分配到不同GPU节点上。
* `scheduler.defaultSchedulerPolicy.gpuSchedulerPolicy:` 字符串类型,预设值为"spread", 表示GPU调度策略,"binpack"表示尽量将任务分配到同一个GPU上,"spread"表示尽量将任务分配到不同GPU上。
* `resourceName:`
* `nvidia.resourceCountName:`
字符串类型, 申请vgpu个数的资源名, 默认: "nvidia.com/gpu"
* `resourceMem:`
* `nvidia.resourceMemoryName:`
字符串类型, 申请vgpu显存大小资源名, 默认: "nvidia.com/gpumem"
* `resourceMemPercentage:`
* `nvidia.resourceMemoryPercentageName:`
字符串类型,申请vgpu显存比例资源名,默认: "nvidia.com/gpumem-percentage"
* `resourceCores:`
* `nvidia.resourceCoreName:`
字符串类型, 申请vgpu算力资源名, 默认: "nvidia.com/cores"
* `resourcePriority:`
* `nvidia.resourcePriorityName:`
字符串类型,表示申请任务的任务优先级,默认: "nvidia.com/priority"
## Chart参数
你可以在安装过程中,通过`-set`来修改以下的客制化参数,例如:
```
helm install vgpu vgpu-charts/vgpu --set devicePlugin.deviceMemoryScaling=5 ...
```
* `scheduler.defaultSchedulerPolicy.nodeSchedulerPolicy:` 字符串类型,预设值为"binpack", 表示GPU节点调度策略,"binpack"表示尽量将任务分配到同一个GPU节点上,"spread"表示尽量将任务分配到不同GPU节点上。
* `scheduler.defaultSchedulerPolicy.gpuSchedulerPolicy:` 字符串类型,预设值为"spread", 表示GPU调度策略,"binpack"表示尽量将任务分配到同一个GPU上,"spread"表示尽量将任务分配到不同GPU上。
# Pod配置(在注解中指定)
* `nvidia.com/use-gpuuuid:`
Expand Down

0 comments on commit 311d18b

Please sign in to comment.