GPU load prediction method, device and equipment, medium and program product

By combining the combined prediction model of the gated cycle unit model and the attention mechanism converter model, the problem of insufficient GPU load prediction accuracy in the prior art is solved, and more accurate short-term and long-term GPU load prediction is achieved to meet the real-time processing needs of cloud-based wireless networks.

CN119848754APending Publication Date: 2025-04-18ZGC INSTITUTE OF UBIQUITOUS-X INNOVATION & APPLICATIONS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410997195.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the prior art, GPU load prediction accuracy is insufficient and cannot take into account both short-term and long-term prediction performance.

Method used

A combined prediction model combining the gated cyclic unit model and attention mechanism transformer model is adopted. The first model captures the short-term dynamic nonlinear change characteristics of each time step, and the second model analyzes the long-term dependency relationship based on the characteristics of multiple time steps to generate more accurate GPU load prediction results.

Benefits of technology

It improves the accuracy of GPU load prediction, can capture short-term and long-term changes more accurately, and meets the demand for real-time processing in cloud-based wireless networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848754A_ABST
    Figure CN119848754A_ABST
Patent Text Reader

Abstract

The invention provides a GPU load prediction method, device and equipment, a medium and a program product, and relates to the technical field of terminals. The GPU load prediction method comprises the following steps: obtaining a GPU load prediction result according to GPU load historical data and a GPU load prediction model; wherein the GPU load prediction model comprises a first model and a second model, and the first model is obtained based on a gating cycle unit model and is used for obtaining a corresponding first hidden state feature according to GPU load historical data of each time step; the second model is obtained based on an attention mechanism converter model and is used for obtaining a GPU load prediction result according to the first hidden state features of the multiple time steps. According to the scheme, the GPU load prediction precision can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of terminal technology, and in particular to a GPU load prediction method, device, equipment, medium and program product. Background Art

[0002] GPU (Graphics Processing Unit) has the computing characteristics of slow reading, fast computing, strong parallelism and weak seriality. It shows outstanding performance advantages in the fields of artificial intelligence model training and reasoning, high-performance parallel computing, and is widely used in artificial intelligence, the Internet, mobile communications and other fields. Moreover, GPU can not only be used as an artificial intelligence accelerator in wireless networks to complete model training and reasoning computing, but also has potential advantages in physical layer technologies such as MIMO (Multiple-Input Multiple-Output, multiple antennas) technology. In summary, GPU has great application potential in future wireless networks.

[0003] Cloudification has become an important technical direction for future wireless networks. In future cloud-based wireless networks, it is necessary to consider highly fragmented and distributed deployment scenarios and cost and power consumption, so that servers will only configure a small amount of GPU resources according to demand to cope with diverse task loads, which exacerbates the scarcity of GPU resources in future cloud-based wireless networks.

[0004] Therefore, faced with the scarcity of GPU resources and the strict requirements of wireless networks for real-time processing, multiple core modules of the wireless cloud platform, such as orchestration and scheduling, require the cloud platform to accurately predict the GPU load.

[0005] The current methods for predicting GPU load still lack prediction accuracy because they cannot take into account both short-term and long-term prediction performance. Summary of the invention

[0006] The technical solution of the present invention aims to provide a GPU load prediction method, device, equipment, medium and program product, which are used to solve the problem of insufficient GPU load prediction accuracy in the prior art.

[0007] To achieve the above object, the present invention is achieved by:

[0008] In a first aspect, an embodiment of the present invention provides a GPU load prediction method, comprising:

[0009] Obtain GPU load prediction results based on GPU load historical data and GPU load prediction model;

[0010] Among them, the GPU load prediction model includes a first model and a second model, the first model is obtained based on a gated recurrent unit model, and is used to obtain the corresponding first hidden state features according to the GPU load history data of each time step; the second model is obtained based on an attention mechanism transformer model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps.

[0011] Optionally, in the GPU load prediction method, the bias parameters used for resetting the gating vector and updating the gating vector in the first model are the same.

[0012] Optionally, in the GPU load prediction method, the first model is specifically used for:

[0013] Obtain candidate hidden state features according to the reset gating vector, the GPU load history data of the current time step, and the first hidden state feature of the previous time step;

[0014] The first hidden state feature of the current time step is obtained according to the updated gating vector, the candidate hidden state feature and the first hidden state vector of the previous time step.

[0015] Optionally, in the GPU load prediction method, the second model comprises an approximate attention mechanism encoder module and a linear module;

[0016] Wherein, the approximate attention mechanism encoder module is used to:

[0017] Approximate the attention scores corresponding to the first hidden state features of multiple time steps to obtain approximate attention scores;

[0018] Attention features are obtained based on the approximately processed attention scores;

[0019] Obtaining a second hidden state feature according to the attention feature;

[0020] The linear module is used to map the second hidden state feature to obtain the GPU load prediction result.

[0021] Optionally, in the GPU load prediction method, the approximate attention mechanism encoder module includes an approximate attention mechanism layer, and the approximate attention mechanism layer is used to:

[0022] Obtain a first attention score according to the embedded features corresponding to the first hidden state features of multiple time steps;

[0023] Performing a scaled dot product based on the first attention score to obtain a second attention score;

[0024] setting a second attention score that is less than the first score to the second score;

[0025] Obtaining an approximated attention score based on a second attention score that is greater than or equal to the first score and a second attention score that is equal to the second score;

[0026] The attention feature is obtained according to the approximated attention score and the embedded feature.

[0027] Optionally, in the GPU load prediction method, the second model further includes a position encoding module and a splicing module;

[0028] Wherein, the position encoding module is used to obtain position encoding features corresponding to the first hidden state features of multiple time steps;

[0029] The splicing module is used to positionally embed the first hidden state features and corresponding position encoding features of multiple time steps to obtain embedded features corresponding to the first hidden state features of multiple time steps;

[0030] The approximate attention mechanism encoder module is specifically used to obtain an attention score based on the embedded features corresponding to the first hidden state features of multiple time steps, and to approximate the attention score to obtain an approximate processed attention score, to obtain an attention feature based on the approximate processed attention score, and to obtain a second hidden state feature based on the attention feature.

[0031] Optionally, in the GPU load prediction method, the approximate attention mechanism layer further includes a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer;

[0032] The first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer are used to process the attention features in sequence to obtain the second hidden state features.

[0033] Optionally, the GPU load prediction method further comprises:

[0034] Processing missing values ​​of the GPU load history data to obtain processed GPU load history data;

[0035] Based on the GPU load history data and GPU load prediction model, the GPU load prediction results are obtained, including:

[0036] A GPU load prediction result is obtained according to the processed GPU load history data and the GPU load prediction model.

[0037] In a second aspect, an embodiment of the present invention further provides a GPU load prediction device, comprising:

[0038] A prediction module is used to obtain a GPU load prediction result based on GPU load historical data and a GPU load prediction model;

[0039] Among them, the GPU load prediction model includes a first model and a second model, the first model is obtained based on a gated recurrent unit model, and is used to obtain the corresponding first hidden state features according to the GPU load history data of each time step; the second model is obtained based on an attention mechanism transformer model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps.

[0040] In a third aspect, an embodiment of the present invention further provides a GPU load prediction device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the GPU load prediction method as described in the first aspect is implemented.

[0041] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the GPU load prediction method as described in the first aspect is implemented.

[0042] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the GPU load prediction method as described in the first aspect.

[0043] The beneficial effects of the above technical solution of the present invention are as follows:

[0044] The GPU load prediction method described in the embodiment of the present invention is used to obtain a GPU load prediction result based on GPU load history data and a GPU load prediction model; wherein the GPU load prediction model includes a first model and a second model, wherein the first model is obtained based on a gated cyclic unit model, and is used to obtain the corresponding first hidden state feature according to the GPU load history data of each time step; and the second model is obtained based on an attention mechanism transformer model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps. In this way, the GPU load prediction model including the first model and the second model combines the ability to capture short-term dynamic nonlinear change characteristics and long-term dependency characteristics, thereby improving the accuracy of GPU load prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic diagram of a flow chart of a GPU load prediction method according to an embodiment of the present invention;

[0046] Figure 2A schematic diagram of a process for implementing the method according to an embodiment of the present invention;

[0047] Figure 3 A schematic diagram of the structure of the GPU load prediction model according to an embodiment of the present invention;

[0048] Figure 4 Schematic diagram of the structure of the approximate attention mechanism layer according to an embodiment of the present invention;

[0049] Figure 5 One of the schematic diagrams of GPU load prediction results of a simulation experiment using the method described in an embodiment of the present invention;

[0050] Figure 6 The second schematic diagram is a result of GPU load prediction of a simulation experiment using the method described in an embodiment of the present invention;

[0051] Figure 7 One of the schematic diagrams of GPU load prediction error in a simulation experiment using the method described in an embodiment of the present invention;

[0052] Figure 8 The second schematic diagram of GPU load prediction error in a simulation experiment using the method described in an embodiment of the present invention;

[0053] Fig. 9 A schematic diagram of the evaluation index results of the GPU load prediction model according to an embodiment of the present invention;

[0054] Fig.10 A schematic diagram of the structure of a GPU load prediction device according to an embodiment of the present invention;

[0055] Fig.11 The figure is a schematic diagram of the hardware structure of the GPU load prediction device described in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0057] The embodiment of the present invention, as Figure 1 As shown, a GPU load prediction method is provided, comprising:

[0058] Step 101, obtaining a GPU load prediction result according to GPU load history data and a GPU load prediction model;

[0059] Among them, the GPU load prediction model includes a first model and a second model. The first model is obtained based on the GRU (Gated Recurrent Unit) model, and is used to obtain the corresponding first hidden state features according to the GPU load history data of each time step; the second model is obtained based on the attention mechanism transformer (AttentionTransformer) model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps.

[0060] It can be understood that the GPU load prediction model includes a first model and a second model, which is a combined model for predicting GPU load. Specifically, the first model outputs the first hidden state feature corresponding to each time step, and the first hidden state feature can highlight the short-term dynamic nonlinear change characteristics while retaining the long-term dependency information contained in the GPU load history data. Then, the second model can be used to convert the captured long-term dependency information and short-term dynamic nonlinear change characteristics of the GPU load history data into GPU load prediction results, thereby obtaining GPU load short-term prediction results and GPU load long-term prediction results, and improving the GPU load prediction accuracy.

[0061] The GPU load history data is the GPU load history data of multiple time steps, and the interval between every two time steps of the GPU load history data is the same length. The GPU load history data of multiple time steps is a one-dimensional sequence.

[0062] Optionally, before step 101, the method further includes:

[0063] Processing missing values ​​of the GPU load history data to obtain processed GPU load history data;

[0064] Step 101 includes:

[0065] A GPU load prediction result is obtained according to the processed GPU load history data and the GPU load prediction model.

[0066] It should be noted that, since the interval between every two time steps of the GPU load history data is the same length, it is possible to determine whether missing occurs based on the acquired GPU load history data, and if missing occurs, calculate the missing rate; further, if the missing rate is greater than the missing rate threshold, the GPU load history data can be discarded, and if the missing rate is less than or equal to the missing rate threshold, the GPU load history data is processed for missing values. Optionally, the mean filling method is used to fill the missing values.

[0067] like Figure 2The following is a flow chart of an implementation method of the GPU load prediction method according to an embodiment of the present invention. According to this implementation method, the GPU load prediction method includes the following steps:

[0068] Step 201, obtaining GPU load history data.

[0069] Step 202 , preprocessing the GPU load history data, optionally including the above-mentioned missing value processing.

[0070] Step 203: normalize the filled GPU load history data using a normalization method to obtain pre-processed GPU load history data. It should be noted that the pre-processed GPU load history data is a one-dimensional sequence.

[0071] Step 204: input the pre-processed GPU load history data into a first model of the GPU load prediction model to obtain a one-dimensional first hidden state feature.

[0072] Step 205: transfer the first hidden state feature to the second model to obtain the GPU load prediction result for the future time period.

[0073] In one implementation manner, optionally, the offset parameters used for resetting the gating vector and updating the gating vector in the first model are the same.

[0074] In the embodiment of the present invention, the first model is determined based on the GRU model. The first model adopts the calculation method of resetting the gating vector and updating the gating vector of the GRU model. Specifically, the resetting gating vector r t The calculation method of is shown in the following formula (1), update the gate vector z t The calculation method of is shown in the following formula (2).

[0075] r t =σ(W r ·[x t +h t-1 ]+b r )(1)

[0076] z t =σ(W z ·[x t +h t-1 ]+b z )(2)

[0077] Where σ is the sigmoid function, x t Represents the GPU load history data of the current time step; h t-1 represents the first hidden feature state of the previous time step; W r , Wz represents the weight parameter; b r 、b z Represents the bias parameter.

[0078] Since the reset gating vector r in the first model t and update the gating vector z t The bias parameters used are the same, that is, b in the above formula r and b z Same, set b r =b z =b, so the bias parameter is shared, and the first model can be called a shared gated recurrent unit (SGRU) model, or SGRU model for short.

[0079] It should be noted that b in the above formula r and b z The same is set to the same b and initialized to 0, so any short-term changes in the GPU load history data will be considered by both gating vectors through the same bias parameter and reset the gating vector r t and update the gating vector z t The response to short-term dynamic nonlinear information is more consistent, thereby increasing the capture of short-term dynamic nonlinear change characteristics of GPU load historical data and improving the accuracy of GPU load short-term prediction.

[0080] In addition to improving the short-term prediction accuracy of GPU load, shared bias parameters can also be used as a regularization method to improve the generalization ability of the model, reduce overfitting, and improve the accuracy of actual GPU load prediction when the historical data of GPU load is limited. Of course, the reduction of parameters can also reduce memory usage and save computing costs, quickly converge the input GPU load sequence, and speed up the prediction speed.

[0081] In one embodiment, optionally, the first model is specifically used for:

[0082] Obtain candidate hidden state features according to the reset gating vector, the GPU load history data of the current time step, and the first hidden state feature of the previous time step;

[0083] The first hidden state feature of the current time step is obtained according to the updated gating vector, the candidate hidden state feature and the first hidden state vector of the previous time step.

[0084] Figure 3 FIG. 1 is a schematic diagram of the structure of the GPU load prediction model according to an embodiment of the present invention. Figure 3 , the first model is described as follows:

[0085] The first model includes a reset gating and an update gating, which are used to calculate the reset gating vector and the update gating vector as described above, respectively. The reset gating vector r t It will decide how much past information to ignore and how much new information to introduce, and update the gating vector z t Determine how much influence the GPU load history data of the current time step has on the first hidden state feature, so as to effectively capture the short-term nonlinear dynamic change characteristics of the GPU load history data.

[0086] The candidate hidden state feature h ′ t By using the following formula (3) to calculate, the memory can be adjusted according to the GPU load history data of the current time step and the first hidden state characteristics of the previous time step, so as to better capture the short-term nonlinear dynamic change characteristics in the GPU load history data.

[0087] h ′ t =tanh(W c ·[r t ⊙h t-1 ,x t ]+b h )(3)

[0088] Among them, tanh is the hyperbolic tangent function, x t Represents the GPU load history data of the current time step; h t-1 represents the first hidden state feature of the previous time step; ⊙ represents element-by-element multiplication; W c represents the weight parameter; b h Represents the bias parameter.

[0089] It should be noted that the GPU load history data of a time step corresponds to a first hidden state feature. Specifically, the first hidden state feature of the current time step is calculated using the following formula (4).

[0090] h t =(1-z t )⊙h t-1 +z t ⊙h ′ t (4)

[0091] Among them, h t represents the first hidden state feature of the current time step; z t represents the updated gating vector calculated by the above formula (2); h ′ t represents the candidate hidden state feature of the current time step; h t-1represents the first hidden state feature of the previous time step; ⊙ represents element-wise multiplication.

[0092] Then, the GPU load history data of all time steps (a one-dimensional sequence, using x t The first hidden state feature corresponding to the first hidden state feature of multiple time steps is a one-dimensional sequence, using x t ′ ), which is input into the second model, so as to obtain the GPU load prediction result.

[0093] In one embodiment, optionally, the second model includes an approximate attention mechanism encoder module and a linear module;

[0094] Wherein, the approximate attention mechanism encoder module is used to:

[0095] Approximate the attention scores corresponding to the first hidden state features of multiple time steps to obtain approximate attention scores;

[0096] Attention features are obtained based on the approximately processed attention scores;

[0097] Obtaining a second hidden state feature according to the attention feature;

[0098] The linear module is used to map the second hidden state feature to obtain the GPU load prediction result.

[0099] Here, still combined Figure 3 , the second model of the embodiment of the present invention is described:

[0100] The approximate attention mechanism encoder module performs approximate processing on the attention scores corresponding to the first hidden state features of multiple time steps, which means introducing an approximate attention mechanism (Approximate Attention), thereby ignoring some GPU load history data that have little effect on the GPU load prediction results, and retaining some GPU load history data that has an effect on the GPU load prediction results.

[0101] The linear module, i.e., the output layer of the GPU load prediction model, can obtain the final GPU load prediction result. Here, the loss function can also be calculated in the linear module. The loss function guides the optimization of model parameters through the difference between the GPU load prediction result output by the GPU load prediction model and the actual GPU load data. For example, the loss function shown in the following formula (5) is set.

[0102]

[0103] Where n is the number of samples; y i is the actual GPU load data of the i-th sample; is the predicted GPU load prediction result of the i-th sample.

[0104] It should be noted that, since the second model includes an approximate attention mechanism encoder module, the second model can be called an approximate attention mechanism transformer (Approximate Attention Transformer) model, abbreviated as AA-Transformer model.

[0105] At this point, the GPU load prediction model described in the embodiment of the present invention is a combined model including a shared gated recurrent unit and an approximate attention mechanism transformer (Shared Gated Recurrent Unit and Approximate Attention Transformer), so the GPU load prediction model can be referred to as an SGRU-(AA-Transformer) model.

[0106] In one implementation manner, optionally, the second model further includes a positional encoding module and a splicing module;

[0107] Wherein, the position encoding module is used to obtain position encoding features corresponding to the first hidden state features of multiple time steps;

[0108] The splicing module is actually a vector and operation module, which is used to perform position embedding according to the first hidden state features of multiple time steps and the corresponding position encoding features to obtain the embedded features corresponding to the first hidden state features of multiple time steps; the approximate attention mechanism encoder module is specifically used to obtain the attention score according to the embedded features corresponding to the first hidden state features of multiple time steps, and approximate the attention score to obtain the approximate processed attention score, obtain the attention feature according to the approximate processed attention score, and obtain the second hidden state feature according to the attention feature.

[0109] Here, continue to combine Figure 3 , the second model of the embodiment of the present invention is specifically described:

[0110] First, it is necessary to obtain the position encoding features corresponding to the first hidden state features of multiple time steps through the position encoding module. Position encoding can help the model understand the relative position of the GPU load history data of each time step in the GPU load history data of multiple time steps. Specifically, the position encoding feature PE is calculated using the following formulas (6) and (7).

[0111]

[0112] Where, pos represents the position of the GPU load history data of each time step in the GPU load history data of multiple time steps; d model Represents the dimension size of the hidden layer of the second model; i is the dimension index, corresponding to different dimensions in the encoding.

[0113] Then, the splicing module embeds according to the first hidden state feature and the position encoding feature, that is, performs position embedding to obtain an embedded feature containing position information. Specifically, the embedded feature E is calculated using the following formula (8).

[0114] E=W E x t ′ +PE(8)

[0115] Among them, W E represents the weight parameter; x t ′ Represents the first hidden state features of multiple time steps, where the first hidden state feature of one time step is h t ; PE is the position encoding feature.

[0116] In one embodiment, optionally, the approximate attention mechanism encoder module includes an approximate attention mechanism layer, a first residual connection and normalization (Add&Norm) layer, a feed forward network (Feed Forward) layer, and a second residual connection and normalization (Add&Norm) layer;

[0117] Wherein, the approximate attention mechanism layer is used to:

[0118] Obtain a first attention score according to the embedded features corresponding to the first hidden state features of multiple time steps;

[0119] Performing a scaled dot product based on the first attention score to obtain a second attention score;

[0120] setting a second attention score that is less than the first score to the second score;

[0121] Obtaining an approximated attention score based on a second attention score that is greater than or equal to the first score and a second attention score that is equal to the second score;

[0122] Obtaining the attention feature according to the approximated attention score and the embedded feature;

[0123] The first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer are used to process the attention features in sequence to obtain the second hidden state features.

[0124] In this embodiment of the present invention, the approximate attention mechanism encoder module is specifically described:

[0125] First, combine Figure 4 Explain the approximate attention mechanism layer:

[0126] Before calculating the attention score, you need to use the Matmul (which stands for matrix multiplication) function to calculate the following three matrices.

[0127] The following formula (9) is used to transform the embedding feature E and the weight parameter W Q Multiply them together to get Query (Q);

[0128] The following formula (10) is used to transform the embedding feature E and the weight parameter W K Multiply them to get Key(K);

[0129] The following formula (11) is used to transform the embedding feature E and the weight parameter W H Multiply them and get Value(V).

[0130] Q=E·W Q (9)

[0131] K=E·W K (10)

[0132] V=E·W V (11)

[0133] The following formula (12) is used to obtain the first attention score. It should be noted that the first attention score Attention Scores is the original attention score corresponding to the first hidden state features of multiple time steps.

[0134] Attention Scores = QK T (12)

[0135] Next, the following formula (13) is used to scale the dot product of the first attention score to obtain the second attention score S = Scaled Attention Scores, where the second attention score is the scaled attention score.

[0136]

[0137] Among them, d k Represents dimension.

[0138] Set the first score to θ and the second score to 0, set the second attention score less than θ to 0, and do not process the second attention score greater than or equal to the first score and remain the same, that is, use the following formula (14) to describe it, so as to obtain the approximate processed attention scores.

[0139]

[0140] Thus, in an embodiment of the present invention, the approximate attention mechanism layer adopts a selective calculation strategy. After scaling the first attention score, it adds approximate processing (i.e., threshold processing) and assigns attention scores below a certain value that do not affect the accuracy of GPU load prediction to 0, thereby retaining some GPU load history data that is effective for the GPU load prediction results.

[0141] After approximation, the weights can be concentrated on those K that are most relevant to the current Q, which can prevent the model from being overly sensitive to subtle fluctuations in the GPU load history data, reduce interference and overfitting, and retain the connection between the elements that are crucial to the short-term nonlinear dynamic change characteristics and long-term dependency characteristics in the GPU load history data, thereby improving the GPU load prediction accuracy. Some elements in the attention feature are 0, which can reduce the amount of calculation and thus speed up the prediction.

[0142] Furthermore, after obtaining the approximate attention score, the Softmax (normalized exponential) function and the following formula (15) can be used for normalization to obtain the normalized attention weights.

[0143] Attention Weights=softmax(thershold Scores)(15)

[0144] As shown in the following formula (16), the Matmul function is used to multiply the normalized attention weights AttentionWeights by V obtained from the above embedded features to obtain the attention feature Head 1.

[0145] Head 1=Attention Weights·V(16)

[0146] It should be noted that Head 1 is the attention feature output by an independent approximate attention mechanism layer. The embodiment of the present invention can also execute multiple approximate attention mechanism layers in parallel, and merge the attention features output by multiple approximate attention mechanism layers to obtain the final attention feature.

[0147] In this way, the approximate attention mechanism layer processes information in multiple subspaces in parallel and dynamically adjusts the attention weights of different heads, thereby effectively capturing the short-term dynamic nonlinear change characteristics and long-term dependency characteristics of GPU load history data.

[0148] Next, as shown in the following formula (17), the first residual connection and normalization layer combines residual connection and layer normalization to perform residual connection and layer normalization on the attention features output by the approximate attention layer, thereby improving the performance and stability of the model.

[0149] LNoutput 1=LN(Sublayer(x)+x)(17)

[0150] Wherein, x is the embedded feature E; Sublayer(x) is the attention feature output by the approximate attention mechanism layer; LN represents the normalization function; LNoutput 1 is the output of the first residual connection and normalization layer.

[0151] The feedforward network layer works in conjunction with the approximate attention mechanism layer to enhance representation capabilities and feature conversion by providing additional nonlinear transformation capabilities, thereby improving the ability to understand and process GPU load history data. Specifically, the following formula (18) is used.

[0152] FFNoutput=max(0,xW1+b1)W2+b2(18)

[0153] Wherein, x is the activation value of the feedforward network layer, that is, the output LNoutput 1 of the first residual connection and normalization layer; W1 is the weight parameter of the first linear layer; b1 is the bias parameter of the first linear layer; W2 is the weight parameter of the second linear layer; b2 is the bias parameter of the th linear layer; max(0,·) is the ReLU activation function, which sets the negative value of the input to 0 element by element; FFNoutput is the output of the feedforward network layer.

[0154] Furthermore, the second residual connection and normalization layer shown in the following formula (19) is adopted.

[0155] LNoutput 2=LN(Sublayer(x)+x)(19)

[0156] Among them, x is the output LNoutput 1 of the first residual connection and normalization layer; Sublayer(x) is the output FFNoutput of the feedforward network layer; LN represents the normalization function; LNoutput2 is the output of the first residual connection and normalization layer.

[0157] The following simulation experiment using the GPU load prediction method described in the embodiment of the present invention is taken as an example to illustrate the beneficial effects of the embodiment of the present invention.

[0158] The experimental environment is set up as shown in Table 1 below.

[0159] Experimental environment set up Operating Environment Python 3.7 Deep Learning Frameworks PyTorch 1.8 operating system Windows 10 Memory / GB 16.0 CPU Intel Corei5-8500U GPU NVIDIA GeForce RTX3060 (12GB video memory)

[0160] Table 1

[0161] Optionally, the simulation experiment uses the data set provided by The Grid Work Loads Archiv website and the load time series data provided by Matern. The data set records a grid workload every 5 minutes. Here, the GPU load prediction result of 1 moment is predicted and output with a time interval of 5 minutes, and the long-term prediction of 10 moments is predicted and output. According to this output principle, 10 days of measured working GPU load historical data from April 6, 2023 to April 16, 2023 are selected from the data set, totaling 2880 data records. The first 80% of the data are selected as the training set, and the last 20% of the data are selected as the test set. The parameter settings of the GPU load prediction model are shown in Table 2.

[0162] parameter Parameter settings Input sequence length 30(short term) / 300(long term) The number of hidden layer neurons in the SGRU model 24 Number of layers in the SGRU model 1 Embedding dimension of AA-Transformer model 64 Number of encoder blocks for the AA-Transformer model 2 Number of attention heads of the AA-Transformer model 4 Feedforward network layer dimensions of the AA-Transformer model 128 Output sequence length 1(short term) / 10(long term)

[0163] Table 2

[0164] In this simulation experiment, the GPU load prediction result is the GPU load utilization, such as Figure 5 and Figure 6 As shown in FIG. 1 , the short-term and long-term prediction data of the GPU load utilization rate of the GPU load prediction model are basically consistent with the trend of the original sequence. Figure 7 and Figure 8 It can be seen that the errors between the short-term and long-term predicted data of GPU utilization by the GPU load prediction model and the actual data are mostly concentrated between -3.0 and 3.0, and the errors are relatively small. Therefore, the GPU load prediction model described in the embodiment of the present invention has high prediction accuracy for both short-term and long-term.

[0165] Prediction accuracy is a key indicator for measuring the performance of the GPU resource prediction model. We use the root mean square error (RMSE), mean absolute error (MAE), and determination coefficient R2 to measure the prediction accuracy of the model. The root mean square error is used to measure the error between the predicted value and the true value; the mean absolute error is used to reflect the actual situation of the prediction value error; the determination coefficient R2 quantitatively reflects the fit of the model. The closer its value is to 1, the better the fit of the model.

[0166] Depend on Fig. 9From the quantitative calculation results of RMSE, MAE, and R2 for the prediction values ​​of different models, it can be seen that the prediction accuracy of the GPU load prediction model (SGRU-(AA-Transformer) model) described in the embodiment of the present invention is better than that of a single ARIMA (autoregressive differential moving average) model, LSTM (long short-term memory network) model, and a combined ARIMA-LSTM model and GRU-LSTM model.

[0167] In summary, the GPU load prediction method described in the embodiment of the present invention combines the ability of the SGRU model to capture short-term dynamic nonlinear change characteristics and the ability of the AA-Transformer model to capture long-term dependency characteristics, provides comprehensive sequence data analysis, has better prediction accuracy to predict GPU load, and has a faster prediction speed, thereby meeting the needs of predicting GPU usage in highly distributed deployment scenarios in cloud wireless networks.

[0168] like Fig.10 As shown, an embodiment of the present invention further provides a GPU load prediction device, comprising:

[0169] The prediction module 1001 is used to obtain a GPU load prediction result according to the GPU load historical data and the GPU load prediction model;

[0170] Among them, the GPU load prediction model includes a first model and a second model, the first model is obtained based on a gated recurrent unit model, and is used to obtain the corresponding first hidden state features according to the GPU load history data of each time step; the second model is obtained based on an attention mechanism transformer model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps.

[0171] Optionally, in the GPU load prediction device, the bias parameters used for resetting the gating vector and updating the gating vector in the first model are the same.

[0172] Optionally, in the GPU load prediction device, the first model is specifically used for:

[0173] Obtain candidate hidden state features according to the reset gating vector, the GPU load history data of the current time step, and the first hidden state feature of the previous time step;

[0174] The first hidden state feature of the current time step is obtained according to the updated gating vector, the candidate hidden state feature and the first hidden state vector of the previous time step.

[0175] Optionally, in the GPU load prediction device, the second model comprises an approximate attention mechanism encoder module and a linear module;

[0176] Wherein, the approximate attention mechanism encoder module is used to:

[0177] Approximate the attention scores corresponding to the first hidden state features of multiple time steps to obtain approximate attention scores;

[0178] Attention features are obtained based on the approximately processed attention scores;

[0179] Obtaining a second hidden state feature according to the attention feature;

[0180] The linear module is used to map the second hidden state feature to obtain the GPU load prediction result.

[0181] Optionally, in the GPU load prediction device, the approximate attention mechanism encoder module includes an approximate attention mechanism layer, and the approximate attention mechanism layer is used to:

[0182] Obtain a first attention score according to the embedded features corresponding to the first hidden state features of multiple time steps;

[0183] Performing a scaled dot product based on the first attention score to obtain a second attention score;

[0184] setting a second attention score that is less than the first score to the second score;

[0185] Obtaining an approximated attention score based on a second attention score that is greater than or equal to the first score and a second attention score that is equal to the second score;

[0186] The attention feature is obtained according to the approximated attention score and the embedded feature.

[0187] Optionally, in the GPU load prediction device, the second model further includes a position encoding module and a splicing module;

[0188] Wherein, the position encoding module is used to obtain position encoding features corresponding to the first hidden state features of multiple time steps;

[0189] The splicing module is used to positionally embed the first hidden state features and corresponding position encoding features of multiple time steps to obtain embedded features corresponding to the first hidden state features of multiple time steps;

[0190] The approximate attention mechanism encoder module is specifically used to obtain an attention score based on the embedded features corresponding to the first hidden state features of multiple time steps, and to approximate the attention score to obtain an approximate processed attention score, to obtain an attention feature based on the approximate processed attention score, and to obtain a second hidden state feature based on the attention feature.

[0191] Optionally, in the GPU load prediction device, the approximate attention mechanism layer further includes a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer;

[0192] The first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer are used to process the attention features in sequence to obtain the second hidden state features.

[0193] Optionally, the GPU load prediction device further comprises:

[0194] A processing module, used for performing missing value processing on the GPU load history data to obtain processed GPU load history data;

[0195] The first acquisition module is used to obtain the GPU load prediction result according to the GPU load history data and the GPU load prediction model, including:

[0196] The second acquisition module is used to obtain a GPU load prediction result according to the processed GPU load history data and the GPU load prediction model.

[0197] The GPU load prediction device provided in the embodiment of the present invention can execute the above-mentioned GPU load prediction method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.

[0198] like Fig.11 As shown, the GPU load prediction device of an embodiment of the present invention includes: a processor 1101; and a memory 1102 connected to the processor 1101 through a bus interface, the memory 1102 is used to store programs and data used by the processor 1101 when performing operations, and the processor 1101 calls and executes the programs and data stored in the memory 1102.

[0199] The processor 1101 is used to read the program in the memory 1102 and execute the following process:

[0200] Used to obtain GPU load prediction results based on GPU load historical data and GPU load prediction model;

[0201] Among them, the GPU load prediction model includes a first model and a second model, the first model is obtained based on a gated recurrent unit model, and is used to obtain the corresponding first hidden state features according to the GPU load history data of each time step; the second model is obtained based on an attention mechanism transformer model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps.

[0202] The transceiver 1103 is used to receive and send data in the controller of the processor 1101.

[0203] Among them, Fig.11 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 1101 and various circuits of memory represented by memory 1102 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 1103 may be a plurality of components, namely, a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. For different user devices, the user interface 1104 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.

[0204] The processor 1101 is responsible for managing the bus architecture and general processing, and the memory 1102 can store data used by the processor 1101 when performing operations.

[0205] Optionally, the resetting gating vector and the updating gating vector in the first model use the same bias parameter.

[0206] Optionally, the first model is specifically used for:

[0207] Obtain candidate hidden state features according to the reset gating vector, the GPU load history data of the current time step, and the first hidden state feature of the previous time step;

[0208] The first hidden state feature of the current time step is obtained according to the updated gating vector, the candidate hidden state feature and the first hidden state vector of the previous time step.

[0209] Optionally, the second model includes an approximate attention mechanism encoder module and a linear module;

[0210] Wherein, the approximate attention mechanism encoder module is used to:

[0211] Approximate the attention scores corresponding to the first hidden state features of multiple time steps to obtain approximate attention scores;

[0212] Attention features are obtained based on the approximately processed attention scores;

[0213] Obtaining a second hidden state feature according to the attention feature;

[0214] The linear module is used to map the second hidden state feature to obtain the GPU load prediction result.

[0215] Optionally, the approximate attention mechanism encoder module comprises an approximate attention mechanism layer, wherein the approximate attention mechanism layer is used to:

[0216] Obtain a first attention score according to the embedded features corresponding to the first hidden state features of multiple time steps;

[0217] Performing a scaled dot product based on the first attention score to obtain a second attention score;

[0218] setting a second attention score that is less than the first score to the second score;

[0219] Obtaining an approximated attention score based on a second attention score that is greater than or equal to the first score and a second attention score that is equal to the second score;

[0220] The attention feature is obtained according to the approximated attention score and the embedded feature.

[0221] Optionally, the second model further includes a position encoding module and a splicing module;

[0222] Wherein, the position encoding module is used to obtain position encoding features corresponding to the first hidden state features of multiple time steps;

[0223] The splicing module is used to positionally embed the first hidden state features and corresponding position encoding features of multiple time steps to obtain embedded features corresponding to the first hidden state features of multiple time steps;

[0224] The approximate attention mechanism encoder module is specifically used to obtain an attention score based on the embedded features corresponding to the first hidden state features of multiple time steps, and to approximate the attention score to obtain an approximate processed attention score, to obtain an attention feature based on the approximate processed attention score, and to obtain a second hidden state feature based on the attention feature.

[0225] Optionally, the approximate attention mechanism layer further includes a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer;

[0226] The first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer are used to process the attention features in sequence to obtain the second hidden state features.

[0227] Optionally, the processor 1101 is further configured to read the computer program and execute the following steps:

[0228] Processing missing values ​​of the GPU load history data to obtain processed GPU load history data;

[0229] Based on the GPU load history data and GPU load prediction model, the GPU load prediction results are obtained, including:

[0230] A GPU load prediction result is obtained according to the processed GPU load history data and the GPU load prediction model.

[0231] A specific embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps in the above-mentioned GPU load prediction method are implemented and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0232] In addition, an embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0233] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0234] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0235] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0236] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for predicting GPU load, characterized in that: include: Obtain GPU load prediction results based on GPU load historical data and GPU load prediction model; The GPU load prediction model includes a first model and a second model, wherein the first model is obtained based on a gated cycle unit model and is used to obtain a corresponding first hidden state feature according to the GPU load history data at each time step; The second model is obtained based on the attention mechanism transformer model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps.

2. The GPU load prediction method according to claim 1, characterized in that: The reset gating vector and the update gating vector in the first model use the same bias parameter.

3. The GPU load prediction method according to claim 1 or 2, characterized in that: The first model is specifically used for: Obtain candidate hidden state features according to the reset gating vector, the GPU load history data of the current time step, and the first hidden state feature of the previous time step; The first hidden state feature of the current time step is obtained according to the updated gating vector, the candidate hidden state feature and the first hidden state vector of the previous time step.

4. The GPU load prediction method according to claim 1, characterized in that: The second model includes an approximate attention mechanism encoder module and a linear module; Wherein, the approximate attention mechanism encoder module is used to: Approximate the attention scores corresponding to the first hidden state features of multiple time steps to obtain approximate attention scores; Attention features are obtained based on the approximately processed attention scores; Obtaining a second hidden state feature according to the attention feature; The linear module is used to map the second hidden state feature to obtain the GPU load prediction result.

5. The GPU load prediction method according to claim 4, characterized in that: The approximate attention mechanism encoder module includes an approximate attention mechanism layer, and the approximate attention mechanism layer is used to: Obtain a first attention score according to the embedded features corresponding to the first hidden state features of multiple time steps; Performing a scaled dot product based on the first attention score to obtain a second attention score; setting a second attention score that is less than the first score to the second score; Obtaining an approximated attention score based on a second attention score that is greater than or equal to the first score and a second attention score that is equal to the second score; The attention feature is obtained according to the approximated attention score and the embedded feature.

6. The GPU load prediction method according to claim 4, characterized in that: The second model also includes a position encoding module and a splicing module; Wherein, the position encoding module is used to obtain position encoding features corresponding to the first hidden state features of multiple time steps; The splicing module is used to positionally embed the first hidden state features and corresponding position encoding features of multiple time steps to obtain embedded features corresponding to the first hidden state features of multiple time steps; The approximate attention mechanism encoder module is specifically used to obtain an attention score based on the embedded features corresponding to the first hidden state features of multiple time steps, and to approximate the attention score to obtain an approximate processed attention score, to obtain an attention feature based on the approximate processed attention score, and to obtain a second hidden state feature based on the attention feature.

7. The GPU load prediction method according to claim 5, characterized in that: The approximate attention mechanism layer also includes a first residual connection and normalization layer, a feedforward network layer, and a second residual connection and normalization layer; The first residual connection and normalization layer, the feedforward network layer, and the second residual connection and normalization layer are used to process the attention features in sequence to obtain the second hidden state features.

8. The GPU load prediction method according to claim 1, characterized in that: The method further comprises: Processing missing values ​​of the GPU load history data to obtain processed GPU load history data; Based on the GPU load history data and GPU load prediction model, the GPU load prediction results are obtained, including: A GPU load prediction result is obtained according to the processed GPU load history data and the GPU load prediction model.

9. A GPU load prediction device, characterized in that: include: A prediction module is used to obtain a GPU load prediction result based on GPU load historical data and a GPU load prediction model; The GPU load prediction model includes a first model and a second model, wherein the first model is obtained based on a gated cycle unit model and is used to obtain a corresponding first hidden state feature according to the GPU load history data at each time step; The second model is obtained based on the attention mechanism transformer model, and is used to obtain the GPU load prediction result according to the first hidden state features of multiple time steps.

10. A GPU load prediction device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the GPU load prediction method according to any one of claims 1 to 8 is implemented.

11. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is executed by a processor, the GPU load prediction method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the GPU load prediction method according to any one of claims 1 to 8.