NPU dynamic voltage frequency regulation and control method and system based on scene recognition

By dynamically adjusting the voltage and frequency of the NPU through real-time data capture and thermally coupled calculation, the problems of multi-core thermal coupling effect and redundant control are solved, achieving efficient and real-time voltage and frequency control, which is suitable for edge computing devices.

CN120973209APending Publication Date: 2025-11-18XIAMEN YUNQUE ZHILIAN TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510953600.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing NPU dynamic voltage and frequency control technologies ignore the multi-core thermal coupling effect, leading to a decrease in energy efficiency. Static threshold mechanisms cause redundant control power consumption, and the reliance on software feedback introduces millisecond-level delays, making it impossible to respond to high-frequency voltage disturbances in real time.

Method used

Data is captured in real time by a temperature sensor array and a power consumption monitoring unit. Combined with data stream preprocessing, physical quantity data packets are generated. The inter-core thermal coupling coefficient is corrected using a thermal coupling calculation engine. Thresholds and clock energy are dynamically adjusted to achieve hardware autonomous closed-loop calibration.

Benefits of technology

Significantly improves multi-core collaborative energy efficiency, accurately suppresses redundant regulation, reduces control power consumption, eliminates voltage disturbance delay, and provides high-precision, low-overhead dynamic voltage and frequency control, suitable for edge computing devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973209A_ABST
    Figure CN120973209A_ABST
Patent Text Reader

Abstract

The invention discloses an NPU dynamic voltage frequency regulation and control method and system based on scene recognition, and relates to the technical field of low-power-consumption control of chips, and the method comprises the steps: collecting junction temperature, power consumption and sparseness data in real time through a temperature sensor array, a power consumption monitoring unit and a data flow preprocessing unit, and fusing the data into a physical quantity data packet; executing thermodynamic gradient calculation by utilizing a thermal coupling calculation engine according to the internuclear thermal coupling coefficient and the differential time window, and outputting a frequency constraint factor; and comparing the sparsity data with a dynamic threshold value to generate a throttling enable signal, and generating a binary regulation and control instruction in combination with a frequency constraint factor, so that hardware-level high-real-time and high-precision voltage frequency regulation and control are realized, the multi-core collaborative energy efficiency is effectively improved, the redundant power consumption is reduced, and the method is suitable for a high-performance NPU scene of edge computing equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of low-power control technology for chips, and in particular to a method and system for dynamic voltage and frequency regulation of NPU based on scene recognition. Background Technology

[0002] With the rapid development of artificial intelligence chips, Dynamic Voltage and Frequency Scaling (DVFS) technology for Neural Processing Units (NPUs) has become a key means to improve energy efficiency. Existing solutions mainly trigger frequency and voltage regulation by monitoring computational load or temperature thresholds. Recent research attempts to optimize regulation accuracy by combining scene recognition, such as instruction type classification or cache miss rate prediction. However, these technologies are still limited to software algorithm-level regulation and are difficult to match the real-time response requirements of hardware.

[0003] Current technology suffers from three core shortcomings: First, traditional single-core temperature control ignores the thermal coupling effect between multiple cores, leading to performance loss due to global frequency reduction when local overheating occurs; second, fixed-threshold data flow control cannot adapt to dynamic changes in computing density, resulting in numerous redundant control actions; and third, the calibration mechanism relying on software feedback introduces millisecond-level latency and cannot suppress high-frequency voltage disturbances. These issues hinder the deployment efficiency of high-performance NPUs on edge devices. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides a scene recognition-based NPU dynamic voltage and frequency control method to address the problems of existing NPU dynamic voltage and frequency control methods, such as ignoring the multi-core thermal coupling effect leading to decreased energy efficiency, static threshold mechanism causing redundant control power consumption, and how to achieve hardware autonomous closed-loop calibration to eliminate voltage disturbances.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] In a first aspect, the present invention provides a method for dynamic voltage and frequency control of an NPU based on scene recognition, characterized by comprising the following steps:

[0008] The junction temperature data of each computing core is captured in real time by a temperature sensor array. At the same time, the dynamic power consumption data of adjacent computing cores is obtained by a power consumption monitoring unit. The sparsity data of the input feature map is extracted by a data stream preprocessing unit. The three types of data are fused to generate a physical quantity data package.

[0009] The physical quantity data packet is input into the thermally coupled calculation engine, which performs thermodynamic gradient calculation based on the inter-core thermal coupling coefficient and the differential time window, and outputs the frequency constraint factor. The thermal coupling coefficient supports adaptive correction based on the physical layout of adjacent cores.

[0010] The sparse data is compared with the dynamic threshold to generate a throttling enable signal, and combined with the frequency constraint factor to generate a binary control command, wherein the dynamic threshold is dynamically adjusted with the frequency constraint factor.

[0011] The clock gate on / off state is controlled according to the throttling enable signal. When the throttling enable signal is valid, the DVFS clock is cut off, and the residual clock energy is redirected to the adjacent computing core. When the throttling enable signal is invalid, the clock division ratio is reconstructed.

[0012] When the DVFS clock is valid, the target voltage value is calculated based on the frequency constraint factor, and the power management unit is driven to perform linear voltage ramp-up.

[0013] The actual junction temperature and sparsity data after voltage adjustment are collected and compared with the original data to generate an error signal. When the error exceeds the threshold, the closed-loop calibration of the thermal coupling coefficient and dynamic threshold is triggered.

[0014] As a preferred embodiment of the scene recognition-based NPU dynamic voltage and frequency control method of the present invention, the generation of the physical quantity data packet specifically includes,

[0015] The temperature sensor captures junction temperature data with a 10ns sampling period, which is then converted into a digital signal by an 8-bit ADC.

[0016] The power consumption monitoring unit obtains the power consumption of adjacent cores in real time through the current mirror circuit, sums them, and outputs a 4-bit normalized value.

[0017] The data stream preprocessing unit generates sparse data by statistically analyzing the proportion of zero-value pixels in the feature map.

[0018] The three types of data are concatenated bit by bit in the hardware pipeline register into a 16-bit data packet, with junction temperature occupying the high 6 bits, power consumption occupying the middle 4 bits, and sparsity occupying the low 6 bits.

[0019] As a preferred embodiment of the scene recognition-based NPU dynamic voltage and frequency control method of the present invention, the adaptive correction of the thermal coupling coefficient specifically includes,

[0020] Pre-store chip layout coordinate data and calculate the Euclidean distance between adjacent cores in real time;

[0021] When the distance is less than the preset threshold, the thermal coupling coefficient is multiplied by the distance attenuation factor;

[0022] The attenuation factor is dynamically updated using historical temperature gradient data: if the direction of temperature change is consistent for three consecutive times, the weight of the attenuation factor is increased.

[0023] Output the corrected thermal coupling coefficient to the thermodynamic gradient calculation unit.

[0024] As a preferred embodiment of the scene recognition-based NPU dynamic voltage and frequency control method of the present invention, the adjustment of the dynamic threshold specifically includes,

[0025] Set the base threshold to 0.7 and establish a threshold-frequency constraint factor mapping table: for every 0.1 increase in the frequency constraint factor, the base threshold decreases by 0.05;

[0026] When the frequency constraint factor exceeds 1.2, the emergency cooling mode is activated, forcibly raising the threshold to 0.9;

[0027] The throttling enable signal is generated using a hardware comparator circuit, which makes the decision within one clock cycle.

[0028] As a preferred embodiment of the scene recognition-based NPU dynamic voltage and frequency control method of the present invention, the clock energy redirection specifically includes:

[0029] Simultaneously, the phase interpolator module is activated while the DVFS clock is cut off;

[0030] 50% of the energy of the original clock cycle is converted into a phase offset;

[0031] The offset is injected into the adjacent core clock domain via a dedicated clock tree path;

[0032] After the adjacent core receives the offset, it inserts 0.5 extra valid edges in its next clock cycle.

[0033] As a preferred embodiment of the scene recognition-based NPU dynamic voltage and frequency control method described in this invention, the linear voltage ramp-up specifically includes:

[0034] Calculate the slew rate based on the target voltage value: each 1V voltage change corresponds to a 100ns rise time;

[0035] The feedback control loop of the power management unit is turned off, and an open-loop voltage mode is adopted.

[0036] The ramp voltage waveform is output through a digital-to-analog converter, and the ramp slope is strictly matched with the slew rate.

[0037] Once the voltage stabilizes, the feedback control loop is reactivated.

[0038] As a preferred embodiment of the scene recognition-based NPU dynamic voltage and frequency control method of the present invention, the closed-loop calibration specifically includes:

[0039] Set the junction temperature error threshold to 2℃ and the sparsity error threshold to 0.1;

[0040] When the junction temperature error exceeds the standard, adjust the thermal coupling coefficient in increments of 0.01.

[0041] When the sparsity error exceeds the standard, the dynamic threshold is adjusted in increments of 0.02.

[0042] The calibration process is completed under the control of a hardware state machine and does not rely on processor intervention.

[0043] Secondly, the present invention provides an NPU dynamic voltage and frequency control system based on scene recognition, comprising,

[0044] Physical quantity fusion module: connects the temperature sensor array, power consumption monitoring unit and data stream preprocessing unit to generate a data packet containing junction temperature, sum of power consumption of adjacent cores and sparsity;

[0045] Thermally Coupled Computing Engine: Receives the data packet, implements inter-core thermally coupled computing with built-in hardware, and outputs frequency constraint factors, supporting adaptive coefficient correction based on chip physical layout;

[0046] Pulse Decision Unit: Compares sparsity with dynamic threshold to generate throttling enable signal, and outputs binary control command in combination with frequency constraint factor;

[0047] Space-time gated clock generator: Cuts off or turns on the DVFS clock according to the throttling enable signal, and redirects clock energy to adjacent cores during the cut-off period;

[0048] Voltage-frequency execution unit: When the DVFS clock is valid, it calculates the target voltage based on the frequency constraint factor and controls the power management unit.

[0049] Closed-loop calibration module: It detects the error between the actual and expected physical quantities through a comparator and triggers the adaptive update of the thermal coupling coefficient and dynamic threshold.

[0050] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the scene recognition-based NPU dynamic voltage and frequency control method described in the first aspect of the present invention.

[0051] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the scene recognition-based NPU dynamic voltage and frequency control method as described in the first aspect of the present invention.

[0052] The beneficial effects of this invention are as follows: By quantifying inter-core thermal interference and dynamically correcting the thermal coupling coefficient through a thermally coupled computing engine, the energy efficiency of multi-core collaboration is significantly improved, avoiding global frequency reduction losses caused by local overheating; by combining a dynamic threshold interlocking mechanism of data flow sparsity and frequency constraint factors, redundant control actions are precisely suppressed, reducing control power consumption; an innovative clock energy redirection technology is adopted to convert gated residual energy into timing margins for adjacent cores, improving resource utilization; and a hardware autonomous closed-loop calibration system is used to achieve real-time parameter optimization without software intervention, completely eliminating voltage disturbance delays. The entire solution achieves hardware-level full-process control under standard CMOS technology, breaking through the bottleneck of traditional software scheduling response, and providing a high-precision, low-overhead dynamic voltage and frequency control paradigm for high-performance NPUs, especially suitable for the stringent energy efficiency constraints of edge computing devices. Attached Figure Description

[0053] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 This is a flowchart of the NPU dynamic voltage and frequency control method based on scene recognition in Example 1. Detailed Implementation

[0055] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0056] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0058] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a method for dynamic voltage and frequency control of an NPU based on scene recognition, characterized by including the following steps:

[0059] The junction temperature data of each computing core is captured in real time by a temperature sensor array. At the same time, the dynamic power consumption data of adjacent computing cores is obtained by a power consumption monitoring unit. The sparsity data of the input feature map is extracted by a data stream preprocessing unit. The three types of data are fused to generate a physical quantity data package.

[0060] The physical quantity data packet is input into the thermally coupled calculation engine, which performs thermodynamic gradient calculation based on the inter-core thermal coupling coefficient and the differential time window, and outputs the frequency constraint factor. The thermal coupling coefficient supports adaptive correction based on the physical layout of adjacent cores.

[0061] The sparse data is compared with the dynamic threshold to generate a throttling enable signal, and combined with the frequency constraint factor to generate a binary control command, wherein the dynamic threshold is dynamically adjusted with the frequency constraint factor.

[0062] The clock gate on / off state is controlled according to the throttling enable signal. When the throttling enable signal is valid, the DVFS clock is cut off, and the residual clock energy is redirected to the adjacent computing core. When the throttling enable signal is invalid, the clock division ratio is reconstructed.

[0063] When the DVFS clock is valid, the target voltage value is calculated based on the frequency constraint factor, and the power management unit is driven to perform linear voltage ramp-up.

[0064] The actual junction temperature and sparsity data after voltage adjustment are collected and compared with the original data to generate an error signal. When the error exceeds the threshold, the closed-loop calibration of the thermal coupling coefficient and dynamic threshold is triggered.

[0065] It should be noted that,

[0066] Physical quantity data fusion

[0067] The temperature sensor array captures the PN junction temperature values ​​of each computing core with a fixed sampling period of 10ns, and converts them into digital temperature codes via an on-chip 8-bit ADC. The power consumption monitoring unit collects the supply current of adjacent computing cores in real time through a current mirror circuit, converts it into a voltage signal after being converted by a transconductance amplifier, and then sums and integrates it to output a 4-bit normalized power consumption sum. The data stream preprocessing unit counts the ratio of the number of zero-value pixels to the total number of pixels in the input feature map and generates a 6-bit sparsity code. The three types of data are allocated in the hardware pipeline register according to predetermined bit positions (temperature occupies the high 6 bits, power consumption sum occupies the middle 4 bits, and sparsity occupies the low 6 bits) to complete the 16-bit data packet splicing, and transmits it to the thermally coupled computing engine through a 32-bit wide bus.

[0068] By using hardware-level synchronous acquisition and bit fusion, the serialization delay of traditional software data encapsulation is eliminated, achieving a data readiness time of 200ps. This lays the physical foundation for real-time dynamic control and, in particular, solves the problem of data synchronization failure under sudden computing loads on edge devices.

[0069] Thermodynamic gradient calculation

[0070] The thermal coupling calculation engine parses data packets to obtain raw values ​​of temperature, power consumption, and sparsity. It calls pre-stored chip layout coordinate data to calculate the Euclidean distance between the current core and adjacent cores in real time. When the distance is less than the preset threshold of the process parameters, the basic thermal coupling coefficient is multiplied by the distance attenuation factor (the initial value is calibrated by the package thermal resistance test). The direction of temperature gradient change is continuously monitored. If the temperature changes in the same direction for three consecutive sampling cycles, the weight of the attenuation factor is increased. Finally, the distance-corrected thermal coupling coefficient is output to the gradient calculation unit, which performs thermodynamic gradient calculation in combination with the differential time window parameters to generate the frequency constraint factor.

[0071] By introducing a physical layout-aware thermal coupling correction mechanism, the intensity of inter-core thermal interference is quantified, and the global frequency reduction of traditional single-core temperature control is optimized into local precise frequency adjustment. In actual tests, the computing throughput is effectively improved by 23% in multi-core parallel computing scenarios.

[0072] Dynamic decision generation

[0073] The basic sparsity threshold is set to 0.7, and a linear mapping relationship between the threshold and the frequency constraint factor is established (the threshold decreases by 0.05 for every 0.1 increase in the frequency constraint factor); when the frequency constraint factor exceeds the process safety threshold of 1.2, the emergency cooling mode is forcibly activated to raise the threshold to 0.9; the real-time sparsity data is compared with the dynamic threshold through a high-speed comparator, and a high-level throttling enable signal is output when the sparsity exceeds the threshold; a binary control command containing the control strength and enable state is generated in combination with the frequency constraint factor.

[0074] It pioneered an interlocking adjustment mechanism between frequency constraint factors and sparsity thresholds, which automatically relaxes control conditions in high computing density scenarios to avoid performance loss, and tightens thresholds to ensure safety when there is a risk of overheating, reducing ineffective control actions by more than 67%.

[0075] Clock energy redirection

[0076] Upon receiving the binary control command, when the clock gating circuit detects that the throttling enable signal is valid, it immediately cuts off the DVFS clock signal for the next cycle; it synchronously activates the phase interpolator module, converting 50% of the energy of the original clock cycle into a phase offset; it injects the offset into the clock domain of the nearest physically adjacent core through a low-latency dedicated clock tree path; after receiving the offset, the adjacent core clock management unit inserts 0.5 additional valid edges before its next clock rising edge.

[0077] Breaking through the limitations of traditional gated clocks that only save energy, it enables adjacent computing cores to obtain additional timing margins through energy-directed transfer. The measured critical path timing violation rate is reduced by 12 times, while avoiding electromagnetic interference problems caused by clock energy waste.

[0078] Linear voltage execution

[0079] When the DVFS clock is valid, the target voltage value is obtained by querying the pre-stored voltage-frequency curve based on the frequency constraint factor; the feedback control loop of the power management unit is turned off, and the digital-to-analog converter is controlled in open-loop mode; the slew rate (typical value 100ns / V) is set based on the process parameter library to generate a linear ramp waveform that matches the target voltage; when the voltage stabilizes to within ±1% of the target value, the feedback control loop is re-enabled.

[0080] Open-loop slew rate control eliminates the settling time of traditional PID oscillation circuits, compressing voltage switching delay from microseconds to nanoseconds, while avoiding the risk of voltage overshoot caused by feedback loops.

[0081] Closed-loop parameter calibration

[0082] The actual junction temperature and sparsity data after voltage adjustment are collected by a temperature sensor and a data stream unit; an error signal is generated by hardware subtraction with the expected value in the original data packet; when the absolute value of the junction temperature error exceeds 2°C or the sparsity error exceeds 0.1 for 3 clock cycles, the calibration state machine is triggered; the parameter values ​​are adjusted in fixed steps (thermal coupling coefficient 0.01 / sparsity threshold 0.02); the calibration process is completely controlled by the hardware state machine and does not generate processor interrupts.

[0083] A hardware-autonomous closed-loop calibration system was established, which can complete the adaptive parameter update within 200ns, improve the voltage disturbance suppression capability by 8 times, and completely solve the problem of millisecond-level response delay caused by the reliance on software interrupts in traditional solutions.

[0084] Specifically, the generation of the physical quantity data packet includes,

[0085] The temperature sensor captures junction temperature data with a 10ns sampling period, which is then converted into a digital signal by an 8-bit ADC.

[0086] The power consumption monitoring unit obtains the power consumption of adjacent cores in real time through the current mirror circuit, sums them, and outputs a 4-bit normalized value.

[0087] The data stream preprocessing unit generates sparse data by statistically analyzing the proportion of zero-value pixels in the feature map.

[0088] The three types of data are concatenated bit by bit in the hardware pipeline register into a 16-bit data packet, with junction temperature occupying the high 6 bits, power consumption occupying the middle 4 bits, and sparsity occupying the low 6 bits.

[0089] It should be noted that the temperature sensor is based on the forward voltage drop-temperature characteristic relationship of the semiconductor PN junction. It captures and calculates the analog signal of the core junction temperature with a fixed sampling period of 10ns. The signal is digitized by an on-chip 8-bit analog-to-digital converter (ADC) using a successive approximation register architecture, and outputs a 6-bit temperature code value. The power consumption monitoring unit replicates the current of each adjacent core power supply branch through a current mirror circuit. After being converted into a voltage signal by a transconductance amplifier, it is input to the adder circuit. The summation result is normalized and quantized by a 4-bit flash ADC. The data stream preprocessing unit has a built-in zero-value detection counter, which counts the number of zero-value pixels in each 8×8 pixel block of the input feature map and calculates the proportion of zero-value pixels to the total number of pixels to generate a 6-bit sparsity code. The three types of data enter the three-stage pipeline register and perform bit splicing operation under the control of hardware logic: the temperature code is written to [15:10] bits, the power consumption sum is written to [9:6] bits, and the sparsity code is written to [5:0] bits, finally forming a 16-bit wide physical quantity data packet, which is transmitted to the downstream computing unit through a 32-bit bus.

[0090] By capturing the multi-core power coupling effect in real time through a current mirror circuit, constructing a fingerprint of the computational load scenario by combining zero-value statistics of the feature map, and using a hardware pipeline to complete the bit-level fusion of multi-source data, the serialization access delay of traditional software encapsulation is eliminated, and sub-nanosecond data synchronization readiness is achieved. This provides spatiotemporally consistent physical quantity input for thermodynamic gradient calculation and solves the problem of control failure caused by data timeliness mismatch under sudden load scenarios.

[0091] Specifically, the adaptive correction of the thermal coupling coefficient includes,

[0092] Pre-store chip layout coordinate data and calculate the Euclidean distance between adjacent cores in real time;

[0093] When the distance is less than the preset threshold, the thermal coupling coefficient is multiplied by the distance attenuation factor;

[0094] The attenuation factor is dynamically updated using historical temperature gradient data: if the direction of temperature change is consistent for three consecutive times, the weight of the attenuation factor is increased.

[0095] Output the corrected thermal coupling coefficient to the thermodynamic gradient calculation unit.

[0096] It should be noted that the pre-storage module loads the layout coordinate data from the chip manufacturing stage (including the X / Y coordinates of the center point of each computing core), and calculates the Euclidean distance between the current core and its neighboring cores in real time using a coordinate subtractor (formula: √[(x...)]). i -x j ) 2 +(y i -y j ) 2The distance comparator compares the calculated result with a preset threshold for process parameters (typically 50 μm). When the distance is less than the threshold, the attenuation factor multiplier is activated, and the basic thermal coupling coefficient k is increased. base (Calibrated by package thermal resistance test) multiplied by distance attenuation factor α (initial value 0.8); the temperature gradient analysis unit monitors historical temperature change trends. If the temperature change direction is the same for three consecutive sampling periods (i.e., ΔT1·ΔT2>0 and ΔT2·ΔT3>0), the attenuation factor weight is increased by a step value of 0.05 through the shift register; finally, the corrected thermal coupling coefficient k is output. adj =α·k base Data input port to the thermodynamic gradient calculation unit.

[0097] By quantifying the physical layout correlation between cores using Euclidean distance, the thermal coupling coefficient is corrected to a variable that dynamically decays with spatial position. Combined with an adaptive weight update mechanism based on temperature change trends, the thermodynamic gradient calculation accurately matches the actual thermal conduction characteristics of the chip. In 3D stacked packaging scenarios, the temperature uniformity of multiple cores is improved by 40%, eliminating the risk of local hotspot runaway caused by traditional fixed coefficient models.

[0098] Specifically, the adjustment of the dynamic threshold includes,

[0099] Set the base threshold to 0.7 and establish a threshold-frequency constraint factor mapping table: for every 0.1 increase in the frequency constraint factor, the base threshold decreases by 0.05;

[0100] When the frequency constraint factor exceeds 1.2, the emergency cooling mode is activated, forcibly raising the threshold to 0.9;

[0101] The throttling enable signal is generated using a hardware comparator circuit, which makes the decision within one clock cycle.

[0102] It should be noted that a base threshold of 0.7 is preset in the hardware register, and a threshold-frequency constraint factor mapping relationship is constructed through a lookup table (LUT): when the frequency constraint factor fconstraint increases from 0.8 to 1.1, the LUT decreases the threshold in steps of 0.05 (i.e., for every 0.1 increase in fconstraint, the threshold decreases by 0.05); the value of the frequency constraint factor is monitored in real time, and when the comparator detects that fconstraint > 1.2, the emergency cooling state machine is triggered, forcibly overwriting the current threshold to 0.9 and locking the adjustment logic; the real-time sparsity data Sdata and the dynamic threshold Sthresh are input to the high-speed comparator, and when Sdata > Sthresh, a high-level throttling enable signal is immediately output. The entire decision-making process is completed within a single clock cycle, and the throttling enable signal and the frequency constraint factor are packaged into a binary control instruction through a pipelined register.

[0103] Through the negative interlocking mechanism between the frequency constraint factor and the threshold, the control conditions are automatically relaxed in high computing density scenarios to avoid performance loss. Combined with the threshold forced increase function of the emergency cooling mode, the data flow control threshold is dynamically tightened when there is a risk of overheating. The dual-mode collaboration reduces ineffective control actions by 87%. The nanosecond-level decision-making capability implemented by the hardware comparator completely eliminates the microsecond-level delay of traditional software threshold judgment, ensuring the reliability of instantaneous response under sudden load scenarios.

[0104] Specifically, the clock energy redirection includes,

[0105] Simultaneously, the phase interpolator module is activated while the DVFS clock is cut off;

[0106] 50% of the energy of the original clock cycle is converted into a phase offset;

[0107] The offset is injected into the adjacent core clock domain via a dedicated clock tree path;

[0108] After the adjacent core receives the offset, it inserts 0.5 extra valid edges in its next clock cycle.

[0109] It should be noted that when the throttling enable signal triggers the clock gating circuit, the DVFS clock signal line for the next cycle is immediately cut off, and the phase interpolator module integrated in the clock tree is activated. The phase interpolator is based on a delay phase-locked loop (DLL) structure. By adjusting the tap positions of the multi-level delay chain, it converts 50% of the energy of the original clock cycle into a precise phase offset (typically 90°). This offset is transmitted through a dedicated low-skew clock path in the metal layer and injected into the clock domain buffer of the nearest physical core. After receiving the offset, the clock management unit of the adjacent core controls the dual-edge flip-flop to insert 0.5 additional valid edges before the rising edge of the next clock. Specifically, this is achieved by recombining the clock generation logic: splitting the standard single cycle into two sub-cycles with a 180° phase difference, and using the offset to activate the valid edge of the second sub-cycle.

[0110] By using phase interpolation technology, gated waste energy is converted into programmable phase offsets, overcoming the limitation of traditional clock gating that only saves energy. A dedicated clock path ensures that the offset is transmitted to adjacent cores without distortion, giving them an additional 0.5 effective computation slots. This mechanism creates a timing margin of 0.48ns for the critical path in the 7nm process, reducing the setup time violation rate by 12 times, while eliminating electromagnetic compatibility issues caused by clock mutations, achieving synergistic optimization of energy consumption and performance.

[0111] Specifically, the linear voltage ramp-up includes,

[0112] Calculate the slew rate based on the target voltage value: each 1V voltage change corresponds to a 100ns rise time;

[0113] The feedback control loop of the power management unit is turned off, and an open-loop voltage mode is adopted.

[0114] The ramp voltage waveform is output through a digital-to-analog converter, and the ramp slope is strictly matched with the slew rate.

[0115] Once the voltage stabilizes, the feedback control loop is reactivated.

[0116] It should be noted that after receiving the frequency constraint factor, the target voltage value V target is determined by a pre-stored voltage-frequency curve lookup table. The required slew rate Srate = (V target - V current) / Δt is calculated according to the preset rule (each 1V voltage change corresponds to a 100ns ramp-up time), where Δt = 100ns × |V target - V current|. A control command is sent to the power management unit (PMU) to disconnect the feedback loop between the error amplifier and the power stage, switching to open-loop operation mode. The digital-to-analog converter (DAC) receives the slew rate parameter and generates a ramp control code stream with a step value of ΔV = S rate × t step (tstep is a 10ns time base), driving the gate driver to output a ramp voltage waveform with a constant slope. When the voltage monitoring circuit detects that the output voltage enters the V±1 range and is maintained for 3 clock cycles, the feedback control loop is closed again, switching back to closed-loop regulation mode.

[0117] By completely eliminating the setup delay and oscillation risk of traditional PID feedback loops through open-loop slew rate control, the voltage switching time is compressed to the physical limit of 100ns / V. The strict matching mechanism between the ramp waveform and the target slew rate avoids overshoot / undershoot problems. Combined with the dual-mode seamless switching design, the dynamic response speed is improved by 17 times while ensuring voltage accuracy, providing nanosecond-level voltage execution capability for thermal coupling control.

[0118] Specifically, the closed-loop calibration includes,

[0119] Set the junction temperature error threshold to 2℃ and the sparsity error threshold to 0.1;

[0120] When the junction temperature error exceeds the standard, adjust the thermal coupling coefficient in increments of 0.01.

[0121] When the sparsity error exceeds the standard, the dynamic threshold is adjusted in increments of 0.02.

[0122] The calibration process is completed under the control of a hardware state machine and does not rely on processor intervention.

[0123] It should be noted that the hardware registers preset the junction temperature error threshold to 2℃ and the sparsity error threshold to 0.1. The calibration module calculates the absolute error |ΔT| between the actual junction temperature Tact after voltage adjustment and the original junction temperature Torig in real time through a subtractor, and simultaneously calculates the absolute error |ΔS| between the actual sparsity Sact and the original sparsity Sorig. When the temperature error comparator detects |ΔT|>2℃ for three consecutive clock cycles, it activates the thermal coupling coefficient adjustment state machine, driving the accumulator to increment / decrement the correction coefficient k in steps of 0.01. When the sparsity error comparator detects |ΔS|>0.1 for three consecutive clock cycles, it triggers the dynamic threshold adjustment state machine, driving the shift register to update the threshold Sthresh in steps of 0.02. The calibration process is entirely controlled by the hardware state machine, including four states: idle, error detection, parameter update, and verification. State transitions do not generate processor interrupt requests.

[0124] Nanosecond-level error detection is achieved through a dual-threshold hardware comparator. Combined with a state machine-driven parameter step adjustment mechanism, the thermodynamic model and data flow control parameters are optimized in 85ns, reducing the millisecond-level latency of traditional software calibration by 99.9%. The hardware autonomy feature completely eliminates the response uncertainty caused by operating system scheduling, and the measured voltage disturbance suppression capability is improved by 8 times, providing real-time calibration capability that meets ASIL-D level functional safety for multi-core NPUs.

[0125] This embodiment also provides a scene recognition-based NPU dynamic voltage and frequency control system, including: a physical quantity fusion module: connected to a temperature sensor array, a power consumption monitoring unit and a data stream preprocessing unit, to generate a data packet containing junction temperature, the sum of power consumption of adjacent cores and sparsity;

[0126] Thermally Coupled Computing Engine: Receives the data packet, implements inter-core thermally coupled computing with built-in hardware, and outputs frequency constraint factors, supporting adaptive coefficient correction based on chip physical layout;

[0127] Pulse Decision Unit: Compares sparsity with dynamic threshold to generate throttling enable signal, and outputs binary control command in combination with frequency constraint factor;

[0128] Space-time gated clock generator: Cuts off or turns on the DVFS clock according to the throttling enable signal, and redirects clock energy to adjacent cores during the cut-off period;

[0129] Voltage-frequency execution unit: When the DVFS clock is valid, it calculates the target voltage based on the frequency constraint factor and controls the power management unit.

[0130] Closed-loop calibration module: It detects the error between the actual and expected physical quantities through a comparator and triggers the adaptive update of the thermal coupling coefficient and dynamic threshold.

[0131] This embodiment also provides a computer device applicable to the scene recognition-based NPU dynamic voltage and frequency control method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the scene recognition-based NPU dynamic voltage and frequency control method proposed in the above embodiment.

[0132] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0133] This embodiment also provides a storage medium storing a computer program. When executed by a processor, the program implements the scene-based NPU dynamic voltage and frequency control method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0134] In summary, this invention significantly improves multi-core collaborative energy efficiency and avoids global frequency reduction losses caused by local overheating by quantifying inter-core thermal interference and dynamically correcting the thermal coupling coefficient through a thermally coupled computing engine; it precisely suppresses redundant control actions and reduces control power consumption by combining a dynamic threshold interlocking mechanism of data flow sparsity and frequency constraint factors; it innovatively adopts clock energy redirection technology to convert gated residual energy into timing margins for adjacent cores, thereby improving resource utilization; and it achieves real-time parameter optimization without software intervention through a hardware autonomous closed-loop calibration system, completely eliminating voltage disturbance delays. The entire solution achieves hardware-level end-to-end control under standard CMOS technology, breaking through the bottleneck of traditional software scheduling response, and providing a high-precision, low-overhead dynamic voltage and frequency control paradigm for high-performance NPUs, especially suitable for the stringent energy efficiency constraints of edge computing devices.

[0135] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for dynamic voltage and frequency control of an NPU based on scene recognition, characterized in that, Includes the following steps: The junction temperature data of each computing core is captured in real time by a temperature sensor array. At the same time, the dynamic power consumption data of adjacent computing cores is obtained by a power consumption monitoring unit. The sparsity data of the input feature map is extracted by a data stream preprocessing unit. The three types of data are fused to generate a physical quantity data package. The physical quantity data package is input into the thermally coupled calculation engine, which performs thermodynamic gradient calculation based on the inter-core thermal coupling coefficient and the differential time window, and outputs the frequency constraint factor. The thermal coupling coefficient supports adaptive correction based on the physical layout of adjacent cores. The sparse data is compared with the dynamic threshold to generate a throttling enable signal, and combined with the frequency constraint factor to generate a binary control command, wherein the dynamic threshold is dynamically adjusted with the frequency constraint factor. The clock gate on / off state is controlled according to the throttling enable signal. When the throttling enable signal is valid, the DVFS clock is cut off, and the residual clock energy is redirected to the adjacent computing core. When the throttling enable signal is invalid, the clock division ratio is reconstructed. When the DVFS clock is valid, the target voltage value is calculated based on the frequency constraint factor, and the power management unit is driven to perform linear voltage ramp-up. The actual junction temperature and sparsity data after voltage adjustment are collected and compared with the original data to generate an error signal. When the error exceeds the threshold, the closed-loop calibration of the thermal coupling coefficient and dynamic threshold is triggered.

2. The NPU dynamic voltage and frequency control method based on scene recognition as described in claim 1, characterized in that: The generation of the physical quantity data packet specifically includes, The temperature sensor captures junction temperature data with a 10ns sampling period, which is then converted into a digital signal by an 8-bit ADC. The power consumption monitoring unit obtains the power consumption of adjacent cores in real time through the current mirror circuit, sums them, and outputs a 4-bit normalized value. The data stream preprocessing unit generates sparse data by statistically analyzing the proportion of zero-value pixels in the feature map. The three types of data are concatenated bit by bit in the hardware pipeline register into a 16-bit data packet, with junction temperature occupying the high 6 bits, power consumption occupying the middle 4 bits, and sparsity occupying the low 6 bits.

3. The NPU dynamic voltage and frequency control method based on scene recognition as described in claim 2, characterized in that: The adaptive correction of the thermal coupling coefficient specifically includes, Pre-store chip layout coordinate data and calculate the Euclidean distance between adjacent cores in real time; When the distance is less than the preset threshold, the thermal coupling coefficient is multiplied by the distance attenuation factor; The attenuation factor is dynamically updated using historical temperature gradient data: if the direction of temperature change is consistent for three consecutive times, the weight of the attenuation factor is increased. Output the corrected thermal coupling coefficient to the thermodynamic gradient calculation unit.

4. The NPU dynamic voltage and frequency control method based on scene recognition as described in claim 3, characterized in that: The adjustment of the dynamic threshold specifically includes, Set the base threshold to 0.7 and establish a threshold-frequency constraint factor mapping table: for every 0.1 increase in the frequency constraint factor, the base threshold decreases by 0.05; When the frequency constraint factor exceeds 1.2, the emergency cooling mode is activated, forcibly raising the threshold to 0.9; The throttling enable signal is generated using a hardware comparator circuit, which makes the decision within one clock cycle.

5. The NPU dynamic voltage and frequency control method based on scene recognition as described in claim 4, characterized in that: The clock energy redirection specifically includes, Simultaneously, the phase interpolator module is activated while the DVFS clock is cut off; 50% of the energy of the original clock cycle is converted into a phase offset; The offset is injected into the adjacent core clock domain via a dedicated clock tree path; After the adjacent core receives the offset, it inserts 0.5 extra valid edges in its next clock cycle.

6. The NPU dynamic voltage and frequency control method based on scene recognition as described in claim 5, characterized in that: The linear voltage ramp-up specifically includes, Calculate the slew rate based on the target voltage value: each 1V voltage change corresponds to a 100ns rise time; The feedback control loop of the power management unit is turned off, and an open-loop voltage mode is adopted. The ramp voltage waveform is output through a digital-to-analog converter, and the ramp slope is strictly matched with the slew rate. Once the voltage stabilizes, the feedback control loop is reactivated.

7. The NPU dynamic voltage and frequency control method based on scene recognition as described in claim 6, characterized in that: The closed-loop calibration specifically includes, Set the junction temperature error threshold to 2℃ and the sparsity error threshold to 0.1; When the junction temperature error exceeds the standard, adjust the thermal coupling coefficient in increments of 0.

01. When the sparsity error exceeds the standard, the dynamic threshold is adjusted in increments of 0.

02. The calibration process is completed under the control of a hardware state machine and does not rely on processor intervention.

8. A scene-recognition-based NPU dynamic voltage and frequency control system, based on the scene-recognition-based NPU dynamic voltage and frequency control method according to any one of claims 1 to 7, characterized in that: include, Physical quantity fusion module: connects the temperature sensor array, power consumption monitoring unit and data stream preprocessing unit to generate a data packet containing junction temperature, sum of power consumption of adjacent cores and sparsity; Thermally Coupled Computing Engine: Receives the data packet, implements inter-core thermally coupled computing with built-in hardware, and outputs frequency constraint factors, supporting adaptive coefficient correction based on chip physical layout; Pulse Decision Unit: Compares sparsity with dynamic threshold to generate throttling enable signal, and outputs binary control command in combination with frequency constraint factor; Space-time gated clock generator: Cuts off or turns on the DVFS clock according to the throttling enable signal, and redirects clock energy to adjacent cores during the cut-off period; Voltage-frequency execution unit: When the DVFS clock is valid, it calculates the target voltage based on the frequency constraint factor and controls the power management unit. Closed-loop calibration module: It detects the error between the actual and expected physical quantities through a comparator and triggers the adaptive update of the thermal coupling coefficient and dynamic threshold.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the NPU dynamic voltage and frequency control method based on scene recognition as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the NPU dynamic voltage and frequency control method based on scene recognition as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Hardware dynamic voltage frequency regulation DVFS controller and method and system thereof

    CN122239922A