Message Transmission Method, Apparatus, Electronic Device, and Storage Medium
By adding identification information and generating transmission sequence to the on-chip network, the problem of repeated requests during message transmission is solved, efficient directional transmission is achieved, and the transmission efficiency and system response speed of the on-chip network are improved.
Patent Information
- Application Number
- CN202510350465.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-03-24
AI Technical Summary
In the prior art, there is a problem of duplication of requests when transmitting messages in an on-chip network, resulting in low transmission efficiency. Especially when the neural network processor connects multiple neural network accelerators through CHI, broadcast operations require multiple requests to be sent, and the broadcast function cannot be effectively supported.
By determining the response node information corresponding to the message to be transmitted at the request node, and adding identification information to the message, the first node determines whether to perform broadcast transmission, and realizing directional transmission of the message, including generating transmission sequence information and routing algorithm optimization, ensuring efficient transmission of the message among multiple nodes.
It improves the efficiency of message transmission, solves the problem of duplication of requests, and realizes fast and efficient transmission of messages on the on-chip network, and optimizes performance and energy consumption for different application needs.
Smart Images

Figure CN119865452B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network on chip, and in particular, to a message transmission method, apparatus, electronic device and storage medium. Background Art
[0002] Under the background of increasing demands for Artificial Intelligence (AI), the Advanced Microcontroller Bus Architecture Coherent Hub Interface (AMBA CHI) is currently the most widely used protocol on the Network on Chip (NOC) in the industry. Exemplarily, in the case where a Neural Processing Unit (NPU) is connected to 32 neural network accelerators through CHI, for the data stream of the "broadcast" operation on the chip, first, Direct Memory Access (DMA) is initiated to transfer the data of the Double Data Rate Synchronous Dynamic Random Access Memory (DDR) to the NPU. However, the "broadcast" of DMA is sent to the NPU multiple times. That is, when broadcasting one piece of data to 32 NPUs, 32 requests and corresponding data need to be sent. The interconnection protocol layer does not support the "broadcast" function, so it can only be sent to the corresponding nodes one by one, unable to solve the problem of repeated requests during message transmission, and reducing the efficiency of message transmission. Summary of the Invention
[0003] Embodiments of the present invention provide a message transmission method, apparatus, electronic device and storage medium, which can solve the problem of repeated requests during message transmission in related technologies and improve the efficiency of message transmission.
[0004] On the one hand, embodiments of the present invention disclose a message transmission method applied to a network on chip, where the network on chip includes a request node and a response node; the method includes:
[0005] The request node determines at least one response node corresponding to the message to be transmitted;
[0006] The requesting node adds the node information corresponding to the at least one responding node to the message to obtain a target message, and sends the target message to a first node; the first node is any one of the at least one responding nodes;
[0007] When the first node obtains the target message, it determines whether there is identification information in the target message; the identification information is used to indicate that the target message is to be transmitted by broadcast; when the identification information exists in the target message, the target message is saved and the target message is transmitted to the next responding node among the at least one responding nodes.
[0008] Optionally, the requesting node adds the node information corresponding to the at least one responding node to the message to obtain a target message, and sends the target message to a first node, including:
[0009] The requesting node generates first indication information according to the node information corresponding to the at least one responding node; the first indication information is used to indicate the transmission order of the message among the at least one responding nodes;
[0010] Add the first indication information to the message to obtain a target message;
[0011] Based on the first indication information, send the target message to a first node;
[0012] Wherein, the first node is any one of the at least one responding nodes, including: the first node is the first node among the at least one responding nodes that transmits the message as indicated by the first indication information.
[0013] Optionally, when the identification information exists in the target message, saving the target message and transmitting the target message to the next responding node among the at least one responding nodes, including:
[0014] When the identification information exists in the target message, save the target message;
[0015] Transmit the target message to the next responding node among the at least one responding nodes according to the transmission order indicated by the first indication information.
[0016] Optionally, the requesting node generates first indication information according to the node information corresponding to the at least one responding node, including:
[0017] Add the identification information to the target message through a compiler;
[0018] Determine the transmission path corresponding to the target message based on the identification information and the routing algorithm;
[0019] Generate first indication information based on the transmission path.
[0020] Optionally, when the identification information exists in the target message, save the target message and transmit the target message to the next response node among the at least one response node, including:
[0021] When the identification information exists in the target message, save the target message and add second indication information to the target message; the second indication information is used to indicate that the first node has received the target message;
[0022] Transmit the target message to the response node that has not received the target message among the at least one response node until each node among the at least one response node has received the target message.
[0023] Optionally, the transmitting the target message to the next response node among the at least one response node includes:
[0024] When the identification information exists in the target message, save the target message;
[0025] Copy the target message and modify the target address corresponding to the copied target message according to the node information of the next response node among the at least one response node;
[0026] Transmit the target message to the next response node among the at least one response node based on the target address.
[0027] On the other hand, an embodiment of the present invention discloses a message transmission device, which is applied to a network-on-chip. The network-on-chip includes a request node and a response node; the device includes:
[0028] A determination module, configured to determine at least one response node corresponding to the message to be transmitted;
[0029] An obtaining module, configured to add the node information corresponding to the at least one response node to the message to obtain a target message;
[0030] A sending module, configured to send the target message to a first node; the first node is any node among the at least one response node;
[0031] The determining module is further configured to determine whether identification information exists in the target message when the target message is obtained; the identification information is used to indicate that the target message is to be broadcast and transmitted.
[0032] The saving module is configured to save the target message when the identification information exists in the target message.
[0033] The transmitting module is configured to transmit the target message to the next response node among the at least one response nodes.
[0034] Optionally, the obtaining module includes:
[0035] The generating module is configured to generate first indication information according to the node information corresponding to the at least one response node; the first indication information is used to indicate the transmission order of the message among the at least one response nodes.
[0036] The obtaining sub-module is configured to add the first indication information to the message to obtain a target message.
[0037] In another aspect, an embodiment of the present invention further discloses an electronic device, which includes a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute the foregoing message transmission method.
[0038] An embodiment of the present invention further discloses a readable storage medium. When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the foregoing message transmission method.
[0039] Embodiments of the present invention have the following advantages:
[0040] An embodiment of the present invention provides a message transmission method, which is applied to a network-on-chip. The network-on-chip includes a request node and a response node; the request node determines at least one response node corresponding to the message to be transmitted; the request node adds the node information corresponding to the at least one response node to the message to obtain a target message, and sends the target message to a first node; the first node is any one of the at least one response nodes; the first node determines whether identification information exists in the target message when the target message is obtained; the identification information is used to indicate that the target message is to be broadcast and transmitted; when the identification information exists in the target message, the target message is saved and the target message is transmitted to the next response node among the at least one response nodes. Embodiments of the present invention can implement the directional transmission of messages according to the node information and identification information in the message, solve the problem of repeated requests during message transmission, and thus improve the efficiency of message transmission. Brief Description of the Drawings
[0041] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0042] Figure 1 is a flowchart of the steps of an embodiment of a message transmission method of the present invention;
[0043] Figure 2 is a block diagram of the composition structure of a network-on-chip of the present invention;
[0044] Figure 3 is the step flow of an embodiment of a message transmission method of the present invention Figure 2 ;
[0045] Figure 4 is the step flow of an embodiment of a message transmission method of the present invention Figure 3 ;
[0046] Figure 5 is a block diagram of the structure of an embodiment of a message transmission device of the present invention;
[0047] Figure 6 is a block diagram of the structure of an electronic device provided by an example of the present invention. Detailed Embodiments
[0048] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0049] The terms "first", "second", etc. in the description and claims of the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and do not limit the number of objects. For example, the first object can be one or more. In addition, the term "and / or" in the description and claims is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. In the embodiments of the present invention, the term "plurality" refers to two or more, and other quantifiers are similar.
[0050] Method embodiment
[0051] Refer to Figure 1 , which shows a step flowchart of an embodiment of a message transmission method of the present invention. The method may specifically include the following steps:
[0052] Step S101, the requesting node determines at least one responding node corresponding to the message to be transmitted;
[0053] Step S102, the requesting node adds the node information corresponding to at least one responding node to the message to obtain a target message, and sends the target message to the first node; the first node is any one of the at least one responding nodes;
[0054] Step S103, when the first node obtains the target message, it determines whether there is identification information in the target message; the identification information is used to indicate that the target message is to be broadcast transmitted; when there is identification information in the target message, the target message is saved and the target message is transmitted to the next responding node among the at least one responding nodes.
[0055] The message transmission method provided by the embodiments of the present invention is applied to a network-on-chip, and the network-on-chip includes a requesting node and a responding node.
[0056] Among them, the requesting node can be any node in the network-on-chip, and the requesting node can also be an NPU.
[0057] The responding node can be any node in the network-on-chip other than the requesting node; when the requesting node is an NPU, the responding node can be a neural network accelerator.
[0058] The network-on-chip can linearly scale the system's performance by adding more routers and communication links without bottlenecks or performance degradation. Moreover, by using parallel transmission and multi-path routing, it can provide fast and efficient data transmission, significantly improving the system's response speed. Finally, the NOC can select appropriate routing algorithms and topologies according to different application requirements to optimize performance and energy consumption.
[0059] The message to be transmitted refers to the data block that a site wants to send at one time.
[0060] Specifically, the message to be transmitted contains the complete data information to be sent. Its length varies, is unlimited and variable. It is the basic unit in network communication and is used to transfer information between the source node and the destination node.
[0061] Exemplarily, the message to be transmitted can also be a message composed of 128 bits, where 100 bits include the data of the message and 28 bits include node information and identification information.
[0062] Exemplarily, the message to be transmitted usually consists of three parts: a start line, a header, and a body.
[0063] Among them, the start line is the first line of the message and is used to indicate what to do in a request message or to describe the problem that has occurred in a response message.
[0064] The header contains some additional information, such as source address, destination address, message length, checksum, etc. These information help the devices in the network to correctly process and transmit the message.
[0065] The body is the main part of the message and contains the actual data content to be transmitted.
[0066] At least one response node corresponding to the message to be transmitted can be the node that transmits the message, and the node that transmits the message can include multiple or one.
[0067] The node information corresponding to at least one response node refers to the node information of the node that transmits the message. For example, if the node that transmits the message is a node in a linked list, (1,0) → (1,2) → (2,2) in the linked list refers to the node information.
[0068] The target message refers to the message with node information added.
[0069] The first node refers to any node that transmits the message, that is, any node among at least one response node.
[0070] During the process of sequential message transmission, any node among at least one response node can be the first node, the last node, or any intermediate node in the sequential list; similarly, during the process of unsequential message transmission, any node among at least one response node can also be the first node, the last node, or any intermediate node in the sequential list.
[0071] The identification information refers to the information for broadcast transmission, and the message containing the identification information can be transmitted by broadcast.
[0072] Broadcast transmission means that when a node (sender) needs to send data to multiple nodes (receivers), it will send the data packet to all nodes in the network. These data packets will be recognized as broadcast data packets by devices such as routers and switches in the network and forwarded to all hosts within the subnet. Each host will receive this data packet and process it according to its own needs.
[0073] Exemplarily, during the process of sending the target message to other response nodes, the target message needs to be saved in the current node first, and then the subsequent message transmission process is carried out.
[0074] The next response node among at least one response node refers to the next node in the message transmission process. For example, if the current node is A, during the process of unsequential message transmission, all other nodes except the current node A can be the next response node among at least one response node; during the process of sequential message transmission, the order of the transmission list is A, B, C, D......, when the current node is A, the next response node for transmission in accordance with the transmission order is B.
[0075] During the process of message transmission, it can include sequential transmission and unsequential transmission. Thus, during the process of saving the target message, during sequential transmission, the message can be saved in an ordered table such as a linked list or a linear table; during unsequential transmission, the saving of the message can also be unordered, as long as it is ensured that the message is transmitted to the next response node among at least one response node.
[0076] In an embodiment of the present invention, a network-on-chip includes a request node and a response node; during the process of message transmission, the request node can first add node information corresponding to at least one response node to the message to obtain a target message, and then send the target message to a first node; further, when the first node obtains the target message, it is necessary to determine whether there is identification information in the target message; the identification information is used to indicate that the target message is to be broadcast and transmitted; when there is identification information in the target message, the target message is saved, and then the target message can be transmitted to the next response node among at least one response node. The embodiment of the present invention can realize the directional transmission of messages according to the node information and identification information in the message, solve the problem of repeated requests during message transmission, and thus improve the efficiency of message transmission.
[0077] Further, in an embodiment of the present invention, when the request node adds node information corresponding to at least one response node to the message to obtain a target message and sends the target message to the first node, the message transmission method may further include the following steps:
[0078] Step S1021: The request node generates first indication information according to the node information corresponding to at least one response node; the first indication information is used to indicate the transmission order of the message among at least one response node.
[0079] Step S1022: Add the first indication information to the message to obtain a target message.
[0080] Step S1023: Based on the first indication information, send the target message to the first node; the first node is the first node among at least one response node indicated by the first indication information to transmit the message.
[0081] Among them, the first indication information refers to the order information of message transmission, that is, during the process of ordered message transmission, the request node can generate the first indication information according to the node information corresponding to at least one response node.
[0082] The transmission order refers to the order in a linked list or the order in a linear list, etc., which is not limited in the embodiment of the present invention.
[0083] Exemplarily, the first node among at least one response node to transmit the message refers to the first node to transmit the message. During the process of ordered message transmission, the order of the transmission linked list is A, B, C, D...... When the current node A receives the message, the first node among at least one response node to transmit the message refers to A.
[0084] In an embodiment of the present invention, when the requesting node adds node information corresponding to at least one responding node to a message to obtain a target message and sends the target message to a first node, the requesting node generates first indication information according to the node information corresponding to the at least one responding node; the first indication information is used to indicate the transmission order of the message among the at least one responding nodes; that is, in the case of ordered transmission of the message, the first indication information can be added to the message to obtain the target message; based on the first indication information, the target message is sent to the first node in the transmission order; wherein, the first node is the first node among the at least one responding nodes indicated by the first indication information to transmit the message first, that is to say, in the process of ordered transmission, it is necessary to send the target message to the first node to transmit the message first according to the first indication information.
[0085] Further, in an embodiment of the present invention, when there is identification information in the target message, and the target message is saved and transmitted to the next responding node among the at least one responding nodes, the message transmission method may further include the following steps:
[0086] Step S1031: When there is identification information in the target message, save the target message.
[0087] Step S1032: Transmit the target message to the next responding node among the at least one responding nodes according to the transmission order indicated by the first indication information.
[0088] Wherein, the transmission order indicated by the first indication information refers to the order in which the message is transmitted. For example: the order of the transmission linked list is A, B, C, D......, when the current node is A, the next responding node for transmission according to the transmission order is B.
[0089] Exemplarily, in the process of ordered transmission of the message, the order of the transmission linked list is A, B, C, D......, when the current node is B, the next responding node for transmission according to the transmission order is C, that is, the next responding node among the at least one responding nodes is C.
[0090] In an embodiment of the present invention, when there is identification information in the target message, the target message is saved and transmitted to the next responding node among the at least one responding nodes. When there is identification information in the target message, the target message is saved; in the case of ordered transmission of the message, the target message can be transmitted to the next responding node among the at least one responding nodes according to the transmission order indicated by the first indication information, that is, the message is transmitted in order.
[0091] Further, in the embodiments of the present invention, when the requesting node generates the first indication information according to the node information corresponding to at least one responding node, the message transmission method may further include the following steps:
[0092] Step S10211: Add identification information to the target message through a compiler.
[0093] Step S10212: Determine the transmission path corresponding to the target message based on the identification information and the routing algorithm.
[0094] Step S10213: Generate the first indication information based on the transmission path.
[0095] Herein, the compiler refers to a computer program whose main function is to convert a program written in one programming language (referred to as "source code") into another language (usually machine language or some intermediate representation) so that the computer hardware can execute it.
[0096] The routing algorithm refers to the process of selecting the best path according to the network topology structure and routing policy by calculating the distance and cost from each node to the destination node, so that the data packet can reach the destination node quickly and accurately. In this process, the router maintains a routing table (also called a forwarding table), which contains information such as the destination network IP address, subnet mask, next-hop IP address, and interface, for guiding the forwarding of data packets.
[0097] Exemplarily, during the sequential transmission of messages, if the order of the transmission list is A, B, C, D......, the transmission path corresponding to the target message refers to A, B, C, D......
[0098] Exemplarily, during the sequential transmission of messages, if the transmitted messages need to pass through A, B, C, D......, the transmission path corresponding to the target message refers to A, B, C, D......, or D, C, A, B,......, etc., which is not limited in the embodiments of the present invention.
[0099] Exemplarily, during the sequential transmission of messages, if the order of the transmission list is (1, 0) → (1, 2) → (2, 2), the transmission path corresponding to the target message refers to (1, 0) → (1, 2) → (2, 2).
[0100] Exemplarily, during the unordered transmission of messages, if the transmitted messages need to pass through (1, 0), (1, 2), (2, 2), the transmission path corresponding to the target message can be (1, 0) → (1, 2) → (2, 2), or (2, 2) → (1, 2) → (1, 0), etc., which is not limited in the embodiments of the present invention.
[0101] In an embodiment of the present invention, in the process of a requesting node generating first indication information according to node information corresponding to at least one responding node, the compiler may first add identification information to the target message; then, based on the identification information and the routing algorithm, determine the transmission path corresponding to the target message; finally, based on the transmission path, generate the first indication information. That is to say, the compiler can determine the transmission routing path, that is, determine the transmission order of the message among at least one responding node.
[0102] Further, in an embodiment of the present invention, when there is identification information in the target message, and the target message is saved and transmitted to the next responding node among at least one responding node, the message transmission method may further include the following steps:
[0103] Step S1033: When there is identification information in the target message, save the target message and add second indication information to the target message; the second indication information is used to indicate that the first node has received the target message.
[0104] Step S1034: Transmit the target message to the responding node among at least one responding node that has not received the target message until each node among at least one responding node has received the target message.
[0105] Wherein, the second indication information is used to indicate that the first node has received the target message, that is, the identification information added to the node that has received the target message.
[0106] In the process of the message being transmitted in order, the order of the transmission linked list is A, B, C, D...... When the current node is A, the next responding node for transmission in the transmission order is B, that is, the first node A has received the target message.
[0107] In the process of the message being transmitted in order, the order of the transmission linked list is A, B, C, D...... When the current node is A, the next responding node for transmission in the transmission order is B, that is, the first node A has received the target message. The responding nodes among at least one responding node that have not received the target message may include B, C, D......
[0108] During the process of sequential transmission of messages, the order of the transmission linked list is A, B, C, D...... When the current node is A, the next response node for transmission in accordance with the transmission order is B, that is, the first node A has received the target message. The response nodes among at least one response node that have not received the target message may include B, C, D...... When the target message has been transmitted in all the response nodes among at least one response node that have not received the target message, it indicates that each node among at least one response node has received the target message.
[0109] In an embodiment of the present invention, in the case where there is identification information in the target message, when saving the target message and transmitting the target message to the next response node among at least one response node, in the case of unordered transmission of messages, first save the target message with identification information at the current node, and it is also necessary to add second indication information to the target message; the second indication information is used to indicate that the first node has received the target message; that is, mark the node that has received the message, and then the target message can be transmitted to the response node among at least one response node that has not received the target message until each node among at least one response node has received the target message.
[0110] Further, in an embodiment of the present invention, when transmitting the target message to the next response node among at least one response node, the message transmission method may further include the following steps:
[0111] Step S1035: Save the target message in the case where there is identification information in the target message.
[0112] Step S1036: Copy the target message, and modify the target address corresponding to the copied target message according to the node information of the next response node among at least one response node.
[0113] Step S1037: Transmit the target message to the next response node among at least one response node based on the target address.
[0114] Among them, during the process of sequential transmission of messages, the order of the transmission linked list is A, B, C, D......Z. When the current node is A, the next response node for transmission in accordance with the transmission order is B. Before transmitting to node B, it is necessary to copy the target message. In the case of transmitting to the last node Z of the linked list, it is not necessary to copy the message, that is, only when it is necessary to transmit to the next node, it is necessary to copy the target node.
[0115] Exemplarily, during the sequential transmission of a message, the order of the transmission linked list is (1, 0) → (1, 2) → (2, 2). When the current node is (1, 2), the next response node for transmission according to the transmission order is (2, 2), that is, the node information of the next response node among at least one response node is (2, 2).
[0116] Exemplarily, during the sequential transmission of a message, the order of the transmission linked list is (1, 0) → (1, 2) → (2, 2). When the current node is (1, 2), the next response node for transmission according to the transmission order is (2, 2). Then, it is necessary to modify the address corresponding to the original current node (1, 2) to the target address corresponding to the next response node (2, 2).
[0117] In an embodiment of the present invention, when transmitting a target message to the next response node among at least one response node, if there is identification information in the target message, the target message can be saved in the current response node. When it is necessary to transmit the target message to the next response node, the target message needs to be copied, and the target address corresponding to the copied target message is modified according to the node information of the next response node among at least one response node. Furthermore, based on the target address, the target message can be transmitted to the next response node among at least one response node, that is, the message can be sent to different target addresses to achieve the directional transmission of the message, thereby improving the efficiency of message transmission.
[0118] Referring to Figure 2 , a block diagram of the composition structure of a network-on-chip according to the present invention is shown. The network-on-chip may include the following:
[0119] An access device and a router. The access device includes a processor core and a cache.
[0120] In practical applications, although multiple processor cores in a multi-core processor chip execute their respective codes, data sharing and synchronization are required between the processor cores. Therefore, the multi-core processor hardware structure must support efficient inter-core communication, and the performance of the on-chip communication structure will directly affect the performance of the processor.
[0121] Therefore, the Network-on-Chip (NoC) aims to solve the communication problems within multi-core processors. The NoC is an integrated circuit based on a network-based communication subsystem, and it is a router-based packet-switching network among systems-on-chip. The NoC technology draws on the interconnection network structure of parallel computers, integrating a large number of computing resources and an on-chip communication network connecting these resources on a single chip. Each processor core has an independent router and its private cache, and they are connected together through the on-chip communication network. The message communication mechanism is adopted between processor cores, and the router and packet-switching technology are used to replace the on-chip bus in related technologies to complete the communication task, thus solving various bottleneck problems brought by bus interconnection in related technologies.
[0122] The CHI protocol is an advanced bus protocol used to solve the data consistency problem among multiple Central Processing Units (CPUs). It uses packets for information transmission, supports various network topologies, and has good scalability and flexibility. By defining different component and node types, as well as cache coherence protocols and snoop methods and other mechanisms, the CHI protocol can effectively maintain data consistency in the system and improve the overall performance of the system.
[0123] In the context of increasing AI requirements, CHI is currently the most widely used protocol on the industry's Network-on-Chip (NOC). The NPU connects its 32 neural network accelerators through CHI. In terms of the data flow of the "broadcast" operation on the chip, first, the DMA is started to move the data in the DDR to the NPU. However, the DMA broadcast is sent to the NPU multiple times. That is to say, when broadcasting one piece of data to 32 NPUs, 32 requests and corresponding data need to be sent. Therefore, the interconnection protocol layer does not support the "broadcast" function, so it can only be sent to the corresponding nodes one by one. The present invention aims to solve this problem and can achieve faster data transmission to the nodes.
[0124] The present invention adds support for broadcast at the protocol layer. The specific support method is to add the node information to be broadcast in req_filt. Since the flit to be broadcast needs to be marked by the compiler first, and because the topology of the NOC is known, the nodes through which the flit is to be propagated in the linked list can be written into the information of the flit. In this way, a linked list can be generated in the flit. The specific data flow is as follows: when the interface bridge gets the flit from the DDR, MXP will check whether there is a broadcast enable (for broadcast transmission) in the flit. If the enable exists, the corresponding nodeid (identification information) can be determined in the linked list, and then a copy of the data is directly made and sent to the next node in the linked list. If there is no nodeid at the end of the linked list, then this broadcast ends.
[0125] Refer to Figure 3 , which shows the step flow of an embodiment of the message transmission method of the present invention Figure 2 , and the method may specifically include the following:
[0126] Add a linked list to the message and broadcast the message to these three nodes when only one request is sent.
[0127] Refer to Figure 4 , which shows the step flow of an embodiment of the message transmission method of the present invention Figure 3 , and the method may specifically include the following:
[0128] Specifically, if a message (flit) wants to be sent to the nodes (1, 0) → (1, 2) → (2, 2) with only one request, the present invention can use the form of adding a linked list to the message to broadcast the message to these three nodes with only one request. As shown in the figure, first, according to the x, y routing, the packet will be routed to the (1, 0) node through the yellow arrow first, and then the routing will look back at the linked list and find that the node (1, 2) is connected behind (1, 0). Subsequently, this routing will directly copy the message, change the destination address of the message to (1, 2), and then send it. And so on, the message will be copied and sent in the directions of the purple and green arrows until there is no information behind the node. At this time, the life cycle of this broadcast packet will end. In the traditional method, three requests need to be sent to broadcast to three nodes. The data requested is the same but the destination addresses are different.
[0129] Among modern AI models, matrices are widely used in the attention layer or convolutional layer. Moreover, the number of parameters in modern large models is very large. Matrix multiplications of this scale cannot be performed in their entirety on a single core (single-core processor). Therefore, it is only possible to perform matrix multiplications by dividing large matrices into small matrices. At this time, the matrix to be multiplied needs to be broadcast to each core. Therefore, the broadcast feature needs to be widely utilized in gemm (General Matrix to Matrix Multiplication). For example, in the matrix multiplication of tiling, a matrix multiplication of (9, 6) × (6, 9) can be divided into the multiplication of two tensors with a shape of (6, 3, 3) × (6, 3, 3). Each 3×3 output is a part of the original matrix multiplication and is then gathered together. Therefore, as long as the operation of this operator is executed, the multiplicand needs to be broadcast so that parallel computing can be performed.
[0130] The problem of repeated requests when the NOC performs broadcasting; reducing the sending of repeated requests by adding the broadcast feature to the protocol; further optimizing the optimal routing path through the compiler to implement the broadcast linked list.
[0131] Device embodiments
[0132] Refer to Figure 5 , which shows a structural block diagram of a message transmission device of the present invention. The device is applied to a network on a chip. Specifically, the device may include:
[0133] A determination module 501, configured to determine at least one response node corresponding to a message to be transmitted;
[0134] An obtaining module 502, configured to add node information corresponding to the at least one response node to the message to obtain a target message;
[0135] A sending module 503, configured to send the target message to a first node; the first node is any one of the at least one response node;
[0136] The determination module is further configured to determine whether there is identification information in the target message when the target message is obtained; the identification information is used to indicate that the target message is transmitted by broadcasting;
[0137] A saving module 504, configured to save the target message when the identification information exists in the target message;
[0138] A transmission module 505 for transmitting the target message to the next response node among the at least one response node.
[0139] Optionally, the obtaining module includes:
[0140] A generating module for generating first indication information according to the node information corresponding to the at least one response node; the first indication information is used to indicate the transmission order of the message among the at least one response node;
[0141] An obtaining sub-module for adding the first indication information to the message to obtain a target message.
[0142] Optionally, in the case where the identification information exists in the target message, saving the target message and transmitting the target message to the next response node among the at least one response node includes:
[0143] A saving sub-module for saving the target message in the case where the identification information exists in the target message;
[0144] A first transmission sub-module for transmitting the target message to the next response node among the at least one response node according to the transmission order indicated by the first indication information.
[0145] Optionally, the request node generates first indication information according to the node information corresponding to the at least one response node, including:
[0146] An adding module for adding the identification information to the target message through a compiler;
[0147] A determining sub-module for determining the transmission path corresponding to the target message based on the identification information and a routing algorithm;
[0148] A generating sub-module for generating first indication information based on the transmission path.
[0149] Optionally, in the case where the identification information exists in the target message, saving the target message and transmitting the target message to the next response node among the at least one response node includes:
[0150] A first saving sub-module for saving the target message in the case where the identification information exists in the target message;
[0151] An adding sub-module for adding second indication information to the target message; the second indication information is used to indicate that the first node has received the target message;
[0152] A second transmission sub-module, configured to transmit the target message to the response nodes among the at least one response node that have not received the target message until each node among the at least one response node has received the target message.
[0153] Optionally, the transmitting the target message to the next response node among the at least one response node includes:
[0154] A second saving sub-module, configured to save the target message when the identification information exists in the target message;
[0155] A copying module, configured to copy the target message;
[0156] A modifying module, configured to modify the target address corresponding to the copied target message according to the node information of the next response node among the at least one response node;
[0157] A third transmission sub-module, configured to transmit the target message to the next response node among the at least one response node based on the target address.
[0158] In summary, the embodiment of the present invention provides a message transmission method, which is applied to a network-on-chip. The network-on-chip includes a request node and a response node; the request node determines at least one response node corresponding to the message to be transmitted; the request node adds the node information corresponding to the at least one response node to the message to obtain a target message, and sends the target message to the first node; the first node is any one of the at least one response node; when the first node obtains the target message, it determines whether the identification information exists in the target message; the identification information is used to indicate that the target message is transmitted by broadcast; when the identification information exists in the target message, the target message is saved and the target message is transmitted to the next response node among the at least one response node. The embodiment of the present invention can implement the directional transmission of the message according to the node information and the identification information in the message, solve the problem of repeated requests during message transmission, and thus improve the efficiency of message transmission.
[0159] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For the relevant parts, refer to the partial description of the method embodiment.
[0160] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0161] Regarding the processor in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0162] Referring to Figure 6 , it is a structural block diagram of an electronic device for data transmission in a network on a chip provided by an embodiment of the present invention. As Figure 6 shown, the electronic device includes: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute the message transmission method of the foregoing embodiment.
[0163] The processor may be a CPU, a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable devices, transistor logic devices, hardware components, or any combination thereof. The processor may also be a combination that implements a computing function, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0164] The communication bus may include a path for transmitting information between the memory and the communication interface. The communication bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 6 only one line is shown in
[0165] but it does not mean that there is only one bus or one type of bus.
[0166] An embodiment of the present invention also provides a non-transitory computer-readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor is enabled to execute Figure 1 the message transmission method shown.
[0167] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0168] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0169] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of processes and / or blocks in the flowchart and / or block diagram can also be implemented. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0170] These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal devices to work in a predictive manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal devices, so that a series of operation steps are executed on the computer or other programmable terminal devices to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable terminal devices provide for implementing the functions specified in Figure 1 one process or multiple processes and / or blocksFigure 1 Steps of the functions specified in one or more boxes.
[0172] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
[0173] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the said element.
[0174] The above has introduced in detail a message transmission method, device, electronic device and storage medium provided by the present invention. Specific examples are used herein to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A message transmission method, characterized in that, Applied to a network-on-chip, the network-on-chip including a request node and a response node; the method includes: The request node determines at least one response node corresponding to the message to be transmitted; The request node adds the node information corresponding to the at least one response node to the message to obtain a target message, and sends the target message to a first node; the first node is any one of the at least one response nodes; When the first node obtains the target message, it determines whether there is identification information in the target message; the identification information is used to indicate that the target message is to be transmitted by broadcast; when there is the identification information in the target message, the target message is saved and the target message is transmitted to the next response node among the at least one response nodes; Wherein, the first node being any one of the at least one response nodes includes: the first node is the first node among the at least one response nodes indicated by the first indication information to transmit the message; the first indication information is used to indicate the transmission order of the message among the at least one response nodes.
2. The method according to claim 1, wherein The request node adding the node information corresponding to the at least one response node to the message to obtain a target message and sending the target message to a first node includes: The request node generates first indication information according to the node information corresponding to the at least one response node; Add the first indication information to the message to obtain a target message; Based on the first indication information, send the target message to the first node.
3. The method according to claim 2, wherein The step of, when there is the identification information in the target message, saving the target message and transmitting the target message to the next response node among the at least one response nodes includes: When there is the identification information in the target message, save the target message; Transmit the target message to the next response node among the at least one response nodes according to the transmission order indicated by the first indication information.
4. The method according to claim 2, characterized in that The request node generating first indication information according to the node information corresponding to the at least one response node includes: Adding the identification information to the target message through a compiler; Based on the identification information and a routing algorithm, determining the transmission path corresponding to the target message; Generating first indication information based on the transmission path.
5. The method according to claim 1, wherein The step of, when there is the identification information in the target message, saving the target message and transmitting the target message to the next response node among the at least one response nodes includes: When there is the identification information in the target message, save the target message and add second indication information to the target message; the second indication information is used to indicate that the first node has received the target message; Transmit the target message to the response nodes among the at least one response nodes that have not received the target message until each node among the at least one response nodes has received the target message.
6. The method according to claim 1, characterized in that Transmitting the target message to the next response node among the at least one response node includes: When the identification information exists in the target message, saving the target message; Copying the target message and modifying the target address corresponding to the copied target message according to the node information of the next response node among the at least one response node; Based on the target address, transmitting the target message to the next response node among the at least one response node.
7. A message transmission device, characterized in that, Applied to a network-on-chip, the network-on-chip includes a request node and a response node; the device includes: A determination module, configured to determine at least one response node corresponding to the message to be transmitted; An obtaining module, configured to add the node information corresponding to the at least one response node to the message to obtain a target message; A sending module, configured to send the target message to a first node; the first node is any one of the at least one response node; the first node is the first node among the at least one response node indicated by the first indication information to transmit the message; the first indication information is used to indicate the transmission order of the message among the at least one response node; The determination module is further configured to determine whether identification information exists in the target message when the target message is obtained; the identification information is used to indicate that the target message is transmitted by broadcast; A saving module, configured to save the target message when the identification information exists in the target message; A transmission module, configured to transmit the target message to the next response node among the at least one response node.
8. The device according to claim 7, characterized in that, The obtaining module includes: A generating module, configured to generate first indication information according to the node information corresponding to the at least one response node; the first indication information is used to indicate the transmission order of the message among the at least one response node; An obtaining sub-module, configured to add the first indication information to the message to obtain a target message.
9. An electronic device, characterized in that, The electronic device includes a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store executable instructions, and the executable instructions cause the processor to execute the message transmission method according to any one of claims 1 to 6.
10. A readable storage medium, characterized in that, When the instructions in the readable storage medium are executed by the processor of the electronic device, the processor is enabled to execute the message transmission method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Path detection method and device and computer storage medium
CN110995583A
Multicast communication method and device, electronic equipment and storage medium
CN118972189A