Data routing method and device of network-on-chip, electronic equipment and storage medium

By acquiring node coordinates and congestion time in the on-chip network, and adopting the XY congestion-aware routing mode, the path can be flexibly allocated, solving the problem of unreasonable data routing paths, improving link utilization and communication efficiency, and reducing latency.

CN120881028APending Publication Date: 2025-10-31YUANQIXIN (SHANDONG) SEMICONDUCTOR TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510845498.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

The data routing paths of existing on-chip networks are unreasonable, leading to congestion in network hotspots, insufficient link utilization and throughput, especially serious problems under high load scenarios.

Method used

By obtaining the coordinates of the local node and the target node, the port congestion time of the local node in the first and second directions is determined. The data forwarding port is determined based on the congestion time, and the XY congestion-aware routing mode is adopted to flexibly allocate paths to avoid congested areas.

Benefits of technology

It improves link utilization and data routing balance, reduces latency, and enhances communication efficiency. Compared to fully adaptive routing, it only adds lightweight hardware overhead and significantly improves energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120881028A_ABST
    Figure CN120881028A_ABST
Patent Text Reader

Abstract

The invention provides a data routing method and device of a network-on-chip, electronic equipment and a storage medium, and belongs to the technical field of the network-on-chip, and the method comprises the steps: obtaining coordinates of a local node and a target node in the network-on-chip; if the coordinates of the local node and the target node are different, acquiring congestion time of a port of the local node in a first direction and congestion time of a port of the local node in a second direction; determining a data forwarding port according to the port congestion time in the first direction and the port congestion time in the second direction; the data forwarding port is a port in a first direction or a port in a second direction; forwarding the data of the local node to the next node through the data forwarding port; wherein the first direction is a horizontal component of the local node pointing to the target node direction, and the second direction is a vertical component of the local node pointing to the target node direction. According to the method, the congestion time of the local node port is considered in the process of determining the data routing path, and a more reasonable data routing path can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of on-chip network processing technology, and in particular to a data routing method, apparatus, electronic device, and storage medium for on-chip networks. Background Technology

[0002] AI chips, such as Neural Network Processing Units (NPUs) and Tensor Processing Units (TPUs), often have thousands of computing units due to the need to handle massive matrix operations (such as convolution and attention mechanisms). This makes traditional buses unable to meet the bandwidth and low-latency requirements of parallel data flows in AI chips. Network on Chip (NoC), as the core infrastructure of AI chip design, employs distributed routing, packet switching mechanisms, and dynamic topology structures. It also reduces redundant transmission through routing algorithms and flow control, achieving 30%-50% energy savings compared to traditional buses. It has become a key technology for solving communication problems in multi-core chips and supporting AI computing power.

[0003] However, traditional NoC data routing schemes face significant challenges in terms of congestion control and energy consumption balancing. These challenges are mainly manifested in the following ways: using path-determined XY routing can easily lead to unreasonable data routing paths, which can cause congestion in network hotspots, especially in high-load scenarios where local hotspots can easily form, resulting in insufficient link utilization and throughput. Summary of the Invention

[0004] This invention provides a data routing method, apparatus, electronic device, and storage medium for on-chip networks, to solve the technical problem of unreasonable data routing paths in existing on-chip networks.

[0005] This invention provides a data routing method for an on-chip network, comprising: Obtain the coordinates of the local node and the target node in the on-chip network; If the coordinates of the local node and the target node are different, then the congestion time of the port in the first direction and the congestion time of the port in the second direction of the local node are obtained. The data forwarding port is determined based on the port congestion time in the first direction and the port congestion time in the second direction; the data forwarding port is either the port in the first direction or the port in the second direction. The data from the local node is forwarded to the next node through the data forwarding port. Wherein, the first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

[0006] According to a data routing method for an on-chip network provided by the present invention, the step of determining the data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction includes: The first time interval in which the port congestion time in the first direction is located and the second time interval in which the port congestion time in the second direction are located are determined respectively. The data forwarding port is determined based on the first time interval and the second time interval.

[0007] According to a data routing method for an on-chip network provided by the present invention, the step of determining the data forwarding port based on a first time interval and a second time interval includes: If the maximum value of the first time interval is a first time threshold, or the minimum value of the second time interval is greater than or equal to the maximum value of the first time interval, then the data forwarding port is determined to be the port in the first direction.

[0008] According to a data routing method for an on-chip network provided by the present invention, the step of determining the data forwarding port based on a first time interval and a second time interval includes: If the minimum value of the first time interval is greater than or equal to the maximum value of the second time interval, and the maximum value of the second time interval is less than or equal to the second time threshold, then the data forwarding port is determined to be the port in the second direction. Wherein, the second time threshold is greater than the preset first time threshold.

[0009] According to a data routing method for an on-chip network provided by the present invention, the step of determining the data forwarding port based on a first time interval and a second time interval includes: If the minimum value of the first time interval and the minimum value of the second time interval are both first time thresholds, and the maximum value of the first time interval and the maximum value of the second time interval are both second time thresholds, then compare the port congestion time in the first direction with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then the data forwarding port is determined to be the port in the second direction.

[0010] According to a data routing method for an on-chip network provided by the present invention, the step of determining the data forwarding port based on a first time interval and a second time interval includes: If the first time interval is the same as the second time interval, and the minimum value of the first time interval and the second time interval is greater than or equal to the second time threshold, then the port congestion time in the first direction is compared with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then the time difference between the port congestion time in the first direction and the port congestion time in the second direction is determined. If the time difference is less than or equal to a preset time threshold, then the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, then the data forwarding port is determined to be the port in the second direction.

[0011] According to a data routing method for an on-chip network provided by the present invention, the step of determining the data forwarding port based on a first time interval and a second time interval includes: If the minimum value of the first time interval is the third time threshold, and the minimum value of the second time interval is the second time threshold and the maximum value is the third time threshold, then the time difference between the port congestion time in the first direction and the port congestion time in the second direction is determined. If the time difference is less than or equal to a preset time threshold, then the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, then the data forwarding port is determined to be the port in the second direction; Wherein, the second time threshold is greater than the preset first time threshold.

[0012] According to a data routing method for an on-chip network provided by the present invention, after obtaining the coordinates of the local node and the target node in the on-chip network, the method further includes: If the coordinates of the local node and the target node are the same, then data routing ends.

[0013] The present invention also provides a data routing device for an on-chip network, comprising: The acquisition module is used to obtain the coordinates of the local node and the target node in the on-chip network; And if the coordinates of the local node and the target node are different, then obtain the congestion time of the port in the first direction and the congestion time of the port in the second direction of the local node. The determination module is used to determine the data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction; the data forwarding port is either the port in the first direction or the port in the second direction. The forwarding module is used to forward data from the local node to the next node through the data forwarding port; Wherein, the first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a data routing method for a network-on-a-chip as described above.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data routing method of any of the above-described on-chip networks.

[0016] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a data routing method for on-chip networks as described above.

[0017] The data routing method, apparatus, electronic device, and storage medium for on-chip networks provided by this invention determine the data forwarding port based on the congestion time of the local node's port, which is to say, the data forwarding direction. By taking into account the port congestion time in the process of determining the data routing path, a more reasonable data routing path can be obtained. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the structure of the on-chip network provided by the present invention.

[0020] Figure 2 This is a schematic diagram of the router provided by the present invention.

[0021] Figure 3 This is a flowchart illustrating the data routing method for on-chip networks provided by the present invention.

[0022] Figure 4This is a schematic diagram of the data routing device for on-chip network provided by the present invention.

[0023] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0025] It should be noted that in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The terms "upper," "lower," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Unless otherwise expressly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly, for example, as a fixed connection, a detachable connection, or an integral connection; a mechanical connection or an electrical connection; a direct connection or an indirect connection through an intermediate medium; or a connection within two elements. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0026] The terms "first," "second," etc., used in this invention are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0027] Generally, traditional NoCs face challenges in congestion control and energy balance, including: although adaptive routing algorithms can alleviate congestion through dynamic path adjustment, their complex priority arbitration mechanism increases hardware overhead, resulting in a 15%-20% increase in the area of ​​routers and arbitrators; the buffering mechanism and switching circuits of NoCs account for 30%-40% of the total chip power consumption, and this increases non-linearly with the number of links; at the same time, the additional computational overhead of the congestion feedback mechanism under high load may increase energy consumption by 20%-30%.

[0028] The following is combined with Figures 1-5 This invention describes the data routing method, apparatus, electronic device, and storage medium for on-chip networks provided by the present invention.

[0029] The present invention first provides, as follows Figure 1 The on-chip network shown is a two-dimensional mesh topology, consisting of multiple routers (labeled R) arranged according to row and column coordinate rules to form a regular 4x4 mesh. Each router R has coordinates (such as {0,0}, {1,1}, etc.) and is directly interconnected with adjacent nodes in the east, south, west, and north directions. The on-chip network of this invention supports seamless expansion; adding a new router (e.g., expanding from 4x4 to 8x8) only requires replicating the cell structure according to row and column coordinates, without reconstructing the underlying routing logic. This feature is particularly suitable for the rapid iteration of large-scale AI chips.

[0030] The on-chip network of this invention supports two data routing modes: XY routing mode and XY congestion-aware routing mode. The XY congestion-aware routing mode corresponds to the data routing method of the on-chip network of this invention. XY routing mode follows a deterministic path selection rule, prioritizing horizontal (X-axis) transmission to the column containing the target node, and then vertical (Y-axis) transmission to the row containing the target node. For example, if the local node where the data is currently located is R{1,0} and the target node is R{3,3}, the data first travels eastward along the X-axis from node R{1,0} to node R{1,3}. During this process, because XY routing is a fixed routing algorithm, the data cannot actively detour when it reaches the lightly congested node R{1,2} and will wait at node R{1,2}. After the data reaches node R{1,3}, it is forwarded southward along the Y-axis to the heavily congested node R{2,3} based on the location of the target node, and waits again at node R{2,3} before finally reaching the target node R{3,3}. It can be seen that traditional XY routing results in some links being idle due to fixed paths (in reality, the utilization rate of north-south links is less than 20% during low-load periods).

[0031] The core module of router R is Figure 2The congestion control unit in the router R consists of an XY routing module and a congestion registration table. The XY routing module is the core routing engine, following traditional XY routing rules to support XY routing mode. The congestion level table, as the core module of the congestion control unit, includes direction counters, time thresholds, congestion levels, and enable (0 / 1) for the four ports of router R: W (West), N (North), S (South), and E (East). The WE direction corresponds to the X-axis, and the NS direction corresponds to the Y-axis. The direction counter records the port's congestion time, which is divided into four intervals: (0, 10T], (10T, 20T], (20T, 30T], and (30T, 50T], where T is one period. A port's congestion time in the interval (0, 10T) indicates no congestion in the corresponding direction; (0, 10T) indicates mild congestion; (20T, 30T) indicates moderate congestion; and (30T, 50T) indicates severe congestion. Of course, a port's congestion time greater than 50T also indicates severe congestion. When the enable value in the congestion level table is 1, the port's congestion awareness function is enabled to support XY congestion-aware routing mode; when enabled is 0, the port's congestion awareness function is disabled.

[0032] Data requiring routing, such as the H (Head Flit) packets of data packets, enters the current node (local node) through the in module of one port of router R, and is forwarded to the next node through the out module of another port. The B (Body Flit) and T (Tail Flit) packets of data packets have the same routing path as the H (Head Flit) packets.

[0033] like Figure 3 As shown, the data routing method for on-chip networks provided by the present invention includes steps S1-S4.

[0034] Step S1: Obtain the coordinates of the local node and the target node in the on-chip network.

[0035] A local node is the node where the data is currently located. For example, if data enters node R{1,0} from port W of node R{1,0}, then node R{1,0} is a local node; if data enters node R{1,1} from port W of node R{1,1}, then node R{1,1} is a local node; if data enters node R{2,1} from port N of node R{2,1}, then node R{2,1} is a local node.

[0036] For H (Head Flit) messages, the coordinates of the target node can be obtained by parsing the H (Head Flit) message.

[0037] Step S2: If the coordinates of the local node and the target node are different, then obtain the congestion time of the port in the first direction and the congestion time of the port in the second direction of the local node. The first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

[0038] If the coordinates of the local node and the target node are different, it means that the data routing is incomplete and needs to be forwarded from the local node to the next node. The port congestion time represents the congestion level in the corresponding direction of the port.

[0039] For example, if the local node is R{1,0} and the target node is R{3,3}, then the direction from the local node to the target node is southeast. The horizontal component of the southeast direction is the east (E) direction, and the vertical component of the southeast direction is the south (S) direction. The first direction is the E direction, and the port of the first direction is the E port of node R{1,0}. The second direction is the S direction, and the port of the second direction is the S port of node R{1,0}.

[0040] Step S3: Determine the data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction; the data forwarding port is either the port in the first direction or the port in the second direction.

[0041] In some implementations, the port with the shorter congestion time can be used as the data forwarding port; if the congestion times of two ports are the same, the port in the first direction is selected as the data forwarding port. For example, the local node is... Figure 1 When R{1,1} is selected, since the congestion time of port S of node R{1,1} is less than the congestion time of port E, the data forwarding port is determined to be port S. For example, if the local node is... Figure 1 When R{1,0} is in the range, if the congestion time of port S of node R{1,0} is equal to the congestion time of port E, then the data forwarding port is determined to be port E.

[0042] Step S4: Forward the data from the local node to the next node through the data forwarding port.

[0043] For example, if the data forwarding port is port E of node R{1,0}, then the data is forwarded to node R{1,1} through port E of node R{1,0}. If the data forwarding port is port S of node R{1,1}, then the data is forwarded to node R{2,1} through port S of node R{1,1}.

[0044] As can be seen from the above, the data routing method of the present invention determines the data forwarding port based on the congestion time of the local node's port, that is, determines the data forwarding direction. The congestion time of the port is taken into account in the process of determining the data routing path, which can obtain a more reasonable data routing path.

[0045] In some embodiments, step S3 of the present invention may further include: Determine the first time interval in which the port congestion time in the first direction is located and the second time interval in which the port congestion time in the second direction is located, respectively. The data forwarding port is determined based on the first time interval and the second time interval.

[0046] In some implementations, the port corresponding to the lower priority of the first time interval and the second time interval can be selected as the data forwarding port. If the first time interval and the second time interval are the same, the port in the first direction can be selected as the data forwarding port. For example, when the local node is R{1,1}, the first time interval is (10T, 20T], the second time interval is (0, 10T], and the priority of the first time interval is greater than that of the second time interval. Therefore, the S port of node R{1,1} is selected as the data forwarding port. When the local node is R{1,0}, both the first time interval and the second time interval are (0, 10T], and the E port of node R{1,0} is selected as the data forwarding port.

[0047] This allows for the determination of the data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction.

[0048] In some embodiments, the present invention determines the data forwarding port based on a first time interval and a second time interval, which may further include: If the maximum value of the first time interval is the first time threshold, or the minimum value of the second time interval is greater than or equal to the maximum value of the first time interval, then the data forwarding port is determined to be the port in the first direction.

[0049] The first time threshold can be 10T. The maximum value of the first time interval is the first time threshold, which means the first time interval is (0, 10T). If the congestion level of the local node in the first direction is no congestion, then the port in the first direction is directly used as the data forwarding port.

[0050] The cases where the maximum value of the first time interval is the first time threshold include: the congestion level in the first direction is no congestion (the first time interval is (0,10T]) and the congestion level in the second direction is no congestion (the second time interval is (0,10T]).

[0051] If the minimum value of the second time interval is greater than or equal to the maximum value of the first time interval, it indicates that the congestion level in the first direction is lower than that in the second direction. This includes: no congestion in the first direction (first time interval (0, 10T)) and mild congestion in the second direction (second time interval (10T, 20T)); no congestion in the first direction (first time interval (0, 10T)) and moderate congestion in the second direction (second time interval (20T, 30T)); and no congestion in the first direction (first time interval (0, 10T)) and severe congestion in the second direction. The six scenarios are: (the second time interval is (30T, 50T)); the first direction has a congestion level of light congestion (the first time interval is (10T, 20T)) and the second direction has a congestion level of moderate congestion (the second time interval is (20T, 30T)); the first direction has a congestion level of light congestion (the first time interval is (10T, 20T)) and the second direction has a congestion level of heavy congestion (the second time interval is (30T, 50T)); and the first direction has a congestion level of moderate congestion (the first time interval is (20T, 30T)) and the second direction has a congestion level of heavy congestion (the second time interval is (30T, 50T)).

[0052] For example, such as Figure 1 As shown, when the local node is R{1,0}, the port in the first direction is the E port of node R{1,0}. Since there is no congestion in node R{1,1} in the E direction, the first time interval in which the congestion time of the E port of node R{1,0} is located is (0,10T]. The maximum value of the first time interval is 10T. The E port of node R{1,0} is used as the data forwarding port to forward the data to node R{1,1}.

[0053] This way, when the congestion level in the first direction of the local node is low, data can be forwarded in the first direction, which can reduce the latency of data routing.

[0054] In some embodiments, the present invention determines the data forwarding port based on a first time interval and a second time interval, and may further include: If the minimum value of the first time interval is greater than or equal to the maximum value of the second time interval, and the maximum value of the second time interval is less than or equal to the second time threshold, then the data forwarding port is determined to be the port in the second direction. The second time threshold is greater than the preset first time threshold.

[0055] The second time threshold can be 20T. If the minimum value of the first time interval is greater than or equal to the maximum value of the second time interval, it means that the congestion level in the first direction is higher than that in the second direction. If the maximum value of the second time interval is less than or equal to the second time threshold, it means that the highest congestion level in the second direction is mild congestion.

[0056] The congestion level in the first direction is higher than that in the second direction, and the highest congestion level in the second direction is mild congestion, including: mild congestion in the first direction (first time interval (10T, 20T)) and no congestion in the second direction (second time interval (0, 10T)); moderate congestion in the first direction (first time interval (20T, 30T)) and no congestion in the second direction (second time interval (0, 10T)); and severe congestion in the first direction (second time interval (0, 10T)). The five scenarios are: a time interval of (30T, 50T) and a congestion level of no congestion in the second direction (second time interval of (0, 10T); a congestion level of moderate congestion in the first direction (first time interval of (20T, 30T)) and a congestion level of light congestion in the second direction (second time interval of (10T, 20T); a congestion level of severe congestion in the first direction (first time interval of (30T, 50T)) and a congestion level of light congestion in the second direction (second time interval of (10T, 20T)).

[0057] For example, such as Figure 1 As shown, when the local node is R{1,1}, since the node R{1,2} in the first direction of the local node is slightly congested and the node R{2,1} in the second direction is not congested, the congestion level in the first direction is slightly congested and the congestion level in the second direction is not congested. Therefore, the port S of node R{1,1} is used as the data forwarding port, and the data is forwarded to node R{2,1}.

[0058] For example, such as Figure 1 As shown, when the local node is R{2,2}, since the node R{2,3} in the first direction of the local node is heavily congested and the node R{3,2} in the second direction is lightly congested, the congestion level in the first direction is heavy congestion and the congestion level in the second direction is light congestion. Therefore, the port S of node R{2,2} is used as the data forwarding port, and the data is forwarded to node R{3,2}.

[0059] Forwarding data in the second direction when the congestion level is lower can reduce data routing latency.

[0060] In some embodiments, the present invention determines the data forwarding port based on a first time interval and a second time interval, and may further include: If the minimum value of the first time interval and the minimum value of the second time interval are both the first time threshold, and the maximum value of the first time interval and the maximum value of the second time interval are both the second time threshold, then compare the port congestion time in the first direction with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then the data forwarding port is determined to be the port in the second direction.

[0061] The minimum value of the first time interval and the minimum value of the second time interval are both the first time threshold of 10T, and the maximum value of the first time interval and the maximum value of the second time interval are both the second time threshold of 20T. This means that the first time interval and the second time interval are both (10T, 20T), and the congestion level of the local node in the first direction and the second direction is mild congestion.

[0062] In this way, when the congestion level in both the first and second directions of the local node is light, forwarding data to the direction with a lower congestion level can reduce data routing latency.

[0063] In some embodiments, the present invention determines the data forwarding port based on a first time interval and a second time interval, and may further include: If the first time interval is the same as the second time interval, and the minimum value of the first time interval and the second time interval is greater than or equal to the second time threshold, then the port congestion time in the first direction is compared with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then determine the time difference between the port congestion time in the first direction and the port congestion time in the second direction. If the time difference is less than or equal to the preset time threshold, the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, the data forwarding port is determined to be the port in the second direction.

[0064] Wherein, the minimum value of the first time interval and the second time interval is greater than or equal to the second time threshold of 20T, which means that the congestion level of the first direction and the second direction is at least moderate congestion, including: both the first direction and the second direction are moderate congestion (first time interval is (20T, 30T], second time interval is (20T, 30T]) and both the first direction and the second direction are severe congestion (first time interval is (30T, 50T], second time interval is (30T, 50T]).

[0065] If the congestion time of the port in the first direction is less than or equal to the congestion time of the port in the second direction, it means that the congestion in the second direction is more severe. Determining the data forwarding port as the port in the first direction can reduce data routing latency.

[0066] When the congestion time of a port in the first direction is greater than that of a port in the second direction, theoretically the congestion in the first direction is more severe, and data should be forwarded to the second direction. However, considering the optimal path and the forwarding characteristics of XY routing, it is necessary to further compare the congestion time difference between the first and second directions. If the time difference is less than or equal to a preset time threshold, it means that the congestion difference between the first and second directions is not significant, and the data forwarding port is determined to be the port in the first direction, reflecting the principle of prioritizing the X direction in XY routing. If the time difference is greater than the preset time threshold, it means that the congestion difference between the first and second directions is significant, and the data forwarding port is determined to be the port in the second direction, which can reduce data routing latency.

[0067] In this way, when the congestion levels in the first and second directions of the local node are the same and relatively severe, the routing principle of prioritizing the X direction can be reflected or the data routing delay can be reduced.

[0068] In some embodiments, the present invention determines the data forwarding port based on a first time interval and a second time interval, and may further include: If the minimum value of the first time interval is the third time threshold, and the minimum value of the second time interval is the second time threshold and the maximum value is the third time threshold, then the time difference between the port congestion time in the first direction and the port congestion time in the second direction is determined. If the time difference is less than or equal to the preset time threshold, the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, the data forwarding port is determined to be the port in the second direction; The second time threshold is greater than the preset first time threshold.

[0069] The third time threshold can be 30T. If the minimum value of the first time interval is the third time threshold, then the first time interval is (30T, 50T], representing severe congestion in the first direction of the local node. If the minimum value of the second time interval is the second time threshold 20T and the maximum value is the third time threshold 30T, then the second time interval is (20T, 30T], representing moderate congestion in the second direction of the local node.

[0070] If the time difference is less than or equal to the preset time threshold, it means that the congestion time difference between the first and second directions is small, and the data forwarding port is determined to be the port for the first direction, reflecting the principle of prioritizing the X direction in XY routing. If the time difference is greater than the preset time threshold, it means that the congestion time difference between the first and second directions is large, and the data forwarding port is determined to be the port for the second direction, which can reduce data routing latency.

[0071] For example, such as Figure 1 As shown, when the local node is R{2,1}, the congestion level in the first direction is severe, and the congestion level in the second direction is moderate. However, the time difference between the congestion in the first direction and the second direction is less than the preset time threshold. The data forwarding port is determined to be the E port of node R{2,1}, and the data is forwarded to node R{2,2}.

[0072] In this way, when the congestion level of the local node in the first direction is higher than that in the second direction and both are relatively severe, the routing principle of prioritizing the X direction can be reflected or the data routing delay can be reduced.

[0073] In some embodiments, after step S1, the data routing method for on-chip networks of the present invention may further include: If the coordinates of the local node and the target node are the same, then data routing ends.

[0074] If the local node and the target node have the same coordinates, it means the data has reached the target node. For H (Head Flit) packets, the routing of H (Head Flit) packets ends, and the local node receives subsequent B and T packets, thus ending the process. This allows routing to end promptly when data routing is complete.

[0075] The invention can ultimately yield the following: Figure 1 The XY congestion-aware routing path shown demonstrates that the congestion-aware routing mode, based on the XY routing algorithm, significantly improves link utilization and balance through flexible path allocation; and compared to fully adaptive routing (which requires virtual channels and complex arbitrators). Figure 1The architecture adds only a lightweight congestion control unit to the traditional XY logic (increasing hardware overhead by about 5%-8%), yet it can achieve more than 50% adaptive routing performance and significantly improve energy efficiency, providing a high-throughput, low-latency communication foundation for AI chips, high-performance computing and other scenarios.

[0076] like Figure 4 As shown, the present invention also provides a data routing device for an on-chip network, comprising: The acquisition module is used to obtain the coordinates of the local node and the target node in the on-chip network; And if the coordinates of the local node and the target node are different, then obtain the congestion time of the port in the first direction and the congestion time of the port in the second direction of the local node. The determination module is used to determine the data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction; the data forwarding port is either the port in the first direction or the port in the second direction. The forwarding module is used to forward data from the local node to the next node through the data forwarding port; The first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

[0077] It should be noted that the on-chip network data routing device provided by the present invention can execute the on-chip network data routing method of any of the above embodiments during specific operation, which will not be elaborated in this embodiment.

[0078] In some implementations, the determining module can also be used for: Determine the first time interval in which the port congestion time in the first direction is located and the second time interval in which the port congestion time in the second direction is located, respectively. The data forwarding port is determined based on the first time interval and the second time interval.

[0079] In some implementations, the determining module can also be used for: If the maximum value of the first time interval is the first time threshold, or the minimum value of the second time interval is greater than or equal to the maximum value of the first time interval, then the data forwarding port is determined to be the port in the first direction.

[0080] In some implementations, the determining module can also be used for: If the minimum value of the first time interval is greater than or equal to the maximum value of the second time interval, and the maximum value of the second time interval is less than or equal to the second time threshold, then the data forwarding port is determined to be the port in the second direction. The second time threshold is greater than the preset first time threshold.

[0081] In some implementations, the determining module can also be used for: If the minimum value of the first time interval and the minimum value of the second time interval are both the first time threshold, and the maximum value of the first time interval and the maximum value of the second time interval are both the second time threshold, then compare the port congestion time in the first direction with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then the data forwarding port is determined to be the port in the second direction.

[0082] In some implementations, the determining module can also be used for: If the first time interval is the same as the second time interval, and the minimum value of the first time interval and the second time interval is greater than or equal to the second time threshold, then the port congestion time in the first direction is compared with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then determine the time difference between the port congestion time in the first direction and the port congestion time in the second direction. If the time difference is less than or equal to the preset time threshold, the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, the data forwarding port is determined to be the port in the second direction.

[0083] In some implementations, the determining module can also be used for: If the minimum value of the first time interval is the third time threshold, and the minimum value of the second time interval is the second time threshold and the maximum value is the third time threshold, then the time difference between the port congestion time in the first direction and the port congestion time in the second direction is determined. If the time difference is less than or equal to the preset time threshold, the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, the data forwarding port is determined to be the port in the second direction; The second time threshold is greater than the preset first time threshold.

[0084] In some implementations, the on-chip network data routing device may further include: The control module is used to terminate data routing if the coordinates of the local node and the target node are the same.

[0085] Figure 5This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5 As shown, the electronic device may include a processor, a communications interface, a memory, and a communication bus, wherein the processor, communications interface, and memory communicate with each other via the communication bus. The processor can invoke logical instructions in the memory to execute a data routing method for the on-chip network. This method includes: obtaining the coordinates of a local node and a target node in the on-chip network; if the coordinates of the local node and the target node are different, obtaining the congestion time of a port in a first direction and the congestion time of a port in a second direction for the local node; determining a data forwarding port based on the congestion time of the first and second directions; the data forwarding port being either the port in the first direction or the port in the second direction; and forwarding the data of the local node to the next node through the data forwarding port; wherein the first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

[0086] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0087] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer is able to execute the on-chip network data routing method provided in the above embodiments, the method including: obtaining the coordinates of a local node and a target node in the on-chip network; if the coordinates of the local node and the target node are different, obtaining the congestion time of a port in a first direction and the congestion time of a port in a second direction of the local node; determining a data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction; the data forwarding port is the port in the first direction or the port in the second direction; forwarding the data of the local node to the next node through the data forwarding port; wherein, the first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

[0088] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data routing method for the on-chip network provided in the above embodiments. The method includes: obtaining the coordinates of a local node and a target node in the on-chip network; if the coordinates of the local node and the target node are different, obtaining the congestion time of a port in a first direction and the congestion time of a port in a second direction of the local node; determining a data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction; the data forwarding port being either the port in the first direction or the port in the second direction; and forwarding the data of the local node to the next node through the data forwarding port; wherein the first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

[0089] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0090] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data routing method for an on-chip network, characterized in that, include: Obtain the coordinates of the local node and the target node in the on-chip network; If the coordinates of the local node and the target node are different, then the congestion time of the port in the first direction and the congestion time of the port in the second direction of the local node are obtained. The data forwarding port is determined based on the port congestion time in the first direction and the port congestion time in the second direction. The data forwarding port is either the port in the first direction or the port in the second direction; The data from the local node is forwarded to the next node through the data forwarding port. Wherein, the first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

2. The data routing method for on-chip networks according to claim 1, characterized in that, The step of determining the data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction includes: The first time interval in which the port congestion time in the first direction is located and the second time interval in which the port congestion time in the second direction are located are determined respectively. The data forwarding port is determined based on the first time interval and the second time interval.

3. The data routing method for on-chip networks according to claim 2, characterized in that, Determining the data forwarding port based on the first time interval and the second time interval includes: If the maximum value of the first time interval is a first time threshold, or the minimum value of the second time interval is greater than or equal to the maximum value of the first time interval, then the data forwarding port is determined to be the port in the first direction.

4. The data routing method for on-chip networks according to claim 2, characterized in that, Determining the data forwarding port based on the first time interval and the second time interval includes: If the minimum value of the first time interval is greater than or equal to the maximum value of the second time interval, and the maximum value of the second time interval is less than or equal to the second time threshold, then the data forwarding port is determined to be the port in the second direction. Wherein, the second time threshold is greater than the preset first time threshold.

5. The data routing method for on-chip networks according to claim 2, characterized in that, Determining the data forwarding port based on the first time interval and the second time interval includes: If the minimum value of the first time interval and the minimum value of the second time interval are both first time thresholds, and the maximum value of the first time interval and the maximum value of the second time interval are both second time thresholds, then compare the port congestion time in the first direction with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then the data forwarding port is determined to be the port in the second direction.

6. The data routing method for on-chip networks according to claim 2, characterized in that, Determining the data forwarding port based on the first time interval and the second time interval includes: If the first time interval is the same as the second time interval, and the minimum value of the first time interval and the second time interval is greater than or equal to the second time threshold, then the port congestion time in the first direction is compared with the port congestion time in the second direction. If the port congestion time in the first direction is less than or equal to the port congestion time in the second direction, then the data forwarding port is determined to be the port in the first direction. If the port congestion time in the first direction is greater than the port congestion time in the second direction, then the time difference between the port congestion time in the first direction and the port congestion time in the second direction is determined. If the time difference is less than or equal to a preset time threshold, then the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, then the data forwarding port is determined to be the port in the second direction.

7. The data routing method for on-chip networks according to claim 2, characterized in that, Determining the data forwarding port based on the first time interval and the second time interval includes: If the minimum value of the first time interval is the third time threshold, and the minimum value of the second time interval is the second time threshold and the maximum value is the third time threshold, then the time difference between the port congestion time in the first direction and the port congestion time in the second direction is determined. If the time difference is less than or equal to a preset time threshold, then the data forwarding port is determined to be the port in the first direction; If the time difference is greater than the preset time threshold, then the data forwarding port is determined to be the port in the second direction; Wherein, the second time threshold is greater than the preset first time threshold.

8. The data routing method for on-chip networks according to claim 1, characterized in that, After obtaining the coordinates of the local node and the target node in the on-chip network, the method further includes: If the coordinates of the local node and the target node are the same, then data routing ends.

9. A data routing device for an on-chip network, characterized in that, include: The acquisition module is used to obtain the coordinates of the local node and the target node in the on-chip network; And if the coordinates of the local node and the target node are different, then obtain the congestion time of the port in the first direction and the congestion time of the port in the second direction of the local node. The determination module is used to determine the data forwarding port based on the port congestion time in the first direction and the port congestion time in the second direction. The data forwarding port is either the port in the first direction or the port in the second direction; The forwarding module is used to forward data from the local node to the next node through the data forwarding port; Wherein, the first direction is the horizontal component of the direction from the local node to the target node, and the second direction is the vertical component of the direction from the local node to the target node.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data routing method for the on-chip network as described in any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data routing method for the on-chip network as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the data routing method for the on-chip network as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Data routing method and device, electronic equipment, storage medium and program product

    CN121585604A