Power consumption compensation method and device for AI chip, equipment, storage medium and program product

By configuring flip-weights and power consumption compensation methods for the data transmission nodes of the AI ​​chip computing module, the problems of voltage drop and chip overheating caused by power consumption fluctuations were solved, achieving accurate power consumption and gradient compensation, and improving the performance and energy efficiency of the computing module.

CN123114239APending Publication Date: 2026-11-17VASTAI TECH (SHANGHAI) INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611614430.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The AI ​​chip's computing module experiences significant power consumption fluctuations during operation, leading to issues such as voltage drops, logic mis-triggers, and localized overheating and aging of the chip.

Method used

Configure flip weights for the data transmission nodes of the computing module in the AI ​​chip. By statistically analyzing and comparing the real-time value of the weighted sum of flip numbers and the interval threshold, determine the level and compensate the power consumption value to the power supply of the first computing unit to achieve accurate and gradient compensation.

Benefits of technology

It reduces power consumption fluctuations in AI chips, lowers power supply noise and chip hotspots, improves the computing speed and accuracy of computing modules, and balances power consumption stability and chip energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114239A_ABST
    Figure CN123114239A_ABST
Patent Text Reader

Abstract

The present disclosure provides a power consumption compensation method and device for an AI chip, equipment, a storage medium and a program product, relates to the technical field of artificial intelligence, in particular to the fields of AI chips, high-performance computing, etc., and realizes the scheme that each data transmission node of a calculation module located in the AI chip is configured with a flip weight one by one, wherein the calculation module comprises a first calculation unit and a second calculation unit; based on the flip weight and the maximum number of flips, the maximum value of the flip number weighted sum of each data transmission node is determined; based on the maximum value of the flip number weighted sum, n-1 interval thresholds are determined; the real-time flip number of each data transmission node is counted; based on the flip weight and the real-time flip number, the real-time value of the flip number weighted sum of each data transmission node is determined; the real-time value of the flip number weighted sum is compared with the interval threshold to determine the gear of the real-time value of the flip number weighted sum; and the power consumption value determined based on the gear is compensated to the power supply of the first calculation unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, particularly to AI chips, high-performance computing, and especially to a power consumption compensation method, apparatus, device, storage medium, and program product for AI chips. Background Technology

[0002] In AI chips, the computing module is a core component, mainly used to efficiently complete large-scale data operations, and can be applied to the training and inference of neural networks.

[0003] However, if the computing module experiences significant power consumption fluctuations during operation, it may cause problems such as voltage drops, logic mis-triggers, and localized overheating and aging of the chip. Therefore, there is an urgent need for a power compensation method for AI chips that can reduce power consumption fluctuations. Summary of the Invention

[0004] This disclosure provides a power consumption compensation method, apparatus, device, storage medium, and program product for AI chips.

[0005] According to one aspect of this disclosure, a power consumption compensation method for an AI chip is provided. The method includes: configuring flip weights for each data transmission node of a computing module located in the AI ​​chip, wherein the computing module includes a first computing unit and a second computing unit, and the data transmission nodes transmit computational data to the first computing unit and the second computing unit. Within the same time period, the total number of flips for each data transmission node of the first computing unit is greater than the total number of flips for each data transmission node of the second computing unit. The flip number is the number of bits that flip between adjacent clock cycles of the computing module. Based on the flip weights and the maximum number of flips for each data transmission node of the computing module, the method determines the power consumption compensation method for each data transmission node. The maximum value of the weighted sum of the flip counts of the points; based on the maximum value of the weighted sum of the flip counts, determine n-1 interval thresholds, where n is a natural number greater than or equal to 2; calculate the real-time flip counts of each data transmission node in the statistical calculation module; based on the flip weights and the real-time flip counts, determine the real-time value of the weighted sum of the flip counts of each data transmission node; compare the real-time value of the weighted sum of the flip counts with the interval thresholds to determine the level of the real-time value of the weighted sum of the flip counts, where the interval of the real-time value of the weighted sum of the flip counts corresponds one-to-one with the level, and the real-time value of the weighted sum of the flip counts is inversely proportional to the level; compensate the power consumption value determined based on the level to the power supply of the first calculation unit, where the level is directly proportional to the power consumption value.

[0006] In some embodiments, the calculation module includes at least a multiply-adder, the first calculation unit includes at least an adder, the second calculation unit includes at least a multiplier, and the data transmission node includes at least a multiplication input data node, a multiplication output data node, and an addition intermediate value data node.

[0007] In some embodiments, a flip weight is configured for each data transmission node of the computing module located in the AI ​​chip, including: the magnitude of the flip weight is inversely proportional to the maximum number of flips of the corresponding data transmission node.

[0008] In some embodiments, determining n-1 interval thresholds based on the maximum value of the weighted sum of the flip numbers includes: dividing the numerical range from zero to the maximum value of the weighted sum of the flip numbers into n consecutive intervals to obtain n-1 interval boundary points; and setting the n-1 interval boundary points one-to-one as n-1 interval thresholds.

[0009] In some embodiments, comparing the real-time value of the weighted sum of flipped numbers with an interval threshold to determine the level of the real-time value of the weighted sum of flipped numbers includes: comparing the real-time value of the weighted sum of flipped numbers with n-1 interval thresholds to determine the sequence number of the interval in which the real-time value of the weighted sum of flipped numbers is located, wherein the sequence number of the interval is set sequentially based on the n intervals arranged in descending order; and setting the sequence number of the interval as the level.

[0010] In some embodiments, determining the real-time value of the weighted sum of the flip counts of each data transmission node based on the flip weight and the real-time flip count includes: logically shifting the real-time flip count of the corresponding data transmission node to the left based on the flip weight; and summing the real-time flip counts after the logical left shift to obtain the real-time value of the weighted sum of the flip counts.

[0011] In some embodiments, compensating the power consumption value determined based on the gear position to the power supply of the first computing unit includes: generating a power consumption value determined based on the gear position on the side away from the second computing unit according to the clock signal of the computing module; and compensating the power consumption value to the power supply of the first computing unit.

[0012] In some embodiments, the method further includes: within the same clock cycle of the computing module, counting the real-time toggle counts of each data transmission node of the computing module, determining the real-time value of the weighted sum of the toggle counts of each data transmission node, comparing the real-time value of the weighted sum of the toggle counts with an interval threshold, and compensating the power consumption value determined based on the level to the power supply of the first computing unit.

[0013] According to one aspect of this disclosure, a power compensation device for an AI chip is provided, comprising: a weight configuration module configured to configure flip weights for each data transmission node of a computing module located in the AI ​​chip, wherein the computing module includes a first computing unit and a second computing unit, the data transmission nodes transmit computational data to the first computing unit and the second computing unit, the total number of flips of each data transmission node of the first computing unit is greater than the total number of flips of each data transmission node of the second computing unit in the same time period, and the flip number is the number of bits that the data transmission node flips between adjacent clock cycles of the computing module; a weighted sum maximum value determination module configured to determine the maximum value of the weighted sum of the flip numbers of each data transmission node based on the flip weights and the maximum number of flips of each data transmission node of the computing module; and an interval threshold determination module configured to... The system is configured to: determine n-1 interval thresholds based on the maximum value of the weighted sum of flip-numbers, where n is a natural number greater than or equal to 2; a real-time flip-number statistics module, configured to count the real-time flip-numbers of each data transmission node in the calculation module; a weighted sum real-time value determination module, configured to determine the real-time value of the weighted sum of flip-numbers of each data transmission node based on the flip-number weight and the real-time flip-numbers; a gear determination module, configured to compare the real-time value of the weighted sum of flip-numbers with the interval thresholds to determine the gear of the real-time value of the weighted sum of flip-numbers, where the interval of the real-time value of the weighted sum of flip-numbers corresponds one-to-one with the gear, and the real-time value of the weighted sum of flip-numbers is inversely proportional to the size of the gear; and a power consumption compensation module, configured to compensate the power consumption value determined based on the gear to the power supply of the first calculation unit, where the size of the gear is directly proportional to the power consumption value.

[0014] According to another aspect of this disclosure, a computer device is provided, comprising: at least one processor; and a memory having a computer program stored thereon, wherein the computer program, when executed by the at least one processor, causes the at least one processor to perform the methods provided above in this disclosure.

[0015] According to another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the methods provided above in this disclosure.

[0016] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, causes the processor to perform the methods provided above in this disclosure.

[0017] According to one or more embodiments of this disclosure, the flipping situation of each data transmission node of the computing module can be distinguished, and the computing module can be accurately compensated in gradient, which can significantly reduce power supply noise and chip hotspots, and balance power consumption stability and chip energy efficiency.

[0018] These and other aspects of this disclosure will be apparent from the embodiments described below, and will be elucidated with reference to the embodiments described below. Attached Figure Description

[0019] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of this disclosure. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0020] Figure 1 This is a flowchart illustrating a power consumption compensation method for an AI chip according to an exemplary embodiment.

[0021] Figure 2 This is a schematic diagram illustrating a first configuration of a data transmission node according to an exemplary embodiment.

[0022] Figure 3 This is a schematic diagram illustrating a second configuration of a data transmission node according to an exemplary embodiment.

[0023] Figure 4 This is a schematic diagram illustrating a third configuration of a data transmission node according to an exemplary embodiment.

[0024] Figure 5 This is a schematic diagram illustrating the number of flips according to an exemplary embodiment.

[0025] Figure 6 This is a partial schematic diagram illustrating a power consumption compensation method applied to a computing module in an AI chip according to an exemplary embodiment.

[0026] Figure 7 This is a schematic diagram illustrating the statistical-weighted-level determination-compensation process of a power consumption compensation method for an AI chip according to an exemplary embodiment.

[0027] Figure 8 This is a schematic diagram illustrating a multiply-accumulator according to an exemplary embodiment.

[0028] Figure 9 This is a schematic diagram illustrating a power consumption compensator according to an exemplary embodiment.

[0029] Figure 10 This is a schematic block diagram illustrating a power compensation device for an AI chip according to an exemplary embodiment.

[0030] Figure 11 This is a block diagram illustrating an exemplary computer device that can be applied to an exemplary embodiment. Detailed Implementation

[0031] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0032] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.

[0033] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. As used herein, the term "multiple" means two or more, and the term "based on" should be interpreted as "at least partially based on". Furthermore, the terms "and / or" and "at least one of..." cover any one of the listed items and all possible combinations thereof.

[0034] In related technologies, random virtual data is generated to fill idle data streams, thereby improving the flip-flop rate of computing modules and smoothing out power consumption fluctuations. However, this approach has significant drawbacks: First, it only injects data uniformly into the entire computing module, failing to differentiate the power consumption contribution of each computing unit and unable to accurately compensate for power drops caused by insufficient bit flips at data transmission nodes of certain computing units; second, it cannot differentiate the flip-flop losses of data transmission nodes of each computing unit, and the compensation level cannot dynamically match the actual power consumption gap; third, it can only inject or disable virtual data in its entirety, lacking multi-level adjustable compensation settings, making it prone to undercompensation or overcompensation; fourth, virtual data intervenes in the real computation data stream, requiring complex flags to prevent calculation errors and adding extra hardware overhead to the data path.

[0035] Therefore, embodiments of this disclosure provide a power consumption compensation method for AI chips, which can accurately compensate for power consumption drops caused by insufficient bit flipping in data transmission nodes. This method can not only reduce power consumption fluctuations in the computing module of the AI ​​chip, but also perform gradient compensation for the computing module, and can avoid interfering with the original computational data stream without causing precision loss.

[0036] Exemplary embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0037] Figure 1 This is a flowchart illustrating a power consumption compensation method for an AI chip according to an exemplary embodiment.

[0038] like Figure 1 As shown, the power consumption compensation method for AI chips includes steps S101, S102, S103, S104, S105, S106 and S107.

[0039] In step S101, flip weights are configured for each data transmission node of the computing module located in the AI ​​chip. The computing module includes a first computing unit and a second computing unit. The data transmission nodes transmit computational data to the first computing unit and the second computing unit. In the same time period, the total number of flips of each data transmission node of the first computing unit is greater than the total number of flips of each data transmission node of the second computing unit. The number of flips is the number of bits that the data transmission node flips between adjacent clock cycles of the computing module.

[0040] In the example, the calculation module is used to receive calculation data, perform calculations, and output calculation results. The first calculation unit and the second calculation unit are used to implement different calculation functions. For example... Figure 2 As shown, data transmission nodes can be located at the input and output ends of the computing unit, respectively, such as... Figure 3 As shown, the data transmission node can also be located at the input end of the computing unit, such as... Figure 4 As shown, the data transmission node can also be located at the output end of the computing unit.

[0041] In the example, the total number of bit flips for all data transmission nodes of the first computing unit is greater than that of the second computing unit within the same time frame, meaning the power consumption fluctuation of the first computing unit is smaller than that of the second computing unit. Here, the number of bit flips refers to the number of bits that flip between adjacent clock cycles of the computing module. For example, ... Figure 5 As shown, the number of bit flips that occur between adjacent clock cycles in the data transmission node is 3, that is, the number of flips is 3.

[0042] In step S102, based on the flip weights and maximum flip counts of each data transmission node in the calculation module, the maximum value of the weighted sum of the flip counts of each data transmission node is determined.

[0043] In the example, the maximum number of flips for the data transmission node can be set according to the bit width of the computational data transmitted by the node. For example, as Figure 5As shown, the transmitted data is in 8-bit floating-point format (fp8), meaning the maximum number of flips is 8. The calculation method for the maximum value of the weighted sum of the flips can be determined according to actual needs. For example, the maximum number of flips and the flip weights can be multiplied one by one, and then the maximum number of flips after the multiplication can be added together to obtain the maximum value of the weighted sum of the flips.

[0044] In step S103, based on the maximum value of the weighted sum of the flip numbers, n-1 interval thresholds are determined, where n is a natural number greater than or equal to 2.

[0045] In the example, n-1 interval thresholds are determined within the numerical range from zero to the maximum value of the weighted sum of the flip numbers, providing a comparison benchmark for subsequent operations. The value of n can be set according to actual needs, such as the bit width of the computational data. It should be noted that the number of hardware components used for comparison with the interval thresholds in the subsequent "gear determination" step, and the compensation gradient in the subsequent "compensation" step, are both related to the value of n.

[0046] In step S104, the real-time flip count of each data transmission node in the statistical calculation module is calculated.

[0047] In the example, such as Figure 6 As shown, counting real-time flip-numbers is beneficial for dynamic power consumption compensation of the computing module. It should be noted that the hardware bit width for implementing the "counting" step can be set according to the bit width of the computation data. It should also be noted that real-time counting can be achieved using three independent synchronous latch XOR counting branches, significantly reducing hardware size. Additional flip-number counting branches such as multiplier carry chains and addition outputs can also be used to expand multi-dimensional fusion logic.

[0048] In step S105, based on the flip weight and the real-time flip count, the real-time value of the weighted sum of the flip counts of each data transmission node is determined.

[0049] In the example, the method for calculating the real-time value of the weighted sum of the flipped numbers can be determined according to actual needs. For example, such as Figure 7 As shown, the real-time flip number and flip weight are multiplied one by one, and then the real-time flip numbers after the multiplication operation are added together to obtain the real-time value of the weighted sum of the flip numbers.

[0050] In step S106, the real-time value of the weighted sum of the flipped numbers is compared with the interval threshold to determine the gear level of the real-time value of the weighted sum of the flipped numbers. The interval in which the real-time value of the weighted sum of the flipped numbers is located corresponds one-to-one with the gear level, and the real-time value of the weighted sum of the flipped numbers is inversely proportional to the size of the gear level.

[0051] In the example, such as Figure 6 As shown, determining the appropriate power level is beneficial for performing gradient power consumption compensation on the computing module. For example, as... Figure 7As shown, by comparing the real-time value of the weighted sum of the flipped numbers with n-1 interval thresholds in parallel, the interval in which the real-time value of the weighted sum of the flipped numbers is located can be determined. By the correspondence between the interval and the gear, the gear of the real-time value of the weighted sum of the flipped numbers can be determined.

[0052] In step S107, the power consumption value determined based on the gear level is compensated to the power supply of the first computing unit, wherein the size of the gear level is proportional to the power consumption value.

[0053] In the example, the power consumption value to be compensated is directly proportional to the size of the power level, and the size of the power level is inversely proportional to the real-time value of the weighted sum of the toggle numbers. This indicates that the real-time value of the weighted sum of the toggle numbers is inversely proportional to the power consumption value to be compensated, which is beneficial for the stable operation of the computing module. The power consumption value is compensated to the first computing unit because the power consumption fluctuation of the first computing unit is relatively stable, and directly compensating the power consumption value to the power supply does not infringe on the original computational data stream.

[0054] Therefore, in the power consumption compensation method for AI chips according to embodiments of this disclosure, the computing module can be dynamically compensated by statistically analyzing the real-time flip-flop count of each data transmission node. Simultaneously, by determining the real-time value of the weighted sum of the flip-flop counts and obtaining the corresponding level, both precise compensation and gradient compensation of the computing module can be achieved. Furthermore, directly compensating the power consumption value determined based on the level to the power supply of the first computing unit can reduce fluctuations in the computing module when receiving the compensated power consumption value without intruding on the original computational data stream. Thus, the power consumption compensation method for AI chips according to embodiments of this disclosure can significantly reduce power supply noise and chip hotspots, improve the computational speed and accuracy of the computing module, and balance power consumption stability and chip energy efficiency.

[0055] In some embodiments, the calculation module includes at least a multiply-adder, the first calculation unit includes at least an adder, the second calculation unit includes at least a multiplier, and the data transmission node includes at least a multiplication input data node, a multiplication output data node, and an addition intermediate value data node.

[0056] In the example, such as Figure 8 As shown, the multiply-adder includes a multiplier and an adder. The data transmission nodes of the multiplier include multiplication input data nodes and multiplication output data nodes, and the data transmission nodes of the adder include addition intermediate value data nodes.

[0057] In the above manner, for computing modules such as multiply-accumulators that have the problem of separate power consumption imbalance, that is, multiplyers are prone to sudden drops in the number of flips and a large drop in instantaneous power consumption, while the addition logic flips are stable. The overall power consumption gap of multiply-accumulators is basically generated by fluctuations on the multiplyer side. The embodiments of this disclosure can accurately compensate for the power consumption drop caused by insufficient bit flips at the data transmission nodes of the multiplyer, and reduce faults such as voltage drops, logic mis-triggers, and local overheating and aging of AI chips.

[0058] In some embodiments, the flip weight is inversely proportional to the maximum number of flips for the corresponding data transmission node.

[0059] In the example, the flip weights can be configured based on the bit flipping behavior of the data transmission nodes. For example, a smaller flip weight can be configured for a larger maximum flip number, and a larger flip weight can be configured for a smaller maximum flip number. It should be noted that the value of each flip weight can be determined individually, or the sum of the flip weights can be determined first, and then the values ​​of the individual flip weights can be assigned.

[0060] The above method helps to accurately compensate for data transmission nodes with insufficient bit flipping in the computing module and reduce power consumption fluctuations.

[0061] In some embodiments, combined with Figure 1 Step S103, which determines n-1 interval thresholds based on the maximum value of the weighted sum of the flipped numbers, further includes: dividing the numerical range from zero to the maximum value of the weighted sum of the flipped numbers into n consecutive intervals to obtain n-1 interval boundary points; and setting the n-1 interval boundary points one by one as n-1 interval thresholds.

[0062] In the example, the method of dividing the intervals can be determined according to actual needs. For example, the range of values ​​from zero to the maximum value of the weighted sum of the flipped numbers can be divided into n equal intervals.

[0063] The above method can clarify the value of the interval threshold, which is beneficial for subsequently determining the level of the real-time value of the weighted sum of the flip numbers.

[0064] In some embodiments, combined with Figure 1 Step S105, which determines the real-time value of the weighted sum of the flip counts of each data transmission node based on the flip weight and the real-time flip count, further includes: logically shifting the real-time flip count of the corresponding data transmission node to the left based on the flip weight; and summing the real-time flip counts after the logical left shift to obtain the real-time value of the weighted sum of the flip counts.

[0065] In the example, the implementation of the logical left shift can be determined based on the actual situation. For example, the integer power of the preset base to which the flip weight is converted can be determined, and the corresponding real-time flip number can be logically shifted left by an integer power.

[0066] By using the above method, a hardware multiplier can be replaced by a logical shifter, reducing the hardware area.

[0067] In some embodiments, combined with Figure 1 Step S106, comparing the real-time value of the weighted sum of the flipped numbers with the interval thresholds to determine the level of the real-time value of the weighted sum of the flipped numbers, further includes: comparing the real-time value of the weighted sum of the flipped numbers with n-1 interval thresholds to determine the sequence number of the interval in which the real-time value of the weighted sum of the flipped numbers is located, wherein the sequence number of the interval is set sequentially based on the n intervals arranged in descending order; and setting the sequence number of the interval as the level.

[0068] In the example, the n intervals are arranged in descending order. The interval numbers are set to correspond one-to-one with the n intervals, which helps to realize the inverse relationship between the real-time value of the weighted sum of the flip numbers and the gear size.

[0069] The above method can clearly define the specific value of the gear position, and the inverse relationship between the real-time value of the weighted sum of the flips and the gear position size is beneficial for achieving accurate compensation when the calculation module has insufficient bit flips.

[0070] In some embodiments, combined with Figure 1 Step S107, which compensates the power consumption value determined based on the gear position to the power supply of the first computing unit, further includes: generating a power consumption value determined based on the gear position on the side away from the second computing unit according to the clock signal of the computing module; and compensating the power consumption value to the power supply of the first computing unit.

[0071] In the example, such as Figure 6 and Figure 9 As shown, on the side away from the second computing unit, a power consumption value determined based on the clock signal of the computing module is generated based on the power level. This power consumption value is then directly compensated for at the power supply of the first computing unit. The side away from the second computing unit includes the side closer to the first computing unit and the physically idle area within the AI ​​chip.

[0072] By adopting the above method, the impact on the second computing unit, which has relatively large power consumption fluctuations, can be reduced, which is conducive to stabilizing the power consumption of the computing module.

[0073] In some embodiments, the power consumption compensation method for an AI chip according to the present disclosure further includes: within the same clock cycle of the computing module, counting the real-time toggle count of each data transmission node of the computing module, determining the real-time value of the weighted sum of the toggle counts of each data transmission node, comparing the real-time value of the weighted sum of the toggle counts with an interval threshold, and compensating the power consumption value determined based on the level to the power supply of the first computing unit.

[0074] In the example, the "statistics-weighting-tier generation-power compensation" process can be completed within the same clock cycle of the calculation module. It should be noted that the "statistics-weighting-tier generation-power compensation" process can also be completed in different clock cycles. The advantage is that it reduces hardware requirements, but the disadvantage is that the compensation will introduce pipeline delays and may sacrifice the accuracy of the comparison in each clock cycle.

[0075] The above method completes the "statistics-weighting-level generation-power consumption compensation" in the same clock cycle, with no compensation delay, which can cope with instantaneous data changes and synchronously fill the power consumption gap.

[0076] The following combination Figures 6-9 This section provides examples of power consumption compensation methods for AI chips, specifically illustrating embodiments of this disclosure.

[0077] In one example, such as Figure 8 As shown, the calculation module includes a multiply-accumulator, which comprises a multiplier and an adder. The multiplication input data node and multiplication output data node transmit data to the multiplier, while the addition intermediate value data node transmits data to the adder. Figure 6 As shown, in the pre-configuration stage: the flip weights W1, W2, and W3 of the multiplication input data node, W2, and W3 of the addition intermediate value data node are configured one by one, i.e., 8, 4, and 4; based on the maximum flip numbers of the multiplication input data node, multiplication output data node, and addition intermediate value data node, i.e., 16, 32, and 32, the maximum value of the weighted sum of flip numbers is obtained, i.e., 384; the range 0 to 384 is divided into eight equal parts, resulting in seven threshold intervals: 48, 96, 144, 192, 240, 288, and 336, with interval numbers (levels) of 7, 6, 5, 4, 3, 2, 1, and 0, respectively. Figure 7 As shown, within the same clock cycle, the real-time toggle counts N1, N2, and N3 of the multiplication input data node, and the addition intermediate value data node are acquired in parallel. The integer powers of 2 corresponding to W1, W2, and W3 are converted sequentially, i.e., 3, 2, and 2. A logical left shift is then performed on N1, N2, and N3 to obtain the real-time value of the weighted sum of the toggle counts, i.e., N_SUM = N1 << 3 + N2 << 2 + N3 << 2. A 7-channel parallel comparator is used to compare N_SUM with the interval threshold, and the gear of N_SUM is determined based on the one-hot priority encoder. Figure 9As shown, a segmented 32-bit ripple counter is used. Based on a high-frequency clock signal, a power consumption determined by the level is generated on the adder side and directly compensated to the power supply domain of the adder. At this time, the ripple counter and the adder share the power line. Based on the above examples, precise gradient compensation can be performed on the multiply-accumulator. For example, if all signals have no flips (N1=0, N2=0, N3=0, N_SUM=0, setting 7), the ripple counters are all turned on to suppress a sharp drop in power consumption; if multiplication has a small number of flips and addition has no flips (N1=2, N2=4, N3=0, N_SUM=32, setting 7), the ripple counters are all turned on for maximum compensation; if the multiply-accumulator has a moderate number of bit flips (N1=8, N2=16, N3=8, N_SUM=160, setting 4), the ripple counters are turned on for 16 bits for moderate compensation; if both the multiplier and adder have full flips (N1=16, N2=32, N3=32, N_SUM=384, setting 0), the ripple counters are all turned off, resulting in no compensation power consumption.

[0078] Embodiments of this disclosure also provide a power consumption compensation device for an AI chip.

[0079] Figure 10 This is a schematic block diagram illustrating a power compensation device for an AI chip according to an exemplary embodiment.

[0080] like Figure 10 As shown, in some embodiments, the power consumption compensation device 1000 for AI chips includes a weight configuration module 1001, a weighted sum maximum value determination module 1002, an interval threshold determination module 1003, a flip number real-time value statistics module 1004, a weighted sum real-time value determination module 1005, a level determination module 1006, and a power consumption compensation module 1007.

[0081] The weight configuration module 1001 is configured to configure flip weights for each data transmission node of the computing module located in the AI ​​chip. The computing module includes a first computing unit and a second computing unit. The data transmission nodes transmit computation data to the first computing unit and the second computing unit. In the same time period, the total number of flips of each data transmission node of the first computing unit is greater than the total number of flips of each data transmission node of the second computing unit. The number of flips is the number of bits that the data transmission node flips between adjacent clock cycles of the computing module.

[0082] The weighted sum maximum value determination module 1002 is configured to determine the maximum value of the weighted sum of the flip numbers of each data transmission node based on the flip weight and maximum flip number of each data transmission node in the calculation module.

[0083] The interval threshold determination module 1003 is configured to determine n-1 interval thresholds based on the maximum value of the weighted sum of the flipped numbers, where n is a natural number greater than or equal to 2.

[0084] The real-time flip count statistics module 1004 is configured to calculate the real-time flip count of each data transmission node in the module.

[0085] The weighted sum real-time value determination module 1005 is configured to determine the real-time value of the weighted sum of the flip counts of each data transmission node based on the flip weight and the real-time flip count.

[0086] The gear determination module 1006 is configured to compare the real-time value of the weighted sum of the flip-numbers with an interval threshold to determine the gear position of the real-time value of the weighted sum of the flip-numbers. The interval in which the real-time value of the weighted sum of the flip-numbers is located corresponds one-to-one with the gear position, and the real-time value of the weighted sum of the flip-numbers is inversely proportional to the size of the gear position.

[0087] The power consumption compensation module 1007 is configured to compensate the power consumption value determined based on the gear level to the power supply of the first computing unit, wherein the size of the gear level is proportional to the power consumption value.

[0088] The operations of the aforementioned weight configuration module 1001, weighted sum maximum value determination module 1002, interval threshold determination module 1003, real-time value statistics module 1004, weighted sum real-time value determination module 1005, gear determination module 1006, and power consumption compensation module 1007 can be combined. Figure 1 The operations of steps S101 to S107 are the same, so the details of each aspect will not be repeated here.

[0089] In some embodiments, the power consumption compensation device 1000 for the AI ​​chip may further include: a clock synchronization module 1008, configured to, within the same clock cycle of the computing module, count the real-time toggle count of each data transmission node of the computing module, determine the real-time value of the weighted sum of the toggle counts of each data transmission node, compare the real-time value of the weighted sum of the toggle counts with an interval threshold, and compensate the power consumption value determined based on the level to the power supply of the first computing unit.

[0090] In some embodiments, the interval threshold determination module 1003 may include: an interval boundary point determination module 1003a, configured to divide the numerical range from zero to the maximum value of the weighted sum of the flipped numbers into n consecutive intervals to obtain n-1 interval boundary points; and an interval threshold setting module 1003b, configured to set the n-1 interval boundary points one by one as n-1 interval thresholds.

[0091] In some embodiments, the weighted sum real-time value determination module 1005 may include: a logical left shift module 1005a, configured to logically shift the real-time flip number of the corresponding data transmission node to the left based on the flip weight; and a summation module 1005b, configured to sum the real-time flip numbers after the logical left shift to obtain the real-time value of the weighted sum of the flip numbers.

[0092] In some embodiments, the gear determination module 1006 may include: an interval number setting module 1006a, configured to compare the real-time value of the weighted sum of the flipped numbers with n-1 interval thresholds to determine the number of the interval in which the real-time value of the weighted sum of the flipped numbers is located, wherein the interval number is set sequentially based on the n intervals arranged in descending order; and a gear setting module 1006b, configured to set the interval number as the gear.

[0093] In some embodiments, the power consumption compensation module 1007 may include: a power consumption generation module 1007a, configured to generate a power consumption value determined based on a gear level on the side away from the second computing unit according to the clock signal of the computing module; and a compensation module 1007b, configured to compensate the power consumption value to the power supply of the first computing unit.

[0094] While specific functions have been discussed above with reference to specific modules, it should be noted that the functions of the modules discussed herein can be divided into multiple modules, and / or at least some functions of multiple modules can be combined into a single module. The specific actions performed by the modules discussed herein include the specific module itself performing the action, or alternatively, the specific module calling or otherwise accessing another component or module that performs the action (or performs the action in conjunction with the specific module). Therefore, a specific module performing an action can include the specific module performing the action itself and / or another module that performs the action, called or otherwise accessed by the specific module.

[0095] It should also be understood that the above regarding Figure 10The described modules can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these modules can be implemented as computer program code / instructions configured to execute in one or more processors and stored in a computer-readable storage medium. Alternatively, these modules can be implemented as hardware logic / circuit. For example, these modules can be implemented together in a System-on-Chip (SoC). The SoC may include an integrated circuit chip (which includes one or more components in the following categories: processor (e.g., Central Processing Unit (CPU), microcontroller, microprocessor, digital signal processor (DSP), etc.), memory, one or more communication interfaces, and / or other circuitry), and may optionally execute received program code and / or include embedded firmware to perform functions.

[0096] According to one aspect of this disclosure, a computer device is also provided, including a memory, a processor, and a computer program stored in the memory. The processor is configured to execute the computer program to implement the steps of any of the method embodiments described above.

[0097] According to one aspect of this disclosure, a non-transitory computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of any of the method embodiments described above.

[0098] According to one aspect of this disclosure, a computer program product is also provided, which includes a computer program that, when executed by a processor, implements the steps of any of the method embodiments described above.

[0099] In the following text, combined with Figure 11 Illustrative examples describing such computer devices, non-transitory computer-readable storage media, and computer program products.

[0100] Figure 11 An example configuration of a computer device 1100 that can be used to implement the methods described herein is shown.

[0101] Computer device 1100 can be a variety of different types of devices. Examples of computer device 1100 include, but are not limited to: desktop computers, server computers, laptop or netbook computers, mobile devices (e.g., tablets, cellular or other wireless phones (e.g., smartphones), notebook computers, mobile stations), wearable devices (e.g., glasses, watches), entertainment devices (e.g., entertainment appliances, set-top boxes communicatively coupled to a display device, game consoles), televisions or other display devices, automotive computers, and so on.

[0102] Computer device 1100 may include at least one processor 1102, memory 1104, multiple communication interfaces 1106, display device 1108, other input / output (I / O) devices 1110, and one or more mass storage devices 1112 capable of communicating with each other, such as via system bus 1114 or other suitable connections.

[0103] Processor 1102 may be a single processing unit or multiple processing units, and all processing units may include single or multiple computing units or multiple cores. Processor 1102 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and / or any device that manipulates signals based on operating instructions. Among other capabilities, processor 1102 may be configured to acquire and execute computer-readable instructions stored in memory 1104, mass storage device 1112, or other computer-readable media, such as program code of operating system 1116, program code of application program 1118, program code of other program 1120, etc.

[0104] Memory 1104 and mass storage device 1112 are examples of computer-readable storage media for storing instructions that are executed by processor 1102 to perform the various functions described above. For example, memory 1104 may generally include both volatile and non-volatile memory (e.g., RAM, ROM, etc.). Furthermore, mass storage device 1112 may generally include hard disk drives, solid-state drives, removable media, including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network-attached storage, storage area networks, etc. Both memory 1104 and mass storage device 1112 may be collectively referred to herein as memory or computer-readable storage media, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code, which may be executed by processor 1102 as a specific machine configured to perform the operations and functions described in the examples herein.

[0105] Multiple programs may be stored on mass storage device 1112. These programs include operating system 1116, one or more application programs 1118, other programs 1120, and program data 1122, and they may be loaded into memory 1104 for execution. Examples of such application programs or program modules may include computer program logic (e.g., computer program code or instructions) of the methods described herein and / or other embodiments described herein.

[0106] Although Figure 11 The modules 1116, 1118, 1120, and 1122, or portions thereof, are illustrated as being stored in memory 1104 of computer device 1100, but modules 1116, 1118, 1120, and 1122, or portions thereof, may be implemented using any form of computer-readable medium accessible by computer device 1100. As used herein, “computer-readable medium” includes at least two types of computer-readable media: computer-readable storage media and communication media.

[0107] Computer-readable storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, DVD, or other optical storage devices, magnetic cassettes, magnetic tapes, disk storage devices or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by computer devices. In contrast, communication media can embody computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms. Computer-readable storage media as defined herein do not include communication media.

[0108] One or more communication interfaces 1106 are used for exchanging data with other devices, such as via a network, direct connection, etc. Such communication interfaces can be one or more of the following: any type of network interface (e.g., a network interface card (NIC)), wired or wireless (such as IEEE 802.11 Wireless LAN (WLAN)) wireless interface, Wi-MAX interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth. TM Interfaces, near field communication (NFC) interfaces, etc. Communication interface 1106 can facilitate communication across various network and protocol types, including wired networks (e.g., LAN, cable, etc.) and wireless networks (e.g., WLAN, cellular, satellite, etc.), the Internet, etc. Communication interface 1106 can also provide communication with external storage devices (not shown) such as storage arrays, network-attached storage, storage area networks, etc.

[0109] In some examples, a display device 1108, such as a monitor, may be included for displaying information and images to the user. Other I / O devices 1110 may be devices that receive various inputs from the user and provide various outputs to the user, and may include touch input devices, gesture input devices, cameras, keyboards, remote controls, mice, printers, audio input / output devices, and so on.

[0110] The technologies described herein can be supported by these various configurations of computer device 1100, and are not limited to specific examples of the technologies described herein. For example, the functionality can also be implemented wholly or partially on a “cloud” using a distributed system. A cloud includes and / or represents a platform for resources. The platform abstracts the underlying functionality of the cloud’s hardware (e.g., servers) and software resources. Resources may include applications and / or data that can be used when performing computational processing on a server remote from computer device 1100. Resources may also include services provided via the Internet and / or via subscriber networks such as cellular or Wi-Fi networks. The platform can abstract resources and functionality to connect computer device 1100 to other computer devices. Therefore, the implementation of the functionality described herein can be distributed throughout the cloud. For example, the functionality may be implemented partly on computer device 1100 and partly through a platform that abstracts the functionality of the cloud.

Claims

1. A power consumption compensation method for AI chips, characterized in that, The method includes: Each data transmission node in the computing module located in the AI ​​chip is configured with a flip weight. The computing module includes a first computing unit and a second computing unit. The data transmission node transmits computational data to the first computing unit and the second computing unit. In the same time period, the total number of flips of each data transmission node of the first computing unit is greater than the total number of flips of each data transmission node of the second computing unit. The number of flips is the number of bits that the data transmission node flips between adjacent clock cycles of the computing module. Based on the flip weights and maximum flip counts of each data transmission node in the calculation module, the maximum value of the weighted sum of the flip counts of each data transmission node is determined. Based on the maximum value of the weighted sum of the flipped numbers, n-1 interval thresholds are determined, where n is a natural number greater than or equal to 2; Count the real-time flip count of each data transmission node in the computing module; Based on the flip weight and the real-time flip count, determine the real-time value of the weighted sum of the flip counts of each data transmission node; The real-time value of the weighted sum of the flipped numbers is compared with the interval threshold to determine the gear level of the real-time value of the weighted sum of the flipped numbers, wherein the interval in which the real-time value of the weighted sum of the flipped numbers is located corresponds one-to-one with the gear level, and the real-time value of the weighted sum of the flipped numbers is inversely proportional to the size of the gear level; The power consumption value determined based on the gear level is compensated to the power supply of the first computing unit, wherein the size of the gear level is proportional to the power consumption value.

2. The method according to claim 1, characterized in that, The calculation module includes at least a multiply-adder, the first calculation unit includes at least an adder, the second calculation unit includes at least a multiplier, and the data transmission node includes at least a multiplication input data node, a multiplication output data node, and an addition intermediate value data node.

3. The method according to claim 1 or 2, characterized in that, Configure flip weights for each data transmission node of the computing module located in the AI ​​chip, including: the magnitude of the flip weight is inversely proportional to the maximum number of flips of the corresponding data transmission node.

4. The method according to claim 1 or 2, characterized in that, Based on the maximum value of the weighted sum of the flipped numbers, n-1 interval thresholds are determined, including: Divide the numerical range from zero to the maximum value of the weighted sum of the flipped numbers into n consecutive intervals to obtain n-1 interval boundary points; Set each of the n-1 interval boundary points as an n-1 interval threshold.

5. The method according to claim 1 or 2, characterized in that, Comparing the real-time value of the weighted sum of the flipped numbers with the interval threshold to determine the level of the real-time value of the weighted sum of the flipped numbers includes: The real-time value of the weighted sum of the flipped numbers is compared with n-1 interval thresholds to determine the index of the interval in which the real-time value of the weighted sum of the flipped numbers is located, wherein the index of the interval is set to increase sequentially based on the n intervals arranged in descending order; Set the sequence number of the interval to the gear position.

6. The method according to claim 1, characterized in that, Based on the flip weight and the real-time flip count, the real-time value of the weighted sum of flip counts for each data transmission node is determined, including: Based on the aforementioned flip weight, the real-time flip count of the corresponding data transmission node is logically shifted to the left. The real-time flip numbers after logical left shift are summed to obtain the real-time value of the weighted sum of the flip numbers.

7. The method according to claim 1, characterized in that, Compensating the power consumption value determined based on the gear level to the power supply of the first computing unit includes: Based on the clock signal of the computing module, a power consumption value determined based on the gear is generated on the side away from the second computing unit; The power consumption value is compensated to the power supply of the first computing unit.

8. The method according to any one of claims 1-2 and 6-7, characterized in that, The method further includes: Within the same clock cycle of the computing module, the real-time toggle count of each data transmission node of the computing module is counted, the real-time value of the weighted sum of the toggle counts of each data transmission node is determined, the real-time value of the weighted sum of the toggle counts is compared with the interval threshold, and the power consumption value determined based on the level is compensated to the power supply of the first computing unit.

9. A power consumption compensation device for AI chips, characterized in that, The device includes: The weight configuration module is configured to configure flip weights for each data transmission node of the computing module located in the AI ​​chip. The computing module includes a first computing unit and a second computing unit. The data transmission nodes transmit computation data to the first computing unit and the second computing unit. In the same time period, the total number of flips of each data transmission node of the first computing unit is greater than the total number of flips of each data transmission node of the second computing unit. The number of flips is the number of bits that the data transmission node flips between adjacent clock cycles of the computing module. The weighted sum maximum value determination module is configured to determine the maximum value of the weighted sum of the flip numbers of each data transmission node based on the flip weight and maximum flip number of each data transmission node in the calculation module. The interval threshold determination module is configured to determine n-1 interval thresholds based on the maximum value of the weighted sum of the flip numbers, where n is a natural number greater than or equal to 2; The real-time flip count statistics module is configured to count the real-time flip count of each data transmission node of the calculation module. The weighted sum real-time value determination module is configured to determine the real-time value of the weighted sum of the flip counts of each data transmission node based on the flip weights and the real-time flip counts. The gear position determination module is configured to compare the real-time value of the weighted sum of the flip numbers with the interval threshold to determine the gear position of the real-time value of the weighted sum of the flip numbers, wherein the interval in which the real-time value of the weighted sum of the flip numbers is located corresponds one-to-one with the gear position, and the real-time value of the weighted sum of the flip numbers is inversely proportional to the size of the gear position. A power consumption compensation module is configured to compensate the power consumption value determined based on the gear level to the power supply of the first computing unit, wherein the size of the gear level is proportional to the power consumption value.

10. A computer device, characterized in that, The computer device includes: At least one processor; A memory having a computer program stored thereon, wherein, when executed by the at least one processor, the computer program causes the at least one processor to perform the method of any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the method of any one of claims 1-8.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, causes the processor to perform the method of any one of claims 1-8.