Data broadcasting method, network-on-chip, chip and data processing method
By using the predetermined logo method in the grid network, the high -efficiency broadcast of large neural network model data transmission has been realized, and the problem of low data transmission efficiency between devices is solved, and the cost is low and easy to achieve.
Patent Information
- Application Number
- CN202411696802.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-25
AI Technical Summary
During data transmission, large neural network models have limited performance due to low data transmission efficiency between devices.
By introducing the predetermined logo in the grid network, the node encapsulates it into a message package carrying the scheduled logo when transmitting broadcast data, and determines whether to save and forward data based on the scheduled logo in the receiving node to achieve the effect of data broadcasting.
The number of message packages is reduced, the grid network load is reduced, the data transmission efficiency is improved, and the network hardware does not need to be modified. It only needs to simply modify the transmission protocol.
Smart Images

Figure CN119363500A_ABST
Abstract
Description
Technical Field
[0001] This article relates to but is not limited to the field of data transmission technology, and in particular to a data broadcasting method, an on-chip network, a chip, and a data processing method. Background Art
[0002] Large neural network models have been widely used in image recognition and processing, natural language processing, medical health, scientific research, intelligent manufacturing, network security and other fields due to their powerful data processing and learning capabilities. Due to the limited computing power and memory limitations of a single device, it cannot meet the needs of large neural network models for large-scale calculations and data transmission. Large neural network models usually need to be performed in a parallel system composed of multiple devices. However, in the current related technologies, the data transmission efficiency between devices is very low, which has become a key issue restricting the performance of large neural network models. Summary of the invention
[0003] The embodiments of the present application provide a data broadcast method, an on-chip network, a chip and a data processing method, which greatly reduce the number of message packets, effectively reduce the load of the grid network, and improve the efficiency of data transmission. By adding a predetermined identifier for indication, the effect of "broadcasting" the data can be achieved, and there is no need to modify the network grid hardware, the cost is low, and it is easy to implement.
[0004] In a first aspect, an embodiment of the present application provides a data broadcast method, which is applied to a mesh network including multiple nodes, including: The node that needs to transmit broadcast data carries a predetermined identifier in a broadcast message packet used to transmit the broadcast data, and sends the broadcast message packet; The node receiving the broadcast message packet determines whether to save the broadcast data carried by the received broadcast message packet according to the predetermined identifier, and forwards the received broadcast message packet when the node is an intermediate node on the transmission path of the received broadcast message packet.
[0005] In a second aspect, an embodiment of the present application provides a network on chip, comprising a plurality of nodes; The multiple nodes communicate via a grid network; each of the nodes comprises a routing module, a transmission module and a storage module; The transmission module is configured to: when broadcast data needs to be transmitted, read the broadcast data from the storage module and encapsulate it into a broadcast message packet for transmitting the broadcast data; The routing module is configured to: instruct the transmission module to carry a predetermined identifier in the broadcast message packet; when the transmission module receives the broadcast message packet, determine according to the predetermined identifier whether to instruct the storage module to save the broadcast data carried by the received broadcast message packet, and when the current node is an intermediate node on the transmission path of the received broadcast message packet, instruct the transmission module to forward the received broadcast message packet; The storage module is configured to: store broadcast data to be transmitted; and store the broadcast data carried in the broadcast message packet received by the transmission module according to the instruction of the routing module.
[0006] In a third aspect, an embodiment of the present application provides a chip including multiple processor cores; The multiple processor cores communicate via a grid network to form an on-chip network; the on-chip network is configured to exchange data between the multiple processor cores and external data; The plurality of processor cores store instructions, and execute the data broadcasting method as described in the above embodiment according to the instructions.
[0007] In a fourth aspect, an embodiment of the present application provides a data processing method, which is applied to a two-dimensional grid network including P rows and Q columns of nodes; wherein the P×Q nodes E in the grid network p,q Respectively save the first submatrix obtained by splitting the first matrix X to be subjected to matrix multiplication, and the second submatrix obtained by splitting the second matrix W to be subjected to matrix multiplication; The data processing method comprises: Each of the nodes uses the stored first submatrix as first data and the stored second submatrix as second data, respectively, and executes the data broadcasting method as described in the above embodiment, and sends the stored first submatrix to other nodes in the same row, and sends the stored second submatrix to other nodes in the same column; Each of the nodes obtains a result submatrix corresponding to the node according to the first submatrix and the second submatrix stored and received by the node; wherein the result submatrices of P×Q nodes constitute a result matrix Y of matrix multiplication of the first matrix X and the second matrix W.
[0008] Compared with the related art, the data broadcasting method, on-chip network, chip and data processing method of the embodiments of the present application only need to encapsulate a small number of message packets carrying predetermined identifiers when a node needs to transmit the same data to multiple other nodes, without having to encapsulate a message packet for each node. Therefore, the number of message packets is greatly reduced, which effectively reduces the load of the grid network, shortens the transmission time of the message packets, and improves the efficiency of data transmission. By adding a predetermined identifier for indication, the effect of "broadcasting" the data can be achieved, and there is no need to modify the network grid hardware. Data broadcasting can be achieved by simply modifying the transmission protocol, which is low-cost and easy to implement.
[0009] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0011] Figure 1 A flow chart of a data broadcasting method according to an embodiment of the present application; Figure 2 is a schematic diagram of a transmission path in an example; Figure 3 is a schematic diagram of a two-dimensional grid network of an exemplary embodiment; Figure 4a is a schematic diagram of a corner node interface of an exemplary embodiment; Figure 4b is a schematic diagram of an edge node interface of an exemplary embodiment; Figure 4c is a schematic diagram of an internal node interface of an exemplary embodiment; Figure 5 A schematic diagram of a grid network node structure according to an embodiment of the present application; Figure 6 This is a schematic diagram of a 3-row 4-column two-dimensional grid structure for an application example of this application; Figure 7 A flow chart of a data processing method according to an embodiment of the present application; Figure 8 A schematic diagram of a two-dimensional grid network with 2 rows and 2 columns according to an exemplary embodiment. DETAILED DESCRIPTION
[0012] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, 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 any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0013] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0014] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0015] In a mesh network, the header of a message packet usually includes a source address and a destination address. When the same payload is transmitted from one node to multiple other nodes, a corresponding message packet needs to be encapsulated for each receiving node. When the mesh network is applied to a large neural network model, if each node needs to transmit data to multiple nodes, a large number of message packets need to be encapsulated, resulting in high-load operation of the mesh network, high transmission time complexity, and extremely low data transmission efficiency, which cannot meet the fast computing requirements of large neural network models.
[0016] The present application embodiment provides a data broadcast method, such as Figure 1 As shown, it is applied to a grid network including multiple nodes, including steps S100-S200: S100: A node that needs to transmit broadcast data carries a predetermined identifier in a broadcast message packet used to transmit the broadcast data, and sends the broadcast message packet; S200: The node receiving the broadcast message packet determines whether to save the broadcast data carried by the received broadcast message packet according to the predetermined identifier, and forwards the received broadcast message packet when the node is an intermediate node on the transmission path of the received broadcast message packet.
[0017] In this embodiment, the broadcast data to be transmitted is stored in multiple nodes. When the node executes step S100, part of the broadcast data or all of the broadcast data stored in the node is encapsulated into a message packet as a payload. The message packet may include at least a source address (that is, the address of the source node sending the broadcast data) and carry a predetermined identifier to indicate that the message packet is a broadcast message packet, that is, the predetermined identifier indicates that the broadcast data in the broadcast message packet needs to be stored in multiple nodes on the transmission path, rather than just included in the destination node that is the end point of the transmission path.
[0018] In this embodiment, the predetermined identifier may be carried in the packet header but is not limited to it.
[0019] In this embodiment, the intermediate node refers to other nodes other than the node as the starting point and the node as the end point on the transmission path; after the broadcast message packet is sent from the starting point, it is forwarded by one or more intermediate nodes and reaches the end point.
[0020] In this embodiment, the method of carrying the predetermined identifier may include: adding a predetermined identifier to the message packet, that is, the message packet with the predetermined identifier is a broadcast message packet, and the message packet without the predetermined identifier is a non-broadcast message packet. The predetermined identifier may be a new field or control character added to the message packet, and the message packet with the new field or control character added is a broadcast message packet. If the new field or control character is not carried, it is not a broadcast message packet. Alternatively, the predetermined identifier may be an identifier bit set to a specific value in the message packet. For example, if the predetermined identifier bit in a message packet is set to "1", it indicates that the message packet carries the corresponding predetermined identifier, and if it is set to "0", it does not carry the corresponding predetermined identifier. If there are multiple predetermined identifiers, a message packet may only carry some of the predetermined identifiers, but as long as it carries one predetermined identifier, the message packet is a broadcast message packet; for example, two predetermined identifiers may be set, wherein the first predetermined identifier is a first identifier bit set to "1", and the second predetermined identifier is a second identifier bit set to "1"; if the first identifier bit in the message packet is "1" and the second identifier bit is "0", it indicates that the message packet is a broadcast message packet and only carries the first predetermined identifier.
[0021] According to the data broadcasting method of this embodiment, when a node needs to transmit the same data to multiple other nodes, it only needs to encapsulate a small number of message packets carrying predetermined identifiers, without having to encapsulate a message packet for each node. Therefore, the number of message packets is greatly reduced, which effectively reduces the load of the grid network, shortens the transmission time of the message packets, and improves the efficiency of data transmission. By adding a predetermined identifier for indication, the effect of "broadcasting" the data can be achieved, and there is no need to modify the network grid hardware. Data broadcasting can be achieved by simply modifying the transmission protocol. It is low-cost and easy to implement.
[0022] In an exemplary embodiment, the predetermined identifier may include a forwarding identifier, wherein the forwarding identifier is used to indicate that the broadcast message packet is forwarded along a predetermined transmission path.
[0023] In this embodiment, for a node that receives a broadcast message packet, when the predetermined identifier is a forwarding identifier, it is determined to save the broadcast data in the broadcast message packet and forward the broadcast message packet along a predetermined transmission path indicated by the forwarding identifier.
[0024] In this embodiment, a broadcast message packet with a forwarding identifier may be sent to instruct multiple nodes on a predetermined transmission path to sequentially store and forward the broadcast data, thereby reducing the number of message packets.
[0025] In this embodiment, the destination address is not required, that is, the destination node is not specified; the nodes on the transmission path forward the broadcast message packet one by one until the broadcast message packet is forwarded from the starting point of the transmission path along one or more intermediate nodes to the end point of the transmission path; wherein the starting point is the node that starts sending the broadcast message packet, and the end point is the node that is adjacent to only one node on the transmission path.
[0026] In this embodiment, the packet header of the broadcast message packet may not carry the destination address, or may carry an invalid destination address (for example, set to 0), or the node receiving the broadcast message packet may ignore the destination address.
[0027] In this embodiment, for a transmission path, the end point may be one or two; for example, in Figure 2 In the two-dimensional MESH network shown in the figure, the transmission path is the row of the node array, and the node E 1,3 As the starting point of the transmission path, node E transmits the broadcast message packet to the left and right nodes respectively. 1,1 and node E 1,Q In this embodiment, in step S100, for each node, when it is necessary to send the broadcast data stored in the node to other nodes on the predetermined transmission path, the address of the node is the source address, and the sending process is to transmit the broadcast message packet from the node to the intermediate nodes on the predetermined transmission path in sequence until the end point is reached.
[0028] In this embodiment, in step S200, for each node, when receiving a broadcast message packet sent by other nodes on a predetermined transmission path, and the current node is the end point on the transmission path, the broadcast data carried in the received broadcast message packet only needs to be saved without forwarding; when the current node is an intermediate node on the predetermined transmission path, and receives a broadcast message packet sent by the previous adjacent node in the transmission path, not only the broadcast data carried in the received broadcast message packet needs to be saved, but also the received broadcast message packet needs to be forwarded to the next adjacent node in the transmission path.
[0029] In this embodiment, the mesh network may include R predetermined transmission paths, R≥1, and each predetermined transmission path may correspond to a forwarding identifier, such as the rth transmission path corresponds to the rth identifier, r=1,2,...R, and the rth identifier is used to indicate that the message packet carrying the identifier is transmitted along the rth transmission path; each predetermined path is formed by a plurality of nodes connected in sequence. Alternatively, multiple predetermined transmission paths may use the same forwarding identifier, and the node receiving the broadcast message packet may determine where to forward the broadcast message packet according to which adjacent node the broadcast message packet comes from; for example, if the broadcast message packet comes from the previous adjacent node on the first transmission path, it is forwarded to the next adjacent node on the first transmission path; when the broadcast message packet comes from the previous adjacent node on the second transmission path, it is forwarded to the next adjacent node on the second transmission path, and so on.
[0030] In this embodiment, among multiple nodes on a predetermined transmission path, an intermediate node may have two opposite interfaces, respectively connecting two adjacent nodes in front and behind on the transmission path, and adjacent nodes in a predetermined path may be connected in sequence through interfaces.
[0031] In this embodiment, when there are multiple predetermined transmission paths, a node in the mesh network may exist on multiple predetermined transmission paths.
[0032] In this embodiment, if multiple nodes on a predetermined transmission path need to send broadcast data, each node may send the broadcast data in sequence, or multiple nodes may send the broadcast data in parallel.
[0033] In an exemplary embodiment, the plurality of nodes may form a node array, and the grid network may be a two-dimensional grid network, such as Figure 3 As shown; The forwarding identifier includes at least one of the following identifiers: a row identifier and a column identifier; The row identifier is used to indicate that the broadcast message packet is forwarded along the row of the node array; The column identifier is used to indicate that the broadcast message packet is forwarded along a column of the node array.
[0034] In this embodiment, the transmission path corresponding to the row identifier is a row in the node array where the current node is located, and the transmission path corresponding to the column identifier is a column in the node array where the current node is located.
[0035] In this embodiment, there can be two forwarding identifiers: a row identifier and a column identifier; there are two transmission paths; the rows and columns in the node array correspond to the row identifier and the column identifier, respectively. For a node, if the received message packet contains a row identifier, it indicates that the message packet is a broadcast message packet, and the corresponding transmission path is the row where the node is located; if the received message packet contains a column identifier, it indicates that the message packet is a broadcast message packet, and the corresponding transmission path is the column where the node is located.
[0036] In this embodiment, two new identification bits can be added to the header of the message packet: a row broadcast identification bit and a column broadcast identification bit; the row identification bit is set to "1" to carry the row identification bit, that is: when the node parses the message packet and finds that the row broadcast identification bit is "1", it is considered that the message packet carries the row identification bit, and when it is "0", it is considered that the message packet does not carry the row identification bit; the column identification bit is set to "1" to carry the column identification bit, that is: when the node parses the message packet and finds that the column broadcast identification bit is "1", it is considered that the message packet carries the column identification bit, and when it is "0", it is considered that the message packet does not carry the column identification bit.
[0037] In this embodiment, the two-dimensional grid network is Figure 3 The grid network shown has P rows and Q columns, including P×Q nodes E p,q , p=1,2,...P, q=1,2,...Q, the predetermined transmission path includes P row paths (rows of the node array) corresponding to P rows one by one, and Q column paths (columns of the node array) corresponding to Q columns one by one. Each node E p,q are on one row path (the pth row path) and one column path (the qth column path), that is, each node is on two transmission paths, and each node E p,q Both support broadcasting message packets on the row path and column path where the node is located.
[0038] In this embodiment, taking the row path of row 1 as an example, node E 1,1 and E 1,Q Can be used as the end point, other nodes E 1, q =2,3,……Q-1 It can be used as an intermediate node, and the other row paths are similar, so we will not go into details here.
[0039] In this embodiment, taking the column path of the third column as an example, node E 1,3 and E P,3 Can be used as the end point, other nodes E p=2,3,……P-1,3 It can be used as an intermediate node, and the other column paths are similar, so I will not go into details here.
[0040] In this embodiment, the end point on one transmission path is not necessarily the end point on another transmission path. 1,3On the column path at column 3 it is an endpoint, but on the row path at row 1 it is an intermediate node.
[0041] In this embodiment, the nodes E located at the four corners of the grid network can be 1,1 , E 1,Q , E P,1 and E P,Q It is called a corner node. Each corner node has two interfaces, such as Figure 4a The corner node interface diagram shown in Figure 1 is shown in Figure 2. 1,1 Including south and east interfaces, E 1,Q Including west and south interfaces, E P,1 Including north and east interfaces, E P,Q Includes north and west interfaces.
[0042] In this embodiment, the nodes on the four edges of the mesh network except the four corner nodes can be called edge nodes. There are 2P+2Q-8 edge nodes, and each edge node has three interfaces, such as Figure 4b The edge node interface diagram shown in Figure 1 is based on E 1,3 For example, it includes west, east and south interfaces. The interfaces of other edge nodes are similar and so on, which will not be described here one by one.
[0043] In this embodiment, nodes other than corner nodes and edge nodes in the mesh network can be called internal nodes. There are (P-2)×(Q-2) internal nodes. Each internal node includes four interfaces: north, west, east and south interfaces. Figure 4c The schematic diagram of the inner node interface is shown.
[0044] In this embodiment, the corner nodes are end nodes in both the row path and the column path, and can serve as the end points of the row path and the column path; the edge nodes are end nodes of the row path or the column path, and can serve as the end points of the row path or the column path respectively; the internal nodes are the middle nodes on the row or column.
[0045] In one implementation of this embodiment, the east interface and the west interface are two relative interfaces on the row path; each inner node on the row path is provided with an east interface and a west interface, the leftmost end node on the row path is provided with an east interface, and the rightmost end node is provided with a west interface.
[0046] In this implementation manner, on the row path, when the node in the leftmost column (the first column of the node array) is used as the starting point, the broadcast message packet carrying the row identifier encapsulated by the current node is sent to the east interface; when it is used as the end point, the broadcast message packet is received from the east interface of the current node and forwarding is stopped; when the node in the rightmost column (the last row of the node array) is used as the end point, the broadcast message packet carrying the row identifier encapsulated by the current node is sent to the west interface; when it is used as the end point, the broadcast message packet is received from the west interface of the current node and no longer forwarded; when the node in other columns is used as the starting point, the broadcast message packet carrying the row identifier encapsulated by the current node is sent to the east interface and the west interface; when it is used as the intermediate node, the broadcast message packet received from the east interface of the current node is forwarded to the west interface of the current node, and the broadcast message packet received from the west interface of the current node is forwarded to the east interface of the current node.
[0047] In this implementation, the north interface and the south interface are two relative interfaces on the column path; each inner node on the column path is provided with a north interface and a south interface, the bottom edge node on the column path is provided with a north interface, and the top edge node is provided with a south interface.
[0048] In this embodiment, on the column path, when the node in the top row (the first row of the node array) is used as the starting point, the broadcast message packet carrying the column identifier encapsulated by the current node is sent to the south interface, and when it is used as the end point, the broadcast message packet is received from the south interface of the current node and is not forwarded; when the node in the bottom row (the last row of the node array) is used as the starting point, the broadcast message packet carrying the column identifier encapsulated by the current node is sent to the north interface, and when it is used as the end point, the broadcast message packet is received from the north interface of the current node and is not forwarded; when the nodes in other rows are used as the starting point, the message packet carrying the column identifier encapsulated by the current node is sent to the north interface and the south interface, and when it is used as the intermediate node, the broadcast message packet received from the north interface of the current node is forwarded to the south interface of the current node, and the broadcast message packet received from the south interface of the current node is forwarded to the north interface of the current node.
[0049] In this embodiment, the intermediate node can directly save the broadcast data in the forwarded broadcast message packet, or can decide whether to save it based on the value of the corresponding identification bit in the storage identifier; the end node can directly save the broadcast data in the received broadcast message packet, or can decide whether to save it based on the value of the corresponding identification bit in the storage identifier.
[0050] The two-dimensional grid network of this embodiment supports parallel data transmission on P rows and Q columns, with high data transmission efficiency. Data broadcast on the row path can be realized according to the row identifier, and data broadcast on the column path can be realized according to the column identifier. The judgment logic is simple, and there is no need to add other information to the routing table. Moreover, there is no transmission interference between the paths, and the data transmission reliability is high.
[0051] In an exemplary embodiment, the broadcast data may include first data and second data; step S100 may include steps S110-S120: S110: A node that needs to transmit the first data carries the row identifier in a first broadcast message packet used to transmit the first data, and sends the first broadcast message packet along the row of the node array; S120: The node that needs to transmit the second data carries the column identifier in a second broadcast message packet used to transmit the second data, and sends the second broadcast message packet along the columns of the node array.
[0052] In this embodiment, the first data and the second data can be different data. The first data is data that needs to be broadcast in the row direction, and the second data is data that needs to be broadcast in the column direction. The first broadcast message packet carries at least a row identifier and the first data, and the second broadcast message packet carries at least a column identifier and the second data; each node supports sending the first broadcast message packet and the second broadcast message packet.
[0053] In another exemplary embodiment, the broadcast data may include third data, and the third data needs to be sent along the row path and the column path respectively; the node that needs to transmit the third data carries the row identifier in a first broadcast message packet used to transmit the third data and sends the first broadcast message packet along the row path, and carries the column identifier in a second broadcast message packet used to transmit the third data and sends the second broadcast message packet along the column path.
[0054] In an exemplary embodiment, the step S200 of “when the node is an intermediate node on the transmission path of the received broadcast message packet, forwarding the received broadcast message packet” may include steps S210-S220: S210: The node that receives the first broadcast message packet forwards the received first broadcast message packet along the row of the node array when the node is an intermediate node on the row of the node array; S220: The node that receives the second broadcast message packet forwards the received second broadcast message packet along the column of the node array when the node is an intermediate node on the column of the node array.
[0055] Steps S210 and S220 are not sequentially ordered and can be executed in parallel.
[0056] In this embodiment, for the intermediate node in a row, the interface for receiving the first broadcast message packet and the interface for forwarding the first broadcast message packet are two opposite interfaces in the row direction.
[0057] In this embodiment, for the intermediate node in a column, the interface for receiving the second broadcast message packet and the interface for forwarding the second broadcast message packet are two interfaces opposite to each other in the column direction.
[0058] In an exemplary embodiment, the “forwarding the received first broadcast message packet along the row of the node array” in step S210 may include steps S211-S212: S211: Determine a receiving interface for a first broadcast message packet; S212: forwarding the received first broadcast message packet to a node connected to an interface opposite to the receiving interface in the row direction; that is: When the receiving interface is the first interface, forwarding the received first broadcast message packet to a node connected to the second interface of the node; When the receiving interface is the second interface, forwarding the received first broadcast message packet to a node connected to the first interface of the node; The first interface and the second interface are two interfaces opposite to each other in a row direction.
[0059] In one implementation of this embodiment, the first interface is Figure 4a , Figure 4b and Figure 4c The east interface in the corresponding second interface is Figure 4a , Figure 4b and Figure 4c The west interface in .
[0060] In another implementation of this embodiment, the first interface is Figure 4a , Figure 4b and Figure 4c The west interface in the example is: Figure 4a , Figure 4b and Figure 4c The east interface in .
[0061] In an exemplary embodiment, the “forwarding the received second broadcast message packet along the columns of the node array” in step S220 may include steps S221-S222: S221: Determine a receiving interface for a second broadcast message packet; S222: forwarding the received second broadcast message packet to a node connected to an interface opposite to the receiving interface in the column direction; that is: When the receiving interface is the third interface, forwarding the received second broadcast message packet to a node connected to the fourth interface of the node; When the receiving interface is the fourth interface, forwarding the received second broadcast message packet to a node connected to the third interface of the node; The third interface and the fourth interface are two interfaces opposite to each other in a column direction.
[0062] In one implementation of this embodiment, the third interface is Figure 4a , Figure 4b and Figure 4c The north interface in , correspondingly, the fourth interface is Figure 4a , Figure 4b and Figure 4c The south interface in.
[0063] In another implementation of this embodiment, the third interface is Figure 4a , Figure 4b and Figure 4c The south interface in the example, correspondingly, the fourth interface is Figure 4a , Figure 4b and Figure 4c The north interface in .
[0064] In an exemplary embodiment, the header of the broadcast message packet may include a row broadcast flag and a column broadcast flag; The step S110 of “carrying the row identifier in a first broadcast message packet for transmitting the first data” may include step S111: S111: setting a row broadcast flag in a packet header of a first broadcast message packet used to transmit the first data to a first predetermined value; The step S120 of “carrying the column identifier in a second broadcast message packet used to transmit the second data” may include step S121: S121: Setting a column broadcast flag in a packet header of a second broadcast message packet used to transmit the second data to a first predetermined value.
[0065] In this embodiment, when executing step S110, a row broadcast flag and a column broadcast flag can be first added to the first broadcast message packet. The row broadcast flag and the column broadcast flag are both binary flags. The row broadcast flag and the column broadcast flag are both set to 0. Thereafter, step S111 is executed. For example, in step S111, the first predetermined value is 1, that is, the row broadcast flag in the packet header of the first broadcast message packet is set to 1, and the column broadcast flag remains at 0. Whether the first broadcast message packet is sent along the row can be determined based on the value of the row broadcast flag.
[0066] In this embodiment, when executing step S120, a row broadcast flag and a column broadcast flag can be first added to the second message packet. Both the row broadcast flag and the column broadcast flag are binary flags. The row broadcast flag and the column broadcast flag are both set to 0. Thereafter, step S121 is executed. For example, in step S121, the first predetermined value is 1, that is, the column broadcast flag in the packet header of the second broadcast message packet is set to 1, and the row broadcast flag remains at 0. Whether the second message packet is sent along the column can be determined based on the value of the column broadcast flag.
[0067] In an exemplary embodiment, the “sending the first broadcast message packet along the row of the node array” in step S110 may include: When the node that needs to transmit the first data is a node in the first column or the last column of the node array, the first broadcast message packet is sent to a node in the same column adjacent to the node array; when the node that needs to transmit the first data is a node other than the first column and the last column of the node array, the first broadcast message packet is sent to two nodes in the same column adjacent to the node array respectively; The step S120 of “sending the second broadcast message packet along the columns of the node array” may include: When the node that needs to transmit the second data is a node in the first row or the last row of the node array, the second broadcast message packet is sent to a node in the same column and adjacent row; when the node that needs to transmit the second data is a node other than the first row and the last row of the node array, the second broadcast message packet is sent to two nodes in the same column and adjacent row respectively.
[0068] In this embodiment, Figure 2 Node E in 2,1 For example, E 2,1 The node on the second row is an end node, and carries a row identifier in the first message packet used to transmit the first data, and sends a message to an adjacent node E on the second row. 2,2 Send the message packet; E 2,1 The intermediate node on the first column carries the column identifier in the second message packet used to transmit the second data, and sends a message to two adjacent nodes E on the first column. 1,1 and E 3,1 The message packet is sent, and other nodes are similarly sent, which will not be described in detail here.
[0069] In another exemplary embodiment, the mesh network may be a three-dimensional mesh network; The forwarding identifier includes at least one of the following identifiers: a first forwarding identifier, a second forwarding identifier, and a third forwarding identifier; The first forwarding identifier is used to indicate that the broadcast message packet carrying the first forwarding identifier is the first broadcast message packet transmitted along the X-axis direction; The second forwarding identifier is used to indicate that the broadcast message packet carrying the second forwarding identifier is a second broadcast message packet transmitted along the Y-axis direction; The third forwarding identifier is used to indicate that the broadcast message packet carrying the third forwarding identifier is a third broadcast message packet transmitted along the Z-axis direction.
[0070] In other embodiments, the predetermined transmission path may not be limited to a path along a certain direction, but a path formed by connecting multiple adjacent nodes in sequence, such as Figure 2 In the mesh network shown, node E can be 1,1 、E 1,2 、E 1,3 、E 2,3 、E 3,3 、E 3,4 Connected in sequence to form a transmission path S; node E 1,1 and node E 3,4 can be used as the end point of the transmission path S, and other nodes can be used as intermediate nodes of the transmission path S; the routing table of each node can store the addresses or interfaces of the adjacent nodes in each predetermined transmission path, so as to complete the forwarding of the broadcast message packet on the predetermined transmission path; for example, when node E 2,3 From Node E 1,3 After receiving the broadcast message packet, if the forwarding identifier determines that the broadcast message packet belongs to the transmission path S, the address or interface of the adjacent node in the transmission path S in the routing table can be searched, thereby forwarding the message to node E. 3,3 (north interface) forwards the broadcast message packet.
[0071] In an exemplary embodiment, the predetermined identifier may include: a storage identifier; The storage identifier includes at least N identification bits, where N is the number of intermediate nodes on the transmission path of the broadcast message packet; the N identification bits correspond one-to-one to the intermediate nodes on the transmission path of the broadcast message packet; the value of each identification bit is used to indicate whether the corresponding intermediate node stores the broadcast data in the broadcast message packet; The node receiving the broadcast message packet determines, according to the predetermined identifier, whether to save the broadcast data carried by the received broadcast message packet, including: The node that receives the broadcast message packet queries the identification bit corresponding to the node in the storage identification, and determines whether to save the broadcast data carried by the received broadcast message packet according to the value of the identification bit.
[0072] In this embodiment, transmission can be performed in a point-to-point manner, and the intermediate node is a node other than the source node (i.e., the starting point) and the destination node (i.e., the end point) on the transmission path; the source node carries the destination address corresponding to the destination node in the broadcast message packet, and the node receiving the broadcast message packet routes according to the destination address of the broadcast message packet, and forwards the broadcast message packet to the next hop node in the route until it is transmitted to the destination node; during the transmission process, the intermediate node on the transmission path can decide to save the broadcast data in the broadcast message packet based on the storage identifier; in this way, by adding a predetermined identifier, a point-to-point transmission can send the broadcast data to multiple specified nodes, which can reduce the number of message packets and flexibly select the node for saving the broadcast data.
[0073] In this embodiment, different values of the identification bit can represent different meanings, for example, "1" represents saving the broadcast data, and "0" represents not saving; after an intermediate node receives a broadcast message packet, it queries the corresponding identification bit, if it is "1" it is saved and then forwarded, if it is "0" it is forwarded directly.
[0074] In this embodiment, it may be assumed that the destination node needs to store the broadcast data, or a corresponding identification bit may be set for the destination node.
[0075] An example is Figure 2 As shown, seven nodes E1, E2...E7 are connected in sequence. Assuming that node E1 needs to transmit broadcast data to nodes E2, E6 and E7, according to the method of this embodiment, node E1 can initiate point-to-point transmission to destination node E7 as a source node. Node E1 sets the destination address to the address of node E7 in the transmitted broadcast message packet, and sets the storage identifier to 10001. The five identification bits in the storage identifier correspond to nodes E2, E3, E4, E5 and E6 respectively.
[0076] After the broadcast message packet is sent from the source node E1, it is routed and forwarded in sequence through the intermediate nodes E2, E3, E4, E5 and E6 to reach the destination node E7. After receiving the broadcast message packet, nodes E2 and E6 will save the broadcast data in the broadcast message packet because the corresponding identification bit is "1"; while nodes E3, E4, and E5 will not save the broadcast data after receiving the broadcast message packet because the corresponding identification bit is "0". The destination node E7 can save the broadcast data by default, or the storage flag can add an identification bit corresponding to the destination node, such as setting it to 100011. The destination node E7 decides whether to save the broadcast data based on the value of the corresponding identification bit.
[0077] In an exemplary embodiment, the predetermined identifier may include a forwarding identifier and a storage identifier; wherein the forwarding identifier is used to indicate that the broadcast message packet is forwarded along a predetermined transmission path, and the storage identifier is used to indicate whether a node receiving the broadcast message packet saves the broadcast data.
[0078] The storage identifier includes at least N identification bits, which correspond to the N intermediate nodes one by one, and the value of each identification bit is used to indicate whether the corresponding intermediate node stores the broadcast data.
[0079] In this embodiment, it is not necessary to specify the destination node; each intermediate node determines whether to store the broadcast data according to the value of the corresponding identification bit in the storage identification. In this embodiment, by configuring the value of the identification bit, some nodes in the broadcast direction can be controlled not to receive data, which not only reduces the message packets, but also is more flexible.
[0080] In this embodiment, the storage identifier may also include an identifier corresponding to an end point of the transmission path, and the value is used to indicate whether the end point stores the broadcast data.
[0081] In an exemplary implementation of this embodiment, Figure 2 As an example, the predetermined transmission paths are E1, E2, ..., E7. Assume that the node that needs to transmit broadcast data is E1. E1 carries a forwarding identifier, a storage identifier, and a source address (the address of node E1) in the broadcast message packet. The forwarding identifier is used to indicate the transmission path of the broadcast message packet. Figure 2 The transmission path shown in the figure is transmitted, and the storage identifier may include 6 identification bits 110101, which correspond to nodes E2, E3, E4, E5, E6, and E7 respectively. When the identification bit is 1, it indicates that the node receiving the broadcast message packet saves the broadcast data carried by the broadcast message packet, and when the identification bit is 0, it indicates that the node receiving the broadcast message packet does not save the broadcast data carried by the broadcast message packet. The transmission process is as follows: Node E1 encapsulates the broadcast message packet, carries the forwarding identifier corresponding to the transmission paths E1, E2, ... E7, the storage identifier 110101, and the address of node E1 in the broadcast message packet, and then transmits the broadcast message packet to node E2; After receiving the broadcast message packet, node E2 recognizes that the value of the identification bit corresponding to the node is 1, saves the broadcast data carried by the broadcast message packet, and continues to transmit the broadcast message packet to the next node (i.e., node E3) in the predetermined transmission path according to the forwarding identifier; Similarly, after receiving the broadcast message packet, node E3 identifies that the identification bit corresponding to the node is 1, saves the broadcast data carried by the broadcast message packet, and continues to transmit the broadcast message packet to node E4 according to the forwarding identifier; After receiving the broadcast message packet, node E4 recognizes that the identification bit corresponding to the node is 0, and continues to transmit the broadcast message packet to node E5 only according to the forwarding identifier; After receiving the broadcast message packet, node E5 identifies that the identification bit corresponding to the node is 1, saves the broadcast data carried by the broadcast message packet, and continues to transmit the broadcast message packet to node E6 according to the forwarding identifier; After receiving the broadcast message packet, node E6 identifies that the identification bit corresponding to the node is 0, and continues to transmit the broadcast message packet to node E7 only according to the forwarding identifier; After receiving the broadcast message packet, node E7 identifies that the identification bit corresponding to the node is 1, and saves the broadcast data carried by the broadcast message packet; since the node is not an intermediate node on the transmission path, it does not continue to forward it.
[0082] In another implementation of this embodiment, Figure 2 Taking the case shown as an example, the predetermined transmission path includes 7 nodes E1, E2...E7. Assuming that the node that needs to transmit broadcast data is E3, E3 carries a forwarding identifier, a storage identifier and a source address (the address of node E3) in the broadcast message packet. The forwarding identifier is used to indicate that the message packet is transmitted along the transmission path. The storage identifier may include 6 identification bits 110101, which correspond to E1, E2, E4, E5, E6, and E7 respectively. When the identification bit is 1, it indicates that the node receiving the broadcast message packet saves the broadcast data carried by the broadcast message packet. When the identification bit is 0, it indicates that the node receiving the broadcast message packet does not save the broadcast data carried by the broadcast message packet. The transmission process is as follows: Node E1 encapsulates a broadcast message packet, carries the forwarding identifier corresponding to the transmission paths E1, E2, ..., E7, the storage identifier 110101, and the address of node E3 in the broadcast message packet, and transmits the broadcast message packet to nodes E2 and E4 respectively; After receiving the broadcast message packet, node E2 identifies that the identification bit corresponding to the node is 1, saves the broadcast data carried by the broadcast message packet, and continues to transmit the broadcast message packet to node E1 according to the forwarding identifier; After receiving the broadcast message packet, node E1 identifies that the identification bit corresponding to this node is 1, and saves the broadcast data carried by the broadcast message packet; since this node is not an intermediate node on the transmission path, it does not continue to forward it; After receiving the broadcast message packet, node E4 recognizes that the identification bit corresponding to the node is 0, and continues to transmit the broadcast message packet to node E5 only according to the forwarding identifier; After receiving the broadcast message packet, node E5 identifies that the identification bit corresponding to the node is 1, saves the broadcast data carried by the broadcast message packet, and continues to transmit the broadcast message packet to node E6 according to the forwarding identifier; After receiving the broadcast message packet, node E6 identifies that the identification bit corresponding to the node is 0, and continues to transmit the broadcast message packet to node E7 only according to the forwarding identifier; After receiving the broadcast message packet, node E7 identifies that the identification bit corresponding to the node is 1, and saves the broadcast data carried by the broadcast message packet; since the node is not an intermediate node on the transmission path, it does not continue to forward it.
[0083] On the other hand, the embodiment of the present application further provides a network on chip (Network on Chip, NoC), including multiple nodes, the multiple nodes communicate through a mesh network; each of the nodes includes a routing module 52, a transmission module 51 and a storage module 53, such as Figure 5 As shown; The transmission module 51 is configured to: when broadcast data needs to be transmitted, read the broadcast data from the storage module and encapsulate it into a broadcast message packet for transmitting the broadcast data; The routing module 52 is configured to: instruct the transmission module 51 to carry a predetermined identifier in the broadcast message packet; when the transmission module receives the broadcast message packet, determine according to the predetermined identifier whether to instruct the storage module 53 to save the broadcast data carried by the received broadcast message packet, and when the current node is an intermediate node on the transmission path of the received broadcast message packet, instruct the transmission module 51 to forward the received broadcast message packet; The storage module 53 is configured to: store broadcast data to be transmitted; and store the broadcast data carried in the broadcast message packet received by the transmission module 51 according to the instruction of the routing module 52 .
[0084] In an exemplary embodiment, the predetermined identifier may include: a forwarding identifier, which is used to indicate that the broadcast message packet is forwarded along a predetermined transmission path.
[0085] In an exemplary embodiment, the plurality of nodes may form a node array, and the mesh network may be a two-dimensional mesh network; The forwarding identifier may include at least one of the following identifiers: a row identifier, a column identifier; The row identifier is used to indicate that the broadcast message packet is forwarded along the row of the node array; The column identifier is used to indicate that the broadcast message packet is forwarded along the column of the node array.
[0086] In an exemplary implementation of this embodiment, the broadcast data includes first data and second data; In this implementation, the routing module 52 instructs the transmission module 51 to carry a predetermined identifier in the broadcast message packet, which may include: The routing module 52 in the node that needs to transmit the first data instructs the transmission module 51 to carry a row identifier in a first broadcast message packet used to transmit the first data; The routing module 52 in the node that needs to transmit the second data instructs the transmission module 51 to carry the column identifier in the second broadcast message packet used to transmit the second data.
[0087] In this embodiment, when sending a broadcast message packet, the transmission module 51 sends a first broadcast message packet along the rows of the node array and sends a second broadcast message packet along the columns of the node array.
[0088] In an exemplary implementation of this embodiment, when the routing module 52 is an intermediate node on the transmission path of the received broadcast message packet, instructing the transmission module 51 to forward the received broadcast message packet may include: The routing module 52 in the node that receives the first broadcast message packet instructs the transmission module 51 to forward the received first broadcast message packet along the row of the node array when the node is an intermediate node on the row of the node array; The routing module 52 in the node that receives the second broadcast message packet instructs the transmission module 51 to forward the received second broadcast message packet along the column of the node array when the node is an intermediate node on the column of the node array.
[0089] In an exemplary implementation of this embodiment, the transmission module 51 forwards the received first broadcast message packet along the row of the node array, which may include: The transmission module 51 determines a receiving interface of the first broadcast message packet; forwards the received first broadcast message packet to a node connected to an interface opposite to the receiving interface in a row direction; The transmission module 51 forwards the second broadcast message packet along the column of the node array, which may include: The transmission module 51 determines a receiving interface of the second broadcast message packet; and forwards the received second broadcast message packet to a node connected to an interface opposite to the receiving interface in a column direction.
[0090] In an exemplary implementation of this embodiment, the transmission module 51 may carry the row identifier in the first message packet used to transmit the first data, which may include: The transmission module 51 sets the row broadcast flag in the packet header of the first message packet used to transmit the first data to a first predetermined value; The transmission module 51 may carry the column identifier in a second message packet used to transmit the second data: The transmission module 51 sets the column broadcast flag in the packet header of the second message packet used to transmit the second data to a first predetermined value.
[0091] In an exemplary implementation of this embodiment, the transmission module 51 sends the first broadcast message packet along the row of the node array, which may include: When the node to be transmitted with the first data is a node in the first column or the last column of the node array, the transmission module 51 sends a first broadcast message packet to a node in the same adjacent column; when the node to be transmitted with the first data is a node other than the first column and the last column of the node array, the transmission module 51 sends the first broadcast message packet to two nodes in the same adjacent column respectively; The transmission module 51 sends the second broadcast message packet along the columns of the node array, which may include: When the node that needs to transmit the second data is a node in the first row or the last row in the node array, the transmission module 51 sends the second broadcast message packet to a node in the adjacent row of the same column; when the node that needs to transmit the second data is a node other than the first row and the last row in the node array, the transmission module 51 sends the second broadcast message packet to two nodes in the adjacent row of the same column respectively.
[0092] In an exemplary embodiment, the mesh network may be a three-dimensional mesh network; The forwarding identifier may include at least one of the following identifiers: a first forwarding identifier, a second forwarding identifier, and a third forwarding identifier; The first forwarding identifier is used to indicate that the broadcast message packet carrying the first forwarding identifier is the first broadcast message packet transmitted along the X-axis direction; The second forwarding identifier is used to indicate that the broadcast message packet carrying the second forwarding identifier is a second broadcast message packet transmitted along the Y-axis direction; The third forwarding identifier is used to indicate that the broadcast message packet carrying the third forwarding identifier is a third broadcast message packet transmitted along the Z-axis direction.
[0093] In an exemplary embodiment, the predetermined identification includes: a storage identification; The storage identifier includes at least N identification bits, where N is the number of intermediate nodes on the transmission path of the broadcast message packet; the N identification bits correspond one-to-one to the intermediate nodes on the transmission path of the broadcast message packet; the value of each identification bit is used to indicate whether the corresponding intermediate node stores the broadcast data in the broadcast message packet; The routing module 52 determines whether to instruct the storage module 53 to save the broadcast data carried by the received broadcast message packet according to the predetermined identifier, which may include: The routing module 52 in the node that receives the broadcast message packet searches the identification bit corresponding to the node in the storage identification, and determines whether to instruct the storage module 53 to save the broadcast data carried by the received broadcast message packet according to the value of the identification bit.
[0094] In this embodiment, the predetermined identifier may include not only the storage identifier but also the forwarding identifier.
[0095] The following is a description using an application example. The data broadcasting method of the application example is based on Figure 6The two-dimensional grid network with 3 rows and 4 columns shown is executed as follows: Node E 1,1 The storage module stores the first data A 11 and the second data B 11 ; Node E 1,2 The storage module stores the first data A 12 and the second data B 12 ; Node E 1,3 The storage module stores the first data A 13 and the second data B 13 ; Node E 1,4 The storage module stores the first data A 14 and the second data B 14 ; Node E 2,1 The storage module stores the first data A 21 and the second data B 21 ; Node E 2,2 The storage module stores the first data A 22 and the second data B 22 ; Node E 2,3 The storage module stores the first data A 23 and the second data B 23 ; Node E 2,4 The storage module stores the first data A 24 and the second data B 24 ; Node E 3,1 The storage module stores the first data A 31 and the second data B 31 ; Node E 3,2 The storage module stores the first data A 32 and the second data B 32 ; Node E 3,3 The storage module stores the first data A 33 and the second data B 33 ; Node E 3,4 The storage module stores the first data A 34 and the second data B 34 ; In this application example, the predetermined identifier includes a row identifier and a column identifier. Carrying a row identifier means that the row broadcast identifier is set to 1, and carrying a column identifier means that the column broadcast identifier is set to 1. The intermediate node saves the broadcast data in the forwarded broadcast message packet by default.
[0096] Take node E 2,2 For example, the process of sending a broadcast message packet includes: In order to 22 Send it to other peer nodes and send B 22 When sending to other nodes in the same column, node E 2,2 A 22 Encapsulate into the first broadcast message packet, and 22 Encapsulated into the second broadcast message packet, the first broadcast message packet and the second broadcast message packet both carry the source address in their headers, and the source address is node E 2,2 The first broadcast message packet and the second broadcast message packet both include a row broadcast flag and a column broadcast flag, the initial value of the row broadcast flag is set to 0, and the initial value of the column broadcast flag is set to 0; Node E 2,2 After setting the row broadcast flag in the first broadcast message packet to 1 and the column broadcast flag in the second broadcast message packet to 1, the first broadcast message packet is sent to node E. 2,1 and E 2,3 Send, send the second broadcast message packet to node E 1,2 and E 3,2 send.
[0097] In this application example, the process of sending broadcast message packets by the other 11 nodes can be deduced in the same way.
[0098] The following takes the node in row 2 as an example to illustrate the process of receiving and forwarding the first broadcast message packet: Node E 2,2 Received from node E 2,1 Sent with A 21 After the first broadcast message packet, save A 21 and will carry A 21 The first broadcast message packet is forwarded to node E 2,3 Node E 2,3 Received with A 21 After the first broadcast message packet, it will carry A 21 The first broadcast message packet is forwarded to node E 2,4 Node E 2,4 Received with A 21 After the first broadcast message packet is saved A 21 ; Carry A 21 The first broadcast message packet line broadcast is completed.
[0099] Node E2,1 Received from node E 2,2 Sent with A 22 After the first broadcast message packet is saved A 22 Node E 2,3 Received from node E 2,2 Sent with A 22 After the first broadcast message packet is saved A 22 , and will carry A 22 The first broadcast message packet is forwarded to node E 2,4 Node E 2,4 Received with A 22 After the first broadcast message packet is saved A 22 ; Carry A 22 The first broadcast message packet line broadcast is completed.
[0100] Node E 2,4 Receive node E 2,3 Sent with A 23 After the first broadcast message packet is saved A 23 Node E 2,2 Receive node E 2,3 Sent with A 23 After the first broadcast message packet is saved A 23 , and will carry A 23 The first broadcast message packet is forwarded to node E 2,1 Node E 2,1 Received with A 23 After the first broadcast message packet is saved A 23 ; Carry A 23 The first broadcast message packet line broadcast is completed.
[0101] Node E 2,3 Receive node E 2,4 Sent with A 24 After the first broadcast message packet, save A 24 , and will carry A 24 The first broadcast message packet is forwarded to node E 2,2 Node E 2,2 Received with A 24 After the first broadcast message packet, save A 24 and will carry A 24 The first broadcast message packet is forwarded to node E 2,1 Node E 2,1 Received with A 24 After the first broadcast message packet is saved A 24 ; Carry A 24 The first broadcast message packet line broadcast is completed.
[0102] In this application example, the process of other row nodes receiving and forwarding the first broadcast message packet can be deduced in this way.
[0103] Below is the node E 1,2 The second data B 12 Taking the process of column broadcasting as an example, the process of receiving and forwarding the second broadcast message packet is described: Node E 2,2 Received from node E 1,2 Send with B 12 After the second broadcast message packet, save B 12 , and will carry B 12 The second message packet is forwarded to node E 3,2 Node E 3,2 Received B 12 The second message packet saves B 12 .
[0104] In this application example, the process of broadcasting the second data in other nodes can be deduced in the same way. 2,1 Receive the first data A 22 , A 23 , A 24 , receiving the second data B 11 and B 31 Node E 2,2 Receive the first data A 21 , A 23 , A 24 , receiving the second data B 12 and B 32 Node E 2,3 Receive the first data A 21 , A 22 , A 24 , receiving the second data B 13 and B 33 Node E 2,4 Receive the first data A 21 , A 22 , A 23 , receiving the second data B 14 and B 34 .
[0105] On the other hand, an embodiment of the present application further provides a chip, comprising a plurality of processor cores, wherein the plurality of processor cores communicate via a mesh network to form an on-chip network; the on-chip network is configured to exchange data between the plurality of processor cores and external data; The plurality of processor cores store instructions, and execute the data broadcasting method as described in the above embodiment according to the instructions.
[0106] On the other hand, the embodiment of the present application further provides a data processing method, which is applied to a two-dimensional grid network including P rows and Q columns of nodes; wherein the P×Q nodes E in the grid network p,q Respectively save the first submatrix obtained by splitting the first matrix X to be subjected to matrix multiplication, and the second submatrix obtained by splitting the second matrix W to be subjected to matrix multiplication; The data processing method includes steps S300-S400, such as Figure 7 As shown: S300: Each of the nodes uses the saved first sub-matrix as the first data and the saved second sub-matrix as the second data, respectively, and executes the data broadcasting method as described in the above embodiment, and sends the saved first sub-matrix to other nodes in the same row, and sends the saved second sub-matrix to other nodes in the same column; S400: Each of the nodes obtains a result submatrix corresponding to the node according to the first submatrix and the second submatrix stored and received by the node; wherein the result submatrices of P×Q nodes constitute a result matrix Y of matrix multiplication of the first matrix X and the second matrix W.
[0107] In this embodiment, the data processing method can be applied to a neural network model, the first matrix X can be an input matrix of a large neural network model, and the second matrix W can be a weight matrix of a large neural network model. Through the data processing method of this embodiment, the data transmission efficiency of the large neural network model is improved, large-scale data sets are supported, the training process of large neural networks can be accelerated, the convergence time of the model is shortened, and the generalization ability of the model is improved.
[0108] In this implementation, when executing step S400, each node can splice the first submatrix stored in the node and the first submatrix received from other Q-1 nodes in the same row to obtain a first spliced matrix; it can also splice the second submatrix stored in the node and the second submatrix received from other P-1 nodes in the same column to obtain a second spliced matrix; then multiply the first spliced matrix and the second spliced matrix to obtain a result submatrix; based on the result submatrices corresponding to the P×Q nodes respectively, a result matrix Y with M rows and N columns can be obtained.
[0109] Alternatively, each node may pair the first submatrix stored and received by the node with the second submatrix stored and received by the node, where each pair includes a first submatrix and a second submatrix, and then perform matrix multiplication pair by pair.
[0110] In this embodiment, in the large matrix multiplication calculation corresponding to the large neural network model, a parallel data transmission method can be used to greatly improve the data transmission efficiency of the large matrix. The payload included in each message packet is converted from the entire matrix to a sub-matrix, and the data volume of the sub-matrix is the input matrix or the weight matrix. Or lower, the load is greatly reduced, further improving the efficiency of data transmission.
[0111] In order to illustrate the data processing method of this embodiment, an application example is used to describe it in detail. Taking P=2 as an example, the calculation Y=X×W can be performed in 7 steps S1-S7. The calculation is based on a two-dimensional grid network with 2 rows and 2 columns, such as Figure 8 As shown; where the array of the first submatrix into which X is split is , the array of the second sub-matrix into which W is split is , node E 1,1 The storage module saves X 11 and W 11 , E 1,2 The storage module saves X 12 and W 12 , E 2,1 The storage module saves X 21 and W 21 , E 2,2 The storage module saves X 22 and W 22 ; S1: Node E 1,1 The sending unit will X 11 Encapsulate into a first broadcast message packet, and receive the instruction of the routing module to carry the row identifier in the first broadcast message packet, and send the first broadcast message packet to node E 1,2 Node E 2,1 The sending unit will X 21 Encapsulate into a first broadcast message packet, and receive the instruction of the routing module to carry the row identifier in the first broadcast message packet, and send the first message packet to node E 2,2 ; S2: Node E 1,1 The sending unit will W 11 Encapsulate into a second broadcast message packet, receive the instruction of the routing module to carry the column identifier in the second broadcast message packet, and send the second broadcast message packet to node E 2,1 Node E 1,2 The sending unit will W 12 Encapsulate into a second broadcast message packet, receive the instruction of the routing module to carry the column identifier in the second message packet, and send the second broadcast message packet to node E 2,2 ; S3: Each node multiplies the matrix of this transmission, such as node E 1,1 Is X 11 and W 11 Multiply, the multiplication results of the four nodes can form the matrix Y1= ; S4: Node E 1,2 The sending unit will X 12 Encapsulate into a first message packet, and receive the instruction of the routing module to carry the row identifier in the first message packet, and send the first message packet to node E 1,1 Node E 2,2 The sending unit will X 22 Encapsulate into a first message packet, and receive the instruction of the routing module to carry the row identifier in the first message packet, and send the first message packet to node E 2,1 ;; S5: Node E 2,1 The sending unit will W 21 Encapsulate into a second message packet, and receive the instruction of the routing module to carry the column identifier in the second message packet, and send the second message packet to node E 1,1 Node E 2,2 The sending unit will W 22 Encapsulate into a second message packet, and receive the instruction of the routing module to carry the column identifier in the second message packet, and send the second message packet to node E 1,2 ;; S6: Each node multiplies the matrix of this transmission, such as node E 1,1 Is X 12 and W 21 Multiply, the multiplication results of the four nodes can form the matrix Y2= ; S7: Add matrix Y1 and matrix Y2 to obtain Y=Y1+Y2= . Y is the multiplication result of the first matrix X and the second matrix W;
[0112] In this implementation, steps S1, S2, S4 and S5 can be executed in parallel, and steps S3 and S6 can be executed in parallel. This implementation is an example of P=2. In the large matrix multiplication calculation corresponding to the large neural network model, the data processing method of this implementation can adopt a parallel data transmission method, which can greatly improve the data transmission efficiency of large matrices. The effective load included in each message packet is converted from the entire matrix to a single element, the load is greatly reduced, and the efficiency of data transmission is improved.
[0113] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description 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 by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term "computer storage medium" 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 technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, 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 a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A data broadcasting method, characterized in that: The method is applied to a mesh network including a plurality of nodes, comprising: The node that needs to transmit broadcast data carries a predetermined identifier in a broadcast message packet used to transmit the broadcast data, and sends the broadcast message packet; The node receiving the broadcast message packet determines whether to save the broadcast data carried by the received broadcast message packet according to the predetermined identifier, and forwards the received broadcast message packet when the node is an intermediate node on the transmission path of the received broadcast message packet.
2. The data broadcasting method according to claim 1, wherein: The predetermined identifier includes a forwarding identifier, wherein the forwarding identifier is used to indicate that the broadcast message packet is forwarded along a predetermined transmission path.
3. The data broadcasting method according to claim 2, wherein: The multiple nodes form a node array, and the grid network is a two-dimensional grid network; The forwarding identifier includes at least one of the following identifiers: a row identifier and a column identifier; The row identifier is used to indicate that the broadcast message packet is forwarded along the row of the node array; The column identifier is used to indicate that the broadcast message packet is forwarded along a column of the node array.
4. The data broadcasting method according to claim 3, wherein: The broadcast data includes first data and second data; The node that needs to transmit broadcast data carries a predetermined identifier in a broadcast message packet used to transmit the broadcast data, and sends the broadcast message packet, including: The node that needs to transmit the first data carries the row identifier in a first broadcast message packet used to transmit the first data, and sends the first broadcast message packet along the row of the node array; The node that needs to transmit the second data carries the column identifier in a second broadcast message packet used to transmit the second data, and sends the second broadcast message packet along the columns of the node array.
5. The data broadcasting method according to claim 4, wherein: When the node is an intermediate node on the transmission path of the received broadcast message packet, forwarding the received broadcast message packet includes: The node that receives the first broadcast message packet forwards the received first broadcast message packet along the row of the node array when the node is an intermediate node on the row of the node array; The node that receives the second broadcast message packet forwards the received second broadcast message packet along the column of the node array when the node is an intermediate node on the column of the node array.
6. The data broadcasting method according to claim 5, wherein: The forwarding of the received first broadcast message packet along the row of the node array includes: determining a receiving interface of the first broadcast message packet; forwarding the received first broadcast message packet to a node connected to an interface opposite to the receiving interface in the row direction; The forwarding of the received second broadcast message packet along the column of the node array includes: determining a receiving interface of the second broadcast message packet; and forwarding the received second broadcast message packet to a node connected to an interface opposite to the receiving interface in the column direction.
7. The data broadcasting method according to claim 4, wherein: The carrying of the row identifier in a first broadcast message packet used to transmit the first data comprises: setting a row broadcast identifier bit in a packet header of the first broadcast message packet used to transmit the first data to a first predetermined value; Carrying the column identifier in a second broadcast message packet used to transmit the second data includes: setting a column broadcast identifier bit in a packet header of the second broadcast message packet used to transmit the second data to a first predetermined value.
8. The data broadcasting method according to claim 4, wherein: The sending of the first broadcast message packet along the row of the node array comprises: when the node that needs to transmit the first data is a node in the first column or the last column of the node array, sending the first broadcast message packet to a node in the same adjacent column; when the node that needs to transmit the first data is a node other than the first column and the last column of the node array, sending the first broadcast message packet to two nodes in the same adjacent column respectively; The sending of the second broadcast message packet along the columns of the node array includes: when the node that needs to transmit the second data is a node in the first row or the last row of the node array, sending the second broadcast message packet to a node in an adjacent row of the same column; when the node that needs to transmit the second data is a node other than the first row and the last row of the node array, sending the second broadcast message packet to two nodes in adjacent rows of the same column respectively.
9. The data broadcasting method according to claim 2, wherein: The grid network is a three-dimensional grid network; The forwarding identifier includes at least one of the following identifiers: a first forwarding identifier, a second forwarding identifier, and a third forwarding identifier; The first forwarding identifier is used to indicate that the broadcast message packet carrying the first forwarding identifier is the first broadcast message packet transmitted along the X-axis direction; The second forwarding identifier is used to indicate that the broadcast message packet carrying the second forwarding identifier is a second broadcast message packet transmitted along the Y-axis direction; The third forwarding identifier is used to indicate that the broadcast message packet carrying the third forwarding identifier is a third broadcast message packet transmitted along the Z-axis direction.
10. The data broadcasting method according to any one of claims 1 to 8, characterized in that: The predetermined identification includes: a storage identification; The storage identifier includes at least N identification bits, where N is the number of intermediate nodes on the transmission path of the broadcast message packet; the N identification bits correspond one-to-one to the intermediate nodes on the transmission path of the broadcast message packet; the value of each identification bit is used to indicate whether the corresponding intermediate node stores the broadcast data in the broadcast message packet; The node receiving the broadcast message packet determines, according to the predetermined identifier, whether to save the broadcast data carried by the received broadcast message packet, including: The node that receives the broadcast message packet queries the identification bit corresponding to the node in the storage identification, and determines whether to save the broadcast data carried by the received broadcast message packet according to the value of the identification bit.
11. A network on chip, comprising a plurality of nodes, characterized in that: The multiple nodes communicate via a grid network; each of the nodes comprises a routing module, a transmission module and a storage module; The transmission module is configured to: when broadcast data needs to be transmitted, read the broadcast data from the storage module and encapsulate it into a broadcast message packet for transmitting the broadcast data; The routing module is configured to: instruct the transmission module to carry a predetermined identifier in the broadcast message packet; when the transmission module receives the broadcast message packet, determine according to the predetermined identifier whether to instruct the storage module to save the broadcast data carried by the received broadcast message packet, and when the current node is an intermediate node on the transmission path of the received broadcast message packet, instruct the transmission module to forward the received broadcast message packet; The storage module is configured to: store broadcast data to be transmitted; and store the broadcast data carried in the broadcast message packet received by the transmission module according to the instruction of the routing module.
12. A chip comprising a plurality of processor cores, characterized in that: The multiple processor cores communicate via a grid network to form an on-chip network; the on-chip network is configured to exchange data between the multiple processor cores and external data; The plurality of processor cores store instructions, and execute the data broadcasting method according to any one of claims 1 to 10 according to the instructions.
13. A data processing method, characterized in that: The method is applied to a two-dimensional grid network including P rows and Q columns of nodes; wherein the P×Q nodes E in the grid network p,q Respectively save the first submatrix obtained by splitting the first matrix X to be subjected to matrix multiplication, and the second submatrix obtained by splitting the second matrix W to be subjected to matrix multiplication; The data processing method comprises: Each of the nodes uses the saved first submatrix as first data and the saved second submatrix as second data, respectively, to execute the data broadcasting method according to any one of claims 4 to 7, sends the saved first submatrix to other nodes in the same row, and sends the saved second submatrix to other nodes in the same column; Each of the nodes obtains a result submatrix corresponding to the node according to the first submatrix and the second submatrix stored and received by the node; wherein the result submatrices of P×Q nodes constitute a result matrix Y of matrix multiplication of the first matrix X and the second matrix W.
Citation Information
Patent Citations
Efficient broadcast in wireless mesh networks
CN101300777A
Opportunistic network routing forwarding method based on computable AP
CN110461018A
Many-core network-on-chip data transmission method, device, equipment and medium
CN114363245A
Class network routing
CN1493128A
Reducing broadcast duplication in hybrid wireless mesh protocol routing
WO2015175118A2