A convolutional neural network convolution layer acceleration method based on coded distributed computing
By adopting the coded distributed computing method to parallelize tensor convolution operations on edge devices, the delay problem caused by node lagging is solved, and efficient and stable acceleration of the convolution layer is achieved, which is suitable for CNN deployment in resource-constrained environments.
Patent Information
- Application Number
- CN202411553774.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-03
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-03
AI Technical Summary
When deploying the convolutional layer of a convolutional neural network on resource-constrained edge devices, existing technologies have delay problems caused by node lag and lack in-depth consideration of the high-dimensional tensor operation characteristics of CNN, resulting in low computing stability and resource utilization efficiency.
A coded distributed computing method is adopted to distribute tensor convolution operations to multiple slave nodes in parallel for execution. Redundant information is embedded through linear coding, and the segmentation parameters are dynamically adjusted to optimize communication and storage costs, ensuring system stability and efficiency.
It significantly accelerates convolutional layer calculations, improves system stability and resource utilization efficiency, reduces calculation time, and maintains efficient operation especially when nodes fall behind.
Smart Images

Figure CN119514606B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distributed computing and convolutional neural networks, and in particular to a method for accelerating the convolution layer 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 gained widespread adoption in image processing due to their superior feature extraction and classification performance. However, the deployment of CNN models, particularly the convolutional layer, their core computational module, on resource-constrained edge devices, still faces significant challenges. Research has shown that in mainstream CNN architectures, convolution operations account for over 90% of multiplication-accumulation operations and consume over 80% of inference time. To address the problem of excessive computational load on single nodes, distributed computing solutions have been widely adopted. However, in real-world applications, due to device heterogeneity and fluctuating network environments, nodes are prone to falling behind, significantly increasing system inference latency. In IoT environments in particular, packet loss rates can exceed 70%, severely impacting the stability of CNN operations.
[0003] In recent years, Coded Distributed Computing (CDC) technology has made significant progress in the field of distributed computing. This technology effectively alleviates the problem of node lag by introducing a redundant coding mechanism into computing tasks. In a master-slave architecture, the master node can use the calculation results of some slave nodes to restore the output of the lag node, ensuring the integrity of the computing task. CDC technology has demonstrated significant advantages in the field of matrix operations: it ensures numerical stability and maintains computational sparsity, while reducing computational complexity and communication storage overhead. This makes CDC technology a promising application prospect in complex application scenarios such as edge computing and multi-drone clusters.
[0004] However, directly applying CDC technology to accelerate CNN convolutional layers still faces the following technical difficulties: First, convolution operations involve complex, high-dimensional interactions between three-dimensional input tensors and four-dimensional core tensors, requiring precise control of tensor decomposition and task allocation to ensure spatial continuity during parallel computing. Second, existing CDC schemes are primarily designed for two-dimensional matrix multiplication and lack in-depth consideration and integration of the high-dimensional tensor operation characteristics of CNNs. Furthermore, in most distributed systems, data communication costs are often significantly higher than storage costs. This requires that when parallelizing convolutional layer operations, the tensor splitting strategy be dynamically adjusted based on the parameter scale of different convolutional layers and system characteristics to optimize communication and storage costs between nodes.
[0005] Therefore, there is an urgent need to develop a coded distributed computing solution for the convolutional layer to address the latency issue caused by node lag, ensure stable acceleration of convolutional layer computation, and optimize system resource utilization and cost. This has important practical significance for deploying CNNs 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 method for accelerating the convolution layer of a convolutional neural network based on coded distributed computing. By distributing tensor convolution operations in parallel to multiple slave nodes for execution, the computing efficiency is significantly improved. This method innovatively embeds coded redundant information in distributed convolution calculations, effectively overcoming the adverse effects of node lag and enhancing system reliability. At the same time, it can dynamically adjust the splitting parameters according to the scale of tensor calculations in the convolution layer 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 convolution layer calculations, 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 method for accelerating the convolutional layer of 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, it 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 input tensor height, W is the input tensor width, and defines the four-dimensional convolution kernel tensor Where N is the number of output channels, C is the number of input channels, K H is the nuclear 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, specifically including the following sub-steps:
[0010] Step 2-1: The master node determines the optimal splitting scheme for the current convolution layer for each working node 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 for 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 sub-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 , perform k linear combinations on the k received encoding 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 that are optimized in 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 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 sub-tensor 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 communication and storage costs of each slave node and satisfy k A ×k B = integer solutions of k.
[0027] Furthermore, the optimal value The expression is as follows:
[0028]
[0029] Furthermore, in step 2-2, before splitting, it is necessary to determine whether the dimension is divisible by the corresponding split number. If it is not divisible, the dimension must be filled with all 0 elements to a suitable value while keeping the other 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 split 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 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: represents the retention of input channel dimension and width dimension, and They represent the starting and ending split element numbers in high dimensions 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] 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, and the dimension of the kernel tensor after splitting is
[0038] Furthermore, in steps 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 element in row i and column j 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 encoder tensor is as follows:
[0042]
[0043] Furthermore, in step 4-1, the master node needs to construct a set based on the k slave node numbers 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 And then the columns after the operation are 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, sort each k A The sub-tensors are continuously concatenated along the height or width dimension of the output tensor to obtain k B The sub-tensors after splicing the height or width dimensions are then spliced along the output channel dimension 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 height or width dimension and the output channel dimension, which lays the foundation for the subsequent distributed parallel implementation and facilitates the introduction of 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 a master-slave distributed architecture. This 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, this scheme directly linearly encodes the input sub-tensor and the core sub-tensor at 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. Experimental results conducted on an Amazon AWS cluster show that this method effectively improves the computational speed of the convolutional layers of mainstream convolutional neural network models, such as AlexNet, when there are node lags. When the distributed system uses 18 slave nodes, the computational time of the convolutional layer is reduced by more than 90%, significantly improving computational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a flow chart of the convolutional layer acceleration method of a convolutional neural network based on distributed encoding 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 input tensors and core tensors and perform convolution calculations on slave nodes in an embodiment of the present invention.
[0052] Figure 3 It is a schematic diagram of a method for transmission from a slave node and reception, decoding and dimension splicing by a master node 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 with reference to 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 precise definition of the scope of protection of the present invention. Figure 1 As shown, the process framework of a convolutional neural network convolution layer acceleration method based on distributed encoding provided by the present invention is 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 subscripts (n, h, w) represent the elements at the corresponding dimensional positions. The positions of tensor elements in higher dimensions are defined similarly, indicating dot multiplication operations 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 participating 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 a 4D kernel tensor And determine the number of n slave nodes i∈{1, 2, 3, ..., n} and the storage cost λ in tensor elements on the current distributed system slave nodes store and 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 by 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 Contains only the accepted cost C of 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 can get:
[0081]
[0082] At the same time, considering k A and k B are all positive integers. After obtaining the theoretical optimal solution, adjustments for practical feasibility are required. 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 deduce the corresponding This method not only guarantees the mathematical optimality of the solution, but also ensures that the results meet 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 divided 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 factor. If not, fill the dimension with all zero elements while keeping the other dimensions unchanged until the minimum dimension that is divisible by the split factor is reached.
[0084] For an input tensor X, suppose k A The sub-splitting all acts on high dimensions, so the high dimension of each input sub-tensor is At the same time, 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] Where ":" means retaining the input channel dimension and width dimension, 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. 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 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 encoder tensor is as follows:
[0093]
[0094] Figure 2Schematic diagram of the process of the master node splitting and encoding the input tensor and core tensor and transmitting the encoded sub-tensors to the corresponding slave nodes for convolution calculation.
[0095] Next, the master node distributes the generated encoding sub-tensor to the corresponding n nodes at the same time. Each slave node will receive one encoding input sub-tensor and one encoding core tensor. The encoding core tensor corresponding to each convolutional layer is stored on each slave node during the first inference and does not need to be uploaded subsequently.
[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 then stitch the calculated column blocks vertically to form the recovery matrix G D :
[0098]
[0099] The decoding matrix
[0100] The master node then decodes the received encoded output sub-tensor using the following linear combination operation:
[0101]
[0102] For the generated k decoded output sub-tensors, the master node sorts each k A Sub-tensors are continuously spliced along high dimensions to obtain k B The high-dimensional spliced tensor is then spliced along the output channel in sequence to finally obtain the output tensor Y of the convolution layer, and it is used as the output result of the current convolution layer to participate in subsequent neural network calculations.
[0103] Figure 3 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 this method in accelerating convolutional layer operations and combating node stagnation is demonstrated through the following experimental data. The experiments were conducted on an Amazon EC2 cluster. Except for the single-node solution, all instances used a t2.micro configuration with 1 vCPU and 1GB of memory. The experiments were implemented in Python 3.11, with inter-node communication performed via MPI4py. Furthermore, the computational time for all distributed solutions is determined by the average computational time of the participating 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 of memory, while the proposed method is deployed in a cluster consisting of 1 master node and 18 slave nodes, all of which are t2.micro nodes. The experimental setting is 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 to a more powerful single-node solution, the proposed method significantly accelerates the computation of AlexNet's convolutional layers in a resource-limited distributed node environment. Specifically, the proposed method reduces the computation time of its five convolutional layers by 93.9%, 94.7%, 96.4%, 95.8%, and 95.8%, respectively.
[0107] The scalability test of the method of the present invention was then carried out. 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 its 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 dropping out. The slave node uses the time.sleep() function to introduce artificial delay to simulate random dropout, gradually increasing the number of dropped nodes from 1 to 12, and testing the node dropout delay of 1 second and 2 seconds. Figure 6As shown in the figure, when the number of stray 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 stray nodes exceeds the number of redundant nodes, the average computation time only increases linearly, verifying the strong robustness of this method in handling stray 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 achieving C comm and C store The best balance is achieved to optimize the total communication storage cost.
[0110] Table 1 shows the optimal segmentation parameter configurations for various CNN architectures based on the k=16 distribution scheme.
[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, it 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 input tensor height, W is the input tensor width, and defines the four-dimensional convolution kernel tensor Where N is the number of output channels, C is the number of input channels, K H is the nuclear 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, specifically including the following sub-steps: Step 2-1: The master node determines the optimal splitting scheme for the current convolution layer for each working node 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 for 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 overlap each other 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 sub-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 , perform k linear combinations on the k received encoding 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 splits k of X and K optimized by 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 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 sub-tensor 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 expression is as follows:
4. The method according to claim 1, wherein In step 2-2, before splitting, it is necessary to determine whether the dimension is divisible by the corresponding split number. If not, the dimension must be filled with all 0 elements to a suitable value while keeping the other dimensions unchanged.
5. The method according to claim 1, wherein 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 split 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 starting point number of each segmentation is adjusted to Step A2: The process of splitting each sub-tensor is expressed as: Among them: represents the retention of input channel dimension and width dimension, and They represent the starting and ending split element numbers 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 follows: 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, and the dimension of the kernel tensor after splitting is 7. The method according to claim 1, characterized in that In steps 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 element in row i and column j 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 encoder tensor is as follows:
9. The method according to claim 8, characterized in that In step 4-1, the master node needs to build a set based on the k slave node numbers 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 And then the columns after the operation 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, sort each k A The sub-tensors are continuously concatenated along the height or width dimension of the output tensor to obtain k B The sub-tensors after splicing the height or width dimensions are then spliced along the output channel dimension 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
Computation coding and transmission coding integration method and system
CN117498985A