Parameter adjustment method, component, processor, equipment, medium and product
By obtaining the current operating parameters, temperature and power consumption of the processor, and adjusting the operating parameters of the next operating cycle of the processor using the power consumption calculation strategy, the problem of complex and slow response of the processor in the prior art is solved, and fast and efficient adjustment of the operating parameters is achieved.
Patent Information
- Application Number
- CN202411998603.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing processor operating parameter control methods rely on the complex collaborative work of multiple hardware units and software units, resulting in high time overhead and inability to quickly respond to dynamically changing workloads.
By obtaining the current operating parameters, temperature and power consumption of the processor, the power consumption calculation strategy is used to determine the current load data, and the operating parameters of the next operating cycle are adjusted based on the load data, temperature and preset target power consumption.
It realizes rapid and accurate adjustment of processor operating parameters according to the current working situation, improves reaction speed and adjustment speed, reduces the coordination time of software and hardware units, and improves the working efficiency of the processor.
Smart Images

Figure CN119917375A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of graphics processing technology, and in particular to a parameter adjustment method, component, processor, device, medium and product. Background Art
[0002] The control method of working parameters in current processors usually relies on the complex cooperation of multiple hardware units and software units. This includes but is not limited to the scheduling management unit, workload monitoring unit, policy control unit, performance monitoring unit, etc. The software driver monitors and feedbacks each unit and transmits it to the control unit to control the working parameters. Summary of the invention
[0003] In view of this, embodiments of the present application provide at least one parameter adjustment method, component, processor, device, medium, and product.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] On the one hand, an embodiment of the present application provides a method for adjusting processor operating parameters, the method comprising: obtaining current operating parameters, current temperature and current power consumption of the processor; based on the power consumption calculation strategy corresponding to the processor, determining current load data using the current operating parameters, current temperature and current power consumption; the current load data characterizes the load condition of the processor; determining the operating parameters of the processor in the next operating cycle using the current load data, the current temperature, a preset target power consumption and the power consumption calculation strategy; wherein the power consumption calculation strategy is used to calculate the corresponding power consumption using the voltage and frequency obtained based on the voltage-frequency mapping relationship obtained by pre-training.
[0006] On the other hand, an embodiment of the present application provides a management and control component, which is arranged in a processor, and the management and control component includes: an acquisition unit, which is used to acquire the current operating parameters, current temperature and current power consumption of the processor; a first determination unit, which is used to determine the current load data based on the power consumption calculation strategy corresponding to the processor, using the current operating parameters, current temperature and current power consumption; the current load data characterizes the load condition of the processor; a second determination unit, which is used to determine the operating parameters of the processor in the next operating cycle using the current load data, the current temperature, a preset target power consumption and the power consumption calculation strategy; wherein the power consumption calculation strategy is used to calculate the corresponding power consumption using the voltage and frequency obtained based on the voltage-frequency mapping relationship obtained based on pre-training.
[0007] On the other hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0008] On the other hand, an embodiment of the present application provides a processor, which includes the above-mentioned management control component.
[0009] On the other hand, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements part or all of the steps in the above method when executed by a processor.
[0010] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the above method.
[0011] In the embodiment of the present application, through the power consumption calculation strategy, the current operating parameters of the processor are used to determine the operating parameters of the next operating cycle, so that the operating parameters of the processor can be adjusted quickly, accurately and efficiently according to the current working scenario; the changes in workload can be quickly responded to within milliseconds, greatly improving the reaction speed and adjustment speed; the software and hardware units can be reduced, and the calculation can be coordinated efficiently and quickly; no interruption is initiated to the processor, greatly improving the working efficiency of the processor.
[0012] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0014] Figure 1 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 1 ;
[0015] Figure 2 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 2 ;
[0016] Figure 3 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 3 ;
[0017] Figure 4 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 4 ;
[0018] Figure 5 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 5 ;
[0019] Figure 6 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 6 ;
[0020] Figure 7 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 7 ;
[0021] Figure 8 A schematic diagram of a static power consumption model provided in an embodiment of the present application;
[0022] Fig. 9 A schematic diagram of a VF model provided in an embodiment of the present application;
[0023] Fig.10 A schematic diagram of a control flow provided for an embodiment of the present application;
[0024] Fig.11 A schematic diagram of the composition structure of a management control component provided in an embodiment of the present application;
[0025] Fig.12 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] 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.
[0027] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is 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. The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.
[0029] The embodiment of the present application provides a method for adjusting the operating parameters of a processor, which can be executed by a processor of a computer device. The computer device may refer to a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (such as a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or other device with data processing capabilities.
[0030] Existing methods for controlling processor operating parameters rely on multiple hardware units and software units. The hardware units occupy additional performance power area (PPA) of the chip, and the software units add additional load overhead. The large amount of coordination between hardware and software increases the time overhead, especially in scenarios that require fast response, this overhead becomes more obvious. It is necessary to monitor and read the counters inside the processor in real time, and reading the counters requires initiating an interrupt to the processor, which indirectly affects the overall performance of the processor. Under dynamically changing workloads, existing methods cannot adapt quickly, and the response time and adjustment speed are slow.
[0031] In order to accurately and efficiently adjust the processor operating parameters, an embodiment of the present application proposes a method for adjusting the processor operating parameters, the method comprising: obtaining the current operating parameters, current temperature and current power consumption of the processor; based on the power consumption calculation strategy corresponding to the processor, using the current operating parameters, current temperature and current power consumption, determining the current load data; the current load data characterizes the load condition of the processor; using the current load data, the current temperature, a preset target power consumption and the power consumption calculation strategy, determining the operating parameters of the processor in the next operating cycle; wherein the power consumption calculation strategy is used to calculate the corresponding power consumption using the voltage and frequency obtained based on the voltage-frequency mapping relationship obtained by pre-training.
[0032] Figure 1 A schematic diagram of an implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application Figure 1 ,like Figure 1 As shown, the method includes the following steps S101 to S103:
[0033] Step S101: Acquire the current operating parameters, current temperature and current power consumption of the processor.
[0034] The operating parameters are parameters related to the performance of the processor. The performance of the processor can be adjusted by adjusting the operating parameters of the processor. Exemplarily, the operating parameters include the voltage and frequency at which the processor operates. The processor can be a graphics processing unit (GPU), a central processing unit (CPU), or any other processor.
[0035] In some embodiments, during the operation of the processor, the operating parameters of the processor need to be adjusted in real time to maximize the performance of the processor. In order to adjust the operating parameters in real time according to the current situation of the processor, it is necessary to obtain the current operating parameters, current temperature and current power consumption of the processor.
[0036] In some embodiments, the current operating parameters of the processor can be obtained through parameter monitoring software, the operating temperature of the processor can be obtained through sensors inside the processor, and the current power consumption of the processor can be monitored through sensors outside the processor.
[0037] Step S102: Based on the power consumption calculation strategy corresponding to the processor, current load data is determined using the current operating parameters, current temperature and current power consumption.
[0038] The power consumption calculation strategy is a method for calculating power consumption in a processor. Different processors correspond to different power consumption calculation strategies. Exemplarily, the power consumption calculation strategy may be a power consumption calculation model or a power consumption calculation formula. By inputting parameters related to power consumption calculation into the model or formula, the power consumption of the processor may be obtained.
[0039] In some embodiments, during normal operation of the processor, the power consumption of the processor under different operating parameters and configurations is collected, and these operating parameters, configurations, and power consumption are used as sample data. The power consumption calculation model is trained through a deep learning algorithm to obtain a trained power consumption calculation model, and the power consumption calculation model is converted into a formula to obtain a power consumption calculation strategy.
[0040] The current load data represents the load of the processor. Different tasks correspond to different loads, and the workload of the processor is different when the processor processes different tasks. Exemplarily, the range of the load data is 0 to 1, and the larger the load data, the larger the workload of the processor.
[0041] The power consumption calculation strategy is used to calculate the corresponding power consumption using the voltage and frequency obtained based on the voltage-frequency mapping relationship obtained through pre-training.
[0042] In some embodiments, the voltage-frequency mapping relationship represents the correspondence between the voltage and frequency of the processor; that is, for a fixed voltage, a fixed frequency can be obtained by referring to the voltage-frequency mapping relationship; conversely, for a fixed frequency, a fixed voltage can also be obtained by referring to the voltage-frequency mapping relationship.
[0043] In an embodiment of the present application, by utilizing the power consumption calculation strategy, the power consumption of the processor can be calculated based on the voltage and frequency obtained through the above-mentioned voltage-frequency mapping relationship, combined with other parameters of the processor (such as the load and temperature of the processor); of course, the load of the processor can also be inferred based on the current power consumption, voltage and frequency of the processor (obtained through the above-mentioned voltage-frequency mapping relationship) and other parameters of the processor (such as the temperature of the processor).
[0044] In some embodiments, the total power consumption of the processor is determined by static power consumption and dynamic power consumption. Static power consumption refers to the power consumed by the integrated circuit even when there is no switching activity. It is mainly caused by the leakage current of the transistor and is related to the threshold voltage and power supply voltage of the transistor. Static power consumption represents the power consumption consumed by the processor in the standby state. Dynamic power consumption refers to the power consumption generated when the chip is working and the transistor is in a jump state. Dynamic power consumption mainly consists of two parts: dynamic switching power consumption caused by dynamic switching current and power consumption generated by short-circuit current.
[0045] The static power consumption can be determined by a static power consumption calculation strategy, and the dynamic power consumption can be determined by a dynamic power consumption calculation strategy. The input parameters of the static power consumption calculation strategy include operating parameters and temperature, and the input parameters of the dynamic power consumption calculation strategy include operating parameters and load data.
[0046] In some embodiments, the operating parameters include voltage and frequency, the static power consumption calculation strategy is related to voltage and temperature, and the dynamic power consumption calculation strategy is related to voltage, frequency and load data.
[0047] In some embodiments, the operating parameters of the processor include voltage and frequency, and the power consumption calculation strategy includes a static power consumption calculation strategy and a dynamic power consumption calculation strategy; the dynamic power consumption calculation strategy is used to calculate the corresponding dynamic power consumption using load data, voltage and frequency obtained based on a pre-trained voltage-frequency mapping relationship; the static power consumption calculation strategy is used to calculate the corresponding static power consumption using the obtained voltage and temperature.
[0048] Among them, the dynamic power consumption reflects the power consumption related to the real-time load of the processor, and the dynamic power consumption is related to the voltage, frequency and load data; the higher the voltage and frequency, the higher the dynamic power consumption; the greater the load represented by the load data, the higher the dynamic power consumption.
[0049] The static power consumption is positively correlated with voltage and temperature. The higher the voltage, the higher the static power consumption. The higher the temperature, the higher the static power consumption.
[0050] In some embodiments, based on the static power consumption calculation strategy, the current static power consumption is determined using the current voltage and the current temperature; based on the current static power consumption and the current power consumption, the current dynamic power consumption is determined; based on the dynamic power consumption calculation strategy, the current load data is determined using the current dynamic power consumption and the current voltage and frequency.
[0051] In some embodiments, the power consumption calculation strategy corresponds to a power consumption calculation model, and the power consumption calculation model can be obtained by training sample data. The power consumption calculation model characterizes the relationship between the current voltage and frequency, the current temperature, the current power consumption and the current load data. The current voltage and frequency, the current temperature and the current power consumption are input into the power consumption calculation model, and the model outputs the current load data.
[0052] Step S103: Determine the operating parameters of the processor in the next operation cycle by using the current load data, the current temperature, the preset target power consumption and the power consumption calculation strategy.
[0053] The target power consumption is the expected power consumption of the processor in the next operation cycle. By determining the working parameters of the processor in the next operation cycle in each operation cycle, the power consumption of the processor in the next operation cycle can be adjusted.
[0054] The operation cycle is the adjustment cycle of the working parameters in the processor. The operation cycle can be set according to the actual operation of the processor. Exemplarily, the operation cycle may include several clock cycles.
[0055] In some embodiments, the operating parameters of the processor include voltage and frequency, and the voltage and frequency satisfy the voltage-frequency mapping data corresponding to the processor. A target voltage-frequency combination is determined among multiple voltage-frequency combinations that satisfy the voltage-frequency mapping data; wherein the target voltage-frequency is a voltage-frequency combination among the multiple voltage-frequency combinations whose estimated power consumption obtained based on the power consumption calculation strategy is closest to the target power consumption and less than the target power consumption; the voltage and frequency in the target voltage-frequency combination are determined as the operating parameters of the processor in the next operating cycle.
[0056] In some embodiments, the power consumption calculation strategy corresponds to a power consumption calculation model, and the power consumption calculation model can be obtained by training sample data. The power consumption calculation model characterizes the relationship between the working parameters of the next operating cycle, the current temperature, the target power consumption and the current load data. The current load data, the current temperature and the preset target power consumption are input into the power consumption calculation model, and the model outputs the working parameters of the next operating cycle.
[0057] Exemplarily, the operating parameters are voltage V and frequency F, the load data is α, the current temperature T and the current power consumption P1 are known, and the calculation formula of the power consumption calculation strategy is F1(V, T, IDDQ)+F2(V, F, α), and the formula outputs the power consumption. IDDQ here is a built-in parameter of the processor, which represents the static current of the processor, and IDDQ can be predetermined. Substitute the current V, F, T and P1 into the formula to obtain the load data α; substitute the current load data α, the current temperature T and the preset target power consumption P2 into the formula, and combine the mapping relationship between V and F to obtain the V and F of the processor in the next operating cycle. The processor works according to the determined V and F in the next operating cycle.
[0058] In an embodiment of the present application, the current operating parameters, current temperature and current power consumption of the processor are obtained; based on the power consumption calculation strategy corresponding to the processor, the current load data is determined using the current operating parameters, current temperature and current power consumption; the current load data characterizes the load condition of the processor; the operating parameters of the processor in the next operating cycle are determined using the current load data, the preset target power consumption and the power consumption calculation strategy; wherein the power consumption calculation strategy includes a static power consumption calculation strategy and a dynamic power consumption calculation strategy; the static power consumption calculation strategy is related to the operating parameters and temperature, and the dynamic power consumption strategy is related to the operating parameters and load data. In this way, by using the static power consumption calculation strategy and the dynamic power consumption calculation strategy, the operating parameters of the next operating cycle are determined using the current operating parameters of the processor, and the operating parameters of the processor can be adjusted quickly, accurately and efficiently according to the current working scenario; the changes in workload can be quickly responded to within milliseconds, greatly improving the reaction speed and adjustment speed; the software and hardware units can be reduced, and the calculation can be coordinated efficiently and quickly; no interruption is initiated to the processor, greatly improving the working efficiency of the processor.
[0059] Figure 2 This is a schematic diagram of the implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application. Figure 2 , the method can be executed by a processor of a computer device. Figure 1 , the operating parameters of the processor include voltage and frequency, and the voltage and frequency satisfy the voltage-frequency mapping data corresponding to the processor; Figure 1 S103 in can be updated to S201 to S202, which will be combined Figure 2 The steps shown are explained.
[0060] Step S201: Determine a target voltage-frequency combination among a plurality of voltage-frequency combinations that satisfy the voltage-frequency mapping data.
[0061] Among them, voltage refers to the voltage required for the processor to work normally. Frequency refers to the operating frequency of the processor, which means the number of times the processor executes instructions per second.
[0062] The voltage-frequency mapping data represents the mapping relationship between discrete voltages and discrete frequencies when the processor is working normally, and the voltage-frequency mapping data includes multiple voltage-frequency combinations, each voltage corresponding to a frequency. Each processor corresponds to a voltage-frequency mapping data. Exemplarily, the voltage-frequency mapping data is a table, which records multiple voltage-frequency combinations.
[0063] The target voltage-frequency is a voltage-frequency combination among the multiple voltage-frequency combinations, wherein the estimated power consumption obtained based on the power consumption calculation strategy is closest to the target power consumption and is smaller than the target power consumption.
[0064] In some embodiments, the voltage and frequency of the normal operation of the processor meet the voltage-frequency mapping data corresponding to the processor, that is, the voltage and frequency of the processor operation is a voltage-frequency combination in the voltage-frequency mapping data. The expected power consumption in the power consumption calculation strategy is related to the parameters of voltage, frequency, current temperature, and current load data. When the current temperature and current load data are constant, each voltage-frequency combination will correspond to an expected power consumption. When the voltage-frequency combination is determined, in order to adjust the expected power consumption of the processor in the next operating cycle to the preset target power consumption, only the expected power consumption closest to the target power consumption and less than the target power consumption can be selected from the expected power consumptions corresponding to the multiple voltage-frequency combinations as the target power consumption of the processor in the next operating cycle. Therefore, based on the preset target power consumption, the voltage-frequency combination closest to the target power consumption and less than the target power consumption can be determined from the multiple voltage-frequency combinations, and the voltage-frequency combination is used as the voltage and frequency of the processor in the next operating cycle.
[0065] In some embodiments, the power consumption calculation strategy corresponds to a power consumption calculation formula, and based on a preset order, each voltage-frequency combination in the voltage-frequency combination is brought into the power consumption calculation formula, and combined with the known current load data and current temperature, the estimated power consumption corresponding to each voltage-frequency combination can be obtained. The estimated power consumption closest to and less than the target power consumption is selected from the multiple estimated power consumptions corresponding to the multiple voltage-frequency combinations, and the target voltage-frequency combination corresponding to the selected estimated power consumption is used as the operating parameter of the processor in the next operating cycle.
[0066] In some embodiments, the power consumption calculation strategy corresponds to a power consumption calculation formula, and there is a general voltage-frequency relationship in the processor, which is configurable. A set of voltage frequencies can be determined by combining the power consumption calculation formula and the voltage-frequency relationship, as well as the current load data, the current temperature, and the preset target power consumption. Determine the voltage-frequency combination closest to the solved voltage frequency among multiple voltage-frequency combinations, and bring the closest voltage-frequency combination into the power consumption calculation formula to obtain the expected power consumption. When the expected power consumption is less than the target power consumption, select a voltage-frequency combination larger than the closest voltage-frequency combination to determine the corresponding expected power consumption; when the expected power consumption is greater than the target power consumption, select a voltage-frequency combination smaller than the closest voltage-frequency combination to determine the corresponding expected power consumption. In this way, the target voltage-frequency combination that is closest to the target power consumption and less than the target power consumption can also be selected. This method is equivalent to first determining a starting voltage-frequency combination, and then looking for a target voltage-frequency combination that is closest to the target power consumption and less than the target power consumption.
[0067] Step S202: Determine the voltage and frequency in the target voltage-frequency combination as operating parameters of the processor in the next operating cycle.
[0068] The voltage and frequency in the target voltage-frequency combination are the operating parameters of the processor in the next operating cycle. In the next operating cycle, the operating parameters of the processor are adjusted to the voltage and frequency in the target voltage-frequency combination, so that the power consumption of the processor in the next operating cycle can be approximately adjusted to the target power consumption.
[0069] Exemplarily, the voltage-frequency mapping data corresponding to the processor includes 5 groups of voltage frequencies, and these 5 groups of voltage frequencies are sequentially brought into the power consumption calculation strategy to obtain 5 groups of estimated power consumption. These 5 groups of estimated power consumption are compared with the preset target power consumption, and it is determined that the third group of estimated power consumption is closest to the target power consumption and is less than the target power consumption. Therefore, the voltage frequency corresponding to the third group of estimated power consumption is used as the working parameter of the next operation cycle.
[0070] In the embodiment of the present application, a target voltage-frequency combination is determined among multiple voltage-frequency combinations that satisfy the voltage-frequency mapping data; the voltage and frequency in the target voltage-frequency combination are determined as the operating parameters of the processor in the next operation cycle. In this way, the operating parameters of the processor can be adjusted according to the preset voltage-frequency combination to meet the specific requirements of the operating parameters. At the same time, the operating parameters of the processor can be adjusted more accurately according to the target power consumption in each operation cycle.
[0071] Figure 3 This is a schematic diagram of the implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application. Figure 3 , the method can be executed by a processor of a computer device. Figure 2 , the voltage-frequency mapping data is stored in the processor, the method further comprises steps S301 and S302, combining Figure 3 The steps shown are explained.
[0072] Step S301: In response to the processor being powered on, reading hardware parameters of the processor and a voltage-frequency mapping relationship obtained based on pre-training.
[0073] The voltage-frequency mapping data may be stored in a processor. Exemplarily, the voltage-frequency mapping data is stored in a read-only memory (ROM) of the control unit.
[0074] The hardware parameters are parameters related to the hardware characteristics of the processor. Different processors correspond to different hardware parameters. Exemplarily, the hardware parameters are the process parameters of the processor, and the process parameters characterize the switching speed of the transistor (MOS tube) inside a chip.
[0075] The voltage-frequency mapping relationship represents the corresponding relationship between the voltage and frequency of the processor.
[0076] In some embodiments, the voltage-frequency mapping relationship corresponds to a voltage-frequency mapping model. The voltage-frequency mapping model can be obtained by training the model based on sample data. Therefore, the voltage-frequency mapping relationship is obtained through pre-training. The voltage-frequency mapping relationship can be regarded as a formula corresponding to the voltage-frequency mapping model. Exemplarily, the sample data includes voltage-frequency curves related to voltage, temperature, and hardware parameters, and the voltage-frequency mapping model is obtained by training the deep learning algorithm based on the sample data.
[0077] In some embodiments, the voltage-frequency mapping relationship is a formula corresponding to the voltage-frequency mapping model, and the formula is added to the firmware code of the processor in the form of code. Firmware refers to the device "driver" stored inside the device. Through the firmware, the operating system can implement the operation of a specific machine according to the standard device driver. The hardware parameters of the processor are stored in the "electronic fuse" EFUSE of the chip. EFUSE is a non-volatile memory device for storing information and protecting chips. During the chip manufacturing process, EFUSE can be programmed to store some important data, such as the unique identification number of the device, encryption keys, etc. These data can be read and used, but once programmed, they cannot be modified or erased. In response to the processor being powered on, the hardware parameters are read from EFUSE, and the voltage-frequency mapping relationship is read from the firmware code.
[0078] Step S302: Generate voltage-frequency mapping data corresponding to the processor based on the hardware parameters of the processor and the voltage-frequency mapping relationship.
[0079] The voltage-frequency mapping relationship corresponds to a voltage-frequency mapping model, and the pre-trained voltage-frequency mapping relationship includes the voltage-frequency mapping relationship of each processor in the multiple processors. Different processors have different hardware parameters, and based on the hardware parameters and the voltage-frequency mapping relationship, the voltage-frequency mapping relationship corresponding to the processor can be generated.
[0080] In some embodiments, the voltage-frequency mapping data is a mapping table of voltage and frequency; generating the voltage-frequency mapping data corresponding to the processor based on the hardware parameters of the processor and the voltage-frequency mapping relationship includes: generating a voltage-frequency curve corresponding to the processor based on the hardware parameters of the processor and the voltage-frequency mapping relationship; sampling the voltage-frequency curve corresponding to the processor to obtain multiple voltage-frequency combinations; the voltage-frequency mapping table is used to store the multiple voltage-frequency combinations.
[0081] Among them, the voltage-frequency mapping relationship obtained by pre-training includes multiple voltage-frequency curves. After reading the voltage-frequency mapping relationship obtained based on the pre-training, the hardware parameters of the processor are input into the voltage-frequency mapping relationship (equivalent to the formula corresponding to the voltage-frequency mapping model), and the voltage-frequency curve corresponding to the processor is directly output. Based on the preset sampling frequency, the voltage-frequency curve corresponding to the processor is sampled to obtain the horizontal and vertical coordinates at each sampling point, that is, each voltage-frequency combination. Multiple voltage-frequency combinations are stored in the voltage and frequency mapping table. Different sampling frequencies obtain different numbers of voltage-frequency combinations, so based on different sampling frequencies, power control effects of different precisions can be achieved.
[0082] Exemplarily, in response to the processor being powered on, the process parameters and the voltage-frequency mapping relationship of the processor are read, the process parameters are brought into the voltage-frequency mapping relationship, a voltage-frequency curve corresponding to the processor is obtained, the voltage-frequency curve is sampled, and voltage-frequency mapping data corresponding to the processor is obtained.
[0083] In the embodiment of the present application, in response to the processor being powered on, the hardware parameters of the processor and the voltage-frequency mapping relationship obtained based on pre-training are read; based on the hardware parameters of the processor and the voltage-frequency mapping relationship, the voltage-frequency mapping data corresponding to the processor is generated. In this way, the hardware parameters and the voltage-frequency mapping relationship can be effectively read, and the voltage-frequency mapping data corresponding to the processor can be accurately generated.
[0084] Figure 4 This is a schematic diagram of the implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application. Figure 4 , the method can be executed by a processor of a computer device. Figure 3 The voltage-frequency mapping relationship is obtained based on a pre-trained voltage-frequency prediction model. The method further includes steps S401 and S402. Figure 4 The steps shown are explained.
[0085] Step S401, obtaining a first sample set including multiple first sample data; the first sample data includes a voltage-frequency curve related to voltage, temperature, and hardware parameters, the voltage-frequency curve includes a mapping relationship between voltage and frequency and a boundary parameter at the voltage frequency, and the boundary parameter is the difference in the ratio of long-term testing and short-term testing passing the test standard at the voltage frequency.
[0086] The voltage-frequency prediction model is pre-trained based on the first sample set to obtain a trained voltage-frequency prediction model, and the trained voltage-frequency prediction model is converted into a corresponding voltage-frequency mapping relationship. Exemplarily, the trained voltage-frequency prediction model is converted into a formula, which is the voltage-frequency mapping relationship.
[0087] In some embodiments, the first sample data includes a voltage-frequency curve related to voltage, temperature, and hardware parameters. Voltage, temperature, and hardware parameters are sample parameters in the first sample data, and the voltage-frequency curve is a sample result in the first sample data. For the first sample data, changes in voltage, temperature, and hardware parameters will affect the frequency of the processor. The processor is set with different voltages, temperatures, and hardware parameters, and each parameter can be set with N groups of data. Under each parameter combination, the processor also sets N groups of different workloads. The frequency of the processor is collected under each configuration, and the processor can generate a voltage-frequency curve based on the collected voltage-frequency data. Each hardware parameter corresponds to a voltage-frequency curve.
[0088] In some embodiments, for each voltage frequency in the voltage-frequency curve, the processor is tested at the voltage frequency, and at the current voltage, temperature and hardware parameters. There is a difference between the pass rate of the long-term test and the pass rate of the short-term test. Exemplarily, the pass rate of the processor for executing 10 tests is 100%, and the pass rate for executing 100 tests is 98%. The boundary parameter is the difference in the ratio of the long-term test and the short-term test in passing the test standard at the voltage frequency. When generating the voltage-frequency curve, the boundary parameter corresponding to the voltage frequency and the mapping relationship between the voltage and the frequency are considered at the same time.
[0089] In the embodiment of the present application, the boundary parameters are added to enable the voltage-frequency prediction model to cover a small number of boundary conditions. The actual frequency may fluctuate above and below the prediction curve. This part of the fluctuation can be understood as the standard deviation, which will be added to the model as a boundary parameter.
[0090] Step S402: obtaining the voltage-frequency prediction model based on the first sample set; the voltage-frequency model is used to generate a voltage-frequency mapping relationship of the processor based on hardware parameters of the processor.
[0091] The voltage-frequency prediction model is obtained by training the model training algorithm based on the first sample set. Exemplarily, the voltage-frequency prediction model is obtained by training the model training algorithm based on the first sample set.
[0092] The trained voltage-frequency prediction model can characterize the relationship between the hardware parameters and the voltage-frequency mapping relationship of the processor. The voltage-frequency mapping relationship of the processor can be generated by inputting the hardware parameters into the voltage-frequency prediction model.
[0093] In an embodiment of the present application, a first sample set including a plurality of first sample data is obtained; the first sample data includes a voltage-frequency curve related to voltage, temperature, and hardware parameters, the voltage-frequency curve includes a mapping relationship between voltage and frequency and a boundary parameter at the voltage frequency, the boundary parameter being the difference in the ratio of long-term tests and short-term tests passing the test standard at the voltage frequency; the voltage-frequency prediction model is obtained based on the first sample set. In this way, training can be performed based on the first sample set to obtain an accurate voltage-frequency prediction model. By considering the boundary parameters, the robustness of the model can be improved.
[0094] Figure 5 This is a schematic diagram of the implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application. Figure 5 , the method can be executed by a processor of a computer device. Figure 1 , Figure 1 S102 in can be updated to S501 to S503, which will be combined Figure 5 The steps shown are explained.
[0095] Step S501 : Based on the static power consumption calculation strategy, the current static power consumption is determined using the current operating parameters and the current temperature.
[0096] The static power consumption calculation strategy is related to the current operating parameters and the current temperature. By substituting the current operating parameters and the current temperature into the static power consumption calculation strategy, the static power consumption can be obtained. Exemplarily, the static power consumption calculation strategy corresponds to formula F1 (V, T, IDDQ), IDDQ is the static current, which is predetermined, and the current operating parameter is the voltage. Substituting the current voltage V and temperature T into formula F1, the static power consumption is output.
[0097] Step S502: Determine the current dynamic power consumption based on the current static power consumption and the current power consumption.
[0098] The current power consumption of the processor can be calculated by jointly calculating the current static power consumption and the current dynamic power consumption. When the current static power consumption and the current power consumption are obtained, the current dynamic power consumption is obtained by subtracting the current static power consumption from the current power consumption.
[0099] Step S503: Based on the dynamic power consumption calculation strategy, the current load data is determined using the current dynamic power consumption and the current operating parameters.
[0100] The dynamic power consumption calculation strategy is related to the current working parameters and the current load data. By bringing the current working parameters and the current dynamic power consumption into the dynamic power consumption calculation strategy, the current load data can be obtained. Exemplarily, the dynamic power consumption calculation strategy corresponds to formula F2 (V, F, α), the current working parameters are voltage V and frequency F, and the current voltage V, frequency F and dynamic power consumption are brought into formula F2 to output the current load data α.
[0101] In the embodiment of the present application, based on the static power consumption calculation strategy, the current working parameters and the current temperature are used to determine the current static power consumption; based on the current static power consumption and the current power consumption, the current dynamic power consumption is determined; based on the dynamic power consumption calculation strategy, the current dynamic power consumption and the current working parameters are used to determine the current load data. In this way, based on the power consumption calculation strategy corresponding to the processor, the current working parameters, the current temperature and the current power consumption can be used to determine the accurate current load data.
[0102] Figure 6 This is a schematic diagram of the implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application. Figure 6 , the method can be executed by a processor of a computer device. Figure 5 , Figure 5 S501 in can be updated to S601 to S602, which will be combined Figure 6 The steps shown are explained.
[0103] Step S601, reading the static current of the processor.
[0104] The static current IDDQ refers to the leakage current when all transistors in the processor are in a static state. When the transistors are turned off, the leakage current still exists, which is the main cause of static power consumption.
[0105] In some embodiments, the IDDQ of the processor is stored in the EFUSE of the processor. After the processor is powered on, the IDDQ of the processor can be read from the EFUSE of the processor.
[0106] Step S602: Determine the current static power consumption based on the static current, the current operating parameters and the current temperature.
[0107] Among them, the static current, the current working parameters and the current temperature jointly affect the current static power consumption. The current static power consumption can be obtained by bringing the static current, the current working parameters and the current temperature into the static power consumption calculation strategy.
[0108] Exemplarily, the static power consumption calculation strategy corresponds to formula F1 (V, IDDQ, T), the current operating parameter is voltage V, the current voltage V, temperature T and static current IDDQ are substituted into formula F1, and the current static power consumption is output.
[0109] In the embodiment of the present application, the quiescent current of the processor is read; and the current quiescent power consumption is determined based on the quiescent current, the current operating parameters and the current temperature. In this way, the accurate quiescent power consumption can be determined based on the quiescent current, the current operating parameters and the current temperature.
[0110] Figure 7 This is a schematic diagram of the implementation process of a processor operating parameter adjustment method provided in an embodiment of the present application. Figure 7 , the method can be executed by a processor of a computer device. Figure 2 The processor is provided with a voltage setting unit and a frequency setting unit, and the method further comprises steps S701 and S702, combining Figure 7 The steps shown are explained.
[0111] Step S701: Send the voltage of the next operation cycle to the voltage setting unit, so that the voltage of the processor is set to the voltage of the next operation cycle through the voltage setting unit.
[0112] The voltage setting unit is used to set the voltage of the processor in each operation cycle. After the second determination unit of the processor determines the voltage of the processor in the next operation cycle using the current load data, the preset target power consumption and the power consumption calculation strategy, the voltage can be sent to the voltage setting unit. In the next operation cycle, the voltage setting unit sets the voltage of the processor to the voltage of the next operation cycle.
[0113] Step S702: Send the frequency of the next operation cycle to the frequency setting unit, so that the frequency of the processor is set to the frequency of the next operation cycle through the frequency setting unit.
[0114] The frequency setting unit is used to set the frequency of the processor in each operation cycle. After the second determination unit of the processor determines the frequency of the processor in the next operation cycle using the current load data, the preset target power consumption and the power consumption calculation strategy, the frequency can be sent to the frequency setting unit. In the next operation cycle, the frequency setting unit sets the frequency of the processor to the frequency of the next operation cycle.
[0115] In the embodiment of the present application, the voltage of the processor is set to the voltage of the next operation cycle by the voltage setting unit, and the frequency of the processor is set to the frequency of the next operation cycle by the frequency setting unit. In this way, the voltage and frequency of the processor operation cycle can be set by the voltage setting unit and the frequency setting unit, thereby improving the voltage and frequency adjustment efficiency.
[0116] In some embodiments, the method further includes: in response to the processor running a cycle with the operating parameters of the next operating cycle, reacquiring the temperature and power consumption of the processor, and determining new operating parameters based on the operating parameters of the next operating cycle, the target power consumption, the power consumption calculation strategy and the reacquired temperature and power consumption.
[0117] Among them, after determining the working parameters of the processor for the next operating cycle, the processor will operate according to the determined working parameters in the next operating cycle. In the next operating cycle, the temperature and power consumption of the processor can be re-obtained, and the working parameters of the next operating cycle can be determined based on the operating parameters, target power consumption, power consumption calculation strategy and the re-obtained temperature and power consumption.
[0118] Exemplarily, the operating parameters include voltage and frequency. In response to the processor running for one cycle at the voltage and frequency of the next operating cycle, the temperature and power consumption of the processor are obtained again. Based on the power consumption calculation strategy corresponding to the processor, the load data can be determined using the running voltage, frequency, obtained temperature and power consumption; the new voltage and frequency can be determined using the load data, temperature, target power consumption and power consumption calculation strategy.
[0119] In the embodiment of the present application, in response to the processor running a cycle with the operating parameters of the next operating cycle, the temperature and power consumption of the processor are re-acquired, and new operating parameters are determined based on the operating parameters of the next operating cycle, the target power consumption, the power consumption calculation strategy, and the re-acquired temperature and power consumption. In this way, by periodically executing the operating parameter adjustment process, the operating parameters of the next operating cycle can be recalculated in each operating cycle, so as to achieve timely adjustment of the operating parameters of the processor and improve the performance of the processor.
[0120] In some embodiments, the static power consumption calculation strategy is obtained based on a pre-trained static power consumption model, and the method further includes: obtaining a second sample set including multiple second sample data; the second sample data includes static power consumption related to voltage, temperature and static current, and the static power consumption is the power consumption of the processor at voltage and temperature in a no-load state; the static power consumption model is obtained based on the second sample set; the static power consumption model is used to generate static power consumption based on the voltage, temperature and static current of the processor.
[0121] The static power consumption model is pre-trained based on the second sample set to obtain a trained static power consumption model, and the trained static power consumption model is converted into a static power consumption calculation strategy. Exemplarily, the trained static power consumption model is converted into a formula, which is the static power consumption calculation strategy.
[0122] In some embodiments, the second sample data includes static power consumption related to voltage, temperature and static current. Voltage, temperature and static current are sample parameters in the second sample data, and static power consumption is a sample result in the second sample data. For the second sample data, changes in voltage, temperature and static current will affect the static power consumption of the processor. The processor is set to different voltages, temperatures and static currents, and each parameter can be set to N groups of data. Under each parameter combination, the static power consumption of the processor is collected as the second sample data. Static power consumption is the power consumption of the processor at voltage and temperature in a no-load state.
[0123] The static power consumption model is obtained by training the second sample set through a model training algorithm. Exemplarily, the static power consumption model is obtained by training the second sample set through a deep learning algorithm.
[0124] The trained static power consumption model can characterize the relationship between voltage, temperature, static current and the static power consumption of the processor. The static power consumption of the processor can be generated by inputting voltage, temperature and static current into the static power consumption model.
[0125] In some embodiments, the static power consumption calculation strategy is converted into a formula and added to the firmware code; in response to the processor being powered on, the static power consumption calculation strategy of the processor is read from the firmware code.
[0126] In an embodiment of the present application, a second sample set including a plurality of second sample data is obtained; the second sample data includes static power consumption related to voltage, temperature and static current, and the static power consumption is the power consumption of the processor under no-load state at voltage and temperature; the static power consumption model is obtained based on the second sample set; the static power consumption model is used to generate static power consumption based on the voltage, temperature and static current of the processor. In this way, training can be performed based on the second sample set to obtain an accurate static power consumption model.
[0127] The following describes the application of the processor operating parameter adjustment method provided in an embodiment of the present application in a practical scenario.
[0128] The relevant technical fields of the embodiments of the present application include computer graphics processing, deep learning, GPU working physical characteristics analysis, software and hardware collaborative control and dynamic voltage and frequency adjustment control technology. For the field of computer graphics processing, the embodiments of the present application are related to the application of graphics processing unit (GPU) in graphics rendering, image processing, and high-performance computing, with particular attention to the optimization between its performance and energy consumption; for the field of deep learning, the embodiments of the present application involve modeling and optimizing the working parameters of the GPU using deep learning algorithms, so as to automatically adjust the performance parameters of the GPU under different workloads to achieve the optimal energy efficiency ratio; for the field of GPU working physical characteristics analysis, the embodiments of the present application study the underlying working characteristics of the GPU and extract the key parameters of the GPU for mathematical analysis; for the field of software and hardware collaborative control, the embodiments of the present application also focus on the calculation control at the software level, so that it can quickly and accurately work with the hardware unit, and realize a more accurate and efficient dynamic voltage and frequency adjustment (Dynamic Voltage and Frequency Scaling, DVFS) strategy through software and hardware collaborative control; for the field of dynamic voltage and frequency adjustment control technology, the embodiments of the present application focus on improving the existing GPU DVFS control method, by introducing a data-driven model based on physical characteristics, reducing the dependence on multi-unit collaboration, and realizing fast and high-efficiency voltage and frequency adjustment.
[0129] In the prior art, the DVFS control method of GPU usually relies on the complex cooperation of multiple hardware units and software units, including but not limited to the scheduling management unit, workload monitoring unit, policy control unit, performance monitoring unit, etc. The software driver monitors and feedbacks each unit and transmits it to the control unit for DVFS control.
[0130] The main disadvantages of the existing technology: 1. Complex hardware and software requirements: The existing DVFS control method relies on multiple hardware units and software units. The hardware units occupy additional PPA (Power Peformance Area) of the chip, and the software units add additional load overhead. 2. High coordination and time overhead: A large amount of coordination work between hardware and software increases the time overhead, especially in scenarios that require fast response, this overhead becomes more obvious. 3. Occupying GPU computing space: It is necessary to monitor and read the counter inside the GPU in real time, and reading the counter requires initiating an interrupt to the GPU, which indirectly affects the overall performance of the GPU. 4. Slow response time and adjustment speed: Under dynamically changing workloads, the existing methods cannot adapt quickly, and the response time and adjustment speed are slow. 5. Unable to set the optimal GPU operating parameters: In the DVFS control strategy, the GPU operating frequency is often a pre-set fixed value, which leads to an indirect loss of chip performance.
[0131] The specific improvement measures of the embodiments of the present application include: 1. Reducing software and hardware units: Compared with the traditional method, only a separate mathematical operation unit is needed, and no additional scheduling unit or monitoring unit is required, which reduces the amount of hardware and reduces the chip PPA. 2. Efficient and fast coordinated calculation: Compared with the prior art, the software and hardware coordination time is greatly reduced by using a trained model combined with simple mathematical operations. 3. Does not occupy GPU computing space: does not rely on reading GPU internal information, does not initiate interrupts to the GPU, and greatly improves GPU work efficiency. 4. Improves reaction speed and adjustment efficiency: Using a trained mathematical model, the GPU can quickly respond to changes in workload within milliseconds, greatly improving reaction speed and adjustment speed. 5. Deep learning pre-training to form a model: Use deep learning technology to pre-train the physical parameters of the GPU and customize the optimal operating frequency model for each chip.
[0132] The embodiment of the present application aims to rely on deep learning to pre-train the modeling of the physical working parameters of the GPU, and implant the trained model into the GPU so that it can quickly, accurately and efficiently set the optimal parameters of the GPU according to the current working scenario, allowing the GPU to quickly implement the Boost function, and also allow the GPU to quickly set the voltage and frequency when the hardware threshold, such as the power consumption upper limit, is reached, so as to improve the overall working performance of the GPU.
[0133] The embodiments of the present application include the following key components: 1. Static power consumption model: This model is a pre-trained model based on deep learning, and the core data is extracted from the power consumption performance of the GPU under different conditions in actual work. 2. Voltage-frequency model: This model is a pre-trained model based on deep learning, and the core data is extracted from the frequency performance of the GPU under different working conditions. 3. System management unit: The system management (system management control, SMC) unit composed of the CPU (corresponding to the management and control component in the above embodiment) is responsible for receiving power consumption and temperature data, and inputting it into the pre-trained model for calculation, and setting the optimal voltage and frequency according to the calculation results. 4. Power consumption monitoring unit: The current power consumption of the GPU is monitored by external sensors, and the SMC can obtain the current power consumption in real time. 5. Temperature monitoring unit: The GPU operating temperature is obtained through the sensor inside the GPU, and the SMC can obtain the current temperature in real time.
[0134] In some embodiments, the following steps are involved:
[0135] 1. Static power consumption model data modeling: Under different conditions, specific parameters are set and data is collected and modeled. The specific parameters of the static power consumption model include voltage, temperature and IDDQ (corresponding to the static current in the above embodiment). Under specific parameters, the power consumption data of the GPU is collected.
[0136] 2. Voltage-frequency model (VF model) modeling: According to different conditions, specific parameters are set, and data collection and modeling are performed under different GPU working conditions. Among them, the specific parameters of the VF model include voltage, temperature and process (corresponding to the hardware parameters in the above embodiment). Under specific parameters, for different workloads, the voltage-frequency parameter pairs of the GPU are collected to construct the VF curve.
[0137] 3. The trained model is solidified into a mathematical calculation formula, and the software extracts the chip parameters (corresponding to the parameters of the processor in the above embodiment) and inputs them into the pre-trained model for voltage-frequency calculation, and generates a table for storage. Specifically, the process parameters of the chip are input into the VF model to obtain the VF table corresponding to the chip (corresponding to the voltage-frequency mapping data in the above embodiment), and the VF table stores the mapping relationship between the voltage and frequency domain.
[0138] 4. During operation, the SMC reads the total power consumption, temperature, voltage, and static current IDDQ of the GPU, and calculates the current dynamic power consumption according to the static power consumption model. Specifically, the static power consumption model is converted into formula F3 (V, T, IDDQ) (corresponding to the static power consumption calculation strategy in the above embodiment), where V is voltage, T is temperature, and IDDQ is static current. Substitute voltage, temperature, and static current into formula F3 to obtain static power consumption; subtract static power consumption from total power consumption to obtain dynamic power consumption.
[0139] 5. Calculate the current load data activity factor (corresponding to the load data in the above embodiment) according to the dynamic power consumption, voltage Voltage, and frequency Frequency, and save the activity factor for calculation at the next moment. Specifically, the calculation formula of dynamic power consumption is F4 (α, V, F) (corresponding to the dynamic power consumption calculation strategy in the above embodiment). Exemplarily, F4 is represented by formula (1):
[0140] F4(α, V, F) = α*C*V 2 *F Formula (1);
[0141] Where F4 is the dynamic power consumption function, α is the activity factor, C is a constant, V is the voltage, and F is the frequency. Substituting dynamic power consumption, voltage, and frequency into formula (1), we can calculate α, the activity factor.
[0142] 6. According to the activity factor, temperature and the current hardware redundancy budget (corresponding to the preset target power consumption in the above embodiment), such as Power Budget, calculate the maximum GPU frequency and voltage that can be achieved at the next moment, and send the voltage and frequency control information to the Voltage and Frequency control unit (corresponding to the voltage setting unit and frequency setting unit in the above embodiment). Specifically, the new voltage and frequency are calculated by formula (2):
[0143] P=F4(α,V,F)+F3(V,T,IDDQ) Formula (2);
[0144] Among them, F4 corresponds to dynamic power consumption, F3 corresponds to static power consumption, and P is the total power consumption. Substitute the power budget as P, the activity factor, temperature, and the current hardware redundancy budget into formula (2) for calculation to obtain the voltage V and frequency F.
[0145] 7. After receiving the new instructions (voltage V and frequency F), the Voltage and Frequency control unit makes corresponding settings, allowing the GPU to enter the next state.
[0146] Figure 8 Schematic diagram of a static power consumption model provided for an embodiment of the present application. During the pre-training process of the static power consumption model (corresponding to the static power consumption calculation strategy of the above embodiment), the GPU is in static mode and has no workload. Three parameters, voltage 801, temperature 802, and static current 803, are set. Each parameter has N different values. Under the preset GPU configuration 804, the GPU will generate static power consumption 805. By changing the values of voltage, temperature, and IDDQ, the GPU will generate different power consumption. N groups of values of GPU voltage, temperature, and IDDQ and the power consumption corresponding to each combination of values are collected as training samples, and training is performed based on the deep learning module 806 to obtain a static power consumption model 807. The static power consumption model reflects the correspondence between the three parameters of voltage, temperature, and IDDQ and static power consumption.
[0147] Fig. 9 A schematic diagram of a VF model provided for an embodiment of the present application. During the pre-training process of the VF model (corresponding to the voltage-frequency prediction model of the above-mentioned embodiment), three parameters, namely voltage 901, temperature 902, and hardware parameter 903 (process), are set, each parameter having N different values, and a VF curve 905 is generated when the GPU is under different workloads 904, and each hardware parameter corresponds to a VF curve. Considering that the GPU performs different numbers of tests under each VF configuration, there are slight differences in the test pass rate, and the boundary parameter 906 (margin) corresponding to the voltage-frequency is added to the VF curve. Through multiple groups of sample data, training is performed based on a deep learning module 907 to obtain a VF model 908. Margin represents the difference in the test pass rate of the GPU at different execution times under voltage and frequency.
[0148] Fig.10A control flow diagram provided for an embodiment of the present application. It includes a memory 1001 (SMC ROM), a system management unit 1002 (SMC), a voltage setting unit 1003 and a frequency setting unit 1004. A VF table 1007 (chip VF table) is generated based on a hardware parameter 1005 (chipparameter_1) and a VF model 1006 (VF model). The VF table 1007 and the static power consumption model 1008 are stored in the memory 1001. After the GPU startup module 1009 works (boot), the VF table 1007 and the static power consumption model 1008 are read from the memory 1001. When the GPU working module 1010 works, the current power consumption 1011 is read through the power consumption sensor and the current temperature 1012 is read through the temperature sensor. The current load data 1014 is calculated by the power consumption calculation strategy 1013 (corresponding to formula (2)). Determine whether the current power consumption reaches the power consumption budget 1015. If the current power consumption does not reach the power consumption budget, increase the voltage frequency 1016. If the current power consumption exceeds the power consumption budget, reduce the voltage frequency 1017. Finally, obtain a new voltage-frequency pair 1018. Set the new voltage through the voltage setting unit 1003, and set the new frequency through the frequency setting unit 1004.
[0149] based on Fig.10 , including the following steps:
[0150] Step 1: Perform reliability testing (corner testing) and mathematical modeling of specific parameters (voltage, temperature, IDDQ, process parameters) based on the physical characteristics of the GPU to obtain a static power consumption model and a voltage-frequency model.
[0151] Step 2: Convert the two models into mathematical formulas and add them to the Firmware code, where the input parameters Parameter_1 and Parameter_2 are obtained by reading the EFUSE of the chip.
[0152] Among them, Parameter_1 is the process parameter of the chip, and Parameter_2 is IDDQ.
[0153] Step 3: After the chip is powered on, Parameter_1 is read and a unique VFtable for each chip is generated according to the model formula. The table is saved in the SMC ROM for subsequent calls.
[0154] Among them, Parameter_1 is substituted into the formula corresponding to the VF model to obtain the VF table corresponding to the chip.
[0155] Step 4: The chip is powered on according to the default startup configuration and the corresponding initial Voltage-Frequency is set.
[0156] When the chip is started, an initial voltage is configured, and an initial frequency is determined by looking up a table based on the initial voltage.
[0157] Step 5: GPU loads workload. The SMC obtains the power consumption value Power returned by the power consumption sensor and the temperature value Temperature returned by the temperature sensor in real time, inputs the current V, F, Power, and Temperature into the static power consumption model formula, calculates the current activity factor, and temporarily caches it.
[0158] Among them, V, F, Power, Temperature, and IDDQ are input into formula (2) to obtain α, that is, the activity factor.
[0159] Step 6: The SMC reads the current power budget (corresponding to the preset target power consumption in the above embodiment), substitutes the cached activity factor, the read temperature and the power budget into formula (2), and solves for the voltage and frequency. The voltage and frequency are sent to the corresponding setting unit.
[0160] Exemplarily, the activity factor, temperature and IDDQ are substituted into formula (2), and each group of VFs in the VF Table is substituted into formula (2) based on a preset order to obtain the estimated power consumption corresponding to each group of V and F, and the estimated power consumption corresponding to each group of VFs is compared with the Power budget, and the estimated power consumption that is closest to the Power budget and less than the Power budget is selected, and the corresponding VF is used as the latest voltage and frequency.
[0161] Step 7: After completing step 6, continue periodic monitoring and activity factor calculation, and repeat steps 3 to 6.
[0162] The embodiments of the present application have the following beneficial effects: 1. Reduced design complexity: The cycle of the dynamic adjustment process is very fast, and fewer software and hardware units are involved, which can simplify the design and reduce the design complexity of the chip. 2. Efficient and fast calculation: The use of pre-trained models can greatly reduce the computing time of the processor, and the processor only needs to perform repetitive mathematical operations. 3. Optimal GPU parameters: According to the working characteristics of the GPU, a large amount of data is used for modeling and analysis to obtain the optimal working parameters of the GPU, so that the GPU can achieve the highest energy consumption ratio in actual work. 4. Strong scalability and easy iteration: The entire control method is highly scalable. For different chips and architectures, only the model parameters need to be updated, which greatly reduces the complexity of chip iteration.
[0163] Currently, commonly used solutions often rely on the coordination of multiple units, and most still rely on more hardware unit detection and calculation, or capture more processor register parameters for comprehensive selection and calculation. Compared with these solutions, the embodiments of the present application have great advantages in calculation simplicity and response speed, as well as algorithm iteration. However, the embodiments of the present application need to rely on a large amount of data testing and precise modeling of the chip.
[0164] The contents of the embodiments of the present application include: 1. A static power consumption model training method based on deep learning: extraction of key parameters, data testing methods, and model training methods. 2. A voltage-frequency model training method based on deep learning: extraction of key parameters, data testing methods, and model selection and optimization methods. 3. Model implantation method: a code conversion method for converting model parameters into GPU firmware, and a method for selecting and loading key input parameters when powering on. 4. Mathematical model of the chip's working state: how to integrate the chip's working parameters into a mathematical model, solve specific parameters for the model, and use the solved parameters for calculations at the next moment. 5. Chip working state switching judgment logic: how to judge the parameters of the next working state of the chip based on existing working conditions. 6. Iteration of control logic: an iteration scheme for the entire control process, and the sub-module parts that need to be replaced when the chip is iterated.
[0165] The advantages of the embodiments of the present application include: 1. Reduced design complexity: The existing solutions require more hardware units and software algorithm control, and the present solution greatly reduces the complexity of hardware unit and software algorithm implementation. 2. Efficient and fast calculation: The existing solutions require coordination of multiple hardware and software units. If one unit has a large delay, it will affect the speed of the entire control process. The present solution only needs to convert the pre-trained deep learning model into firmware code and implant it into the GPU to achieve real-time and fast calculation feedback, greatly reducing the coordination time of hardware and software. 3. Reduced interference to the GPU: The existing solutions rely on monitoring and reading of the internal registers of the GPU. The present solution relies on indirect parameters to measure the GPU load, which can directly avoid obtaining the internal parameters of the GPU, reduce direct interruptions to the GPU, and greatly improve the working efficiency of the GPU. 4. Optimal GPU parameters: The existing solutions often use fixed parameters. The present solution uses a large amount of data for modeling and analysis based on the working characteristics of the GPU to obtain the optimal working parameters of the GPU, and tailor the optimal working parameters for each GPU, so that the GPU can achieve the highest energy consumption ratio in actual work. 5. Strong scalability and easy iteration: The existing solution relies on the coordination of GPU internal units and other key subsystems. If the architecture changes, the entire solution needs to be reconstructed. The entire control method of this solution is highly scalable. For different chips and architectures, only the model parameters need to be updated, which greatly reduces the complexity of chip iteration.
[0166] Based on the foregoing embodiments, an embodiment of the present application provides a management control component, which includes the units included and the modules included in the units, which can be implemented by a processor in a computer device; of course, it 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.
[0167] Fig.11 A schematic diagram of the composition structure of a management control component provided in an embodiment of the present application is shown in FIG. Fig.11 As shown, the management control component 1100 includes: an acquisition unit 1110, a first determination unit 1120, and a second determination unit 1130, wherein: the management control component is set in the processor;
[0168] An acquisition unit 1110 is used to acquire current operating parameters, current temperature and current power consumption of the processor;
[0169] A first determining unit 1120 is configured to determine current load data based on a power consumption calculation strategy corresponding to the processor and using the current operating parameters, current temperature, and current power consumption; the current load data represents a load condition of the processor;
[0170] A second determining unit 1130 is used to determine the operating parameters of the processor in the next operation cycle by using the current load data, the preset target power consumption and the power consumption calculation strategy;
[0171] The power consumption calculation strategy is used to calculate the corresponding power consumption using the voltage and frequency obtained based on the voltage-frequency mapping relationship obtained through pre-training.
[0172] In some embodiments, the operating parameters of the processor include voltage and frequency, and the power consumption calculation strategy includes a static power consumption calculation strategy and a dynamic power consumption calculation strategy; the dynamic power consumption calculation strategy is used to calculate the corresponding dynamic power consumption using load data, voltage and frequency obtained based on a pre-trained voltage-frequency mapping relationship; the static power consumption calculation strategy is used to calculate the corresponding static power consumption using the obtained voltage and temperature.
[0173] In some embodiments, the voltage and the frequency satisfy the voltage-frequency mapping data corresponding to the processor; the second determination unit 1130 is further used to determine a target voltage-frequency combination among multiple voltage-frequency combinations that satisfy the voltage-frequency mapping data; wherein the target voltage-frequency is a voltage-frequency combination among the multiple voltage-frequency combinations, in which the estimated power consumption obtained based on the power consumption calculation strategy is closest to the target power consumption and less than the target power consumption; the voltage and frequency in the target voltage-frequency combination are determined as the operating parameters of the processor in the next operating cycle.
[0174] In some embodiments, the acquisition unit 1110 is also used to read the hardware parameters of the processor and the voltage-frequency mapping relationship obtained based on pre-training in response to the processor being powered on; and generate voltage-frequency mapping data corresponding to the processor based on the hardware parameters of the processor and the voltage-frequency mapping relationship.
[0175] In some embodiments, the voltage-frequency mapping relationship is obtained based on a pre-trained voltage-frequency prediction model; the management control component 1100 also includes a training unit, which is used to obtain a first sample set including multiple first sample data; the first sample data includes a voltage-frequency curve related to voltage, temperature, and hardware parameters, and the voltage-frequency curve includes a mapping relationship between voltage and frequency and a boundary parameter at the voltage frequency, and the boundary parameter is the difference in the ratio of long-term tests and short-term tests passing the test standard at the voltage frequency; the voltage-frequency prediction model is obtained based on the first sample set; the voltage-frequency prediction model is used to generate the voltage-frequency mapping relationship of the processor based on the hardware parameters of the processor.
[0176] In some embodiments, the first determination unit 1120 is further used to determine the current static power consumption based on the static power consumption calculation strategy, using the current operating parameters and the current temperature; determine the current dynamic power consumption based on the current static power consumption and the current power consumption; and determine the current load data based on the dynamic power consumption calculation strategy, using the current dynamic power consumption and the current operating parameters.
[0177] In some embodiments, the first determination unit 1120 is further configured to read a static current of the processor; and determine a current static power consumption based on the static current, the current operating parameters, and the current temperature.
[0178] In some embodiments, the processor is provided with a voltage setting unit and a frequency setting unit; the second determination unit 1130 is further used to send the voltage of the next operating cycle to the voltage setting unit, so as to set the voltage of the processor to the voltage of the next operating cycle through the voltage setting unit; and send the frequency of the next operating cycle to the frequency setting unit, so as to set the frequency of the processor to the frequency of the next operating cycle through the frequency setting unit.
[0179] In some embodiments, the acquisition unit 1110 is also used to re-acquire the temperature and power consumption of the processor in response to the processor running a cycle with the working parameters of the next operating cycle; the second determination unit 1130 is also used to determine new operating parameters based on the working parameters of the next operating cycle, the target power consumption, the power consumption calculation strategy and the re-acquired temperature and power consumption.
[0180] In some embodiments, the static power consumption calculation strategy is obtained based on a pre-trained static power consumption model; the training unit is also used to obtain a second sample set including multiple second sample data; the second sample data includes static power consumption related to voltage, temperature and static current, and the static power consumption is the power consumption of the processor at voltage and temperature in a no-load state; the static power consumption model is obtained based on the second sample set; the static power consumption model is used to generate static power consumption based on the voltage, temperature and static current of the processor.
[0181] 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.
[0182] It should be noted that in the embodiment of the present application, if the above-mentioned processor operating parameter adjustment 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 a number of 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 described in 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.
[0183] An embodiment of the present application provides a processor, including the management control component in the above embodiment.
[0184] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0185] 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, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.
[0186] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0187] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.
[0188] 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, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.
[0189] Fig.12 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown in FIG. Fig.12 As shown, the hardware entity of the computer device 1200 includes: a processor 1201 and a memory 1202, wherein the memory 1202 stores a computer program that can be run on the processor 1201, and the processor 1201 implements the steps in the method of any of the above embodiments when executing the program.
[0190] The memory 1202 stores computer programs that can be run on the processor. The memory 1202 is configured to store instructions and applications executable by the processor 1201. It can also cache data to be processed or processed by the processor 1201 and various modules in the computer device 1200 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0191] When the processor 1201 executes the program, the steps of any of the above-mentioned methods for adjusting the processor operating parameters are implemented. The processor 1201 generally controls the overall operation of the computer device 1200.
[0192] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the processor operating parameter adjustment method of any of the above embodiments.
[0193] It should be noted here that the description of the above storage medium and device 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 storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0194] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, and the embodiments of the present application are not specifically limited.
[0195] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0196] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for adjusting processor operating parameters, characterized in that: The method comprises: Get the current operating parameters, current temperature and current power consumption of the processor; Based on the power consumption calculation strategy corresponding to the processor, current load data is determined using the current working parameters, current temperature and current power consumption; the current load data represents the load condition of the processor; Determine the operating parameters of the processor in the next operation cycle by using the current load data, the current temperature, the preset target power consumption and the power consumption calculation strategy; The power consumption calculation strategy is used to calculate the corresponding power consumption using the voltage and frequency obtained based on the voltage-frequency mapping relationship obtained through pre-training.
2. The method according to claim 1, characterized in that: The operating parameters of the processor include voltage and frequency, and the power consumption calculation strategy includes a static power consumption calculation strategy and a dynamic power consumption calculation strategy; the dynamic power consumption calculation strategy is used to calculate the corresponding dynamic power consumption using load data, voltage and frequency obtained based on a pre-trained voltage-frequency mapping relationship; the static power consumption calculation strategy is used to calculate the corresponding static power consumption using the obtained voltage and temperature.
3. The method according to claim 2, characterized in that The voltage and the frequency satisfy the voltage-frequency mapping data corresponding to the processor, and the use of the current load data, the current temperature, the preset target power consumption, and the power consumption calculation strategy to determine the operating parameters of the processor in the next operation cycle includes: Determine a target voltage-frequency combination among multiple voltage-frequency combinations that satisfy the voltage-frequency mapping data; wherein the target voltage-frequency is a voltage-frequency combination among the multiple voltage-frequency combinations whose estimated power consumption obtained based on the current load data and the power consumption calculation strategy is closest to the target power consumption and is less than the target power consumption; The voltage and frequency in the target voltage-frequency combination are determined as operating parameters of the processor in the next operating cycle.
4. The method according to claim 1, characterized in that: The voltage-frequency mapping data is stored in the processor, and the method further includes: In response to the processor being powered on, reading hardware parameters of the processor and a voltage-frequency mapping relationship obtained based on pre-training; Based on the hardware parameters of the processor and the voltage-frequency mapping relationship, voltage-frequency mapping data corresponding to the processor is generated.
5. The method according to claim 1, characterized in that The voltage-frequency mapping relationship is obtained based on a pre-trained voltage-frequency prediction model, and the training process of the voltage-frequency prediction model includes: Acquire a first sample set including a plurality of first sample data; the first sample data includes a voltage-frequency curve related to voltage, temperature, and hardware parameters, the voltage-frequency curve includes a mapping relationship between voltage and frequency and a boundary parameter at a voltage frequency, the boundary parameter being a difference in a ratio of a long-term test and a short-term test passing a test standard at the voltage frequency; The voltage-frequency prediction model is obtained based on the first sample set; the voltage-frequency prediction model is used to generate a voltage-frequency mapping relationship of the processor based on hardware parameters of the processor.
6. The method according to claim 1, characterized in that The determining of current load data based on the power consumption calculation strategy corresponding to the processor and using the current operating parameters, the current temperature and the current power consumption includes: Based on the static power consumption calculation strategy, the current static power consumption is determined using the current operating parameters and the current temperature; Determining current dynamic power consumption based on the current static power consumption and the current power consumption; Based on the dynamic power consumption calculation strategy, the current load data is determined using the current dynamic power consumption and the current operating parameters.
7. The method according to claim 6, characterized in that The determining the current static power consumption based on the static power consumption calculation strategy and using the current operating parameters and the current temperature includes: reading a quiescent current of the processor; The current static power consumption is determined based on the static current, the current operating parameter and the current temperature.
8. The method according to claim 3, characterized in that The processor is provided with a voltage setting unit and a frequency setting unit, and the method further comprises: sending the voltage of the next operation cycle to the voltage setting unit, so that the voltage of the processor is set to the voltage of the next operation cycle through the voltage setting unit; The frequency of the next operation cycle is sent to the frequency setting unit, so that the frequency of the processor is set as the frequency of the next operation cycle through the frequency setting unit.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: In response to the processor running for a cycle with the operating parameters of the next operating cycle, the temperature and power consumption of the processor are reacquired, and new operating parameters are determined based on the operating parameters of the next operating cycle, the target power consumption, the power consumption calculation strategy and the reacquired temperature and power consumption.
10. The method according to any one of claims 1 to 8, characterized in that: The static power consumption calculation strategy is obtained based on a pre-trained static power consumption model, and the method further includes: Acquire a second sample set including a plurality of second sample data; the second sample data includes static power consumption related to voltage, temperature and static current, the static power consumption being power consumption of the processor under no-load state at voltage and temperature; The static power consumption model is obtained based on the second sample set; the static power consumption model is used to generate static power consumption based on the voltage, temperature and static current of the processor.
11. A management control component, arranged in a processor, the management control component comprising: An acquisition unit, used to acquire the current operating parameters, current temperature and current power consumption of the processor; A first determining unit, configured to determine current load data based on a power consumption calculation strategy corresponding to the processor and using the current operating parameters, current temperature, and current power consumption; The current load data represents the load condition of the processor; A second determining unit, configured to determine operating parameters of the processor in a next operating cycle by using the current load data, the current temperature, a preset target power consumption, and the power consumption calculation strategy; The power consumption calculation strategy is used to calculate the corresponding power consumption using the voltage and frequency obtained based on the voltage-frequency mapping relationship obtained through pre-training.
12. A processor, characterized in that: The processor includes the management control component of claim 10.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 9 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 10 are implemented.
15. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps in the method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Power consumption adjusting method and device
CN117296022A
Dynamic voltage frequency adjusting method, device, equipment, medium and processor system
CN117555405A
Parameter adjustment method and device, computer equipment and storage medium
CN118069339A
Chip control method and device, equipment, medium and product
CN119203727A
Metering GPU workload with real time feedback from a power sensor or block activity to maintain below predetermined power budget
US20190286214A1
Cited By
Processor performance optimization method and device, electronic equipment and storage medium
CN120561520A
Processor performance optimization method and apparatus, electronic device, and storage medium
CN120561520B