LSTM prediction model training training method and PCIe DPA active power distribution based on workflow prediction processing module

By using an LSTM prediction model to predict the load of PCIe devices and actively allocate power consumption, the performance jitter and insufficient energy efficiency problems of passive reactive strategies are solved, and more stable and efficient power management is achieved.

CN122366518APending Publication Date: 2026-07-10SHANGHAI XINLIJI SEMICON CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI XINLIJI SEMICON CO LTD
Filing Date
2025-11-24
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing PCIe DPA technology employs a passive reactive strategy, resulting in performance jitter and insufficient energy efficiency optimization, making it unable to achieve an instantaneous optimal power consumption performance balance under dynamically changing workloads.

Method used

The LSTM prediction model training method is adopted to predict future load conditions by performing time series analysis on historical performance and power consumption data of PCIe device subsystems, and actively allocate power consumption budget based on the prediction results. This includes the integration of workflow detection, predictive analysis, strategy decision-making and DPA control execution modules.

Benefits of technology

It enables power budget allocation to be completed within tens of microseconds before the task arrives, reducing performance jitter, improving the intelligent adaptability of energy efficiency management and system stability, and significantly improving user experience and energy efficiency ratio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122366518A_ABST
    Figure CN122366518A_ABST
Patent Text Reader

Abstract

This invention discloses an LSTM prediction model training method and a PCIe DPA proactive power allocation processing module based on workflow prediction, realizing a paradigm shift in power allocation from "passive response" to "proactive prediction": The method records performance data of each subsystem of the PCIe device; receives real-time performance data using a workflow detection module; collects preset types of performance data and constructs time-series data for each subsystem based on timestamps; inputs the time-series data into a trained prediction analysis module to predict the load of the corresponding subsystem; generates control instructions for adjusting the power consumption of the subsystem based on the prediction results, including maintaining, increasing, or decreasing the power consumption state; and the DPA control execution module reads the control instructions and writes them into the DPA capability structure register, thereby adjusting the power consumption state of the corresponding subsystem, which helps to solve the performance jitter problem caused by latency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of high-speed interconnect PCIe, and in particular to an LSTM prediction model training method and a processing module for PCIe DPA active power allocation based on workflow prediction. Background Technology

[0002] Dynamic Power Allocation (DPA) is an advanced power management feature introduced by the PCI-SIG organization starting with the PCIe 4.0 specification. Its core design goal is to allow the dynamic reallocation of a fixed total power budget among different logical functional units within a complex PCIe device, thereby improving energy efficiency and performance. It is widely used in computer systems, primarily for connecting various hardware devices such as GPUs, storage devices, and network cards. Hardware devices report their DPA capabilities to software (operating system or driver) through the DPA Extended Capability Structure in their PCIe configuration space. The software can query the subsystem status and initiate state switching commands by reading and writing registers in this structure.

[0003] Workflow monitoring is the foundation of power management awareness, aiming to capture the device's operational status in real time. Monitoring primarily relies on performance counters. Modern PCIe devices (such as GPUs and smart network cards) provide a rich set of hardware performance counters that can be used to measure various metrics, such as compute unit utilization, cache hit / miss counts, memory read / write bandwidth, instruction throughput, and task queue depth. Monitoring functionality is typically implemented by the device driver: the driver periodically polls the device's performance counter registers via memory-mapped I / O (MMIO) or collects data through interrupt-based mechanisms. This data constitutes a time-series signal characterizing the device's workload.

[0004] Currently, the implementation of PCIe DPA technology mainly follows the mechanism defined by the PCIe standard specification, adopting a passive reactive control strategy. The core of this strategy lies in the software (operating system or driver) responding to changes in hardware state. That is, it makes dynamic power allocation decisions based on a simple threshold strategy (if-then rule) for certain specific performance indicators of the detected PCIe subsystem. For example, if the current computing unit utilization exceeds a certain percentage, the power consumption level will be dynamically increased.

[0005] Although DPA technology is a significant improvement over fixed power allocation, its passive reactive nature brings several significant and objective drawbacks, such as performance jitter (user experience stuttering or instability), insufficient energy efficiency optimization (always "half a beat behind"), and the inability of static threshold-based strategies to understand complex, non-linear, and multi-stage workflow patterns, resulting in the inability to achieve an instantaneous optimal power performance balance under dynamically changing workloads.

[0006] The disclosure of the above background technical content is only for the purpose of assisting in understanding the concept and technical solution of this application, and does not necessarily provide technical instruction. Summary of the Invention

[0007] The purpose of this invention is to provide a method and system for proactively and forward-lookingly allocating the internal power budget of PCIe devices by predicting workflows through machine learning.

[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A training method for an LSTM prediction model for PCIe device subsystem load prediction includes the following steps: Acquire time-series historical data, including time-series historical performance data recorded for the PCIe device subsystem and historical power consumption data sampled from the subsystem, and align the historical performance data and historical power consumption data on timestamps to obtain time-series data as [(X1,L1),(X2,L2),…,(X... n ,L n ]], where X represents the performance data vector and L represents the power consumption parameter; Define the time window length, denoted as window_size; define the prediction step size, denoted as step_size; and construct samples as follows: the input of a sample is X. t To X t+window_size-1 The time series data, the label of this sample includes L t+step_size This is used to construct a dataset that includes multiple samples and their corresponding labels. A basic model is designed based on the LSTM architecture, and the basic model is trained using the constructed dataset to obtain the LSTM prediction model.

[0009] Furthermore, following any one or a combination of the aforementioned technical solutions, the LSTM prediction model outputs an overloaded probability prediction value in the following manner: The sample is labeled L t+step_size To L t+step_size+window_size-1 ; The trained LSTM prediction model predicts the input data X. current To X current+window_size-1 The power consumption parameter is L current+step_sizeTo L current+step_size+window_size-1 ; Get the current input data X current The corresponding current power consumption parameter is compared with the predicted power consumption parameter, and the power consumption parameter L is calculated. current+step_size To L current+step_size+window_size-1 The proportion of power consumption exceeding the current power consumption parameter is used as the probability prediction value of overload.

[0010] Furthermore, following any one or a combination of the aforementioned technical solutions, the LSTM prediction model outputs an overloaded probability prediction value in the following manner: The sample is labeled L t+step_size To L t+step_size+window_size-1 ; Configure the last layer of the LSTM network to simultaneously predict vectors of k quantiles; The quantile LSTM network model is trained using the quantile loss function to output arbitrary quantiles end-to-end, forming the prediction range of future load distribution and the prediction value of overload probability.

[0011] Furthermore, following any one or a combination of the aforementioned technical solutions, the LSTM prediction model can output a confidence interval in the following manner: Define time series data X t The corresponding power consumption parameter is L t ; Statistical original label L t+step_size To L t+step_size+window_size-1 In the middle of the power consumption parameter L t The proportion of this is used as a label for the probability of overload; The stability of the subsystem load is measured within the time period from t to (t + window_size - 1); a dataset including multiple samples, corresponding labels, and stability measurement results is constructed accordingly. The learning objective of the quantile LSTM network model during training is designed to learn the overload probability prediction of different quantiles, and output the confidence score based on the stability of the subsystem load within the corresponding time period: the higher the stability of the subsystem load, the higher the confidence score; the lower the stability of the subsystem load, the lower the confidence score. Based on the constructed dataset, the base model is trained to obtain the LSTM prediction model: if the true overload probability value of the label is lower than the overload probability prediction value of the lowest quantile predicted by the model, or if the true overload probability value of the label is higher than the overload probability prediction value of the highest quantile predicted by the model, then the training score of its overload probability prediction is deducted.

[0012] Furthermore, following any one or a combination of the aforementioned technical solutions, the learning objective of the quantile LSTM network model during the training process includes learning the overload probability prediction of the intermediate quantile between the lowest and highest quantiles. If the confidence level output by the LSTM prediction model is lower than a preset confidence threshold, no control command for adjusting the subsystem power consumption is generated; if the confidence level output by the LSTM prediction model reaches the preset confidence threshold, a control command for adjusting the subsystem power consumption is generated according to the overload probability prediction result of the LSTM prediction model at the middle quantile, including: If the overload probability prediction value of the LSTM prediction model at the middle quantile is greater than the preset upper probability threshold, a control instruction to improve the power consumption state is generated; if the overload probability prediction value is less than the preset lower probability threshold, a control instruction to reduce the power consumption state is generated; otherwise, a control instruction to maintain the power consumption state is generated.

[0013] Furthermore, based on any one or a combination of the aforementioned technical solutions, the label of the sample is determined in the following way: obtaining the power consumption parameter L. t+step_size To L t+step_size+window_size-1 Define time series data X t The corresponding power consumption parameter is L t Statistical power consumption parameter L t+step_size To L t+step_size+window_size-1 In the middle of the power consumption parameter L t The proportion, used as a label; Construct a dataset that includes multiple samples and their corresponding labels; A basic model is designed based on the LSTM architecture, and the basic model is trained using the constructed dataset to obtain the LSTM prediction model.

[0014] According to another aspect of the present invention, a processing module for PCIe DPA proactive power allocation based on workflow prediction is provided, which realizes proactive dynamic power adjustment of PCIe devices based on load prediction. The processing module includes a workflow detection module, a predictive analysis module, a strategy decision module, and a DPA control execution module. The workflow detection module is configured to receive real-time performance data of each subsystem of the PCIe device from the PCIe device, wherein the real-time performance data has a timestamp; and to collect performance data of a preset type from it, and to construct time series data corresponding to each subsystem based on the timestamp; The predictive analysis module is configured to predict the load of the corresponding subsystem based on the time series data. The strategy decision module is configured to generate control instructions for adjusting the power consumption of the subsystem based on the prediction results of the prediction analysis module. The DPA control execution module is configured to read the control instructions from the policy decision module and write them into the DPA capability structure register.

[0015] Furthermore, following any one or a combination of the aforementioned technical solutions, the prediction analysis module is obtained based on the LSTM prediction model training method described above.

[0016] Furthermore, following any one or a combination of the aforementioned technical solutions, the workflow detection module determines the corresponding data type based on the function and type of each subsystem, which includes one or more of the following data types: The data type is utilization, and its corresponding real-time performance data includes computing unit active cycles and instruction throughput. The data type is memory-based, and its corresponding real-time performance data includes video memory read / write bandwidth and cache miss rate. The data type is a queue, and its corresponding real-time performance data includes task queue depth and the number of DMA requests.

[0017] Furthermore, following any one or a combination of the aforementioned technical solutions, before the DPA control execution module reads the control command from the strategy decision module, the method further includes: the strategy decision module performing a security check on the control command, including one or more of the following checks: Predict whether the power consumption target state of the corresponding subsystem is valid after executing the control command; And / or predict whether the power consumption target state of the corresponding subsystem after executing the control command exceeds the power consumption limit of the subsystem itself; And / or predict whether the sum of the power consumption of all subsystems of the PCIe device exceeds the total power consumption resources after the corresponding subsystem executes the control command; If the conditions are met and / or the limits are not exceeded, the security check passes, and the policy decision module sends the control command to the DPA control execution module. If the security check fails, the policy decision module will not send the control command to the DPA control execution module.

[0018] Furthermore, based on any one or a combination of the aforementioned technical solutions, the real-time performance data of each subsystem also includes system identification data characterizing the corresponding subsystem. The control commands include maintaining power consumption state, increasing power consumption state, or decreasing power consumption state. If the control instruction is to increase power consumption, then the DPA capability structure register configures the subsystem that matches the system identification data to increase power consumption. If the control command is to reduce power consumption, the DPA capability structure register configures the subsystem that matches the system identification data to reduce power consumption.

[0019] Furthermore, based on any one or a combination of the aforementioned technical solutions, each subsystem of the PCIe device is configured with a corresponding priority; When the sum of the power consumption of all subsystems reaches a preset proportion of the total power consumption resources, one or more of the following methods will be used to allocate power consumption resources to subsystems with higher priority: Limit the allocable power budget for the lowest priority or lower-priority subsystems to a preset level; And / or, set bias coefficients for each subsystem according to their priority, and the strategy decision module combines the bias coefficients to generate control commands, with the bias coefficients of higher priority subsystems being greater than those of lower priority subsystems.

[0020] The beneficial effects of the technical solution provided by this invention are as follows: a. Predict power consumption status and demand in advance, accurately anticipate future workloads, and complete the allocation of power budget and hardware state switching tens of microseconds before the actual arrival of the task. The subsystem is ready in a sufficient power consumption state and can start processing immediately after the actual arrival of the task, reducing the latency caused by the subsystem being affected by sudden large traffic. b. Based on load prediction, it realizes proactive dynamic power consumption adjustment, which is applicable to PCIe devices such as GPUs, AI accelerator cards, storage controllers and high-speed network interface cards. Compared with the traditional "passive response" paradigm, it better solves the problem of performance jitter caused by latency, thus providing users with an extremely stable and smooth application experience, especially in AI inference and real-time data processing scenarios with zero tolerance for latency, the effect is significant. c. In terms of energy efficiency, this invention achieves global optimization, elevates energy efficiency management to a new level, and the forward-looking prediction greatly extends the time window for refined management, enabling idle subsystems to enter a deep low-power state earlier, while busy subsystems can accurately acquire resources on demand, minimizing energy waste and significantly improving the overall energy efficiency ratio of the system. d. Compared to the traditional rigid control strategy based on a simple threshold strategy (if-then rule), the present invention has a high degree of intelligent adaptability: the LSTM model used by the system can learn and memorize the unique load patterns of different applications, automatically generate the optimal decision, and adapt to complex and ever-changing working scenarios without manual intervention, which greatly reduces maintenance costs and improves the system's generalization ability. Attached Figure Description

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

[0022] Figure 1 A schematic diagram of the framework of a PCIe DPA active power allocation system based on workflow prediction, provided as an exemplary embodiment of the present invention; Figure 2 This is a flowchart illustrating a PCIe DPA active power allocation method based on workflow prediction, provided as an exemplary embodiment of the present invention. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0025] In one embodiment of the present invention, a PCIe DPA proactive power allocation system based on workload prediction is provided. This system introduces a prediction mechanism based on a machine learning model, enabling it to learn and predict complex, non-linear workload patterns. Since the decision-making is based on predictions of future states rather than simple reactions to past states, it transforms the approach from "reactive" to "proactive." By allocating power budgets in advance before peak workloads arrive, it solves the problem of timing delays, thereby eliminating performance jitter and maximizing energy efficiency.

[0026] In this embodiment, the PCIe DPA active power allocation system based on workflow prediction includes PCIe devices and a processing module, such as... Figure 1 As shown, the PCIe device includes a DPA capability structure register, several subsystems (subsystem 1, subsystem 2, ..., subsystem M), and a performance counter register that records performance data for the subsystems; See also Figure 1 The processing module includes a workflow detection module, a predictive analysis module, a strategy decision-making module, and a DPA control execution module; each module is described in detail below: First, regarding the workflow detection module: The workflow detection module is configured to receive real-time performance data from the performance counter register, which is provided by hardware and is used to record the working status of each subsystem. The corresponding performance data includes tasks, bandwidth utilization, idle time, etc., which are the objects monitored by the software.

[0027] The real-time performance data includes a timestamp and system identifier data representing the corresponding subsystem. Preset types of performance data are collected from the data, and time-series data corresponding to each subsystem is constructed based on the timestamp. For example, the performance data packet of subsystem 1 within a half-hour period includes the identifier of subsystem 1 (i.e., the ID of subsystem 1), the performance data packet of subsystem 2 within a half-hour period includes the identifier of subsystem 2 (i.e., the ID of subsystem 2), and so on. Each performance data packet is sent to the performance counter register, and then the workflow detection module collects data from it.

[0028] The workflow detection module resides within the processing module, i.e., the device driver, and interacts directly with the hardware registers of the PCIe device to achieve high-precision, real-time data acquisition with low overhead. This real-time acquisition can be programmed, for example, using performance data from the current half-hour to predict the load (power consumption demand) over the next 50μs. A specific acquisition method can employ a periodic polling pattern: the workflow detection module initializes a high-precision timer (e.g., with a period set to 10μs to 100μs). Upon each timer interrupt, the driver reads the value of the PCIe device's performance counter register via memory-mapped I / O (MMIO). For example, it samples performance data from 7:30 to 8:00 to predict the load over the next 50μs starting at 8:00, performing real-time sampling according to the timer's period.

[0029] In addition to the periodic polling mode, an event-triggered mode can also be set, such as setting an interrupt for certain critical counters (e.g., queue overflow) to achieve immediate response to abnormal events.

[0030] The performance counter register records complex and varied performance data for the subsystems. The workflow detection module provides data materials (constructing time-series data for each subsystem based on timestamps) to the predictive analysis module. Specifically, it sets the data types to be collected for each subsystem according to its function and type, typically including one or more of the following data types: Utilization categories: compute unit active cycles, instruction throughput; Memory-related parameters: video memory read / write bandwidth, cache miss rate; Queue type: Task queue depth, number of DMA requests.

[0031] Each sample is accompanied by a precise timestamp for constructing a time series. The collected data is temporarily stored in a circular buffer allocated by the driver to avoid data loss and awaits consumption by the predictive analysis module.

[0032] Second, regarding the predictive analysis module: The predictive analysis module is configured to predict the load of the corresponding subsystem based on the time series data. The predictive analysis module is implemented as a user-space daemon process to avoid complex machine learning model inference calculations blocking the kernel or introducing stability risks. The daemon process communicates with the kernel driver at high speed through netlink sockets or mmap shared memory, ultimately achieving low latency and high accuracy load prediction.

[0033] The model employs a lightweight Long Short-Term Memory (LSTM) network, a special type of recurrent neural network (RNN) well-suited for time series prediction problems. The number of nodes in its input layer corresponds to the number of monitored features, and the output layer consists of a single node. The model is trained offline using historical workload data, and the trained model parameter file is deployed along with the driver. Within the daemon process, a lightweight inference engine such as TensorFlow Lite or ONNX Runtime loads the model. The daemon process retrieves the latest monitored data sequences from shared memory, performs standardization preprocessing, inputs it into the model, and obtains the prediction results. The prediction results (subsystem ID, prediction result) are then sent back to the kernel driver (via netlink) or written to another shared memory area.

[0034] Device workloads exhibit strong temporal correlations, meaning future load conditions highly depend on past behavior. The core advantage of LSTM lies in its internal gating mechanism (input gate, forget gate, output gate), which effectively learns long-term dependencies in time series data and captures complex workload patterns (such as periodicity and burstiness) without encountering the vanishing or exploding gradient problems of traditional RNNs. In the context of power management, historical workflow monitoring data (such as utilization and bandwidth over the past N time points) can be fed as input sequences into the LSTM model. After training, the model can output predictions of load conditions over a future period (such as the probability distribution of utilization) over the next M time points.

[0035] The predictive analysis module's predictive mechanism addresses the significant decision-making and execution delays (including polling intervals, switching delays, and software processing time, typically in the microsecond range) between "event detection" and "budget readiness." Furthermore, it frees the response granularity from being limited by the polling interval, allowing idle subsystems to instantly enter a low-power state without maintaining high power consumption until the next polling cycle. This solves the problems of energy waste and potential performance loss, achieving optimal energy efficiency. Experiments show that under typical fluctuating loads, this invention can save an additional 5%-15% of dynamic power consumption, significantly improving the overall system performance per watt.

[0036] The specific training methods and prediction results of the predictive analytics module will be explained in detail below.

[0037] Third, regarding the strategy decision-making module: The strategy decision module is configured to generate control commands based on the prediction results of the prediction analysis module. The control commands include maintaining the power consumption state, increasing the power consumption state, or decreasing the power consumption state. The strategy decision module is also located inside the driver program, and its function is to make decisions safely and efficiently based on the prediction results.

[0038] The core components of the strategy decision module are the sub-module measurement registry and the decision engine. The registry is a data structure created during driver initialization, which can be in the form of an array or a hash table. Each entry in the registry corresponds to a subsystem and contains the subsystem's unique parameters, such as the subsystem's ID, state power consumption limit, upgrade threshold, downgrade threshold, and switching latency tolerance. The core of the decision engine is a decision function that makes a decision on whether to upgrade, downgrade, or maintain power consumption based on the prediction results of the predictive analysis module. In a further embodiment, in addition to making decisions on power level adjustment, the measurement decision module also performs a safety check: whether the target state after making a decision to upgrade, downgrade, or maintain power consumption based on the prediction results is legal and whether the power consumption exceeds the limit. Illegal decisions include exceeding hardware physical limits (CPU overclocking to an impossible frequency), violating thermal design power limits, exceeding safe state transition rates, resource conflicts and dependency violations, violating power management policies, subsystem dependency violations, timing and sequence violations, voltage-frequency curve violations, etc.

[0039] After the safety check is passed, the measurement decision module can send the control command to the DPA control execution module. Otherwise, the control command will not be executed, meaning it will not be sent to the DPA control execution module.

[0040] Fourth, regarding the DPA control execution module: The DPA control execution module is configured to read the control instructions from the policy decision module and write them into the DPA capability structure register; the DPA control execution module is located at the lowest level of the driver and is used to reliably and correctly execute hardware register operations of the PCIe device.

[0041] Specifically, the control commands read include the subsystem ID and the target status (power level status after power upgrade / downgrade / maintenance). The DPA capability structure register is divided into multiple DPA capability structure areas, each corresponding to a different subsystem. The DPA control execution module accesses the DPA capability structure area of ​​the subsystem corresponding to the subsystem ID in the control command through PCIe configuration space read / write operations. By processing the Substate Control Enable bit (status control operation flag bit) of the DPA capability structure area, preferably by writing 1 to clear it, the target status value (i.e., the power status value of the power adjustment target) can be written to the Substate Control register. The SubstateStatus register is polled; if its value matches the target status value, the switchover is complete.

[0042] To prevent state corruption caused by concurrent write operations from multiple threads, a spin lock can be used to protect access to the DPA capability structure registers.

[0043] Fifth, regarding the DPA capability structure register: The DPA (Capability Profiler) register is located in the PCI configuration space of a PCIe device and serves as the contractual interface between the PCIe device hardware and software (processing module). The DPA register contains characteristics of each subsystem, such as the number of supported sub-states, the maximum power consumption limit for each sub-state, and the state transition latency. These are the objects that the software controls and queries.

[0044] Each subsystem supports multiple power states (e.g., Substate 0, 1, 2...). Each state corresponds to a maximum power budget and a state transition latency. Substate 0 is typically the highest performance state (maximum budget), while the performance of Substate 1 and subsequent power states decreases progressively (budget decreases progressively). In summary, if the control instruction is to increase the power state, the DPA capability structure register configures the subsystem matching the system identification data (subsystem ID) to increase the power state, i.e., subtracting 1 from the current power state value; if the control instruction is to decrease the power state, the DPA capability structure register configures the subsystem matching the system identification data (subsystem ID) to decrease the power state, i.e., adding 1 to the current power state value.

[0045] In one specific embodiment, each subsystem is configured with a power management unit. The actual circuitry inside the unit is responsible for receiving instructions and performing specific operations such as clock gating, power gating, and voltage / frequency adjustment according to the instructions to complete the switching of the target state.

[0046] The specific training method and detailed implementation examples of the prediction analysis module are as follows: The first embodiment of the training method for the predictive analytics module is as follows: Acquiring time-series historical data includes obtaining time-series historical performance data from the performance counter register and sampling historical power consumption data of the subsystem. The historical performance data and historical power consumption data are then aligned on the timestamps to obtain time-series data as [(X1,L1),(X2,L2),…,(X...]. n ,L n ]], where X represents the performance data vector and L represents the power consumption parameter; Define the time window length, denoted as window_size; define the prediction step size, denoted as step_size; and construct samples as follows: the input of a sample is X. t To X t+window_size-1 The time series data, the label of this sample includes L t+step_size In this way, a dataset consisting of multiple samples and their corresponding labels is constructed; A basic model is designed based on the LSTM architecture, and the basic model is trained using the constructed dataset to obtain the LSTM prediction model. After training, the model predicts the power consumption after a time length of step_size based on real-time time series data.

[0047] The second embodiment of the training method for the predictive analysis module is as follows: Unlike the first embodiment, the training objective of the LSTM prediction model is to predict the power consumption distribution within a time window after a prediction time length of step_size, in order to further determine the probability of overload, that is, the likelihood that the power consumption after the prediction time length of step_size will exceed the power consumption at the current time t. Therefore, the sample label in the second embodiment is L. t+step_size To L t+step_size+window_size-1 ; The trained LSTM prediction model predicts the input data X. current To X current+window_size-1 The power consumption parameter is L current+step_size To L current+step_size+window_size-1 ; Get the current input data X current The corresponding current power consumption parameter (denoted as L) current The predicted power consumption parameter is compared with the current power consumption parameter, and the power consumption parameter L is statistically analyzed. current+step_size To L current+step_size+window_size-1 The power consumption exceeds the current power consumption parameter L current The proportion is used as the probability prediction value for overload.

[0048] The third embodiment of the training method for the predictive analysis module is as follows: Unlike the second embodiment, this embodiment aims to train an LSTM prediction model using quantile regression to directly output overloaded probability predictions. This method does not change the label structure (the sample labels are the same as in the second embodiment, L...). t+step_size To L t+step_size+window_size-1 Instead of changing the model's output and loss function, it directly predicts the distribution quantiles of power consumption.

[0049] In the third embodiment, the last layer of the LSTM network is set to predict the vector of k quantiles simultaneously; The quantile LSTM network model is trained using the quantile loss function to output arbitrary quantiles end-to-end, forming the prediction range of future load distribution and the prediction value of overload probability.

[0050] The fourth embodiment of the training method for the predictive analysis module is as follows: Based on the third embodiment, the LSTM prediction model in this embodiment is further trained to output confidence intervals: Define time series data X t The corresponding power consumption parameter is L t ; Statistical original label L t+step_size To L t+step_size+window_size-1 In the middle of the power consumption parameter L t The proportion of this is used as a label for the probability of overload; The stability of the subsystem load is measured within the time period from t to (t + window_size - 1); a dataset including multiple samples, corresponding labels, and stability measurement results is constructed accordingly. The learning objective of the quantile LSTM network model during training is designed to learn the overload probability prediction for different quantile levels. In this embodiment, three levels are used as an example: the conservative prediction level with lower quantiles, the most likely prediction level with middle quantiles, and the optimistic prediction level with higher quantiles. The confidence level is output according to the stability of the subsystem load within the corresponding time period: the higher the stability of the subsystem load, the higher the confidence level; the lower the stability of the subsystem load, the lower the confidence level. The conservative prediction level indicates the minimum power consumption in the worst-case scenario, the most likely prediction level indicates the most likely power consumption under normal circumstances, and the optimistic prediction level indicates the maximum power consumption under the best-case scenario. The goal of model training is to make the prediction results fall between the "conservative prediction" and "optimistic prediction" as much as possible, especially within the "most likely prediction" range.

[0051] Based on the constructed dataset, the basic model is trained to obtain the LSTM prediction model. This includes training both the prediction overload probability and the prediction confidence. On the one hand, if the actual overload probability value of the label is lower than the overload probability prediction value of the lowest quantile (conservative prediction quantile) predicted by the model, or if the actual overload probability value of the label is higher than the overload probability prediction value of the highest quantile (optimistic prediction quantile) predicted by the model, the training score for its overload probability prediction is deducted. On the other hand, if the actual overload probability value of the label falls outside the range between "conservative prediction" and "optimistic prediction," but its prediction confidence is high (e.g., exceeding the preset first confidence level, such as the "blindly confident standard" of 85%), then the training score for its confidence prediction is deducted. Conversely, if the actual overload probability value of the label falls within the "most likely prediction" range, but its prediction confidence is low (e.g., below the preset second confidence level, such as the "too unconfident standard" of 50%), then the training score for its confidence prediction is also deducted. This is to enable the model to learn to adjust its confidence level based on the characteristics of the input data, thereby improving the accuracy of confidence prediction.

[0052] The learning objectives of the quantile LSTM network model during training include learning the overload probability prediction of the intermediate quantile between "conservative prediction" and "optimistic prediction". If the confidence level of the LSTM prediction model output is lower than the preset confidence level threshold, the policy decision module will not generate corresponding control commands even if the predicted overload probability is high. By introducing a confidence level check mechanism, the system effectively avoids the risks that the LSTM prediction model may bring, ensuring that it can return to a safe state even when the prediction uncertainty is high. This fundamentally solves the security concerns of applying AI to the underlying hardware control, enabling the technology to be reliably deployed in demanding production environments. By deeply integrating artificial intelligence prediction with hardware control, it provides crucial performance and energy efficiency guarantees for the next generation of high-performance computing devices.

[0053] If the confidence level output by the LSTM prediction model reaches a preset confidence threshold, then a control command is generated according to the overload probability prediction result of the LSTM prediction model at the middle quantile, including: If the overload probability prediction value of the LSTM prediction model at the middle quantile is greater than the preset upper probability threshold, the strategy decision module generates a control instruction to improve the power consumption state (decrease the current power consumption state Substate value by 1); if the overload probability prediction value is less than the preset lower probability threshold, the strategy decision module generates a control instruction to reduce the power consumption state (increase the current power consumption state Substate value by 1); otherwise, it generates a control instruction to maintain the power consumption state.

[0054] The following example illustrates a scenario involving encrypted video stream transmission using a smart network interface card (NIC): The workflow detection module detects the performance data of subsystem 1 over the previous half hour. The LSTM prediction model analyzes this half-hour performance and predicts that the probability (overload probability) of power consumption exceeding the current power consumption within the next 50μs is 86%, with a confidence level of 92%. The policy decision module queries the submodule policy registry, which records the upgrade thresholds for each submodule's power consumption state at each level. For example, the upgrade threshold from Substate 31 to Substate 30 is an overload probability of 85% with a confidence level of 90%; the upgrade threshold from Substate 30 to Substate 29 is an overload probability of 85.5% with a confidence level of 90.5%; the upgrade threshold from Substate 29 to Substate 28 is an overload probability of 86% with a confidence level of 92.5%; and the upgrade threshold from Substate 31 to Substate 29 is an overload probability of 86% with a confidence level of 92.5%. The upgrade threshold for upgrading from Substate 1 to Substate 0 is an overload probability of 90% and a confidence level of 95%. Therefore, in this embodiment, upgrade thresholds for different power state levels can be set differently. For the current predicted overload probability of 86% and a confidence level of 92%, if the current power state is Substate 31 or Substate 30, the strategy decision module will implement an upgrade strategy that reduces the power state by 1. If the current power state is Substate 29, the strategy decision module will not implement an upgrade strategy that reduces the power state by 1 because the confidence level is insufficient.

[0055] The degradation threshold can also be set differently: there are two types of degradation thresholds for degrading from Substate 0 to Substate 1: one is the overload probability degradation threshold, which is greater than the degradation threshold for degrading from Substate 30 to Substate 31; the other is the confidence degradation threshold, which is less than the degradation threshold for degrading from Substate 30 to Substate 31. For example, the degradation threshold for degrading from Substate 0 to Substate 1 is an overload probability of 70% and a confidence level of 90%; the degradation threshold for degrading from Substate 1 to Substate 2 is an overload probability of 69% and a confidence level of 90.5%; and the degradation threshold for degrading from Substate 30 to Substate 31 is an overload probability of 65% and a confidence level of 95%. When the predicted value of the overload probability is lower than the overload probability degradation threshold, and the predicted value of the confidence level exceeds the confidence level degradation threshold, the policy decision module can make a degradation strategy of incrementing the power consumption state by 1. This innovative sub-module strategy registry design enables customized strategies for subsystems with different characteristics, such as GPU computing units and video encoders, achieving unprecedented fine-grained management.

[0056] The fifth embodiment of the training method for the predictive analysis module is as follows: Unlike the third and fourth embodiments, which use quantile regression to train the LSTM prediction model, the training method in this embodiment is as follows: Acquiring time-series historical data includes obtaining time-series historical performance data from the performance counter register and sampling historical power consumption data of the subsystem. The historical performance data and historical power consumption data are then aligned on the timestamps to obtain time-series data as [(X1,L1),(X2,L2),…,(X...]. n ,L n ]], where X represents the performance data vector and L represents the power consumption parameter; Define the time window length, denoted as window_size; define the prediction step size, denoted as step_size; and construct samples as follows: the input of a sample is X. t To X t+window_size-1 The time-series data, the label of this sample is determined by the following method: obtaining the power consumption parameter L t+step_size To L t+step_size+window_size-1 Define time series data X t The corresponding power consumption parameter is L t Statistical power consumption parameter L t+step_size To L t+step_size+window_size-1 In the middle of the power consumption parameter L t The proportion is used as a label; it can be seen that this embodiment differs from the first and second embodiments in that it uses power consumption as a label: in this embodiment, probability is used as a label. Construct a dataset that includes multiple samples and their corresponding labels; A basic model is designed based on the LSTM architecture, and the basic model is trained using the constructed dataset to obtain an LSTM prediction model that can predict the overload probability.

[0057] In a further embodiment, applicable to the above embodiments: there are multiple subsystems, and each subsystem is configured with a corresponding priority; When the sum of the power consumption of all subsystems reaches a preset proportion of the total power consumption resources (e.g., 75%), it indicates that the remaining available power consumption has reached the alarm threshold. At this time, power consumption resources need to be allocated to subsystems with higher priority. For example, the allocable power consumption budget of the lowest priority or lower priority subsystems can be limited to a preset level. For example, before reaching the alarm threshold, the highest power consumption state of each subsystem is Substate 0. After reaching the alarm threshold, the highest power consumption state of the subsystem with the lowest priority is limited to Substate 6, and the highest power consumption state of the subsystem with the second lowest priority is limited to Substate 3. In this case, when a subsystem reaches its corresponding highest power consumption state, even if the predictive analysis module predicts that the probability of overload is extremely high and the confidence level is extremely high, it will no longer generate the control command that was originally intended to improve the power consumption state. The implementation of prioritizing power resources for high-priority subsystems also includes setting bias coefficients for each subsystem according to their priority. The strategy decision module combines these bias coefficients to generate control commands, with the bias coefficients of higher-priority subsystems being greater than those of lower-priority subsystems. For example, the bias coefficient for the highest-priority subsystem is 1 or 1.1, the bias coefficient for the second-highest-priority subsystem is 0.95, and the bias coefficient for the lowest-priority subsystem is 0.8. This makes the conditions for lower-priority subsystems to improve their power state more stringent and the conditions for improving their power state more lenient.

[0058] In another embodiment of the present invention, a PCIe DPA active power allocation method based on workflow prediction is provided, such as... Figure 2 As shown, the DPA active power allocation method includes the following steps: The performance counter register is used to record the performance data of each subsystem of the PCIe device; The workflow detection module receives real-time performance data from the performance counter register, wherein the real-time performance data has a timestamp and system identifier data representing the corresponding subsystem; and collects performance data of a preset type from it, and constructs time series data corresponding to each subsystem based on the timestamp; The time series data is input into the trained predictive analysis module, which predicts the load of the corresponding subsystem based on the time series data. Control commands are generated based on the prediction results of the predictive analysis module. The control commands include maintaining the power consumption state, increasing the power consumption state, or decreasing the power consumption state. The DPA control execution module reads the control instructions and writes them into the DPA capability structure register, thereby adjusting and configuring the power consumption state of the subsystem that matches the system identification data.

[0059] Furthermore, following any one or a combination of the aforementioned technical solutions, the predictive analysis module completes its training in the following manner: Acquiring time-series historical data includes obtaining time-series historical performance data from the performance counter register and sampling historical power consumption data of the subsystem. The historical performance data and historical power consumption data are then aligned on the timestamps to obtain time-series data as [(X1,L1),(X2,L2),…,(X...]. n ,L n ]], where X represents the performance data vector and L represents the power consumption parameter; Define the time window length, denoted as window_size; define the prediction step size, denoted as step_size; and construct samples as follows: the input of a sample is X. t To X t+window_size-1 The time series data, the label of this sample includes L t+step_size To L t+step_size+window_size-1 In this way, a dataset consisting of multiple samples and their corresponding labels is constructed; Define time series data X t The corresponding power consumption parameter is L t ; Statistical original label L t+step_size To L t+step_size+window_size-1 In the middle of the power consumption parameter L t The proportion of this is used as a label for the probability of overload; The stability of the subsystem load is measured within the time period from t to (t + window_size - 1); a dataset including multiple samples, corresponding labels, and stability measurement results is constructed accordingly. The learning objective of the quantile LSTM network model during training is designed to learn the overload probability prediction of different quantiles and output the confidence level based on the stability of the subsystem load within the corresponding time period: the higher the stability of the subsystem load, the higher the confidence level; the lower the stability of the subsystem load, the lower the confidence level.

[0060] Furthermore, following any of the aforementioned technical solutions or combinations thereof, if the actual overload probability value of the label is lower than the overload probability prediction value of the lowest quantile predicted by the model, or if the actual overload probability value of the label is higher than the overload probability prediction value of the highest quantile predicted by the model, then the training score for its overload probability prediction will be deducted. If the confidence value predicted by the model is greater than the first confidence level, and the actual overload probability value of the label does not fall within the range between the overload probability prediction value of the lowest quantile and the overload probability prediction value of the highest quantile, then the training score of its confidence prediction will be deducted. If the confidence value predicted by the model is lower than the second confidence level, and the actual overload probability value of the label is between the overload probability prediction value of the lowest quantile and the overload probability prediction value of the highest quantile, then the training score for its confidence prediction will be deducted.

[0061] It should be noted that the PCIe DPA active power allocation method based on workflow prediction provided in this embodiment is based on the same concept as the PCIe DPA active power allocation system based on workflow prediction provided in the above embodiments. The content of the PCIe DPA active power allocation system embodiment based on workflow prediction can be incorporated into this PCIe DPA active power allocation method embodiment by reference, and the content of this PCIe DPA active power allocation method embodiment based on workflow prediction can also be incorporated into the PCIe DPA active power allocation system embodiment based on workflow prediction by reference. Further details will not be repeated.

[0062] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0063] The above description is only a specific embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A training method for an LSTM prediction model for PCIe device subsystem load prediction, characterized in that, Includes the following steps: Acquire time-series historical data, including time-series historical performance data recorded for the PCIe device subsystem and historical power consumption data sampled from the subsystem, and align the historical performance data and historical power consumption data on timestamps to obtain time-series data as [(X1,L1),(X2,L2),…,(X... n ,L n ]], where X represents the performance data vector and L represents the power consumption parameter; Define the time window length, denoted as window_size; define the prediction step size, denoted as step_size; and construct samples as follows: the input of a sample is X. t To X t+window_size-1 The time series data, the label of this sample includes L t+step_size This is used to construct a dataset that includes multiple samples and their corresponding labels. A basic model is designed based on the LSTM architecture, and the basic model is trained using the constructed dataset to obtain the LSTM prediction model.

2. The LSTM prediction model training method according to claim 1, characterized in that, The LSTM prediction model outputs overloaded probability predictions in the following way: The sample is labeled L t+step_size To L t+step_size+window_size-1 ; The trained LSTM prediction model predicts the input data X. current To X current+window_size-1 The power consumption parameter is L current+step_size To L current+step_size+window_size-1 ; Get the current input data X current The corresponding current power consumption parameter is compared with the predicted power consumption parameter, and the power consumption parameter L is calculated. current+step_size To L current+step_size+window_size-1 The proportion of power consumption exceeding the current power consumption parameter is used as the probability prediction value of overload.

3. The LSTM prediction model training method according to claim 1, characterized in that, The LSTM prediction model outputs overloaded probability predictions in the following way: The sample is labeled L t+step_size To L t+step_size+window_size-1 ; Configure the last layer of the LSTM network to simultaneously predict vectors of k quantiles; The quantile LSTM network model is trained using the quantile loss function to output arbitrary quantiles end-to-end, forming the prediction range of future load distribution and the prediction value of overload probability.

4. The LSTM prediction model training method according to claim 3, characterized in that, The LSTM prediction model can also output confidence intervals in the following way: Define time series data X t The corresponding power consumption parameter is L t ; Statistical original label L t+step_size To L t+step_size+window_size-1 In the middle of the power consumption parameter L t The proportion of this is used as a label for the probability of overload; The stability of the subsystem load is measured within the time period from t to (t + window_size - 1); a dataset including multiple samples, corresponding labels, and stability measurement results is constructed accordingly. The learning objective of the quantile LSTM network model during training is designed to learn the overload probability prediction of different quantiles, and output the confidence score based on the stability of the subsystem load within the corresponding time period: the higher the stability of the subsystem load, the higher the confidence score; the lower the stability of the subsystem load, the lower the confidence score. Based on the constructed dataset, the base model is trained to obtain the LSTM prediction model: if the true overload probability value of the label is lower than the overload probability prediction value of the lowest quantile predicted by the model, or if the true overload probability value of the label is higher than the overload probability prediction value of the highest quantile predicted by the model, then the training score of its overload probability prediction is deducted.

5. The LSTM prediction model training method according to claim 4, characterized in that, The learning objectives of the quantile LSTM network model during training include learning the overload probability prediction of the intermediate quantile between the lowest and highest quantiles. If the confidence level output by the LSTM prediction model is lower than a preset confidence threshold, no control command for adjusting the subsystem power consumption is generated; if the confidence level output by the LSTM prediction model reaches the preset confidence threshold, a control command for adjusting the subsystem power consumption is generated according to the overload probability prediction result of the LSTM prediction model at the middle quantile, including: If the overload probability prediction value of the LSTM prediction model at the middle quantile is greater than the preset upper probability threshold, then a control command to improve the power consumption state is generated. If the predicted overload probability is less than the preset lower probability threshold, a control instruction to reduce power consumption is generated; otherwise, a control instruction to maintain power consumption is generated.

6. The LSTM prediction model training method according to claim 1, characterized in that, The label for this sample was determined by obtaining the power consumption parameter L. t+step_size To L t+step_size+window_size-1 Define time series data X t The corresponding power consumption parameter is L t Statistical power consumption parameter L t+step_size To L t+step_size+window_size-1 In the middle of the power consumption parameter L t The proportion, used as a label; Construct a dataset that includes multiple samples and their corresponding labels; A basic model is designed based on the LSTM architecture, and the basic model is trained using the constructed dataset to obtain the LSTM prediction model.

7. A processing module for PCIe DPA active power allocation based on workflow prediction, characterized in that, Based on load prediction, the processing module enables proactive dynamic power consumption adjustment of PCIe devices, including a workflow detection module, a predictive analysis module, a strategy decision module, and a DPA control execution module. The workflow detection module is configured to receive real-time performance data of each subsystem of the PCIe device from the PCIe device, wherein the real-time performance data has a timestamp; and to collect performance data of a preset type from it, and to construct time series data corresponding to each subsystem based on the timestamp; The predictive analysis module is configured to predict the load of the corresponding subsystem based on the time series data. The strategy decision module is configured to generate control instructions for adjusting the power consumption of the subsystem based on the prediction results of the prediction analysis module. The DPA control execution module is configured to read the control instructions from the policy decision module and write them into the DPA capability structure register.

8. The processing module for PCIe DPA active power allocation based on workflow prediction according to claim 7, characterized in that, The prediction analysis module is obtained based on the LSTM prediction model training method according to any one of claims 1 to 6.

9. The processing module for PCIe DPA active power allocation based on workflow prediction according to claim 7, characterized in that, The workflow detection module determines the corresponding data type based on the function and type of each subsystem, which includes one or more of the following data types: The data type is utilization, and its corresponding real-time performance data includes computing unit active cycles and instruction throughput. The data type is memory-based, and its corresponding real-time performance data includes video memory read / write bandwidth and cache miss rate. The data type is a queue, and its corresponding real-time performance data includes task queue depth and the number of DMA requests.

10. The processing module for PCIe DPA active power allocation based on workflow prediction according to any one of claims 7 to 9, characterized in that, Before the DPA control execution module reads the control command from the policy decision module, the process further includes: the policy decision module performing a security check on the control command, including one or more of the following checks: Predict whether the power consumption target state of the corresponding subsystem is valid after executing the control command; And / or predict whether the power consumption target state of the corresponding subsystem after executing the control command exceeds the power consumption limit of the subsystem itself; And / or predict whether the sum of the power consumption of all subsystems of the PCIe device exceeds the total power consumption resources after the corresponding subsystem executes the control command; If the conditions are met and / or the limits are not exceeded, the security check passes, and the policy decision module sends the control command to the DPA control execution module. If the security check fails, the policy decision module will not send the control command to the DPA control execution module.

11. The processing module for PCIe DPA active power allocation based on workflow prediction according to any one of claims 7 to 9, characterized in that, The real-time performance data of each subsystem also includes system identification data that characterizes the corresponding subsystem; The control commands include maintaining power consumption state, increasing power consumption state, or decreasing power consumption state. If the control instruction is to increase power consumption, then the DPA capability structure register configures the subsystem that matches the system identification data to increase power consumption. If the control command is to reduce power consumption, the DPA capability structure register configures the subsystem that matches the system identification data to reduce power consumption.

12. The processing module for PCIe DPA active power allocation based on workflow prediction according to any one of claims 7 to 9, characterized in that, Each subsystem of the PCIe device is configured with a corresponding priority. When the sum of the power consumption of all subsystems reaches a preset proportion of the total power consumption resources, one or more of the following methods will be used to allocate power consumption resources to subsystems with higher priority: Limit the allocable power budget for the lowest priority or lower-priority subsystems to a preset level; And / or, set bias coefficients for each subsystem according to their priority, and the strategy decision module combines the bias coefficients to generate control commands, with the bias coefficients of higher priority subsystems being greater than those of lower priority subsystems.