Graph convolutional neural network storage and calculation integrated system based on resource copy

By using machine learning prediction models and greedy algorithms to dynamically allocate resource copies in the GCN accelerator, the problem of low resource utilization of the existing GCN accelerator is solved, achieving shorter training time and greater acceleration ratio.

CN118627563AActive Publication Date: 2024-09-10ZHEJIANG UNIV

Patent Information

Application Number
CN202410762044.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-09-10
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

The existing ReRAM-based graph convolutional neural network (GCN) accelerator has low resource utilization, mainly due to the data dependence between stages and the execution time difference caused by different stage calculation modes, resulting in a suboptimal pipeline.

Method used

A machine learning-based time prediction model is used to estimate the execution time of each stage, and the resource allocator dynamically allocates resource copies based on a greedy algorithm and a big top heap strategy to optimize resource utilization.

Benefits of technology

It achieves shorter pipeline training time and greater acceleration ratio, while improving energy saving effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627563A
    Figure CN118627563A
Patent Text Reader

Abstract

The invention discloses a storage and calculation integrated system of a graph convolutional neural network based on a resource copy. Comprising a plurality of ReRAM tiles, a 128kb global buffer area, a weight calculation module consisting of SRAMs, an activation module, a group of adders, a central controller for reducing off-chip memory access delay, a time predictor and a resource allocator. According to the method, a storage and calculation integrated system based on the ReRAM is designed for GCN training, an execution time predictor based on a copy and a resource allocation scheme based on a large top heap are adopted, self-adaptive allocation of resources is achieved, the time of pipeline training is shortened as much as possible, and finally a larger speed-up ratio and a better energy-saving effect are obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer science artificial intelligence systems and relates to a storage and computing integrated system of a graph convolutional neural network based on resource copies. Background Art

[0002] Graph Convolutional Neural Network (GCN) performs well in extracting non-Euclidean graph structure data and is widely used in node classification, link prediction, and recommendation systems. GCNs consist of multiple layers, each of which has a combination phase and an aggregation phase. The combination phase updates vertex features by multiplying the vertex features with the weights of the multilayer perceptron (MLP) neural network. The aggregation phase aggregates the feature information of each vertex and its neighbors by multiplying the adjacency matrix with the relevant vertex features.

[0003] The GCN training process includes forward propagation and backward propagation. The process is divided into four stages: combination (CO), aggregation (AG), loss calculation (LC), and gradient calculation (GC). The forward process contains two stages (i.e., CO and AG), while the backward process contains another two stages (i.e., LC and GC). Figure 1 A two-layer GCN training process is shown, which consists of eight stages: CO1→AG1→CO2→AG2→LC2→GC2→LC1→GC1. There is a unidirectional data flow between each stage, such as vertex features (X0, X1, X2), loss values ​​(δ1, δ2) and gradient update values. Therefore, due to data dependencies, the various stages of GCN must be executed sequentially.

[0004] Resistive random access memory (ReRAM) has the advantages of high density, low power consumption, and support for in-situ matrix-vector multiplication (MVM) operations. Therefore, ReRAM is suitable as an accelerator for GCN training. However, the existing ReRAM-based GCN accelerators have low resource utilization. This is because there are data dependencies between stages, and different stages have different computing modes, resulting in large differences in the execution time of each stage. A direct way to solve this idleness is to trade space for time, that is, to use unoccupied cross-array resources as copies to shorten the execution time of certain stages, thereby shortening the time of the entire pipeline. However, if the differences in execution time of different stages are ignored and resources are allocated to all stages, the pipeline is not optimal. Summary of the invention

[0005] In view of the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a graph convolutional neural network storage and computing integrated system based on resource replicas. The present invention uses a prediction model based on machine learning (ML) to estimate the execution time of each stage in order to predict the resource replica requirements and plan accordingly, and use the knowledge gained from these predictions to better dynamically manage and allocate resources.

[0006] The object of the present invention is to achieve the following technical solution: a graph convolutional neural network storage and computing system based on resource copies, comprising the following components:

[0007] Multiple ReRAM tiles: connected through adders and pipeline buses, supporting data aggregation and transmission between tiles;

[0008] Global buffer: responsible for temporarily storing data read from off-chip storage and on-chip intermediate results;

[0009] Weight calculation module: This unit consists of SRAM and calculates weight gradients during the back-propagation phase of training;

[0010] Activation module: used for activation operation in the GCN training process;

[0011] Adder: used to calculate the sum of the results of the crossbar arrays in different ReRAM tiles;

[0012] Central controller: controls the data flow of GCN training between off-chip memory and the chip, pre-fetches input data to the on-chip global cache to reduce off-chip memory access latency, writes output results back to off-chip memory in batches, and controls sequential memory access;

[0013] Time predictor: predicts the execution time of each stage of each layer in the GCN training process based on relevant information from the model and dataset. The time refers to the predicted execution time of each stage of replica resource allocation.

[0014] Resource allocator: Under the constraint of limited crossbar array hardware resources, crossbar array replicas are allocated to each stage in proportion based on the predicted execution time of intra-layer merging and aggregation.

[0015] Furthermore, the global buffer storage size is 128kb.

[0016] Furthermore, the data flow operation phases of the system are as follows:

[0017] 1. Combination stage CO: First, load the weight matrix from the off-chip memory OM to the global buffer GB, and then load it into the crossbar array; then, load the vertex features of OM into GB, and perform matrix-vector multiplication to transform the vertex features; finally, update the transformed vertex features to GB and OM;

[0018] 2. Aggregation stage AG: Load the latest version of vertex features into GB and then into the crossbar array; next, load the adjacency matrix from OM for the aggregated MVM operation; process the result through the adder and send it to the activation module, transform the intermediate result, and finally move it to OM;

[0019] 3. Loss calculation stage LC: In the back propagation stage of training, the error from the previous layer is read as input to calculate the error of the current layer. The data flow of the LC stage is the same as that of the CO stage;

[0020] 4. Gradient calculation stage GC: Load the error of the previous layer from the OM to the weight calculation module, perform element-wise multiplication and accumulation with the activation from the current layer; then, transmit the updated gradient to the tile to rewrite the weights and vertex features on the cross array.

[0021] Furthermore, the combination stage CO also includes:

[0022] (1) Extract the structure of the graph neural network model and the characteristics of the dataset as the input of the time predictor. The time predictor is divided into three layers. The input layer is 10 neurons, the middle hidden layer is 256 neurons, and the output layer is 1 neuron.

[0023] The data set features include: the number of rows of input features in the combination stage The number of columns of input features in the combination phase The number of rows in the mapping weight matrix during the combination phase The number of columns in the mapping weight matrix during the combination phase Number of rows in the adjacency matrix during the aggregation phase Number of columns in the adjacency matrix during the aggregation phase The number of rows in the mapping vertex matrix during the aggregation phase The number of columns in the mapping vertex matrix during the aggregation phase Current round number e, current layer number k;

[0024] (2) Use the time predictor to predict the execution time of each stage of the model deployed on the storage-computation integrated accelerator based on the crossbar array;

[0025] (3) Use a resource allocator to perform resource allocation based on a greedy algorithm: Use two max-heaps to implement a resource allocation strategy based on a greedy algorithm; one max-heap stores the resource adjustment value, and the other max-heap stores the execution time of all stages obtained in step (2) to quickly identify the stage where resource copies are currently added first to minimize the end-to-end time of the pipeline.

[0026] Further, step 3 includes: for a GCN model with L layers, dividing it into 4L stages, each layer consists of an independent stage: CO, AG, LC and GC, setting the micro-batch size B to 3, and the start time of the i-th stage No earlier than the end time of the i-1th stage In addition, for the cross-array group mapping the same stage, the execution of the j-1th micro-batch is performed before the execution of the jth micro-batch is completed. B represents the number of total micro-batches, and the total execution time of the pipeline is T A It is expressed as:

[0027]

[0028] in, represents the end time of the i-th stage of the j-1-th micro-batch, represents the start execution time of the i-th stage of the j-th micro-batch, Represents the maximum execution time of each stage of the j-th micro-batch.

[0029] The beneficial effects of the present invention are as follows: the present invention designs a ReRAM-based storage and computing integrated system for GCN training, adopts a replica-based execution time predictor and a max-heap-based resource allocation scheme, realizes adaptive allocation of resources to shorten the pipeline training time as much as possible, and ultimately obtains a greater acceleration ratio and better energy-saving effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a data dependency flowchart for the GNN training process;

[0031] Figure 2 A simplified diagram of the pipeline parallelism for GCN training on a ReRAM storage-computing integrated accelerator;

[0032] Figure 3 Schematic diagram of the ReRAM-based GCN accelerator system and data flow. DETAILED DESCRIPTION

[0033] The present invention will be further described below in conjunction with embodiments and drawings.

[0034] The present invention proposes a storage and computing integrated system for graph convolutional neural networks, including:

[0035] Multiple ReRAM tiles: connected through adders and pipeline buses, supporting data aggregation and transmission between tiles;

[0036] Global buffer: responsible for temporarily storing data read from off-chip storage and on-chip intermediate results;

[0037] Weight calculation module: This unit consists of SRAM and calculates weight gradients during the back-propagation phase of training;

[0038] Activation module: used for activation operation in the GCN training process;

[0039] Adder: used to calculate the sum of the results of the crossbar arrays in different ReRAM tiles;

[0040] Central controller: controls the data flow of GCN training between off-chip memory and the chip, pre-fetches input data to the on-chip global cache to reduce off-chip memory access latency, writes output results back to off-chip memory in batches, and controls sequential memory access;

[0041] Time predictor: predicts the execution time of each stage of each layer in the GCN training process based on relevant information from the model and dataset. The time refers to the predicted execution time of each stage of replica resource allocation.

[0042] Resource allocator: Under the constraint of limited crossbar array hardware resources, crossbar array replicas are allocated to each stage in proportion based on the predicted execution time of intra-layer merging and aggregation.

[0043] The global buffer storage size is 128kb.

[0044] like Figure 3 The system and data flow of the ReRAM-based accelerator are demonstrated in the paper. The data flow is divided into four stages: combination stage (CO), aggregation stage (AG), loss calculation stage (LC) and gradient calculation stage (GC). The specific stage process is as follows:

[0045] (1) CO: First, the weight matrix is ​​fetched from the off-chip memory (OM) to the global buffer (GB), and then transferred to the crossbar array (①). Then, the vertex features of the OM are loaded into the GB (②), and the MVM is executed to perform vertex feature transformation calculations (③). Subsequently, the transformed vertex features are updated to the GB and OM (④).

[0046] (2) AG: For the aggregation stage, the latest version of vertex features is loaded into the GB and then into the crossbar array (⑤). Next, the adjacency matrix is ​​loaded from the OM (⑥) for the MVM operation of aggregation (⑦). The result is processed by the adder and sent to the activation module, which transforms the intermediate results and then moves to the OM (⑧).

[0047] (3) LC: In the back-propagation phase of training, the error from the l+1th layer is read as input to calculate the error of the lth layer. The data flow in the LC phase is the same as that in the CO phase.

[0048] (4) GC: To calculate the weight gradient of layer l, the error of layer l+1 is loaded from OM to the weight calculation module, and element-wise multiplication and accumulation are performed with the activation from layer l in a channel-by-channel manner. The updated gradients are then transferred to the tiles and used to rewrite the weights and vertex features on the crossbar array. In the CO and AG phases, this step is considered as part of the data loading process.

[0049] The combined stage CO also comprises:

[0050] 1. Extract the model structure and dataset features as input. The input features are shown in Table 1.

[0051] Table 1

[0052]

[0053]

[0054] 2. Use a pre-trained time predictor to predict the execution time of each stage after the model is deployed on a storage-computing integrated accelerator based on a crossbar array. In order to select a highly accurate and lightweight execution time prediction model as much as possible, first compare the five regression models of the scikit-learn library (decision tree model, gradient boosting decision tree model, support vector machine model, logistic regression model, Bayesian regression model) and multiple groups of multilayer perceptron models, and use the mean square error to measure each model. Because the mean square error of the multilayer perceptron model is smaller than that of the other five regression models, the multilayer perceptron model series is selected. Then, the number of layers of the multilayer perceptron is changed (2, 3, 4, 5, 6), and it is found that the mean square error of the three-layer model is smaller than that of the models with other layers, so the number of layers of the multilayer perceptron is fixed to 3. Finally, the number of neurons in the hidden layer is changed (64, 128, 256, 512, 1024), and it is found that when the hidden layer has 256 neurons, the mean square error of the model is the smallest.

[0055] Therefore, a three-layer time predictor is chosen, with 10 neurons in the input layer, 256 neurons in the middle hidden layer, and 1 neuron in the output layer.

[0056] 3. Use the greedy algorithm for dynamic resource allocation: After obtaining the execution time prediction value of each stage through the machine learning-based time predictor, two large top heaps H are established. V and H P , respectively storing resource adjustment values ​​and execution duration of all phases, where each object is a key-value pair. V and H PThe keys represent the number of replicas and the adjusted value of execution time for each stage. The values ​​in the two heaps represent the index of the respective stage.

[0057] When unused crossbar array resources are available, increase H P The replica count of the top node stage in H is calculated. Then, check whether the stage with the highest adjustment value also has the longest execution time. If so, update the adjustment value and execution time of this stage, and then adjust the two max heaps from top to bottom. Otherwise, recalculate H V The adjusted value of the top node. Then, in H P Find the corresponding node in and reduce its execution time.

[0058] Next, the two heaps are adjusted from top to bottom; subsequently, the unused crossbar array resources are reduced; finally, the replica allocation process is iterated until the available unused crossbar array resources are exhausted.

[0059] like Figure 2 The pipeline designed for a ReRAM-based accelerator in the context of a 2-layer GCN model is illustrated. For a GCN model with L layers, it is divided into 4L stages, and each layer consists of an independent stage: CO, AG, LC, and GC. For illustration, the micro-batch size B is set to 3. Different block colors represent three consecutive micro-batches of input data. Due to the data dependencies of the execution, the start time of the i-th stage is No earlier than the end time of the i-1th stage In addition, for the cross-array group mapping the same stage, the execution of the j-1th micro-batch must be performed before the execution of the jth micro-batch is completed. B represents the number of total micro-batches, and the total execution time of the pipeline is T A It is expressed as:

[0060]

[0061] in, represents the end time of the i-th stage of the j-1-th micro-batch, represents the time of the i-th stage of the j-th micro-batch, Represents the maximum execution time of each stage of the j-th micro-batch.

[0062] Compared with the latest work Reflip, the present invention achieves a maximum speedup of 24.987 times on four Ogb data sets with the same cross-array resources. The specific data are shown in Table 2.

[0063] Table 2

[0064] Dataset Original plan Reflip The present invention multiple Ogb-ddi 1 18.046 80 4.43 Ogb-ppa 1 2.333 10.18 4.363 Ogb-proteins 1 2.867 71.64 24.987 Ogb-arxiv 1 18.814 64.78 3.443

Claims

1. A graph convolutional neural network storage and computing system based on resource replicas, It is characterized in that include: Multiple ReRAM tiles: connected through adders and pipeline buses, supporting data aggregation and transmission between tiles; Global buffer: responsible for temporarily storing data read from off-chip storage and on-chip intermediate results; Weight calculation module: This unit consists of SRAM and calculates weight gradients during the back-propagation phase of training; Activation module: used for activation operation in the GCN training process; Adder: used to calculate the sum of the results of the crossbar arrays in different ReRAM tiles; Central controller: controls the data flow of GCN training between off-chip memory and the chip, pre-fetches input data to the on-chip global cache to reduce off-chip memory access latency, writes output results back to off-chip memory in batches, and controls sequential memory access; Time predictor: predicts the execution time of each stage of each layer in the GCN training process based on relevant information from the model and dataset. The time refers to the predicted execution time of each stage of replica resource allocation. Resource allocator: Under the constraint of limited crossbar array hardware resources, crossbar array replicas are allocated to each stage in proportion based on the predicted execution time of intra-layer merging and aggregation.

2. According to the resource replica-based graph convolutional neural network storage and computing integrated system of claim 1, It is characterized in that The global buffer storage size is 128kb.

3. According to the resource copy-based graph convolutional neural network storage and computing integrated system of claim 1, It is characterized in that The data flow operation phases of the system are as follows: (1) Combination stage CO: First, load the weight matrix from the off-chip memory OM to the global buffer GB, and then load it into the crossbar array; then, load the vertex features of OM into GB, and perform matrix-vector multiplication to perform vertex feature transformation operations; Finally, the transformed vertex features are updated to GB and OM; (2) Aggregation stage AG: Load the latest version of vertex features into GB and then into the crossbar array; Next, the adjacency matrix is ​​loaded from the OM for the aggregated MVM operation; the result is processed by the adder and sent to the activation module, which transforms the intermediate result and finally moves to the OM; (3) Loss calculation stage LC: In the back propagation stage of training, the error from the previous layer is read as input to calculate the error of the current layer. The data flow of the LC stage is the same as that of the CO stage; (4) Gradient calculation stage GC: Load the error of the previous layer from the OM to the weight calculation module, and perform element-wise multiplication and accumulation with the activation from the current layer; The updated gradients are then transferred to the tiles and used to rewrite the weights and vertex features on the crossbar array.

4. According to claim 3, the graph convolutional neural network storage and computing integrated system based on resource replicas, It is characterized in that The combined stage CO also comprises: (1) Extract the structure of the graph neural network model and the characteristics of the dataset as the input of the time predictor. The time predictor is divided into three layers. The input layer is 10 neurons, the middle hidden layer is 256 neurons, and the output layer is 1 neuron. The data set features include: the number of rows of input features in the combination stage The number of columns of input features in the combination stage The number of rows in the mapping weight matrix during the combination phase The number of columns in the mapping weight matrix during the combination phase The number of rows in the adjacency matrix during the aggregation phase The number of columns in the adjacency matrix during the aggregation phase The number of rows in the mapping vertex matrix during the aggregation phase The number of columns in the mapping vertex matrix during the aggregation phase Current round number e, current layer number k; (2) Use the time predictor to predict the execution time of each stage of the model deployed on the storage-computation integrated accelerator based on the crossbar array; (3) Use a resource allocator to perform resource allocation based on a greedy algorithm: Use two max-heaps to implement a resource allocation strategy based on a greedy algorithm; one max-heap stores the resource adjustment value, and the other max-heap stores the execution time of all stages obtained in step (2) to quickly identify the stage where resource copies are currently added first to minimize the end-to-end time of the pipeline.

5. According to claim 4, the graph convolutional neural network storage and computing integrated system based on resource replicas, It is characterized in that The step (3) further includes: for a GCN model with L layers, dividing it into 4L stages, each layer consisting of an independent stage: CO, AG, LC and GC, setting the micro-batch size B to 3, and the start time of the i-th stage No earlier than the end time of the i-1th stage In addition, for the cross-array group mapping the same stage, the execution of the j-1th micro-batch is performed before the execution of the jth micro-batch is completed. B represents the number of total micro-batches, and the total execution time of the pipeline is T A It is expressed as: in, represents the end time of the i-th stage of the j-1-th micro-batch, represents the start execution time of the i-th stage of the j-th micro-batch, Represents the maximum execution time of each stage of the j-th micro-batch.

Citation Information

Patent Citations

  • A load balancing method based on DPI prediction

    CN109729017A

  • Resource scheduling method and device, storage medium and electronic equipment

    CN114997687A

  • Graph convolutional networks with motif-based attention

    US20200285944A1

Cited By

  • GCN-ReRAM vertex feature selective updating method based on staggered mapping

    CN119397229A