A data processing architecture, chip, matrix multiplication and neural network calculation method

Through a distributed computing architecture of node arrays, low-cost and efficient matrix multiplication operations are achieved, solving the matrix multiplication problem in large-scale neural network computing and providing a parallel computing architecture and an easily scalable solution.

CN122477461APending Publication Date: 2026-07-28SUNMMIO SCIENCE & TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUNMMIO SCIENCE & TECHNOLOGY (BEIJING) CO LTD
Filing Date
2024-11-25
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

In large-scale neural network computation, how to perform matrix multiplication operations quickly and at low cost, especially the transpose multiplication of large-dimensional matrices, has become an urgent problem to be solved.

Method used

A node array of P rows and Q columns is used, with each node storing the first and second sub-matrices. Matrix multiplication is achieved through communication and computation between nodes. The specific steps include sub-matrix transmission between nodes, transpose matrix multiplication, and result merging, ultimately forming the matrix multiplication result.

Benefits of technology

It reduces computational costs, improves computational efficiency, provides a parallel computing architecture, is easy to expand and maintain, and is suitable for large-scale matrix multiplication operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122477461A_ABST
    Figure CN122477461A_ABST
Patent Text Reader

Abstract

A data processing architecture, chip, matrix multiplication and neural network calculation method, the data processing architecture (20) comprises: a node array of P rows and Q columns; P×Q nodes (10) in the node array respectively store a first submatrix obtained by dividing a first matrix, and a second submatrix obtained by dividing a second matrix; each node (10) is configured to send the second submatrix stored in the node to other P-1 nodes in the column where the node is located, respectively, to perform multiplication calculation on the first submatrix stored in the node and the transposed matrix of the plurality of second submatrices, respectively, to obtain a plurality of first type submatrix calculation results; according to a preset first correspondence relationship, the first type submatrix calculation results corresponding to other nodes in the row where the node is located are respectively sent to the corresponding nodes, and the first type submatrix calculation result corresponding to the node calculated is added to the first type submatrix calculation result received from other nodes to obtain a first result submatrix of the node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to, but is not limited to, the field of data processing technology, and in particular to a data processing architecture, chip, matrix multiplication, and neural network computation method. Background Technology

[0002] Deep learning is a special form of neural network that learns complex representations of data using a multi-layered neural network architecture. Deep learning has wide applications in large-scale models, such as image recognition and generation, natural language processing, speech recognition and synthesis, video generation, robot dialogue, and autonomous driving. This demonstrates the broad application prospects of deep learning in the future of information transmission. This involves a large number of matrix multiplication calculations: Y[M][N]=X[M][L]×W[L][N], where Y is the M x N output matrix, X is the M x L ​​input matrix, and W is the L x N weight matrix. Neural network inversion is the process of deducing the input or weight matrix from the output matrix of the neural network. Inversion can be performed using matrix multiplication, for example, the gradient matrix of the input matrix dX[M][L]=dY[M][N]×(W[L][N]). T The gradient matrix of the weight matrix is ​​dW[L][N] = (X[M][L]). T ×dY[M][N], where dY is the gradient matrix of the output matrix Y. Since computational tasks in large models are typically complex, the dimensions L and N of the weight matrix W are generally in the range of several thousand to tens of thousands, while the value of dimension M in the input matrix varies depending on the application scenario and the stage of computation, generally ranging from tens to hundreds of thousands. The total computational load during inversion will be very large, consuming significant processor resources. Therefore, how to perform multiplication operations with transpose processing in a low-cost and fast manner has become a pressing problem to be solved. Summary of the Invention

[0003] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.

[0004] This application provides a data processing architecture, including: a node array of P rows and Q columns; wherein the P×Q nodes in the node array respectively store a first sub-matrix obtained by partitioning a first matrix B and a second sub-matrix obtained by partitioning a second matrix C;

[0005] Each node is configured to send the second submatrix stored in this node to the other P-1 nodes in the same column. The first submatrix stored in this node is multiplied by the transposes of multiple second submatrixes to obtain multiple first-type submatrix calculation results. These multiple second submatrixes include the second submatrix stored in this node and the received second submatrix. According to a preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the same row are sent to their respective nodes. The calculated first-type submatrix calculation result corresponding to this node is then added to the first-type submatrix calculation results received from other nodes to obtain the first-result submatrix of this node. The first-result submatrixes of the P×Q nodes form a first-result matrix A, where A = B×C. T .

[0006] On the other hand, embodiments of this application provide a matrix multiplication calculation method, which is implemented based on the above-mentioned data processing architecture and includes:

[0007] Each node sends the second submatrix stored in this node to the other P-1 nodes in the same column;

[0008] Each node performs multiplication calculations using the first submatrix stored in this node and the transpose of multiple second submatrixes respectively, to obtain multiple first-type submatrix calculation results, wherein the multiple second submatrixes include the second submatrix stored in this node and the received second submatrix;

[0009] Each node retains the calculation result of the first type submatrix corresponding to its own node according to the preset first correspondence relationship, sends the calculation results of the first type submatrix corresponding to other nodes in the row where the node is located to the corresponding nodes respectively, and adds the calculation results of the first type submatrix corresponding to the node to obtain the first result submatrix of the node.

[0010] In the data processing architecture, the first result submatrices of P×Q nodes constitute the first result matrix A, where A = B×C. T The first submatrix stored by P×Q nodes forms the first matrix B, and the second submatrix stored by P×Q nodes forms the second matrix C.

[0011] In another aspect, embodiments of this application provide a data processing architecture, including: a node array of P rows and Q columns; wherein P×Q nodes in the node array respectively store a third sub-matrix obtained by partitioning a third matrix E and a fourth sub-matrix obtained by partitioning a fourth matrix F;

[0012] Each node is configured to send the third submatrix stored in this node to the other Q-1 nodes in the same row. Multiple transposes of the third submatrix are multiplied by the fourth submatrix stored in this node to obtain multiple second-type submatrix calculation results. These multiple third submatrixes include the third submatrix stored in this node and the received third submatrix. According to a preset second correspondence, the second-type submatrix calculation results corresponding to other nodes in the same column are sent to their respective nodes. The calculated second-type submatrix calculation result corresponding to this node is then added to the second-type submatrix calculation results received from other nodes to obtain the second-result submatrix of this node. The second-result submatrixes of the P×Q nodes form a second-result matrix D, where D = E. T ×F.

[0013] Furthermore, embodiments of this application provide a matrix multiplication calculation method, which is implemented based on the aforementioned data processing architecture and includes:

[0014] Each node sends the third submatrix stored in this node to the other Q-1 nodes in the same row as this node;

[0015] Each node performs multiplication calculations by multiplying the transpose of multiple third submatrices with the fourth submatrices stored in the node, respectively, to obtain multiple second-type submatric calculation results, wherein the multiple third submatrices include the third submatrices stored in the node and the received third submatrices;

[0016] Each node retains the calculation result of the second type submatrix corresponding to its own node according to the preset second correspondence relationship, sends the calculation results of the second type submatrix corresponding to other nodes in the column where the node is located to the corresponding nodes respectively, and adds the calculation results of the second type submatrix corresponding to the node to obtain the second result submatrix of the node;

[0017] In the data processing architecture, the second result submatrices of P×Q nodes form the second result matrix D, which is the result of matrix multiplication of the transpose of the third matrix X and the fourth matrix dY, where D = E. T The third matrix E is composed of the third sub-matrix stored by the P×F nodes, and the fourth matrix F is composed of the fourth sub-matrix stored by the P×Q nodes.

[0018] Furthermore, embodiments of this application provide a neural network inversion method, the method comprising: when calculating the input matrix X of the current layer, each layer in the neural network model performs the following steps:

[0019] Using the gradient matrix dY of the current layer's output matrix as the first matrix B, and the weight matrix W of the current layer as the second matrix C, the first result matrix A = B × C is obtained by following the matrix multiplication method described above. T Wherein, the first result matrix A is used as the gradient matrix dX of the input matrix X of the current layer;

[0020] Calculate the input matrix X of the current layer based on dX. * ;

[0021] When calculating the weight matrix W of the current layer, each layer in the neural network model performs the following steps:

[0022] Using the input matrix X of the current layer as the third matrix E, and the gradient matrix dY of the output matrix of the current layer as the fourth matrix F, the second result matrix D = E is obtained by following the matrix multiplication method described above. T ×F; where the second result matrix D is used as the gradient matrix dW of the current layer's weight matrix W;

[0023] Calculate the weight matrix W of the current layer based on dW.

[0024] In another aspect, embodiments of this application provide a chip including any of the data processing architectures described above.

[0025] After reading and understanding the accompanying diagrams and detailed descriptions, the other aspects can be understood.

[0026] Overview of the attached figures

[0027] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0028] Figure 1 This is a schematic diagram of the data processing architecture according to an embodiment of this application;

[0029] Figure 2 This is a schematic diagram of the layout of a data processing architecture in an exemplary embodiment;

[0030] Figure 3 This is a schematic diagram of the node structure in one exemplary embodiment;

[0031] Figure 4 Here is a schematic diagram of a 4×4 node matrix as an example;

[0032] Figure 5 Here is a schematic diagram of a 4×4 node matrix in another example;

[0033] Figure 6This is a flowchart of a matrix multiplication calculation method according to an embodiment of this application;

[0034] Figure 7 This is a flowchart of another matrix multiplication calculation method according to an embodiment of this application;

[0035] Figure 8 This is a three-dimensional schematic diagram of a chip in an exemplary embodiment;

[0036] Figure 9 This is a cross-sectional schematic diagram of a chip in an exemplary embodiment;

[0037] Figure 10 Here is a schematic diagram of a 4×4 node matrix in another example;

[0038] Figure 11 This is a schematic diagram of a 4×4 node matrix in another example.

[0039] Detailed Explanation

[0040] This disclosure describes several embodiments, but these descriptions are exemplary and not limiting, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in detail, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.

[0041] The terms "first" and "second," etc., used in this disclosure and its accompanying drawings are intended to distinguish different objects or different treatments of the same object, and not to describe a particular order of objects. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein.

[0042] For applications such as neural network inversion or other scenarios requiring large-dimensional matrix transpose multiplication, a low-cost and efficient solution for matrix transpose multiplication is needed.

[0043] The first embodiment of this application provides a data processing architecture 20, such as... Figure 1 As shown, it includes: a node array of P rows and Q columns; when the P×Q nodes 10 in the node array respectively store the first sub-matrix obtained by partitioning the first matrix B[M][N] and the second sub-matrix obtained by partitioning the second matrix C[L][N];

[0044] Each node is configured to send its stored second submatrix to the other P-1 nodes in its column. The first submatrix stored at this node is multiplied by the transposes of multiple second submatrixes to obtain multiple first-type submatrix calculation results. These multiple second submatrixes include the second submatrix stored at this node and the received second submatrixes. According to a preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the same row are sent to their respective nodes. The calculated first-type submatrix calculation result for this node is then added to the first-type submatrix calculation results received from other nodes to obtain the first-result submatrix for this node. The first-result submatrixes of P×Q nodes form a first-result matrix A, where A = B×C. T .

[0045] In this article, node 10 is represented by E. p,q The subscript indicates the position of a node in the node array; p represents the p-th row in the node array, q represents the q-th column in the node array, p = 1, 2, ..., P, q = 1, 2, ..., Q.

[0046] In this embodiment, the data processing architecture 20 can be a distributed two-dimensional node array architecture, with node E p,q In this context, 'p' represents the x-coordinate of the node in the node array, meaning 'p' indicates that the node is located in the p-th row of the node array; node E p,q In this context, q represents the vertical coordinate of the node in the node array, that is, q means that the node is located in the qth column of the node array.

[0047] In this embodiment, there are P×Q nodes E p,q The corresponding first result submatrix can be directly concatenated according to the position of the corresponding node in the node array (i.e., the row and column number), thus obtaining the final result of matrix multiplication of the transposes of the first and second matrices; for example, assuming each node E p,q Each corresponds to a first result submatrix a pq Then the first result submatrix a among P×Q nodes pq They can be arranged into A[M][L], that is: A[M][L] can be regarded as a first result submatrix array, where the first row is a 11 a 12 , ..., a 1Q The second line is 'a'. 21 a 22 , ..., a 2Q The last line is 'a'. P1 a P2 , ..., a PQAnd so on. When each node corresponds to multiple first result submatrices, the multiple first result submatrices in the node form a first result subarray. The first result subarrays corresponding to multiple nodes are concatenated according to the position of the corresponding node in the node array to obtain A[M][L].

[0048] In this embodiment, the data processing architecture 20 has P×Q nodes E p,q It can directly connect to other nodes E in the same row and column of the node array. p,q It can also indirectly connect other nodes E in the same row and column of the node array. p,q This allows for the transmission of the second submatrix and the reception of the calculation results of the first type of submatrix corresponding to this node; P×Q nodes E p,q It can, but is not limited to, forming a two-dimensional mesh network or a dedicated data link, with each pair of adjacent nodes E p,q They can communicate point-to-point or broadcast by row and column.

[0049] In this embodiment, each node E in the data processing architecture 20 p,q Based on the first submatrix and the second submatrix stored in this node, and the second submatrix received from the other P-1 nodes in the same column as this node, multiple first-type submatrix calculation results are calculated. That is, matrix multiplication is performed on the transpose of the first submatrix and the second submatrix stored in this node to obtain a first-type submatrix calculation result. Then, matrix multiplication is performed on the first submatrix stored in this node and the transpose of the second submatrix received from the other nodes in the same column as this node to obtain multiple first-type submatrix calculation results. Of all the first-type submatrix calculation results obtained, at least one is the first-type submatrix calculation result corresponding to this node, and the rest are the first-type submatrix calculation results corresponding to the other P-1 nodes in the same row as this node. According to the preset first correspondence, this node sends the first-type submatrix calculation results corresponding to the other P-1 nodes in the same row as this node to the corresponding nodes respectively. In addition, this node also receives the first-type submatrix calculation results corresponding to this node from the other Q-1 nodes in the same row as this node, which are sent to this node by other nodes according to the preset first correspondence. This node adds the first-type submatrix calculation result corresponding to this node that it calculates itself to the first-type submatrix calculation result corresponding to this node that it receives from other nodes to obtain the first result submatrix of this node.

[0050] In this embodiment, the first submatrix derived from the first matrix can be viewed as an array of first submatrixes, and the second submatrix derived from the second matrix can be viewed as an array of second submatrixes. If each node E p,qIf only one first submatrix and one second submatrix are stored, then the first matrix is ​​divided into P rows and Q columns of first submatrixes, and the second matrix is ​​divided into P rows and Q columns of second submatrixes; each node E p,q The positions of the saved first submatrix and the saved second submatrix within the first matrix are identical to the position of the node in the node array. If each node E... p,q It stores multiple first submatrices and multiple second submatrices, and any node E p,q The position of the matrix formed by the multiple first sub-matrices stored in the first matrix, and the position of the matrix formed by the multiple second sub-matrices stored in the second matrix, are the same as the position of the node in the node array. Here, position refers to the row and column number of the node in the node array or sub-matrix array.

[0051] In this embodiment, a node E p,q Each node can store one or more first submatrices and one or more second submatrices. The size of each first submatrix and each second submatrix can be the same. If each node contains only one first submatrix and one second submatrix, then the number of rows in the first submatrix is ​​M / P, and the number of columns is N / Q; the number of rows in the second submatrix is ​​L / P, and the number of columns is N / Q.

[0052] In this embodiment, the first submatrix, divided by the first matrix, can be evenly distributed across P×Q nodes E. p,q In the second matrix, the second submatrix can be evenly distributed across P×Q nodes E. p,q In this case, each node has the same number of first submatrices and the same number of second submatrices.

[0053] The data processing architecture 20 of this embodiment can divide two large matrices undergoing matrix transpose multiplication into multiple smaller submatrices, which are then distributed across multiple nodes for storage and computation. This allows each node to perform only the transpose multiplication of the submatrices and store the corresponding first-type submatric calculation results, significantly reducing costs. The data processing architecture 20 of this embodiment provides a parallel architecture for the storage and arrangement of large-scale matrices. Each node E in the node array... p,q The first result submatrix can be computed in partial or full parallelism. Submatrix transmission between nodes only requires row-level and column-level communication. Each node is responsible for small matrix computation tasks involving the first submatrix stored on its own node and the transposes of multiple second submatrixes. This provides the hardware foundation for converting large-scale matrix multiplication operations into parallel computations of multiple small matrices, significantly reducing the time required for large-scale matrix multiplication operations. Furthermore, all nodes E in the node array... p,qThe structure can be identical, and the number of nodes or columns can be increased according to actual needs. It is highly scalable, easy to implement standardized design and integration, and the performance between each node is consistent, which improves the reliability of the data processing architecture. When a single node fails, the faulty node can be replaced. It is easy to maintain, user-friendly and environmentally friendly, and reduces the maintenance cost of the data processing architecture.

[0054] In one exemplary embodiment, each node may include: a computing sub-node and a storage module;

[0055] Computational child nodes can include:

[0056] The processing module is configured to read the first and second sub-matrices stored in this node and the received second sub-matrices from the storage module; perform multiplication calculations on the first sub-matrices stored in this node and the transposes of the read second sub-matrices respectively to obtain multiple first-type sub-matrices calculation results, and save them to the storage module; read the first-type sub-matrices calculation results corresponding to this node from the storage module, sum them to obtain the first result sub-matrices corresponding to this node, and save them to the storage module.

[0057] The communication module is configured to send the second submatrix saved by the current node, which is read by the processing module, to the other P-1 nodes in the same column as the current node, and to receive the second submatrix from the other P-1 nodes in the same column as the current node and save it to the storage module; according to the preset first correspondence, the module sends the calculation results of the first type submatrix corresponding to the other P-1 nodes in the same row as the current node to the corresponding nodes, and receives the calculation results of the first type submatrix corresponding to the current node from the other Q-1 nodes in the same row as the current node and save them to the storage module.

[0058] In this embodiment, the calculation result of the first type submatrix corresponding to this node includes the calculation result of the first type submatrix corresponding to this node in the preset first correspondence relationship calculated by this node, and the calculation result of the first type submatrix received from the other Q-1 nodes in the row where this node is located.

[0059] In this embodiment, the second submatrix is ​​received from the other P-1 nodes in the same column as this node.

[0060] In this embodiment, the storage module can be configured to store the first submatrix and the second submatrix saved by this node, the received second submatrix, the calculation result of the first type submatrix calculated by this node (including the calculation results of the first type submatrix corresponding to the other P-1 nodes in the row where this node is located, and the calculation result of the first type submatrix corresponding to this node), the calculation results of the first type submatrix received from the other Q-1 nodes in the row where this node is located, and the first result submatrix corresponding to this node.

[0061] In one exemplary embodiment of this invention, the data processing architecture can be as follows: Figure 2 As shown, nodes communicate with each other through a communication module; the storage module may include a temporary storage module and a main memory module. Each node sends and receives the second sub-matrix through the communication module and temporarily stores it in the temporary storage module. This is used by the processing module to perform matrix multiplication calculations to obtain multiple first-type sub-matrix calculation results, which are temporarily stored in the temporary storage module. These multiple first-type sub-matrix calculation results include: the first-type sub-matrix calculation result corresponding to the current node and the first-type sub-matrix calculation results corresponding to other nodes in the same row as the current node. The first-type sub-matrix calculation result corresponding to the current node is used by the processing module for subsequent matrix addition calculations. The first-type sub-matrix calculation results corresponding to other nodes in the same row as the current node... The communication module sends the results to the corresponding nodes; each node also receives the calculation results of the first type submatrix corresponding to its own node from other nodes in the same column through the communication module, and temporarily stores them in the temporary storage module for the processing module to perform matrix addition calculation (the processing module performs matrix addition calculation on the stored calculation results of the first type submatrix corresponding to its own node and the received calculation results of the first type submatrix corresponding to its own node) to obtain the addition result (i.e., the first result submatrix), which is temporarily stored in the temporary storage module and finally saved to the memory module; the submatrix saved by a node can be stored entirely in the memory module, or part of it can be stored in the temporary storage module and the other part in the memory module.

[0062] In one exemplary embodiment, the storage module may include: a temporary storage module disposed in the computing sub-node;

[0063] Alternatively, it may include: a temporary storage module set in the compute sub-node, and a memory sub-node connected to the compute sub-node;

[0064] Memory child nodes can be configured to store the first submatrix saved by this node, the second submatrix saved by this node, and the first result submatrix corresponding to this node;

[0065] The temporary storage module can be configured to store the first sub-matrix of the current node read by the processing module from the memory child node, the second sub-matrix of the current node, the second sub-matrix received from the other P-1 nodes in the column where the current node is located, the calculation result of the first type of sub-matrix calculated by the processing module, and the first result sub-matrix corresponding to the current node;

[0066] The processing module can also be configured to save the first result submatrix temporarily stored in the temporary storage module to the memory subnode.

[0067] In this embodiment, when the storage module only includes a temporary storage module, the temporary storage module can be configured to store the first sub-matrix and the second sub-matrix saved by this node, the received second sub-matrix, the calculation result of the first type sub-matrix calculated by this node (including the calculation results of the first type sub-matrix corresponding to the other P-1 nodes in the row where this node is located, and the calculation result of the first type sub-matrix corresponding to this node), the calculation results of the first type sub-matrix received from the other Q-1 nodes in the row where this node is located, and the first result sub-matrix corresponding to this node.

[0068] In this embodiment, when the storage module includes a temporary storage module and a memory sub-node, one implementation method is as follows: Figure 3 Each node 10 may include: a computational sub-node 30, and a memory sub-node 40 connected to the computational sub-node 30;

[0069] Memory child node 40 is configured to store the first submatrix, the second submatrix, and the first result submatrix corresponding to this node;

[0070] Calculating child node 30 includes:

[0071] Temporary storage module 31;

[0072] Processing module 32 is configured to read the first and second sub-matrices stored in the current node from memory sub-node 40 and temporarily store them in temporary storage module 31; calculate multiple first-type sub-matrices based on the first and second sub-matrices temporarily stored in temporary storage module 31 and temporarily store them in temporary storage module 31; sum the first-type sub-matrices calculation results corresponding to the current node temporarily stored in temporary storage module 31 (the first-type sub-matrices calculation results corresponding to the current node include: the first-type sub-matrices calculation results corresponding to the current node among the multiple first-type sub-matrices calculation results calculated by processing module 32 of the current node, and the first-type sub-matrices calculation results corresponding to the current node received from the other Q-1 nodes in the same row of the current node) to obtain the first result sub-matrix corresponding to the current node and save it to memory sub-node 30;

[0073] The communication module includes a column data communication module 33 and a row data communication module 34, wherein:

[0074] The column data communication module 33 is configured to send the second sub-matrix saved by the current node, which is read by the processing module 32, to the other P-1 nodes in the column where the current node is located, and to receive the second sub-matrix from the other P-1 nodes in the column where the current node is located and save it to the temporary storage module 31.

[0075] The row data communication module 34 is configured to send the calculation results of the first type submatrix corresponding to the other P-1 nodes in the row where the current node is located to the corresponding nodes according to the preset first correspondence relationship; and receive the calculation results of the first type submatrix corresponding to the current node from the other Q-1 nodes in the row where the current node is located, and save them to the temporary storage module 31.

[0076] In this embodiment, the second submatrix to be calculated by the processing module 32 is temporarily stored in the temporary storage module 31. The second submatrix to be calculated includes two cases: one is the second submatrix stored in the memory child node of the current node and to be sent out; the other is the second submatrix received from other nodes. The processing module 32 can use some or all of the submatrixes in the temporary storage module 31 during calculation. Which submatrixes to use can be selected by instructing the processing module 32 through programming or other means. A submatrix can be uniquely identified by its name (e.g., b, or c) and coordinates (represented in this document as the subscript of b or c).

[0077] In this embodiment, P×Q computational sub-nodes 30 and P×Q memory sub-nodes 40 are connected one-to-one to form a parallel memory access architecture. That is, each computational sub-node 30 has dedicated memory access bandwidth when reading the first and second sub-matrices from the memory sub-node 40, and when writing the result sub-matrices to the memory sub-node 40. Therefore, the computational sub-nodes in the entire node array can read and write to the memory sub-nodes in parallel. After reading the sub-matrices in parallel, the sub-matrices can be sent in parallel, which greatly improves the efficiency of memory access and the efficiency of transmitting sub-matrices, and reduces the need for large-capacity memory, thus reducing hardware costs.

[0078] In this embodiment, the memory sub-node 40 can be DRAM, or one or more storage media such as SRAM, PCM, ReRAM, Flash, etc., and is connected to the computing sub-node 30 through the memory port 41; the temporary storage module 31 can be, but is not limited to, SRAM, or can be high-speed memory such as MRAM, eDRAM, etc.; the processing module 32 can be a matrix calculation circuit.

[0079] In this embodiment, the communication module can be treated as a whole, without being split into column data communication module and row data communication module. Alternatively, the column data communication module 33 and the row data communication module 34 can reuse some hardware resources. For example, the row data communication module 34 may include a routing module and one or two first interfaces in the row direction. The first interfaces connect adjacent nodes in the same row. The routing module performs operations such as data packet encapsulation, routing, sending, receiving, and decapsulation. The column data communication module 33 may include the routing module and one or two second interfaces in the column direction. The second interfaces connect adjacent nodes in the same column. The routing module can be reused. Alternatively, the column data communication module 33 and the row data communication module 34 can be independent data links.

[0080] In this embodiment, the hardware implementation of the computing sub-nodes and memory sub-nodes is not limited. For example, P×Q computing sub-nodes 30 can form a logic array, which can be packaged in a logic die; P×Q memory sub-nodes 40 can form a memory array, which can be packaged in a memory die. The logic dies and memory dies can be stacked and bonded together. Alternatively, a processing chip with memory can be used as a node to form a chip array. Another example is that different cores in a multi-core processor can be used as different computing sub-nodes. Or, for example, each computing sub-node and its corresponding memory sub-node can be directly connected in the same circuit and packaged in a die. Alternatively, the computing sub-nodes and memory sub-nodes can be bonded together or directly packaged in a single chip.

[0081] In other implementations, multiple computational child nodes can share one or more memory child nodes. Each computational child node reads the first submatrix and the second submatrix through different storage addresses and stores the calculated results in different storage addresses. For example, two memory child nodes can be set up: one stores the first submatrix of all computational child nodes, and the other stores the second submatrix of all computational child nodes.

[0082] In other implementations, a single memory can be used to store the first submatrix, the second submatrix, and the first result submatrix in P×Q storage areas arranged in P rows and Q columns. The computational child nodes can access the corresponding storage area through two-dimensional coordinates (such as the storage area in which row and column).

[0083] In one exemplary embodiment, the node E p,q Sending the second submatrix stored in this node to the other P-1 nodes in the same column as this node can include:

[0084] The node E p,q Broadcast the second submatrix stored in this node to the other P-1 nodes E in the same column as this node.p,q .

[0085] In this embodiment, multiple data packets can be sent, that is, each node sends one data packet to send the second submatrix stored in this node to the other P-1 nodes in the same column; or the second submatrix can be forwarded along the column by node by node.

[0086] This application does not limit the form in which the second submatrix is ​​sent, as long as it can be sent to other nodes in the same column.

[0087] In one exemplary embodiment, nodes in different rows can send the second sub-matrix at different time periods, while nodes in the same row can send the second sub-matrix in parallel; or, P×Q nodes can send the second sub-matrix in parallel.

[0088] In this embodiment, the P-row nodes can be divided into P periods to send the second sub-matrix row by row. For example, in the first period, the first row node sends the stored second sub-matrix, in the second period, the second row node sends the stored second sub-matrix, and so on; or, the P-row nodes can be divided into multiple periods to send the second sub-matrix, in each period, 2 or more rows of nodes send the stored second sub-matrix in parallel.

[0089] In this embodiment, regardless of the method used for transmission, each node will eventually send the stored second submatrix to every other node in the same column, and will also receive the second submatrix sent by every other node in the same column.

[0090] In one exemplary embodiment of this example, when nodes in different rows send the second submatrix at different time periods, the first submatrix stored by this node is multiplied by the transposes of multiple second submatrixes to obtain multiple first-type submatrix calculation results. Based on a preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the row where this node is located are sent to their respective nodes. This may include:

[0091] In each time period, the following operations are performed: multiply the first submatrix stored in this node with the transpose of the second submatrix transmitted in the current time period to obtain the calculation result of the first type of submatrix in the current time period; when it is determined according to the preset first correspondence that the node corresponding to the calculation result of the first type of submatrix obtained in the current time period is another node in the row where this node is located, send the calculation result of the first type of submatrix to the corresponding node; wherein, the second submatrix transmitted in the current time period is the second submatrix sent or received by this node in the current time period.

[0092] In this embodiment, the calculation and transmission of the first type of submatrix calculation result can be performed in cycles. For example, if the P-row nodes are divided into P cycles to transmit the second submatrix row by row, then each node performs at least one multiplication calculation in each cycle between the first submatrix stored by the node and the transpose of the second submatrix transmitted in the cycle (stored by the node and sent to other nodes, or received from other nodes). If the first type of submatrix calculation result obtained in each cycle corresponds to the node, it is retained in the node for summation calculation; if it corresponds to another node, it is sent to the corresponding node in the cycle. In other embodiments, after the first type of submatrix calculation result is obtained in each cycle, it can be delayed and sent to the corresponding node in parallel after the first type of submatrix calculation results of multiple cycles are obtained.

[0093] In another exemplary embodiment of this example, when the P×Q nodes send the second submatrix in parallel, the first submatrix stored at this node is multiplied by the transposes of the multiple second submatrixes to obtain multiple first-type submatrix calculation results. According to a preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the row where this node is located are sent to their respective nodes, including:

[0094] The first submatrix stored in this node is multiplied by the transpose of the received second submatrix and the transpose of the second submatrix stored in this node to obtain multiple first-type submatrix calculation results; according to the preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the row where this node is located are sent to the corresponding nodes in parallel.

[0095] In this embodiment, each node will calculate multiple first-type submatrix calculation results at once. Except for the first-type submatrix calculation result corresponding to this node, which is retained in this node, the other first-type submatrix calculation results can be sent to multiple other nodes in parallel.

[0096] In one exemplary embodiment, the first matrix can be divided into R rows and S columns of first submatrices b. ij The second matrix can be divided into S rows and T columns of second submatrices c. hk ; i represents the first submatrix b ij The row number j in the first matrix indicates the first submatrix b. ij The column number in the first matrix; h represents the second submatrix c. hk The row number in the second matrix, k, indicates the second submatrix c. hk The column index in the second matrix; i = 1, 2, ..., R, j = 1, 2, ..., S, h = 1, 2, ..., S, k = 1, 2, ..., T;

[0097] Multiplying the first submatrix stored in this node with the transposes of multiple second submatrices can include: the node selecting a first submatrix b from the stored first submatrix and multiple second submatrices where j and k are equal. ij and a second submatrix c hk The transpose of the matrix is ​​used as a pair of submatrices, wherein multiple second submatrices include the second submatrices stored in this node and the received second submatrices; matrix multiplication is performed on the transpose of the first and second submatrices in each pair of submatrices.

[0098] In this embodiment, in a pair of submatrices, the number of columns in the first submatrix is ​​equal to the number of columns in the second submatrix.

[0099] In one exemplary embodiment of this example, R = S = T = P = Q, the node array is a square matrix, and the total number of the first submatrix and the total number of the second submatrix are both equal to the total number of nodes. Each node stores one first submatrix and one second submatrix. The position or two-dimensional coordinates of the submatrix in the matrix are the same as the position or two-dimensional coordinates of the node in the node array. For example, if the node array is 2 rows and 3 columns, and the first matrix is ​​divided into 2 rows and 3 columns of first submatrix, then the first submatrix in the first row and first column is located at E. 1,1 The first submatrix in the 2nd row and 3rd column is located in E. 2,3 The same applies to the second submatrix.

[0100] In this embodiment, the node array is a square node array, with Figure 4 Taking the 4×4 node matrix with P=Q=4 as an example, the second submatrix c is processed in 4 periods. hk The transmission; the following uses a subset of nodes in this 4×4 node matrix as an example to illustrate the transmission of the submatrix, for example, node E. 1,1 In the first cycle, store the second submatrix c at this node. 11 Send to node E respectively 2,1 E 3,1 E 4,1 Node E 2,3 In the second cycle, the second submatrix c stored at this node will be... 23 Send to node E respectively 1,3 E 3,3 E 4,3 Node E 3,2 In the third cycle, the second submatrix c stored at this node will be... 32 Send to node E respectively 1,2 E 2,2 E 4,2 Node E 4,3 In the 4th period, the second submatrix c stored at this node will be...43 Send to node E respectively 1,3 E 2,3 E 3,3 The same logic applies to other nodes, and will not be elaborated here.

[0101] In this embodiment, each node can perform a multiplication calculation of the transpose of the first submatrix and the second submatrix once after each cycle of transmission is completed, or each node can perform multiple matrix transpose multiplication calculations after all nodes have transmitted the second submatrix.

[0102] In one exemplary implementation, each node E p,q Store I×J first submatrices and K×H second submatrices respectively, where the number of columns in the first submatrices is equal to the number of columns in the second submatrices, and J×Q=H×P; each node E p,q Each corresponds to one × K result submatrices.

[0103] In this embodiment, when a node stores multiple first sub-matrices, the multiple first sub-matrices are arranged in an array. When a node stores multiple second sub-matrices, the multiple second sub-matrices are arranged in an array. I and J are integers greater than 1, or one of I and J can be 1 (if both are 1, then the node stores only one first sub-matrice). H and K are integers greater than 1, or one of H and K can be 1 (if both are 1, then the node stores only one second sub-matrice).

[0104] In this embodiment, if the first matrix is ​​divided into R rows and S columns of first submatrices b ij The second matrix is ​​divided into S rows and T columns of second submatrices c. hk If the first and second submatrices are evenly distributed to P×Q nodes, then we have I=R / P, J=S / Q, K=S / P, H=T / Q; if R / P, S / Q, S / P, and T / Q are not integers, they can be rounded up to become I, J, K, and H respectively.

[0105] In this embodiment, the P×Q nodes can send data multiple times in parallel, or different nodes can send data at staggered times; for example, the first row of nodes sends data once, then the second row of nodes sends data once, and after all rows of nodes have sent data, the first row of nodes sends data a second time, then the second row of nodes sends data a second time, and so on. This embodiment does not limit the sending order of the nodes or whether they are sent in parallel, as long as all the second submatrices in each node can be sent to other nodes in the same column.

[0106] In this embodiment, after each second submatrix is ​​sent, the node can perform a multiplication calculation between the transposes of the first and second submatrixes on the submatrixes that can be paired.

[0107] In one exemplary embodiment, P = Q, and the preset first correspondence can be: the calculation result of the first type of submatrix calculated using the second submatrix stored in the Zth row of the column where this node is located corresponds to the Zth column of the row where this node is located; Z = 1, 2, ..., P.

[0108] In other embodiments, P may not be equal to Q. The preset first correspondence can be designed based on the position of the calculation results of different first type sub-matrixes calculated by each node in the first result matrix A. For example, assuming that the calculation result of a first type sub-matrix should appear in the element of the 20th row and 30th column of the first result matrix A according to the calculation rules of linear algebra, and the element of the 20th row and 30th column of the first result matrix A belongs to the result sub-matrix a 56 In the first correspondence, the calculation result of the first type submatrix corresponds to the result submatrix a. 56 The node it is located at.

[0109] The second embodiment of this application provides a data processing architecture, such as Figure 4 As shown, it includes: a node array of P rows and Q columns; when the P×Q nodes in the node array respectively store the third sub-matrix obtained by partitioning the third matrix E[M][L] and the fourth sub-matrix obtained by partitioning the fourth matrix F[M][N];

[0110] Each node is configured to send its stored third submatrix to the other Q-1 nodes in its row. Multiple transposes of these third submatrices are multiplied by the stored fourth submatrix to obtain multiple second-type submatrices. These multiple third submatrices include both the stored and received third submatrices. According to a pre-defined second correspondence, the second-type submatrices corresponding to other nodes in the same column are sent to their respective nodes. The calculated second-type submatrix for this node is then added to the received second-type submatrix results from the other nodes to obtain the second-result submatrix for this node. The second-result submatrices from P×Q nodes form the second-result matrix D, where D = E. T ×F.

[0111] In this embodiment, there are P×Q nodes E p,q The corresponding second submatrix can be directly concatenated according to the position of the corresponding node in the node array (i.e., the row and column number) to obtain the final result of matrix multiplication of the transpose of the third matrix and the fourth matrix; for example, assuming each node E p,q Each corresponds to a second result submatrix d pq Then the second result submatrix d in P×Q nodespq We can concatenate them to obtain D[L][N], that is: D[L][N] can be regarded as a second result submatrix array, where the first row is d 11 d 12 , ..., d 1Q The second line is d 21 d 22 , ..., d 2Q The last line is d P1 d P2 , ..., d PQ And so on. When each node corresponds to multiple second result submatrices, the multiple second result submatrices in the node form a second result subarray. The second result subarrays corresponding to multiple nodes are concatenated according to the position of the corresponding node in the node array to obtain D[L][N].

[0112] In this embodiment, the data processing architecture 20 has P×Q nodes E p,q It can directly connect to other nodes E in the same row and column of the node array. p,q It can also indirectly connect other nodes E in the same row and column of the node array. p,q This allows for the transmission of the third submatrix and the reception of the second type submatrix corresponding to this node; P×Q nodes E p,q It can, but is not limited to, forming a two-dimensional mesh network or a dedicated data link, with each pair of adjacent nodes E p,q They can communicate point-to-point or broadcast by row and column.

[0113] In this embodiment, each node E in the data processing architecture 20 p,qBased on the third and fourth submatrices stored in this node, and the third submatrices received from the other Q-1 nodes in the same row as this node, multiple second-type submatrices are calculated. Specifically, matrix multiplication is performed on the transpose of the third submatrices stored in this node and the fourth submatrices stored in this node to obtain a second-type submatric calculation result. Then, matrix multiplication is performed on the transpose of the third submatrices received from other nodes in the same row and the fourth submatrices stored in this node to obtain multiple second-type submatric calculation results. Of all the obtained second-type submatrix calculation results, at least one is the second-type submatrix calculation result corresponding to this node, and the rest are the second-type submatrix calculation results corresponding to the other Q-1 nodes in the same column as this node. According to the preset second correspondence, the second-type submatrix calculation results corresponding to the other Q-1 nodes in the same column as this node are sent to the corresponding nodes respectively. In addition, this node also receives the second-type submatrix calculation results corresponding to this node sent to this node according to the preset second correspondence from the other P-1 nodes in the same column as this node. This node adds the second-type submatrix calculation result corresponding to this node that it calculates to itself to the second-type submatrix calculation results corresponding to this node that it receives from other nodes to obtain the second result submatrix of this node.

[0114] In this embodiment, the third submatrix derived from the third matrix can be viewed as an array of third submatrixes, and the fourth submatrix derived from the fourth matrix can be viewed as an array of fourth submatrixes. If each node E p,q If only one third submatrix and one fourth submatrix are stored, then the third matrix is ​​divided into P rows and Q columns of third submatrixes, and the fourth matrix is ​​divided into P rows and Q columns of fourth submatrixes; each node E p,q The positions of the stored third submatrix and the stored fourth submatrix within the fourth matrix are identical to the position of the node in the node array. If each node E... p,q It stores multiple third submatrices and multiple fourth submatrices, and any node E p,q The position of the matrix formed by multiple third sub-matrices stored in the array, and the position of the matrix formed by multiple fourth sub-matrices stored in the array, are the same as the position of the node in the node array. Here, position refers to the row and column number of the node in the node array or sub-matrix array.

[0115] In this embodiment, a node E p,qEach node can store one or more third submatrices and one or more fourth submatrices. The size of each third submatrix and each fourth submatrix can be the same. If each node contains only one third submatrix and one fourth submatrix, then the number of rows in the third submatrix is ​​L / P, the number of columns is M / Q, and the number of rows in the second submatrix is ​​L / P, and the number of columns is N / Q.

[0116] In this embodiment, the third submatrix derived from the third matrix can be evenly distributed across P×Q nodes E. p,q In the diagram, the fourth submatrix derived from the fourth matrix can be evenly distributed across P×Q nodes E. p,q In other words, each node has the same number of third submatrices and the same number of fourth submatrices.

[0117] The data processing architecture 20 of this embodiment can divide two large matrices undergoing matrix multiplication into multiple relatively smaller sub-matrices, which are then distributed across multiple nodes for storage and computation. This allows each node to perform only the sub-matrix multiplication and store the corresponding second-type sub-matrix calculation results, significantly reducing costs. This data processing architecture provides a parallel architecture for the storage and arrangement of large-scale matrices, with each node E in the node array... p,q The second result submatrix can be computed in partial or full parallelism. Submatrix transmission between nodes only requires row-level and column-level communication. Each node is responsible for the small matrix computation tasks of the transpose matrices of multiple third submatrices and the fourth submatrix stored on the node. This provides the hardware foundation for converting large-scale matrix multiplication operations into parallel computation of multiple small matrices, significantly reducing the time required for large-scale matrix multiplication operations. In addition, all nodes E in the node array p,q The structure can be identical, and the number of nodes or columns can be increased according to actual needs. It is highly scalable, easy to implement standardized design and integration, and the performance between each node is consistent, which improves the reliability of the data processing architecture. When a single node fails, the faulty node can be replaced. It is easy to maintain, user-friendly and environmentally friendly, and reduces the maintenance cost of the data processing architecture.

[0118] In one exemplary embodiment, each node may include: a computing sub-node and a storage module;

[0119] Computational child nodes can include:

[0120] The processing module is configured to read the third and fourth sub-matrices stored in the current node and the received third sub-matrices from the storage module; multiply the transposes of the read third sub-matrices with the fourth sub-matrices stored in the current node to obtain multiple second-type sub-matrices calculation results, and save them to the storage module; read the second-type sub-matrices calculation results corresponding to the current node from the storage module, sum them to obtain the second result sub-matrices corresponding to the current node, and save them to the storage module.

[0121] The communication module is configured to send the third submatrix saved by the current node, which is read by the processing module, to the other Q-1 nodes in the same row as the current node, and to receive the third submatrix from the other Q-1 nodes in the same row as the current node and save it to the storage module; according to the preset second correspondence, the module sends the calculation results of the second type submatrix corresponding to the other Q-1 nodes in the same column as the current node to the corresponding nodes, and receives the calculation results of the second type submatrix corresponding to the current node from the other P-1 nodes in the same column as the current node and save them to the storage module.

[0122] In this embodiment, the calculation result of the second type submatrix corresponding to this node includes the calculation result of the second type submatrix corresponding to this node in the preset second correspondence relationship, as well as the calculation result of the second type submatrix received from the other Q-1 nodes in the row where this node is located.

[0123] In this embodiment, the received third submatrix is ​​received from the other Q-1 nodes in the same row as this node.

[0124] In this embodiment, the storage module can be configured to store the third and fourth sub-matrices saved by this node, the received third sub-matrices, the calculation results of the second type sub-matrices calculated by this node (including the calculation results of the second type sub-matrices corresponding to the other Q-1 nodes in the column where this node is located, and the calculation results of the second type sub-matrices corresponding to this node), the calculation results of the second type sub-matrices received from the other Q-1 nodes in the column where this node is located, and the second result sub-matrices corresponding to this node.

[0125] In one exemplary embodiment of this invention, the data processing architecture is as follows: Figure 2 As shown.

[0126] In one exemplary embodiment, the storage module may include: a temporary storage module disposed in the computing sub-node; or it may include: a temporary storage module disposed in the computing sub-node, and a memory sub-node connected to the computing sub-node;

[0127] The memory child node can be configured to store the third sub-matrix stored in this node, the fourth sub-matrix stored in this node, and the second result sub-matrix corresponding to this node;

[0128] The temporary storage module can be configured to store the third sub-matrix stored in this node, the fourth sub-matrix stored in this node, the third sub-matrix received from the other Q-1 nodes in the row of this node, the calculation results of the second type sub-matrix corresponding to the other Q-1 nodes in the column of this node, the calculation results of the second type sub-matrix corresponding to this node, and the second result sub-matrix corresponding to this node, which are read from the memory child node by the temporary storage module.

[0129] The processing module can also be configured to save the second result submatrix temporarily stored in the temporary storage module to a memory subnode.

[0130] In this embodiment, when the storage module only includes a temporary storage module, the temporary storage module can be configured to store the third and fourth sub-matrices saved by this node, the received third sub-matrices, the calculation results of the second type sub-matrices calculated by this node (including the calculation results of the second type sub-matrices corresponding to the other Q-1 nodes in the column where this node is located, and the calculation results of the second type sub-matrices corresponding to this node), the calculation results of the second type sub-matrices received from the other Q-1 nodes in the column where this node is located, and the second result sub-matrices corresponding to this node.

[0131] In this embodiment, when the storage module includes a temporary storage module and a memory sub-node, one implementation method is as follows: Figure 3 Each node 10 may include: a computational sub-node 30, and a memory sub-node 40 connected to the computational sub-node 30;

[0132] Memory child node 40 is configured to store the third submatrix, the fourth submatrix, and the second result submatrix corresponding to this node;

[0133] Calculating child node 30 includes:

[0134] Temporary storage module 31;

[0135] Processing module 32 is configured to read the third and fourth sub-matrices stored in the current node from memory sub-node 40 and temporarily store them in temporary storage module 31; calculate multiple second-type sub-matrices based on the third and fourth sub-matrices temporarily stored in temporary storage module 31 and temporarily store them in temporary storage module 31; sum the second-type sub-matrices calculation results corresponding to the current node temporarily stored in temporary storage module 31 (the second-type sub-matrices calculation results corresponding to the current node include: the second-type sub-matrices calculation results corresponding to the current node among the multiple second-type sub-matrices calculation results calculated by processing module 32 of the current node, and the second-type sub-matrices calculation results corresponding to the current node received from the other P-1 nodes in the column where the current node is located) to obtain the second result sub-matrix corresponding to the current node and save it to memory sub-node 30;

[0136] The communication module includes a column data communication module 33 and a row data communication module 34, wherein:

[0137] The column data communication module 33 is configured to, according to the preset second correspondence, send the calculation results of the second type submatrix corresponding to the other Q-1 nodes in the column where the current node is located in the temporary storage module 31 to the corresponding nodes respectively; and receive the calculation results of the second type submatrix corresponding to the current node from the other P-1 nodes in the column where the current node is located, and save them to the temporary storage module 31.

[0138] The row data communication module 34 is configured to send the third sub-matrix saved by the current node, which is read by the processing module 32, to the other Q-1 nodes in the row where the current node is located, and receive the third sub-matrix from the other Q-1 nodes in the row where the current node is located and save it to the temporary storage module 31.

[0139] In this embodiment, the third submatrix to be calculated by the processing module 32 is temporarily stored in the temporary storage module 31. The third submatrix to be calculated includes two cases: one is the third submatrix stored in the memory child node of the local node and to be sent out; the other is the third submatrix received from other nodes. The processing module 32 can use some or all of the submatrixes in the temporary storage module 31 during calculation. Which submatrixes to use can be selected by instructing the processing module 32 through programming or other means. A submatrix can be uniquely identified by its name (e.g., e, or f) and coordinates (represented in this document as the subscript of e or f).

[0140] In this embodiment, P×Q computational sub-nodes 30 and P×Q memory sub-nodes 40 are connected one-to-one to form a parallel memory access architecture. That is, each computational sub-node 30 has dedicated memory access bandwidth when reading the third and fourth sub-matrices from the memory sub-node 40 and when writing the result sub-matrices to the memory sub-node 40. Therefore, the computational sub-nodes in the entire node array can read and write to the memory sub-nodes in parallel. After reading the sub-matrices in parallel, the sub-matrices can be sent in parallel, which greatly improves the efficiency of memory access and the efficiency of transmitting sub-matrices, and reduces the need for large-capacity memory and reduces hardware costs.

[0141] Other implementation details of this embodiment can be found in the first embodiment. Figure 3 The corresponding implementation method.

[0142] In one exemplary embodiment, the node E p,q Sending the third submatrix stored in this node to the other Q-1 nodes in the same row as this node can include: the node E p,q Broadcast the third submatrix stored in this node to the other Q-1 nodes E in the same row as this node. p,q .

[0143] In this embodiment, multiple data packets can be sent, that is, each node sends Q-1 data packets to send the third submatrix stored by this node to the other Q-1 nodes in the same row; or the third submatrix can be forwarded row by row node by node.

[0144] This application does not limit the form in which the third submatrix is ​​sent, as long as the third submatrix can be sent to other nodes in the same row.

[0145] In one exemplary embodiment, nodes in different columns can send the third submatrix at different time periods, while nodes in the same column can send the third submatrix in parallel; or, P×Q nodes can send the third submatrix in parallel.

[0146] In this embodiment, the Q-column nodes can be divided into Q periods to send the third sub-matrix column by column. For example, in the first period, the first column node sends the stored third sub-matrix, in the second period, the second column node sends the stored third sub-matrix, and so on; or, the Q-column nodes can be divided into multiple periods to send the second sub-matrix, and in each period, two or more column nodes send the stored third sub-matrix in parallel.

[0147] In this embodiment, regardless of the method used for transmission, each node will eventually send the stored third submatrix to every other node in the same row, and will also receive the third submatrix sent by every other node in the same row.

[0148] In one embodiment of this example, when nodes in different columns send third submatrices at different time periods, the transposes of multiple third submatrices are multiplied by the fourth submatrices stored in the current node to obtain multiple second-type submatric calculation results. Based on a preset second correspondence, the second-type submatric calculation results corresponding to other nodes in the same column are sent to their respective nodes. This may include:

[0149] In each time period, the following operations are performed: the transpose of the third submatrix transmitted in the current time period is multiplied by the fourth submatrix stored in this node to obtain the calculation result of the second type of submatrix in the current time period; when it is determined, according to the preset second correspondence, that the node corresponding to the calculation result of the second type of submatrix obtained in the current time period is another node in the column where this node is located, the calculation result of the second type of submatrix is ​​sent to the corresponding node; wherein, the third submatrix transmitted in the current time period is the third submatrix sent or received by this node in the current time period.

[0150] In this embodiment, the calculation and transmission of the second type of submatrix calculation results can be performed in cycles; for example, if the Q-column nodes are divided into Q cycles to transmit the third submatrix row by row, then each node performs at least one multiplication calculation in each cycle between the transpose of the third submatrix transmitted in this cycle (either stored and sent to other nodes by this node, or received from other nodes) and the fourth submatrix stored by this node; the second type of submatrix calculation results obtained in each cycle will remain at this node according to the second correspondence, or will be sent to the corresponding node in this cycle. In other embodiments, the second type of submatrix calculation results obtained in multiple cycles can be sent to the corresponding nodes in parallel.

[0151] In another embodiment of this example, when the P×Q nodes send the third submatrix in parallel, the transpose of the multiple third submatrixes is multiplied by the fourth submatrix stored in the current node to obtain multiple second-type submatrix calculation results. According to a preset second correspondence, the second-type submatrix calculation results corresponding to other nodes in the column where the current node is located are sent to their respective nodes, including:

[0152] The transpose of the received third submatrix and the transpose of the third submatrix stored in this node are multiplied with the fourth submatrix stored in this node to obtain multiple calculation results of the second type of submatrix. According to the preset second correspondence, the calculation results of the second type of submatrix corresponding to other nodes in the column where this node is located are sent to the corresponding nodes in parallel.

[0153] In this embodiment, each node will calculate multiple second-type submatrix calculation results at once. Except for the second-type submatrix calculation result corresponding to this node, which is retained in this node, the other second-type submatrix calculation results can be sent to multiple other nodes in parallel.

[0154] In one exemplary embodiment, the third matrix can be divided into R' rows and S' columns of third submatrices e. i’j’ The fourth matrix can be divided into S' rows and T' columns of fourth submatrices f. h’k’ ; i' represents the third submatrix e i’j’ The row number in the third matrix, j', indicates the third submatrix e. i’j’ The column number in the third matrix; h' represents the fourth submatrix f. h’k’ The row number in the fourth matrix, k' represents the fourth submatrix f. h’k’ The column index in the fourth matrix; i' = 1, 2, ..., R', j' = 1, 2, ..., S', h' = 1, 2, ..., S', k' = 1, 2, ..., T';

[0155] Multiplying the first submatrix stored in this node with the transposes of multiple second submatrices can include: the node selecting a third submatrix e from among the stored fourth submatrix and multiple third submatrices where i' and h' are equal. i’j’ The transpose of the matrix and a fourth submatrix f h’k’ As a pair of sub-matrices; wherein, multiple third sub-matrices include the third sub-matrices stored in this node and the received third sub-matrices; matrix multiplication is performed on the transpose of the third sub-matrices and the fourth sub-matrices in each pair of sub-matrices.

[0156] In this embodiment, in a pair of submatrices, the number of rows in the third submatrix is ​​equal to the number of rows in the fourth submatrix.

[0157] In one exemplary embodiment of this example, R' = S' = T' = P = Q, the node array is a square matrix, the total number of the third submatrix and the total number of the fourth submatrix are equal to the total number of nodes, and each node stores a third submatrix and a fourth submatrix; the position or two-dimensional coordinates of the submatrix in the matrix are the same as the position or two-dimensional coordinates of the node in the node array.

[0158] In this embodiment, the node array is a square node array, with Figure 5 Taking the 4×4 node matrix with P=Q=4 as an example, the third submatrix e is divided into 4 periods. i’j’ The transmission; the following uses several nodes in this 4×4 node matrix as examples to introduce the transmission of the submatrix, for example, node E. 1,1In the first cycle, store the third submatrix e at this node. 11 Send to node E respectively 1,2 E 2,3 E 1,4 Node E 2,3 In the second cycle, the third submatrix e stored at this node will be... 23 Send to node E respectively 2,1 E 2,2 E 2,4 The same logic applies to other nodes, and will not be elaborated here.

[0159] In this embodiment, each node can perform a multiplication calculation of the third and fourth submatrix once after each cycle of transmission is completed, or each node can perform multiple matrix multiplication calculations after all nodes have transmitted the third submatrix.

[0160] In one exemplary implementation, each node E p,q Store J'×I' third submatrices and H'×K' fourth submatrices respectively, wherein the number of rows in the third submatrices is equal to the number of rows in the fourth submatrices, and J'×Q=H'×P; each node E p,q Each corresponds to one × K' result submatrices.

[0161] In this embodiment, when a node stores multiple third sub-matrices, the multiple third sub-matrices are arranged in an array. When a node stores multiple third sub-matrices, the multiple third sub-matrices are arranged in an array. I' and J' are integers greater than 1, or one of I' and J' can be 1 (if both are 1, then the node stores only one third sub-matrice). H' and K' are integers greater than 1, or one of H' and K' can be 1 (if both are 1, then the node stores only one fourth sub-matrice).

[0162] In this embodiment, if the first matrix is ​​divided into R' rows and S' columns of third submatrices e i’j’ The fourth matrix is ​​divided into S' rows and T' columns of fourth submatrices f. h’k’ If the third and fourth submatrices are evenly distributed to P×Q nodes, then J'=R' / P, I'=S' / Q, H'=S' / P, K'=T' / Q; if R' / P, S' / Q, S' / P, and T' / Q are not integers, then they can be rounded up to J', I', H', and K' respectively.

[0163] In this embodiment, the P×Q nodes can send data multiple times in parallel, or different nodes can send data at staggered times; for example, the first column of nodes sends data once, then the second column of nodes sends data once, and after all columns of nodes have sent data, the first column of nodes sends data a second time, then the second column of nodes sends data a second time, and so on. This embodiment does not limit the sending order of the nodes or whether they send data in parallel, as long as all third submatrices in each node can be sent to other nodes in the same row.

[0164] In this embodiment, after each transmission of the third submatrix, the node can perform a multiplication calculation between the transpose of the third submatrix and the fourth submatrix on the submatrix that can be paired.

[0165] In one exemplary embodiment, P = Q, and the preset second correspondence is: the calculation result of the second type of submatrix calculated using the third submatrix stored in the Zth column of the row where this node is located corresponds to the node in the Zth row of the column where this node is located; Z = 1, 2, ..., P.

[0166] In other embodiments, P may not be equal to Q. The preset second correspondence can be designed based on the position of the calculation results of different second-type submatrices calculated by each node in the second result matrix D. For example, assuming that the calculation result of a second-type submatrix should appear in the element of the 20th row and 30th column of the second result matrix D according to the calculation rules of linear algebra, and the element of the 20th row and 30th column of the second result matrix D belongs to the result submatrix d 56 In the first correspondence, the calculation result of the first type submatrix corresponds to the result submatrix d. 56 The node it is located at.

[0167] The third embodiment of this application provides a matrix multiplication calculation method, implemented based on the data processing architecture provided in the first embodiment above, such as... Figure 6 As shown, it includes:

[0168] S100, Each node sends the second submatrix stored in this node to the other P-1 nodes in the column where this node is located;

[0169] S101. Each node performs multiplication calculations using the first submatrix stored in this node and the transpose of multiple second submatrixes respectively, to obtain multiple first-type submatrix calculation results, wherein the multiple second submatrixes include the second submatrix stored in this node and the received second submatrix.

[0170] S102. Each node retains the calculation result of the first type submatrix corresponding to its own node according to the preset first correspondence relationship, sends the calculation results of the first type submatrix corresponding to other nodes in the row where the node is located to the corresponding nodes respectively, and adds the calculation results of the first type submatrix corresponding to the node to obtain the first result submatrix of the node.

[0171] In the data processing architecture, the first result submatrices of P×Q nodes constitute the first result matrix A, where A = B×C. T The first submatrix stored by P×Q nodes forms the first matrix B, and the second submatrix stored by P×Q nodes forms the second matrix C.

[0172] In this embodiment, P×Q nodes can perform step S100 multiple times; a node can perform step S100 once or multiple times.

[0173] In this embodiment, each node E p,q It will receive the second submatrix sent by the other P-1 nodes in the same column as this node, and will also receive the calculation results of the first type submatrix sent by the other Q-1 nodes in the same row as this node.

[0174] The matrix multiplication calculation method in this embodiment divides the multiplication calculation of large matrices into multiple parallel small matrix multiplication calculations, which greatly improves the calculation efficiency of large matrix multiplication, saves calculation time, and provides a foundation for accurate matrix multiplication calculation.

[0175] The nodes E in different rows p,q The second sub-matrix is ​​sent at different time intervals, and the nodes E in the same row are... p,q In parallel, the second submatrix stored at this node is sent to the other P-1 nodes in the same column; or, each node E p,q The second submatrix stored in this node is sent in parallel to the other P-1 nodes in the same column.

[0176] In other embodiments, the second sub-matrix can be sent sequentially by P×Q nodes, or the sending batches can be divided without following the row and column method.

[0177] In one exemplary embodiment, step S100 performed by each node may include:

[0178] Broadcast the second submatrix stored in this node to the other P-1 nodes in the same column as this node.

[0179] In this embodiment, each second submatrix is ​​broadcast to each other only between nodes in the same column.

[0180] In other embodiments, other transmission methods, not limited to broadcasting, can be used to send the second submatrix to other nodes in the same column.

[0181] In one exemplary embodiment, the first matrix is ​​divided into R rows and S columns of first submatrices b. ij The second matrix is ​​divided into S rows and T columns of second submatrices c. hk ; i represents the first submatrix b ij The row number j in the first matrix represents the first submatrix b. ij The index of the column in the first matrix; h represents the second submatrix c. hk The row number k in the second matrix represents the second submatrix c. hk The column numbers in the second matrix; i = 1, 2, ..., R, j = 1, 2, ..., S, h = 1, 2, ..., S, k = 1, 2, ..., T.

[0182] Step S101 may include: the node selecting a first submatrix b in the stored first submatrix and multiple second submatrixes where j and k are equal. ij and a second submatrix c hk The transpose of the matrix is ​​used as a pair of submatrices, wherein the plurality of second submatrices include the second submatrices stored in this node and the received second submatrices; matrix multiplication is performed on the transpose of the first and second submatrices in each pair of submatrices.

[0183] In one exemplary embodiment, P = Q; the preset first correspondence is: the calculation result of the first type of submatrix calculated using the second submatrix stored in the Zth row of the column where this node is located corresponds to the node in the Zth column of the row where this node is located; Z = 1, 2, ..., P.

[0184] The fourth embodiment of this application provides a matrix multiplication calculation method, such as... Figure 7 As shown, the data processing architecture implementation based on the second embodiment described above includes:

[0185] S200, Each node sends the third submatrix stored in this node to the other Q-1 nodes in the same row as this node;

[0186] S201. Each node performs multiplication calculations by multiplying the transpose of multiple third submatrices with the fourth submatrices stored in the node to obtain multiple second-type submatrices. The multiple third submatrices include the third submatrices stored in the node and the received third submatrices.

[0187] S202. Each node retains the calculation result of the second type submatrix corresponding to its own node according to the preset second correspondence relationship, sends the calculation results of the second type submatrix corresponding to other nodes in the column where the node is located to the corresponding nodes respectively, and adds the calculation results of the second type submatrix corresponding to the node to obtain the second result submatrix of the node.

[0188] In the data processing architecture, the second result submatrices of P×Q nodes form the transpose of the third matrix X, and the second result matrix D is formed by matrix multiplication of the fourth matrix dY, where D = E. T The third submatrix stored by P×F nodes forms the third matrix E, and the fourth submatrix stored by P×Q nodes forms the fourth matrix F.

[0189] In this embodiment, P×Q nodes can perform step S200 multiple times; a node can perform step S200 once or multiple times.

[0190] In this embodiment, each node E p,q It will receive the third submatrix sent by the other Q-1 nodes in the same row as this node, and will also receive the calculation results of the second type submatrix sent by the other P-1 nodes in the same column as this node.

[0191] The matrix multiplication calculation method in this embodiment divides the multiplication calculation of large matrices into multiple parallel small matrix multiplication calculations, which greatly improves the calculation efficiency of large matrix multiplication, saves calculation time, and provides a foundation for accurate matrix multiplication calculation.

[0192] The nodes E in different columns p,q The third sub-matrix is ​​sent at different time intervals, and the nodes E in the same column are sent respectively. p,q The third submatrix stored in this node is sent in parallel to the other Q-1 nodes in the same row;

[0193] Or, each node E p,q The third submatrix stored in this node is sent in parallel to the other Q-1 nodes in the same row.

[0194] In other embodiments, the third submatrix can be sent sequentially by P×Q nodes, or the sending batches can be divided without following the row and column method.

[0195] In one exemplary embodiment, S200 executed by each node may include:

[0196] Broadcast the third submatrix stored in this node to the other Q-1 nodes in the same row as this node.

[0197] In this embodiment, each third submatrix is ​​broadcast to each other only among nodes in the same row.

[0198] In other embodiments, other transmission methods, not limited to broadcasting, can be used to send the third submatrix to other nodes in the same row.

[0199] In one exemplary embodiment, the third matrix is ​​divided into R' rows and S' columns of third submatrices e. i’j’ The fourth matrix is ​​divided into S' rows and T' columns of fourth submatrices f. h’k’ ; i' represents the third submatrix e i’j’ The row number j' in the third matrix represents the third submatrix e. i’j’ The column number in the third matrix; h' represents the fourth submatrix f. h’k’ The row number in the fourth matrix, k' represents the fourth submatrix f. h’k’ The column numbers in the fourth matrix; i' = 1, 2, ..., R', j' = 1, 2, ..., S', h' = 1, 2, ..., S', k' = 1, 2, ..., T';

[0200] Step S201 may include: the node selecting a third submatrix e from the stored fourth submatrix and multiple third submatrixes where i' and h' are equal. i’j’ The transpose of the matrix and a fourth submatrix f h’k’ As a pair of sub-matrices; wherein, the plurality of third sub-matrices include the third sub-matrices stored in this node and the received third sub-matrices; matrix multiplication is performed on the transpose of the third sub-matrices and the fourth sub-matrices in each pair of sub-matrices.

[0201] In one exemplary embodiment, P = Q; the preset second correspondence is: the calculation result of the second type of submatrix calculated using the third submatrix stored in the Zth column of the row where this node is located corresponds to the node in the Zth row of the column where this node is located; Z = 1, 2, ..., P.

[0202] The fifth embodiment of this application provides a neural network inversion method, including:

[0203] When calculating the input matrix X of the current layer, each layer in the neural network model performs the following steps:

[0204] Using the gradient matrix dY of the current layer's output matrix as the first matrix B, and the weight matrix W of the current layer as the second matrix C, the first result matrix A = B × C is obtained according to the matrix multiplication calculation method of the third embodiment. T Wherein, the first result matrix A is used as the gradient matrix dX of the input matrix X of the current layer;

[0205] Calculate the input matrix X of the current layer based on dX. * ;

[0206] When calculating the weight matrix W of the current layer, each layer in the neural network model performs the following steps:

[0207] Using the input matrix X of the current layer as the third matrix E, and the gradient matrix dY of the output matrix of the current layer as the fourth matrix F, the second result matrix D = E is obtained according to the matrix multiplication calculation method of the fourth embodiment. T ×F; where the second result matrix D is used as the gradient matrix dW of the current layer's weight matrix W;

[0208] Calculate the weight matrix W of the current layer based on dW.

[0209] In this embodiment, the neural network model can be a multi-layer deep learning model, such as the Transformer model, Linear-Time Sequence Modeling with Selective State Space, TTT (Test-Time Training), LSTM (Long Short-Term Memory), VGGNet (Deep Convolutional Neural Network), or any other large model structure or deep learning model. The above deep learning models are all illustrative examples and are not intended to limit this application. They will not be described in detail here.

[0210] The sixth embodiment of this application provides a chip, including:

[0211] The data processing architecture of the first embodiment or the second embodiment.

[0212] In this embodiment, the same set of hardware plus different code can be used to implement the data processing architecture of the first embodiment and the second embodiment respectively. For example, when the first set of code is loaded into the chip, the data processing architecture of the first embodiment is implemented, and when the second set of code is loaded, the data processing architecture of the second embodiment is implemented. The chip can store the first set of code and the second set of code. When X needs to be calculated, the first set of code is loaded, and when W needs to be calculated, the second set of code is loaded.

[0213] The seventh embodiment of this application provides a chip, including: a memory die, including P×Q memory sub-nodes; a logic die, including P×Q computing sub-nodes, corresponding one-to-one with the P×Q memory sub-nodes; the memory die and the logic die are stacked and bonded or circuit-connected.

[0214] The implementation methods of computed child nodes and memory child nodes can be found in the relevant content of the first embodiment or the second embodiment.

[0215] In one exemplary embodiment, P×Q memory sub-nodes can respectively store the first sub-matrix obtained by partitioning the first matrix B, the second sub-matrix obtained by partitioning the second matrix C, and the first result sub-matrix obtained by the corresponding computation sub-nodes;

[0216] Each computational sub-node can be configured to read the second sub-matrix from its corresponding memory sub-node and send it to the other P-1 computational sub-nodes in the same column. It can also read the first sub-matrix from its corresponding memory sub-node and multiply it by the transposes of multiple second sub-matrixes to obtain multiple first-type sub-matrix calculation results. These multiple second sub-matrixes include the second sub-matrix stored in the corresponding memory sub-node and the received second sub-matrix. According to a preset first correspondence, the calculation results of the first-type sub-matrix corresponding to other computational sub-nodes in the same row are sent to their respective computational sub-nodes. The first-type sub-matrix calculation result corresponding to this computational sub-node is added to the received first-type sub-matrix to obtain the first result sub-matrix of this computational sub-node, and then stored in the corresponding memory sub-node. The result sub-matrixes stored in P×Q memory sub-nodes form the first result matrix A, where A = B×C. T .

[0217] In one exemplary embodiment, P×Q memory sub-nodes can respectively store the third sub-matrix obtained by partitioning the third matrix E, the fourth sub-matrix obtained by partitioning the fourth matrix F, and the second result sub-matrix obtained by the corresponding computation sub-nodes;

[0218] Each computational sub-node can be configured to read the third sub-matrix from its corresponding memory sub-node and send it to the other Q-1 computational sub-nodes in the same row. It can also read the fourth sub-matrix from its corresponding fourth memory sub-node and multiply it with the transposes of multiple third sub-matrices to obtain multiple second-type sub-matrix calculation results. These multiple third sub-matrices include the third sub-matrix stored in the corresponding memory sub-node and the received third sub-matrix. According to a preset second correspondence, the calculation results of the second-type sub-matrix corresponding to other computational sub-nodes in the same column are sent to their respective computational sub-nodes. The calculated second-type sub-matrix result of this computational sub-node is added to the received second-type sub-matrix to obtain the second result sub-matrix of this node, and then stored in the corresponding memory sub-node. The result sub-matrices stored in P×Q memory sub-nodes form the second result matrix D, where D = E. T ×F.

[0219] In one exemplary implementation of this embodiment, such as Figure 8 and Figure 9 As shown, the memory sub-nodes in the storage die 60 and the computing sub-nodes in the logic die 50 can be connected one-to-one in a vertical connection manner. This reduces the size of the data processing architecture, optimizes space, reduces wiring complexity, reduces electromagnetic interference between different nodes, facilitates maintenance and expansion upgrades, and makes it easy to achieve standardized design.

[0220] In other implementations, memory sub-nodes and compute sub-nodes can be located on the same plane and connected by circuitry; storage dies and logic dies can be physically integrated into a single die, for example, using ReRaam technology to directly integrate P×Q memory sub-nodes into P×Q compute sub-nodes in a one-to-one correspondence.

[0221] The above embodiments are illustrated below with four examples.

[0222] Example 1

[0223] Example 1 calculates A[M][L] = B[M][N] × (C[L][N]). T In Example 1, the first matrix B is divided into P × Q first submatrices b. pq The second matrix C is divided into P×Q second submatrices c. pq Each node stores its own first submatrix b. pq and a second submatrix c pq .

[0224] like Figure 4 As shown, in Example 1, the node array is a square matrix of nodes with P = Q = 4, and each node stores a first submatrix b. pq and a second submatrix c pq , corresponding to a first result submatrix a pq 4×4 first result submatrices a pq This forms the first result matrix A. In Example 1, the first correspondence is: the result of calculating the first type submatrix based on the second submatrix in the Zth row of this column corresponds to the node in the Zth column of this row. In Example 1, the result of calculating the first type submatrix is ​​the first submatrix b. pq Second submatrix c pq The result obtained by matrix multiplication of the transpose of the matrix.

[0225] In the first implementation of Example 1, the second submatrix c is sent by 4×4 nodes in 4 cycles. pq :

[0226] First cycle: The first row node sends the second submatrix stored in this node to the nodes in the same column, i.e., node E.1,1 The second submatrix c saved at this node 11 Send to E respectively 2,1 E 3,1 and E 4,1 Node E 1,2 The second submatrix c saved at this node 12 Send to E respectively 2,2 E 3,2 and E 4,2 Node E 1,3 The second submatrix c saved at this node 13 Send to E respectively 2,3 E 3,3 and E 4,3 Node E 1,4 The second submatrix c saved at this node 14 Send to E respectively 2,4 E 3,4 and E 4,4 ;

[0227] The second cycle: The node in the second row sends the second submatrix stored in this node to the nodes in the same column, i.e., node E. 2,1 The second submatrix c saved at this node 21 Send to E respectively 1,1 E 3,1 and E 4,1 Node E 2,2 The second submatrix c saved at this node 22 Send to E respectively 1,2 E 3,2 and E 4,2 Node E 2,3 The second submatrix c saved at this node 23 Send to E respectively 1,3 E 3,3 and E 4,3 Node E 2,4 The second submatrix c saved at this node 24 Send to E respectively 1,4 E 3,4 and E 4,4 .

[0228] The third cycle: The node in the third row sends the second submatrix stored in this node to the nodes in the same column, i.e., node E. 3,1 The second submatrix c saved at this node 31 Send to E respectively 1,1 E 2,1 and E 4,1 Node E 3,2 The second submatrix c saved at this node 32 Send to E respectively 1,2E 2,2 and E 4,2 Node E 3,3 The second submatrix c saved at this node 33 Send to E respectively 1,3 E 2,3 and E 4,3 Node E 3,4 The second submatrix c saved at this node 34 Send to E respectively 1,4 E 2,4 and E 4,4 .

[0229] Fourth cycle: The fourth row node sends the second submatrix stored in this node to the nodes in the same column, i.e., node E. 4,1 The second submatrix c saved at this node 41 Send to E respectively 1,1 E 2,1 and E 3,1 Node E 4,2 The second submatrix c saved at this node 42 Send to E respectively 1,2 E 2,2 and E 3,2 Node E 4,3 The second submatrix c saved at this node 43 Send to E respectively 1,3 E 2,3 and E 3,3 Node E 4,4 The second submatrix c saved at this node 44 Send to E respectively 1,4 E 2,4 and E 3,4 .

[0230] In the first implementation of Example 1, after each cycle of transmission (i.e., after the corresponding node has sent the second submatrix and received it from nodes in other rows of the same column), corresponding processing can be performed, including matrix transpose calculation and matrix multiplication calculation. After completing the matrix transpose calculation and matrix multiplication, according to the first correspondence, the calculation result of the first type submatrix corresponding to this node is retained in this node for summation calculation, and the calculation results of the first type submatrix corresponding to other nodes are sent to the corresponding nodes for summation calculation. This process is performed by each node in 4 cycles, including:

[0231] Processing of the first cycle: This process occurs after the first cycle is sent, at node E. 1,1 Calculate b 11 ×c 11 T Node E 1,2 Calculate b12 ×c 12 T Node E 1,3 Calculate b 13 ×c 13 T Node E 1,4 Calculate b 14 ×c 14 T Node E 2,1 Calculate b 21 ×c 11 T Node E 2,2 Calculate b 22 ×c 12 T Node E 2,3 Calculate b 23 ×c 13 T Node E 2,4 Calculate b 24 ×c 14 T Node E 3,1 Calculate b 31 ×c 11 T Node E 3,2 Calculate b 32 ×c 12 T Node E 3,3 Calculate b 33 ×c 13 T Node E 3,4 Calculate b 34 ×c 14 T Node E 4,1 Calculate b 41 ×c 11 T Node E 4,2 Calculate b 42 ×c 12 T Node E 4,3 Calculate b 43 ×c 13 T Node E 4,4 Calculate b 44 ×c 14 T ;

[0232] Node E 1,2 b 12 ×c 12 T The calculation results are sent to node E. 1,1Node E 1,3 db 13 ×c 13 T The calculation results are sent to node E. 1,1 Node E 1,4 b 14 ×c 14 T The calculation results are sent to node E. 1,1 Node E 1,1 The calculated b 11 ×c 11 T The calculation results and node E 1,2 E 1,3 E 1,4 The sent calculation results are summed to obtain a. 11 Stored in node E 1,1 middle;

[0233] Node E 2,2 b 22 ×c 12 T The calculation results are sent to node E. 2,1 Node E 2,3 b 23 ×c 13 T The calculation results are sent to node E. 2,1 Node E 2,4 b 24 ×c 14 T The calculation results are sent to node E. 2,1 Node E 2,1 The calculated b 21 ×c 11 T The calculation results and node E 2,2 E 2,3 E 2,4 The sent calculation results are summed to obtain a. 21 Stored in node E 2,1 middle;

[0234] Node E 3,2 b 32 ×c 12 T The calculation results are sent to node E. 3,1 Node E 3,3 by 33 ×c 13 T The calculation results are sent to node E. 3,1 Node E 3,4 b34 ×c 14 T The calculation results are sent to node E. 3,1 Node E 3,1 The calculated b 31 ×c 11 T The calculation results and node E 3,2 E 3,3 E 3,4 The sent calculation results are summed to obtain a. 31 Stored in node E 3,1 middle;

[0235] Node E 4,2 b 42 ×c 12 T The calculation results are sent to node E. 4,1 Node E 4,3 b 43 ×c 13 T The calculation results are sent to node E. 4,1 Node E 4,4 b 44 ×c 14 T The calculation results are sent to node E. 4,1 Node E 4,1 The calculated b 41 ×c 11 T The calculation results and node E 4,2 E 4,3 E 4,4 The sent calculation results are summed to obtain a. 41 Stored in node E 4,1 middle.

[0236] Therefore, after this cycle of processing, the first column of the node matrix, node E... 1,1 E 2,1 E 3,1 E 4,1 The corresponding calculation results were obtained for all of them, namely a 11 a 21 a 31 a 41 .

[0237] Processing of the second cycle: This process takes place after the second cycle is sent, at node E. 1,1 Calculate b 11 ×c 21 T Node E 1,2 Calculate b 12 ×c22 T Node E 1,3 Calculate b 13 ×c 23 T Node E 1,4 Calculate b 14 ×c 24 T Node E 2,1 Calculate b 21 ×c 21 T Node E 2,2 Calculate b 22 ×c 22 T Node E 2,3 Calculate b 23 ×c 23 T Node E 2,4 Calculate b 24 ×c 24 T Node E 3,1 Calculate b 31 ×c 21 T Node E 3,2 Calculate b 32 ×c 22 T Node E 3,3 Calculate b 33 ×c 23 T Node E 3,4 Calculate b 34 ×c 24 T Node E 4,1 Calculate b 41 ×c 21 T Node E 4,2 Calculate b 42 ×c 22 T Node E 4,3 Calculate b 43 ×c 23 T Node E 4,4 Calculate b 44 ×c 24 T ;

[0238] Node E 1,1 b 11 ×c 21 T The calculation results are sent to node E. 1,2 Node E1,3 b 13 ×c 23 T The calculation results are sent to node E. 1,2 Node E 1,4 b 14 ×c 24 T The calculation results are sent to node E. 1,2 Node E 1,2 The calculated b 12 ×c 22 T The calculation results and node E 1,1 E 1,3 E 1,4 The sent calculation results are summed to obtain a. 12 Stored in node E 1,2 middle;

[0239] Node E 2,1 b 21 ×c 21 T The calculation results are sent to node E. 2,2 Node E 2,3 b 23 ×c 23 T The calculation results are sent to node E. 2,2 Node E 2,4 b 24 ×c 24 T The calculation results are sent to node E. 2,2 Node E 2,2 The calculated b 22 ×c 22 T The calculation results and node E 2,1 E 2,3 E 2,4 The sent calculation results are summed to obtain a. 22 Stored in node E 2,2 middle;

[0240] Node E 3,1 b 31 ×c 21 T The calculation results are sent to node E. 3,2 Node E 3,3 b 33 ×c 23 T The calculation results are sent to node E. 3,2 Node E 3,4 b 34×c 24 T The calculation results are sent to node E. 3,2 Node E 3,2 The calculated b 32 ×c 22 T The calculation results and node E 3,1 E 3,3 E 2,4 The sent calculation results are summed to obtain a. 32 Stored in node E 3,2 middle;

[0241] Node E 4,1 b 41 ×c 21 T The calculation results are sent to node E. 4,2 Node E 4,3 b 43 ×c 23 T The calculation results are sent to node E. 4,2 Node E 4,4 b 44 ×c 24 T The calculation results are sent to node E. 4,2 Node E 4,2 The calculated b 42 ×c 22 T The calculation results and node E 4,1 E 4,3 E 4,4 The sent calculation results are summed to obtain a. 42 Stored in node E 4,2 middle.

[0242] Therefore, after this cycle of processing, the second column of the node matrix, node E... 1,2 E 2,2 E 3,2 E 4,2 The corresponding calculation results were obtained for all of them, namely a 12 a 22 a 32 a 42 .

[0243] The processing for the third cycle: This occurs after the third cycle has been sent, and can be deduced similarly to the first and second cycles. After this cycle's processing, node E in the third column of the node matrix... 1,3 E 2,3 E 3,3 E 4,3The corresponding calculation results were obtained for all of them, namely a 13 a 23 a 33 a 43 .

[0244] The processing for the fourth cycle: This occurs after the fourth cycle's transmission, and can be deduced similarly to the first and second cycles. After this cycle's processing, node E in the fourth column of the node matrix... 1,4 E 2,4 E 3,4 E 4,4 The corresponding calculation results were obtained for all of them, namely a 14 a 24 a 34 a 44 .

[0245] After the above four cycles of processing, the resulting 4×4 first result submatrices are combined to form the first result matrix A. pq .

[0246] In a variation of the first implementation of Example 1, the corresponding matrix transpose calculation and matrix multiplication calculation can be performed together after four cycles of transmission. After the matrix transpose calculation and matrix multiplication are completed, the calculation results of the first type of submatrix are handed over to the corresponding node (this node or other nodes in the same row) for summation calculation according to the first correspondence.

[0247] In the second implementation of Example 1, each node sends the second submatrix it has saved to the other three nodes in the same column in parallel. That is, the sending is not done in cycles, but the four nodes in the same row send to the other nodes in the same column at the same time period. After all the sending is completed (which means that each node has not only sent the second submatrix it has saved, but has also received the second submatrix sent by the other three nodes in the same column), each node calculates four matrix multiplications to obtain four first-type submatrix multiplication results. One of them is kept for summation, and the other three are sent to the other three nodes in the same row for summation according to the first correspondence.

[0248] The following example uses two nodes to illustrate this:

[0249] For node E 1,1 :

[0250] Node E 1,1 It stores the second submatrix c 11 Node E 1,1 c 11 Send to E respectively 2,1 E 3,1 and E 4,1 and receive from node E 2,1 Sending c21 Node E 3,1 Sending c 31 and node E 4,1 Sending c 41 ;

[0251] Node E 1,1 For the saved c 11 Calculate b 11 ×c 11 T And obtain b 11 ×c 11 T The calculation results;

[0252] Node E 1,1 Calculate b 11 ×c 21 T and b 11 ×c 21 T The calculation results are sent to node E. 1,2 (c 21 From node E 1,1 The second row of the same column, node E 2,1 Therefore, it was sent to E. 1,1 The second column node E in the same row 1,2 );

[0253] Node E 1,1 Calculate b 11 ×c 31 T and b 11 ×c 31 T The calculation results are sent to node E. 1,3 (c 31 From node E 1,1 The third node E in the same column 3,1 Therefore, it was sent to E. 1,1 The third column node E in the same row 1,3 );

[0254] Node E 1,1 Calculate b 11 ×c 41 T and b 11 ×c 41 T The calculation results are sent to node E. 1,4 (c 41 From node E 1,1 The fourth node E in the same column 4,1 Therefore, it was sent to E. 1,1 The fourth column node E in the same row 1,4 );

[0255] Furthermore, node E 1,1 Receiver Node E 1,2 Send b 12 ×c 12 T The calculation results are received by node E. 1,3 Send b 13 ×c 13 T The calculation results are received by node E. 1,4 Send b 14 ×c 14 T The calculation results for node E; 1,1 The calculated b 11 ×c 11 T The calculation results and the received calculation results are summed to obtain a. 11 Stored in node E 1,1 middle.

[0256] For node E 2,4 :

[0257] Node E 2,4 It stores the second submatrix c 24 Node E 2,4 Saved c 24 Send to E respectively 1,4 E 3,4 and E 4,4 and receive from node E 1,4 Sending c 14 Node E 3,4 Sending c 34 and node E 4,4 Sending c 44 ;

[0258] Node E 2,4 For the received c 14 Calculate b 24 ×c 14 T and b 24 ×c 14 T The calculation results are sent to node E. 2,1 (c 14 From node E 2,4 The first row of the same column node E 1,4 Therefore, it was sent to E. 2,4 The first column node E of the same row 2,1 );

[0259] For the saved c 24 Calculate b24 ×c 24 T and b 24 ×c 14 T The calculation results are sent to node E. 2,2 (c 24 From node E 2,4 The second row of the same column, node E 2,4 Therefore, it was sent to E. 2,4 The second column node E in the same row 2,2 );

[0260] For the received c 34 Calculate b 24 ×c 34 T and b 24 ×c 34 T The calculation results are sent to node E. 2,3 (c 34 From node E 2,4 The third node E in the same column 3,4 Therefore, it was sent to E. 2,4 The third column node E in the same row 2,3 );

[0261] For the received c 44 Calculate b 24 ×c 34 T And obtain b 24 ×c 44 T The calculation results (c) 34 From node E 4,4 The fourth node E in the same column 4,4 Therefore, E, which is the fourth column node, is retained. 2,4 );

[0262] Furthermore, node E 2,4 Receiver Node E 2,1 b 21 ×c 41 T The calculation results are received by node E. 2,2 b 22 ×c 42 T The calculation results are received by node E. 2,3 b 23 ×c 43 T The calculation results for node E; 2,4 The received calculation results and the b calculated by itself 24 ×c 44T The calculation results are summed to obtain a. 24 Stored in node E 2,4 .

[0263] The calculation process for other nodes is similar and will not be repeated here.

[0264] In the variations of the two implementations in Example 1, each node can send the transpose of the second submatrix stored in its own node to other nodes in the same column. That is, the transpose is not performed by the node receiving the second submatrix, but by the node sending the second submatrix. What is sent and received is the transpose of the second submatrix. For example:

[0265] First cycle: The first row node sends the transpose of the second submatrix stored in this node to the nodes in the same column, i.e., node E. 1,1 The second submatrix c saved at this node 11 The transpose matrix c 11 T Send to E respectively 2,1 E 3,1 and E 4,1 Node E 1,2 The second submatrix c saved at this node 12 The transpose matrix c 12 T Send to E respectively 2,2 E 3,2 and E 4,2 Node E 1,3 The second submatrix c saved at this node 13 The transpose matrix c 13 T Send to E respectively 2,3 E 3,3 and E 4,3 Node E 1,4 The second submatrix c saved at this node 14 The transpose matrix c 14 T Send to E respectively 2,4 E 3,4 and E 4,4 ;

[0266] The other three cycles are similar; or they can be sent without a cycle, with the four nodes sending in parallel.

[0267] If the transmission method in the modified scheme is adopted, the node receiving the second submatrix can directly perform matrix multiplication calculation based on the received matrix without performing matrix transpose calculation.

[0268] Example 2

[0269] Example 2 is the calculation of D[L][N]) = (E[M][L]). T The case of ×F[M][N]; in Example 2, the third matrix E is divided into P×Q third submatrices e. pq The fourth matrix F is divided into P×Q fourth submatrices f. pq Each node stores a third submatrix e. pq and a fourth submatrix f pq .

[0270] like Figure 5 As shown, in Example 2, the node array is a square matrix of nodes P = Q = 4, and each node stores a third submatrix e. pq and a fourth submatrix f pq , corresponding to a second result submatrix d pq 4×4 second result submatrices d pq This forms the second result matrix D. In Example 2, the first correspondence is: the result of calculating the second type submatrix based on the second submatrix stored in the Zth column of this row corresponds to the node in the Zth row of this column. In Example 2, the result of calculating the second type submatrix is ​​the third submatrix e. pq The transpose matrix and the fourth submatrix f pq The result of matrix multiplication.

[0271] In the first implementation of Example 2, the third submatrix e is sent by 4×4 nodes in 4 cycles. pq :

[0272] First cycle: The first column node sends the third submatrix stored in this node to the nodes in the same row, i.e., node E. 1,1 Save the third submatrix e stored in this node 11 Send to E respectively 1,2 E 1,3 and E 1,4 Node E 2,1 Save the third submatrix e stored in this node. 21 Send to E respectively 2,2 E 2,3 and E 2,4 Node E 3,1 Save the third submatrix e stored in this node 31 Send to E respectively 3,2 E 3,3 and E 3,4 Node E 4,1 Save the third submatrix e stored in this node. 41 Send to E respectively 4,2 E 4,3 and E 4,4 ;

[0273] Second cycle: The second column node sends the third submatrix stored in this node to the nodes in the same row, i.e., node E. 1,2 Save the third submatrix e stored in this node. 12 Send to E respectively 1,1 E 1,3 and E 1,4 Node E 2,2 Save the third submatrix e stored in this node. 22 Send to E respectively 2,1 E 2,3 and E 2,4 Node E 3,2 Save the third submatrix e stored in this node. 32 Send to E respectively 3,1 E 3,3 and E 3,4 Node E 4,2 Save the third submatrix e stored in this node. 42 Send to E respectively 4,1 E 4,3 and E 4,4 .

[0274] The third cycle: The third column node sends the third submatrix stored in this node to the nodes in the same row, i.e., node E. 1,3 Save the third submatrix e stored in this node. 13 Send to E respectively 1,1 E 1,2 and E 1,4 Node E 2,3 Save the third submatrix e stored in this node. 23 Send to E respectively 2,1 E 2,2 and E 2,4 Node E 3,3 Save the third submatrix e stored in this node. 33 Send to E respectively 3,1 E 3,2 and E 3,4 Node E 4,3 Save the third submatrix e stored in this node. 43 Send to E respectively 4,1 E 4,2 and E 4,4 .

[0275] Fourth cycle: The fourth column node sends the third submatrix stored in this node to the nodes in the same row, i.e.: node E 1,4 Save the third submatrix e stored in this node. 14 Send to E respectively 1,1 E 1,2 and E 1,3 Node E 2,4Save the third submatrix e stored in this node. 24 Send to E respectively 2,1 E 2,2 and E 2,3 Node E 3,4 Save the third submatrix e stored in this node. 34 Send to E respectively 3,1 E 3,2 and E 3,3 Node E 4,4 Save the third submatrix e stored in this node. 44 Send to E respectively 4,1 E 4,2 and E 4,3 .

[0276] In the first implementation of Example 2, after each cycle of transmission (i.e., after the corresponding node has sent the third submatrix and received it from nodes in other columns of the same row), corresponding processing can be performed, including matrix transpose calculation and matrix multiplication calculation. After completing the matrix transpose calculation and matrix multiplication, according to the second correspondence, the calculation result of the second type submatrix corresponding to this node is retained in this node for summation calculation, while the calculation results of the first type submatrix corresponding to other nodes are sent to the corresponding nodes for summation calculation. This process is performed by each node in 4 cycles, including:

[0277] Processing of the first cycle: This process occurs after the first cycle is sent, at node E. 1,1 Calculate e 11 T ×f 11 Node E 2,1 Calculate e 21 T ×f 21 Node E 3,1 Calculate e 31 T ×f 31 Node E 4,1 Calculate e 41 T ×f 41 Node E 1,2 Calculate e 11 T ×f 12 Node E 2,2 Calculate e 21 T ×f 22 Node E 3,2 Calculate e 31 T ×f 32 Node E 4,2 Calculate e 41T ×f 42 Node E 1,3 Calculate e 11 T ×f 13 Node E 2,3 Calculate e 21 T ×f 23 Node E 3,3 Calculate e 31 T ×f 33 Node E 4,3 Calculate e 41 T ×f 43 Node E 1,4 Calculate e 11 T ×f 14 Node E 2,4 Calculate e 21 T ×f 24 Node E 3,4 Calculate e 31 T ×f 34 Node E 4,4 Calculate e 41 T ×f 44 ;

[0278] Node E 2,1 e 21 T ×f 21 The calculation results are sent to node E. 1,1 Node E 3,1 e 31 T ×f 31 The calculation results are sent to node E. 1,1 Node E 4,1 e 41 T ×f 41 The calculation results are sent to node E. 1,1 Node E 1,1 The e calculated by itself 11 T ×f 11 The calculation results and node E 2,1 E 3,1 E 4,1 The sent calculation results are summed to obtain d. 11 Stored in node E 1,1 middle;

[0279] Node E 2,2e 21 T ×f 22 The calculation results are sent to node E. 1,2 Node E 3,2 e 31 T ×f 32 The calculation results are sent to node E. 1,2 Node E 4,2 e 41 T ×f 42 The calculation results are sent to node E. 1,2 Node E 1,2 The e calculated by itself 11 T ×f 12 The calculation results and node E 2,2 E 3,2 E 4,2 The sent calculation results are summed to obtain d. 12 Stored in node E 1,2 middle;

[0280] Node E 2,3 e 21 T ×f 23 The calculation results are sent to node E. 1,3 Node E 3,3 e 31 T ×f 33 The calculation results are sent to node E. 1,3 Node E 4,3 e 41 T ×f 43 The calculation results are sent to node E. 1,3 Node E 1,3 The e calculated by itself 11 T ×f 13 The calculation results and node E 2,3 E 3,3 E 4,3 The sent calculation results are summed to obtain d. 13 Stored in node E 1,3 middle;

[0281] Node E 2,4 e 21 T ×f 24 The calculation results are sent to node E. 1,4 Node E 3,4 e 31 T×f 34 The calculation results are sent to node E. 1,4 Node E 4,4 e 41 T ×f 44 The calculation results are sent to node E. 1,4 Node E 1,4 Calculate itself 11 T ×f 14 The calculation results and node E 2,4 E 3,4 E 4,4 The sent calculation results are summed to obtain d. 14 Stored in node E 1,4 middle.

[0282] After this cycle of processing, the first row of the node matrix, node E... 1,1 E 1,2 E 1,3 E 1,4 The corresponding calculation results, d, were obtained for all of them. 11 d 12 d 12 d 14 .

[0283] Processing of the second cycle: This process takes place after the second cycle is sent, at node E. 1,1 Calculate e 12 T ×f 11 Node E 2,1 Calculate e 22 T ×f 21 Node E 3,1 Calculate e 32 T ×f 31 Node E 4,1 Calculate e 42 T ×f 41 Node E 1,2 Calculate e 12 T ×f 12 Node E 2,2 Calculate e 22 T ×f 22 Node E 3,2 Calculate e 32 T ×f 32 Node E 4,2 Calculate e 42 T ×f 42Node E 1,3 Calculate e 12 T ×f 13 Node E 2,3 Calculate e 22 T ×f 23 Node E 3,3 Calculate e 32 T ×f 33 Node E 4,3 Calculate e 42 T ×f 43 Node E 1,4 Calculate e 12 T ×f 14 Node E 2,4 Calculate e 22 T ×f 24 Node E 3,4 Calculate e 32 T ×f 34 Node E 4,4 Calculate e 42 T ×f 44 ;

[0284] Node E 1,1 e 12 T ×f 11 The calculation results are sent to node E. 2,1 Node E 3,1 e 32 T ×f 31 The calculation results are sent to node E. 2,1 Node E 4,1 e 42 T ×f 41 The calculation results are sent to node E. 2,1 Node E 2,1 The e calculated by itself 12 T ×f 11 The calculation results are sent to node E. 1,1 E 3,1 E 4,1 The calculation results are summed to obtain d. 21 Stored in node E 2,1 middle;

[0285] Node E 1,2 e 12T ×f 12 The calculation results are sent to node E. 2,2 Node E 3,2 e 32 T ×f 32 The calculation results are sent to node E. 2,2 Node E 4,2 e 42 T ×f 42 The calculation results are sent to node E. 2,2 Node E 2,2 The e calculated by itself 12 T ×f 12 The calculation results and node E 1,2 E 3,2 E 4,2 The sent calculation results are summed to obtain d. 22 Stored in node E 2,2 middle;

[0286] Node E 1,2 e 12 T ×f 12 The calculation results are sent to node E. 2,2 Node E 3,2 e 32 T ×f 32 The calculation results are sent to node E. 2,2 Node E 4,2 e 42 T ×f 42 The calculation results are sent to node E. 2,2 Node E 2,2 The e calculated by itself 12 T ×f 12 The calculation results and node E 1,2 E 3,2 E 4,2 The sent calculation results are summed to obtain d. 22 Stored in node E 2,2 middle;

[0287] Node E 1,3 e 12 T ×f 13 The calculation results are sent to node E. 2,3 Node E 3,3 e 32 T ×f 33The calculation results are sent to node E. 2,3 Node E 4,3 e 42 T ×f 43 The calculation results are sent to node E. 2,3 Node E 2,3 The e calculated by itself 22 T ×f 23 The calculation results and node E 1,3 E 3,3 E 4,3 The sent calculation results are summed to obtain d. 23 Stored in node E 2,3 middle;

[0288] Node E 1,4 e 12 T ×f 14 The calculation results are sent to node E. 2,4 Node E 3,4 e 32 T ×f 34 The calculation results are sent to node E. 2,4 Node E 4,4 e 42 T ×f 44 The calculation results are sent to node E. 2,4 Node E 2,4 The e calculated by itself 22 T ×f 24 The calculation results and node E 1,4 E 3,4 E 4,4 The sent calculation results are summed to obtain d. 24 Stored in node E 2,4 middle.

[0289] After this cycle of processing, node E in the second row of the node matrix... 2,1 E 2,2 E 2,3 E 2,4 The corresponding calculation results, d, were obtained for all of them. 21 d 22 d 23 d 24 .

[0290] The processing for the third cycle: This occurs after the third cycle has been sent, and can be deduced similarly to the processes of the first and second cycles. After this cycle's processing, node E in the third row of the node matrix... 3,1 E3,2 E 3,3 E 3,4 The corresponding calculation results, d, were obtained for all of them. 31 d 32 d 33 d 34 .

[0291] The processing for the fourth cycle: This occurs after the fourth cycle's transmission, and can be deduced similarly to the first and second cycles. After this cycle's processing, node E in the third row of the node matrix... 4,1 E 4,2 E 4,3 E 4,4 The corresponding calculation results, d, were obtained for all of them. 41 d 42 d 43 d 44 .

[0292] After the above four cycles of processing, the resulting 4×4 second result submatrices form the second result matrix D.

[0293] In a variation of the first implementation of Example 2, the corresponding matrix transpose calculation and matrix multiplication calculation can be performed together after four cycles of transmission. After the matrix transpose calculation and matrix multiplication are completed, the calculation results of the second type of submatrix are handed over to the corresponding node (this node or other nodes in the same column) for summation calculation according to the second correspondence.

[0294] In the second implementation of Example 2, each node sends the stored third submatrix to the other three nodes in the same row in parallel. That is, the sending is not periodic, but the four columns of nodes send to the other nodes in the same row at the same time period. After all the sending is completed (which means that each node has not only sent the third submatrix stored by itself, but has also received the third submatrix sent by the other three nodes in the same row), each node calculates four matrix multiplications to obtain four second-type submatrix multiplication results. One of them is kept for summation, and the other three are sent to the other three nodes in the same column for summation according to the second correspondence.

[0295] The following example uses two nodes to illustrate this:

[0296] For node E 1,1 :

[0297] Node E 1,1 It stores the third submatrix e 11 Node E 1,1 e 11 Send to E respectively 1,2 E 1,3 and E 1,4and receive from node E 1,2 Send e 12 Node E 1,3 Send e 13 Node E 1,4 Send e 14 ;

[0298] Node E 1,1 For the saved e 11 Calculate e 11 T ×f 11 And obtain e 11 T ×f 11 The calculation results (e) 11 From node E 1,1 The first column node E of the same row 1,1 Therefore, E is retained as the first node in the same column. 1,1 );

[0299] Node E 1,1 Calculate e 12 T ×f 11 and e 12 T ×f 11 The calculation results are sent to node E. 2,1 (e 12 From node E 1,1 The second column node E in the same row 1,2 Therefore, it was sent to E. 1,1 The second row of the same column, node E 2,1 );

[0300] Node E 1,1 Calculate e 13 T ×f 11 and e 13 T ×f 11 The calculation results are sent to node E. 3,1 (e 13 From node E 1,1 The third column node E in the same row 1,3 Therefore, it was sent to E. 1,1 The third node E in the same column 3,1 );

[0301] Node E 1,1 Calculate e 14 T ×f 11 and e 14 T ×f 11 The calculation results are sent to node E.4,1 (e 14 From node E 1,1 The fourth column node E in the same row 4,1 Therefore, it was sent to E. 1,1 The fourth node E in the same column 1,4 );

[0302] Furthermore, node E 1,1 Receiver Node E 2,1 Send e 21 T ×f 21 The calculation results are received by node E. 3,1 Send e 31 T ×f 31 The calculation results are received by node E. 4,1 Send e 41 T ×f 41 The calculation results for node E; 1,1 The received calculation results and the e calculated by itself 11 T ×f 11 The calculation results are summed to obtain d. 11 Stored in node E 1,1 middle.

[0303] For node E 2,4 :

[0304] Node E 2,4 It stores the third submatrix e 24 Node E 2,4 e 24 Send to E respectively 2,1 E 2,2 and E 2,3 and receive from node E 2,1 Send e 21 Receiver node E 2,2 Send e 22 Receiver node E 2,3 Send e 23 ;

[0305] Node E 2,4 Calculate e 21 T ×f 24 and e 21 T ×f 24 The calculation results are sent to node E. 1,4 (e 21 From node E 2,4 The first column node E of the same row 2,1 Therefore, it was sent to E.2,4 The first row of the same column node E 1,4 );

[0306] Node E 2,4 Calculate e 22 T ×f 24 Get e 22 T ×f 24 The calculation results (e) 22 From node E 2,4 The second column node E in the same row 2,1 Therefore, E is retained as the node in the second row of the same column. 2,4 );

[0307] Node E 2,4 Calculate e 23 T ×f 24 and e 23 T ×f 24 The calculation results are sent to node E. 3,4 (e 23 From node E 2,4 The third column node in the same row, so it is sent to E. 2,4 The third node E in the same column 3,4 );

[0308] Node E 2,4 Calculate e 24 T ×f 24 and e 24 T ×f 24 The calculation results are sent to node E. 4,4 (e 24 From node E 2,4 The fourth column node in the same row, so it is sent to E. 2,4 The fourth node E in the same column 4,4 );

[0309] Furthermore, receiving node E 1,4 Send e 12 T ×f 14 The calculation results are received by node E. 3,4 Send e 32 T ×f 34 The calculation results are received by node E. 4,4 Send e 42 T ×f 44 The calculation results for node E; 2,4The received calculation results and the e calculated by itself 22 T ×f 24 The calculation results are summed to obtain d. 24 Stored in node E 2,4 middle.

[0310] The calculation process for other nodes is similar and will not be repeated here.

[0311] In the variations of the two implementations in Example 2, each node can send the transpose of the third submatrix stored in its own node to other nodes in the same row. That is, the transpose is not performed by the node receiving the third submatrix, but by the node sending the third submatrix. What is sent and received is the transpose of the second submatrix. For example:

[0312] First cycle: The first column node sends the transpose of the third submatrix stored in this node to the nodes in the same row, i.e.: Node E 1,1 Save the third submatrix e stored in this node. 11 The transpose matrix e 11 T Send to E respectively 1,2 E 1,3 and E 1,4 Node E 2,1 Save the third submatrix e stored in this node. 21 The transpose matrix e 21 T Send to E respectively 2,2 E 2,3 and E 2,4 Node E 3,1 Save the third submatrix e stored in this node. 31 The transpose matrix e 31 T Send to E respectively 3,2 E 3,3 and E 3,4 Node E 4,1 Save the third submatrix e stored in this node. 41 The transpose matrix e 41 T Send to E respectively 4,2 E 4,3 and E 4,4 ;

[0313] The other three cycles are similar; or there is no cycle, with the four columns of nodes transmitting in parallel.

[0314] If this modified scheme is adopted, the node that receives the third submatrix does not need to perform matrix transpose calculation, but can directly perform matrix multiplication calculation based on the received matrix.

[0315] Example 3

[0316] Example 3 calculates A[M][L] = B[M][N] × (C[L][N]). T In Example 3, the first matrix B is divided into R×S first submatrices b. ij The second matrix C is divided into S×T second submatrices c. hk Let i = 1, 2, ..., 8, j = 1, 2, ..., 8, h = 1, 2, ..., 8, k = 1, 2, ..., 8. Each node stores multiple first submatrices and multiple second submatrices.

[0317] like Figure 10 As shown, the node array in Example 3 can be a square matrix of nodes with P = Q = 4 and R = S = T = 8; each node stores 2×2 first submatrices and 2×2 second submatrices, such as E 1,1 Save b 11 b 12 b 21 b 22 and c 11 c 12 c 21 c 22 E 1,2 Save b 13 b 14 b 23 b 24 and c 13 c 14 c 23 c 24 E 2,1 Save b 31 b 32 b 41 b 42 and c 31 c 32 c 41 c 42 The same logic applies to other nodes. Each node will obtain 2×2 first result submatrices 'a', and 4×4 nodes will result in a total of 8×8 arrays of 'a', which together form the first result matrix A. The calculation process includes the following four cycles.

[0318] First cycle:

[0319] Each node sends the second submatrix in the first row and first column of the 2×2 second submatrix stored in this node to the nodes in the same column, that is: Node E p,q Send the saved c (2p-1)(2q-1) Give it to other nodes in the same column; for example, E. 1,1 Send c 11 Give the other nodes in the same column, i.e., E2,1 E 3,1 and E 4,1 For example, E 3,2 Send c 53 Give the other nodes in the same column, i.e., E 1,2 E 2,2 and E 4,2 .

[0320] Each node selects the first submatrix corresponding to the second submatrix transmitted in this cycle from its own stored first submatrix, including the first submatrix in the first row and first column of the 2×2 first submatrix (i.e., b). 11 b 13 b 15 b 17 ), and the first submatrix in the second row and first column (i.e., b) 21 b 23 b 25 b 27 ).

[0321] Matrix multiplication is performed using the first submatrix in the first row and first column and the transpose of the four second submatrices transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication result is given to the corresponding node to calculate the first result submatrix.

[0322] In Example 3, the first correspondence is: the result of the calculation of the first type of submatrix based on the second submatrix of the Zth row of this column corresponds to the node in the Zth column of this row.

[0323] For example, node E 1,1 Calculate b 11 ×c 11 T Get b 11 ×c 11 T The calculation results (and, node E) 1,1 Also calculate b 11 ×c 31 T and b 11 ×c 31 T The calculation results are sent to node E. 1,2 , so that node E 1,2 In calculating the first result submatrix a 13 Used at that time; Node E 1,1 Also calculate b 11 ×c 51 T and b 11 ×c 51 T The calculation results are sent to node E. 1,3, so that node E 1,3 In calculating the first result submatrix a 15 Used at that time; Node E 1,1 Also calculate b 11 ×c 71 T and b 11 ×c 71 T The calculation results are sent to node E. 1,4 , so that node E 1,4 In calculating the first result submatrix a 17 (for use at the time);

[0324] For example, node E 1,2 Calculate b 13 ×c 13 T and b 13 ×c 13 T The calculation results are sent to node E. 1,1 (And node E) 1,2 Also calculate b 13 ×c 33 T b 13 ×c 53 T b 13 ×c 73 T b 13 ×c 33 T The calculation result is retained, and b is... 13 ×c 53 T The calculation results, b 13 ×c 73 T The calculation results are sent to the corresponding nodes (details will not be elaborated here);

[0325] For example, node E 1,3 Calculate b 15 ×c 15 T and b 15 ×c 15 T The calculation results are sent to node E. 1,1 (And node E) 1,3 Also calculate b 15 ×c 35 T b 15 ×c 55 T b 15 ×c 75 Tb 15 ×c 55 T The calculation result is retained, and b is... 15 ×c 35 T The calculation results, b 15 ×c 75 T The calculation results are sent to the corresponding nodes (details will not be elaborated here);

[0326] For example, node E 1,4 Calculate b 17 ×c 17 T and b 17 ×c 17 T The calculation results are sent to node E. 1,1 (And node E) 1,4 Also calculate b 17 ×c 37 T b 17 ×c 57 T b 17 ×c 77 T b 17 ×c 77 T The calculation result is retained, and b is... 17 ×c 37 T The calculation results, b 17 ×c 57 T The calculation results are sent to the corresponding nodes (details will not be elaborated here);

[0327] For node E 1,1 Node E 1,1 In calculating the first result submatrix a 11 When using its own calculated b 11 ×c 11 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 13 ×c 13 T b 15 ×c 15 T b 17 ×c 17 T Other nodes will not be discussed further.

[0328] The first submatrix in the second row and first column is used to perform matrix transpose and matrix multiplication calculations with the second submatrix transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication calculation result is handed over to the corresponding node to calculate the first result submatrix.

[0329] For example, node E 1,1 Calculate b 21 ×c 11 T Get b 21 ×c 11 T The calculation results (and, node E) 1,1 Also calculate b 21 ×c 31 T and b 21 ×c 31 T The calculation results are sent to node E. 1,2 , so that node E 1,2 In calculating the first result submatrix a 23 Used at that time; Node E 1,1 Also calculate b 21 ×c 51 T and b 21 ×c 51 T The calculation results are sent to node E. 1,3 , so that node E 1,3 In calculating the first result submatrix a 25 Used at that time; Node E 1,1 Also calculate b 21 ×c 71 T and b 21 ×c 71 T The calculation results are sent to node E. 1,4 , so that node E 1,4 In calculating the first result submatrix a 27 (for use at the time);

[0330] E 1,2 Calculate b 23 ×c 13 T and b 23 ×c 13 T The calculation results are sent to node E. 1,1 (And node E) 1,2 Also calculate b 23 ×c 33 T b 23 ×c 53T b 23 ×c 73 T b 23 ×c 33 T The calculation result is retained, and b is... 23 ×c 53 T The calculation results, b 23 ×c 73 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0331] E 1,3 Calculate b 25 ×c 15 T and b 25 ×c 15 T The calculation results are sent to node E. 1,1 (And node E) 1,3 Also calculate b 25 ×c 35 T b 25 ×c 55 T b 25 ×c 75 T b 25 ×c 55 T The calculation result is retained, and b is... 25 ×c 35 T The calculation results, b 25 ×c 75 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0332] E 1,4 Calculate b 27 ×c 17 T and b 27 ×c 17 T The calculation results are sent to node E. 1,1 (And node E) 1,4 Also calculate b 27 ×c 37 T b 27 ×c 57 T b 27 ×c 77 T , will b27 ×c 77 T The calculation result is retained, and b is... 27 ×c 37 T The calculation results, b 27 ×c 57 T The calculation results are sent to the corresponding nodes for use, which will not be elaborated here.

[0333] For node E 1,1 Node E 1,1 In calculating the first result submatrix a 21 When using its own calculated b 21 ×c 11 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 23 ×c 13 T b 25 ×c 15 T b 27 ×c 17 T .

[0334] Second cycle:

[0335] Each node sends the second submatrix in the first row and second column of the 2×2 second submatrix stored in this node to the nodes in the same column, that is: Node E p,q Send the saved c (2p-1)2q Give it to other nodes in the same column; for example, E. 1,1 Send c 12 Give the other nodes in the same column, i.e., E 2,1 E 3,1 and E 4,1 For example, E 2,4 Send c 38 Give the other nodes in the same column, i.e., E 1,4 E 2,4 and E 4,4 .

[0336] Each node selects the first submatrix corresponding to the second submatrix transmitted in this cycle from its own stored first submatrix, including the first submatrix in the first row and second column of the 2×2 first submatrix (i.e., b). 12 b 14 b 15 b 18 ), and the first submatrix in the second row and second column (i.e., b) 22 b24 b 26 b 28 ).

[0337] Matrix multiplication is performed using the first submatrix in the first row and second column and the transpose of the four second submatrixes transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication result is given to the corresponding node to calculate the first result submatrix.

[0338] For example, node E 1,1 Calculate b 12 ×c 12 T Get b 12 ×c 12 T The calculation results (and, node E) 1,1 Also calculate b 12 ×c 32 T and b 12 ×c 32 T The calculation results are sent to node E. 1,2 , so that node E 1,2 In calculating the first result submatrix a 13 Used at that time; Node E 1,1 Also calculate b 12 ×c 52 T and b 12 ×c 52 T The calculation results are sent to node E. 1,3 , so that node E 1,3 In calculating the first result submatrix a 15 Used at that time; Node E 1,1 Also calculate b 12 ×c 72 T and b 12 ×c 72 T The calculation results are sent to node E. 1,4 , so that node E 1,4 In calculating the first result submatrix a 17 (for use at the time);

[0339] For example, node E 1,2 Calculate b 14 ×c 14 T (And node E) 1,2 Also calculate b 14 ×c 34 T b 14 ×c54 T b 14 ×c 74 T b 14 ×c 34 T The calculation result is retained, and b is... 14 ×c 54 T The calculation results, b 14 ×c 74 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0340] For example, node E 1,3 Calculate b 16 ×c 16 T (And node E) 1,3 Also calculate b 16 ×c 36 T b 16 ×c 56 T b 16 ×c 76 T b 16 ×c 56 T The calculation result is retained, and b is... 16 ×c 36 T The calculation results, b 16 ×c 76 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0341] For example, node E 1,4 Calculate b 18 ×c 18 T (And node E) 1,4 Also calculate b 18 ×c 38 T b 18 ×c 58 T b 18 ×c 78 T ; will y 18 ×c 78 T The calculation result is retained, and b is... 18 ×c 38 T The calculation results, b 18 ×c58 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0342] Node E 1,1 In calculating the first result submatrix a 11 When using its own calculated b 12 ×c 12 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 14 ×c 14 T b 16 ×c 16 T b 18 ×c 18 T .

[0343] At this point, node E 1,1 b calculated using the first cycle itself 21 ×c 11 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 23 ×c 13 T b 25 ×c 15 T b 27 ×c 17 T And b calculated by itself in this period 12 ×c 12 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 14 ×c 14 T b 16 ×c 16 T b 18 ×c 18 T Perform the summation calculation to obtain the first result submatrix a. 11 a 11 It is equivalent to the first row of the first matrix B and the transpose of the second matrix C. T The result of multiplication in the first column of the array.

[0344] The first submatrix in the second row and second column is used to perform matrix multiplication with the transpose of the four second submatrixes transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication result is given to the corresponding node to calculate the first result submatrix.

[0345] For example, node E 1,1 Calculate b 22 ×c 12 T Get b 22 ×c 12 T The calculation results (and, node E) 1,1 Also calculate b 22 ×c 31 T and b 22 ×c 32 T The calculation results are sent to node E. 1,2 , so that node E 1,2 In calculating the first result submatrix a 23 Used at that time; Node E 1,1 Also calculate b 22 ×c 52 T and b 22 ×c 52 T The calculation results are sent to node E. 1,3 , so that node E 1,3 In calculating the first result submatrix a 25 Used at that time; Node E 1,1 Also calculate b 22 ×c 72 T and b 12 ×c 72 T The calculation results are sent to node E. 1,4 , so that node E 1,4 In calculating the first result submatrix a 27 (for use at the time);

[0346] For example, node E 1,2 Calculate b 24 ×c 14 T (And node E) 1,2 Also calculate b 24 ×c 34 T b 24 ×c 54 T b 24 ×c 74T b 24 ×c 34 T The calculation result is retained, and b is... 24 ×c 54 T The calculation results, b 24 ×c 74 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0347] For example, node E 1,3 Calculate b 26 ×c 16 T (And node E) 1,3 Also calculate b 26 ×c 36 T b 26 ×c 56 T b 26 ×c 76 T b 26 ×c 56 T The calculation result is retained, and b is... 26 ×c 36 T The calculation results, b 26 ×c 76 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0348] For example, node E 1,4 Calculate b 28 ×c 18 T (And node E) 1,4 Also calculate b 28 ×c 38 T b 28 ×c 58 T b 28 ×c 78 T b 28 ×c 78 T The calculation result is retained, and b is... 28 ×c 38 T The calculation results, b 28 ×c 58 T The calculation results are sent to the corresponding nodes for use (details will not be elaborated here);

[0349] For node E 1,1 Node E 1,1 In calculating the first result submatrix a 21 When using its own calculated b 22 ×c 12 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 24 ×c 14 T b 26 ×c 16 T b 28 ×c 18 T .

[0350] At this point, node E 1,1 b calculated using the first cycle itself 21 ×c 11 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 23 ×c 13 T b 25 ×c 15 T b 27 ×c 17 T And b calculated by itself in this period 22 ×c 12 T The calculation results and the received node E 1,2 E 1,3 E 1,4 The calculation result, i.e., b 24 ×c 14 T b 26 ×c 16 T b 28 ×c 18 T Perform the summation calculation to obtain the first result submatrix a. 21 a 21 It is equivalent to the second row of the first matrix B and the transpose of the second matrix C. T The result of multiplication in the first column of the array.

[0351] The third cycle:

[0352] Each node sends the second submatrix in the second row and first column of the 2×2 second submatrix stored in this node to the nodes in the same column, that is: Node E p,q Send the saved c 2p(2q-1) Give other nodes in the same column, such as E 1,1 Send c 21 Give the other nodes in the same column, i.e., E 2,1 E 3,1 and E 4,1 For example, E 2,4 Send c 47 Give the other nodes in the same column, i.e., E 1,4 E 2,4 and E 4,4 .

[0353] Each node selects the first submatrix corresponding to the second submatrix transmitted in this cycle from its own stored first submatrix, including the first submatrix in the first row and first column of the 2×2 first submatrix (i.e., b). 11 b 13 b 15 b 17 ), and the first submatrix in the second row and first column (i.e., b) 21 b 23 b 25 b 27 ).

[0354] Matrix multiplication is performed using the first submatrix in the first row and first column and the transpose of the four second submatrices transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication result is given to the corresponding node to calculate the first result submatrix.

[0355] The first submatrix in the second row and first column is used to perform matrix multiplication with the transpose of the four second submatrixes transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication result is given to the corresponding node to calculate the first result submatrix.

[0356] The fourth cycle:

[0357] Each node sends the second submatrix in the second row and second column of the 2×2 second submatrix stored in this node to the nodes in the same column, that is: Node E p,q Send the saved c 2p2q Give other nodes in the same column, such as E 1,1 Send c 22 Give the other nodes in the same column, i.e., E 2,1 E 3,1 and E 4,1 For example, E 3,4 Send c 68Give the other nodes in the same column, i.e., E 1,4 E 2,4 and E 4,4 .

[0358] Each node selects the first submatrix corresponding to the second submatrix transmitted in this cycle from its own stored first submatrix, including the first submatrix in the first row and second column of the 2×2 first submatrix (i.e., b). 12 b 14 b 15 b 18 ), and the first submatrix in the second row and second column (i.e., b) 22 b 24 b 26 b 28 ).

[0359] Matrix multiplication is performed using the first submatrix in the first row and second column and the transpose of the four second submatrixes transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication result is given to the corresponding node to calculate the first result submatrix.

[0360] The first submatrix in the second row and second column is used to perform matrix multiplication with the transpose of the four second submatrixes transmitted in the same period. According to the preset first correspondence, the first type of matrix multiplication result is given to the corresponding node to calculate the first result submatrix.

[0361] After the above four cycles, the transpose matrix C of the first matrix B and the second matrix C can be completed. T In the matrix multiplication calculation, each node yields 2×2 first result submatrices 'a'. These 2×2 first result submatrices can be viewed as a first result subarray. That is, the first result matrix A can be considered as an array consisting of 8×8 first result submatrices or 4×4 first result subarrays, with the first row being 'a'. 11 a 12 a 13 a 14 a 15 a 16 a 17 a 18 The last line is a 81 a 82 a 83 a 84 a 85 a 86 a 87 a 88 The same logic applies to other rows.

[0362] In another implementation of Example 3, the corresponding matrix transpose calculation and matrix multiplication calculation can be performed together after four cycles of transmission. After the matrix transpose calculation and matrix multiplication are completed, the calculation result of the first type of submatrix is ​​sent to the corresponding node, which then performs the summation calculation to obtain the first result submatrix.

[0363] In another implementation of Example 3, each node can send the transpose of the second submatrix stored in this node to the nodes in the same column. Taking the first column node as an example:

[0364] The first column node sends the transpose of the first submatrix stored in this node to the nodes in the same row, that is: node E 1,1 The second submatrix c saved at this node 11 The transpose matrix c 11 T Send to E respectively 1,2 E 1,3 and E 1,4 Node E 2,1 The second submatrix c saved at this node 21 The transpose matrix c 21 T Send to E respectively 2,2 E 2,3 and E 2,4 Node E 3,1 The second submatrix c saved at this node 31 The transpose matrix c 31 T Send to E respectively 3,2 E 3,3 and E 3,4 Node E 4,1 The second submatrix c saved at this node 41 The transpose matrix c 41 T Send to E respectively 4,2 E 4,3 and E 4,4 ;

[0365] If this transmission method is used, the receiving node does not need to perform matrix transpose calculation, but can directly perform matrix multiplication calculation based on the received matrix.

[0366] Example 4

[0367] Example 4 is the calculation of D[L][N]) = (E[M][L]). T The case of ×F[M][N]; in Example 4, the third matrix E is divided into R'×S' third submatrices e i’j’ The fourth matrix F is divided into S'×T' fourth submatrices f h’k’Each node stores multiple third submatrices and multiple fourth submatrices.

[0368] by Figure 11 As shown, in Example 4, the node array is a square matrix of nodes with P = Q = 4, and each node stores 2×2 third submatrices e. i’j’ and 2×2 fourth submatrices f h’k’ ; i'=1,2,...,8, j'=1,2,...,8, h'=1,2,...,8, k'=1,2,...,8.

[0369] The matrix calculation can still be performed in four cycles, similar to the process in Example 3, which will not be repeated here; the difference is that in Example 3, each node sends the stored second submatrix to other nodes in the same column, and a first submatrix b that makes j and k equal. ij and a second submatrix c hk The transpose of the matrix is ​​used as a pair of submatrices for matrix multiplication. When adding the multiplication results, the results of the multiplication of the first type of submatrices are passed to the corresponding nodes in the same row for summation. In Example 4, each node sends the stored third submatrix to other nodes in the same row, and a third submatrix e that is equal to i' and h' is obtained. i’j’ and a fourth submatrix f h’k’ The transpose of the matrix is ​​used as a pair of submatrices for matrix multiplication. When adding the multiplication results, the result of the second type of submatrix multiplication is passed to the corresponding nodes in the same column for summation.

[0370] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A data processing architecture, comprising: A node array with P rows and Q columns; When the P×Q nodes in the node array respectively store the first sub-matrix obtained by partitioning the first matrix B and the second sub-matrix obtained by partitioning the second matrix C; Each node is configured to send the second submatrix stored in this node to the other P-1 nodes in the same column. The first submatrix stored in this node is multiplied by the transposes of multiple second submatrixes to obtain multiple first-type submatrix calculation results. These multiple second submatrixes include the second submatrix stored in this node and the received second submatrix. According to a preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the same row are sent to their respective nodes. The calculated first-type submatrix calculation result corresponding to this node is then added to the first-type submatrix calculation results received from other nodes to obtain the first-result submatrix of this node. The first-result submatrixes of the P×Q nodes form a first-result matrix A, where A = B×C. T .

2. The data processing architecture as described in claim 1, wherein, Each of the nodes includes: a computing sub-node and a storage module; The computational sub-nodes include: The processing module is configured to read the first submatrix and the second submatrix stored in this node, as well as the received second submatrix, from the storage module; perform multiplication calculations on the first submatrix stored in this node and the transposes of the read second submatrixes respectively, to obtain multiple first-type submatrix calculation results, and save them to the storage module; read the first-type submatrix calculation results corresponding to this node from the storage module, sum them to obtain the first result submatrix corresponding to this node, and save it to the storage module. The communication module is configured to send the second submatrix saved by the current node, which is read by the processing module, to the other P-1 nodes in the same column as the current node; receive the second submatrix from the other P-1 nodes in the same column as the current node and save it to the storage module; according to the preset first correspondence, send the calculation results of the first type submatrix corresponding to the other P-1 nodes in the same row as the current node in the storage module to the corresponding nodes; and receive the calculation results of the first type submatrix corresponding to the current node from the other Q-1 nodes in the same row as the current node and save them to the storage module.

3. The data processing architecture as described in claim 2, wherein, The storage module includes: a temporary storage module disposed in the computing sub-node; Alternatively, it may include: a temporary storage module set in the computing sub-node, and a memory sub-node connected to the computing sub-node; The memory sub-node is configured to store the first sub-matrix saved by this node, the second sub-matrix saved by this node, and the first result sub-matrix corresponding to this node; The temporary storage module is configured to temporarily store the first sub-matrix of the current node, the second sub-matrix of the current node, the received second sub-matrix, the received and the calculation result of the first type sub-matrix calculated by the processing module, and the first result sub-matrix corresponding to the current node, which are read by the processing module from the memory sub-node. The processing module is also configured to save the first result submatrix temporarily stored in the temporary storage module to the memory sub-node.

4. The data processing architecture as described in claim 1, wherein: The nodes in different rows send the second sub-matrix at different time periods, while the nodes in the same row send the second sub-matrix in parallel. Alternatively, the P×Q nodes may transmit the second sub-matrix in parallel.

5. The data processing architecture as described in claim 4, wherein, When nodes in different rows send the second submatrix at different time periods, the first submatrix stored in this node is multiplied by the transposes of multiple second submatrixes to obtain multiple first-type submatrix calculation results. Based on a preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the same row are sent to their respective nodes, including: In each time period, the following operations are performed: The first submatrix stored in this node is multiplied by the transpose of the second submatrix transmitted in the current time period to obtain the calculation result of the first type of submatrix for the current time period; when, according to a preset first correspondence, it is determined that the node corresponding to the calculation result of the first type of submatrix obtained in the current time period is another node in the row where this node is located, the calculation result of the first type of submatrix is ​​sent to the corresponding node; wherein, the second submatrix transmitted in the current time period is the second submatrix sent or received by this node in the current time period; When the P×Q nodes send the second submatrix in parallel, the first submatrix stored at this node is multiplied by the transposes of multiple second submatrixes to obtain multiple first-type submatrix calculation results. Based on a preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the same row are sent to their respective nodes, including: The first submatrix stored in this node is multiplied by the transpose of the received second submatrix and the transpose of the second submatrix stored in this node to obtain multiple first-type submatrix calculation results; according to the preset first correspondence, the first-type submatrix calculation results corresponding to other nodes in the row where this node is located are sent to the corresponding nodes in parallel.

6. The data processing architecture as described in claim 1, wherein: The first matrix is ​​divided into R rows and S columns of first submatrices b. ij The second matrix is ​​divided into S rows and T columns of second submatrices c. hk ; i represents the first submatrix b ij The row number j in the first matrix represents the first submatrix b. ij The index of the column in the first matrix; h represents the second submatrix c. hk The row number k in the second matrix represents the second submatrix c. hk The column index in the second matrix; i = 1, 2, ..., R, j = 1, 2, ..., S, h = 1, 2, ..., S, k = 1, 2, ..., T; The first submatrix stored in this node is multiplied by the transposes of multiple second submatrices to obtain multiple first-type submatrix calculation results, including: The node stores a first submatrix b in its stored first submatrix and multiple second submatrixes, where j and k are equal. ij and a second submatrix c hk The transpose of the matrix is ​​used as a pair of submatrices, wherein the plurality of second submatrices include the second submatrices stored in this node and the received second submatrices; matrix multiplication is performed on the transpose of the first and second submatrices in each pair of submatrices.

7. The data processing architecture as described in claim 1, wherein, P = Q; The preset first correspondence is: the calculation result of the first type of submatrix calculated using the second submatrix stored in the Zth row of the column where this node is located corresponds to the node in the Zth column of the row where this node is located; Z = 1, 2, ..., P.

8. A data processing architecture, comprising: A node array with P rows and Q columns; When the P×Q nodes in the node array respectively store the third sub-matrix obtained by partitioning the third matrix E and the fourth sub-matrix obtained by partitioning the fourth matrix F; Each node is configured to send the third submatrix stored in this node to the other Q-1 nodes in the same row. Multiple transposes of the third submatrix are multiplied by the fourth submatrix stored in this node to obtain multiple second-type submatrix calculation results. These multiple third submatrixes include the third submatrix stored in this node and the received third submatrix. According to a preset second correspondence, the second-type submatrix calculation results corresponding to other nodes in the same column are sent to their respective nodes. The calculated second-type submatrix calculation result corresponding to this node is then added to the second-type submatrix calculation results received from other nodes to obtain the second-result submatrix of this node. The second-result submatrixes of the P×Q nodes form a second-result matrix D, where D = E. T ×F.

9. The data processing architecture as described in claim 8, wherein, Each of the nodes includes: a computing sub-node and a storage module; The computational sub-nodes include: The processing module is configured to read the third submatrix stored in this node, the fourth submatrix stored in this node, and the received third submatrix from the storage module; multiply the transposes of the read third submatrixes with the fourth submatrix stored in this node to obtain multiple second-type submatrix calculation results, and save them to the storage module; read the second-type submatrix calculation results corresponding to this node from the storage module, sum them to obtain the second result submatrix corresponding to this node, and save it to the storage module. The communication module is configured to send the third submatrix saved by the current node, which is read by the processing module, to the other Q-1 nodes in the same row as the current node; receive the third submatrix from the other Q-1 nodes in the same row as the current node and save it to the storage module; according to the preset second correspondence, send the calculation results of the second type submatrix corresponding to the other Q-1 nodes in the same column as the current node in the storage module to the corresponding nodes; and receive the calculation results of the second type submatrix corresponding to the current node from the other P-1 nodes in the same column as the current node and save them to the storage module.

10. The data processing architecture as described in claim 9, wherein, The storage module includes: a temporary storage module disposed in the computing sub-node; Alternatively, it may include: a temporary storage module set in the computing sub-node, and a memory sub-node connected to the computing sub-node; The memory sub-node is configured to store the third sub-matrix saved by this node, the fourth sub-matrix saved by this node, and the second result sub-matrix corresponding to this node; The temporary storage module is configured to temporarily store the third sub-matrix stored in this node, the fourth sub-matrix stored in this node, the received third sub-matrix, the received and the calculation result of the second type sub-matrix calculated by the processing module, and the second result sub-matrix corresponding to this node, which are read by the processing module from the memory sub-node. The processing module is further configured to save the second result submatrix temporarily stored in the temporary storage module to the memory subnode.

11. The data processing architecture as described in claim 8, wherein: The nodes in different columns send the third sub-matrix at different time periods, while the nodes in the same column send the third sub-matrix in parallel. Alternatively, the P×Q nodes may transmit the third submatrix in parallel.

12. The data processing architecture as described in claim 11, wherein, When nodes in different columns send the third submatrix at different time periods, the transpose of the multiple third submatrixes is multiplied by the fourth submatrix stored in this node to obtain multiple second-type submatrix calculation results. According to a preset second correspondence, the second-type submatrix calculation results corresponding to other nodes in the same column are sent to their respective nodes, including: In each time period, the following operations are performed: the transpose of the third submatrix transmitted in the current time period is multiplied by the fourth submatrix stored in this node to obtain the calculation result of the second type of submatrix in the current time period; when it is determined, according to the preset second correspondence, that the node corresponding to the calculation result of the second type of submatrix obtained in the current time period is another node in the column where this node is located, the calculation result of the second type of submatrix is ​​sent to the corresponding node; wherein, the third submatrix transmitted in the current time period is the third submatrix sent or received by this node in the current time period; When the P×Q nodes send the third submatrix in parallel, the transpose of the multiple third submatrixes is multiplied by the fourth submatrix stored in the current node to obtain multiple second-type submatrix calculation results. According to a preset second correspondence, the second-type submatrix calculation results corresponding to other nodes in the same column are sent to their respective nodes, including: The transpose of the received third submatrix and the transpose of the third submatrix stored in this node are multiplied with the fourth submatrix stored in this node to obtain multiple calculation results of the second type of submatrix. According to the preset second correspondence, the calculation results of the second type of submatrix corresponding to other nodes in the column where this node is located are sent to the corresponding nodes in parallel.

13. The data processing architecture as described in claim 8, wherein: The third matrix is ​​divided into R' rows and S' columns of third submatrices e. i’j’ The fourth matrix is ​​divided into S' rows and T' columns of fourth submatrices f. h’k’ ; i' represents the third submatrix e i’j’ The row number j' in the third matrix represents the third submatrix e. i’j’ The column number in the third matrix; h' represents the fourth submatrix f. h’k’ The row number in the fourth matrix, k' represents the fourth submatrix f. h’k’ The column numbers in the fourth matrix; i' = 1, 2, ..., R', j' = 1, 2, ..., S', h' = 1, 2, ..., S', k' = 1, 2, ..., T'; The step of performing multiplication calculations using the first submatrix stored in this node with the transpose matrices of multiple second submatrices includes: The node selects a third submatrix e from the stored fourth submatrix and multiple third submatrixes where i' and h' are equal. i’j’ The transpose of the matrix and a fourth submatrix f h’k’ As a pair of sub-matrices; wherein, the plurality of third sub-matrices include the third sub-matrices stored in this node and the received third sub-matrices; matrix multiplication is performed on the transpose of the third sub-matrices and the fourth sub-matrices in each pair of sub-matrices.

14. The data processing architecture as described in claim 8, wherein, P = Q; The preset second correspondence is: the calculation result of the second type of submatrix calculated using the third submatrix stored in the Zth column of the current node corresponds to the node in the Zth row of the current node; Z = 1, 2, ..., P.

15. A matrix multiplication calculation method, said method being implemented based on the data processing architecture as described in any one of claims 1 to 5, comprising: Each node sends the second submatrix stored in this node to the other P-1 nodes in the same column; Each node performs multiplication calculations using the first submatrix stored in this node and the transpose of multiple second submatrixes respectively, to obtain multiple first-type submatrix calculation results, wherein the multiple second submatrixes include the second submatrix stored in this node and the received second submatrix; Each node retains the calculation result of the first type submatrix corresponding to its own node according to the preset first correspondence relationship, sends the calculation results of the first type submatrix corresponding to other nodes in the row where the node is located to the corresponding nodes respectively, and adds the calculation results of the first type submatrix corresponding to the node to obtain the first result submatrix of the node. In the data processing architecture, the first result submatrices of P×Q nodes constitute the first result matrix A, where A = B×C. T The first submatrix stored by P×Q nodes forms the first matrix B, and the second submatrix stored by P×Q nodes forms the second matrix C.

16. A matrix multiplication calculation method, said method being implemented based on the data processing architecture as described in any one of claims 6 to 10, comprising: Each node sends the third submatrix stored in this node to the other Q-1 nodes in the same row as this node; Each node performs multiplication calculations by multiplying the transpose of multiple third submatrices with the fourth submatrices stored in the node, respectively, to obtain multiple second-type submatric calculation results, wherein the multiple third submatrices include the third submatrices stored in the node and the received third submatrices; Each node retains the calculation result of the second type submatrix corresponding to its own node according to the preset second correspondence relationship, sends the calculation results of the second type submatrix corresponding to other nodes in the column where the node is located to the corresponding nodes respectively, and adds the calculation results of the second type submatrix corresponding to the node to obtain the second result submatrix of the node; In the data processing architecture, the second result submatrices of P×Q nodes form the second result matrix D, which is the result of matrix multiplication of the transpose of the third matrix X and the fourth matrix dY, where D = E. T The third matrix E is composed of the third sub-matrix stored by the P×F nodes, and the fourth matrix F is composed of the fourth sub-matrix stored by the P×Q nodes.

17. A neural network inversion method, the method comprising: When calculating the input matrix X of the current layer, each layer in the neural network model performs the following steps: Using the gradient matrix dY of the current layer's output matrix as the first matrix B, and the weight matrix W of the current layer as the second matrix C, the first result matrix A = B × C is obtained according to the matrix multiplication calculation method described in claim 13. T Wherein, the first result matrix A is used as the gradient matrix dX of the input matrix X of the current layer; Calculate the input matrix X of the current layer based on dX. * ; When calculating the weight matrix W of the current layer, each layer in the neural network model performs the following steps: Using the input matrix X of the current layer as the third matrix E, and the gradient matrix dY of the output matrix of the current layer as the fourth matrix F, the second result matrix D = E is obtained according to the matrix multiplication calculation method described in claim 14. T ×F; where the second result matrix D is used as the gradient matrix dW of the current layer's weight matrix W; Calculate the weight matrix W of the current layer based on dW.

18. A chip, comprising: The data processing architecture as described in any one of claims 1-14.

19. A chip, comprising: Storage die, logic die, and the data processing architecture as described in claim 2 or 8; The storage die includes P×Q memory sub-nodes; The logic chip includes P×Q computing sub-nodes, which correspond one-to-one with the P×Q memory sub-nodes; The storage die and the logic die are stacked and bonded together or connected by circuitry.