由于支持x86_64和Arm平台、NPU的标卡和模组等多种场景的混合部署,所以需要给各个工作节点配置标签,便于集群调度组件在各种不同形态的工作节点之间进行调度。

在MindCluster Volcano部署文件“volcano-v{version}.yaml”中,对如下“configurations”中“name”为“selector”的部分进行配置,需要配置到“arguments”中。
...
data:
volcano-scheduler.conf: |
actions: "enqueue, allocate, backfill"
tiers:
- plugins:
- name: priority
- name: gang
- name: conformance
- name: volcano-npu_v5.0.0.2_linux-aarch64 # 其中v5.0.0.2为MindX DL的版本号,根据不同版本,该处编码不同。
- plugins:
- name: drf
- name: predicates
- name: proportion
- name: nodeorder
- name: binpack
configurations:
- name: selector
arguments: {"host-arch":"huawei-arm|huawei-x86",
"accelerator":"huawei-Ascend910|nvidia-tesla-v100|nvidia-tesla-p40",
"accelerator-type":"card|module|half|module-{xxx}b-16|module-{xxx}b-8|card-{xxx}b-2","servertype":"soc"}
...
用户根据需要在训练任务的yaml文件中添加自定义标签,完整的yaml文件请从MindXDL-deploy仓库中下载。其中NPU类型的任务必须包括:host-arch:huawei-arm或host-arch:huawei-x86的nodeSelector标签,其他类型不做限制。
yaml文件的相关配置如下。
...
spec:
containers:
...
nodeSelector:
accelerator: nvidia-tesla-v100
volumes:
...
节点的标签需要在装有K8s的管理节点上操作。
kubectl label nodes {HostName} {label_key}={label_value}
参数说明:
kubectl label nodes ubuntu accelerator=nvidia-tesla-p40
kubectl label nodes {HostName} {label_key}={label_value} --overwrite=true
kubectl label nodes ubuntu accelerator=vidia-tesla-p40 --overwrite=true
kubectl label nodes {HostName} {label_key} -
kubectl label nodes ubuntu accelerator -