Method, device and equipment for estimating energy consumption of power domain and storage medium
By obtaining power domain performance information and determining the power consumption model in the offline state, the problems of inaccurate calculation and resource waste in online energy consumption estimation are solved, and efficient and accurate power domain energy consumption estimation is achieved.
Patent Information
- Application Number
- CN202411440743.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-21
AI Technical Summary
When performing energy consumption estimation online, the PMU acquisition program and a large number of floating-point operations lead to inaccurate power consumption calculations in the power domain, and increases resource waste and time consumption, affecting the efficiency of energy consumption estimation.
Get the performance information of the power domain in multiple scenarios in the offline state, determine the power consumption model, and then use the model to estimate the energy consumption in the online state to avoid the online PMU collection and model modeling.
The energy consumption of the power domain determined by offline power consumption models is improved, which improves the accuracy and efficiency of energy consumption estimation, and reduces the impact on the original performance.
Smart Images

Figure CN119336578A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of energy consumption estimation, and in particular to a method, device, equipment and storage medium for estimating energy consumption of a power domain. Background Art
[0002] At present, with the continuous expansion of data center scale and the growing computing demand, energy consumption estimation is often needed. Energy consumption estimation is used to optimize resource allocation, reduce operating costs and improve energy efficiency.
[0003] Normally, the estimation of energy consumption mainly depends on the fitting of the power consumption model. In the related technology, the fitting of the power consumption model usually uses the online PMU (Performance Monitoring Unit) acquisition program and a large number of floating-point operations. However, the online PMU acquisition program and operation will affect the original performance power consumption in the power domain to a certain extent, making the calculation of the power consumption of the power domain inaccurate. In addition, the online PMU acquisition program and operation are prone to generate more overhead, resulting in resource waste and time consumption during model fitting, affecting the efficiency of online energy consumption estimation. Summary of the invention
[0004] Embodiments of the present application provide a method, apparatus, device, and storage medium for estimating energy consumption of a power domain.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for estimating the energy consumption of a power domain, including: in an offline state, obtaining performance information of the power domain in multiple scenarios; based on the performance information, determining a power consumption model of the power domain; the power consumption model is used to determine the power consumption of the power domain in an online state.
[0007] It can be understood that, in an offline state, the performance information of the power domain in multiple scenarios is obtained, and the power consumption model of the power domain is determined based on the performance information; the power consumption model determined offline can be used online, that is, various operating time information of the power domain is collected online, and substituted into the power consumption model, so as to directly estimate the energy consumption of the power domain, thereby avoiding the time and resources consumed by online collection of PMU parameters and a large amount of floating-point calculations when using the PMU parameter model, thereby avoiding the impact on the original performance of the power domain when using the PMU model for energy consumption estimation, realizing lightweight model parameter acquisition and calculation, and effectively improving the accuracy and efficiency of online estimation of power domain energy consumption.
[0008] In the second aspect, an embodiment of the present application provides a method for estimating the energy consumption of a power domain, including: obtaining operating information of the power domain in an online state; using the operating information and a power consumption model of the power domain to obtain the energy consumption of the power domain; the power consumption model is obtained in an offline state based on the performance information of the power domain in multiple scenarios.
[0009] It can be understood that determining the power consumption model in an offline state and using the power consumption model in an online state avoids PMU collection and PMU modeling in an online state. The amount of data collected by PMU is large and the amount of calculation required for PMU modeling is large. Based on this, only simple operation information (CPU time information and power consumption characterization item information of non-CPU hardware modules) needs to be collected in an online state, which realizes lightweight online calculation. The power consumption model can be used to quickly and accurately estimate the energy consumption of the power domain.
[0010] In a third aspect, an embodiment of the present application provides a device for estimating energy consumption of a power domain, including:
[0011] A first acquisition module is used to acquire performance information of power domains in multiple scenarios in an offline state;
[0012] The first determination module is used to determine the power consumption model of the power domain based on the performance information; the power consumption model is used to determine the power consumption of the power domain in an online state.
[0013] In a fourth aspect, an embodiment of the present application provides a device for estimating energy consumption of a power domain, including:
[0014] The second acquisition module is used to acquire the operation information of the power domain in an online state;
[0015] The second determination module is used to obtain the energy consumption of the power domain by using the operation information and the power consumption model of the power domain; the power consumption model is obtained in an offline state based on the performance information of the power domain in multiple scenarios.
[0016] In a fifth aspect, an embodiment of the present application provides a device for estimating energy consumption of a power domain, including a memory and a processor, wherein the memory is used to store executable data instructions; when the processor is used to execute the executable data instructions stored in the memory, the steps in the above method are implemented.
[0017] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0019] Figure 1a A schematic diagram of the relationship between frequency and voltage of a CPU in a shallow sleep state provided in an embodiment of the present application;
[0020] Figure 1b A schematic diagram of the relationship between frequency and voltage of a CPU in a deep sleep state provided in an embodiment of the present application;
[0021] Figure 2 One of the flowcharts of a method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of obtaining information in a method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0023] Figure 4 A second flow chart of a method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0024] Figure 5 A third flow chart of a method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of verifying a method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0026] Figure 7 A fourth flowchart of a method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of online use of a power consumption model in a method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0028] Fig. 9 One of the flowcharts of an exemplary method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0029] Fig.10 A second flowchart of an exemplary method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0030] Fig.11 A third flowchart of an exemplary method for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0031] Fig.12 One of the structural schematic diagrams of a device for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0032] Fig.13 A second structural diagram of a device for estimating energy consumption of a power domain provided in an embodiment of the present application;
[0033] Fig.14 A hardware entity diagram of a device for estimating energy consumption of a power domain provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0035] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0036] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are merely to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0037] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those skilled in the art in the field to which the embodiments of the present application belong. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0038] The following is an illustrative introduction to the energy consumption estimation method, device, equipment and storage medium of the power domain provided in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application.
[0039] It should be noted that the power domain may include a CPU or non-CPU hardware modules. The CPU state includes a working state and an idle state, and the CPU idle state includes a CPU light sleep state and a CPU deep sleep state.
[0040] In the embodiment of the present application, when the CPU is in a light sleep state, the relationship between the CPU frequency and voltage is as follows: Figure 1a As shown in the figure, it can be seen that the higher the CPU frequency, the higher the CPU voltage, and the frequency and voltage are positively correlated. The relationship between the CPU frequency and voltage in the deep sleep state is as follows Figure 1b As shown in the figure, it can be seen that the CPU frequency and voltage do not have a positive correlation trend. Therefore, the CPU in two different idle states should be treated separately in the power consumption model.
[0041] In the embodiments of the present application, Figure 2 One of the flow charts of a method for estimating energy consumption of a power domain provided in an embodiment of the application, the method may include S101 and S102:
[0042] S101. In an offline state, obtain performance information of power domains in multiple scenarios.
[0043] In some embodiments, the estimation of the energy consumption of the power domain is performed online, and the power consumption model used for the estimation is generated offline. That is to say, if there is an electronic device whose power domain energy consumption is to be estimated, when the electronic device is not used online, first, the performance information of the power domain in multiple scenarios is obtained through experiments, and then the power consumption model is established in the experiment using the performance information; secondly, when the electronic device whose power domain energy consumption is to be estimated is in online use, the energy consumption of the power domain is estimated using the obtained power consumption model.
[0044] In the embodiments of the present application, there is no limitation on the multiple scenarios, which are, in short, different scenarios where the power domains are located.
[0045] In some embodiments, the multiple scenarios include one or more of the following: a scenario in which the power domain is at multiple temperatures; a scenario in which the CPU in the power domain is at multiple frequencies; a scenario in which the non-CPU hardware modules in the power domain are at multiple frequencies; a scenario in which the CPU and / or non-CPU hardware modules in the power domain have multiple workloads.
[0046] In the embodiment of the present application, there is no limitation on the performance information of the power domain. In short, the performance information is from the power domain and can be used to establish the power consumption model.
[0047] In some embodiments, the performance information includes one or more of the following: CPU frequency in the power domain; CPU voltage in the power domain; PMC (Performance Monitoring Count) in the power domain; power consumption characterization item information of non-CPU hardware modules in the power domain; CPU temperature in the power domain; actual power consumption of the power domain.
[0048] In some embodiments, the method of obtaining the performance information of the power domain in multiple scenarios is as follows: Figure 3 As shown, including S1111 to S1114:
[0049] S1111: Initialize the PMU monitoring hardware unit;
[0050] S1112: Record the PMU count value, temperature, CPU frequency, and CPU running time;
[0051] S1113: Determine whether the CPU enters the sleep state. If the CPU enters the sleep state, record the PMU count value and temperature, CPU frequency, and CPU running time again. If the CPU does not enter the sleep state;
[0052] S1114: Determine whether the PMU count value meets the recording cycle (preset time); if the recording cycle is reached, record the PMU count value and temperature, CPU frequency, and CPU running time again. If the recording cycle is not reached, continue to determine whether the CPU enters the sleep state.
[0053] Exemplarily, the PMU acquisition module is used to periodically collect PMU data of the CPU, including but not limited to cpu_cycles, stall_backend, l1d_cache, etc. This part of the data will be obtained from the hardware register.
[0054] S102 . Determine a power consumption model of the power domain based on the performance information; the power consumption model is used to determine the power consumption of the power domain in an online state.
[0055] In an embodiment of the present application, various data of the CPU or non-CPU hardware modules in the power domain can be obtained based on the performance information of the power domain, and the power consumption model of the power domain is established through the data.
[0056] In some embodiments, the power consumption model of the power domain may include two types. One is that when there is only a CPU in the power domain and no non-CPU hardware modules exist, the power consumption model of the power domain belongs to the first type of power consumption model; the other is that when there are non-CPU hardware modules in the power domain, the power consumption model of the power domain belongs to the second type of power consumption model.
[0057] In an embodiment of the present application, determining the power consumption model of the power domain is performed offline, and the process of using the power consumption model to calculate the power consumption of the power domain and then determining the energy consumption of the power domain is performed online.
[0058] In some embodiments, various operating time information of the power domain is collected online and substituted into the power consumption model to directly calculate the energy consumption of the power domain.
[0059] It can be understood that, in an offline state, the performance information of the power domain in multiple scenarios is obtained, and the power consumption model of the power domain is determined based on the performance information; the power consumption model determined offline can be used online, that is, various operating time information of the power domain is collected online, and substituted into the power consumption model, so as to directly estimate the energy consumption of the power domain, thereby avoiding the time and resources consumed by online collection of PMU parameters and a large amount of floating-point calculations when using the PMU parameter model, thereby avoiding the impact on the original performance of the power domain when using the PMU model for energy consumption estimation, realizing lightweight model parameter acquisition and calculation, and effectively improving the efficiency of online estimation of power domain energy consumption.
[0060] In some embodiments, Figure 4 As shown, S102 may include S201 to S203:
[0061] S201 . Perform multivariate linear regression fitting based on performance information to determine a first static power consumption model of the power domain.
[0062] In an embodiment of the present application, the performance information of the power domain includes information that enables the power domain to perform multivariate linear regression fitting, and the PMU is used to perform multivariate linear regression fitting on the power consumption to obtain a power consumption model of the power domain.
[0063] In the embodiment of the present application, the power consumption model of the power domain is obtained by multivariate linear regression fitting, and the power consumption model includes a static power consumption model and a dynamic power consumption model. Since the PMU model can separate the contribution of each factor to the power domain, after obtaining the power consumption model of the power domain, the precise separation of the PMU model is used to obtain a high-precision first static power consumption model of the power domain.
[0064] In an embodiment of the present application, the first static power consumption model includes the sum of the static power consumption of the CPU in the power domain during normal operation, light sleep, and deep sleep, wherein, when the CPU is in light sleep, the power consumption of the CPU is correlated with the frequency, but the CPU clock is turned off, therefore, the power consumption in the light sleep state is attributed to the part of the first static power consumption that is related to voltage and temperature; when the CPU is in deep sleep, the power consumption of the CPU is not correlated with the frequency, and its core logic circuit is turned off, therefore, this part is understood as constant leakage current power consumption, therefore, it is attributed to the constant term of the first static power consumption.
[0065] In some embodiments, the first static power consumption model is mainly related to the leakage current and voltage of the device in the power domain, and the leakage current has a high correlation with the temperature. Therefore, the first static power consumption is mainly determined by the voltage and temperature.
[0066] Exemplarily, the PMU is used to perform a multivariate linear regression fit on the power consumption to obtain a power consumption model of the power domain:
[0067]
[0068] Among them, P cluster represents the power consumption model of the multivariate linear regression fit, n represents the total number of PMU events in the power consumption model, and β n Represents the regression coefficient in multiple choice linear regression, E n It represents the result of dividing the PMU event rate within the power domain by MHz. V represents the operating voltage of the power domain. f clk It represents the operating frequency of the CPU, and Temp represents the temperature of the CPU.
[0069] The first static power consumption model of the power domain with high accuracy is obtained by using the PMU model separation:
[0070] P static =C1V+C2Temp+C3Temp 2 +C4Temp+C0 (2)
[0071] Among them, P static Characterizing the first static power consumption model, C1, C2, C3, C4, and C0 are constants and are obtained by a multivariate linear regression model.
[0072] S202: Determine a first dynamic power consumption model based on the first static power consumption model and actual power consumption of the power domain.
[0073] In an embodiment of the present application, the first static model of the power domain is obtained by using the precise separation of the PMU model, and the actual power consumption of the power domain includes the first static power consumption and the first dynamic power consumption of the power domain.
[0074] In an embodiment of the present application, after obtaining the actual power consumption of the power domain, a difference operation is performed between the actual power consumption and the first static power consumption model to obtain the actual dynamic power consumption. The actual dynamic power consumption is used as the value to be fitted in the first dynamic power consumption model. When the CPU running time and CPU frequency are input, the first dynamic power consumption model is obtained.
[0075] In the embodiment of the present application, there is no limitation on the method for obtaining the actual power consumption of the power domain, and in short, the actual power consumption of the power domain can be obtained. For example, the actual power consumption of the power domain can be obtained through a power consumption acquisition peripheral.
[0076] Exemplarily, based on the first static power consumption model and the actual power consumption of the power domain, the first dynamic power consumption model is determined:
[0077] P dynamic =C d V 2 f clk (3)
[0078] Among them, P dynamic Characterize the first dynamic power consumption, C d Characterize the first capacitance.
[0079] S203 : Determine a power consumption model of the power domain based on the first static power consumption model and the first dynamic power consumption model.
[0080] In an embodiment of the present application, after obtaining the first static power consumption model and the first dynamic power consumption model, the power consumption model of the power domain is obtained by summing the first static power consumption model and the first dynamic power consumption model.
[0081] It should be noted that, according to the types of hardware modules included in the power domain, the power domain can be divided into two categories, the first category is the power domain with only the CPU, and the second category is the power domain with the CPU and non-CPU hardware modules. In the embodiment of the present application, the first dynamic power consumption model is determined based on the first static power consumption model and the actual power consumption of the power domain, and is only applicable to the model fitting of the first type of power domain, that is, it is only applicable to the model fitting of the power domain with the CPU but no non-CPU type hardware modules.
[0082] Exemplarily, the first static power consumption model is P static , the first dynamic power consumption model is P dynamic , then the power consumption model of the power domain is:
[0083] P1=P static +P dynamic (4)
[0084] P1 represents the power consumption of the power domain when only the CPU exists in the power domain.
[0085] According to formula (2) and formula (3), formula (4) is transformed to obtain:
[0086] P1=C d V 2 f clk +c1v+C2Temp+C3Temp 2 +C4Temp+C0 (5)
[0087] It can be understood that, on the one hand, based on the performance information, a multivariate linear regression fitting is performed to determine the first static power consumption model of the power domain. After obtaining the power consumption model of the power domain, the first static power consumption model of the power domain is obtained by using the precise separation of the PMU model, thereby achieving the acquisition of a high-precision first static power consumption model. On the other hand, the actual power consumption and the first static power consumption model are used to perform a difference operation, and the result obtained is the first dynamic power consumption model, so that the power consumption model of the power domain is obtained based on the sum of the first static power consumption and the first dynamic power consumption model. In the case where only the CPU exists in the power domain, the offline fitting of the power consumption model of the power domain is realized, that is, the first static power consumption is extracted during offline fitting, and the first static power consumption model includes the sum of the static power consumption of the CPU in the power domain during normal operation, light sleep, and deep sleep. The fitted power consumption model is more fully close to the actual static power consumption of the power domain, and when the power consumption model is used online for energy consumption estimation, the online estimation not only covers the dynamic power consumption, but also covers the static power consumption. Based on this, the accuracy of the power consumption model is effectively improved.
[0088] In some embodiments, S202 may include:
[0089] Perform a difference operation between the actual power consumption and the first static power consumption model to determine the first dynamic power consumption model.
[0090] In an embodiment of the present application, the first dynamic power consumption model is determined based on the first static power consumption model and the actual power consumption of the power domain by performing a difference operation between the actual power consumption and the first static power consumption model, and the result of the calculation is the first dynamic power consumption model.
[0091] It can be understood that the first dynamic power consumption model is determined by performing a difference operation between the actual power consumption and the first static power consumption model, thereby achieving the effectiveness of the fitting of the first dynamic power consumption model.
[0092] In some embodiments, Figure 5 As shown, S102 may include S301:
[0093] S301. When a non-CPU hardware module exists in a power domain, based on performance information, model the power consumption of the power domain and determine a second power consumption model, where the second power consumption model is the power consumption model of the power domain.
[0094] In some embodiments, the power domains are divided into two categories, the first category is a power domain with only a CPU, and the second category is a power domain with a CPU and non-CPU hardware modules. For the fitting of the power consumption model of the first category of power domains, reference can be made to S201 to S203; for the fitting of the power consumption model of the second category of power domains, the power consumption model of the second category of power domains is determined based on the power consumption characterization item information of the non-CPU hardware modules.
[0095] In the embodiment of the present application, the second power consumption model is a model when a non-CPU hardware module (a second type of power domain) exists in the power domain.
[0096] In the embodiment of the present application, the power consumption characterization item information of the non-CPU hardware module indicates the frequency and characteristic information of the non-CPU hardware module. The power consumption characterization item information of the non-CPU hardware module can be used to obtain the characterization item of the non-CPU hardware module, and then the power consumption of the non-CPU hardware module can be characterized.
[0097] In an embodiment of the present application, when there is a non-CPU hardware module in the power domain (a second type of power domain), the power consumption model of the power domain is fitted based on the power consumption characterization item information of the non-CPU hardware module to determine the second power consumption model, that is, to determine the power consumption model of the power domain.
[0098] It can be understood that, when there are non-CPU hardware modules in the power domain, the power consumption characterization item information of the non-CPU hardware modules is used to perform multivariate linear regression fitting on the power domain to determine the second power consumption model, thereby realizing the fitting of the second-state power consumption model of the non-CPU hardware module, that is, obtaining the power consumption model of the power domain, thereby realizing the fitting of the power consumption model when there are non-CPU hardware modules in the power domain.
[0099] In some embodiments, S301 may include S401 and S402:
[0100] S401: When there is a non-CPU hardware module in the power domain, determine a first parameter based on power consumption characterization item information of the non-CPU hardware module in performance information, where the first parameter characterizes dynamic power consumption of the non-CPU hardware module.
[0101] In the embodiment of the present application, the first parameter is not limited. In short, it is a parameter that can be used to characterize the dynamic power consumption of the non-CPU hardware module.
[0102] Exemplarily, in the case where there is a non-CPU hardware module in the power domain that is a DSU hardware module, that is, the CPU and the DSU share the same power domain. In this case, they cannot be separated, which interferes with obtaining the actual power consumption. Therefore, according to the performance information of the DSU hardware module, it is determined that the main power consumption source in the DSU is a characterization item of L3CACHE, wherein the first parameter is the number of accesses to L3CACHE, and after processing the first parameter, the dynamic power consumption of the non-CPU hardware module can be characterized.
[0103] S402: Perform multivariate linear regression fitting based on the first parameter and the performance information to determine a second power consumption model.
[0104] In an embodiment of the present application, after processing the first parameter, the dynamic power consumption of the non-CPU hardware module can be characterized, and based on the performance information of the power domain, a multivariate linear regression fitting is performed to obtain a second power consumption model in which the non-CPU hardware module exists.
[0105] For example, when there is a non-CPU hardware module in the power domain that is a DSU hardware module, since the main power consumption source in the DSU is the characterization item of L3CACHE, the dynamic power consumption characterization item of L3CACHE and the number of occurrences of L3CACHE are found and recorded as L3D_CACHE. The dynamic power consumption of L3CACHE is modeled to obtain the second power consumption model:
[0106] P2=(C d +βE L3D-CACHE )V 2 f clk +f(V,Temp) (6)
[0107] Among them, E L3D-CACHE P2 represents the result of dividing the number of occurrences of the L3D_CACHE event by MHz, and P2 represents the second power consumption.
[0108] Transforming formula (6) yields:
[0109] P2=(C d +βE L3D-CACHE )V 2 f clk +C1V+C2Temp+C3Temp 2 +C4Temp+C0 (7)
[0110] It is understandable that, when there are non-CPU hardware modules in the power domain, a multivariate linear regression fitting is performed based on the power consumption characterization item information of the non-CPU hardware modules, based on the first parameter and the performance information, to determine the second power consumption model. According to actual use, the presence of non-CPU hardware modules in the power domain is taken into account to obtain the fitting of the second power consumption model, and the dynamic power consumption model is considered in multiple scenarios, which improves the flexibility and accuracy of the power consumption model.
[0111] In some embodiments, the performance information includes one or more of the following:
[0112] CPU frequency in the power domain; CPU voltage in the power domain; PMC parameters in the power domain; power consumption characterization item information of non-CPU hardware modules in the power domain; actual power consumption of the power domain.
[0113] In some embodiments, the PMC parameters can record the number of occurrences or times of events such as the number of CPU cycles and the number of instructions executed.
[0114] In some embodiments, the power consumption characterization item information of the non-CPU hardware module is used to determine the dynamic power consumption of the non-CPU hardware module, obtain a second power consumption model of the power domain, and then obtain a power consumption model of the power domain.
[0115] In some embodiments, the CPU frequency in the power domain, the CPU voltage in the power domain, the PMC parameters in the power domain, and the actual power consumption of the power domain are used to determine a first static power consumption model and a first dynamic power consumption model of the power domain, and then obtain the power consumption model of the power domain.
[0116] In some embodiments, after obtaining the power consumption model of the power domain, the power consumption model is verified. The verification process is as follows: Figure 6 As shown, in the verification of the effect of the power consumption model, data collection is first performed to collect the operating information of the power domain and the actual power consumption of the power domain; secondly, the power consumption model of the power domain is fitted to determine the first static power consumption and dynamic power consumption, and then the model power consumption of the power domain is obtained, and the power consumption is compared with the actual power consumption collected to obtain the verification error.
[0117] Exemplarily, the power consumption model is verified on 5 APPs using a benchmark experiment modeling. The data collection method of the verification experiment is consistent with that of the benchmark experiment, wherein the data collection process is performed in a benchmark experiment at a variety of different temperatures. Three CPUs (CPU1, CPU2, CPU3) are used to run the APP at room temperature, and the power consumption of the power domain is calculated by combining the performance information obtained from the data collection and the power consumption model of the power domain. The actual power consumption collected during the experiment is compared with the power consumption obtained through the power consumption model to obtain the fitting error. The power consumption determined when only the CPU exists in the power domain is taken as the first type of power consumption, and the power consumption determined when non-CPU type hardware modules also exist in the power domain is taken as the second type of power consumption. The results are shown in Table 1:
[0118] Table 1
[0119]
[0120]
[0121] Among them, R 2 It represents the goodness of fit of the power consumption model, Err represents the error between the power consumption obtained by the power consumption model and the actual power consumption, and F-statistic is a statistic for evaluating the overall significance of the power consumption model.
[0122] It can be seen from Table 1 that in the first type of power consumption fitting and the second type of power consumption fitting results, R 2They are all close to 1, which means that the better the fitting degree of the power consumption model is, and the average error of Err is about 7%.
[0123] It can be understood that the performance information of the power domain includes the information of the CPU and the power consumption characterization item information of the non-CPU hardware modules, so that when there are different power domains (a power domain with only the CPU and a power domain with non-CPU), the power consumption model can be fitted based on the performance information of the power domain, ensuring the feasibility and accuracy of the power consumption model fitting.
[0124] In some embodiments, the plurality of scenarios includes one or more of the following:
[0125] Scenarios where the power domain is at multiple temperatures; scenarios where the CPU in the power domain is at multiple frequencies; scenarios where non-CPU hardware modules in the power domain are at multiple frequencies; scenarios where the CPU and / or non-CPU hardware modules in the power domain have multiple workloads.
[0126] In the embodiment of the present application, the power domain is at multiple temperatures, that is, the CPU or non-CPU hardware modules in the power domain are at multiple temperatures.
[0127] In an embodiment of the present application, the CPU and / or non-CPU hardware modules in the power domain have a scenario with multiple workloads. For example, the CPU in the power domain can run the first chat APP and the first video APP at the same time, that is, the CPU has two workloads at this time.
[0128] It is understandable that the purpose of obtaining the performance information of the power domain at multiple temperatures is to obtain a more accurate first static power consumption, because the first static power consumption is related to temperature. The purpose of obtaining the performance information of the power domain at multiple frequencies (CPU and non-CPU hardware module frequencies) is to provide more comprehensive data for power consumption model fitting. Based on this, the performance information of the power domain in multiple scenarios is obtained, which effectively improves the accuracy and effectiveness of power consumption model fitting.
[0129] In the embodiments of the present application, Figure 7 This is a flow chart of a power domain method provided in an embodiment of the application. The method may include S111 and S112:
[0130] S111, in an online state, obtaining operation information of the power domain;
[0131] S112, using the operation information and the power consumption model of the power domain to obtain the energy consumption of the power domain; the power consumption model is obtained in an offline state based on the performance information of the power domain in multiple scenarios.
[0132] In an embodiment of the present application, the operation information of the power domain includes time information when the hardware modules in the power domain are running.
[0133] In some embodiments, the operation information includes one or more of the following: working time information of the CPU in the power domain; light sleep time information of the CPU in the power domain; deep sleep time information of the CPU in the power domain; CPU frequency and CPU temperature in the power domain; power consumption characterization item information of non-CPU hardware modules in the power domain.
[0134] In the embodiment of the present application, the power consumption model of the power domain has been obtained in the offline state. The power consumption model is used online, that is, when the device in the power domain is online, the operation information of the power domain is collected online, and the operation information is brought into the power consumption model to calculate the energy consumption of the power domain.
[0135] Exemplarily, the online collected operation information includes the CPU working time information t in the power domain. run , CPU light sleep time information t in the power domain Idle0 , Deep sleep time information of the CPU in the power domain t Idle1 , Use the power consumption model to obtain the energy consumption of the power domain:
[0136] Energy=P dynamic t run +P static (t run +t Idle0 )+C0t Idle1
[0137] Among them, Energy represents the energy consumption of the power domain.
[0138] An exemplary, online use flow chart of the power consumption model is as follows: Figure 8 As shown, three hardware monitoring units are used, namely, a processor core hardware monitoring unit 10, a three-level cache hardware monitoring unit 20 and a temperature hardware monitoring unit 30, wherein the processor core hardware monitoring unit is used to monitor the CPU's sleep state information, CPU frequency information and CPU scheduling information. The three-level cache hardware monitoring unit is used to monitor the frequency information and access information of non-CPU type hardware modules. The temperature hardware monitoring unit is used to monitor the temperature information of the CPU. After all the information is collected, it is summarized in the power consumption hardware monitoring unit 40, and the model online use module 50 is used to estimate the energy consumption using the power consumption model.
[0139] It can be understood that determining the power consumption model in an offline state and using the power consumption model in an online state avoids PMU collection and PMU modeling in an online state. The amount of data collected by PMU is large and the amount of calculation required for PMU modeling is large. Based on this, only simple operation information (CPU time information and power consumption characterization item information of non-CPU hardware modules) needs to be collected in an online state, which realizes lightweight online calculation. The power consumption model can be used to quickly and accurately estimate the energy consumption of the power domain.
[0140] The following describes the method for estimating the energy consumption of the above-mentioned power domain in conjunction with an application embodiment. However, it is worth noting that this embodiment is only for better illustrating the present application and does not constitute an improper limitation on the present application.
[0141] The following describes exemplary applications of the embodiments of the present application in actual application scenarios.
[0142] When there is only a CPU in the power domain and no non-CPU type hardware modules, the fitting flow chart of the power consumption model is as follows: Fig. 9 As shown, the method may include S1001 to S1005:
[0143] S1001. Use the power consumption hardware monitoring module to obtain PMC information and CPU frequency information, use the temperature hardware monitoring module to obtain CPU temperature information, and use external hardware to collect actual power consumption information.
[0144] S1002. In the CPU sleep state, a load test is performed to collect experimental data, and multivariate linear fitting is performed using the experimental data to separate a first static power consumption formula.
[0145] S1003 , performing multiple types of load experiments to obtain actual power consumption, and using a first static power consumption model to calculate a first static power consumption, performing a difference operation between the actual power consumption and the first static power consumption to obtain a first dynamic power consumption.
[0146] S1004: Taking the first dynamic power consumption as the power consumption value to be fitted, and combining the PMU information and the temperature information, a first dynamic power consumption model is fitted.
[0147] S1005 . Determine the sum of the first dynamic power consumption model and the first static power consumption model as the power consumption model when only the CPU exists in the power domain.
[0148] When there are non-CPU type hardware modules in the power domain, the power consumption model fitting flow chart is as follows: Fig.10 As shown, the method may include S2001 to S2003:
[0149] S2001. Use the power consumption hardware monitoring module to obtain frequency information of non-CPU type hardware modules, characteristic information characterizing non-CPU hardware modules, and CPU frequency information, use the temperature hardware monitoring module to obtain CPU temperature information, and use external hardware to collect actual power consumption information.
[0150] S2002. Conduct multiple types of load experiments to ensure that a variety of scenarios are covered, and use power consumption hardware monitoring module information and temperature information to fit the power consumption.
[0151] S2003. According to the fitted power consumption and the collected actual power consumption, a correlation coefficient in the power consumption model is obtained to obtain a power domain power consumption model.
[0152] In an embodiment of the present application, a power consumption hardware monitoring module is used to obtain frequency information of non-CPU type hardware modules, characteristic information characterizing non-CPU hardware modules, and frequency information of the CPU; a temperature hardware monitoring module is used to obtain CPU temperature information; and external hardware is used to collect actual power consumption information.
[0153] In some embodiments, Fig.11 As shown, the estimation, verification and use of energy consumption are realized through the following five parts: hardware setting 11, data collection 21, power consumption model fitting 31, model effect verification 41 and model online use 51. In the hardware setting 11 part, the hardware includes power consumption acquisition peripherals, temperature chamber and target device (device whose energy consumption is to be estimated); in the data collection 21 part, it is necessary to collect all the parameters required for power consumption model fitting; in the power consumption model fitting 31 part, the power consumption model of the power domain is determined; in the model effect verification 41 part, the error verification is performed between the power consumption model of the determined power domain and the actual power consumption; in the model online use 51 part, the power consumption model is used online to estimate the energy consumption.
[0154] In an embodiment of the present application, the acquired PMC information, CPU frequency information, CPU temperature information, frequency information of non-CPU type hardware modules, characteristic information characterizing non-CPU hardware modules, and actual power consumption information collected by external hardware are used to determine, when only a CPU exists in the power domain, a first static power consumption and a first dynamic power consumption are determined, and then the power consumption model of the power domain is determined; when not only a CPU but also non-CPU type hardware modules exist in the power domain, a second model is determined, and then the power consumption model of the power domain is determined. Based on this, the power consumption model of the power domain can be obtained for different situations of hardware types in the power domain, and then the energy consumption of the power domain can be estimated, thereby improving the flexibility of energy consumption estimation.
[0155] The embodiment of the present application provides an energy consumption estimation device 120 for a power domain, such as Fig.12 As shown, the energy consumption estimation device 120 of the power domain includes:
[0156] A first acquisition module 121 is used to acquire performance information of power domains in multiple scenarios in an offline state;
[0157] The first determination module 122 is used to determine a power consumption model of the power domain based on the performance information; the power consumption model is used to determine the power consumption of the power domain in an online state.
[0158] In some embodiments, the power domain energy consumption estimation device 120 further includes a fitting module 123,
[0159] A fitting module 123, configured to perform multivariate linear regression fitting based on the performance information to determine a first static power consumption model of the power domain;
[0160] The first determining module 122 is further configured to determine a first dynamic power consumption model based on the first static power consumption model and the actual power consumption of the power domain; and
[0161] A power consumption model of the power domain is determined based on the first static power consumption model and the first dynamic power consumption model.
[0162] In some embodiments, the first determination module 122 is further configured to perform a difference operation between the actual power consumption and the first static power consumption model to determine the first dynamic power consumption model.
[0163] In some embodiments, the fitting module 123 is used to model the power consumption of the power domain based on the performance information to determine a second power consumption model when there are non-CPU hardware modules in the power domain;
[0164] In some embodiments, the first determination module 122 is further configured to determine a first parameter based on the power consumption characterization item information of the non-CPU hardware module in the performance information when a non-CPU hardware module exists in the power domain, where the first parameter characterizes the dynamic power consumption of the non-CPU hardware module;
[0165] The fitting module 123 is further used to perform multivariate linear regression fitting based on the first parameter and the performance information to determine the second power consumption model.
[0166] The embodiment of the present application provides a device 130 for estimating energy consumption of a power domain, such as Fig.13 As shown, the energy consumption estimation device 130 of the power domain includes:
[0167] The second acquisition module 131 is used to acquire the operation information of the power domain in an online state;
[0168] The second determination module 132 is used to obtain the energy consumption of the power domain by using the operation information and the power consumption model of the power domain; the power consumption model is obtained in an offline state based on the performance information of the power domain in multiple scenarios.
[0169] It can be understood that, on the one hand, in an offline state, the performance information of the power domain in multiple scenarios is obtained, and the power consumption model of the power domain is determined based on the performance information; the power consumption model determined offline can be used online, that is, various types of operating time information of the power domain are collected online, and substituted into the power consumption model, and the energy consumption of the power domain can be directly estimated, thereby avoiding the time and resources consumed by online collection of PMU parameters and a large amount of floating-point calculations when using the PMU parameter model, thereby avoiding the impact on the original performance of the power domain when using the PMU model for energy consumption estimation, realizing lightweight model parameter acquisition and calculation, and effectively improving the efficiency of online estimation of power domain power consumption. On the other hand, it is only necessary to collect simple operating information (CPU time information and power consumption characterization item information of non-CPU hardware modules) in an online state, realizing lightweight online calculation, and using the power consumption model to quickly and accurately estimate the energy consumption of the power domain.
[0170] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiment of the present application can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0171] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0172] The present application embodiment provides a device for estimating energy consumption of a power domain, such as Fig.14 As shown, the hardware entity of the power domain energy consumption estimation device 1400 includes: a processor 1401 and a memory 1403, the memory stores a computer program that can be run on the processor, and the processor implements the steps in the power domain energy consumption estimation method when executing the program.
[0173] It should be noted that the processor 1401 generally controls the overall operation of the device 1400 for estimating the energy consumption of the power domain. The memory 1403 is configured to store instructions and applications executable by the processor 1401, and can also cache data to be processed or processed by each module in the processor 1401 and the device 1400 for estimating the energy consumption of the power domain (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM). The device for estimating the energy consumption of the power domain may also include: a communication interface 1402; the communication interface 1402 enables the device for estimating the energy consumption of the power domain to communicate with other terminals or servers through a network. Data transmission can be performed between the processor 1401, the communication interface 1402, and the memory 1403 through the bus 1404.
[0174] Based on the foregoing embodiments, the modules included in the power domain energy consumption estimation device provided in the embodiments of the present application, as well as the units included in each module, can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0175] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, all steps in the method for estimating the energy consumption of a power domain are implemented. The computer-readable storage medium can be transient or non-transient.
[0176] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device and storage medium embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the device and storage medium embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0177] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.
[0178] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0179] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. The above are only implementation methods of this application, but the protection scope of this application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered within the protection scope of this application.
Claims
1. A method for estimating energy consumption of a power domain, characterized in that: include: In offline state, obtain the performance information of power domain in multiple scenarios; Determining a power consumption model of the power domain based on the performance information; The power consumption model is used to determine the power consumption of the power domain in an online state.
2. The method according to claim 1, characterized in that The determining, based on the performance information, a power consumption model of the power domain includes: Based on the performance information, performing multivariate linear regression fitting to determine a first static power consumption model of the power domain; Determining a first dynamic power consumption model based on the first static power consumption model and the actual power consumption of the power domain; A power consumption model of the power domain is determined based on the first static power consumption model and the first dynamic power consumption model.
3. The method according to claim 2, characterized in that The determining a first dynamic power consumption model based on the first static power consumption model and the actual power consumption includes: Performing a difference operation between the actual power consumption and the first static power consumption model to determine the first dynamic power consumption model.
4. The method according to claim 1, characterized in that: The determining, based on the performance information, a power consumption model of the power domain includes: In the case that non-CPU hardware modules exist in the power domain, the power consumption of the power domain is modeled based on the performance information to determine a second power consumption model, where the second power consumption model is the power consumption model of the power domain.
5. The method according to claim 4, characterized in that In the case where there is a non-CPU hardware module in the power domain, modeling the power consumption of the power domain based on the performance information to determine a second power consumption model includes: In the case where there is a non-CPU hardware module in the power domain, determining a first parameter based on the power consumption characterization item information of the non-CPU hardware module in the performance information, where the first parameter characterizes the dynamic power consumption of the non-CPU hardware module; The second power consumption model is determined based on the first parameter and the performance information.
6. The method according to any one of claims 1 to 5, characterized in that: The performance information includes one or more of the following: CPU frequency in the power domain; CPU voltage in the power domain; PMC parameters in the power domain; Power consumption characterization item information of non-CPU hardware modules in the power domain; CPU temperature in the power domain; The actual power consumption of the power domain.
7. The method according to any one of claims 1 to 6, characterized in that: The multiple scenarios include one or more of the following: A scenario where the power domain is at multiple temperatures; The CPU in the power domain is in a scenario of multiple frequencies; The non-CPU hardware modules in the power domain are scenarios at multiple frequencies; A scenario in which the CPU and / or non-CPU hardware modules in the power domain have multiple workloads.
8. A method for estimating energy consumption of a power domain, characterized in that: The method comprises: In an online state, obtaining operation information of the power domain; The energy consumption of the power domain is obtained by using the operation information and the power consumption model of the power domain; the power consumption model is obtained in an offline state based on the performance information of the power domain in multiple scenarios.
9. The method according to claim 8, characterized in that The operation information includes one or more of the following: Working time information of the CPU in the power domain; Light sleep time information of the CPU in the power domain; Deep sleep time information of the CPU in the power domain; CPU frequency and CPU temperature in the power domain; The power consumption characterization item information of the non-CPU hardware modules in the power domain.
10. A device for estimating energy consumption of a power domain, characterized in that: include: A first acquisition module is used to acquire performance information of power domains in multiple scenarios in an offline state; The first determination module is used to determine a power consumption model of the power domain based on the performance information; the power consumption model is used to determine the power consumption of the power domain in an online state.
11. A device for estimating energy consumption of a power domain, characterized in that: include: A second acquisition module, used to acquire the operation information of the power domain in an online state; A second determination module, configured to obtain energy consumption of the power domain by using the operation information and the power consumption model of the power domain; The power consumption model is obtained in an offline state based on performance information of power domains in multiple scenarios.
12. An electronic device, characterized in that: include: A memory for storing executable data instructions; A processor, configured to implement the steps of the method for estimating the energy consumption of a power domain as described in any one of claims 1 to 7 or 8 to 9 when executing the executable data instructions stored in the memory.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method for estimating the energy consumption of a power domain according to any one of claims 1 to 7 or 8 to 9 are implemented.
Citation Information
Cited By
Chip power consumption estimation method and device, electronic equipment and storage medium
CN122152612A