Accelerator Quota
Accelerator products usually expose resources through Kubernetes extended resource names. After the product is installed, ACP can use those resource names in project and namespace quota.
Quota resources
After an accelerator product is installed in a cluster, ACP can show corresponding accelerator quota fields at project or namespace scope. The exact resource names and units depend on the product.
Examples include:
- physical NVIDIA GPU count;
- HAMi virtual GPU core and memory resources;
- Ascend NPU resources;
- DRA or vendor-specific resource types.
Show quota fields in ACP
Kubernetes node allocatable resources and ACP quota fields are related but not the same. A node can report an accelerator extended resource, while the ACP quota page still needs resource metadata before it can show the resource as a selectable quota field.
If the node already reports the accelerator resource but the ACP quota page does not show it, register the resource metadata with a ConfigMap in the kube-public namespace.
NOTE
Required rules:
- Create one ConfigMap for each accelerator resource name.
- Create the ConfigMap in the
kube-public namespace.
- Use the
cf-crl-<groupName>-<name> format for metadata.name.
- Set
metadata.labels.features.cpaas.io/type to CustomResourceLimitation.
- Set
metadata.labels.features.cpaas.io/group and data.group to the same group name.
- Set
metadata.labels.features.cpaas.io/enabled to "true".
- Set
data.key to the exact Kubernetes extended resource name, such as nvidia.com/gpualloc or huawei.com/Ascend910.
Use the following fields to control how ACP displays and applies the resource in quota pages:
data.labelEn and data.labelZh: display names shown to users.
data.descriptionEn and data.descriptionZh: help text shown to users.
data.limits: set to required or optional.
data.requests: set to disabled or fromLimits.
data.resourceUnit: resource unit, such as count.
data.relatedResources: resource names that should be used together.
data.excludeResources: resource names that should not be mixed with this resource.
data.ignoreNodeCheck: set to "true" when the quota field is derived from another resource and does not need direct node allocatable checking.
If a product exposes multiple resource names, create one ConfigMap for each resource name. For example, shared GPU products may expose separate resource names for GPU core and GPU memory.
Examples
The following example registers HAMi NVIDIA resource fields for GPU count, vGPU core, and vGPU memory:
apiVersion: v1
data:
dataType: integer
defaultValue: "1"
descriptionEn: Declare how many physical GPUs needs
descriptionZh: 申请的物理 gpu 个数
group: hami-nvidia
groupI18n: '{"zh": "HAMi NVIDIA", "en": "HAMi NVIDIA"}'
key: nvidia.com/gpualloc
labelEn: gpu number
labelZh: gpu 个数
limits: optional
requests: disabled
resourceUnit: "count"
relatedResources: "nvidia.com/gpucores,nvidia.com/gpumem"
excludeResources: "nvidia.com/mps-core,nvidia.com/mps-memory,tencent.com/vcuda-core,tencent.com/vcuda-memory"
runtimeClassName: ""
kind: ConfigMap
metadata:
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: hami-nvidia
features.cpaas.io/type: CustomResourceLimitation
name: cf-crl-hami-nvidia-gpualloc
namespace: kube-public
---
apiVersion: v1
data:
dataType: integer
defaultValue: "20"
descriptionEn: Declare how many cores needs per physical GPU (%)
descriptionZh: 每个物理 GPU 申请的算力(%)
group: hami-nvidia
groupI18n: '{"zh": "HAMi NVIDIA", "en": "HAMi NVIDIA"}'
key: nvidia.com/gpucores
labelEn: vgpu cores
labelZh: vgpu 算力
limits: optional
requests: disabled
resourceUnit: "%"
relatedResources: "nvidia.com/gpualloc,nvidia.com/gpumem"
excludeResources: "nvidia.com/mps-core,nvidia.com/mps-memory,tencent.com/vcuda-core,tencent.com/vcuda-memory"
runtimeClassName: ""
ignoreNodeCheck: "true"
kind: ConfigMap
metadata:
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: hami-nvidia
features.cpaas.io/type: CustomResourceLimitation
name: cf-crl-hami-nvidia-gpucores
namespace: kube-public
---
apiVersion: v1
data:
dataType: integer
defaultValue: "4000"
descriptionEn: Declare how many memory needs per physical GPU (Mi)
descriptionZh: 每个物理 GPU 申请的显存(Mi)
group: hami-nvidia
groupI18n: '{"zh": "HAMi NVIDIA", "en": "HAMi NVIDIA"}'
key: nvidia.com/gpumem
labelEn: vgpu memory
labelZh: vgpu 显存
limits: optional
requests: disabled
resourceUnit: "Mi"
relatedResources: "nvidia.com/gpualloc,nvidia.com/gpucores"
excludeResources: "nvidia.com/mps-core,nvidia.com/mps-memory,tencent.com/vcuda-core,tencent.com/vcuda-memory"
runtimeClassName: ""
ignoreNodeCheck: "true"
kind: ConfigMap
metadata:
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: hami-nvidia
features.cpaas.io/type: CustomResourceLimitation
name: cf-crl-hami-nvidia-gpumem
namespace: kube-public
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-crl-hami-config
namespace: kube-public
labels:
device-plugin.cpaas.io/config: "true"
data:
deviceName: "HAMi"
nodeLabelKey: "gpu"
nodeLabelValue: "on"
The following example registers HAMi Ascend vNPU resource fields for Ascend 310P vNPU count and vNPU memory:
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-crl-hami-ascend310p
namespace: kube-public
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: hami-ascend-vnpu
features.cpaas.io/type: CustomResourceLimitation
data:
dataType: integer
defaultValue: "1"
descriptionEn: Number of Ascend 310P vNPU devices requested
descriptionZh: 申请的 Ascend 310P vNPU 数量
group: hami-ascend-vnpu
groupI18n: '{"zh":"HAMi Ascend vNPU","en":"HAMi Ascend vNPU"}'
key: huawei.com/Ascend310P
labelEn: Ascend 310P vNPU
labelZh: Ascend 310P vNPU
limits: optional
requests: disabled
resourceUnit: "count"
relatedResources: "huawei.com/Ascend310P-memory"
runtimeClassName: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-crl-hami-ascend310p-memory
namespace: kube-public
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: hami-ascend-vnpu
features.cpaas.io/type: CustomResourceLimitation
data:
dataType: integer
defaultValue: "3072"
descriptionEn: Ascend 310P vNPU memory requested per device
descriptionZh: 每个 Ascend 310P vNPU 申请的显存
group: hami-ascend-vnpu
groupI18n: '{"zh":"HAMi Ascend vNPU","en":"HAMi Ascend vNPU"}'
key: huawei.com/Ascend310P-memory
labelEn: Ascend 310P vNPU memory
labelZh: Ascend 310P vNPU 显存
limits: optional
requests: disabled
resourceUnit: "Mi"
relatedResources: "huawei.com/Ascend310P"
runtimeClassName: ""
ignoreNodeCheck: "true"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-crl-hami-ascend-vnpu-config
namespace: kube-public
labels:
device-plugin.cpaas.io/config: "true"
data:
deviceName: "HAMi Ascend vNPU"
nodeLabelKey: "ascend"
nodeLabelValue: "on"
The memory quota field uses ignoreNodeCheck: "true" because it is used together with the vNPU device count field instead of being checked as an independent node allocatable device count.
The following example registers the Ascend 910 resource reported as huawei.com/Ascend910 and the device display metadata for Huawei NPU nodes:
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-crl-huawei-ascend910
namespace: kube-public
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: huawei-npu
features.cpaas.io/type: CustomResourceLimitation
data:
dataType: integer
defaultValue: "1"
descriptionEn: Number of Ascend 910 NPUs requested
descriptionZh: 申请的 Ascend 910 NPU 数量
group: huawei-npu
groupI18n: '{"zh":"Huawei NPU","en":"Huawei NPU"}'
key: huawei.com/Ascend910
labelEn: Ascend 910
labelZh: Ascend 910
limits: optional
requests: disabled
resourceUnit: "count"
runtimeClassName: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-crl-huawei-npu-config
namespace: kube-public
labels:
device-plugin.cpaas.io/config: "true"
data:
deviceName: "Huawei NPU"
nodeLabelKey: "ascend"
nodeLabelValue: "on"
For example, even if the NPU Operator reports huawei.com/Ascend910 in node allocatable resources, ACP can show Ascend 910 in quota pages only after the corresponding CustomResourceLimitation metadata is available.
{
"huawei.com/Ascend910": "8"
}
The following example registers the physical NVIDIA GPU resource reported as nvidia.com/gpu:
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-crl-nvidia-gpu
namespace: kube-public
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: nvidia-gpu
features.cpaas.io/type: CustomResourceLimitation
data:
dataType: integer
defaultValue: "1"
descriptionEn: Number of NVIDIA GPUs requested
descriptionZh: 申请的 NVIDIA GPU 数量
group: nvidia-gpu
groupI18n: '{"zh":"NVIDIA GPU","en":"NVIDIA GPU"}'
key: nvidia.com/gpu
labelEn: NVIDIA GPU
labelZh: NVIDIA GPU
limits: optional
requests: disabled
resourceUnit: "count"
runtimeClassName: ""
For other accelerator products, keep the same ACP metadata model and replace the resource key, labels, display names, unit, and device information with the values exposed by that product.
Use ACP quota pages for operations such as adding a cluster to a project, creating a namespace, or changing namespace quota. Use accelerator product documentation to understand which resource names a product exposes and what each unit means.
Quota pages
Related pages