Coding distributed computing-based convolutional neural network convolutional layer acceleration method
By introducing a coding distributed computing method into the CNN convolutional layer, the problem of excessive computational load and nodes falling behind on edge devices is solved, and the calculation efficiency is significantly improved and resource cost optimization is achieved.
Patent Information
- Application Number
- CN202411553774.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-03
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-03
AI Technical Summary
On resource-confined edge devices, the deployment of convolutional neural network (CNN) convolutional layer faces problems of overload computing load and nodes falling behind, resulting in inference delay and computational instability.
Using a method based on coding distributed computing, the tensor convolution operations are distributed in parallel to multiple slave nodes by introducing a redundant coding mechanism in the convolution layer, and the tensor slicing strategy is dynamically adjusted to optimize communication and storage costs.
It effectively overcomes the problem of nodes falling behind, improves system reliability and computing efficiency, significantly accelerates convolutional layer computing, and reduces resource utilization and cost.
Smart Images

Figure CN119514606A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distributed computing and convolutional neural network, and in particular to a convolutional layer acceleration method of a convolutional neural network based on coded distributed computing. Background Art
[0002] With the rapid development of emerging application scenarios such as the Internet of Things (IoT), convolutional neural networks (CNNs) have been widely used in the field of image processing due to their excellent feature extraction and classification performance. However, the deployment of CNN models, especially its core computing module, the convolution layer, on resource-constrained edge devices still faces major challenges. Studies have shown that in the mainstream CNN architecture, convolution operations account for more than 90% of the multiplication and accumulation operations and consume more than 80% of the inference time. In order to solve the problem of excessive computing load on a single node, distributed computing solutions are widely adopted. However, in practical applications, due to device heterogeneity and network environment fluctuations, nodes are prone to "falling behind", resulting in a significant increase in system inference delay. Especially in the IoT environment, the data transmission packet loss rate may exceed 70%, which seriously affects the stability of CNN operations.
[0003] In recent years, Coded Distributed Computing (CDC) technology has made important progress in the field of distributed computing. This technology effectively alleviates the problem of node lagging by introducing a redundant coding mechanism in computing tasks. In the master-slave architecture, the master node can use the calculation results of some slave nodes to restore the output of the lagging node, ensuring the integrity of the computing task. CDC technology has shown significant advantages in the field of matrix operations: it not only ensures numerical stability, but also maintains computational sparsity, while reducing computational complexity and communication storage overhead. This makes CDC technology show good application prospects in complex application scenarios such as edge computing and multi-drone clusters.
[0004] However, there are still the following technical difficulties in directly applying CDC technology to accelerate CNN convolutional layers: First, the convolution operation involves complex high-dimensional interactions between three-dimensional input tensors and four-dimensional core tensors, and its tensor decomposition and task allocation need to be precisely controlled to ensure spatial continuity during parallel computing; second, the existing CDC scheme is mainly designed for two-dimensional matrix multiplication, lacking in-depth consideration and integration of CNN high-dimensional tensor operation characteristics. In addition, in most distributed systems, the data communication cost is often significantly higher than the storage cost, which requires that when parallelizing the convolution layer operation, the tensor splitting strategy should be dynamically adjusted according to the parameter scale and system characteristics of different convolution layers to optimize the communication and storage costs between nodes.
[0005] Therefore, it is urgent to develop a coding distributed computing solution suitable for the convolutional layer to solve the delay problem caused by node lag, ensure the stable acceleration of convolutional layer calculations, and optimize system resource utilization and cost. This has important practical significance for deploying CNN in resource-constrained environments, especially in typical application scenarios such as the Internet of Things and edge computing. Summary of the invention
[0006] The present invention proposes a convolutional layer acceleration method for a convolutional neural network based on coded distributed computing, which significantly improves computing efficiency by distributing tensor convolution operations in parallel to multiple slave nodes for execution. This method innovatively embeds coded redundant information in distributed convolution computing, effectively overcoming the adverse effects of node lag and enhancing system reliability. At the same time, it can dynamically adjust the segmentation parameters according to the scale of convolutional layer tensor computing and the unit cost of system communication and storage, and optimize the resource utilization and total cost of each node. This method not only accelerates the convolutional layer calculation, but also improves the stability and overall efficiency of the distributed system, providing a new solution for the deployment of large-scale convolutional neural networks.
[0007] The present invention proposes a convolutional layer acceleration method for a convolutional neural network based on coded distributed computing, comprising the following steps:
[0008] Step 1: The master node determines the number of slave nodes n, the node number recovery threshold k, and the number of redundant nodes nk for calculation; then, configures the parameters of the convolution layer to be accelerated, sets the convolution length s, and uses the original convolution layer parameters to define the three-dimensional input tensor Where C is the number of input channels, H is the height of the input tensor, W is the width of the input tensor, and the four-dimensional convolution kernel tensor is defined Where N is the number of output channels, C is the number of input channels, K H is the core height, K W is the core width, and assigns numbers i∈{1, 2, 3, ..., n} to n slave nodes;
[0009] Step 2: Master node data preparation phase, including the following sub-steps:
[0010] Step 2-1: The master node determines the optimal splitting scheme for each working node of the current convolution layer based on the communication and storage cost requirements of the distributed system and the scale of the input tensor and core tensor of the convolution layer, and obtains the number of splits k of the input tensor X and the core tensor K. A and k B ;
[0011] Step 2-2: The master node divides the tensor X into k consecutive parts along the high or wide dimension according to the optimal segmentation scheme. A subtensors X that overlap each other′ i, and divide the tensor K into k equal parts according to the output channel dimension B Subtensor K′ i ;
[0012] Step 2-3: The master node uses the linear encoding matrix G A and G B , for k A input sub-tensors and k B The kernel tensors are linearly combined n times to obtain n encoding input tensors. and n encoded kernel tensors At the same time, the generated encoding sub-tensor is distributed to the corresponding n nodes, and each slave node will receive one encoding input sub-tensor and one encoding core sub-tensor;
[0013] Step 3: The slave node numbered i gets the assigned encoded input sub-tensor and the encoded nuclear tensor After that, the convolution operation is completed And the calculation results are immediately returned to the master node;
[0014] Step 4: The master node performs data recovery and splicing, which includes the following sub-steps:
[0015] Step 4-1: The master node receives and stores the first k convolution results returned. The node numbers corresponding to these results constitute a set Then, the master node Combined with the encoding matrix G A and G B , construct the decoding matrix G C ;
[0016] Step 4-2: The master node decodes the matrix G C , k linear combinations are performed on the k received encoded tensor results to obtain k decoded output sub-tensors Y1, Y2, ..., Y k ;
[0017] Step 4-3: The master node concatenates the k recovered output sub-tensors along the H or W dimension and the N dimension to obtain the complete convolution result tensor Y, which is used for subsequent neural network calculations.
[0018] Furthermore, in step 2-1, the number of segments k of X and K optimized by the current convolutional layer is A and k B Determined using the following optimization method:
[0019] The communication and storage costs of the slave nodes in this distributed system are λ in units of tensor elements. comm and λ store;
[0020] First, considering that H>>s, k H ,so Then the communication cost of each slave node is C comm , including receiving the encoded input sub-tensor cost C comm_up and the outgoing encoded output subtensor cost C comm_down , expressed as:
[0021]
[0022] Where V comm_up and V comm_dwon Respectively represent the total number of elements received and the total number of elements transmitted by each slave node;
[0023] Secondly, the storage cost of each slave node is C store (the cost of storing the core tensor), which can be expressed as:
[0024]
[0025] Where V store Indicates the total number of elements of the encoded kernel tensor stored in each slave node;
[0026] k A and k B The optimal value of To minimize the sum of the total communication and storage costs of each slave node and satisfy k A ×k B = integer solutions of k.
[0027] Furthermore, the optimal value The statement is as follows:
[0028]
[0029] Furthermore, in step 2-2, before segmentation, it is necessary to determine whether the dimension is divisible by the corresponding segmentation number. If it is not divisible, the dimension needs to be filled to a suitable value with all-0 elements while keeping the remaining dimensions unchanged.
[0030] Furthermore, in step 2-2, the splitting of the input tensor X needs to be based on the height or width dimension of the output tensor and the splitting number k A To determine the segmentation range and size of each input sub-tensor, the specific steps are as follows:
[0031] Step A1: First output the high Width Assume k A The splitting is all done on high dimensions, so the high dimension of each input sub-tensor is At the same time, the step size of the starting point number of each segmentation is adjusted to
[0032] Step A2: The process of splitting each sub-tensor is expressed as:
[0033]
[0034] Among them: indicates that the input channel dimension and width dimension are retained, and They represent the starting and ending element numbers of the high-dimensional split, respectively. The dimensions of the input sub-tensor after splitting are
[0035] Furthermore, in step 2-2, the process of splitting the core tensor is expressed as:
[0036]
[0037] The “:” indicates that the high and wide dimensions of the kernel tensor are preserved. and They represent the starting and ending element numbers of the split elements in the output channel dimension respectively. The dimension of the kernel tensor after splitting is
[0038] Furthermore, in step 2-3, the encoded kernel tensor corresponding to each convolutional layer is stored on each slave node during the first inference and does not need to be uploaded subsequently.
[0039] Furthermore, the encoding matrix G in step 2-3 A and G B is the Vandermonde matrix, G A and G B The i-th row and j-th column element of is represented as follows:
[0040]
[0041] Among them, n λ j are given constants and are different for each. Use G A and G B The linear combination process of generating the encoded sub-tensors is as follows:
[0042]
[0043] Furthermore, in step 4-1, the master node needs to construct a set based on the numbers of the k slave nodes that first return the results. And in ascending order from G A and G B Extract the corresponding numbered column blocks from the matrix and perform Kronecker product Then, the columns after the operation are sequentially spliced horizontally to form the recovery matrix G D :
[0044]
[0045] The decoding matrix
[0046] Furthermore, in step 4-2, the linear combination operation for decoding the received encoded output sub-tensor is:
[0047]
[0048] Then, for the generated k decoded output sub-tensors, in ascending order of sequence number, A The sub-tensors are concatenated continuously along the height or width dimension of the output tensor to obtain k B The sub-tensors are spliced along the height or width dimensions, and then they are spliced along the output channel dimension in sequence to finally obtain the output tensor Y of the convolutional layer.
[0049] The beneficial effect of the present invention is that the calculation of the input feature matrix and the convolution kernel in the convolution layer of the convolutional neural network is regarded as a tensor calculation, and the input tensor and the core tensor of the convolution layer are respectively divided along the high or wide dimension and the output channel dimension, which lays the foundation for the subsequent distributed parallel implementation, and is convenient for introducing coding calculation to inject redundant information. Based on this, the present invention proposes a coding distributed computing method for accelerating the convolution layer of the convolutional neural network for the master-slave distributed architecture. The method offloads the tensor convolution task to multiple computing nodes for execution through distributed parallelization, thereby accelerating the convolution calculation. At the same time, compared with the traditional coding calculation scheme, the scheme directly linearly encodes the input sub-tensor and the core sub-tensor from the tensor level, embeds computational redundancy, and enables the distributed system to resist node lagging, avoiding the computational performance loss and memory overhead of converting the high-dimensional tensor convolution calculation into a two-dimensional matrix multiplication algorithm. In addition, by controlling the segmentation parameters, the total communication and storage cost of the slave node is optimized. The experimental results conducted on the Amazon AWS cluster show that when there is a node lag, this method effectively improves the convolutional layer calculation speed of mainstream convolutional neural network models such as AlexNet. When the distributed system uses 18 slave nodes, the calculation time of the convolutional layer is reduced by more than 90%, greatly improving the computing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart of the convolutional layer acceleration method of a convolutional neural network based on distributed coding in an embodiment of the present invention.
[0051] Figure 2It is a schematic diagram of a method for a master node to split, encode and transmit an input tensor and a core tensor and perform convolution calculation on a slave node in an embodiment of the present invention.
[0052] Figure 3 It is a schematic diagram of a method for slave node transmission and master node reception, decoding and dimension splicing in an embodiment of the present invention.
[0053] Figure 4 This is a comparison chart of the computational time of the convolution calculation method in the embodiment of the present invention and the traditional single-node solution.
[0054] Figure 5 This is a comparison chart of the computation time of the convolution calculation method in an embodiment of the present invention based on different slave node scales.
[0055] Figure 6 This is a comparison chart of the computation time of the convolution calculation method in an embodiment of the present invention based on different numbers of lagging nodes and lagging delays. DETAILED DESCRIPTION
[0056] The present invention is described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more specific definition of the protection scope of the present invention. Figure 1 As shown, a process framework of a convolutional neural network convolutional layer acceleration method based on distributed coding is provided according to the present invention; the specific implementation steps are as follows:
[0057] The computation in each convolutional layer of a convolutional neural network consists of the input tensor With the core tensor Perform a tensor convolution operation "*" with a convolution step size of s. The specific tensor convolution operation is defined as follows:
[0058]
[0059] The tensor subscript (n, h, w) represents the element at the corresponding dimensional position. The element positions of higher-dimensional tensors are defined similarly, indicating the dot product operation between elements.
[0060] The height and width dimensions of the output tensor are calculated as follows:
[0061]
[0062] First, the master node determines the number of slave nodes n involved in the calculation, the node number recovery threshold k, the number of redundant nodes nk, the convolution step size s of the convolution layer, and the 3D input tensor of the layer. and the 4D kernel tensor And determine the numbers of the n slave nodes i∈{1, 2, 3, ..., n} and the storage cost λ in units of tensor elements on the current distributed system slave nodes store and the communication cost λ comm .
[0063] Considering H>>s, k H ,so
[0064] Then, calculate the k that optimizes the total cost of slave node communication and storage when n and k are fixed. A and k B , the specific method is as follows:
[0065] Because the core tensor of the CNN model required for a specific task is pre-trained, it only needs to be encoded and saved on each slave node during the first operation, so the communication cost C of the slave node is generally comm The acceptance cost C contains only the encoded input sub-tensor comm_up and the transmission cost C of the encoded output sub-tensor comm_down :
[0066]
[0067] Where V comm_up and V comm_down Respectively represent the total number of elements received and the total number of elements transmitted by each slave node;
[0068] The cost C of storing the encoded core tensor in the slave node is store It is expressed as:
[0069]
[0070] Where V store Indicates the total number of elements of the encoded kernel tensor stored in each slave node;
[0071] Assume that the total communication storage cost of each slave node is U(k A , k B ), it can be expressed as:
[0072]
[0073] Since in this scheme k A ×k B = k is a constant, then the total cost U(k A , k B ) can be further simplified to only be about k A The function U(k A ):
[0074]
[0075] Further simplifying the formula yields:
[0076]
[0077] in
[0078] Considering k A , a2>0, then the second-order derivative of the function The minimum value point of this function is the point where the derivative is 0. The specific calculation process is as follows:
[0079]
[0080] Substituting the values of a1 and a2, we get:
[0081]
[0082] At the same time, considering k A and k B are all positive integers. After obtaining the theoretical optimal solution, actual feasibility adjustments need to be made. The details are as follows: If it is an integer, it is used directly; if it is a non-integer, it is calculated separately and The function value of Indicates not greater than The largest integer, Indicates not less than By comparing the function values of these two discrete points, the optimal one is selected as the practical feasible solution. Finally, based on the determined value, using the preset function relationship k A ×k B = k to derive the corresponding This method not only guarantees the mathematical optimality of the solution, but also ensures that the result satisfies the integer constraints in practical applications, thus achieving a balance between theoretical optimality and practical feasibility.
[0083] After the optimal split value is determined, the input tensors are processed according to the split value. and the core tensor Before performing dimension splitting, you need to determine whether the target dimension is divisible by the split number. If it is not divisible, you should fill the dimension with all 0 elements while keeping other dimensions unchanged until the minimum dimension that is divisible by the split number is reached.
[0084] For an input tensor X, assuming k A All the sub-splittings act on high dimensions, so the high dimension of each input sub-tensor is At the same time, the step size of the starting point number of each segmentation is adjusted to
[0085] Then the splitting process for each sub-tensor can be expressed as:
[0086]
[0087] The “:” indicates that the input channel dimension and width dimension are retained. and They represent the starting split element number (inclusive) and the ending split element number (inclusive) in the high dimension respectively. The dimension of the input sub-tensor after splitting is
[0088] The process of splitting the core tensor can be expressed as for i∈{1,2,3,...,k B}; where: represents the high and wide dimensions of the kernel tensor, and They represent the starting split element number (inclusive) and the ending split element number (inclusive) on the output channel dimension respectively. The dimension of the kernel tensor after splitting is
[0089] After the segmentation is completed, according to the corresponding k A ,k B and n, the master node generates the corresponding Vandermonde encoding matrix G A and G B , where G A and G B The elements in row i and column j of are as follows:
[0090]
[0091] Among them, n λ j Each one is different;
[0092] Then, k A unencoded input subtensor X′ i and k B K′ i Perform n linear combinations respectively to obtain n encoded input sub-tensors and n encoded kernel tensors Using the encoding matrix G A and G B The linear combination process of generating the encoded sub-tensors is as follows:
[0093]
[0094] Figure 2Schematic diagram of the process of the master node splitting and encoding the input tensor and the core tensor and transmitting the encoded sub-tensors to the corresponding slave nodes for convolution calculation.
[0095] Next, the master node distributes the generated coding sub-tensor to the corresponding n nodes at the same time. Each slave node will obtain one coding input sub-tensor and one coding core sub-tensor. The coding core sub-tensor corresponding to each convolutional layer is stored on each slave node during the first inference and does not need to be uploaded later.
[0096] Each slave node numbered i obtains the encoded input sub-tensor required for convolution calculation and the encoded nuclear tensor Then start calculating the encoded output sub-tensor And immediately transmit the results back to the master node after the calculation is completed;
[0097] The master node only retains the first k results received, and then builds a set based on the first k slave node numbers that return results. In ascending order, start from G A and G B Extract the corresponding numbered column blocks from the matrix and perform Kronecker product And sequentially concatenate the calculated column blocks along the vertical direction to form the recovery matrix G D :
[0098]
[0099] The decoding matrix
[0100] The master node then decodes the received encoded output sub-tensor by performing the linear combination operation:
[0101]
[0102] For the generated k decoded output sub-tensors, the master node sorts each k in ascending order. A The sub-tensors are continuously concatenated along the high dimension to obtain k B The high-dimensional concatenated tensors are then concatenated along the output channel in sequence to obtain the output tensor Y of the convolution layer, which is used as the output result of the current convolution layer to participate in subsequent neural network calculations.
[0103] Figure 3 A schematic diagram of a method for slave node transmission and master node decoding and dimensional splicing in an embodiment of the present invention.
[0104] The effectiveness of the present invention in accelerating convolutional layer operations and resisting node lag is verified by the following experimental data. The experiment was conducted on an Amazon EC2 cluster. Except for the single-node solution, all instances were configured with t2.micro, equipped with 1 vCPU and 1GB memory. The experiment was implemented based on Python 3.11, and inter-node communication was performed through MPI4py. In addition, the computation time of all distributed solutions depends on the average computation time of the participating computing nodes.
[0105] First, the proposed method is compared with a single-node solution. The single-node solution is implemented on an i3n.xlarge instance with 4 vCPUs and 32GiB memory, while the proposed method is deployed in a cluster with 1 master node and 18 slave nodes, all of which are t2.micro nodes. The experiment sets n=18, the node recovery threshold is k=16, the number of redundant nodes is nk=2, and in this experiment (k A , k B )=(4,4).
[0106] The experimental results are as follows Figure 4 As shown in the figure, even compared with a single-node solution with stronger performance, the method proposed in the present invention significantly accelerates the calculation of the convolutional layer of AlexNet in a distributed node environment with limited resources. Specifically, the calculation time of the five convolutional layers of the present method is reduced by 93.9%, 94.7%, 96.4%, 95.8% and 95.8% respectively.
[0107] The scalability of the method of the present invention was then tested. In the experiment, the number of slave nodes n increased from 8 to 36, and the number of redundant nodes was always kept at 4, that is, it has the ability to resist 4 nodes falling behind. Figure 5 The experimental results show that as the k value increases, the speedup ratio of the present invention in the five convolutional layers of AlexNet is positively correlated with the number of nodes, indicating that the present method has excellent scalability.
[0108] Secondly, the method of the present invention is based on the 5 convolutional layers of AlexNet to test the anti-dropout performance. The experiment uses the coding configuration (n, k) = (32, 24), that is, 32 slave nodes and the node recovery threshold is 24, which has the ability to resist up to 8 nodes from being dropped. The slave node uses the time.sleep() function to introduce artificial delays to simulate random dropouts, gradually increasing the number of dropped nodes from 1 to 12, and testing the node dropout delays of 1 second and 2 seconds. Figure 6As shown in the figure, when the number of dropped nodes does not exceed the preset redundant nodes, the average computation time of the five convolutional layers of AlexNet is not affected; even if the number of dropped nodes exceeds the number of redundant nodes, the average computation time only increases linearly, which verifies the strong robustness of this method in handling dropped nodes.
[0109] The proposed segmentation parameter optimization algorithm can be applied to AWS S3 environment to optimize the cost of convolutional neural networks (CNN) of different scales. The algorithm is based on the communication and storage cost ratio (λ comm =0.09,λ store =0.023), by realizing C comm and C store to optimize the total communication storage cost.
[0110] Table 1 shows the optimal segmentation parameter configurations of various CNN architectures based on the k=16 distributed solution.
[0111] Table 1:
[0112]
Claims
1. A convolutional neural network convolution layer acceleration method based on coded distributed computing, characterized in that: The following steps are involved: Step 1: The master node determines the number of slave nodes n, the node number recovery threshold k, and the number of redundant nodes nk for calculation; then, configures the parameters of the convolution layer to be accelerated, sets the convolution length s, and uses the original convolution layer parameters to define the three-dimensional input tensor Where C is the number of input channels, H is the height of the input tensor, W is the width of the input tensor, and the four-dimensional convolution kernel tensor is defined Where N is the number of output channels, C is the number of input channels, K H is the core height, K W is the core width, and assigns numbers i∈{1, 2, 3, ..., n} to n slave nodes; Step 2: Master node data preparation phase, including the following sub-steps: Step 2-1: The master node determines the optimal splitting scheme for each working node of the current convolution layer based on the communication and storage cost requirements of the distributed system and the scale of the input tensor and core tensor of the convolution layer, and obtains the number of splits k of the input tensor X and the core tensor K. A and k B ; Step 2-2: The master node divides the tensor X into k consecutive parts along the high or wide dimension according to the optimal segmentation scheme. A subtensors X′ that have overlapping parts i , and divide the tensor K into k equal parts according to the output channel dimension B Subtensor K′ i ; Step 2-3: The master node uses the linear encoding matrix G A and G B , for k A input sub-tensors and k B The kernel tensors are linearly combined n times to obtain n encoding input tensors. and n encoded kernel tensors At the same time, the generated encoding sub-tensor is distributed to the corresponding n nodes, and each slave node will receive one encoding input sub-tensor and one encoding core sub-tensor; Step 3: The slave node numbered i gets the assigned encoded input sub-tensor and the encoded nuclear tensor After that, the convolution operation is completed And the calculation results are immediately returned to the master node; Step 4: The master node performs data recovery and splicing, which includes the following sub-steps: Step 4-1: The master node receives and stores the first k convolution results returned. The node numbers corresponding to these results constitute a set Then, the master node Combined with the encoding matrix G A and G B , construct the decoding matrix G C ; Step 4-2: The master node decodes the matrix G C , k linear combinations are performed on the k received encoded tensor results to obtain k decoded output sub-tensors Y1, Y2, ..., Y k ; Step 4-3: The master node concatenates the k recovered output sub-tensors along the H or W dimension and the N dimension to obtain the complete convolution result tensor Y, which is used for subsequent neural network calculations.
2. The method according to claim 1, characterized in that In step 2-1, the number of segments k of X and K that are optimized in the current convolutional layer A and k B Determined using the following optimization method: The communication and storage costs of the slave nodes in this distributed system are λ in units of tensor elements. comm and λ store ; First, considering H ≥ s, k H ,so Then the communication cost of each slave node is C comm , including receiving the encoded input sub-tensor cost C comm_up and the outgoing encoded output subtensor cost C comm_down , expressed as: Where V comm_up and V comm_down Respectively represent the total number of elements received and the total number of elements transmitted by each slave node; Secondly, the storage cost of each slave node is C store (the cost of storing the core tensor), which can be expressed as: where v srore Indicates the total number of elements of the encoded kernel tensor stored in each slave node; k A and k B The optimal value of To minimize the sum of the communication and storage costs of each slave node and satisfy k A ×k B = integer solutions of k.
3. The method according to claim 2, characterized in that Optimal value The statement is as follows:
4. The method according to claim 1, characterized in that: In step 2-2, before segmentation, it is necessary to determine whether the dimension is divisible by the corresponding segmentation number. If it is not divisible, the dimension needs to be filled to a suitable value with all-0 elements while keeping the remaining dimensions unchanged.
5. The method according to claim 1, characterized in that In step 2-2, the splitting of the input tensor X needs to be based on the height or width dimension of the output tensor and the splitting number k A To determine the segmentation range and size of each input sub-tensor, the specific steps are as follows: Step A1: First output the high Width Assume k A The splitting is all done on high dimensions, so the high dimension of each input sub-tensor is At the same time, the step size of the starting point number of each segmentation is adjusted to Step A2: The process of splitting each sub-tensor is expressed as: Among them: indicates that the input channel dimension and width dimension are retained, and They represent the starting and ending element numbers of the split in high dimensions respectively. The dimensions of the input sub-tensor after splitting are 6. The method according to claim 1, characterized in that In step 2-2, the process of splitting the core tensor is expressed as: Where ":" means retaining the high and wide dimensions of the kernel tensor, and They represent the starting and ending split element numbers on the output channel dimension respectively. The dimension of the kernel tensor after splitting is 7. The method according to claim 1, characterized in that In step 2-3, the encoded kernel tensor corresponding to each convolutional layer is stored on each slave node during the first inference and does not need to be uploaded subsequently.
8. The method according to claim 1, characterized in that The encoding matrix G in step 2-3 A and G B is the Vandermonde matrix, G A and G B The i-th row and j-th column element of is represented as follows: Among them, n λ j are given constants and are different for each. Use G A and G B The linear combination process of generating the encoded sub-tensors is as follows:
9. The method according to claim 8, characterized in that In step 4-1, the master node needs to construct a set based on the numbers of the k slave nodes that first return the results. And in ascending order from G A and G B Extract the corresponding numbered column blocks from the matrix and perform Kronecker product Then, the calculated column blocks are spliced horizontally to form the recovery matrix G D : The decoding matrix 10. The method according to claim 9, characterized in that In step 4-2, the linear combination operation for decoding the received encoded output sub-tensor is: Then, for the generated k decoded output sub-tensors, in ascending order of sequence number, A The sub-tensors are concatenated continuously along the height or width dimension of the output tensor to obtain k B The sub-tensors are spliced along the height or width dimensions, and then they are spliced along the output channel dimension in sequence to finally obtain the output tensor Y of the convolutional layer.
Citation Information
Patent Citations
Deep convolutional neural network compression method based on Tucker algorithm
CN110428045A
DGCNN model acceleration method based on Hadoop
CN111160535A
Intrusion detection method and device based on Modbus data packet recombination
CN114124447A
Computation coding and transmission coding integration method and system
CN117498985A
Systems and methods for generation of sparse code for convolutional neural networks
WO2021054990A1