在安装MindCluster Ascend Device Plugin前,需要提前了解相关约束,具体说明请参见表1。
约束场景 |
约束说明 |
---|---|
NPU驱动 |
MindCluster Ascend Device Plugin会周期性调用NPU驱动的相关接口。如果要升级驱动,请先停止业务任务,再停止MindCluster Ascend Device Plugin容器服务。 |
配合MindCluster Ascend Docker Runtime使用 |
组件安装顺序要求如下: MindCluster Ascend Device Plugin容器化运行时会自动识别是否安装了MindCluster Ascend Docker Runtime,需要优先安装MindCluster Ascend Docker Runtime后MindCluster Ascend Device Plugin才能正确识别MindCluster Ascend Docker Runtime的安装情况。 MindCluster Ascend Device Plugin若部署在Atlas 200I SoC A1 核心板上,无需安装MindCluster Ascend Docker Runtime。 |
组件版本要求如下: 该功能要求MindCluster Ascend Docker Runtime与MindCluster Ascend Device Plugin版本保持一致且需要为5.0.RC1及以上版本,安装或卸载MindCluster Ascend Docker Runtime之后需要重启容器引擎才能使MindCluster Ascend Device Plugin正确识别。 |
|
以下2种场景不支持MindCluster Ascend Device Plugin和MindCluster Ascend Docker Runtime配合使用。
|
|
DCMI动态库 |
DCMI动态库目录权限要求如下: MindCluster Ascend Device Plugin调用的DCMI动态库及其所有父目录,需要满足属主为root,其他属主程序无法运行;同时,这些文件及其目录需满足group和other不具备写权限。 |
DCMI动态库路径深度必须小于20。 |
|
如果通过设置LD_LIBRARY_PATH设置动态库路径,LD_LIBRARY_PATH环境变量总长度不能超过1024。 |
|
Atlas 200I SoC A1 核心板 |
Atlas 200I SoC A1 核心板节点上如果使用容器化部署MindCluster Ascend Device Plugin,需要配置多容器共享模式,具体请参考《Atlas 200I SoC A1 核心板 NPU驱动和固件安装指南》。 |
Atlas 200I SoC A1 核心板使用MindCluster Ascend Device Plugin组件,需要遵循以下配套关系:
|
|
虚拟机场景 |
如果在虚拟机场景下部署MindCluster Ascend Device Plugin,需要在MindCluster Ascend Device Plugin的镜像中安装systemd,推荐在Dockerfile中加入RUN apt-get update && apt-get install -y systemd命令进行安装。 |
docker images | grep k8sdeviceplugin
回显示例如下:
ascend-k8sdeviceplugin v6.0.RC2 29eec79eb693 About an hour ago 105MB
yaml文件列表 |
说明 |
---|---|
device-plugin-310-v{version}.yaml |
推理服务器(插Atlas 300I 推理卡)上不使用MindCluster Volcano的配置文件。 |
device-plugin-310-volcano-v{version}.yaml |
推理服务器(插Atlas 300I 推理卡)上使用MindCluster Volcano的配置文件。 |
device-plugin-310P-1usoc-v{version}.yaml |
Atlas 200I SoC A1 核心板上不使用MindCluster Volcano的配置文件。 |
device-plugin-310P-1usoc-volcano-v{version}.yaml |
Atlas 200I SoC A1 核心板上使用MindCluster Volcano的配置文件。 |
device-plugin-310P-v{version}.yaml |
Atlas 推理系列产品上不使用MindCluster Volcano的配置文件。 |
device-plugin-310P-volcano-v{version}.yaml |
Atlas 推理系列产品上使用MindCluster Volcano的配置文件。 |
device-plugin-910-v{version}.yaml |
Atlas 训练系列产品、Atlas A2 训练系列产品或Atlas 800I A2 推理服务器上不使用MindCluster Volcano的配置文件。 |
device-plugin-volcano-v{version}.yaml |
Atlas 训练系列产品、Atlas A2 训练系列产品或Atlas 800I A2 推理服务器上使用MindCluster Volcano的配置文件。 |
如果不使用MindCluster Volcano作为调度器,在启动MindCluster Ascend Device Plugin的时候,需要修改“run_for_310P_1usoc.sh”中MindCluster Ascend Device Plugin的启动参数,将“-volcanoType”参数设置为false。
... containers: - image: ascend-k8sdeviceplugin:v6.0.RC2 name: device-plugin-01 resources: requests: memory: 500Mi cpu: 500m limits: memory: 500Mi cpu: 500m command: [ "/bin/bash", "-c", "--"] args: [ "device-plugin -useAscendDocker=true -volcanoType=true # 重调度场景下必须使用MindCluster Volcano -autoStowing=true # 是否开启自动纳管开关,默认为true;设置为false代表关闭自动纳管,当芯片健康状态由unhealth变为health后,不会自动加入到可调度资源池中;关闭自动纳管,当芯片参数面网络故障恢复后,不会自动加入到可调度资源池中。该特性仅适用于Atlas 训练系列产品 -listWatchPeriod=5 # 健康状态检查周期,范围[3,60];默认5秒 -hotReset=1 # 使用断点续训时,可以在重调度的基础上,开启热复位功能,使用优雅容错模式 -logFile=/var/log/mindx-dl/devicePlugin/devicePlugin.log -logLevel=0" ] securityContext: privileged: true readOnlyRootFilesystem: true ...
containers: - image: ascend-k8sdeviceplugin:v6.0.RC2 name: device-plugin-01 resources: requests: memory: 500Mi cpu: 500m limits: memory: 500Mi cpu: 500m command: [ "/bin/bash", "-c", "--"] args: [ "device-plugin ... -hotReset=0 # 使用推理卡故障恢复时,开启热复位功能 -logFile=/var/log/mindx-dl/devicePlugin/devicePlugin.log -logLevel=0" ] ...
kubectl apply -f device-plugin-910-v{version}.yaml
kubectl apply -f device-plugin-volcano-v{version}.yaml
kubectl apply -f device-plugin-310-v{version}.yaml
kubectl apply -f device-plugin-310-volcano-v{version}.yaml
kubectl apply -f device-plugin-310P-v{version}.yaml
kubectl apply -f device-plugin-310P-volcano-v{version}.yaml
kubectl apply -f device-plugin-310P-1usoc-volcano-v{version}.yaml
kubectl apply -f device-plugin-310P-1usoc-v{version}.yaml
如果K8s集群使用了多种类型的昇腾AI处理器,请分别执行对应命令。
启动示例如下:
serviceaccount/ascend-device-plugin-sa created clusterrole.rbac.authorization.K8s.io/pods-node-ascend-device-plugin-role created clusterrolebinding.rbac.authorization.K8s.io/pods-node-ascend-device-plugin-rolebinding created daemonset.apps/ascend-device-plugin-daemonset created
kubectl get pod -n kube-system
回显示例如下,出现Running表示组件启动成功。
NAME READY STATUS RESTARTS AGE ... ascend-device-plugin-daemonset-d5ctz 1/1 Running 0 11s ...
参数 |
类型 |
默认值 |
说明 |
---|---|---|---|
-fdFlag |
bool |
false |
边缘场景标志,是否使用FusionDirector系统来管理设备。
|
-shareDevCount |
uint |
1 |
共享设备特性开关,取值范围为1~100。 默认值为1,代表不开启共享设备;取值为2~100,表示单颗芯片虚拟化出来的共享设备个数。 支持以下设备,其余设备该参数无效,不影响组件正常启动。
说明:
若用户使用的是以上支持的Atlas 推理系列产品产品,需要注意以下问题:
|
-edgeLogFile |
string |
/var/alog/AtlasEdge_log/devicePlugin.log |
边缘场景日志文件。fdFlag设置为true时生效。 说明:
单个日志文件超过20 MB时会触发自动转储功能,文件大小上限不支持修改。 |
-useAscendDocker |
bool |
true |
容器引擎是否使用MindCluster Ascend Docker Runtime。开启K8s的CPU绑核功能时,需要卸载MindCluster Ascend Docker Runtime并重启容器引擎。
说明:
MindX 5.0.RC1及以上版本只支持自动获取运行模式,不接受指定。 |
-use310PMixedInsert |
bool |
false |
是否使用Atlas 推理系列产品混插模式。
说明:
|
-volcanoType |
bool |
false |
是否使用MindCluster Volcano进行调度,当前已支持Atlas 训练系列产品、Atlas A2 训练系列产品、Atlas 推理系列产品和推理服务器(插Atlas 300I 推理卡)芯片。
|
-presetVirtualDevice |
bool |
true |
虚拟化功能开关。
|
-version |
bool |
false |
是否查询MindCluster Ascend Device Plugin的版本号。
|
-listWatchPeriod |
int |
5 |
设置健康状态检查周期,取值范围为3~60,单位为秒。 |
-autoStowing |
bool |
true |
是否自动纳管已修复设备,volcanoType为true时生效。
说明:
设备故障后,会自动从K8s里面隔离。如果设备恢复正常,默认会自动加入K8s集群资源池。如果设备不稳定,可以设置为false,此时需要手动纳管。
|
-logLevel |
int |
0 |
日志级别:
|
-maxAge |
int |
7 |
日志备份时间限制,取值范围为7~700,单位为天。 |
-logFile |
string |
/var/log/mindx-dl/devicePlugin/devicePlugin.log |
非边缘场景日志文件。fdFlag设置为false时生效。 说明:
单个日志文件超过20 MB时会触发自动转储功能,文件大小上限不支持修改。转储后文件的命名格式为:devicePlugin-触发转储的时间.log,如:devicePlugin-2023-10-07T03-38-24.402.log。 |
-hotReset |
int |
-1 |
设备热复位功能参数。开启此功能,芯片发生故障后,会进行热复位操作,让芯片恢复健康。
该参数支持的训练设备:
该参数支持的推理设备:
说明:
|
-linkdownTimeout |
int |
30 |
网络linkdown超时时间,单位秒;取值范围为1~30。 说明:
该参数取值建议与用户在训练脚本中配置的HCCL_RDMA_TIMEOUT时间一致。如果是多任务,建议设置为多任务中HCCL_RDMA_TIMEOUT的最小值。 |
-dealWatchHandler |
bool |
false |
当informer链接因异常结束时,是否需要刷新本地的pod informer缓存。
|
-maxBackups |
int |
30 |
转储后日志文件保留个数上限,取值范围为1~30,单位为个。 |
-h或者-help |
无 |
无 |
显示帮助信息。 |