Accelerator chip operator level power consumption prediction method based on physical information neural network
Through the accelerator chip operator-level power consumption prediction method based on physical information neural network, combined with the operator's physical characteristics and power consumption data, physical information loss constraints are introduced, and the cross-batch accumulation method is used to train the model, which solves the problems of low power consumption prediction accuracy and insufficient generalization ability in the existing technology, and achieves efficient and accurate power consumption prediction.
Patent Information
- Application Number
- CN202510204311.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-07-08
AI Technical Summary
The existing deep learning operator power consumption prediction methods rely on simulation tools and are difficult to generalize, and the existing data-driven methods ignore the physical laws of power consumption, resulting in low prediction results and limited generalization capabilities.
The accelerator chip power consumption prediction method based on physical information neural network is adopted. By constructing a power consumption prediction model of the operator, combining the physical characteristics and power consumption data of the operator, physical information loss constraint formula is introduced, and cross-batch accumulation method is used for training, and the total loss function is constructed to improve prediction accuracy and generalization ability.
The power consumption prediction time is greatly shortened, from several hours to several minutes, the accuracy is improved, and the average error is less than 1.9%, and it still maintains high accuracy under complex hardware conditions, reducing training costs and sample requirements.
Smart Images

Figure CN120277986A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of deep learning, and particularly relates to an operator-level power consumption prediction method for an accelerator chip based on a physics-informed neural network. Background Art
[0002] In the fields of deep learning and hardware optimization, neural network accelerator chips applied to the edge side usually have extremely stringent requirements for power consumption. In order to deploy energy-efficient deep neural network models on them, complex software and hardware co-design is often required. During the co-design space exploration process, operator power consumption information is a core indicator for quantifying its performance. Therefore, accurately predicting the power consumption of deep learning operators is crucial for architecture design optimization and network model construction. Traditional power consumption prediction methods usually rely on simulation tools and are difficult to generalize to different operator configurations. In addition, existing data-driven deep learning methods often ignore the physical laws of power consumption and have deficiencies such as low prediction result accuracy and limited generalization ability.
[0003] In recent years, Physics-Informed Neural Networks (PINN) have made significant progress in the field of physical modeling. PINN introduces physical constraints into the loss function, enabling the model to not only fit the data but also conform to known physical laws. However, current research on PINN in hardware power consumption modeling is still in its infancy and there are few achievements. Summary of the Invention
[0004] In order to solve the above problems existing in the prior art, the present invention provides an operator-level power consumption prediction method for an accelerator chip based on a physics-informed neural network.
[0005] The technical problems to be solved by the present invention are realized through the following technical solutions:
[0006] In a first aspect, the present invention provides an operator-level power consumption prediction method for an accelerator chip based on a physics-informed neural network, and the method includes:
[0007] Inputting the data to be predicted into a trained operator-level power consumption prediction model; wherein, the operator-level power consumption prediction model is obtained from a physical information loss constraint formula derived from operator physical characteristics, operator configuration, and power consumption data; the operator-level power consumption prediction model is trained according to the mean square error loss and physical loss;
[0008] Obtaining the power consumption prediction result corresponding to the data to be predicted.
[0009] Optionally, the construction process of the operator-level power consumption prediction model includes:
[0010] Construct a data set according to the operator configuration;
[0011] Perform operator-level power consumption simulation based on the data set to obtain the power consumption data;
[0012] Construct the physical information loss constraint formula according to the operator physical characteristics and the power consumption data;
[0013] Obtain the operator-level power consumption prediction model according to the physical information loss constraint formula.
[0014] Optionally, the physical information loss constraint formula is expressed as follows:
[0015] P 1_2 =P base +k(C out -C out_base );
[0016] Wherein, P 1_2 represents the power consumption data of the operator configuration composed of the first operator and the second operator, P base is the first constant, k is the second constant, C out_base is the third constant, C out represents the number of output channels.
[0017] Optionally, the training process of the operator-level power consumption prediction model includes:
[0018] Use the cross-batch accumulation method to store and update the power consumption prediction values of different batches during the training process;
[0019] Construct a physical information loss function according to the operator-level power consumption prediction model;
[0020] Obtain the physical loss according to the physical information loss function and the power consumption prediction value;
[0021] Obtain the total loss function according to the physical loss and the mean square error loss;
[0022] Train the operator-level power consumption prediction model according to the total loss function until the preset training conditions are reached, and obtain the trained operator-level power consumption prediction model.
[0023] Optionally, the physical loss is expressed as follows:
[0024]
[0025] Wherein, L phys represents the physical loss, n represents the number of physical information loss functions, α i represents the weight of the i-th physical information loss function, L phys,i represents the i-th physical information loss function.
[0026] Optionally, the i-th physical information loss function is expressed as follows:
[0027] L phys,i = ∑ groups Var(P pred,i );
[0028] where groups represents operator configurations with the same first operator but different second operators, Var() represents variance, and P pred,i represents the predicted power consumption value of the i-th operator configuration with the same first operator but different second operators.
[0029] Optionally, the mean squared error loss is expressed as follows:
[0030]
[0031] where L MSE represents the mean squared error loss, N represents the number of operator configurations, P' pred,j represents the j-th predicted power consumption value, and P' true,j represents the j-th power consumption data.
[0032] Optionally, storing and updating the power consumption prediction values of different batches during the training process by using the cross-batch accumulation method includes:
[0033] Analyzing the current operator information of the operator configuration of the current batch;
[0034] Storing the corresponding power consumption prediction value into a preset cache structure according to the current operator information;
[0035] When the current cache of the preset cache structure is greater than the cache upper limit, removing the power consumption prediction value with the earliest time stored in the preset cache structure in chronological order.
[0036] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
[0037] In the above technical solution, compared with the traditional power consumption simulation scheme, the present invention significantly reduces the time required to obtain the power consumption prediction result, from simulating one power consumption prediction result in several hours to predicting multiple operator power consumptions in several minutes, with high accuracy, strong generalization ability, and an average error of less than 1.9%; compared with the existing deep learning method for predicting power consumption, a physical information loss constraint formula is incorporated into the model, so that the training cost can be reduced, and similar accuracy can still be achieved under more complex hardware conditions.
[0038] The following will further describe the present invention in detail with reference to the accompanying drawings and embodiments. Description of the Drawings
[0039] Figure 1 It is a flowchart of an operator-level power consumption prediction method for an accelerator chip of a physical information neural network provided by an embodiment of the present invention;
[0040] Figure 2 It is a flowchart of model construction and training provided by an embodiment of the present invention;
[0041] Figure 3 It is a flowchart of power consumption simulation provided by an embodiment of the present invention. Detailed implementation manners
[0042] The present invention will be further described in detail below in conjunction with specific embodiments, but the implementation manners of the present invention are not limited thereto.
[0043] Figure 1 It is a flowchart of an operator-level power consumption prediction method for an accelerator chip of a physical information neural network provided by an embodiment of the present invention. As Figure 1 shown, the method may include:
[0044] S101. Input the data to be predicted into the trained operator-level power consumption prediction model; wherein, the operator-level power consumption prediction model is obtained from a physical information loss constraint formula based on operator physical characteristics, operator configuration, and power consumption data; the operator-level power consumption prediction model is trained according to the mean square error loss and physical loss.
[0045] S102. Obtain the power consumption prediction result corresponding to the data to be predicted.
[0046] Optionally, Figure 2 It is a flowchart of model construction and training provided by an embodiment of the present invention. As Figure 2 shown, the construction process of the operator-level power consumption prediction model includes:
[0047] Construct a data set according to the operator configuration;
[0048] Perform operator-level power consumption simulation on the data set to obtain power consumption data;
[0049] Construct a physical information loss constraint formula according to the operator physical characteristics and power consumption data;
[0050] Obtain the operator-level power consumption prediction model according to the physical information loss constraint formula.
[0051] It is understandable that the present invention combines the physical characteristics of the circuit structure designed by the operator with the power consumption information of the existing operator configuration, and uses the known physical laws of the operator to construct an operator-level circuit power consumption prediction model, reducing the dependence on high-quality sample data. Thanks to the connection between the operator configuration and the circuit power consumption, the average power consumption information of different operator configurations can be used as a basis for operator-level power consumption simulation. Select operator configurations to construct a data set and perform power consumption simulation on the selected partial operators. Figure 3 is a flowchart of a power consumption simulation provided by an embodiment of the present invention, as Figure 3 shown. The main steps are RTL-level functional simulation and DC power consumption analysis. Starting from the RTL-level simulation, System Verilog (SV) is used for simulation to obtain the waveform VCD file and delay information of each operator when running on the target device. The VCD file is large and cannot be directly used in DesignCompiler (DC), so it needs to be converted into a switching rate file with a smaller volume and readable in DC. Then, power consumption analysis is performed in DC using the post-processed netlist, library file, and the above-mentioned switching rate file.
[0052] Optionally, by analyzing the physical characteristics realized by the operator design of the hardware structure, combining the operator configuration with the power consumption information, modeling is performed between the operator configuration and the power consumption data. For the complex non-linear relationship between the power consumption data and multiple operator configurations, it can be simplified into a combination of multiple linear relationships based on the operator type. Based on these relationships, a physical information loss constraint formula is obtained, and the physical information loss constraint formula is expressed as follows:
[0053] P 1_2 =P base +k(C out -C out_base );
[0054] Among them, P 1_2 represents the power consumption data of the operator configuration composed of the first operator and the second operator, P base is the first constant, k is the second constant, C out_base is the third constant, and C out represents the number of output channels. The first operator can be a PW operator (Pointwise Convolution) or a DW operator (Depthwise Convolution), and the second operator can be an operator such as Output_Channel.
[0055] Optionally, referring to Figure 2 , the training process of the operator-level power consumption prediction model includes:
[0056] Using the cross-batch accumulation method to store and update the power consumption prediction values of different batches during the training process;
[0057] Construct a physical information loss function according to the operator-level power consumption prediction model;
[0058] Obtain the physical loss according to the physical information loss function and the power consumption prediction value;
[0059] Obtain the total loss function according to the physical loss and the mean square error loss;
[0060] Train the operator-level power consumption prediction model according to the total loss function until the preset training conditions are reached, and obtain the trained operator-level power consumption prediction model.
[0061] It can be understood that when actually calculating the physical loss, a grouping method can be adopted to group the operator configurations with the same configuration but different second operators, and calculate the variance of the power consumption prediction values as the physical constraint loss. When there are multiple operators, the i-th physical information loss function is expressed as follows:
[0062] L phys,i =∑ groups Var(P pred,i );
[0063] Among them, groups represents the operator configurations with the same first operator but different second operators, Var() represents the variance, and P pred,i represents the predicted power consumption value of the i-th operator configuration with the same first operator but different second operators.
[0064] Optionally, referring to Figure 2 , use the cross-batch accumulation method to store and update the power consumption prediction values of different batches during the training process, including:
[0065] Analyze the current operator information of the operator configuration of the current batch;
[0066] Deposit the corresponding power consumption prediction value into the preset cache structure according to the current operator information;
[0067] When the current cache of the preset cache structure is greater than the cache upper limit, remove the power consumption prediction value with the earliest time stored in the preset cache structure in chronological order.
[0068] It can be understood that in order to implement the above physical loss, the present invention adopts the cross-batch accumulation method to continuously store and update the power consumption prediction values of different batches during the training process to solve the problem that the physical loss cannot be calculated when batchsize = 1.
[0069] For example, in a specific implementation, two cache structures cache_pw and cache_dw are adopted to store the predicted power consumption values corresponding to the PW operator and the DW operator in different batches respectively. The specific steps are as follows:
[0070] (1) Analyze the operator information of the current batch;
[0071] (2) Use (operator type, stride, feature size, input channel) as the key and store the power consumption prediction value in the cache;
[0072] (3) When the value corresponding to a certain key in the cache exceeds 2, calculate the physical loss;
[0073] (4) The buffer upper limit parameter is max_cache. When the cache is greater than max_cache, remove the earliest stored value to control the storage cost.
[0074] Optionally, the physical loss is expressed as follows:
[0075]
[0076] Among them, L phys represents the physical loss, n represents the number of physical information loss functions, and α i represents the weight of the i-th physical information loss function, and L phys,i represents the i-th physical information loss function.
[0077] Optionally, the mean squared error loss is expressed as follows:
[0078]
[0079] Among them, L MSE represents the mean squared error loss, N represents the number of operator configurations, P′ pred,j represents the j-th predicted power consumption value, and P′ true,j represents the j-th power consumption data.
[0080] Obtain the total loss function L according to the physical loss and the mean squared error loss total which is expressed as follows:
[0081]
[0082] It is worth mentioning that the parameters that can be adjusted when training the operator-level power consumption prediction model mainly include: the maximum cache number max_cache, the dynamic loss function weight α 0~n , the sample division ratio test_split, batch_size, the hidden layer size hs 1,2,3 and so on.
[0083] In one embodiment, the above parameters are adjusted and the validation set loss values with and without physical information constraints under different parameter configurations are compared. The results are shown in Table 1. Generally speaking, under different parameter configurations, after adding physical information constraints, the MSE of the validation set is significantly reduced.
[0084] Table 1
[0085]
[0086] The parameter test_split represents the proportion of the validation set when dividing the samples. It can be seen from Table 1 that when this parameter doubles, that is, the training samples are reduced by 11.1%, the validation samples are doubled, and the mean square error of the validation set of the basic network model increases to more than 5 times the original, and the accuracy drops significantly. However, by introducing physical information constraints, the mean square error of this method only increases by about 0.98 times under the same circumstances, and still can maintain good results. It can be seen that this method reduces the dependence on the number of training samples. In the case of such limited samples, batch_size and the number of hidden layers will also have a greater impact on the training results. It can be seen from the table that when batch_size increases and the number of hidden layers decreases, this method still has better results.
[0087] In another embodiment, Table 2 lists the comparisons of various aspects between the present invention and the existing methods CAPEDL and PRIMAL. Analyzing the data in Table 2, it can be known that the present invention is close to the existing advanced methods in terms of accuracy, while other performances are greatly improved. The neural network accelerator chip for power consumption prediction of the present invention has a much higher hardware complexity than the former two (the number of hardware gates is more than 20 times higher), the required training samples are much lower than the former two (the number of training samples is less than 1800 times), and the training time is also significantly lower (the training time is lower than 210 times).
[0088] Table 2
[0089]
[0090] The physical information neural network operator-level power consumption prediction method proposed by the present invention introduces hardware physical information into the loss function and calculates the physical loss by using the method of cross-batch information accumulation. The experimental results show that while ensuring the accuracy of complex hardware operator-level power consumption prediction, this method has the advantages of extremely low training time and sample requirements, and can be applied to fields such as power consumption estimation for different operator configurations, power consumption prediction of neural network hardware accelerators, low-power network architecture search, and operator-level energy efficiency optimization, and can be adapted to different hardware architectures and extended to more operator configurations by adjusting the physical information constraint term.
[0091] In the above technical solution, compared with the traditional power consumption simulation solution, the present invention significantly reduces the time required to obtain the power consumption prediction result, improving from simulating one power consumption prediction result in several hours to predicting the power consumption of multiple operators in several minutes, with high accuracy, strong generalization ability, and an average error of less than 1.9%. Compared with the existing deep learning methods for predicting power consumption, the physical information loss constraint formula is incorporated into the model, which can reduce the training cost and still achieve similar accuracy under more complex hardware conditions.
[0092] It should be noted that the terms "first", "second", etc. are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. On the contrary, they are only examples of devices and methods consistent with some aspects of the present invention.
[0093] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification.
[0094] Although the present invention has been described in connection with various embodiments herein, however, in the process of implementing the claimed invention, those skilled in the art can understand and achieve other variations of the disclosed embodiments by viewing the accompanying drawings and the disclosure. In the description of the present invention, the term "including" does not exclude other components or steps, the term "a" or "an" does not exclude a plurality of cases, and the meaning of "plurality" is two or more, unless otherwise specifically defined. In addition, certain measures are described in different embodiments, but this does not mean that these measures cannot be combined to produce good results.
[0095] The above content is a further detailed description of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited only to these descriptions. For those of ordinary skill in the technical field to which the present invention belongs, without departing from the concept of the present invention, several simple deductions or substitutions can still be made, and all should be regarded as belonging to the protection scope of the present invention.
Claims
1. An operator-level power consumption prediction method for an accelerator chip based on a physics-informed neural network, characterized in that, The method includes: Inputting the data to be predicted into the trained operator-level power consumption prediction model; wherein, the operator-level power consumption prediction model is obtained from the physical information loss constraint formula derived based on the physical characteristics of the operator, the operator configuration, and the power consumption data; the operator-level power consumption prediction model is trained according to the mean square error loss and the physical loss. Obtaining the power consumption prediction result corresponding to the data to be predicted.
2. The operator-level power consumption prediction method for an accelerator chip based on a physics-informed neural network according to claim 1, wherein The construction process of the operator-level power consumption prediction model includes: Constructing a data set according to the operator configuration. Performing operator-level power consumption simulation on the data set to obtain the power consumption data. Constructing the physical information loss constraint formula according to the physical characteristics of the operator and the power consumption data. Obtaining the operator-level power consumption prediction model according to the physical information loss constraint formula.
3. The method for predicting the operator-level power consumption of the accelerator chip based on the physics-informed neural network according to claim 2, wherein The physical information loss constraint formula is expressed as follows: P 1_2 = P base + k(C out - C out_base ); Among them, P 1_2 represents the power consumption data of an operator configuration composed of a first operator and a second operator, P base is a first constant, k is a second constant, C out_base is a third constant, C out represents the number of output channels.
4. The method for predicting the operator-level power consumption of the accelerator chip based on the physics-informed neural network according to claim 1, wherein The training process of the operator-level power consumption prediction model includes: Using the cross-batch accumulation method to store and update the power consumption prediction values of different batches during the training process, and constructing a physical information loss function according to the operator-level power consumption prediction model. Obtaining the physical loss according to the physical information loss function and the power consumption prediction value. Obtaining the total loss function according to the physical loss and the mean square error loss. Training the operator-level power consumption prediction model according to the total loss function until the preset training conditions are met, and obtaining the trained operator-level power consumption prediction model.
5. The method for predicting the operator-level power consumption of an accelerator chip based on a physics-informed neural network according to claim 4, wherein The physical loss is expressed as follows: Among them, L phys represents the physical loss, n represents the number of the physical information loss functions, and α i represents the weight of the i-th physical information loss function, and L phys,i represents the i-th physical information loss function.
6. The method for predicting the operator-level power consumption of an accelerator chip based on a physics-informed neural network according to claim 5, wherein The i-th physical information loss function is expressed as follows: L phys,i = ∑ groups Var(P pred,i ) Among them, groups represents the operator configurations with the same first operator but different second operators, Var() represents the variance, and P pred,i represents the predicted power consumption value of the i-th operator configuration with the same first operator but different second operators.
7. The method for predicting the operator-level power consumption of an accelerator chip based on a physics-informed neural network according to claim 4, wherein The mean square error loss is expressed as follows: Among them, L MSE represents the mean square error loss, N represents the number of the operator configurations, and P′ pred,j represents the j-th predicted power consumption value, and P′ true,j represents the j-th power consumption data.
8. The method for predicting the operator-level power consumption of an accelerator chip based on a physics-informed neural network according to claim 4, wherein The using of the cross-batch accumulation method to store and update the power consumption prediction values of different batches during the training process includes: Parsing the current operator information of the operator configuration of the current batch. Storing the corresponding power consumption prediction value into a preset cache structure according to the current operator information. When the current cache of the preset cache structure is greater than the cache upper limit, removing the power consumption prediction value with the earliest time stored in the preset cache structure in chronological order.