An engine control device and method

By detecting source event information of the processing engine in the artificial intelligence chip, performing hierarchical risk assessment and parameter adjustment, the circuit stability problem caused by drastic current changes is solved, achieving efficient power management and reliable computing platform.

CN123114898APending Publication Date: 2026-11-17SMARTER SILICON (SHANGHAI) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611547208.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In artificial intelligence chips and high-performance computing circuits, when the processing engine rapidly switches its working state or the input data activity changes, it causes drastic changes in current, which can lead to voltage drops or overshoots in the internal power supply of the circuit, resulting in timing violations, logic errors, or even device damage, thus affecting circuit performance and operational reliability.

Method used

The detection circuit acquires source event information of the processing engine, assesses current change trends, uses a risk assessment circuit for hierarchical assessment to determine system-level risks, and the control circuit adjusts operating parameters to predict and proactively intervene in current changes to avoid drastic current fluctuations.

Benefits of technology

It enables accurate prediction of current change trends and system-level coordinated control, improves power integrity and computing platform reliability, reduces timing violations and device damage risks, and enhances system stability and computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114898A_ABST
    Figure CN123114898A_ABST
Patent Text Reader

Abstract

This application provides a processing engine control device and method. The device includes a detection circuit, a risk assessment circuit, and a control circuit. The detection circuit acquires source event information for each of the multiple processing engines, and the source event information characterizes the current change trend of the corresponding processing engine during operation within a predetermined time period. Based on the source event information of each of the multiple processing engines, the risk assessment circuit assesses the current change rate risk of each processing engine, obtains the engine-level risk assessment result for each processing engine, and determines the system-level risk assessment result based on the engine-level risk assessment results. Based on the system-level risk assessment result, the control circuit adjusts the operating parameters of the multiple processing engines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates primarily to the field of artificial intelligence technology, and more specifically to a processing engine control device and method. Background Technology

[0002] In artificial intelligence chips and high-performance computing circuits, the processing engine, as the core computing unit, often faces severe transient current rate of change (di / dt) problems in actual operation. When the working state of the processing engine changes rapidly or the activity of input data changes drastically, it may cause drastic changes in current, resulting in voltage drops or overshoots in the internal power supply of the circuit. In severe cases, this can lead to timing violations, logic errors, or even device damage, thus restricting circuit performance and operational reliability.

[0003] Currently, analog circuits are commonly used to monitor transient current changes on the power rail in real time, and frequency or voltage adjustments are made immediately upon detecting a sudden current surge. However, this analog detection method relies on actual changes in physical quantities to trigger a response, which has an inherent delay and makes it difficult to effectively intervene before a drastic current jump occurs. Summary of the Invention

[0004] In view of the above, this application provides the following technical solution:

[0005] The first aspect of this application provides a processing engine control device, including:

[0006] The detection circuit is configured to acquire source event information for each of the multiple processing engines, the source event information representing the current change trend of the corresponding processing engine during operation within a predetermined time period in the future;

[0007] The risk assessment circuit, coupled to the detection circuit, is configured to assess the current change rate risk of each of the multiple processing engines based on the source event information of each of the multiple processing engines, and determine the system-level risk assessment result based on the obtained engine-level risk assessment results of each of the processing engines.

[0008] A control circuit, coupled to the risk assessment circuit and the plurality of processing engines, is configured to adjust the operating parameters of the plurality of processing engines based on the system-level risk assessment results.

[0009] The source event information includes at least one of the following:

[0010] The first state transition event that instructs the corresponding processing engine to switch from a full-load state to an idle state;

[0011] A second state transition event that instructs the corresponding processing engine to switch from an idle state to a full-load state;

[0012] A data flipping event that characterizes the degree of change in the input data flipping rate of the corresponding processing engine.

[0013] Optionally, the risk assessment circuit includes:

[0014] Multiple engine-level evaluation circuits are respectively associated with the multiple processing engines. Each engine-level evaluation circuit is configured to determine the risk contribution direction and risk contribution degree of the corresponding processing engine based on the source event information of the corresponding processing engine, and use it as the engine-level risk evaluation result of the processing engine.

[0015] A system-level evaluation circuit, coupled to each of the engine-level evaluation circuits, is configured to receive the risk assessment results of each of the engine-level circuits, and fuse the risk assessment results of each of the engine-level circuits according to a preset fusion method to obtain a system-level risk assessment result.

[0016] Optionally, the engine-level evaluation circuit includes:

[0017] The first selection circuit is configured to output a first value or a data flip score based on a first state switching event in the source event information, wherein the data flip score is determined based on the data flip event in the source event information.

[0018] The second selection circuit, coupled to the first selection circuit, is configured to output a second value or the output of the first selection circuit based on a second state switching event in the source event information, to determine the engine-level risk assessment result.

[0019] Optionally, the system-level evaluation circuit includes:

[0020] The fusion circuit, coupled to the plurality of engine-level evaluation circuits respectively, is configured to receive the risk assessment results of each engine-level risk assessment and fuse them to obtain a system-level evaluation result.

[0021] The decision output circuit, coupled to the fusion circuit, is configured to determine the corresponding operating parameter adjustment strategy based on the preset risk range to which the system-level evaluation result belongs, and output a strategy signal characterizing the operating parameter adjustment strategy.

[0022] The control circuit is configured to receive the strategy signal and adjust the operating parameters of the plurality of processing engines based on the operating parameter adjustment strategy.

[0023] The working parameter adjustment strategies differ for different preset risk ranges.

[0024] Optionally, the operating parameters include at least one of clock parameters and supply voltage;

[0025] The control circuit includes at least one of the following:

[0026] The clock control circuit is configured to adjust the clock parameters of the plurality of processing engines based on the system-level risk assessment results;

[0027] A voltage control circuit is configured to adjust the power supply voltage supplied to the plurality of processing engines based on the results of the system-level risk assessment.

[0028] A second aspect of this application provides a method for processing engine control, including:

[0029] Obtain source event information for each of the multiple processing engines, wherein the source event information characterizes the current change trend of the corresponding processing engine during operation within a predetermined time period in the future;

[0030] Based on the source event information of each of the multiple processing engines, the current change rate risk of each processing engine is evaluated to obtain the engine-level risk assessment result of each processing engine.

[0031] Based on the engine-level risk assessment results corresponding to each of the aforementioned processing engines, the system-level risk assessment results are determined;

[0032] Based on the system-level risk assessment results, the operating parameters of the multiple processing engines are adjusted.

[0033] Optionally, the step of assessing the current change rate risk corresponding to each of the multiple processing engines based on their respective source event information, and obtaining the engine-level risk assessment result for each processing engine, includes:

[0034] Based on the source event information of each processing engine, determine whether a first state transition event and a second state transition event of the processing engine have been detected;

[0035] In response to the detection of the second state switching event, the second risk contribution direction and the second risk contribution degree are output and determined as the engine-level risk assessment result of the corresponding processing engine;

[0036] In response to the absence of the second state transition event and the detection of the first state transition event, the first risk contribution direction and the first risk contribution degree are output and determined as the engine-level risk assessment result of the corresponding processing engine;

[0037] In response to the absence of detection of both the first state transition event and the second state transition event, a data flip score is output, which is determined as the engine-level risk assessment result of the corresponding processing engine; the data flip score is determined based on the data flip event in the source event information of the processing engine.

[0038] The first state switching event indicates that the corresponding processing engine switches from a full-load state to an idle state, and the second state switching event indicates that the corresponding processing engine switches from an idle state to a full-load state.

[0039] The second risk contribution direction is the upward direction of the current, and the second risk contribution degree is a positive value;

[0040] The first risk contribution direction is the direction of current decrease, and the first risk contribution degree is negative.

[0041] Optionally, the engine-level risk assessment result includes the risk contribution direction and risk contribution degree. The determination of the system-level risk assessment result based on the engine-level risk assessment results corresponding to each of the processing engines includes at least one of the following implementation methods:

[0042] Based on the risk contribution direction of each processing engine, the risk contribution degree corresponding to each processing engine is summed to obtain the system-level risk assessment result;

[0043] Based on the preset weights and risk contribution directions of the multiple processing engines, the risk contribution of each processing engine is weighted and summed to obtain the system-level risk assessment result.

[0044] Based on the priority of each of the multiple processing engines, some of the processing engines are selected, and based on the risk contribution direction of each of the multiple processing engines, the risk contribution degree of each of the multiple processing engines is merged to obtain the system-level risk assessment result.

[0045] Optionally, adjusting the operating parameters of the multiple processing engines based on the system-level risk assessment results includes:

[0046] Determine the working parameter adjustment strategy corresponding to the preset risk range to which the system-level risk assessment results belong;

[0047] Based on the aforementioned operating parameter adjustment strategy, the operating parameters of the plurality of processing engines are adjusted to reduce the current variation rate of the plurality of processing engines.

[0048] The determined working parameter adjustment strategy includes: reducing the frequency of the shared clock signal supplied to the multiple processing engines at least once during one or more consecutive target working cycles within a predetermined time window, and restoring the clock frequency to the original frequency after the target working cycle;

[0049] The number of downsampling intervals, the downsampling depth relative to the original frequency, and / or the downsampling period position are different for different preset risk intervals. Attached Figure Description

[0050] The above and other features, advantages, and aspects of the embodiments of this application will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0051] Figure 1 This is a schematic diagram of the structure of a processing engine control device according to Embodiment 1 of this application;

[0052] Figure 2 This is a schematic diagram of the structure of a processing engine control device according to Embodiment 2 of this application;

[0053] Figure 3 This is a schematic diagram of the structure of a processing engine control device according to Embodiment 3 of this application;

[0054] Figure 4 This is a schematic diagram of the processing engine control device proposed in Embodiment 4 of this application;

[0055] Figure 5 This is a schematic diagram of the structure of an engine-level evaluation circuit in a processing engine control device according to Embodiment 5 of this application;

[0056] Figure 6 This is a schematic diagram of the structure of a processing engine control device according to Embodiment Six of this application;

[0057] Figure 7 This is a schematic diagram of the structure of a risk assessment circuit in a processing engine control device according to Embodiment 7 of this application;

[0058] Figure 8 This is a schematic diagram of the structure of a processing engine control device according to Embodiment 8 of this application;

[0059] Figure 9 This is a schematic diagram of the structure of a processing engine control device in an NPU system according to an embodiment of this application;

[0060] Figure 10 This is a flowchart illustrating a processing engine control method proposed in Embodiment 1 of this application;

[0061] Figure 11 This is a flowchart illustrating a processing engine control method proposed in Embodiment 2 of this application.

[0062] Figure 12 This is a flowchart illustrating a processing engine control method proposed in Embodiment 3 of this application;

[0063] Figure 13The timing waveform diagram of the frequency modulation strategy for multiple processing engines whose system evaluation results are located in a third preset risk range in the processing engine control method proposed in this application embodiment;

[0064] Figure 14 The timing waveform diagram of the frequency modulation strategy for multiple processing engines whose system evaluation results are located in the second preset risk range in the processing engine control method proposed in the embodiments of this application;

[0065] Figure 15 The timing waveform diagram of the frequency modulation strategy for multiple processing engines whose system evaluation results are located in a first preset risk range in the processing engine control method proposed in the embodiments of this application;

[0066] Figure 16 The timing waveform diagram of the frequency modulation strategy for multiple processing engines whose system evaluation results are located in the fifth preset risk range in the processing engine control method proposed in the embodiments of this application;

[0067] Figure 17 This is a schematic diagram of the hardware structure of an electronic device according to Embodiment 1 of this application;

[0068] Figure 18 This is a schematic diagram of the hardware structure of an electronic device according to Embodiment 2 of this application. Detailed Implementation

[0069] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is only for explaining specific embodiments and is not intended to limit the application. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0070] The terms "first," "second," etc., used throughout this application and in the foregoing figures are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0071] To address the problems described in the background section, a software-level data scheduling strategy is proposed, such as gradually activating computing units and injecting dummy data when the working state of the processing engine changes, to smooth out the impact of load changes. However, while this data-level scheduling method can improve the behavior of a single module (such as a multiply-accumulate MAC array), it lacks a holistic perspective on the overall system state and introduces additional data padding and complex control logic, increasing hardware complexity and power consumption. To further improve these issues, this application proposes a processing engine control device and method that can accurately predict and coordinate the current change trends of each processing engine while ensuring efficient utilization of system computing power.

[0072] It should be noted that this application can be applied to the field of artificial intelligence technology, and its application scenarios in products can include, but are not limited to, the following: for model training and inference scenarios to pre-adjust operating parameters and reduce di / dt risks; for matrix operation-intensive scenarios such as convolutional neural networks and Transformers to coordinate the adjustment of operating parameters of multiple processing engines and avoid the problem of local frequency modulation failing to consider the overall situation; for multi-processing engine task scheduling scenarios; and for Dynamic Voltage and Frequency (DVFS) regulation. In scenarios involving scaling and power integrity management, the device proposed in this application, in conjunction with clock generation circuits and power management circuits, adjusts the shared clock signal and / or supply voltage before drastic current changes occur, improving power integrity and reducing the risk of timing violations, logic errors, or device damage. In high-density AI computing scenarios in data centers, system-level risk assessment and proactive control can reduce the impact of transient current changes on the power network, improving overall system reliability. In low-power edge AI scenarios, it can also be used in autonomous driving and real-time visual computing scenarios. When processing data from multiple cameras, radar, and lidar in real time, and with large fluctuations in neural network computing load, the device proposed in this application can predict current change trends in advance, adjust operating parameters in advance, and improve the reliability of the computing platform under complex operating conditions. No limitations are placed on the application scenarios to which the device and method proposed in this application are applicable.

[0073] Based on this, in the different application scenarios listed above, the processing engine control device and method proposed in this application can be applied to corresponding types of electronic devices or systems. However, they all have multiple processing engines, and transient current rate of change (di / dt) problems may occur during the operation of these multiple processing engines. Each processing engine can be a computing subsystem with independent computing and control capabilities, typically including computing units (e.g., MAC arrays), storage subsystems, control scheduling modules, and data flow engines. They work together to achieve efficient neural network computing, etc. Multiple processing engines can be integrated into the same chip, sharing clock signals and / or power supplies. The product form and working principle of the processing engines can differ in different types of devices or systems, and this application does not limit this.

[0074] In practical applications, the electronic devices to which the processing engine control device and method proposed in this application are applicable may include, but are not limited to, artificial intelligence chips, neural network processors, AI accelerator cards, system-on-a-chip (SoC), multi-core processors, data center servers, edge computing devices, smart terminals, vehicle computing platforms, or autonomous driving domain controllers. Among these, the artificial intelligence chip may include at least one of a neural network processor (NPU), deep learning accelerator chip, inference chip, or training chip, which is prone to di / dt problems during task switching and changes in data activity. The AI ​​accelerator card may include at least one of an AI accelerator card, inference card, or training card inserted into a server or computing node. It may integrate one or more AI chips and communicate with the host via interfaces such as PCIe (Peripheral Component Interconnect Express) and CXL (Compute Express Link, a high-speed interconnect protocol based on PCIe physical layer cache coherence). The processing engine control device proposed in this application can be integrated within the AI ​​chip for system-level risk control of multiple processing engines.

[0075] The system-on-a-chip (SoC) or multi-core processor can be a SoC integrating multiple processing engines such as CPU, GPU, NPU, and DSP, or a multi-core heterogeneous computing platform (multi-core processor). Data center servers can be GPU / NPU servers, cloud computing servers, or AI servers used for large model training and inference. In this case, the processing engine control device can perform system-level coordination at the chip or board level, reducing power integrity risks under high-density computing. Edge computing devices or smart terminals can include at least one of the following devices with high power consumption and reliability requirements: edge AI boxes, smart cameras, smartphones, tablets, wearable devices, etc.; in-vehicle computing platforms or autonomous driving domain controllers can include at least one of the following: autonomous driving computing platforms, smart cockpit computing platforms, in-vehicle AI chips, etc., to improve power stability and functional safety when running neural network calculations under high real-time and high reliability conditions using the device proposed in this application.

[0076] The apparatus and method proposed in this application can also be applied to cloud computing, cluster, or distributed computing systems such as training clusters and inference clusters composed of multiple AI acceleration nodes, such as neural network processing systems. The apparatus proposed in this application can be used in the AI ​​chip within a node of the system, and can also cooperate with upper-layer scheduling to achieve system-level current change rate risk management, etc. Based on the electronic equipment and system described above, the processing engine control device proposed in this application will be described in detail below with reference to the accompanying drawings.

[0077] Reference Figure 1 This is a schematic diagram of the structure of a processing engine control device according to Embodiment 1 of this application. The processing engine control device 100 may include a detection circuit 110, a risk assessment circuit 120, and a control circuit 130.

[0078] The detection circuit 110 is configured to acquire source event information for each of the multiple processing engines, which characterizes the current change trend of the respective processing engine during operation over a predetermined time period in the future.

[0079] In this embodiment, the detection circuit 110 serves as a front-end sensing unit and can be coupled to multiple processing engines respectively. By collecting or receiving information related to the future operating state of the processing engines, such as signal characteristics related to internal state switching or data flipping of the processing engines, it can predict the future current change trend in advance.

[0080] Based on this, such as Figure 1As shown, the detection circuit 110 can be deployed inside a power management integrated circuit (PMIC) or in a dedicated monitoring area of ​​the chip. Its inputs are connected to key logic nodes or clock distribution networks of various processing engines, allowing multiple processing engines to share the centrally located detection circuit 110. Optionally, as... Figure 2 As shown, the detection circuit 110 can also be deployed inside each processing engine. In this case, each processing engine is configured with a detection circuit 110, which is configured to independently detect the source event information of the corresponding processing engine itself. This application does not limit the deployment location, number and structure of the detection circuit 110, as long as it can obtain the source event information of each processing engine separately.

[0081] For each processing engine, the source event information can be predictive information that can be obtained during the engine's operation, earlier than the actual occurrence of the current change; that is, predictive information obtained before the actual current change occurs. In practical applications, when a processing engine enters or exits full load, and the activity level of its input data in adjacent time periods, are all determined by the processing engine's own control logic and input data flow, and therefore can be known in advance. Moreover, the occurrence and extent of this information can characterize the current change trend of the corresponding processing engine during its operation over a predetermined period in the future. This predetermined period can be a time interval from the acquisition of the source event information to the expected occurrence of the corresponding current change, and can be set according to the actual circuit requirements, such as one or more future duty cycles, or several future clock cycles.

[0082] Based on the above analysis, the implementation forms of source event information may include, but are not limited to: instruction decoding prediction signals within the processor core, cache hit rate indication signals, the depth status of the memory access request queue, or priority scheduling signals of the bus arbitrator. These signals can reflect the type of computational load and data throughput scale that the processing engine is about to execute. Based on this, in one possible implementation, the detection circuit 110 can predict changes in the working state or input data activity of the processing engine within a predetermined time period based on at least one of the processing engine's control logic, task scheduling information, instruction flow information, data flow information, and pipeline status information, in order to obtain the source event information of the processing engine and provide a basis for subsequent risk assessment in advance.

[0083] The risk assessment circuit 120 is coupled to the detection circuit 110 and is configured to assess the risk of current change rate corresponding to each processing engine based on the source event information of each of the multiple processing engines, obtain the engine-level risk assessment result of the corresponding processing engine, and then determine the system-level risk assessment result based on the obtained engine-level risk assessment results of each processing engine.

[0084] In this embodiment, the engine-level risk assessment result characterizes the risk of current change rate of a single processing engine within a predetermined future time, while the system-level risk assessment result characterizes the risk of current change rate under the combined action of multiple processing engines in the entire system. In practical applications, the risk assessment circuit 120 can first determine the risk of di / dt problems occurring in each processing engine within a predetermined future time based on its source event information, and provide the corresponding engine-level risk assessment result. Then, it integrates the risk assessment results of multiple processing engines to determine the system-level risk assessment result.

[0085] As can be seen, the risk assessment circuit 120 in this embodiment, through the above-mentioned hierarchical assessment method, not only focuses on the risk of di / dt problems that may be caused by a single processing engine in the future, but also focuses on the overall power supply stability / power consumption when multiple processing engines work together. This ensures that the system-level risk assessment results can truly reflect the transient current bearing capacity of the entire chip where multiple processing engines are located, and avoids focusing only on a single processing engine while ignoring the superimposed risks that may be generated when multiple processing engines work together.

[0086] In some embodiments, the risk assessment circuit 120 can be implemented using digital circuits, combinational logic circuits, analog circuits, processors, microcontrollers, programmable logic devices, or dedicated computing units. Optionally, the risk assessment circuit 120 can also employ more complex probabilistic models, such as Monte Carlo simulations or Markov chain models, to assess the risk direction and severity of di / dt problems occurring in multi-processor concurrent scenarios. This application does not limit the structure of the risk assessment circuit 120.

[0087] The control circuit 130 is coupled to the risk assessment circuit 120 and multiple processing engines, and is configured to adjust the operating parameters of the multiple processing engines based on the system-level risk assessment results. This means that the operating state of each processing engine is adjusted in advance to reduce the rate of current change that may occur within a predetermined time period, thereby suppressing or eliminating potential di / dt problems. The operating parameters can be parameters that affect the rate of current change of the processing engines, such as at least one of clock-related parameters, power supply-related parameters, and enable control parameters. This application does not limit the type of dynamically adjusted operating parameters or the method of adjustment.

[0088] In some embodiments, the control circuit 130 described above may be implemented in the form of, but is not limited to, digital logic circuits, mixed-signal circuits, or firmware-controlled microcontrollers, as long as it can realize the function of dynamic parameter adjustment based on system-level risk assessment results. This application does not limit the structure of the control circuit 130.

[0089] In summary, the processing engine control device 100 proposed in this embodiment constructs a forward-looking processing engine control architecture with early detection, hierarchical evaluation, and proactive intervention / control. It breaks through the traditional passive response mode based on current sampling. By using the detection circuit 110 to obtain source event information representing future current change trends in advance, it outputs the information to the risk assessment circuit 120. The risk assessment circuit 120 performs engine-level risk assessment and system-level risk fusion, outputting the system-level risk assessment result to the control circuit 130. Based on this, the control circuit 130 implements precise adjustment of the operating parameters of multiple processing engines, thereby predicting risks and proactively intervening before drastic current changes occur. This significantly improves the response speed and enhances the performance of the processing engine while ensuring system stability. It achieves a balance between power supply stability and computing efficiency, effectively solving the risk of voltage fluctuations and system crashes caused by di / dt problems in high-density circuits.

[0090] Moreover, since the control circuit 130 operates uniformly on multiple processing engines, there is no need to deploy data processing circuits such as pulsed input control and dummy data injection on each processing engine, which makes it easy to implement on existing chip architectures with a small hardware cost.

[0091] Furthermore, based on the above description of the processing engine's operation that may cause di / dt issues, the aforementioned source event information can include information on changes in the operating state of the corresponding processing engine and / or changes in input data activity. Specifically, the operating state change information can be used to predict whether the corresponding processing engine will undergo a power state switch within a predetermined timeframe, such as switching from a low-power state to a high-power state, or vice versa. The input data activity change information can be used to predict the degree of change in the input data of the corresponding processing engine within a predetermined timeframe, such as the trend of changes in the data flip rate.

[0092] Based on this, in one possible implementation, the source event information corresponding to each processing engine may include at least one core event that causes drastic changes in system current, such as a first state transition event, a second state transition event, and a data flip event. These events correspond to different load change scenarios and are the basic inputs for refined di / dt risk assessment. The first and second state transition events represent two different types of operating state change information, and the detection circuit 110 can predict the state transition event based on the control logic of the processing engine. As for the data flip event, which is a type of input data activity change information, the detection circuit 110 can compare the data input to the corresponding processing engine (i.e., the input data) according to the working cycle to obtain the data flip event, etc. The implementation method of how the detection circuit 110 obtains various events is not limited in this application.

[0093] The first state transition event can instruct the corresponding processing engine to switch from a full-load state to an idle state, such as the state from normal operation to sudden shutdown, denoted as the max_to_idle state. Correspondingly, the second state transition event can instruct the corresponding processing engine to switch from an idle state to a full-load state, such as the state from not working to simultaneous operation, denoted as the idle_to_max state. Based on this, in one possible implementation, it can be determined that the processing engine will switch from an idle state to a full-load state after n working cycles based on the scheduling information of the processing engine and the arrangement of the array enable signals, thus confirming the detection of the second state transition event, or it will switch from a full-load state to an idle state after n working cycles, thus confirming the detection of the first state transition event, where n is a positive integer, and the value of n determines the lead time for prediction; this application does not restrict its value.

[0094] Based on the above analysis, the first state transition event can be used to indicate that the corresponding processing engine is about to end a high-intensity computing task and enter a low-power idle mode. In this application, when the first state transition event is detected, it means that the computing units inside the processing engine will gradually stop working, resulting in a rapid decrease in overall power consumption. This abrupt transition from high power consumption to low power consumption will trigger a negative current spike, i.e., a sudden drop in current. Based on this, by recognizing the first state transition event in advance, the detection circuit 110 can capture the trend signal of the current drop, for example, by determining that the currently executing instruction sequence is about to end based on the control logic of the processing engine, or by predicting the upcoming idle period based on the scheduling information of the scheduler.

[0095] Correspondingly, the second state transition event can be used to indicate that the corresponding processing engine is about to wake up from the low-power idle mode and start at full speed / high speed to perform high-intensity computing tasks. In contrast to the first state transition event, this second state transition event indicates that a large number of logic gates inside the processing engine will be activated, causing a sudden surge in current. This high-intensity load transition from low to high will generate a positive current spike, i.e., a current surge phenomenon. Based on this, in practical applications, the detection circuit 110 can determine the occurrence of the second state transition event by monitoring the pull-up status of the control signal; for example, when the signal line representing the idle_to_max state is pulled high, it confirms that the second state transition event has occurred. This application does not limit the detection and determination methods for the above two types of state transition events.

[0096] The aforementioned data turnover event characterizes the degree of change in the input data turnover rate of the corresponding processing engine, quantifying the change in the activity level of the input data during processing. It can be denoted as `data_turnover_ratio`. The input data turnover rate refers to the proportion of data bits whose logical state changes within a single work cycle. Logical state changes can include changing from 0 to 1 or from 1 to 0. When the input data turnover rate changes significantly, even under the same load, the dynamic power consumption of the processing engine will fluctuate, leading to changes in current. For example, assuming 100 data points are input per work cycle, and 100 data points change in the first work cycle (100% turnover rate), and 80 data points change in the second work cycle (80% turnover rate), the input data turnover rate decreases by 20% compared to the first work cycle. This constitutes a data turnover event, reflecting the dynamic activity change at the data input end.

[0097] The three types of source event information mentioned above together constitute a comprehensive prediction system for the future current change trend of the processing engine. The first and second state transition events capture the step change of load from the macro-level task scheduling perspective, while the data flip event supplements the detailed fluctuations of dynamic power consumption from the micro-level data transmission perspective. This covers the current disturbance factors that may cause di / dt problems during the entire process of standby, startup, and operation of the processing engine. Moreover, these three types of source events can be known in advance by the processing engine control logic or by simple comparative statistics, ensuring the real-time nature of the prediction. They can also be uniformly transformed into quantifiable risk indicators, providing rich and accurate input for the subsequent risk assessment circuit 120.

[0098] In summary, this embodiment introduces three specific source event information—a first state transition event, a second state transition event, and a data flip event—enabling the system to distinguish different types of current change trends. This avoids the lag problem caused by relying solely on real-time current detection in traditional analog schemes. Furthermore, the precise di / dt risk assessment based on multi-dimensional source events not only improves the targeting and accuracy of risk assessment but also provides a solid basis for configuring differentiated dynamic operating parameter adjustment strategies for the control circuit 130. This effectively suppresses voltage drops or overshoots caused by drastic current changes, ensuring stable system operation.

[0099] Furthermore, in conjunction with the above description of the risk assessment circuit 120, this embodiment also provides a structural composition of the risk assessment circuit 120, referring to... Figure 3The schematic diagram of a processing engine control device proposed in Embodiment 3 of this application shows that the risk assessment circuit 120 may include multiple engine-level assessment circuits 121 corresponding to multiple processing engines, and a system-level assessment circuit 122 coupled to the multiple engine-level assessment circuits 121.

[0100] In this embodiment, each engine-level evaluation circuit 121 is configured to determine the risk contribution direction and risk contribution degree corresponding to the processing engine based on the source event information of the corresponding processing engine, as the engine-level risk assessment result of the processing engine. The risk contribution direction can indicate the direction of current change in the corresponding processing engine within a predetermined time period, such as the direction of current increase or decrease. The risk contribution degree can indicate the severity of current change in the corresponding processing engine within a predetermined time period; the larger its absolute value, the higher the probability of causing a di / dt problem, and / or the more severe / intense the di / dt problem.

[0101] As can be seen, in practical applications, each engine-level evaluation circuit 121 operates independently and can receive source event information detected by the detection circuit 110 in the corresponding processing engine, or source event information of the corresponding processing engine detected by the shared detection circuit 110, such as a first state switching event or a second state switching event indicating a state switch, and / or a data flip event characterizing a change in the input data flip rate, etc., thereby realizing a quantitative evaluation of the di / dt problem that may be caused by a single processing engine in the future within a predetermined time. This evaluation is not a direct detection of instantaneous current, but a predictive evaluation based on source event information, thereby solving the problem of lag in traditional analog schemes.

[0102] In this process, for each engine-level evaluation circuit 121, the risk contribution direction and risk contribution degree of the corresponding processing engine to the overall system risk are accurately evaluated. This can be quantified using discrete integer scores, or it can be quantified using floating-point numbers or other continuous numerical methods according to the accuracy requirements of the actual circuit design, as long as the direction and relative severity of the risk can be distinguished. This application does not restrict the quantification form of the risk contribution direction and risk contribution degree.

[0103] The system-level evaluation circuit 122 is configured to receive the risk assessment results of each engine-level evaluation circuit 121, and fuse these results according to a preset fusion method to obtain a system-level risk assessment result. Therefore, the system-level evaluation circuit 122 can be connected to the output of each engine-level evaluation circuit 121 to aggregate and coordinate local risks distributed across various processing engines according to a preset fusion method, forming a system-level risk assessment result from a global perspective.

[0104] The preset fusion method can refer to the rules and / or circuit connection relationships that are pre-set or pre-configured in the system-level evaluation circuit 122 for merging multiple engine-level risk assessment results into a system-level risk assessment result. The preset fusion method can be fixed during the chip design stage or adjusted through configuration information during chip operation, that is, the preset fusion method is dynamically updated during operation. This application does not limit the content and configuration of the preset fusion method.

[0105] Based on the above description of the engine-level risk assessment results, the system-level assessment circuit 122 can use its internally integrated logic modules to aggregate multiple risk contribution degrees into a unified quantitative value according to the different risk contribution directions corresponding to at least some of the processing engines, so as to determine the system-level risk assessment result, namely the system-level risk contribution direction and the system-level risk contribution degree, etc. The fusion implementation process can be determined according to the fusion principle of the preset fusion method, which will not be described in detail here.

[0106] Therefore, this embodiment achieves hierarchical risk assessment from a single processing engine to the entire system. Each engine-level assessment circuit 121 can independently quantify the risk contribution direction and degree caused by state switching and data flipping of each processing engine, solving the problem that traditional methods cannot distinguish the risk sources of different processing engines. Furthermore, the system-level assessment circuit 122 uses a preset fusion method to integrate the risk assessment results of each engine level, solving the problem that traditional methods only consider a single MAC array and cannot plan for the entire system. This achieves the technical effects of predicting system-level di / dt risks in advance, optimizing circuit complexity, and reducing additional power consumption.

[0107] In addition, the hierarchical evaluation architecture proposed in this embodiment not only improves the scalability of the system, but also allows adding or reducing the number of processing engines without significantly modifying the core evaluation logic. The added processing engines can be directly configured with corresponding engine-level evaluation circuits 121 and detection circuits 110 or connected to the shared detection circuit 110, thereby reducing hardware maintenance costs.

[0108] Furthermore, this embodiment also proposes a structure for an engine-level evaluation circuit 121, such as a multiplexer logic structure, to transform qualitative source events into quantifiable risk indicators. It is preferred to use discrete integer scores for quantification, so that the multiplexer logic structure can output different numerical scores according to different types of source events. However, it is not limited to this. This application only uses the quantization form of discrete integer scores as an example for illustration. The risk assessment process for other quantization forms is similar, and this application will not provide detailed examples for each one.

[0109] Based on the above analysis, and referring to Figure 4The diagram shown below illustrates a possible structure of the engine-level evaluation circuit corresponding to each of the multiple processing engines in the processing engine control device proposed in Embodiment 4 of this application. Figure 4 As shown, each engine-level evaluation circuit 121 may include a first selection circuit 1211 and a second selection circuit 1212.

[0110] The first selection circuit 1211 is configured to output a first value or a data flip score based on a first state transition event in the source event information, the data flip score being determined based on the data flip event in the source event information. Combining the above descriptions of the two types of source events, the first selection circuit 1211 can be used to handle the risk of current drop or data load fluctuation.

[0111] In practical applications, when a first state transition event is detected, it indicates that the processing engine is about to switch from full-load operation to idle state. This typically leads to a sharp drop in current, resulting in a negative current change rate risk. At this time, the first selection circuit 1211 corresponding to the processing engine will output a predefined first value, such as a negative score of -5, to characterize the negative risk contribution of the processing engine (engine-level risk severity). Thus, the first value characterizes / includes the first risk contribution direction and first risk contribution level of the corresponding processing engine itself. It should be understood that the first value in this application can also adopt other quantification forms, such as floating-point numbers or other continuous values, and is not limited to this discrete numerical score form.

[0112] If no first state switching event is detected, but a data flip event is detected, the first selection circuit 1211 will quantify and score the severity of the input data flip rate. Therefore, the risk contribution at this time depends on the severity of the change in the input data flip rate. This application can map the absolute change in the input data flip rate to a score value. This can be achieved according to a preset mapping relationship. For this purpose, the range of change in the input data flip rate (such as an increase or decrease of 5% to 100%) can be divided into multiple intervals. Each interval corresponds to a value in the data flip score range (such as -5 to 5, or -10 to 10, etc., without limitation), which is a data flip score. This forms the mapping relationship. This application does not limit the configuration and storage format of the mapping relationship.

[0113] For example, if the increase in input data flip rate is between 5% and 20%, the corresponding data flip rate score can be set to 1; if the increase is between 20% and 40%, the corresponding score can be set to 2; and so on, following a 20% interval, the maximum increase in input data flip rate can reach 5 points, meaning that if the increase is between 80% and 100%, the corresponding score can be set to 5. Similarly, if the input data flip rate decreases, the corresponding score will be a negative value depending on the range of decrease. For example, if the decrease is between 5% and 20%, the corresponding score can be set to -1; if the decrease is between 80% and 100%, the corresponding score can be set to -5, and so on. The decrease in input data flip rate can also be represented by negative numbers, such as between -5% and -20%, between -80% and -100%, etc., without restriction.

[0114] Alternatively, the above mapping relationship can be implemented using a look-up table (LUT) or a simple linear / non-linear function. Assume the input data flip rate is expressed as... Its change relative to the previous work cycle is The corresponding data flipping score It can be represented as:

[0115] (1);

[0116] in, This is a sign function used to determine whether the input data flip rate is increasing or decreasing; an increase is indicated by a positive sign, and a decrease by a negative sign. This is the floor function; Min(5, ...) represents the absolute value (i.e., the magnitude) of the change in the input data's flip rate. This is used to limit the data flipping score to a maximum of 5 points, but is not limited to this; it can be determined based on the upper limit of a preset data flipping score range. The denominator 20% in the formula represents the interval width corresponding to each score level, which changes with the step size of the aforementioned interval division. Therefore, in this embodiment, the first selection circuit 1211 can flexibly output corresponding scores based on the actual input data activity, thereby accurately reflecting the di / dt risk at the data level.

[0117] Among these factors, changes in the input data flip rate can alter the computational activity of the processing engine, thereby affecting the current. However, when the change in the flip rate is small, such as... At this time, the computational intensity of the processing engine changes relatively little, and the resulting current changes are usually insufficient to cause significant di / dt risk. Therefore, treating it as risk-free or negligible and excluding it from data flipping scoring can prevent the system from overreacting to minor fluctuations. Simultaneously, setting a 5% dead zone can filter out normal data activity fluctuations and detection noise, ensuring that the operating parameter adjustment strategy is triggered only when a truly significant di / dt risk exists, avoiding frequent adjustments. Therefore, this embodiment, by setting a preset threshold of 5%, can filter out minor input data flipping rate changes, avoiding unnecessary frequency adjustments due to normal data fluctuations, thereby ensuring effective di / dt risk control while reducing system power consumption and performance overhead.

[0118] It should be noted that the dead zone size set above includes, but is not limited to, those specified above. Different minimum trigger thresholds can be set based on process nodes, power network characteristics, noise margins, and task types. For example, for systems with strong power networks and high anti-interference capabilities, the threshold can be appropriately increased; for systems more sensitive to di / dt, the threshold can be appropriately decreased, or even set to 0. The 5% in this embodiment is merely an example of a preset threshold / range boundary and does not constitute a limitation.

[0119] The second selection circuit 1212 is coupled to the first selection circuit 1211 and is configured to output a second value or the output of the first selection circuit 1211 based on the second state transition event in the source event information, to determine the engine-level risk assessment result. In practical applications, when the system detects a second state transition event, i.e., when the processing engine switches from an idle state to a full-load state, this is often accompanied by a huge instantaneous current demand, which is one of the most serious scenarios that cause di / dt problems. To address this, the second selection circuit 1212 introduces a priority to ensure a rapid response to the risk of positive current surges.

[0120] Based on this, once the second selection circuit 1212 confirms the existence of a second state transition event, it will directly ignore the output from the first selection circuit 1211. Whether this output is a first value or a data inversion score, it will immediately output a preset second value, such as a positive score of +5 points, as the final engine-level risk assessment result. This ensures that the most dangerous positive current surges can be identified and handled most efficiently. Conversely, if no second state transition event occurs in the current working cycle, the second selection circuit 1212 will transfer control to the first selection circuit 1211, directly transmitting the first value or data inversion score output by the first selection circuit 1211 as the current engine-level risk assessment result for the processing engine.

[0121] Optionally, the above scoring example scenario will be used as an example for illustration, such as... Figure 5The diagram shows a logic structure of an engine-level evaluation circuit. The first selection circuit 1211 and the second selection circuit 1212 in each engine-level evaluation circuit 121 can be implemented by multiplexers, such as... Figure 5 The two cascaded multiplexers shown have a first selection circuit 1211. Figure 5 The right-hand multiplexer has a first input terminal, a second input terminal, and a first selection control terminal. The first input terminal can receive a data inversion score, the second input terminal can receive a first numerical value, such as -5, and the first selection control terminal can receive a second state switching event, namely the max_to_idle signal. The second selection circuit 1212 is... Figure 5 The left-hand multiplexer has a third input terminal, a fourth input terminal, and a second selection control terminal. The third input terminal is coupled to the output terminal of the first selection circuit 1211 and is used to receive the output of the first selection circuit 1211. The fourth input terminal can receive a second value, such as 5. The second selection control terminal can receive a second state switching event, namely the idle_to_max signal.

[0122] Based on this, when the max_to_idle signal is detected to be valid (e.g., 1), the first selection circuit 1211 selects the second input terminal to output the first value, i.e., -5. At this time, the idle_to_max signal is invalid. The second selection circuit 1212 selects the third input terminal, and the output is still the first value. This indicates that when the processing engine switches from a full-load state to an idle state, the current may decrease, the risk contribution direction is the direction of current decrease, and the risk contribution degree is negative. When the idle_to_max signal is detected to be valid (e.g., 1), the second selection circuit 1212 selects the fourth input terminal to output the second value, i.e., 5. At this time, regardless of whether the max_to_idle signal is valid or not, and regardless of the data flipping score, the engine-level evaluation result is 5, indicating that when the processing engine switches from an idle state to a full-load state, the current may increase, the risk contribution direction is the direction of current increase, and the risk contribution degree is positive.

[0123] If the max_to_idle and idle_to_max signals are not detected, i.e., these two signals are invalid (e.g., 0), it is determined that the first state transition event and the second state transition event have not been detected. The first selection circuit 1211 selects the first input terminal to output the data flip score, and the second selection circuit 1212 selects the third input terminal to output the output of the first selection circuit 1211, i.e., the data flip score, to determine the engine-level risk assessment result of the processing engine.

[0124] Therefore, through such Figure 5The cascaded selection circuits shown are configured such that the engine-level evaluation circuit determines the engine-level risk assessment result for the corresponding processing engine based on the priority order of the second state transition event over the first state transition event, and the first state transition event over the data flip score. Based on this, the first selection circuit 1211 is configured to: output a first value when a first state transition event is detected (i.e., the max_to_idle signal is valid); and output a data flip score when no first state transition event is detected (i.e., the max_to_idle signal is invalid). The second selection circuit 1212 is configured to: output a second value when a second state transition event is detected (i.e., the idle_to_max signal is valid); and output the output of the first selection circuit 1211, such as the first value or the data flip score, when no second state transition event is detected (i.e., the idle_to_max signal is invalid).

[0125] As can be seen, this embodiment, through this series-connected and prioritized logic structure, enables the second selection circuit 1212 and the first selection circuit 1211 to work together to achieve the classification and grading assessment of risk sources of different natures. This ensures both real-time response to critical risks and refined quantification of other types of risks, thereby ensuring that the source events with the greatest impact on the current are prioritized in the engine-level risk assessment results. Moreover, compared with implementations using complex computing units, this logic structure has a simpler circuit and lower path delay, better meeting the real-time requirements of practical scenarios.

[0126] Furthermore, this embodiment also proposes a structure for a system-level evaluation circuit 122, referring to... Figure 6 The diagram shown is a possible structural schematic of the system-level evaluation circuit in the processing engine control device proposed in Embodiment 6 of this application. The system-level evaluation circuit 122 may include a fusion circuit 1221 and a decision output circuit 1222.

[0127] The fusion circuit 1221 is coupled to multiple engine-level evaluation circuits 121 respectively, and is configured to receive and fuse the engine-level risk assessment results output by each engine-level evaluation circuit 121 to obtain a system-level evaluation result. In this embodiment, the fusion circuit 1221 serves as the core computing module of the system-level evaluation circuit 122. Its input terminals establish electrical connections or signal paths with the output terminals of the engine-level evaluation circuits 121 corresponding to each processing engine, and summarize the independent risk contributions from different processing engines. The implementation process can be determined based on a preset fusion method. For different preset fusion methods, the composition or logic structure of the fusion circuit 1221 can be different, and there is no limitation on this.

[0128] In some embodiments, the preset fusion method can be hard-connection fusion, that is, the fusion circuit 1221 in the system-level evaluation circuit fuses the engine-level risk assessment results output by each engine-level evaluation circuit 121 through fixed circuit connection relationships and / or fixed logic circuit topology. The fixed connection relationships can be determined during chip manufacturing and do not require writing configuration information to registers during operation.

[0129] Based on this, the fusion circuit 1221 may include a fixedly connected merging logic network, with the outputs of multiple engine-level evaluation circuits 121 connected to the corresponding inputs of the merging logic network according to a preset topology. The merging logic network may be composed of at least one of the following: wires, logic gates, adders, subtractors, comparators, selectors, encoders, sign processing circuits, saturation processing circuits, etc., so that the risk assessment results of each engine-level circuit can be input into the merging logic network through a fixed path and merged in the merging logic network according to fixed rules (which depend on the operational principles represented by the merging logic network structure) to output a system-level risk assessment result.

[0130] Optionally, where the risk contribution direction of each processing engine can be represented by a sign bit and the risk contribution degree can be represented by a numerical value, the risk contribution degrees output by multiple engine-level evaluation circuits can be merged according to a fixed topology using a hard-connected fusion method. The merged result is then symbolically processed according to each risk contribution direction to obtain the system-level risk contribution degree (such as the system-level total risk score). The fixed topology can be pre-designed based on the number, type, and connection relationship of the processing engines. For example, for a system with four processing engines, the fusion circuit 1221 supporting hard-connected fusion can include multiple fixedly connected fusion nodes. The four engine-level evaluation results are input to their respective fusion nodes, and after a fixed number of fusion stages, the system-level risk evaluation result is output. It should be noted that the fusion rules for hard-connected fusion can be determined during chip manufacturing and do not require additional configuration during subsequent operation. Therefore, it features low latency, small circuit area, low power consumption, and high reliability. This method is suitable for application scenarios with relatively fixed fusion rules and relatively homogeneous processing engine structures.

[0131] In other embodiments, the preset fusion method can be register-configured fusion, meaning the system-level evaluation circuit 122 includes a configuration register group and a configurable fusion circuit. The configuration register group stores fusion configuration information, and the configurable fusion circuit fuses the evaluation results of each engine level according to this fusion configuration information. The fusion configuration information can be written by the main control processor, control circuit, software driver, firmware, etc., during chip initialization, before task scheduling, during task switching, or during operation. It may include, but is not limited to, at least one of the following: fusion mode selection information, selection information of the processing engines participating in the fusion, fusion parameters corresponding to each processing engine, enable information corresponding to each processing engine, symbol processing method information, numerical saturation processing method information, output mapping method information, risk interval division information, etc.

[0132] Correspondingly, the configurable fusion circuit mentioned above may include at least one of a multiplexer, a configurable merging network, a multiplier, an adder, a lookup table, or a state machine. By writing different fusion configuration information, the configurable fusion circuit can change the fusion method of multiple engine-level risk assessment results, thereby adapting to different task types, working modes, number of processing engines, and / or system configurations.

[0133] The register configuration fusion can support multiple fusion modes. Optionally, a fusion mode field can be set in the configuration register group. When the fusion mode field is a first value, the configurable fusion circuit can use a first fusion topology to merge the risk assessment results of each engine level; when the fusion mode field is a second value, the configurable fusion circuit can use a second fusion topology to merge the risk assessment results of each engine level. The first fusion topology and the second fusion topology can differ in at least one aspect, such as the engines participating in the fusion, the merging path, the symbol processing method, and the numerical processing method.

[0134] Optionally, the configuration register group can also be configured with enable bits for each processing engine to indicate whether the corresponding engine-level evaluation results participate in this system-level fusion. Furthermore, the configuration register group can also be configured with fusion parameters corresponding to each processing engine to adjust the influence of the corresponding engine-level evaluation results during the fusion process, such as fusion weights. In this way, the configurable fusion circuit can merge multiple engine-level evaluation results according to the above configuration information and output a system-level risk assessment result. Therefore, this register-configured fusion method in this embodiment has high flexibility, can adapt to different application scenarios and different control strategies, and is convenient for debugging, upgrading, and reuse in multiple scenarios.

[0135] In some other embodiments, the preset fusion method used in this application may also include a combination of the above-described hard-connection fusion and register configuration fusion. Optionally, the basic merging topology in the system-level evaluation circuit 122 can be fixed by hard-connection, while the enable information, fusion parameters, output thresholds, etc. of each processing engine can be configured by registers. In this way, the basic speed and area advantages of the fusion circuit 1221 can be guaranteed, while also providing a certain degree of configurability. In this case, the above-described configurable fusion circuit may include a fixedly connected basic fusion network and a configuration selection circuit coupled to the basic fusion network. The configuration selection circuit can select the corresponding engine-level evaluation result, adjust the corresponding fusion parameters, or select the corresponding output mapping method according to the configuration information in the configuration register group. The basic fusion network merges the selected results according to the fixed topology to obtain the system-level risk assessment result, but is not limited to this.

[0136] It should be understood that the preset fusion method of this application can also be dynamically updated during operation. In this regard, the system-level evaluation circuit 122 may further include a configuration update interface, which is coupled to the main control processor and / or control circuit of the electronic device to receive updated fusion configuration information. In practical applications, before the task begins, the main control processor can write the corresponding fusion configuration information according to the current task type; during task switching, the control circuit can update the fusion configuration information according to the new operating mode; and during periodic maintenance or debugging, the fusion configuration information can be updated via software, thereby enabling the system-level evaluation circuit to flexibly adjust the fusion method of multiple engine-level risk assessment results according to the actual operating status.

[0137] The decision output circuit 1222, coupled to the fusion circuit, is configured to determine the corresponding operating parameter adjustment strategy based on the preset risk range to which the system-level evaluation result belongs, and output a strategy signal characterizing the operating parameter adjustment strategy. At this time, the control circuit 130 is configured to receive the strategy signal and adjust the operating parameters of multiple processing engines based on the operating parameter adjustment strategy.

[0138] In this embodiment, the decision output circuit 1222 is used to convert continuous numerical system-level evaluation results into discrete control instructions. It may integrate a comparator array or multiplexing logic to compare the system-level evaluation results output by the fusion circuit 1221 with a pre-set threshold (i.e., a preset risk range, which can be stored in a register), thereby determining the current risk level of the system, i.e., the di / dt risk severity level. The preset risk range can be determined based on historical experimental data or theoretical simulations, used to classify different risk severity levels. This embodiment can divide the system-level evaluation results into multiple risk levels such as a safe zone, a low-risk zone, a medium-risk zone, and a high-risk zone, but is not limited to this.

[0139] The decision output circuit 1222 compares the received system-level evaluation results with each preset risk range. After determining the preset risk range into which the current system-level evaluation result falls, it searches a pre-stored mapping table, i.e., the mapping relationship between different preset risk ranges and each operating parameter adjustment strategy, and determines the operating parameter adjustment strategy corresponding to the preset risk range. This strategy can be expressed as the depth, duration, or timing of frequency adjustment, etc. The circuit generates and outputs a strategy signal that represents the corresponding control action, such as a digitally encoded signal, a pulse width modulation signal, or a specific control level, to indicate the operating parameter adjustment operation that the subsequent control circuit 130 needs to perform.

[0140] For example, continuing with the scenario described above, the preset risk ranges can include: [-20, -12), [-12, -5), [-5, 5), [5, 12), and [12, 20), etc. Different risk ranges correspond to different operating parameter adjustment strategies to output corresponding strategy signals. Based on the description of the fusion circuit 1221 above, this fusion circuit 1221 can include multiple cascaded adders, such as... Figure 7 As shown, assuming the system contains four processing engines, denoted as Engine0, Engine1, Engine2, Engine3, etc., the engine-level risk assessment results corresponding to each processing engine are denoted as total_score0, total_score1, total_score2, and total_score3, respectively. The fusion circuit 1221 merges the engine-level risk assessment results, and the resulting system-level risk assessment result can be denoted as total_score. Figure 7 As shown, the total_score3, total_score2, total_score1 and total_score0 are summed by cascaded adders to obtain the total_score, which is then output to the decision output circuit 1222. The decision output circuit 1222 determines which risk range the total_score falls into, thereby determining the corresponding working parameter adjustment strategy and outputting the corresponding strategy signal.

[0141] Subsequently, the control circuit 130, acting as the system's execution terminal, is responsible for parsing the strategy signal emitted by the decision output circuit and actively intervening in the actual operating state of the processing engine. Since the operating parameter adjustment strategies corresponding to different preset risk ranges are different, they typically exhibit significant differences to match the potential di / dt current surge risks of varying severity. Optionally, for a slightly risky range, the strategy signal may only indicate a slight frequency reduction before a specific high-power cycle; while for a severely risky range, the strategy signal may indicate a significant frequency reduction or a phased frequency reduction over multiple consecutive high-power cycles.

[0142] By employing this tiered response method, control circuit 130 can achieve maximum system stability with minimal performance loss. In other words, when system-level evaluation results indicate a high positive cumulative risk, control circuit 130 may proactively reduce the frequency before the upcoming high-power cycle to suppress the current rise rate; when a high negative cumulative risk is indicated, control circuit 130 may reduce the frequency in advance as the high-power cycle is about to end to mitigate the impact of current drop, but this is not limited to this parameter adjustment strategy. This dynamic parameter adjustment strategy based on system-level overall planning can more accurately address the complex current fluctuations caused by concurrent operation of multiple processing engines compared to traditional single-point detection schemes.

[0143] In summary, this application achieves complete risk control, from local risk detection to system-level comprehensive assessment and refined control. By incorporating the fusion circuit 1221 to accumulate the risk contributions of each engine, and the decision output circuit 1222 to map differentiated strategies across different risk ranges, it solves the problems of lag in traditional analog schemes and the complexity and lack of global coordination in data pulsation schemes. This achieves the technical effect of minimizing additional power consumption and improving overall energy efficiency while ensuring system current stability.

[0144] In some embodiments, the operating parameters of the processing engine may include at least one of clock parameters and supply voltage. Therefore, these operating parameters may refer to key physical quantities that directly determine the operating state and power consumption level of the processing engine. The clock parameters characterize the operating frequency or timing rhythm of the processing engine and may include at least one of clock frequency, duty cycle, phase, gating state, and division ratio. The supply voltage characterizes the energy intensity supplied to the processing engine.

[0145] In practical applications, the structure of the control circuit 130 varies depending on the type of operating parameters. Optionally, for example... Figure 8 As shown, the control circuit 130 may include at least one of a clock control circuit 131 and a voltage control circuit 132. The clock control circuit 131 is configured to adjust the clock parameters of a plurality of processing engines based on system-level risk assessment results. The voltage control circuit 132 is configured to adjust the supply voltage to the plurality of processing engines based on system-level risk assessment results.

[0146] As can be seen, this embodiment achieves suppression of the risk of current surges from different physical levels by limiting at least one of the above two operating parameters as the control object. For example, it may be adjusting only the clock parameter, adjusting only the supply voltage, or adjusting both operating parameters simultaneously. This application embodiment does not make any special limitations on this.

[0147] In one possible implementation, the clock control circuit 131 described above can be a logic module or hardware circuit specifically designed to perform dynamic frequency modulation operations. It receives system-level risk assessment results from the risk assessment circuit 120 and accordingly changes the frequency of the clock signal output to the processing engine. When the system-level risk assessment results indicate a risk of a positive current surge, the clock control circuit 131 can reduce the clock frequency during high-power cycles to slow the current rise rate; conversely, it can do so when the current rise rate is low. This feedback control method based on system-level assessment results allows the clock control circuit 131 to precisely adjust the operating state of each processing engine according to the overall system load fluctuations.

[0148] For example, we will still use an NPU system containing four processing engines: Engine0, Engine1, Engine2, and Engine3, as an example for explanation. Figure 9 As shown, the NPU system includes an outermost top-level module (denoted as npu_sys_top) containing the main components of the NPU system, and a core top-level module (denoted as npu_top) containing multiple processing engines within npu_sys_top. Each processing engine contains a computing array, which can be denoted as grid_top, and may include computing resources such as MAC arrays. The aforementioned detection circuit 110 can be distributed in each engine or configured corresponding to each engine. Figure 9 The detection circuit 110 is not shown.

[0149] The clock control circuit 131 may include a frequency change module for adjusting the parameters of the clock signal clk, i.e., the clock parameters, according to the frequency modulation strategy (i.e., a working parameter adjustment parameter). Therefore, the clock control circuit 131 may be a CRG (Clock and Reset Generator), which, as a core module of the SoC / chip, is responsible for generating clock signals and various reset signals for the entire clock domain of the chip. For different frequency modulation strategies, its internal frequency adjustment module may include, but is not limited to, one or more of the following: phase-locked loop (PLL), frequency divider, integrated clock gating (ICG), clock switching circuit, reset synchronization release circuit, etc. There are no restrictions on this.

[0150] Figure 9 The Vote logic in the above can be considered as the system-level evaluation circuit 122 in the risk assessment circuit 120, which can adopt, but is not limited to, the following methods. Figure 7The cascaded adder shown sums the received engine-level risk assessment results total_score0 to total_score3 to obtain the system-level risk assessment result total_score. Optionally, based on the description of the preset fusion method above, Vote logic can also perform weighted summation of the engine-level scores, select some engine scores for fusion, etc., according to the register configuration information. For this, the controller in control circuit 130 (which can be denoted as npu_ctrl) can provide Vote logic with predefined configuration information such as control source, risk range division, and register configuration, enabling Vote logic to flexibly determine the system-level risk assessment result total_score according to actual needs. Then, it can be determined which risk range total_score falls into. Vote logic can output a strategy signal representing the corresponding frequency modulation strategy, such as reduce_freq_scheme. Freq change receives reduce_freq_scheme, adjusts the frequency of the clock signal clk, and provides the adjusted clock signal to each processing engine. Thus, by adjusting the clock frequency in advance, this embodiment can reduce the current change rate of multiple processing engines before drastic current changes occur, thereby suppressing the di / dt problem.

[0151] In one possible implementation, the voltage control circuit 132 described above is a power management module specifically designed to perform dynamic voltage regulation, adjusting the voltage amplitude supplied to the processing engine in real time based on system-level risk assessment results. Lowering the voltage significantly reduces the drive current, thereby mitigating current spikes caused by load fluctuations. Compared to the solution that only adjusts the frequency, voltage control provides another dimension of adjustment freedom. It can operate independently of the clock control circuit or in conjunction with it, working together on the processing engine's power network, as long as dynamic voltage adjustment based on system-level risk assessment results can be achieved.

[0152] Optionally, the control circuit 130 can be configured to prioritize adjusting the frequency of the clock signal, that is, to prioritize executing the clock control circuit 131 to adjust the clock frequency, such as changing at least one of the activity rate, effective operating frequency and flip-flop time distribution of multiple processing engines, and / or after the frequency of the clock signal is adjusted to a preset lower limit, adjusting the power supply voltage, clock gating state, etc., to suppress the current change rate of multiple processing engines. This can be achieved by the voltage control circuit 132. The detailed implementation process is not described in detail in this embodiment.

[0153] As can be seen, the clock control circuit 131 and the voltage control circuit 132 constitute a dual defense control against the di / dt problem. When the processing engine faces the potential risk of drastic current changes, the system-level risk assessment result is first quantified into a preset risk range; subsequently, the clock control circuit 131 and / or the voltage control circuit 132 perform frequency reduction, voltage reduction, or a combination of both adjustments according to the type of the risk range (e.g., positive or negative direction) and the severity (e.g., absolute value). This joint control strategy of multiple operating parameters can effectively smooth the current waveform and avoid impacting the system power network while ensuring the normal operation of the computing task.

[0154] In summary, this embodiment sets up the control circuit 130 with the above structure, which is adjusted based on the system-level risk assessment results. This achieves fine-grained control of the processing engine's operating parameters, solves the problems of lag in traditional analog detection schemes and the inability of single-point pulse input schemes to coordinate the overall situation, thereby predicting and suppressing di / dt problems in advance, maintaining low circuit complexity, and reducing the system's additional power consumption.

[0155] The processing engine control method proposed in this application will be described in detail below with reference to the structure of the processing engine control device described in the above embodiments, but is not limited to the embodiments described below.

[0156] Reference Figure 10 This is a flowchart illustrating a processing engine control method proposed in Embodiment 1 of this application. It can be applied to the processing engine control device described above, and its composition and structure are not limited in this embodiment. Figure 10 As shown, the method proposed in this embodiment may include:

[0157] Step S101: Obtain source event information for each of the multiple processing engines. The source event information represents the current change trend of the corresponding processing engine during operation within a predetermined time period in the future.

[0158] In this embodiment, detection circuits deployed at key nodes of the computing system can collect real-time information on the state switching and data activity of each processing engine to obtain the source event information of each processing engine. Combined with the above description of the source event information, it is not a simple set of state flags, but a key signal that characterizes the trend of drastic current changes that may be caused by the corresponding processing engine during operation within a predetermined time in the future.

[0159] Step S102: Based on the source event information of each of the multiple processing engines, assess the current change rate risk of each processing engine to obtain the engine-level risk assessment result of each processing engine.

[0160] In this embodiment, for each processing engine, an independent engine-level evaluation circuit can be used to assess the risk of excessive current change rate within a predetermined time period based on its source event information. The abstract source event information is transformed into a risk quantification value as the engine-level risk assessment result, which can reflect the severity of current change and clarify the direction of current change, so that the system can distinguish between the risk of current surge or the risk of current drop.

[0161] Step S103: Based on the engine-level risk assessment results corresponding to each processing engine, determine the system-level risk assessment results.

[0162] In this embodiment, the fusion circuit in the system-level evaluation circuit receives the engine-level risk assessment results corresponding to each processing engine. A preset fusion method (such as one or more hard-connection fusion / register configuration fusion methods mentioned above) is used to fuse the engine-level risk assessment results, summarizing the local risk contributions of each independent processing engine into a global system risk index. This is a comprehensive risk assessment result reflecting the overall current change trend of the entire computing system over a predetermined time period, denoted as the system-level risk assessment result. This application, through this aggregation method, enables the system-level risk assessment result to objectively reflect the cumulative current pressure under concurrent operation of multiple processing engines, avoiding the limitations of traditional solutions that only focus on the local state of a single engine.

[0163] Step S104: Based on the system-level risk assessment results, adjust the operating parameters of multiple processing engines.

[0164] By coordinating the decision output circuit and the control circuit, and based on the preset risk range to which the determined system-level risk assessment results belong, the corresponding dynamic operating parameter adjustment strategy is automatically executed. This allows for proactive intervention in the operating parameters of multiple processing engines, reducing the current change rate of multiple processing engines within a predetermined timeframe. This smooths current spikes caused by sudden load changes and suppresses di / dt problems.

[0165] In summary, this embodiment extracts source event information that may cause di / dt problems during the operation of each processing engine within a predetermined time period in the future. Based on this, engine-level risk assessment and system-level fusion are performed. This allows the operating parameters of multiple processing engines to be adjusted in one or more working cycles before the current change occurs. This enables system-level di / dt risk control with lower circuit complexity and less additional power consumption without relying on complex data pulsation or dummy data injection.

[0166] Reference Figure 11This is a flowchart illustrating a processing engine control method proposed in Embodiment 2 of this application. Based on the processing engine control method described in the above embodiments, this embodiment describes a possible implementation method for how the above step S102 obtains the engine-level risk assessment result. Figure 11 As shown, the implementation method may include:

[0167] Step S111: Based on the source event information of each processing engine, determine whether the first state transition event and the second state transition event of the processing engine have been detected.

[0168] In this embodiment, the source event information of each of the multiple processing engines is obtained through the detection circuit. The source event information represents the current change trend of the corresponding processing engine during operation within a predetermined time in the future. By parsing and identifying the received source event information, it can be determined whether a specific state switching behavior exists, that is, whether a first state switching event or a second state switching event is detected.

[0169] The first state transition event indicates that the corresponding processing engine switches from a full-load state to an idle state. For example, based on the control logic of the multiply-accumulate array, it is determined that the multiply-accumulate array will switch from a maximum load state to an idle state after n cycles. The second state transition event indicates that the corresponding processing engine switches from an idle state to a full-load state. For example, based on the control logic of the multiply-accumulate array, it is determined that the multiply-accumulate array will switch from an idle state to a maximum load state after n cycles.

[0170] As can be seen, this embodiment, through real-time monitoring and analysis of source event information, can anticipate upcoming load changes in the processing engine, laying the foundation for subsequent accurate risk assessment.

[0171] Step S112: In response to the detection of the second state switching event, output the second risk contribution direction and the second risk contribution degree, and determine them as the engine-level risk assessment results of the corresponding processing engine.

[0172] Step S113: In response to the absence of a second state transition event and the detection of a first state transition event, output the first risk contribution direction and the first risk contribution degree, and determine them as the engine-level risk assessment results of the corresponding processing engine.

[0173] Step S114: In response to the absence of both the first state transition event and the second state transition event, output a data flip score, which is determined as the engine-level risk assessment result of the corresponding processing engine; the data flip score is determined based on the data flip event in the source event information of the processing engine.

[0174] In this embodiment, the engine-level risk assessment result may include the risk contribution direction and risk contribution degree of the corresponding processing engine. The risk contribution direction represents the direction of current change, such as the direction of current increase, the direction of current decrease, or no current change. The risk contribution degree represents the severity of the current change, that is, the severity of the risk of the current change rate.

[0175] Based on this, this embodiment can transform abstract state switching events into quantified engine-level risk assessment results, namely risk contribution direction and risk contribution degree, through priority-based multi-condition judgment logic. The risk contribution degree is illustrated using discrete numerical scores. When a second state switching event is detected in the current processing engine, it indicates that the processing engine is about to enter a high-load state, which will cause a sharp increase in current and trigger a severe high-current transient problem, i.e., a severe di / dt problem. At this time, the second risk contribution direction and the second risk contribution degree are directly output as the engine-level risk assessment results for this processing engine. The second risk contribution direction is defined as the direction of current increase, and the second risk contribution degree is set to a positive value to reflect a positive risk accumulation effect in subsequent system-level fusion calculations.

[0176] If no second state transition event is detected, but a first state transition event is detected, it indicates that the processing engine is about to switch from full load to idle, which will cause a rapid drop in current. In this case, the first risk contribution direction and the first risk contribution degree are output as engine-level risk assessment results. The first risk contribution direction is defined as the direction of current decrease, and the first risk contribution degree is set to a negative value to reflect the reverse electrical stress caused by the current reduction.

[0177] If neither the first nor the second state transition event is detected, it indicates that the processing engine is in normal operating condition, but drastic changes in its input data may still cause current fluctuations. In this case, the di / dt risk can be determined based on the data flipping event in the source event information of the processing engine, and a data flipping score can be output as the engine-level risk assessment result. This data flipping score reflects the degree of change in the input data flipping rate of the corresponding processing engine. This can be determined by following the mapping relationship between different degrees of increase or decrease in the input data flipping rate and the values ​​within the range of the data flipping score, thus determining the data flipping score mapped to the current degree of change in the input data flipping rate.

[0178] As can be seen, this embodiment, through this hierarchical and progressive risk assessment method, can comprehensively cover all kinds of potential risk sources, ensuring the accuracy and robustness of the risk assessment results of each processing engine. This makes the previously unpredictable micro-current change rate quantifiable and trackable, providing the necessary data foundation for subsequent overall frequency regulation.

[0179] Furthermore, when the engine-level risk assessment result includes risk contribution direction and risk contribution degree, this embodiment can describe the method of fusing the engine-level risk assessment results corresponding to each processing engine in the above step S103 to obtain the system-level risk assessment result. After the system-level assessment circuit in the risk assessment circuit receives the engine-level risk assessment results from all the processing engines participating in the assessment, in one possible implementation, the risk contribution degree corresponding to each processing engine can be summed based on the risk contribution direction of each processing engine to obtain the system-level risk assessment result.

[0180] Based on this, since the engine-level risk assessment results include directional attributes representing the trend of current changes and numerical magnitudes representing the severity of changes, the system-level assessment circuit extracts the risk contribution values ​​of each processing engine and retains their sign attributes. For example, the positive risk contribution generated by switching from idle to full load is recorded as a positive number, and the negative risk contribution generated by switching from full load to idle is recorded as a negative number. Changes in data flip rate are assigned corresponding positive or negative scores based on their upward or downward trends. Subsequently, the system-level assessment circuit performs an algebraic summation operation on these signed risk contribution values, such as by... Figure 7 The cascaded adder shown is an example. Alternatively, this application can also use an accumulator to accumulate the risk assessment results of each processing engine according to the work cycle.

[0181] In practical applications, if a neural network processor chip contains four processing engines with risk contributions of +5, +5, -5, and -2 respectively, the system-level risk assessment result, according to the aforementioned preset fusion method, is the algebraic sum of these four values, which is 3. By directly summing these values, the potential dynamic current transient risks dispersed locally in each processing engine can be aggregated into a global system-level indicator. This process does not require complex weight allocation logic and is suitable for scenarios where the importance of each processing engine is equal and system computing resources are limited. It can achieve rapid prediction of overall current surge risk with relatively low hardware overhead.

[0182] In some implementation scenarios, considering the varying degrees of impact of different processing engines on the overall system power consumption and current change rate, preset fusion weights can be introduced during the fusion of risk assessment results from each engine. These fusion weights can be parameters pre-configured during the system initialization phase based on the computing power ratio, data throughput, and dynamic load capacity of each processing engine in a specific application scenario, but are not limited to these. These fusion weights can be stored in registers within the device / system for the risk assessment circuitry to access.

[0183] Based on this, the system-level evaluation circuit can multiply the risk contribution of each received processing engine by its corresponding fusion weight to obtain a weighted risk contribution after importance correction. Subsequently, the weighted risk contributions of all processing engines are summed to obtain the final system-level risk assessment result. This system-level evaluation circuit can be a weighted summation circuit, which can be composed of multipliers, shift adders, and weight registers, etc., utilizing the operational principles of each logic device to achieve the weighted summation of the risk assessment results at the engine level, but is not limited to this.

[0184] For example, the default weight of the main processing engine responsible for core neural network inference can be set to a higher value, such as 1.5, while the default weight of the auxiliary data preprocessing engine can be set to a lower value, such as 0.8. Through this fusion method, even if a low-priority processing engine experiences a drastic current change, its interference with the system-level risk assessment results will be suppressed, while minor changes in high-priority processing engines will be amplified. This weighted summation fusion method makes the system-level risk assessment results more closely match the load characteristics of the actual physical system, improving the accuracy of dynamic frequency modulation strategy triggering.

[0185] In some other embodiments, such as implementation scenarios for resource-sensitive or specific critical path protection, this application may also adopt a selective fusion approach to implement step S103. In this case, the system does not include all processing engines in the calculation scope of system-level risk assessment, but filters them according to pre-set priority rules. That is, based on the priority of each of the multiple processing engines, some processing engines are selected. Then, based on the risk contribution direction of each of the partial processing engines, the risk contribution of each of the partial processing engines is fused to obtain the system-level risk assessment result.

[0186] The aforementioned priorities can be dynamically determined based on the functional attributes of the processing engines, such as control units being prioritized over computing units, historical failure frequency, or real-time load status, but are not limited to these. In this way, the system-level evaluation circuit traverses the priority identifiers of all processing engines and, according to preset selection thresholds or fixed quantity limits, selects a subset of processing engines as key monitoring targets. For example, in a complex on-chip system with ten processing engines, the system may select only the three highest-priority processing engines to participate in the system-level risk assessment.

[0187] To address this, a masking circuit can be used to mask the engine-level risk assessment results of some processing engines based on priority or a mask configured accordingly, allowing the engine-level risk assessment results of the unmasked processing engines to participate in the system-level risk assessment. Optionally, this application can also use a multiplexer or a priority arbitration circuit to select the engine-level risk assessment results to participate in the fusion in the manner described above. This application does not limit the implementation method of the fusion selection or the circuit structure supporting its implementation.

[0188] Subsequently, the system-level evaluation circuit only merges the risk contribution and risk contribution direction of the selected partial processing engines. The fusion method here can be direct summation or weighted summation, or other preset fusion methods described in this application, while ignoring the risk contribution of other low-priority processing engines.

[0189] As can be seen, the selective fusion method proposed in this embodiment can concentrate limited computing resources and monitoring attention on the critical paths most likely to cause system-level crashes. By focusing on the risk contribution of key processing engines, it can further reduce the power consumption and latency of the risk assessment circuit itself while ensuring core security. This is particularly suitable for embedded artificial intelligence acceleration scenarios with extremely high response speed requirements and clearly defined key engines.

[0190] Reference Figure 12 This is a flowchart illustrating a processing engine control method proposed in Embodiment 3 of this application. Based on the processing engine control method described in the above embodiments, this embodiment describes a possible implementation method for adjusting the working parameters of the processing engine in step S104. Figure 12 As shown, the implementation method may include:

[0191] Step S121: Determine the preset risk range to which the system-level risk assessment results belong.

[0192] Step S122: Determine the working parameter adjustment strategy corresponding to the preset risk range.

[0193] Step S123: Based on the determined operating parameter adjustment strategy, adjust the operating parameters of multiple processing engines to reduce the current change rate of multiple processing engines.

[0194] In this embodiment, following the fusion method described above, the engine-level risk assessment results corresponding to multiple processing engines are merged into a system-level risk assessment result. This system-level risk assessment result can be a quantified total score or a comprehensive score value, which can directly reflect the risk level and direction of drastic current changes (i.e., di / dt problems) in the entire system within a predetermined timeframe. Therefore, when the system-level risk assessment result is positive and has a large absolute value, it indicates that a large number of processing engines in the system are about to switch from an idle state to a full-load state, and the current shows an upward trend; if it is negative, it indicates that a large number of processing engines are about to switch from a full-load state to an idle state, and the current shows a downward trend.

[0195] To achieve precise responses to different risk levels, multiple non-overlapping preset risk ranges are pre-defined, each mapped to a unique and definite operational parameter adjustment strategy. The system-level risk assessment results can be compared with these preset risk ranges to determine which range the results fall into. The corresponding operational parameter adjustment strategy is then applied according to the strategy mapped to that range, such as through automatic table lookup.

[0196] For example, taking the clock parameter, such as the clock signal frequency, as an example, the operating parameter adjustment strategy is a frequency modulation strategy. The preset risk range is divided into five levels: the first preset risk range, the second preset risk range, the third preset risk range, the fourth preset risk range, and the fifth preset risk range. The first preset risk range corresponds to a low risk score, such as [-5, 5). In this case, the system current change is considered stable, requiring no intervention, and the corresponding frequency modulation strategy is to maintain the current clock frequency unchanged. The second preset risk range corresponds to a relatively high positive risk, such as [5, 12), and its corresponding frequency modulation strategy is a slight frequency reduction. The third preset risk range corresponds to an extremely high positive risk, such as [12, 20), and its corresponding frequency modulation strategy is a moderate to severe frequency reduction. The fourth preset risk range corresponds to a relatively high negative risk, such as [-12, -5), and its corresponding frequency modulation strategy is a slight frequency reduction. The fifth preset risk range corresponds to an extremely high negative risk, such as [-20, -12), and its corresponding frequency modulation strategy is a moderate to severe frequency reduction.

[0197] Different frequency modulation strategies determined according to the above method result in different adjustments to the operating states of multiple processing engines. Compared to traditional methods that only passively respond after a drastic current change, this application introduces refined timing control logic into the frequency modulation strategy to proactively adjust the frequency within a predetermined time window before a drastic current change occurs. If the processing engines typically share the same clock source, the clock control circuit can adjust the clock frequency of the shared clock signal supplied to multiple processing engines, achieving system-level overall planning. In this frequency modulation method, the clock control circuit can control the divider to change the division ratio, or control the phase-locked loop to reduce the multiplication factor, or control the clock selection circuit to select a lower frequency clock source. This adjusts the frequency of the shared clock signal supplied to multiple processing engines within one or more consecutive target working cycles within a predetermined time window, and restores the clock frequency to its original frequency after the target working cycle, but is not limited to this implementation. In this case, the frequency modulation actions of multiple processing engines can remain synchronized. Its circuit structure is relatively simple, and the control logic is unified, making it suitable for scenarios where multiple processing engines have consistent risk directions, the system-level risk assessment result is high, and a unified pre-emptive frequency reduction is required.

[0198] Optionally, if multiple processing engines can each receive their own clock signals, the clock control circuit can, after generating a base clock signal, provide corresponding clock signals to multiple processing engines through multiple clock branches. Each clock branch may include at least one of a frequency divider, a clock gating circuit, and a clock selection circuit. The clock control circuit is coupled to each clock branch and is configured to output independent control signals to each clock branch based on system-level risk assessment results and / or engine-level risk assessment results, so as to independently adjust the clock frequency of each processing engine. It can be seen that the separate frequency adjustment of multiple processing engines in this embodiment is achieved through a common-source frequency division method, that is, the clock signals of multiple processing engines originate from the same base clock signal, but have the same or different frequencies after passing through different frequency dividers or clock control circuits. This can maintain clock homogeneity to a certain extent, facilitating synchronous processing. Of course, this separate frequency adjustment can also be achieved through an independent clock source method, that is, each processing engine receives clock signals from different clock generation circuits. This method offers flexible control, but requires consideration of cross-clock domain synchronization issues; the implementation process is not detailed in this embodiment.

[0199] By adjusting the frequency of multiple processing engines separately, the risk contribution of each processing engine can be controlled differently. This reduces unnecessary performance loss while suppressing di / dt. It is suitable for scenarios where some processing engines have risks, the risk contribution of each processing engine is uneven, or it is necessary to prioritize the performance of some processing engines.

[0200] Optionally, the clock control circuit can also select between shared clock frequency adjustment and separate frequency adjustment, or a combination of both, based on the system-level risk assessment results. For example, the clock control circuit may include a mode selection circuit that determines whether to use shared clock frequency adjustment or separate frequency adjustment based on at least one of the following: system-level risk assessment results, engine-level risk assessment results, number of processing engines, task type, and register configuration information. For example, if the system-level risk assessment result is high and the risk contribution direction of multiple processing engines is consistent, the mode selection circuit can choose to use shared clock frequency adjustment to uniformly reduce the shared clock frequency of multiple processing engines; if the system-level risk assessment result is in the medium risk range and only some processing engines have a high risk contribution, the mode selection circuit can choose to use separate frequency adjustment to reduce the frequency only for processing engines with high risk contribution, while maintaining the original frequency or reducing the frequency of other processing engines by a small amount.

[0201] In addition, the clock control circuit can first use a common clock frequency modulation method to uniformly reduce the frequency of multiple processing engines, and then adjust the frequency of the processing engines with higher risk contribution according to the engine-level risk assessment results of each processing engine; or, first use a separate frequency modulation method to reduce the frequency of the processing engines with higher risk contribution, and if the system-level risk assessment results still do not reduce to the safe range, then use a common clock frequency modulation method to uniformly reduce the frequency of multiple processing engines. This application does not limit the frequency modulation method of multiple processing engines and can flexibly choose according to the situation.

[0202] In summary, this embodiment, through this risk classification mapping method, can intuitively transform abstract system-level risk contribution values ​​(such as scores) into hardware-executable frequency modulation instructions, thereby avoiding the response lag or over-intervention problems caused by applying a uniform fixed strategy to all scenarios.

[0203] In one possible implementation, the operating parameter adjustment strategy, i.e., the frequency modulation strategy, determined by the above method includes: reducing the frequency of the shared clock signal supplied to the multiple processing engines at least once within one or more consecutive target working cycles within a predetermined time window, and restoring the clock frequency to its original frequency after the target working cycle. In this case, the number of reductions, the depth of reduction relative to the original frequency, and / or the position of the reduction cycle differ for different preset risk intervals. The shape of the frequency modulation curve is determined by the combination of these three dimensions, enabling it to accurately match the risk severity represented by different preset risk intervals.

[0204] The number of downsampling cycles refers to the number of times the clock frequency is reduced within a predetermined time window. For preset risk ranges with mild risk, such as the second or fourth preset risk range mentioned above, the corresponding strategy may only require a single frequency downsampling at a specific point within the time window. However, for preset risk ranges with severe risk, such as the third or fifth preset risk range mentioned above, the corresponding strategy requires multiple frequency downsampling cycles within one or more consecutive target duty cycles to achieve a smoother transition. The downsampling depth refers to the proportion or magnitude of the clock frequency reduction relative to the original frequency. For example, the downsampling depth can be set to reduce the frequency to half (half frequency) or one-third of the original frequency, etc., without limitation. For ranges with higher risk levels, a larger downsampling depth is usually required to effectively suppress the slope of current peaks or valleys. The downsampling cycle position refers to the specific moment within the predetermined time window when the frequency downsampling action occurs.

[0205] Depending on the direction of the system-level risk assessment result, the timing of frequency adjustment falls into two categories. When the system-level risk assessment result is positive, indicating a risk of current increase (i.e., an idle_to_max event), an early intervention frequency adjustment strategy is adopted to prevent a sharp current increase. For example, this strategy is executed in a positive high-risk interval outside the first preset risk interval (such as the second preset risk interval). When the system-level risk assessment result is negative, indicating a risk of current decrease (i.e., a max_to_idle event), a delayed buffering frequency adjustment strategy is adopted to prevent a sudden current drop. For example, this strategy is executed in a negative high-risk interval, such as the fourth preset risk interval.

[0206] Using the example above, which divides the data into multiple preset risk zones, when the first state transition event, i.e., the max_to_idle event, is detected, to prevent a sudden drop in current, the frequency adjustment strategy corresponding to the negative high-risk zone, such as the fourth preset risk zone (e.g., [-12, -5)), can be as follows: In the last high-power cycle (i.e., the target operating cycle mentioned above) of the predetermined time window, the frequency of the common clock signal is lowered at least once to half frequency to slow down the load unloading speed, and then the original frequency is restored. If the risk is higher, such as entering the fifth preset risk zone (e.g., [-20, -12)), the corresponding frequency adjustment strategy can be as follows: Lower the frequency to half frequency in the penultimate high-power cycle (target operating cycle), lower it to one-third frequency in the last high-power cycle, and then restore the original frequency.

[0207] Upon detecting the second state transition event, i.e., the idle_to_max event, an early intervention strategy is adopted to prevent a sharp increase in current. Optionally, the frequency modulation strategy corresponding to the second preset risk range (e.g., [5, 12)) outside the first preset risk range can be: during the first high-power cycle (target operating cycle) of the predetermined time window, the frequency of the shared clock signal is reduced at least once to half frequency, and then the clock frequency is restored to the original frequency after the end of the target operating cycle. If the risk is higher, such as entering the third preset risk range (e.g., [12, 20)), the corresponding frequency modulation strategy can be: reducing the frequency to one-third frequency in the first high-power cycle, reducing it to half frequency in the second high-power cycle, and so on, gradually releasing the pressure, etc.

[0208] As can be seen, this embodiment constructs a mapping relationship between a preset risk range and a frequency modulation strategy (a working parameter adjustment strategy), and refines the adjustment strategy into a dynamic frequency modulation sequence that includes the number of down-adjustments, the down-adjustment depth, and the period position. This enables the system to proactively and accurately adjust the frequency before the di / dt problem occurs. This proactive intervention method not only effectively reduces the current change rate of multiple processing engines and eliminates the late response defect of analog schemes, but also has lower circuit complexity and power consumption compared to traditional pulsed input schemes, achieving fine-grained control over the current changes of the entire system.

[0209] For example, with Figure 9 Taking the NPU system architecture shown as an example, we illustrate how differentiated configurations of the number of downsampling cycles, the downsampling depth relative to the original frequency, and / or the downsampling cycle position corresponding to different preset risk ranges achieve graded response. We further explain each frequency modulation strategy by combining the timing waveforms of the four processing engines in the NPU system switching from idle to full load and the data flip rate of one processing engine increasing. For example... Figure 13 As shown, if three Engines will enter the idle_to_max state, and one Engine will experience an input data flip rate increase to level 3 (i.e., its risk contribution is 3), the system-level risk assessment result is: 5+5+5+3=18. The frequency modulation strategy corresponding to the third preset risk range [12, 20) is then executed, as follows... Figure 13 The timing waveform diagram is shown below. Figure 14 As shown, if two engines will enter the idle_to_max state, one engine will enter the max_to_idle state, and one engine will have its input data flip rate increase to level 3 (i.e., risk contribution of 3), the system-level risk assessment result is: 5 + 5 + (-5) + 3 = 8. The frequency modulation strategy corresponding to the second preset risk interval [5, 12) is executed, as follows... Figure 14 The timing waveform diagram is shown below. Figure 15 As shown, if two engines will enter the idle_to_max state, one engine will enter the max_to_idle state, and one engine will experience an input data flip rate drop to level 2 (i.e., its risk contribution is -2), then the system-level risk assessment result is: 5 + 5 + (-5) + (-2) = 3. The frequency modulation strategy corresponding to the first preset risk interval [-5, 5) is executed, as follows... Figure 15 The timing waveform diagram without frequency modulation is shown. Figure 16As shown, if three Engines will enter the max_to_idle state, and one Engine will experience a drop in flip rate to level 4 (i.e., its risk contribution is -4), then the system-level risk assessment result is: (-5) + (-5) + (-5) + (-4) = -19. The frequency modulation strategy corresponding to the fifth preset risk interval [-20, -12) is executed, as follows... Figure 16 The timing waveform diagram is shown.

[0210] The aforementioned risk interval boundaries, frequency levels, and window lengths can all be pre-configured via registers. When the operating parameters also include the supply voltage, a similar interval-based strategy can be used to adjust the supply voltage; the implementation process is not detailed in this application. Furthermore, it should be understood that the above embodiments are merely illustrative examples of this application, and this application is not limited thereto. The specific implementation methods of the detection circuit, risk assessment circuit, and control circuit, the specific types of source event information, the specific algorithms for risk assessment, the specific methods of system-level fusion, and the specific strategies for adjusting operating parameters can all be set according to actual circuit and application requirements. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

[0211] In summary, the frequency modulation method described above allows for downsampling of the common clock frequency within the anticipated window of drastic current changes, and restoration of the original frequency after the target duty cycle. The downsampling occurs before the actual di / dt surge, reducing the current fluctuation at its source, while the frequency is restored immediately upon the end of the window, limiting performance loss to a few target duty cycles. The number of downsampling cycles, their depth, and the cycle position vary with the risk range, achieving gradient frequency modulation where higher risk, stronger intervention, and more precise intervention location are achieved, avoiding the performance waste caused by a one-size-fits-all frequency reduction.

[0212] Reference Figure 17 This is a schematic diagram of the hardware structure of an electronic device according to Embodiment 1 of this application. This electronic device can be an artificial intelligence chip, neural network processor, AI accelerator card, system-on-a-chip, multi-core processor, data center server, edge computing device, smart terminal, or autonomous driving computing platform, etc. This application does not limit the product form of the electronic device. Figure 17 As shown, the electronic device includes a processing engine control unit 100 and multiple processing engines 200. The composition and structure of the processing engine control unit 100 can be referred to the description of the device embodiment above, and will not be repeated here. The processing engine 200 may include at least one of a MAC array, a computing unit, a storage subsystem, a control scheduling module, a data flow engine, etc.

[0213] In some embodiments, such as Figure 18As shown, the electronic device may further include a clock generation circuit 300 and / or a power management circuit 400. The control circuit 130 in the processing engine control device 100 can output control signals to the clock generation circuit 300 and / or the power management circuit 400 to adjust the operating parameters of multiple processing engines. For example, the operating parameters may include clock-related parameters and / or power supply-related parameters. However, this application is not limited to this; the operating parameters may also be other parameters that can affect the rate of change of the processing engine current. The operating principle of the clock generation circuit 300 can be referred to the above description of the clock control circuit 131, and the power management circuit 400 can be referred to the above description of the voltage control circuit 132. These details are not elaborated here.

[0214] Furthermore, the electronic device may also include memory, a main control processor, and a bus. Multiple processing engines 200, a processing engine control unit 100, memory, and the main control processor can be coupled via a bus. The main control processor can assign computing tasks to the multiple processing engines 200. The detection circuit 110 in the processing engine control unit 100 can acquire source event information based on task allocation information, control logic, data flow information, etc., thereby predicting the current change trend within a predetermined timeframe.

[0215] In this embodiment, the electronic device performs system-level risk prediction and advance control of multiple processing engines 200 through the processing engine control device 100, which can adjust the operating parameters before drastic current changes occur, thereby improving the power integrity and operational reliability of the electronic device.

[0216] This application also proposes a neural network processing system, such as an NPU system, which may include multiple processing engines, each including a MAC array; a processing engine control device, which includes a detection circuit, a risk assessment circuit, and a control circuit; a clock generation circuit, which is coupled to the multiple processing engines, for providing clock signals to the multiple processing engines; and a power management circuit, which is coupled to the multiple processing engines, for providing power supply voltage to the multiple processing engines.

[0217] Optionally, the neural network processing system may also include a control module and registers. The control module may store predefined configuration information such as control source and gear division. Registers may store configuration information such as threshold, fusion weight, and priority. The risk assessment circuit may fuse the engine-level risk assessment results of each engine based on the register configuration information to obtain a system-level risk assessment result. The control circuit may determine the corresponding operating parameter adjustment strategy based on the system-level risk assessment result and perform the adjustment one or more working cycles in advance to reduce the current change rate of multiple processing engines. The implementation process can be referred to the description in the corresponding section of the above embodiment.

[0218] As can be seen, in this embodiment, the neural network processing system acquires source event information from multiple processing engines in advance through detection circuitry, performs engine-level evaluation and system-level fusion through risk assessment circuitry, and adjusts the clock and / or power supply in advance through control circuitry, thereby achieving system-level di / dt risk control when multiple processing engines work collaboratively. Compared to solutions targeting only a single MAC array, this application can coordinate the states of multiple processing engines, improving the overall system reliability; compared to analog detection schemes, this application can predict risks in advance; compared to data pulse input and dummy data injection schemes, this application has lower circuit complexity and less additional power consumption.

[0219] Finally, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the accompanying drawings of the device embodiments provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0220] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially as a computer program product. The various embodiments in this specification are described in a progressive or parallel manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the methods, devices, and systems disclosed in the embodiments, since they correspond to the apparatuses disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the apparatus section description. The above descriptions are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A processing engine control device, comprising: The detection circuit is configured to acquire source event information for each of the multiple processing engines, the source event information representing the current change trend of the corresponding processing engine during operation within a predetermined time period in the future; The risk assessment circuit, coupled to the detection circuit, is configured to assess the current change rate risk of each of the multiple processing engines based on the source event information of each of the multiple processing engines, and determine the system-level risk assessment result based on the obtained engine-level risk assessment results of each of the processing engines. A control circuit, coupled to the risk assessment circuit and the plurality of processing engines, is configured to adjust the operating parameters of the plurality of processing engines based on the system-level risk assessment results.

2. The apparatus according to claim 1, wherein the source event information includes at least one of the following: The first state transition event that instructs the corresponding processing engine to switch from a full-load state to an idle state; A second state transition event that instructs the corresponding processing engine to switch from an idle state to a full-load state; A data flipping event that characterizes the degree of change in the input data flipping rate of the corresponding processing engine.

3. The apparatus according to claim 1 or 2, wherein the risk assessment circuit comprises: Multiple engine-level evaluation circuits are respectively associated with the multiple processing engines. Each engine-level evaluation circuit is configured to determine the risk contribution direction and risk contribution degree of the corresponding processing engine based on the source event information of the corresponding processing engine, and use it as the engine-level risk evaluation result of the processing engine. A system-level evaluation circuit, coupled to each of the engine-level evaluation circuits, is configured to receive the risk assessment results of each of the engine-level circuits, and fuse the risk assessment results of each of the engine-level circuits according to a preset fusion method to obtain a system-level risk assessment result.

4. The apparatus of claim 3, wherein the engine-level evaluation circuit comprises: The first selection circuit is configured to output a first value or a data flip score based on a first state switching event in the source event information, wherein the data flip score is determined based on the data flip event in the source event information. The second selection circuit, coupled to the first selection circuit, is configured to output a second value or the output of the first selection circuit based on a second state switching event in the source event information, to determine the engine-level risk assessment result.

5. The apparatus of claim 3, wherein the system-level evaluation circuit comprises: The fusion circuit, coupled to the plurality of engine-level evaluation circuits respectively, is configured to receive the risk assessment results of each engine-level risk assessment and fuse them to obtain a system-level evaluation result. The decision output circuit, coupled to the fusion circuit, is configured to determine the corresponding operating parameter adjustment strategy based on the preset risk range to which the system-level evaluation result belongs, and output a strategy signal characterizing the operating parameter adjustment strategy. The control circuit is configured to receive the strategy signal and adjust the operating parameters of the plurality of processing engines based on the operating parameter adjustment strategy. The working parameter adjustment strategies differ for different preset risk ranges.

6. The apparatus according to claim 1, wherein the operating parameters include at least one of clock parameters and supply voltage; The control circuit includes at least one of the following: The clock control circuit is configured to adjust the clock parameters of the plurality of processing engines based on the system-level risk assessment results; A voltage control circuit is configured to adjust the power supply voltage supplied to the plurality of processing engines based on the results of the system-level risk assessment.

7. A method for processing engine control, comprising: Obtain source event information for each of the multiple processing engines, wherein the source event information characterizes the current change trend of the corresponding processing engine during operation within a predetermined time period in the future; Based on the source event information of each of the multiple processing engines, the current change rate risk of each processing engine is evaluated to obtain the engine-level risk assessment result of each processing engine. Based on the engine-level risk assessment results corresponding to each of the aforementioned processing engines, the system-level risk assessment results are determined; Based on the system-level risk assessment results, the operating parameters of the multiple processing engines are adjusted.

8. The method according to claim 7, wherein the step of assessing the current change rate risk corresponding to each of the plurality of processing engines based on the source event information of each of the plurality of processing engines, and obtaining the engine-level risk assessment result corresponding to each of the plurality of processing engines, includes: Based on the source event information of each processing engine, determine whether a first state transition event and a second state transition event of the processing engine have been detected; In response to the detection of the second state switching event, the second risk contribution direction and the second risk contribution degree are output and determined as the engine-level risk assessment result of the corresponding processing engine; In response to the absence of the second state transition event and the detection of the first state transition event, the first risk contribution direction and the first risk contribution degree are output and determined as the engine-level risk assessment result of the corresponding processing engine; In response to the absence of detection of the first state transition event and the second state transition event, a data flip score is output and determined as the engine-level risk assessment result of the corresponding processing engine. The data flipping score is determined based on the data flipping events in the source event information of the processing engine; The first state switching event indicates that the corresponding processing engine switches from a full-load state to an idle state, and the second state switching event indicates that the corresponding processing engine switches from an idle state to a full-load state. The second risk contribution direction is the upward direction of the current, and the second risk contribution degree is a positive value; The first risk contribution direction is the direction of current decrease, and the first risk contribution degree is negative.

9. The method according to claim 7, wherein the engine-level risk assessment result includes risk contribution direction and risk contribution degree, and the determination of the system-level risk assessment result based on the engine-level risk assessment results corresponding to each of the processing engines includes at least one of the following implementation methods: Based on the risk contribution direction of each processing engine, the risk contribution degree corresponding to each processing engine is summed to obtain the system-level risk assessment result; Based on the preset weights and risk contribution directions of the multiple processing engines, the risk contribution of each processing engine is weighted and summed to obtain the system-level risk assessment result. Based on the priority of each of the multiple processing engines, some of the processing engines are selected, and based on the risk contribution direction of each of the multiple processing engines, the risk contribution degree of each of the multiple processing engines is merged to obtain the system-level risk assessment result.

10. The method according to claim 7, wherein adjusting the operating parameters of the plurality of processing engines based on the system-level risk assessment results includes: Determine the working parameter adjustment strategy corresponding to the preset risk range to which the system-level risk assessment results belong; Based on the aforementioned operating parameter adjustment strategy, the operating parameters of the plurality of processing engines are adjusted to reduce the current variation rate of the plurality of processing engines. The determined working parameter adjustment strategy includes: reducing the frequency of the shared clock signal supplied to the multiple processing engines at least once during one or more consecutive target working cycles within a predetermined time window, and restoring the clock frequency to the original frequency after the target working cycle; The number of downsampling intervals, the downsampling depth relative to the original frequency, and / or the downsampling period position are different for different preset risk intervals.