Method for determining working curve of chip, program product, storage medium and electronic equipment
Through test cases, the minimum working voltage of the chip at multiple frequency points is obtained and the working curve is fitted, which solves the problem of difficulty in determining the minimum working voltage of the chip in the prior art, and realizes fast and simple voltage determination at frequency, improving chip performance and power consumption management.
Patent Information
- Application Number
- CN202510327219.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-25
AI Technical Summary
The prior art is difficult to simply and effectively determine the minimum operating voltage of the chip at different frequencies, resulting in voltage margin limiting chip performance.
By running the test case, the minimum operating voltage of the target chip at multiple target frequency points is obtained, and the relationship curve between the frequency and the minimum operating voltage is fitted, and the minimum operating voltage is determined using this curve.
It provides a fast, simple and versatile method that accurately determines the minimum operating voltage of the chip at different frequencies, improves chip performance and reduces power consumption.
Smart Images

Figure CN120370132A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of semiconductor technology, and in particular, to a method, program product, storage medium, and electronic device for determining the operating curve of a chip. Background Art
[0002] The minimum operating voltage of a chip is the lowest safe operating voltage of the chip under specified operating conditions. In order to cope with problems such as power supply noise and aging, hardware designers often set a voltage margin on the basis of the minimum operating voltage. In the worst case, these voltage margins are necessary to avoid silent data corruption or even system crashes, but in other cases, these voltage margins will limit the performance of the chip. For example, on the premise of the same power consumption wall, according to the formula P dynamic = C * V 2 * F, where C, V, and F represent capacitance, voltage, and frequency respectively. When the core operating voltage of the chip increases, the dynamic power consumption P dynamic of the chip increases, that is, the performance decreases.
[0003] To improve the performance of the chip, it is often necessary to determine the minimum operating voltage of the chip. However, in the prior art, there is a lack of an effective means to simply determine the minimum operating voltage of the chip at different frequencies. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a method, program product, storage medium, and electronic device for determining the operating curve of a chip to improve at least some of the above technical problems.
[0005] To achieve the above purpose, the present application provides the following technical solutions:
[0006] In a first aspect, the embodiments of the present application provide a method for determining the operating curve of a chip, including: obtaining the minimum operating voltages corresponding to a target chip at a plurality of target frequency points by running a test case for the target chip; wherein, the minimum operating voltage is the lowest operating voltage that enables the target chip to correctly execute the test case; fitting the operating curve of the target chip by using the plurality of target frequency points and their corresponding minimum operating voltages; wherein, the operating curve is a curve representing the relationship between frequency and the minimum operating voltage.
[0007] In the above method, the minimum operating voltage of the target chip at the target frequency point can be quickly determined according to the execution status of the test cases for the target chip. After obtaining the minimum operating voltages of the target chip at multiple target frequency points, a working curve characterizing the relationship between frequency and the minimum operating voltage can be fitted for the target chip, and the process is simple and efficient. Based on this working curve, by arbitrarily specifying an operating frequency (of course, within the reasonable range covered by the curve), the minimum operating voltage of the target chip at this frequency can be obtained, which provides great convenience for obtaining the minimum operating voltages of the target chip at different frequencies. Moreover, this method has good generality and is applicable to various types of chips.
[0008] In one implementation of the first aspect, obtaining the minimum operating voltages corresponding to the target chip at multiple target frequency points by running test cases for the target chip includes: at each target frequency point, controlling the target chip to execute the test cases respectively at gradually decreasing operating voltages until it cannot be correctly executed, and determining the operating voltage when the test case is last correctly executed as the minimum operating voltage corresponding to the target chip at this target frequency point.
[0009] In the above implementation, by gradually decreasing the operating voltage of the target chip to finally determine the minimum operating voltage of the target chip, it can effectively avoid system crashes caused by sudden voltage drops during the measurement process, thereby improving the efficiency and stability of measuring the minimum operating voltage.
[0010] In one implementation of the first aspect, at each target frequency point, controlling the target chip to execute the test cases respectively at gradually decreasing operating voltages until it cannot be correctly executed includes: at each target frequency point, controlling the target chip to start from the starting search voltage and execute the test cases respectively at gradually decreasing operating voltages until it cannot be correctly executed; wherein, the starting search voltage is determined according to the distribution data of the minimum operating voltages of existing chips at this target frequency point.
[0011] In the above implementation, starting from the starting search voltage and gradually decreasing the operating voltage of the target chip to finally obtain the minimum operating voltage, since the starting search voltage is determined according to the prior data of some existing chips rather than simply taking a fixed value, it will be closer to the true minimum operating voltage of the target chip, thereby reducing the search range and improving the efficiency of determining the minimum operating voltage.
[0012] In one implementation of the first aspect, the test case is the candidate test case with the highest requirement for the minimum operating voltage selected from multiple candidate test cases, and the multiple candidate test cases cover various working scenarios of the target chip.
[0013] In the above implementation manner, selecting the test case with the highest minimum operating voltage requirement from the candidate test cases covering multiple working scenarios as the test case for actual use can make the measured minimum operating voltage more reasonable because different working scenarios of the target chip are considered.
[0014] In one implementation manner of the first aspect, fitting the operating curve of the target chip by using the multiple target frequencies and their corresponding minimum operating voltages includes: dividing the multiple target frequencies into multiple groups, with each group of target frequencies corresponding to a frequency band; respectively using each group of target frequencies and their corresponding minimum operating voltages to fit the part of the operating curve in the frequency band corresponding to this group of target frequencies.
[0015] In the above implementation manner, when fitting the operating curve of the target chip, a piecewise fitting method can be adopted to adapt to the different relationships between frequency and minimum operating voltage presented in different frequency bands, making the finally obtained operating curve more in line with the actual situation of the target chip. For example, some potential inflection points of the operating curve can be selected as the piecewise frequency points.
[0016] In one implementation manner of the first aspect, the method further includes: determining the operating frequency of the target chip and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to this operating frequency in the operating curve.
[0017] In the above implementation manner, determining the minimum operating voltage of the target chip at this frequency according to the operating frequency and operating curve of the target chip and adjusting the operating voltage of the target chip to this minimum operating voltage is beneficial to reducing the power consumption of the target chip, thereby improving the chip performance. This process can be automated to achieve automatic optimization control of the chip power consumption.
[0018] In an implementation of the first aspect, determining the operating frequency of the target chip and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the operating frequency in the operating curve includes: monitoring the utilization rate of at least one hardware unit inside the target chip; if the utilization rate is higher than a first threshold, then when the power consumption wall of the target chip permits, raising the operating frequency of the target chip to a first frequency and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the first frequency in the operating curve; if the utilization rate is lower than a second threshold, then gradually lowering the operating frequency of the target chip until, after lowering to a second frequency, the utilization rate rises to between the second threshold and the first threshold, and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the second frequency in the operating curve; where the second threshold is less than the first threshold; the method further includes: if the utilization rate is between the second threshold and the first threshold, then maintaining the operating frequency and operating voltage of the target chip unchanged.
[0019] In the above implementation, if the utilization rate of the hardware unit inside the target chip is high (greater than the first threshold), it indicates that there are a large number of computing tasks for the target chip currently, so it is necessary to increase the operating frequency and adjust it to the minimum operating voltage at this time to save power consumption; if the utilization rate of the hardware unit inside the target chip is low (less than the second threshold), it indicates that the target chip is relatively idle currently, so there is no need to maintain high-frequency operation and adjust it to the minimum operating voltage at this time to save power consumption; if the utilization rate of the hardware unit inside the target chip is moderate (between the second threshold and the first threshold), then maintain the operating frequency and operating voltage of the target chip unchanged to avoid performance fluctuations caused by over-adjusting the operating state of the target chip and improve the efficiency ratio.
[0020] In a second aspect, an embodiment of the present application provides a device for determining the operating curve of a chip, including: a voltage acquisition module, configured to obtain the minimum operating voltage corresponding to the target chip at multiple target frequency points by running a test case for the target chip; where the minimum operating voltage is the lowest operating voltage that enables the target chip to correctly execute the test case; a curve fitting module, configured to fit the operating curve of the target chip using the multiple target frequency points and their corresponding minimum operating voltages; where the operating curve is a curve representing the relationship between frequency and the minimum operating voltage.
[0021] In a third aspect, an embodiment of the present application provides a computer program product, including computer program instructions that, when read and run by a processor, execute the method provided by the first aspect or any possible implementation of the first aspect.
[0022] Fourthly, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are read and run by a processor, the method provided in the first aspect or any possible implementation manner of the first aspect is executed.
[0023] Fifthly, an embodiment of the present application provides an electronic device, including: a memory and a processor. Computer program instructions are stored in the memory. When the computer program instructions are read and run by the processor, the method provided in the first aspect or any possible implementation manner of the first aspect is executed. Description of the Drawings
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0025] Figure 1 Shows a possible process of the method for determining the working curve of a chip provided by the embodiment of the present application;
[0026] Figure 2 Shows the possible functional modules that the device for determining the working curve of a chip provided by the embodiment of the present application may include;
[0027] Figure 3 Shows the possible structure of the electronic device provided by the embodiment of the present application. Detailed Embodiments
[0028] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It should be noted that: similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0029] The term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0030] The terms "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and cannot be construed as indicating or implying relative importance, nor can they be construed as requiring or implying any such actual relationship or order between these entities or operations.
[0031] Figure 1 Shows a possible process of the method for determining the operating curve of a chip provided by an embodiment of the present application. This method can be, but is not limited to, executed by an electronic device. Figure 3 Shows a possible structure of the electronic device. For details, reference can be made to the following description about Figure 3 . Referring to Figure 1 , the method for determining the operating curve of a chip includes:
[0032] Step S110: By running a test case for the target chip, obtain the minimum operating voltage corresponding to the target chip at multiple target frequencies.
[0033] The target chip refers to the chip to be analyzed currently. The type of the target chip is not limited. For example, it can be a Graphics Processing Unit (GPU), a Central Processing Unit (CPU for short), a Micro Controller Unit (MCU for short), a Neural-network Processing Unit (NPU for short), a Digital Signal Processor (DSP for short), an Application Specific Integrated Circuits (ASIC for short), a Field Programmable Gate Array (FPGA for short), and so on. In the following text, mainly the case where the target chip is a GPU is taken as an example. Here, the GPU can refer to a kind of hardware mainly used for graphics processing. However, in recent years, due to its advantages in parallel computing, some GPUs have also been designed to engage in many general tasks other than graphics processing. Such GPUs are called GPGPUs.
[0034] A test case is an application program that the target chip can run, such as an application program for hardware diagnosis. The same test case should be used when measuring the minimum operating voltage of the same target chip at different target frequencies. Different target chips (the difference here can be understood as different models, rather than different individuals of the same model) may use different test cases. Of course, it is not excluded that the same test case is used. The test case can be directly specified or selected according to a certain method.
[0035] The operating voltage may refer to the core supply voltage of the target chip. The minimum operating voltage may refer to the lowest operating voltage at which the target chip can correctly execute the test cases. In other words, if the voltage is lower than this value (within a certain accuracy), the target chip will not be able to correctly execute the test cases. Here, correctly executing the test cases means that when the test cases are executed, expected results will be output, such as correct calculated values. While not being able to correctly execute the test cases means that when the test cases are executed, results other than the expected ones will be output, such as incorrect calculated values, or even unable to output effectively or directly cause the system to crash.
[0036] According to the above definition, by searching for the critical point at which the target chip executes the test cases correctly or not, the corresponding minimum operating voltage can be found. Here, the "search" can be understood as making attempts within a certain voltage range using a specific search strategy.
[0037] Some target chips are internally equipped with voltage sensors. According to these voltage sensors, the operating voltage of the target chip, including the minimum operating voltage, can be accurately measured. Of course, for chips without voltage sensors, voltage measurement can also be carried out through external devices (such as oscilloscopes).
[0038] The minimum operating voltages corresponding to the target chip at different operating frequencies are different. The target frequencies can be multiple frequencies selected from the distribution range of the operating frequencies of the target chip. For each target frequency, after adjusting the operating frequency of the target chip to the corresponding frequency, the minimum operating voltage of the target chip at this frequency is measured respectively.
[0039] For example, the minimum operating frequency of the target chip is 1 GHz, and the maximum operating frequency is 1.4 GHz, which is determined by the hardware conditions of the target chip. 1 GHz and 1.4 GHz can be selected as 2 target frequencies, the midpoint 1.2 GHz can be selected as 1 target frequency, and then 1 frequency is selected from each of the intervals (1 GHz, 1.2 GHz) and (1.2 GHz, 1.4 GHz) as target frequencies, such as 1.1 GHz and 1.3 GHz. In this way, a total of 5 target frequencies are selected. The operating frequency of the target chip can be set to 1 GHz, 1.1 GHz, 1.2 GHz, 1.3 GHz, and 1.4 GHz in sequence, and 5 minimum operating voltages are measured.
[0040] It should be noted that the distribution of the target frequencies is not necessarily uniform. For example, in the frequency band where the minimum operating voltage changes slowly with the frequency, fewer target frequencies can be selected; in the frequency band where the minimum operating voltage changes rapidly with the frequency, more target frequencies can be selected, so as to better describe the geometric shape of the working curve in step S120.
[0041] Step S120: Fit the operating curve of the target chip using multiple target frequencies and their corresponding minimum operating voltages.
[0042] The operating curve of the target chip is a curve that characterizes the relationship between frequency and the minimum operating voltage of the target chip. The specific form of the operating curve is not limited. For example, it can be a straight line (including a piecewise straight line), a quadratic curve (including a piecewise quadratic curve), a cubic curve (including a piecewise cubic curve), and so on.
[0043] After measuring the minimum operating voltage in step S110, combined with the target frequencies, a number of two-dimensional points in the form of (frequency, minimum operating voltage) are formed. Based on these two-dimensional points, the operating curve of the target chip can be fitted. The fitting methods include the least squares method, polynomial regression method, matrix decomposition method, etc. For example, the least squares method can be used to fit a quadratic curve with frequency as the independent variable and minimum operating voltage as the dependent variable. The complexity of the quadratic curve is moderate, which can not only accurately show the relationship between frequency and minimum operating voltage, but also avoid the problem of overfitting.
[0044] In the above method, according to the execution situation of the test cases for the target chip, the minimum operating voltage of the target chip at the target frequencies can be quickly determined. After obtaining the minimum operating voltages of the target chip at multiple target frequencies, the operating curve characterizing the relationship between frequency and minimum operating voltage can be fitted for the target chip. The process is simple and efficient. Based on this operating curve, by arbitrarily specifying an operating frequency (of course, within the reasonable range covered by the curve, such as the range of 1 GHz to 1.4 GHz in the above example), the minimum operating voltage of the target chip at this frequency can be obtained, which provides great convenience for obtaining the minimum operating voltages of the target chip at different frequencies. Moreover, this method has good generality and is applicable to various types of chips. In addition, the form of the operating curve is simple and convenient for visual display.
[0045] As an alternative method, the operating curve in step S120 can also be replaced by a model that characterizes the relationship between frequency and the minimum operating voltage of the target chip, such as a neural network model. The input of this model is the specified operating frequency, and the output is the minimum operating voltage of the target chip predicted by the model at this frequency. The parameters of this model can be obtained by training based on multiple target frequencies and their corresponding minimum operating voltages.
[0046] In one implementation, the test case in step S110 can be selected from multiple candidate test cases. These candidate test cases cover various working scenarios of the target chip, such as extreme computing loads, data throughput encapsulation, etc. Each candidate test case can correspond to one working scenario. The Power Profiling tool can be used to run different candidate test cases on the target chip, and according to the analysis results, select the candidate test case with the highest requirement for the minimum working voltage (i.e., the largest value) as the test case actually used for the target chip. This can make the subsequently measured minimum working voltage more reasonable because it takes into account the situation of the target chip under different working scenarios.
[0047] In one implementation, step S110 can further include: at each target frequency point, control the target chip to execute the test case at gradually decreasing working voltages until it cannot be correctly executed, and determine the working voltage when the test case was last correctly executed as the minimum working voltage corresponding to the target chip at that target frequency point.
[0048] For example, if the target frequency point is 1.2 GHz, control the target chip to start from 1 V and gradually decrease the working voltage in steps of 20 mV. Execute the test case at each working voltage and confirm whether the execution result is correct until the test case cannot be correctly executed. For instance, when the working voltage is 1 V, execute the test case. If the execution result is correct, then reduce the working voltage to 980 mV and execute the test case again. If the execution result is correct, then reduce the working voltage to 960 mV and execute the test case again, and so on. Assume that when the working voltage is reduced to 700 mV, the execution result of the test case is incorrect, then stop further reducing the working voltage. And since the working voltage can be reduced to 700 mV, it indicates that the test case was correctly executed when the working voltage was 720 mV. Thus, the minimum working voltage at 1.2 GHz is 720 mV.
[0049] In the above example, strictly speaking, the value of the true minimum operating voltage should be between 700 mV and 720 mV. 720 mV is just the minimum operating voltage determined at an accuracy with a step size of 20 mV. Optionally, to more precisely determine the minimum operating voltage, starting from 720 mV, the operating voltage can be gradually decreased with a smaller step size (such as 5 mV). Test cases are executed at each operating voltage and it is confirmed whether the execution results are correct until the test cases cannot be executed correctly. For example, when the operating voltage is 715 mV, the test case is executed. If the execution result is correct, the operating voltage is decreased to 710 mV. The test case is executed again. If the execution result is correct, the operating voltage is decreased to 705 mV. The test case is executed again. If the execution result is incorrect, the decrease of the operating voltage is stopped, and it can be determined that the minimum operating voltage at 1.2 GHz is 710 mV. The above process can be iteratively executed, and the adjustment step size of the operating voltage is decreased each time, so as to obtain a more accurate minimum operating voltage. Generally speaking, the step size gradually decreases, that is, a search strategy of first rough and then precise is adopted when determining the minimum operating voltage, which helps to improve the efficiency.
[0050] There are also other strategies for the value of the adjustment step size of the operating voltage, such as decreasing the step size each time a test case is executed, etc., which will not be elaborated in detail.
[0051] In the above implementation method, by gradually decreasing the operating voltage of the target chip to finally determine the minimum operating voltage of the target chip, the minimum operating voltage can be measured more precisely, and the system crash caused by the sudden voltage drop during the measurement process can be effectively avoided, thereby improving the efficiency and stability of measuring the minimum operating voltage.
[0052] When determining the minimum operating voltage of the target chip, it starts from an initial operating voltage and the test cases are repeatedly executed. If the process of finding the minimum operating voltage is regarded as a search process, this initial operating voltage can be called the starting search voltage. For example, for the target frequency point of 1.2 GHz, the starting search voltage in the above example is 1 V.
[0053] In one implementation method, for different target frequency points, the starting search voltage can be the same preset value, such as 1 V.
[0054] In another implementation method, for different target frequency points, the starting search voltage can be different preset values. For example, at 1.1 GHz it is 900 mV, and at 1.2 GHz it is 1 V. This may narrow the search range and improve the efficiency of determining the minimum operating voltage.
[0055] In another implementation, for different target frequencies, the starting search voltage can be determined according to the distribution data of the minimum operating voltages of existing chips at the target frequency. Here, the existing chips can be some chips for which the minimum operating voltages have been measured, and these chips and the target chip can be of different models. For example, if the minimum operating voltages of 10 existing chips at 1.2 GHz have been measured and these minimum operating voltages are distributed between 650 mV and 750 mV, it can be reasonably inferred that the minimum operating voltage of the target chip at 1.2 GHz will not exceed 800 mV (with a certain margin added to 750 mV). Therefore, the starting search voltage can be set to 800 mV. Compared with directly using the preset value of 1 V in other implementations, 800 mV is significantly closer to the true minimum operating voltage of the target chip, thus reducing the search range and the number of test cases to be executed, and improving the efficiency of determining the minimum operating voltage. For different target frequencies, the starting search voltage can be determined separately in the above manner.
[0056] In one implementation, step S120 can adopt a piecewise fitting method when fitting the operating curve of the target chip, so as to adapt to the different relationships between frequency and minimum operating voltage in different frequency bands, and make the finally obtained operating curve more in line with the actual situation of the target chip. The specific approach is as follows:
[0057] Step A: Divide multiple target frequencies into multiple groups, with each group of target frequencies corresponding to a frequency band.
[0058] For example, there are a total of 5 target frequencies, namely 1 GHz, 1.1 GHz, 1.2 GHz, 1.3 GHz, and 1.4 GHz, which are divided into two groups. One group is 1 GHz, 1.1 GHz, and 1.2 GHz, corresponding to the low-frequency band, and the other group is 1.2 GHz, 1.3 GHz, and 1.4 GHz, corresponding to the high-frequency band. Note that the segmentation frequency point of 1.2 GHz can appear in adjacent groups of target frequencies at the same time.
[0059] There is no limitation on how to select the segmentation frequency point. For example, the potential inflection point of the operating curve can be selected as the segmentation frequency point. Although the operating curve of the target chip is not yet determined at this time, the possible inflection point position can be inferred based on empirical data (such as the measurement results of the operating curves of existing chips). Select the target frequency near the potential inflection point and use it as the segmentation frequency point because on both sides of the inflection point, the shape of the curve may have obvious differences, and piecewise fitting may have a better effect.
[0060] Step B: Use each group of target frequencies and their corresponding minimum operating voltages to fit the part of the operating curve in the frequency band corresponding to the group of target frequencies respectively.
[0061] Continuing with the example in step A, for 1 GHz, 1.1 GHz, 1.2 GHz and their corresponding three minimum operating voltages, the part of the operating curve of the target chip in the low-frequency band (1 GHz to 1.2 GHz) can be fitted; for 1.2 GHz, 1.3 GHz, 1.4 GHz and their corresponding three minimum operating voltages, the part of the operating curve of the target chip in the high-frequency band (1.2 GHz to 1.4 GHz) can be fitted. These two parts of the operating curve are joined together at 1.2 GHz to form the operating curve of the target chip.
[0062] Continuing to refer to Figure 1 , in one implementation, after step S120, the method further includes step S130: determining the operating frequency of the target chip and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the operating frequency in the operating curve.
[0063] The operating frequency of the target chip can be a preset value or can be dynamically set according to the current state of the target chip. The current state here includes but is not limited to at least one of the following factors: the current hardware utilization rate of the target chip, the current temperature of the target chip, the current aging degree of the target chip, the current power consumption of the target chip, the task currently executed by the target chip, and user requirements.
[0064] After determining the operating frequency of the target chip and substituting it into the operating curve calculated in step S120, the minimum operating voltage of the target chip at this operating frequency can be obtained. Then, the operating voltage of the target chip can be adjusted to this minimum operating voltage and run, which is beneficial to minimizing the power consumption of the target chip as much as possible on the premise of ensuring the normal operation of the target chip, thereby improving the chip performance.
[0065] Note that the above process of setting the operating frequency and adjusting the operating voltage can be automatically performed during the operation of the target chip, so as to achieve automatic optimization control of the chip power consumption. The following gives a specific example:
[0066] Step a: Monitoring the utilization rate of at least one hardware unit inside the target chip.
[0067] For example, the utilization rates of the arithmetic logic unit (ALU for short) and the load / store unit inside the target chip can be monitored. The monitoring behavior can be implemented through the monitoring program in the firmware of the target chip, and the monitoring behavior can be real-time and continuous. The monitoring can be enabled according to the user's requirements, or it can also be automatically enabled when the user runs the application program.
[0068] Step b: If the utilization rate is higher than the first threshold, then when the power consumption wall of the target chip permits, increase the operating frequency of the target chip to the first frequency, and adjust the operating voltage of the target chip to the minimum operating voltage corresponding to the first frequency in the operating curve.
[0069] The first threshold can be a preset value, such as 90%.
[0070] For the case where there is more than one monitored hardware unit in step a, the utilization rate of the hardware unit being higher than the first threshold can be defined as the utilization rate of at least one hardware unit being higher than the first threshold. For example, the utilization rate of the ALU and / or LSU is higher than the first threshold, which makes it relatively easy to trigger the increase in the operating frequency in step b and gives full play to the potential of the target chip as much as possible. Of course, it is not excluded that when implemented, the utilization rate of the hardware unit being higher than the first threshold is defined otherwise, such as the utilization rate of all hardware units being higher than the first threshold.
[0071] The first frequency is a frequency determined based on the power consumption wall of the target chip. For example, it can be determined based on the Proportional-Integral-Derivative (PID) algorithm. For instance, if the current operating frequency of the target chip is 1.2 GHz, the current power consumption is 130 w, and the power consumption wall is 150 w, then the PID algorithm can be used to calculate that the frequency to be increased is 50 MHz, and then adding 1.2 GHz gives the first frequency of 1.25 GHz (the values are only for illustration and do not represent real operation values). Substituting the first frequency into the operating curve, the minimum operating voltage corresponding to the first frequency can be obtained, and then the operating voltage of the target chip can be adjusted to this voltage.
[0072] In step b, if the utilization rate of the hardware units inside the target chip is relatively high (greater than the first threshold), it indicates that there are a large number of computing tasks on the target chip currently. Therefore, it is necessary to increase the operating frequency and adjust it to the minimum operating voltage at this time to save power consumption.
[0073] Step c: If the utilization rate is lower than the second threshold, then gradually reduce the operating frequency of the target chip until after reducing to the second frequency, the utilization rate rises back between the second threshold and the first threshold, and adjust the operating voltage of the target chip to the minimum operating voltage corresponding to the second frequency in the operating curve.
[0074] The second threshold is less than the first threshold, and the second threshold can be a preset value, such as 80%.
[0075] For the case where there is more than one hardware unit to be monitored in step a, if the utilization rate of the hardware unit is lower than the second threshold, it can be defined that the utilization rates of all hardware units are lower than the second threshold. For example, the utilization rates of both the ALU and LSU are lower than the second threshold. In this way, it is relatively difficult to trigger the reduction of the operating frequency in step c, and the potential of the target chip is maximized as much as possible. Of course, it is not excluded that when implemented, other definitions are made for the case where the utilization rate of the hardware unit is lower than the second threshold. For example, it is sufficient that the utilization rate of at least one hardware unit is lower than the second threshold.
[0076] The operating frequency of the target chip can be gradually reduced in a certain step size to avoid sudden frequency drops that may cause the chip's operating state to become unstable. After the operating frequency is reduced, the computing power of the chip decreases. Therefore, only by increasing the hardware utilization rate can the normal execution of tasks be ensured. Once it is detected that the utilization rate of the hardware unit has risen back between the second threshold and the first threshold, the reduction of the operating frequency of the target chip can be stopped. The operating frequency at this time is denoted as the second frequency. Substituting the second frequency into the operating curve, the minimum operating voltage corresponding to the second frequency can be obtained, and then the operating voltage of the target chip can be adjusted to this voltage.
[0077] In step c, if the utilization rate of the hardware units inside the target chip is low (less than the second threshold), it indicates that the target chip is relatively idle at present. Therefore, there is no need to maintain a high operating frequency, and the operating voltage is adjusted to the minimum operating voltage at this time to save power consumption.
[0078] Step d: If the utilization rate is between the second threshold and the first threshold, the operating frequency and operating voltage of the target chip are maintained unchanged.
[0079] Combining steps b and c, for the case where there is more than one hardware unit to be monitored in step a, if the utilization rate of the hardware unit is between the second threshold and the first threshold, it can be defined that the utilization rates of all hardware units do not exceed the first threshold, and the utilization rate of at least one hardware unit is not lower than the second threshold. Of course, it is not excluded that other definition methods are adopted.
[0080] In step d, if the utilization rate of the hardware units inside the target chip is moderate (between the second threshold and the first threshold), it indicates that the current operating state of the target chip can well meet the requirements of the current task. Then, there is no need to adjust the operating frequency and operating voltage of the target chip to avoid performance fluctuations caused by excessive adjustment of the operating state of the target chip and improve the efficiency ratio.
[0081] It should be noted that the above steps b to d correspond to three cases where the utilization rate of the hardware unit is satisfied. Therefore, they are parallel solutions and not sequential execution solutions.
[0082] Next, based on the above embodiments, a possible execution manner of steps S110 to S130 is further introduced through an example:
[0083] If the target chip is a GPU installed on an electronic device, and the device also includes a CPU, step S110 can be executed on the CPU. Of course, here it refers to executing the control logic in the step. Executing the test cases must be done on the GPU. After the CPU obtains the minimum operating voltages at 5 target frequencies, it passes them to the GPU firmware through a specified port. The GPU firmware also stores the minimum operating voltages at 5 target frequencies. If the 5 values passed in are different from those previously stored, the minimum operating voltage is updated. If they are the same, no operation needs to be performed. After that, the GPU firmware fits the operating curve of the target chip based on the 5 target frequencies and their corresponding minimum operating voltages stored internally, that is, step S120 is executed. For this purpose, the GPU firmware needs to support floating-point operations and can design a streamlined floating-point arithmetic unit to avoid performance loss caused by the occupation of floating-point computing resources. After fitting the operating curve, the GPU firmware can automatically control the operating frequency and operating voltage of the target chip according to steps a - d, that is, step S130 is executed.
[0084] Optionally, the fitting of the operating curve can also be completed on the CPU, that is, step S120 is executed, and then the parameters of the operating curve are passed to the GPU firmware. After the GPU firmware obtains these parameters, it is equivalent to obtaining the operating curve and can continue to execute step S130 based on the operating curve. In this way, the design and computing burden of the GPU can be simplified.
[0085] Optionally, all steps of S110 - S130 can also be completed in the GPU firmware, but this will make the logic of the firmware complex and requires better performance of the GPU to support.
[0086] After each power-on of the device installed with the GPU, steps S110 - S130 can be executed once to automatically determine the operating curve of the GPU, set the appropriate operating frequency and operating voltage. After that, as long as the device does not shut down, steps S110 and S120 do not need to be executed, and only step S130 is executed. Since these steps are re-executed every time of power-on, it can be ensured that the operating curve of the GPU always conforms to the latest hardware state (for example, the aging condition of the GPU, ambient temperature, etc.), so the automatic optimization control effect of the GPU power consumption using this operating curve is also relatively good.
[0087] In addition, the step of selecting test cases through power consumption analysis mentioned above can be completed during the design and manufacturing of the GPU. After the GPU is sold to users, the test cases have been selected and packaged as part of the program for users. On the user side, only by running the program can the test cases be used to measure the minimum operating voltage and execute the subsequent steps, which is very convenient.
[0088] For the case where the target chip is other chips, similar analysis can be performed. It should be noted that the working curve of the target chip can be used not only for executing step S130, but also for other purposes such as static power consumption fitting, that is, it is not limited to executing step S130.
[0089] Figure 2 shows possible functional modules included in the device 200 for determining the working curve of a chip provided in an embodiment of the present application. Refer to Figure 2 and the device includes:
[0090] a voltage acquisition module 210, configured to obtain the minimum working voltages corresponding to the target chip at multiple target frequencies by running a test case for the target chip; wherein, the minimum working voltage is the lowest working voltage that enables the target chip to correctly execute the test case;
[0091] a curve fitting module 220, configured to fit the working curve of the target chip by using the multiple target frequencies and their corresponding minimum working voltages; wherein, the working curve is a curve characterizing the relationship between the frequency and the minimum working voltage.
[0092] In an implementation manner of the above device, the voltage acquisition module 210 obtains the minimum working voltages corresponding to the target chip at multiple target frequencies by running a test case for the target chip, including: at each target frequency, controlling the target chip to execute the test case respectively at gradually decreasing working voltages until it cannot be correctly executed, and determining the working voltage when the test case is last correctly executed as the minimum working voltage corresponding to the target chip at this target frequency.
[0093] In an implementation manner of the above device, the voltage acquisition module 210, at each target frequency, controls the target chip to execute the test case respectively at gradually decreasing working voltages until it cannot be correctly executed, including: at each target frequency, controlling the target chip to start from the starting search voltage and execute the test case respectively at gradually decreasing working voltages until it cannot be correctly executed; wherein, the starting search voltage is determined according to the distribution data of the minimum working voltages of existing chips at this target frequency.
[0094] In an implementation manner of the above device, the test case is a candidate test case selected from multiple candidate test cases and having the highest requirement for the minimum working voltage, and the multiple candidate test cases cover various working scenarios of the target chip.
[0095] In one implementation of the above device, the curve fitting module 220 fits the operating curve of the target chip by using the multiple target frequency points and their corresponding minimum operating voltages, including: dividing the multiple target frequency points into multiple groups, where each group of target frequency points corresponds to a frequency band; respectively using each group of target frequency points and their corresponding minimum operating voltages to fit the part of the operating curve in the frequency band corresponding to the group of target frequency points.
[0096] In one implementation of the above device, the device further includes: a chip control module 230, configured to determine the operating frequency of the target chip and adjust the operating voltage of the target chip to the minimum operating voltage corresponding to the operating frequency in the operating curve.
[0097] In one implementation of the above device, the chip control module 230 determines the operating frequency of the target chip and adjusts the operating voltage of the target chip to the minimum operating voltage corresponding to the operating frequency in the operating curve, including: monitoring the utilization rate of at least one hardware unit inside the target chip; if the utilization rate is higher than a first threshold, then when the power consumption wall of the target chip permits, raising the operating frequency of the target chip to a first frequency and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the first frequency in the operating curve; if the utilization rate is lower than a second threshold, then gradually reducing the operating frequency of the target chip until after reducing to a second frequency, the utilization rate rises to between the second threshold and the first threshold, and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the second frequency in the operating curve; where the second threshold is less than the first threshold; the chip control module 230 is further configured to: if the utilization rate is between the second threshold and the first threshold, then keep the operating frequency and operating voltage of the target chip unchanged.
[0098] The device 200 for determining the operating curve of a chip provided by an embodiment of the present application can be used to execute the method for determining the operating curve of a chip provided by an embodiment of the present application. Its implementation principle and the resulting technical effects have been introduced in the foregoing method embodiments. For a brief description, for parts not mentioned in the device embodiment, reference can be made to the corresponding content in any of the foregoing method embodiments.
[0099] Figure 3 shows a possible structure of the electronic device 300 provided by an embodiment of the present application. Referring to Figure 3 , the electronic device 300 includes: a processor 310 and a memory 320. These components are interconnected and communicate with each other through a communication bus 330 and / or other forms of connection mechanisms (not shown).
[0100] Among them, the processor 310 includes one or more (only one is shown in the figure), which can be an integrated circuit chip with the ability to process signals. The above-mentioned processor 310 can be a general-purpose processor, including a CPU, MCU, or other conventional processors; it can also be a dedicated processor, including a GPU, NPU, DSP, ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Moreover, when there are multiple processor 310s, a part of them can be general-purpose processors, and another part can be dedicated processors.
[0101] The memory 320 includes one or more (only one is shown in the figure), which can be, but is not limited to, a random access memory (Random Access Memory, abbreviated as RAM), a read-only memory (Read Only Memory, abbreviated as ROM), a programmable read-only memory (Programmable Read-Only Memory, abbreviated as PROM), an erasable programmable read-only memory (Erasable Programmable Read-Only Memory, abbreviated as EPROM), an electrically erasable programmable read-only memory (Electric Erasable Programmable Read-Only Memory, abbreviated as EEPROM), etc.
[0102] The processor 310 and other possible components can access the memory 320, read and / or write the data therein. In particular, one or more computer program instructions can be stored in the memory 320, and the processor 310 can read and run these computer program instructions to implement the method for determining the working curve of the chip provided in the embodiments of the present application.
[0103] In some implementation manners, the processor 310 can be packaged in the form of a chip, but some chips can also include the memory 320. For example, the firmware mentioned in the foregoing method embodiments is stored in the memory 320 inside the chip in a solidified manner.
[0104] In the method for determining the working curve of the chip provided in the embodiments of the present application, the target chip is also installed in the electronic device 300. The target chip may include the processor 310, that is, the target chip will also execute some or all of the steps of the method. For details, reference can be made to the foregoing method embodiments. However, it is also possible that the target chip does not include the processor 310, that is, the target chip is only an object to be measured or controlled, and the main logic of the method is executed on the processor 310.
[0105] It can be understood that Figure 3 The structure shown is only schematic, and the electronic device 300 may further include more than Figure 3more or fewer components shown therein, or having a configuration different from that shown in Figure 3 For example, the electronic device 300 may further include a communication unit. The communication unit can be used to communicate directly or indirectly with other devices for data interaction. The communication unit can be a wired and / or wireless communication module.
[0106] Figure 3 Each component shown in can be implemented by hardware, software, or a combination thereof. The electronic device 300 can be a mobile phone, a PC, a server, a robot, a household appliance, a vehicle, an industrial device, etc. Moreover, the electronic device 300 is not limited to a single device, and can also be a combination of multiple devices or a cluster composed of a large number of devices.
[0107] The embodiment of the present application also provides a computer-readable storage medium. When the computer program instructions stored on the computer-readable storage medium are read and run by a processor, they execute the method for determining the working curve of the chip provided by the embodiment of the present application. For example, the computer-readable storage medium can be implemented as Figure 3 the memory 320 in the electronic device 300 shown in, or exist independently in the form of an optical disc, a USB flash drive, a mobile hard disk, etc.
[0108] The embodiment of the present application also provides a computer program product. When the computer program instructions included in the computer program product are read and run by a processor, they execute the method for determining the working curve of the chip provided by the embodiment of the present application. For example, these computer program instructions can be stored Figure 3 inside the memory 320 in the electronic device 300 shown in, or stored in an independent memory such as an optical disc, a USB flash drive, a mobile hard disk, etc.
[0109] The above are only the embodiments of the present application and are not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining the working curve of a chip, characterized in that, Including: By running test cases for a target chip, obtaining the minimum operating voltages corresponding to the target chip at multiple target frequencies; wherein, the minimum operating voltage is the lowest operating voltage that enables the target chip to correctly execute the test cases. Using the multiple target frequencies and their corresponding minimum operating voltages to fit the operating curve of the target chip; wherein, the operating curve is a curve characterizing the relationship between frequency and the minimum operating voltage.
2. The method according to claim 1, characterized in that, The step of obtaining the minimum operating voltages corresponding to the target chip at multiple target frequencies by running test cases for the target chip includes: At each target frequency, controlling the target chip to execute the test cases respectively at gradually decreasing operating voltages until it cannot be correctly executed, and determining the operating voltage when the test case was last correctly executed as the minimum operating voltage corresponding to the target chip at that target frequency.
3. The method according to claim 2, wherein The step of, at each target frequency, controlling the target chip to execute the test cases respectively at gradually decreasing operating voltages until it cannot be correctly executed includes: At each target frequency, controlling the target chip to start from the starting search voltage and execute the test cases respectively at gradually decreasing operating voltages until it cannot be correctly executed; wherein, the starting search voltage is determined according to the distribution data of the minimum operating voltages of existing chips at that target frequency.
4. The method according to claim 1, wherein The test case is a candidate test case selected from multiple candidate test cases and having the highest requirement for the minimum operating voltage, and the multiple candidate test cases cover various working scenarios of the target chip.
5. The method according to claim 1, characterized in that, Using the multiple target frequencies and their corresponding minimum operating voltages to fit the operating curve of the target chip includes: Dividing the multiple target frequencies into multiple groups, with each group of target frequencies corresponding to a frequency band. Respectively using each group of target frequencies and their corresponding minimum operating voltages to fit the part of the operating curve in the frequency band corresponding to that group of target frequencies.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Determining the operating frequency of the target chip and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the operating frequency in the operating curve.
7. The method according to claim 6, characterized in that The step of determining the operating frequency of the target chip and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the operating frequency in the operating curve includes: Monitoring the utilization rate of at least one hardware unit inside the target chip. If the utilization rate is higher than a first threshold, then, when permitted by the power consumption wall of the target chip, raising the operating frequency of the target chip to a first frequency and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the first frequency in the operating curve. If the utilization rate is lower than a second threshold, then gradually decreasing the operating frequency of the target chip until, after decreasing to a second frequency, the utilization rate rises to between the second threshold and the first threshold, and adjusting the operating voltage of the target chip to the minimum operating voltage corresponding to the second frequency in the operating curve; wherein, the second threshold is less than the first threshold. The method further includes: If the utilization rate is between the second threshold and the first threshold, the operating frequency and operating voltage of the target chip are maintained unchanged.
8. A computer program product, characterized in that, It includes computer program instructions, which, when read and executed by a processor, perform the method according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, Computer program instructions are stored on the computer-readable storage medium, which, when read and executed by a processor, perform the method according to any one of claims 1-7.
10. An electronic device, characterized in that, It includes: A memory and a processor, wherein computer program instructions are stored in the memory, and when the computer program instructions are read and executed by the processor, the method according to any one of claims 1-7 is performed.
Citation Information
Cited By
Dynamic voltage frequency configuration method, device, equipment and program product of chip
CN121210227A
State evaluation method, device and equipment of computing power chip and storage medium
CN121299426A
Fine-grained scanning method and device for lowest stable voltage, electronic equipment and storage medium
CN122043211A