Chip-driven automatic adaptation and performance optimization method
By constructing a running feature tensor and a stability risk prediction model, the core voltage, frequency, and load scheduling phase of the chip are adaptively adjusted, solving the problem of balancing performance and stability in highly integrated chips under complex operating conditions, and achieving efficient performance and reliability optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING AEROSPACE LEGIONE TECH CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies struggle to balance performance and stability in highly integrated system-on-a-chip (SoC) systems under complex transient conditions, especially when frequently switching between millisecond-level high-frequency burst loads and long-cycle low-power standby states. They cannot effectively identify and predict metastable logic errors caused by the superposition of transient power supply ripple and load phase, leading to the accumulation of hidden faults. Furthermore, they lack the ability to coupled model and predict risks based on multi-dimensional operating characteristics.
By collecting the chip's operational characteristic data, constructing an operational characteristic tensor, extracting extreme value envelope samples, establishing a stability risk boundary function, and constructing a stability risk prediction model, adaptively adjusting the risk gradient vector, and collaboratively optimizing the core voltage, frequency, and load scheduling phase, the system can actively predict and suppress metastable errors.
It significantly reduces the probability of random instability during long-term operation, improves the reliability and repeatability stability of the chip under complex transient load scenarios, and achieves simultaneous optimization of performance and reliability while ensuring that the stability boundary is not breached, with higher adjustment accuracy and energy efficiency ratio.
Smart Images

Figure CN122113779B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chip performance tuning technology, and more specifically to a method for automatic chip driver adaptation and performance optimization. Background Technology
[0002] With the widespread application of highly integrated system-on-chips in edge computing terminals, industrial online inspection equipment, and unattended intelligent equipment, single-chip platforms often need to frequently switch between millisecond-level high-frequency burst loads and long-cycle low-power standby states. Moreover, the operating environment may be accompanied by non-ideal conditions such as low temperature, low air pressure, or power supply fluctuations. Existing dynamic adjustment mechanisms based on fixed frequency levels or single temperature thresholds have lag in response and single adjustment dimensions, making it difficult to identify extremely low-probability metastable logic errors caused by the superposition of transient power supply ripple and load phase. Although the trigger probability of such errors is extremely small, they can accumulate and amplify in long-cycle continuous operation scenarios, leading to hidden faults such as abnormal cache refresh, intermittent data verification failure, or brief loss of synchronization of encryption modules. Existing technologies lack the ability to couple and model the multi-dimensional operating characteristics of chips and predict risks, and cannot achieve synergistic optimization of performance and energy consumption while ensuring microscopic stability. Therefore, there is an urgent need for a method that can achieve self-driven automatic adaptation and performance optimization based on the internal operating characteristics of chips to solve the technical problem of difficulty in balancing performance and stability under complex transient conditions. Summary of the Invention
[0003] The purpose of this invention is to provide a chip driver-based automatic adaptation and performance optimization method to address the shortcomings in the prior art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for automatic chip driver adaptation and performance optimization, comprising:
[0005] When the target chip is in its initial operating state, the raw operating data stream within the first time window is collected and time alignment processing is performed to extract the baseline operating feature set and the corresponding phase feature vector.
[0006] Based on the benchmark operating feature set and the corresponding phase feature vector, a micro-pulse load sequence with a variable perturbation phase θ is applied to the target chip, dynamic response data is collected under different θ conditions, and an operating feature tensor is constructed.
[0007] Based on the aforementioned running feature tensor, extreme value envelopes are extracted from the nonlinear boundaries between each amplitude feature, phase coupling feature, and metastable error probability to construct a stability risk boundary function, and a stability risk prediction model is established to output the risk coefficient and risk gradient vector.
[0008] Obtain the real-time running feature set and real-time phase feature vector in the actual application scenario, and input them into the stability risk prediction model to obtain the risk coefficient and risk gradient vector;
[0009] Under the condition that the risk coefficient is less than the preset risk threshold, a multi-objective constraint optimization process is constructed based on the risk gradient vector to obtain the optimal feature adjustment vector;
[0010] The optimal feature adjustment vector is decomposed into voltage regulation component, frequency regulation component and load scheduling phase regulation component, and the core voltage, core frequency and load scheduling phase are optimized in a coordinated manner.
[0011] Preferably, the reference operating feature set includes core voltage, core frequency, transient power ripple amplitude, temperature, load burst cycle and command throughput, and the phase feature vector is the phase difference and synchronization offset between each operating feature.
[0012] Preferably, the step of applying a micropulse load sequence with a variable perturbation phase θ to the target chip and acquiring dynamic response data under different θ conditions includes:
[0013] Under the constraints of the reference operating feature set and phase feature vector, the perturbation phase scanning interval and scanning step size are determined based on the phase difference values between each operating feature in the phase feature vector, and a perturbation phase parameter sequence covering multiple phase difference nodes is generated.
[0014] According to the perturbation phase parameter sequence, a micro-pulse load is triggered at the time offset position corresponding to each perturbation phase parameter, so that the micro-pulse load and the core voltage reference phase form a preset time offset relationship.
[0015] During each period of perturbation phase parameter, dynamic response data is acquired at a sampling frequency consistent with that of the baseline operating characteristic sampling, and the corresponding metastable error probability is calculated.
[0016] The operational feature data, phase feature data, and metastable error probability obtained under different perturbation phase parameters are indexed and associated according to the order of perturbation phase parameters to construct an operational feature tensor.
[0017] Preferably, the steps for calculating the metastable error probability include:
[0018] Within the time interval of the micro-pulse load corresponding to each perturbation phase parameter, the error capture circuit is activated to compare the instruction submission result, register write-back result and cache verification result of the target chip cycle by cycle, and record the number of events of logic flip anomaly or verification inconsistency.
[0019] After completing the event recording, the total number of sampling periods within the time interval corresponding to the disturbance phase parameter is used as the statistical base, and the number of abnormal events is subjected to de-jitter filtering. The de-jitter filtering process is to regard the same address anomaly that occurs repeatedly within two consecutive periods as a single valid anomaly.
[0020] The instantaneous error ratio is calculated based on the number of effective anomalies after screening and the statistical base, and then the arithmetic mean is applied to the results of multiple cyclic tests with the same perturbation phase parameters.
[0021] The error ratio after arithmetic averaging is determined as the metastable error probability corresponding to the perturbation phase parameter.
[0022] Preferably, the step of constructing the stability risk boundary function and establishing a stability risk prediction model for outputting risk coefficients and risk gradient vectors includes:
[0023] The metastable error probabilities corresponding to different perturbation phase parameters in the running feature tensor are sorted, and the feature combination with the largest error probability in the same amplitude feature interval is extracted as the boundary candidate point. The boundary candidate set is formed according to the combination relationship between amplitude feature and phase coupling feature.
[0024] The candidate boundary set is subjected to multidimensional surface fitting, and an envelope surface is constructed by piecewise polynomial fitting. The envelope surface is defined as a stability risk boundary function.
[0025] Using the stability risk boundary function as a constraint, a risk mapping relationship is constructed so that any combination of input running features can be mapped to the corresponding risk coefficient.
[0026] The partial derivatives of the risk mapping relationship are calculated to obtain the rate of change vector of each operating feature with respect to the risk coefficient, and the rate of change vector is defined as the risk gradient vector, thereby forming a stability risk prediction model.
[0027] Preferably, the step of constructing the risk mapping relationship using the stability risk boundary function as a constraint includes:
[0028] The amplitude features and phase coupling features in the running feature tensor are normalized to obtain a standardized feature vector with a uniform scale.
[0029] The standardized feature vector is input into the stability risk boundary function, the minimum distance value from the feature vector to the envelope surface of the stability risk boundary function is calculated, and the minimum distance value is used as an intermediate variable for risk mapping.
[0030] A monotonically increasing mapping function is constructed to convert the minimum distance value into a risk coefficient. The monotonically increasing mapping function is obtained by segmenting and calibrating the metastable error probability in the historical running feature tensor.
[0031] Establish a one-to-one mapping relationship between the standardized feature vectors and their corresponding risk coefficients.
[0032] Preferably, the steps of obtaining the real-time running feature set and real-time phase feature vector and outputting the risk coefficient and risk gradient vector include:
[0033] In actual application scenarios, the core voltage, core frequency, transient power supply ripple amplitude, temperature, load burst cycle and command throughput are synchronously collected at the same sampling frequency as the baseline operating feature acquisition. Based on the core voltage reference phase, the real-time phase difference of each operating feature is calculated to form a real-time operating feature set and a real-time phase feature vector.
[0034] The real-time running feature set and real-time phase feature vector are subjected to normalization processing consistent with the stability risk prediction model construction stage to generate standardized real-time feature vectors.
[0035] The standardized real-time feature vector is input into the stability risk boundary function and risk mapping relationship to calculate the corresponding minimum distance value and map it to the real-time risk coefficient.
[0036] The risk calculation process is repeated for each standardized real-time feature variable to obtain the rate of change of each feature with respect to the risk coefficient, thereby forming a risk gradient vector.
[0037] Preferably, the step of constructing a multi-objective constrained optimization process based on the risk gradient vector and solving for the optimal feature adjustment vector includes:
[0038] The current standardized real-time feature vector is used as the initial solution, the risk gradient vector is used as the risk change direction vector, and a performance objective function is constructed. The performance objective function aims to optimize the instruction throughput per unit power consumption, while setting the risk coefficient to be less than a preset risk threshold as a constraint.
[0039] Provided that the risk coefficient is less than the preset risk threshold, a step search is performed in the opposite direction of the risk gradient vector, and the updated performance objective function value and risk coefficient value are calculated at each step.
[0040] The search process stops when the performance objective function value reaches a local maximum and further steps will cause the risk coefficient to approach the preset risk threshold.
[0041] The difference between the change in the feature variable corresponding to the local optimum and the initial standardized real-time feature vector is determined as the optimal feature adjustment vector.
[0042] Preferably, the performance objective function is defined as: performance objective function value = instruction throughput ÷ power consumption per unit time; where: instruction throughput is the number of valid instructions completed per unit time; power consumption per unit time is the product of average voltage and average current within the time window.
[0043] Preferably, the steps of decomposing the optimal feature vector and performing collaborative optimization include:
[0044] The optimal feature adjustment vector is decomposed according to the feature category, and the voltage regulation component corresponding to the core voltage, the frequency regulation component corresponding to the core frequency, and the load scheduling phase regulation component corresponding to the phase coupling feature are extracted. The amplitude constraint verification is performed on each regulation component.
[0045] Based on the voltage-frequency correspondence between the voltage regulation component and the frequency regulation component, the core voltage and core frequency are synchronously proportionally converted.
[0046] The time offset of the load triggering moment relative to the core voltage reference phase is recalculated based on the load scheduling phase adjustment component, and the load scheduling timing parameters are updated.
[0047] Within the same time window, the core voltage, core frequency, and load scheduling phase are updated synchronously to achieve a collaborative and optimized operating state under controlled risk conditions.
[0048] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0049] 1. This invention constructs a running feature tensor and extracts extreme value envelope samples to establish a stability risk boundary function, thereby accurately characterizing the nonlinear relationship between metastable error probability, amplitude characteristics, and phase coupling characteristics. Compared to existing technologies that adjust based solely on temperature or power consumption thresholds, this invention can quantify the risk level in advance through minimum distance calculation and risk mapping before metastable errors are explicitly triggered, and provides a clear adjustment direction through the risk gradient vector. This enables proactive prediction and suppression of the superposition effect of small phase disturbances and transient power supply ripples, significantly reducing the probability of random instability during long-cycle operation and improving the reliability and repeatable operational stability of the chip under complex transient load scenarios.
[0050] 2. Under the constraint that the risk coefficient is less than a preset risk threshold, this invention constructs a multi-objective constraint optimization process with the instruction throughput per unit power consumption as the objective. It coordinates and optimizes the core voltage, core frequency, and load scheduling phase, not only avoiding performance redundancy or energy waste that may result from single voltage and frequency adjustments, but also achieving refined performance improvement through phase-level scheduling correction. While ensuring that the stability boundary is not breached, this invention can dynamically approach the performance extreme point, achieving simultaneous optimization of performance and reliability, and possessing higher adjustment accuracy, stronger environmental adaptability, and a better energy efficiency ratio. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0052] Figure 1 This is a flowchart of a chip driver-based automatic adaptation and performance optimization method according to the present invention.
[0053] Figure 2 This is a flowchart of the method for solving the optimal feature adjustment vector according to the present invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] For examples, please refer to Figure 1 , 2 As shown in this embodiment, a chip driver-based automatic adaptation and performance optimization method includes:
[0056] When the target chip is in its initial operating state, the raw operating data stream within the first time window is collected and time alignment processing is performed to extract the baseline operating feature set and the corresponding phase feature vector.
[0057] In this embodiment, the reference operating feature set includes core voltage, core frequency, transient power ripple amplitude, temperature, load burst cycle, and command throughput, and the phase feature vector is the phase difference and synchronization offset between each operating feature.
[0058] When the target chip is in its initial operating state, a first time window is first determined. This first time window is a continuous time interval, with a length set to be no less than 1000 times the reciprocal of the target chip's core frequency, to ensure coverage of at least several complete load burst cycles. The start time of the first time window is determined when the temperature change rate of the target chip falls below a preset temperature change threshold after power-on stabilization, where the temperature change threshold is set to a temperature change of no more than 0.5 degrees Celsius per unit time.
[0059] Within the first time window, core voltage, core frequency, transient power ripple amplitude, temperature, load burst cycle, and instruction throughput are synchronously sampled. The sampling frequency is set to an integer division of the core frequency to ensure that the voltage sampling point is aligned with the clock edge. The core voltage is sampled through an on-chip analog-to-digital converter; the transient power ripple amplitude is obtained by calculating the range of a sliding window on the sampled voltage sequence, where the sliding window length is one core frequency cycle, and the ripple amplitude r is defined as the difference between the maximum and minimum voltage values within the window; the temperature is obtained by converting the output voltage of the on-chip temperature-sensitive transistor; the load burst cycle is obtained by statistically analyzing the peak interval of instruction transmission per unit time and taking the average of the time differences between adjacent peaks as the load burst cycle; the instruction throughput η is defined as the number of valid instructions completed per unit time, calculated as η = N / t, where N is the number of instructions submitted and completed within the time interval t.
[0060] To eliminate timing discrepancies between different sampling channels, the acquired raw runtime data stream undergoes timing alignment processing. Specifically, the rising edge of the clock corresponding to the core frequency is used as a unified time reference, and each sampled data point is mapped to a unified time axis according to its timestamp. When sampling time offsets exist, linear interpolation is used to resample the offset data, ensuring that all runtime features correspond to unique data values at the same time scale. Linear interpolation is calculated proportionally based on the values and time intervals of two adjacent sampling points.
[0061] After timing alignment is completed, statistical processing is performed on each operating characteristic within the first time window. The core voltage is taken as the average value within the time window as the initial core voltage value; the core frequency is taken as the average output frequency after the phase-locked loop stabilizes; the transient power supply ripple amplitude is taken as the arithmetic mean of the calculation results of all sliding windows; the temperature is taken as the average value during the stable phase; the load burst cycle is taken as the average value of all statistical cycles; and the command throughput is taken as the statistical average value per unit time. The above six parameters together constitute the baseline operating characteristic set.
[0062] After obtaining the baseline operating feature set, a phase feature vector is constructed. This phase feature vector characterizes the phase difference relationship between various operating features. Specifically, it is constructed as follows: using the core voltage signal as a reference signal, time difference measurements are performed on the edges of the core frequency waveform, the peak value of the transient power supply ripple period, the extreme points of the temperature change waveform, and the peak value of the command throughput. The phase difference φ is defined as the ratio obtained by dividing the time difference between a feature point of a certain signal and the core voltage reference point by the corresponding period. Its expression is φ = Δt / T, where Δt is the time difference and T is the corresponding signal period. By calculating the phase difference for each feature signal, a vector containing multiple phase difference parameters is formed; this vector is the phase feature vector.
[0063] To improve stability, the phase feature vector is determined using a periodic statistical method, that is, the phase difference of no less than 50 cycles is calculated within the first time window, and the average value is taken as the final phase feature parameter, thereby reducing the impact of instantaneous jitter on the results.
[0064] The resulting baseline operating feature set and corresponding phase feature vectors serve as the basic input data for subsequent disturbance load injection and risk modeling.
[0065] Based on the benchmark operating feature set and the corresponding phase feature vector, a micro-pulse load sequence with a variable perturbation phase θ is applied to the target chip. Dynamic response data is collected under different θ conditions, and an operating feature tensor is constructed.
[0066] After obtaining the baseline operating feature set and phase eigenvectors, the specific numerical range of the perturbation phase scan interval is first determined. The specific implementation method is as follows:
[0067] The method for determining the perturbation phase scanning interval is as follows: Extract the phase difference values of each operating feature relative to the core voltage reference phase from the phase feature vector. Assume the core voltage phase is zero, and the phase difference is expressed as the ratio of the time difference to the core voltage period. Among all phase difference values, determine the maximum phase difference φmax and the minimum phase difference φmin. Use φmin to φmax as the basic scanning interval, and extend it to both sides by 0.1 core voltage periods to form an extended scanning interval. The purpose of this extension is to cover any possible phase drift regions. The perturbation phase scanning step size is set to 5% of the core voltage period. If the core voltage period is T, then the scanning step size is 0.05T. This forms the perturbation phase parameter sequence θk, where θk = φminext + k × 0.05T, k is an integer, until the entire extended scanning interval is covered. φminext represents the time offset corresponding to the minimum phase difference after the extension. The method originates from the following steps: first, the minimum phase difference φmin is statistically obtained from the phase eigenvector; then, it is extended in the negative direction by 0.1T to obtain φminext = φmin - 0.1T, where the extension amount of 0.1T is used to cover the possible phase drift region. This process generates a perturbation phase parameter sequence covering multiple phase difference nodes.
[0068] The implementation of micro-pulse load triggering includes: using the rising edge of the core voltage waveform as a unified time reference point. A comparator detects the core voltage waveform, and when the voltage transitions from below a set threshold to above a set threshold, a trigger signal is output. This threshold is set to 50% of the core voltage's rated value. A high-precision counter is started after the rising edge is detected. The counter's clock source is the core frequency clock signal. When the accumulated counter value reaches a preset time offset value, a micro-pulse trigger signal is output. The preset time offset value is equal to the time length corresponding to the disturbance phase parameter θk. The duration of the micro-pulse load is set to be no less than two core frequency cycles and no more than ten core frequency cycles to ensure that a detectable transient disturbance is generated without causing a sustained overload. Through this method, a precise time offset relationship is established between the micro-pulse load and the core voltage reference phase.
[0069] During each disturbance phase parameter period, a sampling frequency consistent with the baseline operating characteristic sampling is maintained. The sampling frequency is set to an integer multiple of the core frequency to ensure that the sampled data is synchronized with the core clock.
[0070] The core voltage is acquired through an analog-to-digital converter circuit with a sampling accuracy of no less than 12 bits.
[0071] The transient power supply ripple amplitude is calculated using the sliding window range method. The sliding window length is set to one core voltage cycle. The ripple amplitude equals the maximum voltage value minus the minimum voltage value within the window.
[0072] The load burst cycle is obtained by detecting the time interval between peak instruction throughput per unit time.
[0073] Instruction throughput is calculated by counting the number of valid instructions completed per unit of time, which is done by dividing the number of valid instructions per unit of time by the time length.
[0074] The method for calculating the metastable error probability includes the following steps:
[0075] The error capture circuit is activated during the duration of the micro-pulse load.
[0076] At the end of each core frequency cycle, the error capture circuit compares the instruction commit result, register write-back result, and cache check result with the standard result cycle by cycle.
[0077] If a value inconsistency is detected, an abnormal event is recorded, along with the register number or cache address where the abnormality occurred.
[0078] After the micropulse load application time interval ends, the total number of sampling cycles within that interval is counted and denoted as Ntotal.
[0079] Abnormal events are filtered and de-jittered. If an abnormality at the same address is detected within two consecutive core frequency cycles, it is counted as only one valid abnormality to eliminate duplicate records caused by the same physical flip.
[0080] The number of valid anomalies after filtering is denoted as Nerror.
[0081] The metastable error probability is calculated as follows: the metastable error probability equals Nerror divided by Ntotal.
[0082] To improve statistical stability, the micropulse test was repeated at least three times under the same perturbation phase parameters. The error probability was calculated for each test, and the arithmetic mean of the three results was taken as the final metastable error probability.
[0083] Each perturbation phase parameter θk is used as the first dimension index.
[0084] The core voltage, core frequency, transient power supply ripple amplitude, temperature, load burst cycle, and command throughput collected under the corresponding disturbance conditions are used as the second dimension feature data.
[0085] The calculated metastable error probability is used as the third dimension of the correlation data.
[0086] The data is arranged in a structured manner according to the increasing order of the perturbation phase parameters to form a three-dimensional data structure.
[0087] This three-dimensional data structure is the running feature tensor, which is used for the subsequent construction and analysis of the stability risk boundary function.
[0088] In this embodiment, high-precision quantification of metastable error probability is achieved through precise phase scanning, controllable micro-pulse triggering, cycle-by-cycle error capture, and jitter-reducing statistical calculation, while ensuring the repeatability and modelability of the running feature tensor data, thereby providing a reliable data foundation for subsequent stability risk prediction.
[0089] Based on the aforementioned running feature tensor, extreme value envelopes are extracted from the nonlinear boundaries between each amplitude feature, phase coupling feature, and metastable error probability to construct a stability risk boundary function, and a stability risk prediction model is established to output the risk coefficient and risk gradient vector.
[0090] After the running feature tensor is constructed, it contains n sets of sample data. Each set of sample data includes an amplitude feature vector, a phase coupling feature vector, and the corresponding metastable error probability. To ensure statistical stability, when the number of samples n is less than 200 sets, it is preferable to increase the number of perturbation phase parameter test cycles until the number of samples is no less than 200 sets.
[0091] First, the core voltage, core frequency, and transient power supply ripple amplitude are used as the principal dividing variables. The maximum and minimum values of each principal dividing variable are calculated across all sample data. If the difference between the maximum and minimum values is less than 2% of the characteristic's nominal value, that characteristic is not considered a principal dividing variable. For effective principal dividing variables, intervals are divided as follows: Interval width = (maximum value - minimum value) ÷ m; where m is an integer between 10 and 20, preferably 15. The variable is divided into multiple consecutive intervals of equal width according to this interval width, ensuring that each interval contains at least 5 samples. After interval division, within each interval, the samples are sorted from largest to smallest metastable error probability.
[0092] When the number of samples in the interval is no less than 10, select the samples with the highest error probability in the top 20%.
[0093] When the number of samples is between 5 and 10, select the two samples with the highest error probability.
[0094] When the number of samples is less than 5, the interval is merged with the adjacent intervals and the sorting and filtering are re-executed.
[0095] To eliminate the impact of occasional outliers, when the difference between the error probability of a candidate sample and the second largest error probability in the interval exceeds three times the standard deviation of the error probability in that interval, the sample is identified as an outlier and removed.
[0096] The sample set obtained after the above processing is defined as the boundary candidate set, which is used to construct the stability risk boundary function.
[0097] After obtaining the candidate set of boundaries, the main intervals are divided in order of increasing core voltage, and the number of samples in each main interval is no less than 30 groups.
[0098] Within each principal interval, the following variables are selected as independent variables:
[0099] The component with the largest absolute value of the correlation coefficient with the metastable error probability among the core voltage, core frequency, transient power supply ripple amplitude, and phase coupling characteristics. The correlation coefficient is obtained by calculating the Pearson correlation coefficient.
[0100] Using the metastable error probability as the dependent variable, a quadratic polynomial function is constructed for fitting. The function form includes a constant term, a linear term, a cross term between variables, and a square term.
[0101] During the fitting process, an error sum-of-squares function is constructed: Error sum-of-squares = Sum of the squares of all samples (true metastable error probability - fitted predicted value). The least squares method is used to solve for the polynomial coefficients. When the coefficient of determination obtained from the fitting is less than 0.85, the polynomial order is increased to cubic and refitted. After fitting each principal interval, continuity correction is performed on the function values and first derivatives at the boundaries of adjacent intervals. When the difference in function values at the boundary is greater than 0.01, linear smoothing is performed on the boundary region to make the function values and first derivatives continuous. After splicing and continuity correction, a continuous multidimensional surface is formed, which is defined as the stability risk boundary function.
[0102] To establish the risk mapping relationship, the amplitude and phase coupling features of all sample data are first normalized. The normalization method is: Normalized value = (Current feature value - Minimum value) ÷ (Maximum value - Minimum value); after normalization, the numerical range of all feature variables is between 0 and 1. Let the standardized feature vector be Z. Input Z into the stability risk boundary function, and obtain the minimum distance value by solving the minimum Euclidean distance from Z to the envelope surface. The minimum distance is solved by an iterative approximation method, with the initial point taken as the fitting center point of the interval, and the initial step size set to 0.01. The iteration is terminated when two consecutive distance changes are less than 0.0005, and the maximum number of iterations is set to 200. The minimum distance values calculated for all samples are sorted and divided into five intervals according to the 20th percentile. The risk coefficient interval is correspondingly divided into five equal intervals between 0 and 1. A linear mapping function is constructed within each quantile interval. D represents the minimum Euclidean distance from the current feature combination to the envelope surface of the stability risk boundary function. Dimin and Dimax are the lower and upper bounds of the distance for the i-th quantile interval, derived from sorting all historical minimum distance values and dividing them by percentage quantiles. Rimin and Rimax are the lower and upper bounds of the risk coefficient corresponding to this quantile interval. This ensures that the minimum distance value is monotonically mapped to the risk coefficient, while guaranteeing the continuity of function values at the boundaries of each interval. Through the above mapping, a one-to-one correspondence is established between the standardized feature vector and the risk coefficient, thus forming a risk mapping relationship.
[0103] For example, the distance value is divided into five percentile intervals: 0 to 20 percentile, 20 to 40 percentile, 40 to 60 percentile, 60 to 80 percentile, and 80 to 100 percentile. For each interval, a risk coefficient range is set: 0 to 0.2, 0.2 to 0.4, 0.4 to 0.6, 0.6 to 0.8, and 0.8 to 1.
[0104] After establishing the risk mapping relationship, partial derivatives of the risk coefficients with respect to each standardized characteristic variable are calculated. For any standardized characteristic variable, while keeping other variables constant, the variable is increased by a small increment of 0.001, and the risk coefficient is recalculated. The partial derivative is equal to the change in the risk coefficient divided by 0.001. To improve computational stability, the partial derivatives are calculated separately for both positive and negative increments, and the average value is taken as the final partial derivative.
[0105] The partial derivatives of each standardized feature variable are combined to form a risk gradient vector. The risk gradient vector is used to represent the sensitivity of each operational feature to changes in the risk coefficient.
[0106] In this embodiment, a complete, computable, and repeatable stability risk prediction model is formed by extreme value sample screening, piecewise polynomial envelope surface construction, distance-based risk mapping relationship establishment, and risk gradient vector calculation, providing a quantitative basis for subsequent adaptive performance optimization.
[0107] Obtain the real-time running feature set and real-time phase feature vector in the actual application scenario, input them into the stability risk prediction model, and obtain the risk coefficient and risk gradient vector.
[0108] In practical application scenarios, to obtain real-time risk assessment results, real-time operational characteristic data is first collected. The time window length for real-time data collection is consistent with that of the baseline operational characteristic collection phase, and the time window length is set to be no less than 1000 times the core voltage cycle. The sampling frequency is kept the same as the baseline operational characteristic sampling frequency, and the sampling clock is derived from an integer division of the core frequency clock signal to ensure data time reference consistency.
[0109] Within the specified time window, core voltage, core frequency, transient power supply ripple amplitude, temperature, load burst cycle, and command throughput are simultaneously acquired. Core voltage is obtained through an analog-to-digital converter; transient power supply ripple amplitude is obtained using a sliding window range calculation method, with the sliding window length set to one core voltage cycle; temperature is obtained through a temperature-sensitive circuit; load burst cycle is calculated by statistically analyzing the time interval between peak command throughput values; and command throughput is obtained by dividing the number of valid commands completed per unit time by the time duration.
[0110] While acquiring real-time operational characteristic data, the rising edge of the core voltage waveform is used as the reference phase zero point to measure the time difference of characteristic points of each operational characteristic signal. The real-time phase difference is calculated as follows: Phase difference = Time difference ÷ Core voltage period; where the time difference is the time interval between the peak or edge of a certain operational characteristic and the reference rising edge of the core voltage. By averaging multiple periods, a real-time phase feature vector is formed. The real-time operational feature set and the real-time phase feature vector together constitute the real-time characteristic data.
[0111] Subsequently, normalization was performed on the real-time running feature set and the real-time phase feature vector. The maximum and minimum values used for normalization were the maximum and minimum values of the entire sample collected during the stability risk prediction model construction phase, maintaining a consistent normalization scale. The normalization calculation formula is: Normalized value = (Current value - Historical minimum value) ÷ (Historical maximum value - Historical minimum value); if the denominator is zero, the normalized value is set to zero. After normalization, a standardized real-time feature vector is obtained.
[0112] The standardized real-time feature vector is input into the stability risk boundary function. First, the corresponding piecewise polynomial function is determined based on the main interval where the standardized real-time feature vector resides. Then, the minimum Euclidean distance from this vector to the envelope surface is calculated using an iterative approximation method consistent with the model building stage. The initial iteration point is selected as the center point of the fitted function for the corresponding interval, with a step size of 0.01. Iteration stops when two consecutive distance changes are less than 0.0005, and the maximum number of iterations is set to 200. After obtaining the minimum distance value, it is converted into a real-time risk coefficient according to the linear mapping function corresponding to the quantile interval.
[0113] After obtaining the real-time risk coefficient, a small perturbation is calculated for each standardized real-time feature variable to calculate the risk gradient vector. Specifically, while keeping other standardized real-time feature variables unchanged, the current feature variable is increased by a small increment of 0.001, and the minimum distance calculation and risk mapping process are re-executed to obtain a new risk coefficient. The risk change rate is calculated as: Change rate = (Perturbed risk coefficient - Original risk coefficient) ÷ 0.001. To improve calculation accuracy, positive and negative perturbations are calculated for the feature variable, and the average of the two change rates is taken as the final change rate of the feature with respect to the risk coefficient.
[0114] Repeat the above calculation steps for all standardized real-time feature variables, and arrange the rates of change of each variable in feature order to form a risk gradient vector. This risk gradient vector is used to represent the sensitivity of each operating feature to changes in the risk coefficient under the current operating state, providing a directional basis for subsequent adaptive adjustment.
[0115] Through the above steps, a complete mapping from real-time operating status to risk coefficients and risk gradient vectors is achieved, ensuring the repeatable calculation and stable operation of the stability risk prediction model in practical application scenarios.
[0116] Under the condition that the risk coefficient is less than the preset risk threshold, a multi-objective constraint optimization process is constructed based on the risk gradient vector to obtain the optimal feature adjustment vector.
[0117] After obtaining the real-time risk coefficient and risk gradient vector, when the real-time risk coefficient is less than the preset risk threshold, the multi-objective constraint optimization process is initiated.
[0118] The preset risk threshold is determined based on the statistical distribution of metastable error probabilities in the historical operational feature tensor. Specifically, the risk coefficients of all historical samples are sorted, and the value corresponding to the 80th percentile risk coefficient is taken as the preset risk threshold. This threshold represents the maximum acceptable risk level in a statistical sense.
[0119] The performance optimization objective is instruction throughput per unit power consumption. First, the power consumption per unit time is calculated. Power consumption is obtained by multiplying the core voltage and core current; it equals the average value of this product over a time window. The performance objective function is defined as: Performance Objective Function Value = Instruction Throughput ÷ Power Consumption per Unit Time; where: instruction throughput is the number of valid instructions completed per unit time; and power consumption per unit time is the product of the average voltage and average current over the time window. The performance objective function measures the overall efficiency of performance and energy consumption.
[0120] Use the current standardized real-time feature vector as the initial solution.
[0121] The risk gradient vector represents the direction of the rate of change of the risk coefficient with respect to each feature variable. To improve performance while ensuring that the risk is controlled, the optimization direction is chosen to be the opposite direction of the risk gradient vector.
[0122] The step search process is as follows:
[0123] Set the step size to 0.01;
[0124] The standardized real-time feature vector is shifted one step in the opposite direction of the risk gradient vector to obtain a new candidate feature vector.
[0125] The candidate feature vectors are denormalized to the actual feature values;
[0126] Recalculate the risk coefficient and performance objective function value;
[0127] If the risk coefficient is less than the preset risk threshold and the performance objective function value increases, then the candidate feature vector is accepted as a new search starting point.
[0128] If the risk coefficient approaches the preset risk threshold or the performance objective function value no longer increases, the search will stop.
[0129] The criterion for determining whether a risk level is close to the preset risk threshold is that the difference between the risk coefficient and the preset risk threshold is less than 0.01.
[0130] When the search terminates, the difference between the final candidate feature vector and the initial standardized real-time feature vector is used as the standardized feature adjustment amount.
[0131] The standardized feature adjustment amount is then denormalized to obtain the actual feature adjustment amount. This actual feature adjustment amount is the optimal feature adjustment vector. The optimal feature adjustment vector includes the core voltage adjustment amount, the core frequency adjustment amount, the power regulation amplitude corresponding to the transient power supply ripple amplitude adjustment, and the load scheduling phase adjustment amount.
[0132] Through the above steps, under the constraint that the risk coefficient is less than the preset risk threshold, the search direction is guided by the risk gradient vector, and the optimization objective is to maximize the performance objective function, so as to obtain the optimal feature adjustment vector that satisfies both stability and performance constraints.
[0133] The optimal feature adjustment vector is decomposed into voltage regulation component, frequency regulation component and load scheduling phase regulation component, and the core voltage, core frequency and load scheduling phase are optimized in a coordinated manner.
[0134] After obtaining the optimal feature adjustment vector, it is first decomposed. The optimal feature adjustment vector contains adjustment amounts for multiple feature variables, where the adjustment amount corresponding to the core voltage is defined as the voltage regulation component, the adjustment amount corresponding to the core frequency is defined as the frequency regulation component, and the adjustment amount related to the load triggering timing in the phase coupling feature is defined as the load scheduling phase regulation component.
[0135] Before implementing the adjustment, the amplitude constraints of the voltage and frequency adjustment components must be verified. The amplitude constraints are determined based on the chip design parameters.
[0136] The allowable adjustment range of the core voltage is: rated voltage - safety margin ≤ adjusted core voltage ≤ rated voltage + safety margin; where the safety margin is 10% of the rated voltage.
[0137] The allowable adjustment range of the core frequency is: minimum operating frequency ≤ adjusted core frequency ≤ maximum operating frequency; if the voltage adjustment component or frequency adjustment component causes the adjusted value to exceed the above range, the corresponding component will be truncated to the boundary value.
[0138] The core voltage and core frequency must meet a preset stable operating curve. This stable operating curve is obtained through offline testing and is expressed as: Core Voltage = Reference Voltage + Slope Coefficient × (Core Frequency - Reference Frequency); where the slope coefficient is obtained by fitting the minimum voltage required for stable operation at different frequencies. Once the frequency adjustment component is determined, the corresponding target core voltage is calculated based on the stable operating curve. If this target core voltage is higher than the current voltage plus the voltage adjustment component, the target core voltage is used first to ensure sufficient voltage margin when the frequency increases. Voltage updates are performed in a step-by-step increment, with each voltage change not exceeding 2% of the original value to avoid transient overshoot.
[0139] The load scheduling phase adjustment component represents the time offset adjustment amount relative to the core voltage reference phase at the load trigger moment. Let the current load trigger time offset be: Original time offset = Current phase ratio × Core voltage period; then the adjusted time offset is: New time offset = Original time offset + Load scheduling phase adjustment component × Core voltage period; Load trigger control is implemented through a counter. The counter is started when a rising edge of the core voltage is detected, and the load is triggered when the count reaches the value corresponding to the new time offset.
[0140] To ensure operational stability, the core voltage, core frequency, and load scheduling phase are updated in a fixed sequence:
[0141] Step 1: Increase or decrease the core voltage to the target value;
[0142] Step 2: Adjust the core frequency after the core voltage stabilizes;
[0143] Step 3: Update the load scheduling phase trigger time.
[0144] The voltage stability criterion is that the voltage fluctuation amplitude is less than 1% of the rated voltage and lasts for no less than ten core voltage cycles.
[0145] After completing the above steps, the system enters a new operating state and recalculates the risk coefficient to verify whether the adjustment results still meet the preset risk threshold.
[0146] In this embodiment, by decomposing the optimal feature adjustment vector, performing amplitude constraint verification, performing voltage-frequency collaborative proportional conversion according to the stable operating curve, and updating the load trigger timing based on the core voltage reference phase, the collaborative optimization control of core voltage, core frequency, and load scheduling phase is achieved, thereby improving the performance objective function value while ensuring that the risk is under control.
[0147] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for automatic chip driver adaptation and performance optimization, characterized in that: include: When the target chip is in its initial operating state, the raw operating data stream within the first time window is collected and time alignment processing is performed to extract the baseline operating feature set and the corresponding phase feature vector. Based on the benchmark operating feature set and the corresponding phase feature vector, a micro-pulse load sequence with a variable perturbation phase θ is applied to the target chip, dynamic response data is collected under different θ conditions, and an operating feature tensor is constructed. Based on the aforementioned running feature tensor, extreme value envelopes are extracted from the nonlinear boundaries between each amplitude feature, phase coupling feature, and metastable error probability to construct a stability risk boundary function, and a stability risk prediction model is established to output the risk coefficient and risk gradient vector. Obtain the real-time running feature set and real-time phase feature vector in the actual application scenario, and input them into the stability risk prediction model to obtain the risk coefficient and risk gradient vector; Under the condition that the risk coefficient is less than the preset risk threshold, a multi-objective constraint optimization process is constructed based on the risk gradient vector to obtain the optimal feature adjustment vector; The optimal feature adjustment vector is decomposed into voltage regulation component, frequency regulation component and load scheduling phase regulation component, and the core voltage, core frequency and load scheduling phase are optimized in a coordinated manner.
2. The method for automatic chip driver adaptation and performance optimization according to claim 1, characterized in that: The reference operating feature set includes core voltage, core frequency, transient power ripple amplitude, temperature, load burst cycle, and command throughput. The phase feature vector is the phase difference and synchronization offset between each operating feature.
3. The method for automatic chip driver adaptation and performance optimization according to claim 1, characterized in that: The step of applying a micropulse load sequence with a variable perturbation phase θ to the target chip and acquiring dynamic response data under different θ conditions includes: Under the constraints of the reference operating feature set and phase feature vector, the perturbation phase scanning interval and scanning step size are determined based on the phase difference values between each operating feature in the phase feature vector, and a perturbation phase parameter sequence covering multiple phase difference nodes is generated. According to the perturbation phase parameter sequence, a micro-pulse load is triggered at the time offset position corresponding to each perturbation phase parameter, so that the micro-pulse load and the core voltage reference phase form a preset time offset relationship. During each period of perturbation phase parameter, dynamic response data is acquired at a sampling frequency consistent with that of the baseline operating characteristic sampling, and the corresponding metastable error probability is calculated. The operational feature data, phase feature data, and metastable error probability obtained under different perturbation phase parameters are indexed and associated according to the order of perturbation phase parameters to construct an operational feature tensor.
4. The method for automatic chip driver adaptation and performance optimization according to claim 3, characterized in that: The steps for calculating the metastable error probability include: Within the time interval of the micro-pulse load corresponding to each perturbation phase parameter, the error capture circuit is activated to compare the instruction submission result, register write-back result and cache verification result of the target chip cycle by cycle, and record the number of events of logic flip anomaly or verification inconsistency. After completing the event recording, the total number of sampling periods within the time interval corresponding to the disturbance phase parameter is used as the statistical base, and the number of abnormal events is subjected to de-jitter filtering. The de-jitter filtering process is to regard the same address anomaly that occurs repeatedly within two consecutive periods as a single valid anomaly. The instantaneous error ratio is calculated based on the number of effective anomalies after screening and the statistical base, and then the arithmetic mean is applied to the results of multiple cyclic tests with the same perturbation phase parameters. The error ratio after arithmetic averaging is determined as the metastable error probability corresponding to the perturbation phase parameter.
5. The method for automatic chip driver adaptation and performance optimization according to claim 1, characterized in that: The steps of constructing the stability risk boundary function and establishing a stability risk prediction model for outputting risk coefficients and risk gradient vectors include: The metastable error probabilities corresponding to different perturbation phase parameters in the running feature tensor are sorted, and the feature combination with the largest error probability in the same amplitude feature interval is extracted as the boundary candidate point. The boundary candidate set is formed according to the combination relationship between amplitude feature and phase coupling feature. The candidate boundary set is subjected to multidimensional surface fitting, and an envelope surface is constructed by piecewise polynomial fitting. The envelope surface is defined as a stability risk boundary function. Using the stability risk boundary function as a constraint, a risk mapping relationship is constructed so that any combination of input running features can be mapped to the corresponding risk coefficient. The partial derivatives of the risk mapping relationship are calculated to obtain the rate of change vector of each operating feature with respect to the risk coefficient, and the rate of change vector is defined as the risk gradient vector, thereby forming a stability risk prediction model.
6. The method for automatic chip driver adaptation and performance optimization according to claim 5, characterized in that: The steps for constructing a risk mapping relationship using the stability risk boundary function as a constraint include: The amplitude features and phase coupling features in the running feature tensor are normalized to obtain a standardized feature vector with a uniform scale. The standardized feature vector is input into the stability risk boundary function, the minimum distance value from the feature vector to the envelope surface of the stability risk boundary function is calculated, and the minimum distance value is used as an intermediate variable for risk mapping. A monotonically increasing mapping function is constructed to convert the minimum distance value into a risk coefficient. The monotonically increasing mapping function is obtained by segmenting and calibrating the metastable error probability in the historical running feature tensor. Establish a one-to-one mapping relationship between the standardized feature vectors and their corresponding risk coefficients.
7. The method for automatic chip driver adaptation and performance optimization according to claim 1, characterized in that: The steps for obtaining the real-time running feature set and real-time phase feature vector, and outputting the risk coefficient and risk gradient vector include: In actual application scenarios, the core voltage, core frequency, transient power supply ripple amplitude, temperature, load burst cycle and command throughput are synchronously collected at the same sampling frequency as the baseline operating feature acquisition. Based on the core voltage reference phase, the real-time phase difference of each operating feature is calculated to form a real-time operating feature set and a real-time phase feature vector. The real-time running feature set and real-time phase feature vector are subjected to normalization processing consistent with the stability risk prediction model construction stage to generate standardized real-time feature vectors. The standardized real-time feature vector is input into the stability risk boundary function and risk mapping relationship to calculate the corresponding minimum distance value and map it to the real-time risk coefficient. The risk calculation process is repeated for each standardized real-time feature variable to obtain the rate of change of each feature with respect to the risk coefficient, thereby forming a risk gradient vector.
8. The method for automatic chip driver adaptation and performance optimization according to claim 1, characterized in that: The steps for constructing a multi-objective constrained optimization process based on the risk gradient vector and obtaining the optimal feature adjustment vector include: The current standardized real-time feature vector is used as the initial solution, the risk gradient vector is used as the risk change direction vector, and a performance objective function is constructed. The performance objective function aims to optimize the instruction throughput per unit power consumption, while setting the risk coefficient to be less than a preset risk threshold as a constraint. Provided that the risk coefficient is less than the preset risk threshold, a step search is performed in the opposite direction of the risk gradient vector, and the updated performance objective function value and risk coefficient value are calculated at each step. The search process stops when the performance objective function value reaches a local maximum and further steps will cause the risk coefficient to approach the preset risk threshold. The difference between the change in the feature variable corresponding to the local optimum and the initial standardized real-time feature vector is determined as the optimal feature adjustment vector.
9. The method for automatic chip driver adaptation and performance optimization according to claim 8, characterized in that: The performance objective function is defined as follows: Performance objective function value = instruction throughput ÷ power consumption per unit time; where: instruction throughput is the number of valid instructions completed per unit time; power consumption per unit time is the product of average voltage and average current within the time window.
10. The method for automatic chip driver adaptation and performance optimization according to claim 1, characterized in that: The steps for optimizing the optimal feature vector decomposition and performing co-optimization include: The optimal feature adjustment vector is decomposed according to the feature category, and the voltage regulation component corresponding to the core voltage, the frequency regulation component corresponding to the core frequency, and the load scheduling phase regulation component corresponding to the phase coupling feature are extracted. The amplitude constraint verification is performed on each regulation component. Based on the voltage-frequency correspondence between the voltage regulation component and the frequency regulation component, the core voltage and core frequency are synchronously proportionally converted. The time offset of the load triggering moment relative to the core voltage reference phase is recalculated based on the load scheduling phase adjustment component, and the load scheduling timing parameters are updated. Within the same time window, the core voltage, core frequency, and load scheduling phase are updated synchronously to achieve a collaborative and optimized operating state under controlled risk conditions.