A hotspot prediction method for on-chip optical networks based on LSTM neural network
Through the multi-input and multi-output model based on LSTM neural network, the hot spots of on-chip optical network are predicted, and the hot spot prediction problems and security problems in the existing technology are solved, achieving more efficient traffic prediction and security guarantee.
Patent Information
- Application Number
- CN202210237289.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2042-03-11
AI Technical Summary
The prior art is difficult to effectively predict the hot spots of on-chip optical networks, resulting in increased node temperature rise and power consumption, and there is a risk of hardware Trojan attacks. A simple hot spot prediction method is needed to optimize task mapping and ensure security.
Using a multi-input and multi-output model based on LSTM neural network, the prediction is made by obtaining node traffic data, and using multi-layer LSTM neural network elements and activation functions, combining data cleaning, normalization and Dropout layers, the model training is optimized to reduce prediction time and Improve accuracy.
Achieve more efficient hot spot prediction, reduce the mean square error of traditional methods by 8.57% and 15.7%, improve the fit by 3.35% and 1.73%, and does not rely on temperature and task mapping algorithms, and is suitable for on-chip with different core numbers. Optical network.
Smart Images

Figure CN114662658B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to communication technology, and in particular to an on-chip optical network hotspot prediction method based on LSTM. Background Art
[0002] At present, high-performance computing has a large demand and application in numerical simulation, life sciences and large-scale engineering computing, and multi-core systems on chip play a key role in this. Optical Network on Chip (ONoC) is an "on-chip communication" solution to solve the problem of data transmission between different cores in multi-core systems on chip. Its emergence makes up for the shortcomings of the previous bus-connected system on chip (System on Chip, SoC) being difficult to expand and the network on chip (Network on Chip, NoC) being poor in reliability and high energy consumption. The ability of multi-core chips to process data has also been continuously improved after the introduction of the optical network on chip. At the same time, in order to improve network performance, researchers usually divide the upper-layer application into multiple tasks and map them to several adjacent intellectual property (Intellectual Property, IP) cores in the optical network on chip to reduce communication delay. From the perspective of the entire optical network on chip, the uneven distribution of node tasks will inevitably form local hotspots in the entire optical network on chip. For chips, the existence of hotspots will increase the node temperature and power consumption, thereby greatly shortening the chip life. To solve this problem, researchers usually take the approach of estimating hotspots to balance the communication traffic of each node. In addition, in order to shorten time and save costs, the chip will contact third-party personnel many times during the design and manufacturing process, but these third-party personnel are not completely trustworthy because they may implant hardware Trojans (HT) during the design and manufacturing process to attack the entire system. At the same time, in order to maximize the attack effect at the lowest cost, hardware Trojans are usually activated in hot spots. Therefore, for on-chip optical networks, there is an urgent need for a simple method to determine hot spots in advance to optimize the mapping algorithm and map tasks to IP cores with less communication volume in advance to achieve thermal balance, while ensuring the security of on-chip optical networks. Summary of the invention
[0003] The present invention aims to solve the above problems of the prior art. A method for predicting hotspots of an on-chip optical network based on an LSTM neural network is proposed. The technical solution of the present invention is as follows:
[0004] A method for predicting hot spots of an on-chip optical network based on an LSTM neural network comprises the following steps:
[0005] 1) Obtain the traffic value of each node in the on-chip optical network through public channels and use it as the input value of the LSTM neural network;
[0006] 2) The traffic volume is input as input data to the constructed multi-input multi-output LSTM neural network model for prediction; compared with the existing LSTM neural network, the multi-input multi-output LSTM neural network can input multiple variables at one time, and then output the predicted values of multiple variables at the same time after processing, which greatly shortens the prediction time.
[0007] 3) After obtaining the predicted traffic, divide the traffic value corresponding to the node into n intervals, calculate the proportion of nodes in each traffic interval, and take the nodes in the interval with larger traffic value as the hotspot at the next moment.
[0008] Furthermore, the multi-input and output LSTM neural network model of step 2) includes: an input layer, a hidden layer, a training module and an output layer, wherein the input layer is used to process the data input into the LSTM network to meet the network requirements; the hidden layer has multiple layers, each layer contains multiple LSTM neural network elements, and the LSTM neural network elements are used for data training; the training module adjusts the weights and biases in the training process according to the relationship between input and output to optimize the network training; the output layer is used to output the training results of the hidden layer.
[0009] Furthermore, the input layer includes steps including data cleaning, data normalization, and data partitioning. Data cleaning is used to remove NAN values and values that do not meet the requirements in the traffic data; data normalization uses the Min-Max method to linearize the original data set to eliminate the impact of singular sample data on training; after normalization, the data set is divided into training set and test set according to a certain ratio, and the training set and test set are used for model training and testing.
[0010] Furthermore, the hidden layer includes two LSTM recurrent layers, each layer includes 32 LSTM neurons, and each LSTM neuron includes a forget gate, an input gate and an output gate; wherein the forget gate is determined by the input data and the output of the previous cell unit, and is used to determine whether to discard useless data from the input; the input gate is determined by the sigmoid function and the tanh function to retain useful data from the input and update the cell state; the output gate is also determined by the sigmoid function and the tanh function, and is used for the output of the cell unit.
[0011] Furthermore, in order to avoid the existence of linear features between the output and input of each cell unit, an activation function is added to the hidden layer to increase the learning ability of the neural network. The activation function adopts the linear rectified linear unit (RELU) activation function, and its mathematical expression is:
[0012] Furthermore, the training module mainly includes calculating the loss error between the theoretical output and the model output, and then using the optimization algorithm to feed back to the hidden layer according to the loss value for continuously adjusting the parameters and updating the weights to accelerate the convergence speed of the network. The mathematical expression is: where y i is the true value of the traffic of each node at the i-th moment, is the traffic prediction value of the network input at the i-th moment;
[0013] The loss error is calculated using mean square error (MSE), and the optimization algorithm uses the Adma optimization algorithm.
[0014] Furthermore, a Dropout layer is added after the hidden layer to prevent overfitting in training.
[0015] The output layer is used to output prediction data and perform inverse normalization.
[0016] Furthermore, the hidden layer outputs x n ,y n The output represents the predicted data obtained during network training. This value is actually real data and is used for network learning. It is related to the hyperparameter time step in the training process. After the network training is completed, the LSTM model has understood the basic development trend of the data set. At this time, the test data can be input into the network to obtain the predicted data. Since the data input into the network has been normalized, the predicted value is also normalized data between [0,1]. In order to obtain the real predicted value, it needs to be denormalized. The denormalization formula is:
[0017] Furthermore, multiple model evaluation indicators are used to evaluate the quality of the prediction results, including root mean square error RMSE, mean absolute error MAE and determination coefficient R2.
[0018] The advantages and beneficial effects of the present invention are as follows:
[0019] 1. The present invention improves on the traditional single-input single-output LSTM model and proposes a multi-input multi-output LSTM neural network model. The model stacks multiple layers of LSTM neural networks, and each layer of the neural network contains multiple LSTM neural network units to be able to calculate and output multiple samples at the same time. Therefore, this model is not limited to the on-chip optical network hotspot prediction scenario, and other scenarios with multiple sample prediction requirements can be predicted using the steps described in the claims.
[0020] 2. Different from the existing hotspot prediction methods, this invention provides a more concise prediction method based on LSTM neural network. Compared with the traditional method, this method does not rely on the temperature in the on-chip optical network, the utilization rate of each node, the task mapping algorithm and other difficult-to-determine change data during the calculation process, but only requires the historical flow change value of each node. Compared with the current representative neural network models, recurrent neural network RNN and gated recurrent unit GRU, the experimental mean square error is reduced by 8.57% and 15.7% respectively, and the fit is improved by 3.35% and 1.73% respectively;
[0021] 3. In terms of applicability, the on-chip optical network hotspot prediction method based on LSTM neural network provided by the present invention is not only applicable to an on-chip optical network with a single number of cores, but also shows good prediction effects on on-chip optical networks with different numbers of cores. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is the LSTM network model structure of the preferred embodiment provided by the present invention.
[0023] Figure 2 Comparison of input dimensions for different variables of LSTM neural network.
[0024] Figure 3 This is the basic unit structure diagram of LSTM.
[0025] Figure 4 This is a comparison chart of the loss values of Example 1 of the present invention and different prediction models.
[0026] Figure 5 This is a comparison chart of the loss values of Example 2 of the present invention and different prediction models.
[0027] Figure 6 This is a comparison chart of the loss values of Example 3 of the present invention and different prediction models.
[0028] Figure 7 The predicted flow distribution diagram of Example 1 of the present invention.
[0029] Figure 8 The predicted flow distribution diagram of Example 2 of the present invention.
[0030] Fig. 9 The predicted flow distribution diagram of Example 3 of the present invention. DETAILED DESCRIPTION
[0031] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
[0032] The technical solution of the present invention to solve the above technical problems is:
[0033] A multi-input and output LSTM neural network model. Figure 1 As shown in the figure, it includes: input layer, hidden layer, training module and output layer. Among them, the input layer is used to process the data input into the LSTM network to meet the network requirements; the hidden layer has multiple layers, each layer contains multiple LSTM neural network elements for data training; the training module adjusts the weights and biases in the training process according to the relationship between input and output to optimize network training. The output layer is used to output the training results of the hidden layer. The following will give a detailed description of each part:
[0034] The input layer includes data cleaning, data normalization, and data cleaning. After obtaining the corresponding data set from public channels, the original traffic data sequence is: T = {Φ 1 ,Φ 2 ,Φ 3 ,Φ 4 ,…,Φ n}, where Φ 1 ={x 1 ,x 2 ,x 3 ,x 4 ,…, x m}, Φ 2 ={y 1 ,y 2 ,y 3 ,y 4 ,…,y m}…, so the input tensor of the LSTM neural network is (m, s, n), where m represents the number of observations, s represents the number of inputs to the network in each training, and n represents the number of variables. Figure 2 This is a comparison chart between traditional single variable input and multivariate input constructed in this article (the split window length is 5). From the input point of view, multivariate is actually a combination of multiple single variables. Therefore, after the following steps during training, the values of n variables can be directly input into the LSTM model for prediction.
[0035] Step 1): Data cleaning. Data cleaning is used to remove NAN values and values that do not meet the requirements in the traffic data, such as negative numbers, text, and other abnormal traffic numerical data.
[0036] Step 2): Data normalization. Data normalization uses the Min-Max method to map the original data set to [0, 1] to eliminate the impact of singular sample data on training. The specific normalization formula is: Where x is the real value, min and max represent the minimum and maximum values of each column in the current data set.
[0037] Step 3): Data division: After normalization, the data set is divided into training set and test set according to a certain ratio. The training set is used for model training; the test set does not participate in model training, but is only used to divide a part of the data from the original data set to demonstrate the accuracy of the model. The specific division ratio is 7:3.
[0038] The hidden layer contains two LSTM recurrent layers, each containing 32 LSTM neurons. The internal structure of each LSTM neuron is as follows: Figure 2 As shown, it contains a forget gate, an input gate and an output gate. The forget gate is determined by the input data and the output of the previous cell unit, and is used to determine whether to discard useless data from the input; the input gate is determined by the sigmoid function and the tanh function to retain useful data from the input and update the cell state; the output gate is also determined by the sigmoid function and the tanh function, and is used for the output of the cell unit. Among them, the output C of each unit n-1 and H n-1 Respectively represent the state and output of the previous LSTM unit, which are used to update the cell parameters.
[0039] In order to avoid the linear characteristics between the output and input of each cell unit, which causes the network to be unable to learn the changing trend of the data set, an activation function is added to the hidden layer to increase the learning ability of the neural network. The activation function uses the RELU activation function, and its mathematical expression is:
[0040] The training module mainly includes calculating the loss error Loss between the theoretical output and the model output, and then using the optimization algorithm to feed back to the hidden layer based on the loss function value to continuously adjust the parameters and update the weights to speed up the convergence of the network. The loss error is calculated using the mean square error MSE, and its mathematical expression is: where y i is the true value of the traffic of each node at the i-th moment, is the traffic prediction value of the network input at the i-th moment. The loss function is divided into the loss function of the training set and the test set. Generally speaking, the lower the loss value, the better the model prediction effect. At the same time, since the training set is mainly used to train the network model, the network will continuously adjust other parameters according to this value during training, so the loss function value of the training set will be lower than the loss function value of the test set. The optimization algorithm adopts the Adma optimization algorithm.
[0041] A Dropout layer is added after the hidden layer to prevent overfitting in training. The Dropout parameter is 0.5.
[0042] The output layer includes the functions of outputting predicted data and denormalization. Figure 1 As shown, the hidden layer outputs x n , yn The outputs represent the predicted data obtained during the network training. This value is actually the real data used for network learning and is related to the hyperparameter time step during the training process. After the network training is completed, the LSTM model has understood the basic development trend of the data set. At this time, the test data can be input into the network to obtain the predicted data. Since the data input into the network has been normalized, the predicted value is also normalized data between [0,1]. In order to obtain the real predicted value, it needs to be denormalized. The denormalization formula is:
[0043] The present invention uses multiple model evaluation indicators to evaluate the quality of the prediction results, including root mean square error (RMSE), mean absolute error (MAE) and determination coefficient R2. The calculation formulas of the three are:
[0044]
[0045]
[0046]
[0047] Where n represents the number of training data, y i For real data, To predict data, is the average value of the corresponding column. The smaller the RMSE and MAE values are, the higher the model accuracy is; and the closer the R2 value is to 1, the better the fit between the training input and output is.
[0048] At the same time, in order to compare the superiority of the model, the present invention also selects two typical neural network prediction models, recurrent neural network RNN and gated recurrent unit GRU for comparison. The following will select different embodiments to illustrate the applicability and superiority of the present invention.
[0049] Embodiment 1:
[0050] In this embodiment, an 8×8 Mesh on-chip optical network topology is selected, and the model is built based on the advanced API in Python, Keras. The Loss, MAE, and RMSE of the three models under different training rounds are as follows: Figure 3 , 4 and 5, while the training set R2 comparison of the three models under different training rounds is shown in Table 1.
[0051] Embodiment 2:
[0052] In this embodiment, a 4×4 Mesh on-chip optical network topology is selected, and the model is built based on Keras, a high-level API in Python. The Losses of the three models under different training rounds are as follows: Figure 3 The R2 comparison of the three models under different training rounds is shown in Table 2.
[0053] Embodiment 3:
[0054] In this embodiment, a 6×6 Mesh on-chip optical network topology is selected, and the model is built based on the advanced API in Python, Keras. The Losses of the three models under different training rounds are as follows: Figure 3 The R2 comparison of the three models under different training rounds is shown in Table 3.
[0055] It can be seen that the embodiments of the present invention show good performance in on-chip optical networks with different core numbers.
[0056] Through the above prediction process, the traffic prediction distribution diagrams of different core numbers of the on-chip optical network in different embodiments at future times can be obtained, as shown in FIG. Figure 7 , 8 As shown in Figure 9. For determining the hotspot, the traffic value corresponding to the node is divided into n intervals, the proportion of nodes in each traffic interval is calculated, and 10% of the nodes in the interval with a larger traffic value are taken as hotspots. Figure 7 As shown in the figure, the traffic values of most nodes are distributed between [8, 290]. The number of nodes in this interval accounts for about 90% of all nodes, while the number of nodes in [290, 478] accounts for about 10%. Therefore, the nodes between [290, 478] are regarded as hotspots when determining hotspots.
[0057] Table 1 Comparison of R2 between Example 1 of the present invention and different prediction models at different rounds
[0058]
[0059] Table 2 Comparison of R2 between Example 2 of the present invention and different prediction models at different rounds
[0060]
[0061] Table 3 Comparison of R2 between Example 3 of the present invention and different prediction models at different rounds
[0062]
[0063] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0064] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0065] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. A method for predicting hot spots in an on-chip optical network based on an LSTM neural network, characterized in that: The following steps are involved: 1) Obtain the traffic value of each node in the on-chip optical network through public channels and use it as the input sample of the LSTM neural network; 2) The input samples are divided and input into the constructed multi-input multi-output LSTM neural network model for prediction; the multi-input multi-output LSTM neural network can input multiple variables at one time, and then output the predicted values of multiple variables at the same time after processing; 3) After obtaining the predicted traffic, divide the traffic value corresponding to the node into n intervals, calculate the proportion of nodes in each traffic interval, and take the nodes in the interval with larger traffic value as the hotspot at the next moment; The hidden layer contains two LSTM recurrent layers, each layer contains 32 LSTM neurons, and each LSTM neuron contains a forget gate, an input gate, and an output gate. The forget gate is determined by the input data and the output of the previous cell unit, and is used to determine whether to discard useless data from the input. The input gate is determined by the sigmoid function and the tanh function to retain useful data from the input and update the cell state. The output gate is also determined by the sigmoid function and the tanh function and is used for the output of the cell unit. In order to avoid the linear characteristics between the output and input of each cell unit, an activation function is added in the hidden layer to increase the learning ability of the neural network. The activation function adopts the linear rectification RELU activation function, and its mathematical expression is: The training module includes calculating the loss error between the theoretical output and the model output, and then using the optimization algorithm to feed back the loss value to the hidden layer to continuously adjust the parameters and update the weights to speed up the convergence of the network. The mathematical expression is: where y i is the true value of the traffic of each node at the i-th moment, is the traffic prediction value of the network input at the i-th moment; The loss error is calculated using mean square error (MSE), and the optimization algorithm uses the Adma optimization algorithm.
2. According to claim 1, a method for predicting hot spots of an on-chip optical network based on an LSTM neural network is characterized in that: The multi-input and output LSTM neural network model of 2) includes: an input layer, a hidden layer, a training module and an output layer, wherein the input layer is used to process the data input into the LSTM network to meet the network requirements; the hidden layer has multiple layers, each layer contains multiple LSTM neural network elements, and the LSTM neural network elements are used for data training; the training module adjusts the weights and biases in the training process according to the relationship between input and output to optimize the network training; the output layer is used to output the training results of the hidden layer.
3. According to claim 1, a method for predicting hot spots of an on-chip optical network based on an LSTM neural network is characterized in that: The input layer includes steps such as data cleaning, data normalization, and data partitioning. Data cleaning is used to remove NAN values and values that do not meet the requirements in the traffic data. Data normalization uses the Min-Max method to linearize the original data set to eliminate the impact of singular sample data on training. After normalization, the data set is divided into training set and test set according to a certain ratio. The training set and test set are used for model training and testing.
4. According to claim 1, a method for predicting hot spots of an on-chip optical network based on an LSTM neural network is characterized in that: Add a Dropout layer after the hidden layer to prevent overfitting in training; The output layer is used to output predicted data and denormalize.
5. The on-chip optical network hotspot prediction method based on LSTM neural network according to claim 4 is characterized in that: The hidden layer outputs x n ,y n The output represents the predicted data obtained during the network training. This value is actually the real data used for network learning and is related to the hyperparameter time step during the training process. After the network training is completed, the LSTM model has understood the basic development trend of the data set. At this time, the test data is input into the network to obtain the predicted data. Since the data input into the network has been normalized, the predicted value is also normalized data between [0,1]. In order to obtain the true predicted value, it needs to be denormalized. The denormalization formula is:
6. A method for predicting hotspots of an on-chip optical network based on an LSTM neural network according to any one of claims 1 to 5, characterized in that: Multiple model evaluation indicators are also used to evaluate the quality of the prediction results, including root mean square error RMSE, mean absolute error MAE and determination coefficient R2.
