Power consumption control method, device, chip, equipment and medium for computing device
By evaluating the number of data request signals in the computing device to adjust the operating frequency, the problems of low computing performance and low power regulation efficiency in deep learning tasks are solved, and efficient power consumption management and performance optimization of deep learning chips are achieved. .
Patent Information
- Application Number
- CN202210555952.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-05-20
AI Technical Summary
Traditional CPUs, GPUs, DSPs and other general processing devices have low computing performance and low efficiency when processing deep learning tasks, and cannot effectively support the large-scale deployment of deep learning algorithms in data centers. The existing technology monitors and adjusts the power consumption of computing devices in chips. There are problems of latency and inefficiency.
By acquiring the number of data request signals of the computing device within a certain period, evaluating its power consumption level, and adjusting the operating frequency according to the preset threshold value, to achieve efficient power consumption adjustment.
The efficiency and real-time performance of the computing device's power consumption adjustment are improved, the impact of frequency switching on the performance of other modules is avoided, and the power consumption control of deep learning chips is optimized.
Smart Images

Figure CN114879832B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of chip technology and artificial intelligence, and specifically to a power consumption control method, device, electronic device, computer-readable storage medium and computer program product for a computing device. Background Art
[0002] With the development of artificial intelligence technology, more and more applications based on artificial intelligence technology have achieved results far exceeding traditional algorithms; deep learning is the core technology of artificial intelligence technology. Deep learning is a data-intensive algorithm and a computationally intensive algorithm, and it is also an algorithm that develops rapidly.
[0003] Traditional general-purpose processing devices such as CPU, GPU, DSP, etc. are designed for general computing tasks. When processing deep learning applications, they have disadvantages such as low computing performance and low efficiency, and cannot effectively support the large-scale deployment of deep learning algorithms in scenarios such as data centers. ASIC / FPGA-based deep learning dedicated acceleration devices have deeply customized hardware structures based on the computing characteristics of deep learning, and can achieve higher computing performance and computing efficiency compared to traditional CPU, GPU, DSP and other devices.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a power consumption control method, device, electronic device, computer-readable storage medium, and computer program product for a computing device.
[0006] According to one aspect of the present disclosure, there is provided a power consumption control method for a computing device, comprising: obtaining a first number of data request signals within a power consumption evaluation cycle, wherein the power consumption evaluation cycle includes a first preset number of consecutive multiple computing cycles, and the data request signal is used to request input data of the computing device; based on the first number, obtaining an average power consumption characterization value of the computing device within the power consumption evaluation cycle; based on the average power consumption characterization value and a preset power consumption threshold, obtaining a power consumption evaluation result within the power consumption evaluation cycle; and adjusting an operating frequency of the computing device based on the power consumption evaluation result.
[0007] According to another aspect of the present disclosure, a power consumption control device for a computing device is provided, comprising: a first acquisition unit, configured to acquire a first number of data request signals within a power consumption evaluation period, wherein the power consumption evaluation period comprises a first preset number of consecutive multiple computing periods, and the data request signal is used to request input data of the computing device; a second acquisition unit, configured to acquire an average power consumption characterization value of the computing device within the power consumption evaluation period based on the first number; a third acquisition unit, configured to acquire a power consumption evaluation result within the power consumption evaluation period based on the average power consumption characterization value and a preset power consumption threshold; and an adjustment unit, configured to adjust the operating frequency of the computing device based on the power consumption evaluation result.
[0008] According to another aspect of the present disclosure, a chip is provided, comprising the above-mentioned power consumption control device for a computing device.
[0009] According to another aspect of the present disclosure, an electronic device is provided, comprising the above chip.
[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned power consumption control method for a computing device.
[0011] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned power consumption control method for a computing device.
[0012] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned power consumption control method for a computing device when executed by a processor.
[0013] According to one or more embodiments of the present disclosure, by obtaining the number of data request signals within a certain period to evaluate the power consumption level of a computing device, and adjusting the device power consumption by adjusting the operating frequency of the computing device, the device power consumption can be efficiently evaluated through simple logical judgment, thereby improving the efficiency of power consumption regulation.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0016] Figure 1 A flowchart of a method for controlling power consumption of a computing device according to an embodiment of the present disclosure is shown;
[0017] Figure 2 A schematic diagram showing the structure of a chip provided with a power consumption control device according to an embodiment of the present disclosure is shown;
[0018] Figure 3 A structural block diagram of a vector computing device according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 4 A structural block diagram of a matrix multiplication device according to an exemplary embodiment of the present disclosure is shown;
[0020] Figure 5 A structural block diagram of a power consumption control device according to an embodiment of the present disclosure is shown;
[0021] Figure 6 A structural block diagram of a power consumption control device for a computing device according to an embodiment of the present disclosure is shown;
[0022] Figure 7 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0024] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0025] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0026] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0027] In deep learning algorithms, mainstream language models (such as BERT, ERNIE, etc.) contain a large number of operations such as matrix multiplication and vector calculation. Mainstream machine vision models (such as RESNET, MASK-RCNN, YOLO, SSD, etc.) also contain a large number of convolution operations, and convolution operations are usually converted into matrix operations. Therefore, deep learning chips usually provide dedicated matrix multiplication devices and vector calculation devices and other computing devices to accelerate deep learning algorithms.
[0028] While providing extremely high computing power for matrix multiplication and vector calculation, these computing devices also consume a lot of power. Under different scenarios and chip cooling conditions, relevant technicians often need to adjust the power consumption level of different computing devices according to actual conditions and computing needs, so as to avoid excessive power consumption of computing devices leading to device performance degradation.
[0029] In the related art, the power consumption monitoring and adjustment of the computing device in the chip is usually carried out through the power management chip of the board, which detects the current change of the entire chip and adjusts the frequency of the entire chip accordingly. This method usually requires the host to actively control the frequency switching of the chip, or to switch the frequency through the MCU inside the chip, which has a high delay; the frequency switching will affect all devices of the entire deep learning chip, while limiting the power consumption of computing devices such as matrix multiplication and transposition, it also limits the performance of other modules such as memory access and control.
[0030] An embodiment of the present disclosure provides a power consumption control method for a computing device. The method is based on the relationship between a data request signal of input data of the computing device and the power consumption of the device. The power consumption level of the computing device is evaluated by obtaining the number of data request signals within a certain period, and the power consumption of the device is adjusted by adjusting the operating frequency of the computing device. The power consumption of the device can be efficiently evaluated through simple logical judgment, thereby improving the efficiency of power consumption regulation.
[0031] According to the embodiments of the present disclosure, Figure 1As shown, a power consumption control method for a computing device is provided, which may include: step S101, obtaining a first number of data request signals within a power consumption evaluation cycle, wherein the power consumption evaluation cycle includes a first preset number of consecutive multiple computing cycles, and the data request signal is used to request input data of the computing device; step S102, based on the first number, obtaining an average power consumption characterization value of the computing device within the power consumption evaluation cycle; step S103, based on the average power consumption characterization value and a preset power consumption threshold, obtaining a power consumption evaluation result within the power consumption evaluation cycle; and step S104, based on the power consumption evaluation result, adjusting the operating frequency of the computing device.
[0032] Therefore, by obtaining the number of data request signals within a certain period to evaluate the power consumption level of the computing device, and adjusting the device power consumption by adjusting the operating frequency of the computing device, the device power consumption can be efficiently evaluated through simple logical judgment, thereby improving the efficiency of power consumption regulation.
[0033] Figure 2 A schematic structural diagram of a chip provided with a power consumption control device according to an embodiment of the present disclosure is shown.
[0034] In some embodiments, Figure 2 As shown, the instruction generation device 210 set in the chip sends the operation instruction to the instruction parsing device 220. The instruction parsing device 220 parses the operation instruction and generates at least one calculation enable signal corresponding to the operation cycle and a data request signal for requesting the calculation required for each operation cycle. In each operation cycle, the instruction parsing device 220 sends the calculation enable signal and the data request signal to the operation device 230 and the storage device 250 respectively. The storage device 250 sends the input data to the operation device 230 based on the data request signal to complete the calculation, and stores the output data output by the operation device 230.
[0035] In some embodiments, the power consumption control device 240 of the embodiment of the present disclosure may be connected to the instruction parsing device 220, so as to realize power consumption control of the computing device 230 corresponding to the instruction parsing device 220. Specifically, in each computing cycle, the instruction parsing device 220 will simultaneously send a data request signal to the power consumption control device 240, and the power consumption control device 240 obtains the power consumption level of the computing device 230 based on the number statistics of the signal.
[0036] In some embodiments, the power consumption control device 240 may collect statistics on the data request signal of each operation cycle within a first preset number of consecutive operation cycles (ie, power consumption evaluation cycles).
[0037] The length of the power consumption evaluation cycle can be adjusted by setting a first preset number, for example, the first preset number can be set to 8 operation cycles. It is understandable that relevant technicians can set the first preset number according to actual needs and conditions such as computing requirements and hardware heat dissipation conditions, and there is no limitation here.
[0038] In some embodiments, the computing device may include multiple computing sub-modules, and obtaining an average power consumption characterization value of the computing device during a power consumption evaluation period based on a first number may include: obtaining a second number of computing sub-modules in the computing device that are in a working state during the power consumption evaluation period based on the first number; and obtaining an average power consumption characterization value of the computing device during the power consumption evaluation period based on the second number.
[0039] Therefore, based on the number of data request signals, the number of computing submodules working in the computing device in the cycle can be obtained, and then the power consumption level of the computing device in the cycle can be characterized by the number of working computing submodules. Therefore, the power consumption level of the computing device can be efficiently obtained through simple logical operations, with higher real-time performance and less computing resource occupation.
[0040] A computing device usually includes multiple computing submodules, and in a computing cycle, if a computing submodule performs calculations, it must obtain one or more input data, and each input data is obtained through a different data request signal (that is, the number of input data is the same as the number of data request signals). Therefore, in a power consumption evaluation cycle, there is a certain correspondence between the first number of data request signals and the second number of computing submodules in working state. The average number of computing submodules in working state in the power consumption evaluation cycle (that is, the average power consumption characterization value) can characterize the average power consumption level of the computing device in the power consumption evaluation cycle.
[0041] Figure 3 A structural block diagram of a vector computing device according to an exemplary embodiment of the present disclosure is shown.
[0042] In an exemplary embodiment, the computing device may be, for example, Figure 3 The vector computing device 300 shown in FIG. 3 is generally used to process operations between vectors or operations between vectors and scalars. Figure 3 As shown, the vector computing device 300 includes K vector computing sub-modules, and within one operation cycle, each vector computing sub-module processes an operation between a pair of vectors or a vector and a scalar, that is, when a vector computing sub-module is working, two input data need to be input to the sub-module at the same time, and each input data corresponds to a data request signal.
[0043] It can be seen from this that there is a corresponding relationship between the number of data request signals and the number of vector calculation submodules in a working state, that is, the number of data request signals is twice the number of vector calculation submodules in a working state.
[0044] Therefore, by counting the first number of data request signals in the power consumption evaluation cycle, the second number of vector computing submodules in the working state in the power consumption evaluation cycle can be obtained through the corresponding relationship. Furthermore, by obtaining the average number of vector computing submodules in the working state per operation cycle (that is, the average power consumption characterization value), the power consumption level of the vector computing device in the power consumption evaluation cycle can be reflected.
[0045] Figure 4 A structural block diagram of a matrix multiplication device according to an exemplary embodiment of the present disclosure is shown.
[0046] In an exemplary embodiment, the computing device may be, for example, Figure 4 Matrix multiplication apparatus 300 is shown. Figure 4 The matrix multiplication device shown includes M×N matrix multiplication sub-modules, which can support matrix inner product operations of a matrix with M row vectors and a matrix with N column vectors in one operation cycle, wherein M and N are positive integers greater than 1.
[0047] When the matrix multiplication device is used to calculate a matrix A with m row vectors and a matrix B with n column vectors (where 1≤m≤M, 1≤n≤N), m×n matrix multiplication submodules are required to perform operations simultaneously.
[0048] When performing calculations, each matrix multiplication submodule needs to obtain input data A(i) and input data B(j) (i∈[0, m], j∈[0, n]) respectively. Each input data corresponds to a data request signal. When m×n matrix multiplication submodules are required to perform calculations at the same time, the number of data request signals is (m+n).
[0049] It can be seen that by counting the first number of data request signals in the power consumption evaluation cycle (the number of data request signals for request A(i) and the number of data request signals for request B(j)), and through the above correspondence, the second number of matrix multiplication submodules in working state in the power consumption evaluation cycle can be obtained. Furthermore, by obtaining the average number of matrix multiplication submodules in working state per operation cycle (that is, the average power consumption characterization value), the power consumption level of the matrix multiplication device in the power consumption evaluation cycle can be reflected.
[0050] Figure 5 A structural block diagram of a power consumption control device according to an embodiment of the present disclosure is shown.
[0051] In some embodiments, the power consumption control device 500 can first count the number of data request signals in each operation cycle through the statistical module 510, thereby obtaining the number of operation sub-modules in working state in the operation cycle based on a predetermined corresponding relationship (denoted as busy_cnt) and sending it to the register for storage.
[0052] In some embodiments, each busy_cnt within the first preset number of cycles may be stored in a register, then input into an adder for summing, and then input into a divider to obtain a corresponding average power consumption characterization value.
[0053] In some embodiments, preferably, the first preset number can be set to 2 n (n is a positive integer), thus we can Figure 5 The shift register 520 shown first performs an arithmetic right shift of n bits for each busy_cnt (equivalent to dividing by a first preset number), and then transmits each shifted busy_cnt to the adder 530 to calculate the sum, thereby obtaining an average power consumption characterization value (recorded as busy_cnt_avg). Thus, the division operation can be conveniently performed through the shift register, which improves the calculation efficiency and saves the calculation resources.
[0054] In some embodiments, adjusting the operating frequency of the computing device based on the power consumption evaluation result may include: adjusting the power consumption control signal value represented in binary based on the power consumption evaluation result, wherein the power consumption evaluation result indicates whether the power consumption of the computing device exceeds a preset power consumption threshold, and the power consumption control signal value includes a second preset number of multiple numerical bits; and controlling the operating frequency of the computing device in the next second preset number of multiple computing cycles after adjusting the power consumption control signal value based on the multiple numerical bits in the adjusted power consumption control signal value, wherein the second preset number is less than or equal to the first preset number, the multiple numerical bits include a first numerical bit whose value is a first value, and the number of the first numerical bits is used to indicate the number of computing cycles in which the computing device stops working in the next second preset number of multiple computing cycles.
[0055] Therefore, a binary power consumption control signal value is adjusted according to the power consumption evaluation result, and the operating frequency of the computing device is adjusted accordingly based on the signal value. The above operation can be realized through existing components (such as registers, comparators, etc.), with a simple structure and cost saving. At the same time, the above power consumption control logic is simple, which can further improve the efficiency and real-time performance of power consumption adjustment.
[0056] In some embodiments, Figure 5 As shown, the preset power consumption threshold can be stored in the first register 550, and supports relevant technicians to maintain it based on actual conditions, so its value is not limited here.
[0057] The power consumption evaluation result can be obtained by comparing the average power consumption characterization value (busy_cnt_avg) obtained from the adder 550 and the preset power consumption threshold obtained from the first register 550 through the comparator 540. After obtaining the power consumption evaluation result, the comparator 540 sends the power consumption evaluation result to the second register 560, and the second register 560 adjusts the power consumption control signal value stored in the second register 560 accordingly according to the power consumption evaluation result.
[0058] In some embodiments, the multiple numerical bits also include a second numerical bit whose numerical value is a second value. Based on the average power consumption characterization value and the preset power consumption threshold, obtaining the power consumption assessment result within the power consumption assessment period may include: in response to the average power consumption characterization value being greater than or equal to the preset power consumption threshold, determining that the power consumption assessment result is that the power consumption of the computing device is too high; and wherein, based on the power consumption assessment result, determining the power consumption control signal value represented in binary may include: in response to determining that the power consumption assessment result is that the power consumption of the computing device is too high, adjusting a second numerical bit in the power consumption control signal value to the first numerical bit.
[0059] In some embodiments, Figure 5 As shown, a power consumption control signal value having a second preset number of bits may be stored in the second register 560 in the power consumption control device 500. The power consumption control signal value has a first numerical bit whose value is the first value and a second numerical bit whose value is the second value. The number of the first numerical bits indicates the number of cycles in which the computing device stops working within the power consumption adjustment cycle (i.e., the next second preset number of computing cycles) after adjusting the power consumption control signal value.
[0060] The second preset number needs to be less than or equal to the first preset number, thereby avoiding the need to evaluate and adjust the power consumption again before the adjustment effect appears. It is understandable that the second preset number can be set by relevant technicians according to actual needs and is not limited here.
[0061] For example, the first value may be "1" and the second value may be "0"; or, the first value may be "0" and the second value may be "1".
[0062] In some embodiments, the power consumption control signal value stored in the second register 560 can be an 8-bit binary data (represented as stall_mask[7:0]), and its initial value is "0000 0000" (that is, each bit is the second value), and the second register 560 can be an 8-bit register.
[0063] When the comparator 540 determines through comparison that the average power consumption characterization value (busy_cnt_avg) is greater than or equal to the preset power consumption threshold, the result is correspondingly transmitted to the second register 560. Based on the result, the second register 560 adjusts the bit of the power consumption control signal value (stall_mask[7:0]) maintained by it, which is originally "0", to "1". For example, stall_mask[7:0] is adjusted from the initial value "0000 0000" to "0000 0001". The power consumption control signal value can indicate that the computing device stops working in one of the eight computing cycles after the adjustment; for another example, stall_mask[7:0] is adjusted from "00000011" to "0000 0111". The power consumption control signal value can indicate that the computing device stops working in three of the eight computing cycles after the adjustment.
[0064] In some embodiments, the multiple numerical bits also include a second numerical bit whose numerical value is a second value. Based on the average power consumption characterization value and the preset power consumption threshold, obtaining the power consumption assessment result within the power consumption assessment period may include: in response to the average power consumption characterization value being less than the preset power consumption threshold, determining that the power consumption assessment result is that the power consumption of the computing device is normal; and wherein, based on the power consumption assessment result, determining the power consumption control signal value represented in binary may include: in response to determining that the power consumption assessment result is that the power consumption of the computing device is normal and the power consumption control signal value includes the first numerical bit, adjusting a first numerical bit in the power consumption control signal value to a second numerical bit.
[0065] In some embodiments, when the comparator 540 determines that the average power consumption characterization value (busy_cnt_avg) is less than the preset power consumption threshold through comparison, the result is transmitted to the second register 560. Based on the result, the second register 560 can adjust the power consumption control signal value (stall_mask[7:0]) maintained by it accordingly.
[0066] When the original value in stall_mask[7:0] contains "1", the bit in stall_mask[7:0] whose original value is "1" can be adjusted to "0". For example, if stall_mask[7:0] is adjusted from the initial value "0000 0111" to "00000011", the power consumption control signal value can indicate that the computing device stops working in 2 computing cycles out of the 8 computing cycles after the adjustment (before the adjustment, the computing device stops working in 3 cycles out of every 8 cycles).
[0067] In some embodiments, based on the power consumption assessment result, determining the power consumption control signal value represented in binary may also include: in response to determining that the power consumption of the computing device is normal and each numerical bit in the power consumption control signal value is the second numerical bit, determining that each numerical bit in the power consumption control signal value is still the second numerical bit.
[0068] In some embodiments, when the power consumption evaluation result obtained from the comparator 540 is that the average power consumption characterization value (busy_cnt_avg) is less than the preset power consumption threshold, and the original value of the power consumption control signal value stall_mask[7:0] is the initial value "00000000", then the power consumption control signal value stall_mask[7:0] may not be adjusted and remains at "0000 0000" (that is, the computing device operates normally in each of the subsequent 8 computing cycles).
[0069] In some embodiments, based on multiple numerical bits in the adjusted power consumption control signal value, controlling the operating frequency of the computing device in the next second preset number of multiple computing cycles after adjusting the power consumption control signal value may include: generating an instruction issuance prevention signal based on a third number of second numerical bits in the adjusted power consumption control signal value; and sending the instruction issuance prevention signal to an instruction parsing device for sending computing instructions to the computing device, so as to prevent the instruction parsing device from stopping issuing computing instructions in the third number of computing cycles in the next second preset number of multiple computing cycles.
[0070] Therefore, based on the adjusted power consumption control signal value, an instruction issuance prevention signal is generated, thereby stopping the number of cycles for issuing instructions in the next power consumption adjustment cycle, thereby controlling the power consumption level of the computing device by adjusting the operating frequency of the computing device. While effectively controlling the power consumption level of the computing device, it does not affect the normal operation of other components in the chip (such as storage devices, control devices, etc.).
[0071] In some embodiments, Figure 5 As shown, after adjusting the power consumption control signal value in the second register 560, the second register 560 generates an instruction issuance prevention signal based on the adjusted power consumption control signal value, and sends it to the instruction parsing device (not shown in the figure).
[0072] In some embodiments, after receiving an instruction issuance prevention signal, the instruction parsing device can know that it is necessary to stop issuing instructions (that is, the above-mentioned computing enable signal and data request signal) within the next second preset number of computing cycles, thereby controlling the computing device to stop working within the cycle.
[0073] In some embodiments, after acquiring the above information, the instruction parsing device may randomly select a cycle to stop issuing instructions (the number is the same as the number of the first value in the power consumption control signal value).
[0074] In some embodiments, Figure 5 As shown, the second register 560 can also generate an instruction issuance prevention signal 502 based on the power consumption control signal value 501 stored therein. For example, if the power consumption control signal value 501 is "0000 1111", the corresponding instruction issuance prevention signal 502 generated is a corresponding window signal. After receiving the instruction issuance prevention signal 502, the instruction parsing device can stop issuing instructions based on the 4 operation cycles indicated by the window of the signal.
[0075] In some embodiments, the power consumption control method for a computing device of an embodiment of the present disclosure may further include: after the power consumption control signal value is adjusted, in response to a third preset number of computing cycles having passed, obtaining an average power consumption characterization value of the computing device within a most recent power consumption evaluation cycle to determine a power consumption evaluation result of the computing device within the most recent power consumption evaluation cycle, wherein the third preset number is greater than or equal to the first preset number; and re-determining the power consumption control signal value based on the power consumption evaluation result of the computing device within the most recent power consumption evaluation cycle.
[0076] Therefore, by setting an interval period (that is, a third preset number of operation periods), after a power consumption adjustment is performed once, the power consumption data is compared and the power consumption control signal value in the register is adjusted after the interval period, so that the frequency of the power consumption adjustment can be controlled based on the interval period, and the power consumption adjustment of the computing device can be made smoother.
[0077] In some embodiments, when a third preset number of operation cycles (i.e., interval cycles) is set, within the third preset number of operation cycles after the power consumption control signal value is adjusted once, the average power consumption characterization value is not compared with the preset power consumption threshold value, and the power consumption control signal value is not adjusted. In the interval cycle, the computing device operates according to the operating frequency after the adjustment.
[0078] In some embodiments, the third preset period may be greater than or equal to the first preset period, thereby preventing the average power consumption characterization value obtained from being the result of the last statistics when the next comparison is triggered, thereby affecting the power consumption evaluation result and power consumption adjustment effect of the comparison. It is understandable that the third preset number can be set by relevant technicians according to actual needs, for example, it can be an integer multiple of the first preset period, which is not limited here.
[0079] In some embodiments, Figure 6As shown, a power consumption control device 600 for a computing device is also provided, which may include: a first acquisition unit 610, configured to acquire a first number of data request signals within a power consumption evaluation period, wherein the power consumption evaluation period includes a first preset number of consecutive multiple computing periods, and the data request signal is used to request input data of the computing device; a second acquisition unit 620, configured to acquire an average power consumption characterization value of the computing device within the power consumption evaluation period based on the first number; a third acquisition unit 630, configured to acquire a power consumption evaluation result within the power consumption evaluation period based on the average power consumption characterization value and a preset power consumption threshold; and an adjustment unit 640, configured to adjust the operating frequency of the computing device based on the power consumption evaluation result.
[0080] The operations of the units 610 to 640 in the power consumption control device 600 are similar to the operations of steps S101 to S104 in the above-mentioned power consumption control method for a computing device, and are not described in detail here.
[0081] In some embodiments, the computing device may include multiple computing sub-modules, and the second acquisition unit may include: a first acquisition sub-unit, configured to acquire the second number of computing sub-modules in the computing device that are in a working state during a power consumption evaluation cycle based on the first number; and a second acquisition sub-unit, configured to acquire the average power consumption characterization value of the computing device during the power consumption evaluation cycle based on the second number.
[0082] In some embodiments, the adjustment unit may include: an adjustment subunit, configured to adjust a power consumption control signal value represented in binary based on a power consumption evaluation result, wherein the power consumption evaluation result indicates whether the power consumption of the computing device exceeds a preset power consumption threshold, and the power consumption control signal value includes a second preset number of multiple numerical bits; and a control subunit, configured to control the operating frequency of the computing device in the next second preset number of multiple computing cycles after adjusting the power consumption control signal value based on the multiple numerical bits in the adjusted power consumption control signal value, wherein the second preset number is less than or equal to the first preset number, the multiple numerical bits include a first numerical bit whose value is a first value, and the number of the first numerical bits is used to indicate the number of computing cycles in which the computing device stops working in the next second preset number of multiple computing cycles.
[0083] In some embodiments, the multiple numerical bits also include a second numerical bit whose value is a second value, and the third acquisition unit may include: a first determination subunit, configured to determine that the power consumption evaluation result is that the power consumption of the computing device is too high in response to the average power consumption characterization value being greater than or equal to a preset power consumption threshold; and wherein the adjustment subunit may be configured to: in response to determining that the power consumption evaluation result is that the power consumption of the computing device is too high, adjust a second numerical bit in the power consumption control signal value to the first numerical bit.
[0084] In some embodiments, the multiple numerical bits also include a second numerical bit whose value is a second value, and the third acquisition unit may include: a second determination subunit, configured to determine that the power consumption evaluation result is that the power consumption of the computing device is normal in response to the average power consumption characterization value being less than a preset power consumption threshold; and wherein the adjustment subunit may be configured to: in response to determining that the power consumption evaluation result is that the power consumption of the computing device is normal and the power consumption control signal value includes a first numerical bit, adjust a first numerical bit in the power consumption control signal value to a second numerical bit.
[0085] In some embodiments, the adjustment subunit can also be configured to: in response to determining that the power consumption assessment result is that the power consumption of the computing device is normal and each numerical bit in the power consumption control signal value is the second numerical bit, determine that each numerical bit in the power consumption control signal value is still the second numerical bit.
[0086] In some embodiments, the control subunit may include: a generation module, configured to generate an instruction issuance prevention signal based on the third number of second numerical bits in the adjusted power consumption control signal value; and a sending module, configured to send the instruction issuance prevention signal to an instruction parsing device for sending operation instructions to the operation device, so as to prevent the instruction parsing device from stopping issuing operation instructions in a third number of operation cycles in the next second preset number of multiple operation cycles.
[0087] In some embodiments, the power consumption control device for a computing device of an embodiment of the present disclosure may further include: a fourth acquisition unit, configured to, after the power consumption control signal value is adjusted, obtain an average power consumption characterization value of the computing device within a most recent power consumption assessment cycle in response to a third preset number of computing cycles having passed, so as to determine a power consumption assessment result of the computing device within the most recent power consumption assessment cycle, wherein the third preset number is greater than or equal to the first preset number; and a determination unit, configured to re-determine the power consumption control signal value based on the power consumption assessment result of the computing device within the most recent power consumption assessment cycle.
[0088] In some embodiments, a chip is provided, comprising the above-mentioned power consumption control device for a computing device.
[0089] In some embodiments, an electronic device is provided, comprising the above-mentioned chip.
[0090] In some embodiments, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned power consumption control method for a computing device.
[0091] In some embodiments, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned power consumption control method for a computing device.
[0092] In some embodiments, a computer program product is provided, including a computer program, wherein the computer program implements the above-mentioned power consumption control method for a computing device when executed by a processor.
[0093] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.
[0094] refer to Figure 7 , a block diagram of an electronic device 700 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0095] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0096] Multiple components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 can be any type of device that can input information to the electronic device 700. The input unit 706 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 707 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 708 can include but is not limited to a disk, an optical disk. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0097] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the above-mentioned power consumption control method for a computing device. For example, in some embodiments, the above-mentioned power consumption control method for a computing device may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the above-mentioned power consumption control method for a computing device described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the above-mentioned power consumption control method for a computing device in any other appropriate manner (for example, by means of firmware).
[0098] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0100] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0102] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0103] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0104] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0105] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A power consumption control method for a computing device executed by a power consumption control device, the method comprising: Acquire a first number of data request signals within a power consumption evaluation cycle, wherein the power consumption evaluation cycle includes a first preset number of consecutive multiple computing cycles, the data request signal is sent by an instruction parsing device to a storage device, and is used to request the storage device for input data of the computing device, and the instruction parsing device is used to send a computing instruction to the computing device; Based on the first quantity, obtaining an average power consumption characterization value of the computing device during the power consumption evaluation period; Based on the average power consumption characterization value and the preset power consumption threshold, obtaining a power consumption evaluation result within the power consumption evaluation period; and Adjusting the operating frequency of the computing device based on the power consumption evaluation result includes: Based on the power consumption evaluation result, adjusting a power consumption control signal value represented in binary, wherein the power consumption evaluation result indicates whether the power consumption of the computing device exceeds the preset power consumption threshold, and the power consumption control signal value includes a second preset number of multiple numerical bits; and Based on a plurality of numerical bits in the adjusted power consumption control signal value, controlling the operating frequency of the computing device in a second preset number of computing cycles after the power consumption control signal value is adjusted, comprises: generating an instruction issuance preventing signal based on a third number of the first numerical bits in the adjusted power consumption control signal value; and The instruction issuance prevention signal is sent to the instruction parsing device, so that the instruction parsing device stops issuing operation instructions in the third number of operation cycles in the next second preset number of multiple operation cycles; wherein, The second preset number is less than or equal to the first preset number, the multiple numerical bits include a first numerical bit whose numerical value is a first value, and the number of the first numerical bits is used to indicate the number of operation cycles in which the operation device stops working in the next second preset number of multiple operation cycles.
2. The method according to claim 1, wherein: The computing device includes a plurality of computing submodules, and obtaining, based on the first quantity, an average power consumption characterization value of the computing device in the power consumption evaluation period includes: Based on the first number, obtaining a second number of operation submodules in the operation device that are in working state during the power consumption evaluation period; and Based on the second number, an average power consumption characterization value of the computing device in the power consumption evaluation period is obtained.
3. The method according to claim 1, wherein: The multiple numerical bits also include a second numerical bit whose value is a second value, and obtaining the power consumption evaluation result within the power consumption evaluation period based on the average power consumption characterization value and the preset power consumption threshold includes: In response to the average power consumption characterization value being greater than or equal to the preset power consumption threshold, determining that the power consumption evaluation result is that the power consumption of the computing device is too high; and wherein, The determining, based on the power consumption evaluation result, a power consumption control signal value represented in binary format comprises: In response to determining that the power consumption evaluation result is that the power consumption of the computing device is too high, a second numerical bit in the power consumption control signal value is adjusted to a first numerical bit.
4. The method according to claim 1, wherein: The multiple numerical bits also include a second numerical bit whose value is a second value, and obtaining the power consumption evaluation result within the power consumption evaluation period based on the average power consumption characterization value and the preset power consumption threshold includes: In response to the average power consumption characterization value being less than the preset power consumption threshold, determining that the power consumption evaluation result is that the power consumption of the computing device is normal; and wherein, The determining, based on the power consumption evaluation result, a power consumption control signal value represented in binary format comprises: In response to determining that the power consumption evaluation result is that the power consumption of the computing device is normal and the power consumption control signal value includes a first numerical bit, a first numerical bit in the power consumption control signal value is adjusted to a second numerical bit.
5. The method according to claim 4, wherein: The determining of a power consumption control signal value represented in binary based on the power consumption evaluation result further comprises: In response to determining that the power consumption evaluation result is that the power consumption of the computing device is normal and each numerical bit in the power consumption control signal value is the second numerical bit, determining that each numerical bit in the power consumption control signal value is still the second numerical bit.
6. The method according to any one of claims 1 to 5, further comprising: After the power consumption control signal value is adjusted, in response to a third preset number of operation cycles having passed, obtaining an average power consumption characterization value of the operation device in a most recent power consumption evaluation cycle to determine a power consumption evaluation result of the operation device in the most recent power consumption evaluation cycle, wherein the third preset number is greater than or equal to the first preset number; and The power consumption control signal value is re-determined based on the power consumption evaluation result of the computing device in the most recent power consumption evaluation cycle.
7. A power consumption control device for a computing device, the power consumption control device comprising: a first acquisition unit, configured to acquire a first number of data request signals within a power consumption evaluation cycle, wherein the power consumption evaluation cycle includes a first preset number of consecutive multiple operation cycles, the data request signal is sent by an instruction parsing device to a storage device, and is used to request the storage device for input data of the operation device, and the instruction parsing device is used to send an operation instruction to the operation device; A second acquisition unit is configured to acquire, based on the first quantity, an average power consumption characterization value of the computing device in the power consumption evaluation period; A third acquisition unit is configured to acquire a power consumption evaluation result within the power consumption evaluation period based on the average power consumption characterization value and a preset power consumption threshold; and An adjustment unit is configured to adjust the operating frequency of the computing device based on the power consumption evaluation result, and the adjustment unit includes: an adjusting subunit, configured to adjust a power consumption control signal value represented in binary form based on the power consumption evaluation result, wherein the power consumption evaluation result indicates whether the power consumption of the computing device exceeds the preset power consumption threshold, and the power consumption control signal value includes a second preset number of multiple numerical bits; and A control subunit is configured to control the operating frequency of the computing device in a second preset number of multiple computing cycles after adjusting the power consumption control signal value based on a plurality of numerical bits in the adjusted power consumption control signal value, wherein the second preset number is less than or equal to the first preset number, the plurality of numerical bits include a first numerical bit whose value is a first value, and the number of the first numerical bits is used to indicate the number of computing cycles in which the computing device stops working in the second preset number of multiple computing cycles, the control subunit includes: a generating module configured to generate an instruction issuance preventing signal based on a third number of first numerical bits in the adjusted power consumption control signal value; and The sending module is configured to send the instruction issuance prevention signal to the instruction parsing device, so that the instruction parsing device stops issuing operation instructions in a third number of operation cycles in the next second preset number of multiple operation cycles.
8. The power consumption control device according to claim 7, wherein: The computing device includes a plurality of computing submodules, and the second acquiring unit includes: A first acquisition subunit is configured to acquire, based on the first number, a second number of operation submodules in the operation device that are in a working state within the power consumption evaluation period; and The second acquisition subunit is configured to acquire an average power consumption characterization value of the computing device within the power consumption evaluation period based on the second quantity.
9. The power consumption control device according to claim 7, wherein: The plurality of numerical bits further include a second numerical bit whose value is a second value, and the third obtaining unit includes: The first determining subunit is configured to determine that the power consumption evaluation result is that the power consumption of the computing device is too high in response to the average power consumption characterization value being greater than or equal to the preset power consumption threshold; and wherein, The adjustment subunit is configured as follows: In response to determining that the power consumption evaluation result is that the power consumption of the computing device is too high, a second numerical bit in the power consumption control signal value is adjusted to a first numerical bit.
10. The power consumption control device according to claim 9, wherein: The plurality of numerical bits further include a second numerical bit whose value is a second value, and the third obtaining unit includes: The second determining subunit is configured to determine that the power consumption evaluation result is that the power consumption of the computing device is normal in response to the average power consumption characterization value being less than the preset power consumption threshold; and wherein, The adjustment subunit is configured as follows: In response to determining that the power consumption evaluation result is that the power consumption of the computing device is normal and the power consumption control signal value includes a first numerical bit, a first numerical bit in the power consumption control signal value is adjusted to a second numerical bit.
11. The power consumption control device according to claim 10, wherein: The adjusting subunit is further configured to: In response to determining that the power consumption evaluation result is that the power consumption of the computing device is normal and each numerical bit in the power consumption control signal value is the second numerical bit, determining that each numerical bit in the power consumption control signal value is still the second numerical bit.
12. The power consumption control device according to any one of claims 7 to 11, further comprising: a fourth acquisition unit configured to acquire, after the power consumption control signal value is adjusted, an average power consumption characterization value of the computing device in a most recent power consumption evaluation cycle in response to a third preset number of computing cycles, so as to determine a power consumption evaluation result of the computing device in the most recent power consumption evaluation cycle, wherein the third preset number is greater than or equal to the first preset number; and The determining unit is configured to re-determine the power consumption control signal value based on the power consumption evaluation result of the computing device in the most recent power consumption evaluation cycle.
13. A chip comprising the device according to any one of claims 7 to 12.
14. An electronic device comprising the chip according to claim 13.
15. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
17. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Processor power consumption estimation method, mobile terminal and computer storage medium
CN112243060A
Method and device for reducing network-on-chip power consumption, CPU chip and server
CN112363609A
Power consumption evaluation method and device, storage medium and electronic equipment
CN113901748A
