How to Define a Whole NPU Cost Model
This procedure registers Ascend whole-NPU allocation and, optionally, project NPU quota as billing items. It measures allocated devices, not AI-core, HBM, or runtime utilization.
TOC
What this configuration provides1. Create the recording rule2. Create the collection configuration3. Create the display configuration4. Add prices to the cost model5. Verify the resultWhat this configuration provides
- Allocation: one assigned NPU device contributes one NPU-hour.
- Project quota (optional): the project's hard NPU quota can be accumulated as NPU-hours.
- Model pricing: allocation records retain the NPU model, so different models can have different prices.
- Project-quota pricing: quota records have no device or model dimension, so use one project-level base price.
1. Create the recording rule
Where to apply this configuration
Apply this PrometheusRule in the cluster that contains the NPUs and npu-exporter. Before applying it, confirm that the exporter target is healthy and that npu_chip_info_name has vdie_id, name, and namespace labels.
The requests.huawei.com/Ascend910 value is only an example. Replace it with the exact NPU resource key exposed by the target cluster, including the actual accelerator model or model suffix. Check the resource label of cpaas_project_resourcequota in Prometheus before applying the rule. If the key does not match, the project-quota metric remains empty and no ProjectQuota usage is collected.
The project-quota rule is optional. Remove it when project-quota billing is not required.
Verify the normalized metrics in Prometheus:
Both the exporter target and the required normalized query must be healthy before continuing.
2. Create the collection configuration
Where to apply this configuration
Apply this ConfigMap in the NPU cluster where the Cost Management Agent runs.
The label_ prefix is required in the Prometheus label source. Cost Management stores label_modelName as the billing label modelName.
After applying the ConfigMap, reload the Cost Management Agent:
3. Create the display configuration
Where to apply this configuration
Apply this ConfigMap in the Global cluster where the Cost Management Server runs.
After applying the ConfigMap, reload the Cost Management Server:
4. Add prices to the cost model
In the platform console, open Metering and Billing > Cost Models and create or edit the cost model linked to the NPU cluster.
Project Quota is optional and has no NPU model dimension. Do not configure modelName price overrides for this method.
For model-specific allocation prices, use the exact value from the exporter as a modelName label override. The value is case-sensitive.
5. Verify the result
Wait for at least one hourly billing window. Verify the result in this order:
- Usage: confirm an NPU usage record exists with the expected cluster, namespace, UUID, and model label.
- Bill: confirm a bill is generated and the expected default or model-specific price is applied.
- Console: confirm the item and amount appear in cost details and statistics.
For shared deployment rules, see Configuration Conventions.