跳到主要内容

Dynamia ascend-device-plugin Chart 0.2.2

发布时间:2026-10-09

版本上一版本版
Chart0.2.10.2.2
appVersionv1.4.1v1.4.2

HAMi Enterprise 兼容性​

功能或模式最低可用 HAMi Enterprise 版本本版配套要求与升级结论
模板化硬切分v2.9.0-rc0可沿用既有调度器,无需因本次插件升级而升级至 v2.10.0-r2。
hami-core 静态软切分,以及本版算力策略、任务优先级、Turbo 和控制注入退出v2.9.0-rc0显式指定 huawei.com/vnpu-mode: hami-core;旧调度器注入的 PostStart 必须能够正常执行,或由工作负载自带的有效 PostStart 避免该注入。满足这些条件时,可沿用既有调度器;运行库状态仍需按下文迁移。
上述软切分功能,且无需旧 PostStart 启动钩子v2.10.0-r2该版本已移除旧启动钩子。容器无法执行旧钩子、且不设置自定义 PostStart 时,需先升级 Enterprise。
显存自动扩容v2.10.0-r2需升级至该配套版本并启用扩容审批和准入保护;使用对应 Chart 时要求 Kubernetes 1.30 或更新版本。审批链路未启用时不会提高显存额度,静态分配不受此门槛限制。

版本变化​

Chart 变化​

  • [企业版特性] 新增 hamiVnpuCore.coreUtilizationPolicy,设置软切分容器的默认算力策略,可选 default、force、disable,默认 force;不依赖 config.create。
  • [企业版特性] 新增 vnpuDeviceSplitCount,默认 10,配置软切分模式下每张物理 NPU 上报的虚拟设备数量。使用内置 deviceConfig 且 config.create=true 时写入设备配置;外部配置的调整方式见升级说明。

应用变化​

  • [企业版特性] 支持经 HAMi Enterprise 审批的虚拟 NPU(vNPU)显存自动扩容。符合条件的单 vNPU 普通业务容器可通过 NPU_MEMORY_AUTO_ADJUST=true 启用;拒绝或超时不增加额度。仅向上扩容,不修改 Pod 资源声明或 AI Core 分配量。启用条件见升级说明。
  • [企业版特性] 支持 NPU_CORE_UTILIZATION_POLICY 算力策略,插件默认向 hami-core 容器注入 force,按分配份额限制平均占空比;default 使用相对权重,disable 关闭算力限制并保留显存控制。容器显式 env 配置优先,包括 valueFrom。
  • [企业版特性] 支持通过业务容器环境变量 NPU_TASK_PRIORITY 设置任务优先级,默认 1,无符号整数越小优先级越高。共享同一物理 NPU 调度状态的任务在提交边界协作式抢占,保留进程和显存;高优先级任务停止提交后,低优先级任务可继续运行;已提交任务自然完成,不保证固定抢占时延,也不提供单容器多设备独立仲裁。持续高优先级需求可能使低优先级任务长期等待;disable、Turbo 和控制注入退出会绕过仲裁。
  • [企业版特性] 随附的 libvnpu v1.4.2 新增 Turbo 模式,精确设置 NPU_TURBO_MODE=true 可关闭算力限速,保留显存限制、记账和经审批的显存扩容。默认关闭,仅适用于可信、算力独占的任务,应申请一张 vNPU 和 100% AI Core。
  • [企业版特性] 支持按容器退出控制库注入。普通业务容器和初始化容器均可通过 Pod env 中的字面量 CANN_DISABLE_CONTROL=true 省略 /etc/ld.so.preload 挂载;不解析 envFrom 或 valueFrom。设备可见性、调度分配和其他挂载不变;未另行加载 libvnpu 时,计算和显存操作使用原生运行时。
  • [企业版特性] 软切分上报数量由最小虚拟化模板计算改为 物理 NPU 数量 × vnpuDeviceSplitCount,无有效配置时每张物理 NPU 默认上报 10 个。节点级正数 vDeviceCount 仍优先,模板化硬切分不变。
  • [企业版特性] 加强软切分分配校验:设备标识、显存额度缺失,或运行信息与调度分配不一致时,拒绝分配。

升级说明​

  • 按所需功能选择 Enterprise 配套。 继续使用硬切分,或满足兼容性表条件的静态软切分时,无需统一升级 Enterprise。旧调度器会为没有自定义 PostStart 的 hami-core 容器注入 bash 启动命令;容器缺少 bash 会导致该钩子失败。若要免除这一旧启动依赖,先升级至 v2.10.0-r2;已有有效 PostStart 的工作负载可保留自己的钩子。该问题在上一版插件中已存在,不是本次新增的整体不兼容。
  • 按实际配置定位共享状态文件。 升级前,记录受影响工作负载实际使用的 NPU_GLOBAL_SHM_PATH、NPU_LOCAL_SHM_PATH,结合容器挂载映射确认宿主机文件。默认全局路径从容器内 /hami-shared-region/<物理设备 ID>_global_registry 映射到宿主机 /usr/local/hami-shared-region/<物理设备 ID>_global_registry;编号取自分配设备的物理 ID。默认本地路径 /hami-vnpu-shmem/vnpu_local_shmem 映射到宿主机 /usr/local/hami-vnpu-core/containers/<Pod UID>_<容器名>/vnpu_local_shmem。如覆盖环境变量、插件 HOOK_PATH 或挂载,以实际路径为准。
  • 停止旧工作负载后迁移状态。 libvnpu v1.4.2 改变了全局调度状态布局和本地共享内存协议。先停止所有使用待迁移文件的旧版软切分工作负载,确认进程退出,再清理对应文件或配置全新路径;不要清理仍被使用的文件,也不要让新旧运行库共用文件。随后升级插件,确认宿主机运行库已更新,再重建工作负载。仅滚动插件不足以完成迁移。
  • 确认镜像覆盖配置。 本版默认镜像为 ghcr.io/dynamia-ai/ascend-device-plugin:v1.4.2。如自定义了 image.tag,需将其更新至目标版本;如设置了 image.digest,需更新为目标镜像摘要或清空该值,因为摘要优先于标签。保留旧镜像会导致本次应用变化未交付到节点。
  • 确认新的默认算力策略。 上一版未注入 NPU_CORE_UTILIZATION_POLICY,通常按相对权重调度;本版未显式配置策略的新建软切分容器默认使用 force,即使没有竞争任务也执行平均占空比限制。需要保留相对权重行为时,设置 hamiVnpuCore.coreUtilizationPolicy=default,或在目标容器的 env 中显式设置 NPU_CORE_UTILIZATION_POLICY=default。策略和 Turbo 模式均应在进程启动前确定,并通过重建 Pod 切换;同一本地共享内存区域内的进程应使用一致配置。
  • 复核软切分上报数量。 本版默认每张物理 NPU 上报 10 个虚拟设备,可能与升级前按最小模板计算的数量不同。需要保持原数量时,设置合适的 vnpuDeviceSplitCount 或节点级 vDeviceCount。默认 config.create=false,数量配置应在实际共享设备 ConfigMap 中调整:HAMi Enterprise Chart 从 2.10.0-r3 起提供 devices.ascend.vnpuDeviceSplitCount;使用较早 Chart 时,可保留插件默认值,或在共享设备配置中显式设置 vnpus.vnpuDeviceSplitCount。若完整覆盖了插件 Chart 的 deviceConfig 字符串,需自行补充该字段。配置更新后重启受影响节点的插件,使其重新读取配置并上报数量;虚拟设备数量变化不增加物理显存或 AI Core 总量。
  • 按需启用显存自动扩容。 先将 Enterprise 升级至 v2.10.0-r2 配套版本,并在 Kubernetes 1.30 或更新版本上设置 devices.ascend.enabled=true、scheduler.admissionWebhook.enabled=true、dra.enabled=false,确认 vNPU 扩容校验 Webhook 已启用。随后按上述顺序迁移运行库状态、升级插件,再为软切分节点上、显式设置 huawei.com/vnpu-mode: hami-core 且只分配一张 vNPU 的普通业务容器,在 Pod env 中设置精确字面量 NPU_MEMORY_AUTO_ADJUST=true。已经满足配套条件时,无需重复升级 Enterprise;初始化容器和单容器多 vNPU 分配不在本次自动扩容范围内。
  • 重新创建使用控制注入退出配置的 Pod。 CANN_DISABLE_CONTROL 在设备分配阶段生效,修改运行中进程的环境变量不会改变挂载结果。此选项退出控制库注入;需要保留显存限制、仅关闭算力限制时,使用 NPU_CORE_UTILIZATION_POLICY=disable 或符合上述条件的 Turbo 模式。

查看Chart 与 appVersion 对应关系或软件中心。

Values 说明​

以下参数说明取自 Chart 0.2.2 发布包随附的 README,保留原文。默认配置以该版本的 values.yaml 为准。

展开参数表
KeyTypeDefaultDescription
config.createboolfalseCreate the bundled device configuration ConfigMap for an installation without HAMi. Leave disabled when HAMi owns the device configuration.
config.deviceConfigMapNamestring"hami-scheduler-device"Name of the device configuration ConfigMap created when config.create=true.
config.existingDeviceConfigMapNamestring"hami-scheduler-device"HAMi-managed device configuration ConfigMap to reuse when config.create=false. The ConfigMap must be in the release namespace.
daemonSet.args[0]string"--config_file"
daemonSet.args[1]string"/device-config.yaml"
daemonSet.args[2]string"--v=4"
daemonSet.args[3]string"--node_config_file"
daemonSet.args[4]string"/node-config.yaml"
daemonSet.namestring"hami-ascend-device-plugin"Device plugin DaemonSet name.
fullnameOverridestring""Override the fully qualified resource name.
hamiVnpuCore.coreUtilizationPolicystring"force"Default compute policy injected into hami-core containers that do not declare NPU_CORE_UTILIZATION_POLICY.
hamiVnpuCore.enabledboolfalseEnable hami-vnpu-core in the bundled device configuration when config.create=true. This mode requires the HAMi scheduler.
image.digeststring""Optional immutable OCI manifest digest. When set, it takes precedence over image.tag.
image.pullPolicystring"IfNotPresent"Kubernetes image pull policy.
image.repositorystring"ghcr.io/dynamia-ai/ascend-device-plugin"Container image repository.
image.tagstring"v1.4.2"Container image tag.
nameOverridestring""Override the chart name used in resource names.
nodeConfigstring"nodes: []"Per-node hami-vnpu-core configuration written to the node ConfigMap.
nodeConfigMap.createbooltrueCreate the per-node configuration ConfigMap.
nodeConfigMap.namestring"hami-device-node-config"Per-node configuration ConfigMap name.
nodeSelector.ascendstring"on"Node label value used to schedule the device plugin.
rbac.namestring"hami-ascend"Name shared by the chart-managed RBAC resources.
resources.limits.cpustring"500m"
resources.limits.memorystring"500Mi"
resources.requests.cpustring"500m"
resources.requests.memorystring"500Mi"
runtimeClass.createbooltrueCreate the Ascend RuntimeClass.
runtimeClass.handlerstring"ascend"Container runtime handler used by the RuntimeClass.
runtimeClass.namestring"ascend"RuntimeClass resource name.
serviceAccount.createbooltrueCreate a ServiceAccount for the device plugin.
serviceAccount.namestring"hami-ascend"ServiceAccount name.
vnpuDeviceSplitCountint10Number of virtual devices advertised per physical Ascend NPU in soft-slicing mode when this chart creates the device configuration. A positive node-level vDeviceCount overrides it.
vnpuMonitor.enabledboolfalseExpose device plugin metrics and create optional Prometheus Operator resources.
vnpuMonitor.prometheusRule.createbooltrueCreate a PrometheusRule when vnpuMonitor.enabled=true.
vnpuMonitor.prometheusRule.groupLabels.vendorstring"ascend"
vnpuMonitor.prometheusRule.groupNamestring"ascend-vnpu"Recording-rule group name.
vnpuMonitor.prometheusRule.intervalstring"15s"Recording-rule evaluation interval.
vnpuMonitor.prometheusRule.labels.releasestring"prometheus"
vnpuMonitor.prometheusRule.labels.rolestring"recording-rules"
vnpuMonitor.prometheusRule.labels.vendorstring"ascend"
vnpuMonitor.prometheusRule.namestring"hami-ascend-vnpu-monitor"PrometheusRule resource name.
vnpuMonitor.prometheusRule.namespacestring"monitoring"Namespace for the PrometheusRule.
vnpuMonitor.service.namestring"hami-ascend-device-plugin-metrics"Headless Service that exposes the device plugin metrics port.
vnpuMonitor.serviceMonitor.createbooltrueCreate a ServiceMonitor when vnpuMonitor.enabled=true.
vnpuMonitor.serviceMonitor.intervalstring"15s"Prometheus scrape interval.
vnpuMonitor.serviceMonitor.labels.releasestring"prometheus"
vnpuMonitor.serviceMonitor.namestring"hami-ascend-vnpu-monitor"ServiceMonitor resource name.
vnpuMonitor.serviceMonitor.namespacestring"monitoring"Namespace for the ServiceMonitor.
vnpuMonitor.serviceMonitor.pathstring"/metrics"Metrics HTTP path.