CN116225202B - Power consumption control method and device for GPU, electronic equipment and storage medium - Google Patents

Power consumption control method and device for GPU, electronic equipment and storage medium Download PDF

Info

Publication number
CN116225202B
CN116225202B CN202310182002.6A CN202310182002A CN116225202B CN 116225202 B CN116225202 B CN 116225202B CN 202310182002 A CN202310182002 A CN 202310182002A CN 116225202 B CN116225202 B CN 116225202B
Authority
CN
China
Prior art keywords
power consumption
gpu
preset
determining
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310182002.6A
Other languages
Chinese (zh)
Other versions
CN116225202A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Moore Threads Technology Co Ltd
Original Assignee
Moore Threads Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Moore Threads Technology Co Ltd filed Critical Moore Threads Technology Co Ltd
Priority to CN202310182002.6A priority Critical patent/CN116225202B/en
Publication of CN116225202A publication Critical patent/CN116225202A/en
Application granted granted Critical
Publication of CN116225202B publication Critical patent/CN116225202B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/324Power saving characterised by the action undertaken by lowering clock frequency
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3058Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations
    • G06F11/3062Monitoring arrangements for monitoring environmental properties or parameters of the computing system or of the computing system component, e.g. monitoring of power, currents, temperature, humidity, position, vibrations where the monitored property is the power consumption
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Power Sources (AREA)
  • Secondary Cells (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The disclosure relates to a power consumption control method, a device, an electronic device and a storage medium for a GPU. The method comprises the following steps: obtaining the current power consumption of the GPU; acquiring target power consumption of the GPU and static power consumption of the GPU; determining a target working voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption; and determining the target working frequency of the GPU according to the target working voltage and the corresponding relation between the preset working frequency and the working voltage.

Description

Power consumption control method and device for GPU, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of signal processing, and in particular relates to a power consumption control method for a GPU, a power consumption control device for the GPU, an electronic device and a storage medium.
Background
A GPU (Graphics Processing Unit, graphics processor) is a high performance, high power consumption image processor. In the running process of the GPU, the power consumption of the GPU is ensured to be in a safe and reasonable range, otherwise, the chip is damaged and the performance is reduced.
Disclosure of Invention
The disclosure provides a power consumption control technical scheme for a GPU.
According to an aspect of the present disclosure, there is provided a power consumption control method for a GPU, including:
obtaining the current power consumption of the GPU;
acquiring target power consumption of the GPU and static power consumption of the GPU;
determining a target working voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption;
and determining the target working frequency of the GPU according to the target working voltage and the corresponding relation between the preset working frequency and the working voltage.
In one possible implementation manner, the determining the target operating voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption includes:
and in response to the GPU being in a power consumption control state, determining a target working voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption.
In one possible implementation, the method further includes:
judging whether the GPU is in the power consumption control state or not according to the current power consumption, preset control power consumption and preset exit power consumption, wherein the preset control power consumption is higher than the preset exit power consumption.
In one possible implementation manner, the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption and the preset exit power consumption includes:
And in response to the GPU being in the power consumption control state, and the continuous times that the power consumption of the GPU is smaller than the preset exit power consumption not reaching the preset times, determining that the GPU is continuously in the power consumption control state, wherein the preset times are larger than 1.
In one possible implementation manner, the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption and the preset exit power consumption includes:
and responding to the GPU in the power consumption control state, wherein the current power consumption is smaller than the preset exit power consumption, and the continuous times of which the power consumption of the GPU is smaller than the preset exit power consumption reach the preset times, and determining that the GPU exits from the power consumption control state.
In one possible implementation manner, the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption and the preset exit power consumption includes:
determining that the GPU enters the power consumption control state in response to the fact that the GPU is not in the power consumption control state and the current power consumption is larger than or equal to preset control power consumption;
or,
and determining that the GPU is not in the power consumption control state in response to the GPU is not in the power consumption control state and the current power consumption is smaller than the preset control power consumption.
In one possible implementation manner, the determining the target operating voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption includes:
determining a current scaling factor according to the current power consumption, the target power consumption and the static power consumption;
and determining the target working voltage of the GPU according to the current proportion coefficient and the corresponding relation between the proportion coefficient and the working voltage.
In one possible implementation manner, the determining the current scaling factor according to the current power consumption, the target power consumption and the static power consumption includes:
determining a first difference between the target power consumption and the static power consumption;
determining a second difference between the current power consumption and the static power consumption;
a current scaling factor between the first difference and the second difference is determined.
In one possible implementation, the correspondence between the scaling factor and the operating voltage is v=c 0 +c 1 ×a+c 2 ×a 2 Wherein v represents the operating voltage, a represents the scaling factor, c 0 、c 1 And c 2 Is a parameter of fitting, and c 0 、c 1 And c 2 Fitting based on historical data.
In one possible implementation manner, the obtaining the current power consumption of the GPU includes:
Acquiring sampling power consumption of the GPU;
and filtering the sampling power consumption to obtain the current power consumption of the GPU.
In one possible implementation manner, the corresponding relationship between the preset working frequency and the working voltage is:
f=a 0 ×p 2 +a 1 ×v 2 +a 2 ×t 2 +a 3 ×p×v+a 4 ×p×t+a 5 ×v×t+a 6 ×p+a 7 ×v+a 8 ×t,
wherein f represents the operating frequency, v represents the operating voltage, p represents the process angle, t represents the temperature, a 0 To a 8 Is a parameter of the fit.
In one possible implementation, after the determining the target operating voltage of the GPU, the method further includes:
and determining a preset voltage closest to the target working voltage in a plurality of preset voltages as a control voltage so as to adjust the working voltage of the GPU based on the control voltage.
In one possible implementation, after the determining the target operating frequency of the GPU, the method further includes:
and determining a preset frequency closest to the target working frequency in a plurality of preset frequencies as a control frequency, so as to adjust the working frequency of the GPU based on the control frequency.
According to an aspect of the present disclosure, there is provided a power consumption control apparatus for a GPU, including:
the obtaining module is used for obtaining the current power consumption of the GPU;
the acquisition module is used for acquiring the target power consumption of the GPU and the static power consumption of the GPU;
The first determining module is used for determining the target working voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption;
and the second determining module is used for determining the target working frequency of the GPU according to the target working voltage and the corresponding relation between the preset working frequency and the working voltage.
In one possible implementation manner, the first determining module is configured to:
and in response to the GPU being in a power consumption control state, determining a target working voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption.
In one possible implementation, the apparatus further includes:
the judging module is used for judging whether the GPU is in the power consumption control state or not according to the current power consumption, preset control power consumption and preset exit power consumption, wherein the preset control power consumption is higher than the preset exit power consumption.
In one possible implementation manner, the judging module is configured to:
and in response to the GPU being in the power consumption control state, and the continuous times that the power consumption of the GPU is smaller than the preset exit power consumption not reaching the preset times, determining that the GPU is continuously in the power consumption control state, wherein the preset times are larger than 1.
In one possible implementation manner, the judging module is configured to:
and responding to the GPU in the power consumption control state, wherein the current power consumption is smaller than the preset exit power consumption, and the continuous times of which the power consumption of the GPU is smaller than the preset exit power consumption reach the preset times, and determining that the GPU exits from the power consumption control state.
In one possible implementation manner, the judging module is configured to:
determining that the GPU enters the power consumption control state in response to the fact that the GPU is not in the power consumption control state and the current power consumption is larger than or equal to preset control power consumption;
or,
and determining that the GPU is not in the power consumption control state in response to the GPU is not in the power consumption control state and the current power consumption is smaller than the preset control power consumption.
In one possible implementation manner, the first determining module is configured to:
determining a current scaling factor according to the current power consumption, the target power consumption and the static power consumption;
and determining the target working voltage of the GPU according to the current proportion coefficient and the corresponding relation between the proportion coefficient and the working voltage.
In one possible implementation manner, the first determining module is configured to:
Determining a first difference between the target power consumption and the static power consumption;
determining a second difference between the current power consumption and the static power consumption;
a current scaling factor between the first difference and the second difference is determined.
In one possible implementation, the correspondence between the scaling factor and the operating voltage is v=c 0 +c 1 ×a+c 2 ×a 2 Wherein v represents the operating voltage, a represents the scaling factor, c 0 、c 1 And c 2 Is a parameter of fitting, and c 0 、c 1 And c 2 Fitting based on historical data.
In one possible implementation manner, the obtaining module is configured to:
acquiring sampling power consumption of the GPU;
and filtering the sampling power consumption to obtain the current power consumption of the GPU.
In one possible implementation manner, the corresponding relationship between the preset working frequency and the working voltage is:
f=a 0 ×p 2 +a 1 ×v 2 +a 2 ×t 2 +a 3 ×p×v+a 4 ×p×t+a 5 ×v×t+a 6 ×p+a 7 ×v+a 8 ×t,
wherein f represents the operating frequency, v represents the operating voltage, p represents the process angle, t represents the temperature, a 0 To a 8 Is a parameter of the fit.
In one possible implementation, the apparatus further includes:
and the third determining module is used for determining a preset voltage closest to the target working voltage in a plurality of preset voltages as a control voltage so as to adjust the working voltage of the GPU based on the control voltage.
In one possible implementation, the apparatus further includes:
and a fourth determining module, configured to determine, as a control frequency, a preset frequency closest to the target operating frequency among a plurality of preset frequencies, so as to adjust the operating frequency of the GPU based on the control frequency.
According to an aspect of the present disclosure, there is provided an electronic apparatus including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the executable instructions stored by the memory to perform the above-described method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
According to an aspect of the present disclosure, there is provided a computer program product comprising a computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in an electronic device, a processor in the electronic device performs the above method.
In the embodiment of the disclosure, the current power consumption of the GPU is obtained, the target power consumption of the GPU and the static power consumption of the GPU are obtained, the target working voltage of the GPU is determined according to the current power consumption, the target power consumption and the static power consumption, and the target working frequency of the GPU is determined according to the target working voltage and the corresponding relation between the preset working frequency and the working voltage, so that the power consumption of the GPU can be controlled to the target power consumption through a single step, namely, the power consumption of the GPU can be controlled rapidly without multi-step control, damage of the excessive power consumption to a chip can be reduced, and the safety and performance of the GPU can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the technical aspects of the disclosure.
Fig. 1 shows a flowchart of a power consumption control method of a GPU provided by an embodiment of the present disclosure.
Fig. 2 shows a block diagram of a power consumption control apparatus for a GPU provided by an embodiment of the present disclosure.
Fig. 3 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the disclosure will be described in detail below with reference to the drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order not to obscure the present disclosure.
In the related art, the power consumption of the GPU is controlled through a scheme of multi-step control. That is, in the related art, a plurality of adjustments are required to control the power consumption of the GPU to a control target that needs to be achieved. In this way, the power consumption of the GPU is reduced at a slower rate, resulting in the risk of damaging the chip and degrading performance.
The embodiment of the disclosure provides a power consumption control method for a GPU, which is characterized in that a current power consumption of the GPU is obtained, a target power consumption of the GPU and a static power consumption of the GPU are obtained, a target working voltage of the GPU is determined according to the current power consumption, the target power consumption and the static power consumption, and a target working frequency of the GPU is determined according to the target working voltage and a corresponding relation between a preset working frequency and the working voltage, so that the power consumption of the GPU can be controlled to the target power consumption through a single step, namely, the power consumption of the GPU can be controlled rapidly without multi-step control, thereby reducing damage of the excessive power consumption to a chip, and further improving the safety and performance of the GPU.
The power consumption control method for the GPU provided by the embodiments of the present disclosure is described in detail below with reference to the accompanying drawings.
Fig. 1 shows a flowchart of a power consumption control method for a GPU provided by an embodiment of the present disclosure. In one possible implementation manner, the execution subject of the power consumption control method for the GPU (Graphics Processing Unit, graphics processor) may be a power consumption control device for the GPU, for example, the power consumption control method for the GPU may be executed by a terminal device or a server or other electronic device. The terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle mounted device, a wearable device, or the like. In some possible implementations, the method for controlling power consumption of the GPU may be implemented by a processor invoking computer readable instructions stored in a memory. As shown in fig. 1, the power consumption control method for the GPU includes steps S11 to S14.
In step S11, the current power consumption of the GPU is obtained.
In step S12, the target power consumption of the GPU and the static power consumption of the GPU are obtained.
In step S13, a target operating voltage of the GPU is determined according to the current power consumption, the target power consumption, and the static power consumption.
In step S14, the target operating frequency of the GPU is determined according to the target operating voltage and the preset correspondence between the operating frequency and the operating voltage.
In the embodiment of the disclosure, the power consumption of the GPU is controlled based on the current power consumption of the GPU.
In one possible implementation manner, the obtaining the current power consumption of the GPU includes: acquiring sampling power consumption of the GPU; and filtering the sampling power consumption to obtain the current power consumption of the GPU.
In this implementation, the sampled power consumption of the GPU may represent the power consumption of the GPU read by the power harvesting device. The power consumption collecting device may be a peripheral power consumption collecting device. For example, the power consumption collection device may be the INA3221 or the like, and is not limited herein. In this implementation, the sampled power consumption of the GPU may be obtained from the power consumption acquisition device. For example, the sampled power consumption of the GPU may be obtained from the power consumption acquisition device at a preset frequency.
As an example of this implementation, the power consumption acquisition device may interact with a preset communication protocol to acquire the power consumption of the GPU. For example, the preset communication protocol may be an I2C (Inter-Integrated Circuit, integrated circuit) communication protocol, etc., which is not limited herein.
As an example of this implementation, the method further comprises: and initializing the power consumption acquisition device in response to the starting of the GPU.
In the implementation manner, filtering modes such as average filtering and the like can be adopted to filter the sampling power consumption of the GPU, so that the current power consumption of the GPU is obtained.
In the implementation manner, the current power consumption of the GPU is obtained by acquiring the sampling power consumption of the GPU and filtering the sampling power consumption, so that the power consumption of the GPU can be controlled based on the more stable current power consumption, the stability of the power consumption control of the GPU is improved, and the stability of the performance of the GPU is improved.
In another possible implementation manner, the obtaining the current power consumption of the GPU includes: and acquiring the sampling power consumption of the GPU as the current power consumption of the GPU. In this implementation, the latest sampled power consumption output by the power consumption acquisition device may be directly used as the current power consumption of the GPU, without filtering.
In one possible implementation, the current power consumption of the GPU may be obtained based on a timing duration or a preset frequency, and the power consumption of the GPU may be controlled based on the current power consumption of the GPU. In this implementation, by obtaining the current power consumption of the GPU based on the timing duration or the preset frequency, more reliable and efficient power consumption control of the GPU can be achieved.
In the embodiments of the present disclosure, the target power consumption of the GPU may represent a target value of the power consumption of the GPU, i.e., the power consumption that the GPU is expected to achieve. Under the target power consumption, the GPU can achieve higher performance and is safe in chip.
The power consumption of the GPU may represent the total power consumption of the GPU, which may include the dynamic power consumption of the GPU and the static power consumption of the GPU. For example, the total power consumption P of the GPU total =P dynamic +P static . Wherein P is dynamic Representing dynamic power consumption of GPU, P static Representing the static power consumption of the GPU. The static power consumption of the GPU may be a fixed value, and may be measured by an oscilloscope or may be obtained by other means.
At the process node before 40nm, the dynamic power consumption of the GPU is a large percentage of the total power consumption. With the evolution of the process, the static power consumption gradually increases in the ratio of the total power consumption to the extent comparable to the dynamic power consumption at 7nm, which further increases the difficulty of implementing DVFS (Dynamic Voltage and Frequency Scaling, dynamic voltage frequency adjustment).
In one example, dynamic power consumption P dynamic =α×C×v 2 X f. Wherein alpha is the turnover rate, C is the load capacitance, v is the working voltage, and f is the working frequency. Therefore, by reducing the operating voltage and operating frequency, the purpose of reducing power consumption can be achieved.
In one possible implementation manner, the determining the target operating voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption includes: determining a current scaling factor according to the current power consumption, the target power consumption and the static power consumption; and determining the target working voltage of the GPU according to the current proportion coefficient and the corresponding relation between the proportion coefficient and the working voltage.
In this implementation, the current scaling factor may be determined according to the current power consumption of the GPU, the target power consumption of the GPU, and the static power consumption of the GPU, where the current scaling factor is used to determine the target operating voltage of the GPU.
The current proportion coefficient is determined according to the current power consumption, the target power consumption and the static power consumption, and the target working voltage of the GPU is determined according to the current proportion coefficient and the corresponding relation between the proportion coefficient and the working voltage, so that the working voltage of the GPU is adjusted based on the current proportion coefficient, and the power consumption of the GPU can be effectively controlled.
As an example of this implementation, said determining the current scaling factor from said current power consumption, said target power consumption and said static power consumption comprises: determining a first difference between the target power consumption and the static power consumption; determining a second difference between the current power consumption and the static power consumption; a current scaling factor between the first difference and the second difference is determined.
In this example, the first difference may represent a difference between the target power consumption and the static power consumption, and the second difference may represent a difference between the current power consumption and the static power consumption. In this example, a ratio of the first difference to the second difference may be determined as the current scaling factor. For example, a= (P) set -P static )/(P current -P static ) The current scaling factor a is determined. Wherein P is set Representing target power consumption, P static Representing static power consumption, P current Representing the current power consumption.
In this example, by determining a first difference between the target power consumption and the static power consumption, determining a second difference between the current power consumption and the static power consumption, and determining a current scaling factor between the first difference and the second difference, the current scaling factor can be reasonably determined. And determining the target working voltage of the GPU based on the determined current scaling factor, thereby being beneficial to improving the safety and performance of the GPU.
As an example of this implementation, said determining the current scaling factor from said current power consumption, said target power consumption and said static power consumption comprises: determining a first difference between the target power consumption and the static power consumption; determining a second difference between the current power consumption and the static power consumption; a current scaling factor between the second difference and the first difference is determined.
In this example, the first difference may represent a difference between the target power consumption and the static power consumption, and the second difference may represent a difference between the current power consumption and the static power consumption. In this implementation, the ratio of the second difference to the first difference may be determined as the current scaling factor. For example, a= (P) current -P static )/(P set -P static ) The current scaling factor a is determined. Wherein P is set Representation ofTarget power consumption, P static Representing static power consumption, P current Representing the current power consumption.
As an example of this implementation, the correspondence between the scaling factor and the operating voltage is v=c 0 +c 1 ×a+c 2 ×a 2 Wherein v represents the operating voltage, a represents the scaling factor, c 0 、c 1 And c 2 Is a parameter of fitting, and c 0 、c 1 And c 2 Fitting based on historical data. In this example, v=c can be used as follows 0 +c 1 ×a+c 2 ×a 2 The target operating voltage v is determined.
In one possible implementation manner, the determining the target operating voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption includes: and in response to the GPU being in a power consumption control state, determining a target working voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption.
In this implementation, the power consumption control state may represent a state in which the power consumption of the GPU needs to be reduced.
In this implementation manner, the target operating voltage of the GPU is determined according to the current power consumption, the target power consumption and the static power consumption in response to the GPU being in the power consumption control state, so that the power consumption of the GPU can be reduced by reducing the operating voltage of the GPU when the GPU is in the power consumption control state, and the power consumption of the GPU can be controlled when the GPU is not in the power consumption control state, so that unnecessary power consumption control can be reduced, and the efficiency of controlling the power consumption of the GPU can be improved.
As an example of this implementation, the method further comprises: judging whether the GPU is in the power consumption control state or not according to the current power consumption, preset control power consumption and preset exit power consumption, wherein the preset control power consumption is higher than the preset exit power consumption.
The preset control power consumption may represent a preset power consumption value for controlling the GPU to enter a power consumption control state, and the preset exit power consumption may represent a preset power consumption value for controlling the GPU to exit the power consumption control state.
In this example, by determining whether the GPU is in the power consumption control state according to the current power consumption, a preset control power consumption, and a preset exit power consumption, the preset control power consumption is higher than the preset exit power consumption, thereby enabling effective power consumption control of the GPU.
In one example, the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption, and the preset exit power consumption includes: and in response to the GPU being in the power consumption control state, and the continuous times that the power consumption of the GPU is smaller than the preset exit power consumption not reaching the preset times, determining that the GPU is continuously in the power consumption control state, wherein the preset times are larger than 1.
In this example, if the GPU is in the power consumption control state before the current power consumption of the GPU is acquired this time and the current power consumption of the GPU is greater than or equal to the preset exit power consumption, it may be determined that the number of consecutive times that the power consumption of the GPU is less than the preset exit power consumption is 0, and the preset number of times is not reached, so that it may be determined that the GPU continues to be in the power consumption control state.
If the GPU is in the power consumption control state before the current power consumption of the GPU is obtained this time and the current power consumption of the GPU is less than the preset exit power consumption, it can be further determined whether the continuous times of the power consumption of the GPU less than the preset exit power consumption reaches the preset times. If the power consumption of the GPU is less than the preset number of times of exiting power consumption, the GPU may be determined to be in the power consumption control state continuously.
In this example, the power consumption of the GPU can be stably controlled at the target power consumption by setting the delay of the preset times to exit the power consumption control state, so that more power consumption scenes can be compatible, and the performance loss in the power consumption control can be effectively reduced.
In one example, the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption, and the preset exit power consumption includes: and responding to the GPU in the power consumption control state, wherein the current power consumption is smaller than the preset exit power consumption, and the continuous times of which the power consumption of the GPU is smaller than the preset exit power consumption reach the preset times, and determining that the GPU exits from the power consumption control state.
If the GPU is in the power consumption control state before the current power consumption of the GPU is obtained this time and the current power consumption of the GPU is less than the preset exit power consumption, it can be further determined whether the continuous times of the power consumption of the GPU less than the preset exit power consumption reaches the preset times. If the power consumption of the GPU is smaller than the preset continuous times of the exiting power consumption and reaches the preset times, the GPU exiting power consumption control state can be determined.
In this example, the power consumption of the GPU can be stably controlled at the target power consumption by setting the delay of the preset times to exit the power consumption control state, so that more power consumption scenes can be compatible, and the performance loss in the power consumption control can be effectively reduced.
In one example, the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption, and the preset exit power consumption includes: determining that the GPU enters the power consumption control state in response to the fact that the GPU is not in the power consumption control state and the current power consumption is larger than or equal to preset control power consumption; or, in response to the GPU not being in the power consumption control state and the current power consumption being less than the preset control power consumption, determining that the GPU is not in the power consumption control state.
If the GPU is not in the power consumption control state before the current power consumption of the GPU is acquired, and the current power consumption of the GPU is greater than or equal to the preset control power consumption, the GPU can be determined to enter the power consumption control state.
If the GPU is not in the power consumption control state before the current power consumption of the GPU is acquired, and the current power consumption of the GPU is smaller than the preset control power consumption, the GPU can be determined not to enter the power consumption control state.
In this example, the power consumption of the GPU can be stably controlled at the target power consumption by setting the delay of the preset times to exit the power consumption control state, so that more power consumption scenes can be compatible, and the performance loss in the power consumption control can be effectively reduced.
In another example, the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption, and the preset exit power consumption includes: determining that the GPU exits the power consumption control state in response to the GPU being in the power consumption control state and the current power consumption of the GPU being smaller than a preset exit power consumption; or, in response to the GPU being in the power consumption control state, the current power consumption is greater than or equal to the preset exit power consumption, determining that the GPU is continuously in the power consumption control state; or, in response to the GPU not being in the power consumption control state and the current power consumption being greater than or equal to a preset control power consumption, determining that the GPU enters the power consumption control state; or, in response to the GPU not being in the power consumption control state and the current power consumption being less than the preset control power consumption, determining that the GPU is not in the power consumption control state.
As another example of this implementation, the method further includes: and judging whether the GPU is in the power consumption control state according to the current power consumption and the preset control power consumption.
In one example, the determining whether the GPU is in the power consumption control state according to the current power consumption and the preset control power consumption includes: in response to the GPU being in the power consumption control state, and the continuous times of the power consumption of the GPU being smaller than the preset control power consumption not reaching the preset times, determining that the GPU is continuously in the power consumption control state, wherein the preset times are larger than 1; or, in response to the GPU being in the power consumption control state, determining that the GPU exits the power consumption control state by the continuous times when the current power consumption is less than the preset control power consumption and the power consumption of the GPU is less than the preset control power consumption reaching the preset times; or, in response to the GPU not being in the power consumption control state and the current power consumption being greater than or equal to a preset control power consumption, determining that the GPU enters the power consumption control state; or, in response to the GPU not being in the power consumption control state and the current power consumption being less than the preset control power consumption, determining that the GPU is not in the power consumption control state.
In another example, the determining whether the GPU is in the power consumption control state according to the current power consumption and the preset control power consumption includes: responding to the GPU in the power consumption control state, wherein the current power consumption of the GPU is larger than or equal to the preset control power consumption, and determining that the GPU is continuously in the power consumption control state; determining that the GPU exits the power consumption control state in response to the GPU being in the power consumption control state and the current power consumption of the GPU being smaller than the preset control power consumption; determining that the GPU enters the power consumption control state in response to the fact that the GPU is not in the power consumption control state and the current power consumption is larger than or equal to preset control power consumption; and determining that the GPU is not in the power consumption control state in response to the GPU is not in the power consumption control state and the current power consumption is smaller than the preset control power consumption.
In another possible implementation manner, the target operating voltage of the GPU may be determined directly according to the current power consumption, the target power consumption and the static power consumption, regardless of whether the GPU is in the power consumption control state.
In one possible implementation manner, the corresponding relationship between the preset working frequency and the working voltage is: f=a 0 ×p 2 +a 1 ×v 2 +a 2 ×t 2 +a 3 ×p×v+a 4 ×p×t+a 5 ×v×t+a 6 ×p+a 7 ×v+a 8 X t, wherein f represents the operating frequency, v represents the operating voltage, p represents the process angle, t represents the temperature, a 0 To a 8 Is a parameter of the fit. In one example, p may be read from an eFuse partition and t may be obtained from a PVT sensor in a system management controller (System Management Controller, SMC). In one example, a 0 To a 8 The maximum working voltage and the maximum working frequency which can be achieved by different chips can be measured by a chip verifier and fitted.
Of course, the corresponding relationship between the operating frequency and the operating voltage may vary according to the actual application scenario, and is not limited herein.
In one possible implementation, after the determining the target operating voltage of the GPU, the method further includes: and determining a preset voltage closest to the target working voltage in a plurality of preset voltages as a control voltage so as to adjust the working voltage of the GPU based on the control voltage.
Taking a PWM (Pulse Width Modulation ) controller supporting 8-bit output as an example, there are 256 kinds of voltages that can be output, and thus, there can be 256 preset voltages. The preset voltage closest to the target operating voltage among the 256 preset voltages may be determined as a control voltage, and the operating voltage of the GPU may be adjusted to the control voltage by the PWM controller.
In this implementation manner, the preset voltage closest to the target operating voltage among the plurality of preset voltages is determined as the control voltage, so that the operating voltage of the GPU is adjusted based on the control voltage, thereby enabling more accurate operating voltage control.
In one possible implementation, after the determining the target operating frequency of the GPU, the method further includes: and determining a preset frequency closest to the target working frequency in a plurality of preset frequencies as a control frequency, so as to adjust the working frequency of the GPU based on the control frequency.
For example, there are 256 preset frequencies, and a preset frequency closest to the target operating frequency among the 256 preset frequencies may be determined as the control frequency.
In this implementation, the preset frequency closest to the target operating frequency among the plurality of preset frequencies is determined as the control frequency, so that the operating frequency of the GPU is adjusted based on the control frequency, thereby enabling more accurate operating frequency control.
In one possible implementation, the method further includes: and closing external power supply of the GPU in response to the temperature of the GPU being greater than or equal to a preset maximum operating temperature.
In this implementation, the preset maximum operating temperature may be obtained by testing a temperature threshold at which the GPU is powered off.
In the implementation manner, the external power supply of the GPU is turned off in response to the fact that the temperature of the GPU is greater than or equal to the preset highest running temperature, so that the shutdown of the display card is controlled, and therefore the safety of the GPU can be improved.
As an example of this implementation, the method further comprises: and in response to the temperature of the GPU being greater than or equal to a preset maximum operating temperature, illuminating a preset LED (Light Emitting Diode ) lamp.
In this example, by turning on a preset LED lamp as an indication of the GPU being turned off too high in temperature in response to the temperature of the GPU being greater than or equal to a preset maximum operating temperature, the user can be alerted in time.
The power consumption control method of the GPU provided by the embodiments of the present disclosure is described below through a specific application scenario.
In the application scene, the current power consumption of the GPU can be read through a peripheral power consumption acquisition device, and the current power consumption of the GPU is acquired from the power consumption acquisition device. The preset control power consumption and the preset exit power consumption can be obtained, and whether the GPU is in the power consumption control state or not can be judged according to the current power consumption, the preset control power consumption and the preset exit power consumption, wherein the preset control power consumption is higher than the preset exit power consumption. Wherein, the GPU may be determined to continue to be in the power consumption control state in response to the GPU being in the power consumption control state, and the continuous number of times that the power consumption of the GPU is less than the preset exit power consumption not reaching the preset number of times, wherein the preset number of times is greater than 1; determining that the GPU exits the power consumption control state in response to the GPU being in the power consumption control state, the current power consumption being less than the preset exit power consumption, and the number of consecutive times that the power consumption of the GPU is less than the preset exit power consumption reaching the preset number of times; determining that the GPU enters the power consumption control state according to the fact that the GPU is not in the power consumption control state and the current power consumption is larger than or equal to preset control power consumption; and determining that the GPU is not in the power consumption control state in response to the GPU is not in the power consumption control state and the current power consumption is smaller than the preset control power consumption.
The target power consumption of the GPU, the static power consumption of the GPU and the current operating frequency of the GPU may be obtained in response to the GPU being in a power consumption control state, and the current scaling factor may be determined according to the current power consumption, the target power consumption and the static power consumption. For example, a= (P) set -P static )/(P current -P static ) The current scaling factor a is determined. Wherein P is set Representing target power consumption, P static Representing static power consumption, P current Representing the current power consumption.
Can be according to v=c 0 +c 1 ×a+c 2 ×a 2 The target operating voltage v is determined. Wherein a represents the current scaling factor, c 0 、c 1 And c 2 Is a parameter of the fit. c 0 、c 1 And c 2 Fitting may be performed based on historical data. Can be based on the target operating voltage and the preset correspondence f=a between the operating frequency and the operating voltage 0 ×p 2 +a 1 ×v 2 +a 2 ×t 2 +a 3 ×p×v+a 4 ×p×t+a 5 ×v×t+a 6 ×p+a 7 ×v+a 8 And x t, determining the target working frequency of the GPU. Wherein f represents the operating frequency, v represents the operating voltage, p represents the process angle, t represents the temperature, a 0 To a 8 Is a fitting parameter. The preset voltage closest to the target operating voltage among 256 preset voltages may be determined as a control voltage to adjust the operating voltage of the GPU based on the control voltage. The preset frequency closest to the target operating frequency among 256 preset frequencies may be determined as a control frequency to adjust the operating frequency of the GPU based on the control frequency.
According to the formula, the target working voltage is determined, so that the accuracy requirement can be met, and the system management controller can be conveniently and rapidly calculated.
The power consumption control method of the GPU provided by the embodiment of the present disclosure does not need an analytical formula of a complex formula, and compared with PID (Proportional-Integral-Differential) control systems, the power consumption control method of the GPU can control the power consumption of the GPU more rapidly, adapt to different scenes, and improve the performance of the GPU.
It will be appreciated that the above-mentioned method embodiments of the present disclosure may be combined with each other to form a combined embodiment without departing from the principle logic, and are limited to the description of the present disclosure. It will be appreciated by those skilled in the art that in the above-described methods of the embodiments, the particular order of execution of the steps should be determined by their function and possible inherent logic.
In addition, the disclosure further provides a power consumption control device, an electronic device, a computer readable storage medium and a computer program product for the GPU, which can be used to implement any of the power consumption control methods for the GPU provided in the disclosure, and the corresponding technical schemes and technical effects can be referred to the corresponding records of the method parts and are not repeated.
Fig. 2 shows a block diagram of a power consumption control apparatus for a GPU provided by an embodiment of the present disclosure. As shown in fig. 2, the power consumption control apparatus for a GPU includes:
an obtaining module 21, configured to obtain a current power consumption of the GPU;
an obtaining module 22, configured to obtain a target power consumption of the GPU and a static power consumption of the GPU;
a first determining module 23, configured to determine a target operating voltage of the GPU according to the current power consumption, the target power consumption, and the static power consumption;
and the second determining module 24 is configured to determine the target operating frequency of the GPU according to the target operating voltage and the preset correspondence between the operating frequency and the operating voltage.
In one possible implementation, the first determining module 23 is configured to:
and in response to the GPU being in a power consumption control state, determining a target working voltage of the GPU according to the current power consumption, the target power consumption and the static power consumption.
In one possible implementation, the apparatus further includes:
the judging module is used for judging whether the GPU is in the power consumption control state or not according to the current power consumption, preset control power consumption and preset exit power consumption, wherein the preset control power consumption is higher than the preset exit power consumption.
In one possible implementation manner, the judging module is configured to:
and in response to the GPU being in the power consumption control state, and the continuous times that the power consumption of the GPU is smaller than the preset exit power consumption not reaching the preset times, determining that the GPU is continuously in the power consumption control state, wherein the preset times are larger than 1.
In one possible implementation manner, the judging module is configured to:
and responding to the GPU in the power consumption control state, wherein the current power consumption is smaller than the preset exit power consumption, and the continuous times of which the power consumption of the GPU is smaller than the preset exit power consumption reach the preset times, and determining that the GPU exits from the power consumption control state.
In one possible implementation manner, the judging module is configured to:
determining that the GPU enters the power consumption control state in response to the fact that the GPU is not in the power consumption control state and the current power consumption is larger than or equal to preset control power consumption;
or,
and determining that the GPU is not in the power consumption control state in response to the GPU is not in the power consumption control state and the current power consumption is smaller than the preset control power consumption.
In one possible implementation, the first determining module 23 is configured to:
Determining a current scaling factor according to the current power consumption, the target power consumption and the static power consumption;
and determining the target working voltage of the GPU according to the current proportion coefficient and the corresponding relation between the proportion coefficient and the working voltage.
In one possible implementation, the first determining module 23 is configured to:
determining a first difference between the target power consumption and the static power consumption;
determining a second difference between the current power consumption and the static power consumption;
a current scaling factor between the first difference and the second difference is determined.
In one possible implementation, the correspondence between the scaling factor and the operating voltage is v=c 0 +c 1 ×a+c 2 ×a 2 Wherein v represents the operating voltage, a represents the scaling factor, c 0 、c 1 And c 2 Is a parameter of fitting, and c 0 、c 1 And c 2 Fitting based on historical data.
In one possible implementation, the obtaining module 21 is configured to:
acquiring sampling power consumption of the GPU;
and filtering the sampling power consumption to obtain the current power consumption of the GPU.
In one possible implementation manner, the corresponding relationship between the preset working frequency and the working voltage is:
f=a 0 ×p 2 +a 1 ×v 2 +a 2 ×t 2 +a 3 ×p×v+a 4 ×p×t+a 5 ×v×t+a 6 ×p+a 7 ×v+a 8 ×t,
wherein f represents the operating frequency, v represents the operating voltage, p represents the process angle, t represents the temperature, a 0 To a 8 Is a parameter of the fit.
In one possible implementation, the apparatus further includes:
and the third determining module is used for determining a preset voltage closest to the target working voltage in a plurality of preset voltages as a control voltage so as to adjust the working voltage of the GPU based on the control voltage.
In one possible implementation, the apparatus further includes:
and a fourth determining module, configured to determine, as a control frequency, a preset frequency closest to the target operating frequency among a plurality of preset frequencies, so as to adjust the operating frequency of the GPU based on the control frequency.
In the embodiment of the disclosure, the current power consumption of the GPU is obtained, the target power consumption of the GPU and the static power consumption of the GPU are obtained, the target working voltage of the GPU is determined according to the current power consumption, the target power consumption and the static power consumption, and the target working frequency of the GPU is determined according to the target working voltage and the corresponding relation between the preset working frequency and the working voltage, so that the power consumption of the GPU can be controlled to the target power consumption through a single step, namely, the power consumption of the GPU can be controlled rapidly without multi-step control, damage of the excessive power consumption to a chip can be reduced, and the safety and performance of the GPU can be improved.
In some embodiments, functions or modules included in an apparatus provided by the embodiments of the present disclosure may be used to perform a method described in the foregoing method embodiments, and specific implementation and technical effects of the functions or modules may refer to the descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
The disclosed embodiments also provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method. Wherein the computer readable storage medium may be a non-volatile computer readable storage medium or may be a volatile computer readable storage medium.
The disclosed embodiments also propose a computer program comprising computer readable code which, when run in an electronic device, causes a processor in the electronic device to carry out the above method.
Embodiments of the present disclosure also provide a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in an electronic device, causes a processor in the electronic device to perform the above method.
The embodiment of the disclosure also provides an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke the executable instructions stored by the memory to perform the above-described method.
The electronic device may be provided as a terminal, server or other form of device.
Fig. 3 shows a block diagram of an electronic device 1900 provided by an embodiment of the disclosure. For example, electronic device 1900 may be provided as a terminal or server. Referring to FIG. 3, electronic device 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform the methods described above.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output interface 1958 (I/O interface). Electronic device 1900 may operate an operating system based on memory 1932, such as the Microsoft Server operating system (Windows Server) TM ) Apple Inc. developed graphical user interface based operating System (Mac OS X TM ) Multi-user multi-process computer operating system (Unix) TM ) Unix-like operating system (Linux) of free and open source code TM ) Unix-like operating system (FreeBSD) with open source code TM ) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 1932, including computer program instructions executable by processing component 1922 of electronic device 1900 to perform the methods described above.
The present disclosure may be a system, method, and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present disclosure can be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be realized in particular by means of hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
The foregoing description of various embodiments is intended to highlight differences between the various embodiments, which may be the same or similar to each other by reference, and is not repeated herein for the sake of brevity.
If the technical scheme of the embodiment of the disclosure relates to personal information, the product applying the technical scheme of the embodiment of the disclosure clearly informs the personal information processing rule and obtains personal independent consent before processing the personal information. If the technical solution of the embodiment of the present disclosure relates to sensitive personal information, the product applying the technical solution of the embodiment of the present disclosure obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of "explicit consent". For example, a clear and remarkable mark is set at a personal information acquisition device such as a camera to inform that the personal information acquisition range is entered, personal information is acquired, and if the personal voluntarily enters the acquisition range, the personal information is considered as consent to be acquired; or on the device for processing the personal information, under the condition that obvious identification/information is utilized to inform the personal information processing rule, personal authorization is obtained by popup information or a person is requested to upload personal information and the like; the personal information processing rule may include information such as a personal information processor, a personal information processing purpose, a processing mode, and a type of personal information to be processed.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (14)

1. A power consumption control method for a GPU, comprising:
obtaining the current power consumption of the GPU;
acquiring target power consumption of the GPU and static power consumption of the GPU;
determining a first difference between the target power consumption and the static power consumption, wherein the first difference represents a difference between the target power consumption and the static power consumption;
determining a second difference between the current power consumption and the static power consumption, wherein the second difference represents a difference between the current power consumption and the static power consumption;
determining a current scaling factor between the first difference and the second difference, or determining a current scaling factor between the second difference and the first difference;
Determining a target working voltage of the GPU according to the current proportionality coefficient and the corresponding relation between the proportionality coefficient and the working voltage;
and determining the target working frequency of the GPU according to the target working voltage and the corresponding relation between the preset working frequency and the working voltage.
2. The method according to claim 1, wherein determining the target operating voltage of the GPU according to the current scaling factor and the correspondence between scaling factor and operating voltage comprises:
and in response to the GPU being in a power consumption control state, determining a target working voltage of the GPU according to the current proportionality coefficient and the corresponding relation between the proportionality coefficient and the working voltage.
3. The method according to claim 2, wherein the method further comprises:
judging whether the GPU is in the power consumption control state or not according to the current power consumption, preset control power consumption and preset exit power consumption, wherein the preset control power consumption is higher than the preset exit power consumption.
4. The method according to claim 3, wherein the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption, and the preset exit power consumption includes:
And in response to the GPU being in the power consumption control state, and the continuous times that the power consumption of the GPU is smaller than the preset exit power consumption not reaching the preset times, determining that the GPU is continuously in the power consumption control state, wherein the preset times are larger than 1.
5. The method according to claim 3, wherein the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption, and the preset exit power consumption includes:
and responding to the GPU in the power consumption control state, wherein the current power consumption is smaller than the preset exit power consumption, and the continuous times that the power consumption of the GPU is smaller than the preset exit power consumption reach the preset times, and determining that the GPU exits from the power consumption control state.
6. The method according to claim 3, wherein the determining whether the GPU is in the power consumption control state according to the current power consumption, the preset control power consumption, and the preset exit power consumption includes:
determining that the GPU enters the power consumption control state in response to the fact that the GPU is not in the power consumption control state and the current power consumption is larger than or equal to preset control power consumption;
Or,
and determining that the GPU is not in the power consumption control state in response to the GPU is not in the power consumption control state and the current power consumption is smaller than the preset control power consumption.
7. The method according to any one of claims 1 to 6, wherein the correspondence between the scaling factor and the operating voltage is v=c 0 +c 1 ×a+c 2 ×a 2 Wherein v represents the operating voltage, a represents the scaling factor, c 0 、c 1 And c 2 Is a parameter of fitting, and c 0 、c 1 And c 2 Fitting based on historical data.
8. The method according to any one of claims 1 to 6, wherein obtaining the current power consumption of the GPU comprises:
acquiring sampling power consumption of the GPU;
and filtering the sampling power consumption to obtain the current power consumption of the GPU.
9. The method according to any one of claims 1 to 6, wherein the correspondence between the preset operating frequency and the operating voltage is:
f=a 0 ×p 2 +a 1 ×v 2 +a 2 ×t 2 +a 3 ×p×v+a 4 ×p×t+a 5 ×v×t+a 6 ×p+a 7 ×v+a 8 ×t,
wherein f represents the operating frequency, v represents the operating voltage, p represents the process angle, t represents the temperature, a 0 To a 8 Is a parameter of the fit.
10. The method of claim 1, wherein after the determining the target operating voltage of the GPU, the method further comprises:
And determining a preset voltage closest to the target working voltage in a plurality of preset voltages as a control voltage so as to adjust the working voltage of the GPU based on the control voltage.
11. The method according to claim 1 or 10, wherein after said determining the target operating frequency of the GPU, the method further comprises:
and determining a preset frequency closest to the target working frequency in a plurality of preset frequencies as a control frequency, so as to adjust the working frequency of the GPU based on the control frequency.
12. A power consumption control apparatus for a GPU, comprising:
the obtaining module is used for obtaining the current power consumption of the GPU;
the acquisition module is used for acquiring the target power consumption of the GPU and the static power consumption of the GPU;
a first determining module configured to determine a first difference between the target power consumption and the static power consumption, where the first difference represents a difference between the target power consumption and the static power consumption; determining a second difference between the current power consumption and the static power consumption, wherein the second difference represents a difference between the current power consumption and the static power consumption; determining a current scaling factor between the first difference and the second difference, or determining a current scaling factor between the second difference and the first difference; determining a target working voltage of the GPU according to the current proportionality coefficient and the corresponding relation between the proportionality coefficient and the working voltage;
And the second determining module is used for determining the target working frequency of the GPU according to the target working voltage and the corresponding relation between the preset working frequency and the working voltage.
13. An electronic device, comprising:
one or more processors;
a memory for storing executable instructions;
wherein the one or more processors are configured to invoke the memory-stored executable instructions to perform the method of any of claims 1 to 11.
14. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1 to 11.
CN202310182002.6A 2023-02-21 2023-02-21 Power consumption control method and device for GPU, electronic equipment and storage medium Active CN116225202B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310182002.6A CN116225202B (en) 2023-02-21 2023-02-21 Power consumption control method and device for GPU, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310182002.6A CN116225202B (en) 2023-02-21 2023-02-21 Power consumption control method and device for GPU, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116225202A CN116225202A (en) 2023-06-06
CN116225202B true CN116225202B (en) 2024-01-23

Family

ID=86578249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310182002.6A Active CN116225202B (en) 2023-02-21 2023-02-21 Power consumption control method and device for GPU, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116225202B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427750A (en) * 2020-04-09 2020-07-17 中国人民解放军国防科技大学 GPU power consumption estimation method, system and medium for computer platform
CN111930216A (en) * 2020-07-27 2020-11-13 长沙景嘉微电子股份有限公司 GPU power consumption control method, device, processing system and storage medium
WO2021190343A1 (en) * 2020-03-26 2021-09-30 安徽寒武纪信息科技有限公司 Frequency regulation method and device for chip, and computer-readable storage medium
CN113988469A (en) * 2021-11-17 2022-01-28 海光信息技术股份有限公司 Method and device for predicting static power consumption of chip, electronic equipment and storage medium
CN114138098A (en) * 2022-02-07 2022-03-04 苏州浪潮智能科技有限公司 Power consumption adjusting method and device, storage device and readable storage medium
CN114879829A (en) * 2022-07-08 2022-08-09 摩尔线程智能科技(北京)有限责任公司 Power consumption management method and device, electronic equipment, graphic processor and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021190343A1 (en) * 2020-03-26 2021-09-30 安徽寒武纪信息科技有限公司 Frequency regulation method and device for chip, and computer-readable storage medium
CN111427750A (en) * 2020-04-09 2020-07-17 中国人民解放军国防科技大学 GPU power consumption estimation method, system and medium for computer platform
CN111930216A (en) * 2020-07-27 2020-11-13 长沙景嘉微电子股份有限公司 GPU power consumption control method, device, processing system and storage medium
CN113988469A (en) * 2021-11-17 2022-01-28 海光信息技术股份有限公司 Method and device for predicting static power consumption of chip, electronic equipment and storage medium
CN114138098A (en) * 2022-02-07 2022-03-04 苏州浪潮智能科技有限公司 Power consumption adjusting method and device, storage device and readable storage medium
CN114879829A (en) * 2022-07-08 2022-08-09 摩尔线程智能科技(北京)有限责任公司 Power consumption management method and device, electronic equipment, graphic processor and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
模型指导的多维GPU软件低功耗优化方法;王桂彬;;计算机学报(第05期);全文 *

Also Published As

Publication number Publication date
CN116225202A (en) 2023-06-06

Similar Documents

Publication Publication Date Title
KR102295182B1 (en) Dc-dc converting circuit and power management chip package
US20170222450A1 (en) Method and electronic device for supplying power to battery
US20150268708A1 (en) Power consumption control in computer system
US10387193B2 (en) Method for identifying application causing temperature rise of terminal, and terminal
CN115877938A (en) Control method, device, equipment, storage medium and program product of GPU
CN116225202B (en) Power consumption control method and device for GPU, electronic equipment and storage medium
CN116166114B (en) Power consumption control method and device for GPU, electronic equipment and storage medium
US11264864B2 (en) Flat-motor driving method and drive circuit, and electronic device
CN116643639A (en) Power consumption control method and device for GPU, electronic equipment and storage medium
CN114020121B (en) Method, device and equipment for controlling temperature of cloud mobile phone server
CN115494925A (en) Noise reduction method of air cooling server, noise processing equipment, circuit and computing equipment
CN116416115B (en) GPU control method, device, equipment, storage medium and program product
CN113839605B (en) Motor rotation speed control method and device
CN115857655B (en) Method, device, equipment, medium and program product for controlling power consumption of GPU
CN114911305A (en) Clock frequency control method, device, chip, electronic equipment and storage medium
CN116540820B (en) Voltage and frequency control system, method and storage medium
CN108321897B (en) Charging control method based on temperature balance, mobile terminal and storage medium
CN115963916A (en) Power consumption control method and device for GPU, electronic equipment and storage medium
KR20160001093A (en) Method for controlling switching regulator and electronic device
CN115840595A (en) Configuration method and device for chip, electronic equipment and storage medium
CN116321621B (en) Method, system, computer readable medium and electronic device for intelligent control of illumination
WO2024077698A1 (en) Parallel configuration method, apparatus and device, medium and program product
CN114944746A (en) Leakage compensation circuit and method
KR20170049195A (en) Method for scaling input/output bus frequency in electronic device
CN110474310B (en) Control method, first electronic device and second electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant