How to Define an NPU Cost Model
TOC
PrerequisitesAbout Alauda Build of NPU OperatorProcedureCreate PrometheusRule to generate needed metricsAdd Collection Config (Cost Management Agent)Add Display/Storage Config (Cost Management Server)Add Price For an NPU Cost ModelBilling Method DescriptionCost Details and Cost StatisticsPrerequisites
In the NPU cluster:
- The Alauda Build of NPU Operator is installed
- The Cost Management Agent installed
- ACP v4.2+
About Alauda Build of NPU Operator
Refer to Installing Alauda Build of NPU Operator
Procedure
Create PrometheusRule to generate needed metrics
Create a PrometheusRule in the NPU cluster.
The npu_count metric is required for NPU metering and billing.
Add Collection Config (Cost Management Agent)
Create ConfigMaps in the NPU cluster where the Cost Management Agent runs to declare what to collect.
After adding the yaml , you need to restart the Agent Pod to reload the configurations.
Add Display/Storage Config (Cost Management Server)
Create a ConfigMap in the cluster where the Cost Management Server runs to declare billing items, methods, units, and display names. This tells the server what and how to bill.
After adding the yaml , you need to restart the Server Pod to reload the configurations.
Add Price For an NPU Cost Model
Billing Method Description
If the NPU cluster does not have a Cost model, you need to create a new cost model. Then you can add price for the cost model of the NPU cluster:
- Associate the target NPU cluster with the cost model.
- Select
NPUin Billing Items. - Select
Request Usage (count-hours)orProject Quota (count-hours)in Method. - Set Default Price.
- Configure Price By Label (optional).
Example:
key: modelName
value:
910B4-Ascend-V1
Cost Details and Cost Statistics
Finally, after waiting for 1 or more hours, you can see the cost details in the Cost Details with namespace and card uuid dimensions. And you can see the total costs based on cluster, project, and namespace in the Cost Statistics.
Billing data is generated in the next billing cycle after the usage data is collected, so it may appear several minutes after the hour boundary.