Traffic load balancing method and device, electronic equipment, storage medium and product
By setting the aging time of forwarding table entries and calculating available bandwidth during the training of large AI models, the problem of inaccurate load balancing in traditional solutions is solved, achieving more efficient traffic load balancing, avoiding network congestion, and improving resource matching efficiency.
Patent Information
- Application Number
- CN202411425364.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-12
AI Technical Summary
In AI large-scale model training scenarios, traditional dynamic load balancing solutions struggle to accurately identify port traffic load, making load balancing difficult and leading to network congestion.
By setting the aging time of forwarding table entries to cover a complete iteration cycle of AI large model training, and combining the physical bandwidth of the outgoing port, real-time occupied bandwidth, and reserved bandwidth to calculate the available bandwidth, the target outgoing port with the largest available bandwidth is selected to forward packets, avoiding the need to measure port bandwidth and queue size in real time, thus improving the accuracy of load measurement.
It improves load balancing performance, avoids network congestion, and enhances the overall efficiency of resource matching for business flows.
Smart Images

Figure CN119299384A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a traffic load balancing method, device, electronic device, storage medium and product. Background Art
[0002] In the field of deep learning, there is usually a network plane used to synchronize the parameter gradients of AI (Artificial Intelligence) models, which is called the parameter plane or computing plane. The Spine-Leaf architecture is a commonly used network architecture for this network plane. The collective communication algorithm is a commonly used algorithm for parameter gradient synchronization. In the specific implementation of collective communication, in order to avoid multiple-to-one (i.e., repeatedly sending the same data packet), the algorithm is usually implemented as a device sending data to only one device at the same time, and a device receiving data from only another device at the same time.
[0003] However, in the scenario of large AI model training, the same large AI model training data stream has characteristics such as time gaps of different sizes and full bandwidth bursts. It is difficult to accurately identify the traffic load of the port using traditional dynamic load balancing solutions, which makes it difficult to achieve load balancing for large AI model training. Summary of the invention
[0004] The present invention provides a traffic load balancing method, device, electronic device, storage medium and product, which are used to solve the problem in the prior art that in the scenario of AI large model training, it is difficult to accurately identify the traffic load of the port using traditional dynamic load balancing solutions, which makes it difficult to achieve load balancing for AI large model training, and achieve accurate measurement of traffic load, improve load balancing effects, and improve the efficiency of resource matching for the overall business flow.
[0005] The present invention provides a traffic load balancing method, which is applied to a network device in a parameter plane network for AI large model training, and the method comprises: Receive a message; the message carries a flow identifier of the AI large model training data flow to which it belongs; If the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, the target egress port with the largest available bandwidth is selected from the egress ports that meet the transmission conditions of the data flow to forward the message, so as to achieve traffic load balancing of the egress ports; Among them, the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
[0006] According to a traffic load balancing method provided by the present invention, the method of selecting a target egress port with the largest available bandwidth from egress ports that meet the transmission conditions of the data flow to forward the message includes: For each egress port that meets the transmission condition of the data flow, based on the physical bandwidth, real-time occupied bandwidth and reserved bandwidth of the egress port, calculate the available bandwidth of the egress port; According to the available bandwidth of each egress port, a target egress port with the largest available bandwidth is selected to forward the message.
[0007] According to a traffic load balancing method provided by the present invention, the real-time occupied bandwidth of the egress port is the transmission demand bandwidth of at least one data stream being transmitted after matching with the egress port, and the reserved bandwidth of the egress port is the transmission demand bandwidth of at least one data stream to be transmitted after matching with the egress port.
[0008] According to a traffic load balancing method provided by the present invention, the flow information of any data flow in the forwarding record table includes a receiving timestamp, and the receiving timestamp is the latest timestamp of receiving a message belonging to any data flow; the method further includes: Determine the message transmission status of any data flow based on the receiving timestamp of any data flow in the forwarding record table; If no message of any data flow is received within the preset aging time, the any data flow is determined to be an inactive data flow, and the flow information of the any data flow in the forwarding record table is deleted.
[0009] According to a traffic load balancing method provided by the present invention, the method further includes: If a message of any of the data flows is received within the preset active time, the any of the data flows is determined to be an active data flow, and the reserved bandwidth of the egress port matching the any of the data flows is increased; The preset active time is shorter than the preset aging time.
[0010] According to a traffic load balancing method provided by the present invention, the flow identifier includes at least a source port and a destination port; after the receiving message, the method further includes: At least one message from the same source port is determined as the same data flow, and at least one message sent to the same destination port is determined as the same data flow.
[0011] The present invention also provides a traffic load balancing device, comprising: A receiving module, used to receive a message; the message carries a flow identifier of the AI large model training data flow to which it belongs; A selection module, for selecting a target egress port with the largest available bandwidth from egress ports that meet the transmission conditions of the data flow to forward the message if the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, so as to achieve traffic load balancing of the egress ports; Among them, the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the traffic load balancing methods described above is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the traffic load balancing method described in any one of the above methods is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned traffic load balancing methods.
[0015] The traffic load balancing method, device, electronic device, storage medium and product provided by the present invention can avoid the problem of difficulty in selecting the time interval for segmenting the data stream by setting the aging time of the forwarding table items to be longer to cover a complete iteration cycle of the AI large model training, without having to segment the data stream by time intervals; by selecting the target egress port with the largest available bandwidth from the egress ports that meet the transmission conditions of the data stream to forward the message, it is possible to select a suitable port for forwarding the data stream based on the actual available bandwidth of the egress port, rather than measuring the bandwidth and queue size of the port in real time, which can improve the accuracy of load measurement and improve the load balancing effect, thereby avoiding the problem of network congestion caused by the imbalance of traffic load of the AI large model training due to incorrect matching of the egress ports, thereby improving the efficiency of resource matching for the overall business flow. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a schematic diagram of the Spine-Leaf network structure in the prior art.
[0018] Figure 2 This is a schematic diagram of traffic imbalance between multiple spines in the prior art.
[0019] Figure 3 It is a schematic diagram of the dynamic load balancing process in the prior art.
[0020] Figure 4 This is the second flow chart of the traffic load balancing method provided in the embodiment of the present invention.
[0021] Figure 5 It is a schematic diagram of the time interval of the AI large model training data stream provided by an embodiment of the present invention.
[0022] Figure 6 It is a schematic diagram of the format of the forwarding record table provided in an embodiment of the present invention.
[0023] Figure 7 It is a flowchart of processing based on data flow activity provided by an embodiment of the present invention.
[0024] Figure 8 This is the second flow chart of the traffic load balancing method provided in the embodiment of the present invention.
[0025] Fig. 9 It is a structural diagram of a traffic load balancing device provided in an embodiment of the present invention.
[0026] Fig.10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] Reference Figure 1 , Figure 1 It is a schematic diagram of the Spine-Leaf network structure in the prior art.
[0029] In the Spine-Leaf network structure, a Leaf switch and a Spine switch can be connected by multiple physical links. A Leaf can also be connected to multiple Spine switches at the same time. These physical links can use ECMP (Equal-cost multi-path routing) for load balancing and routing. ECMP can use various hash algorithms to hash data streams, thereby distributing data streams to different links. However, it is often the case that two data streams are hashed to the same physical link. This may happen on multiple uplinks from the same Leaf to the same Spine, that is, Figure 1The Leaf hash in the process is unbalanced; it may also happen on multiple downlinks from the same Spine to the same Leaf. Figure 1 The Spine hash is unbalanced. Another type of traffic imbalance is when multiple tasks are performed concurrently, the concurrent traffic is unevenly distributed among multiple Spine nodes, resulting in unbalanced traffic among multiple Spine nodes.
[0030] ①Leaf hash imbalance is caused by the information of data flow and the hash mechanism of Leaf switch. ②Spine hash imbalance is caused by the information of data flow and the hash mechanism of Spine switch. ③The traffic imbalance between multiple Spine is caused by the upstream data flow of multiple Leafs to the same Spine, which leads to conflicts when the Spine data flow is downlink.
[0031] ①Leaf hash collision and ②Spine hash collision can be as follows Figure 1 As shown in the figure, when there are multiple physical links between Leaf1 and Spine1, data flow routing is unbalanced.
[0032] Reference Figure 2 , Figure 2 This is a schematic diagram of traffic imbalance between multiple spines in the prior art.
[0033] Assume that each Leaf switch has 4 downstream interfaces connected to 4 servers and 4 upstream interfaces connected to two Spine switches, and each Spine switch is connected to 2 physical links. Assume that a balanced traffic distribution algorithm is used so that the traffic of the 4 servers under Leaf1 is evenly distributed to the 4 upstream physical links. The data stream sent by server L1S1 is distributed to Spine1 via the physical link Leaf1-Spine1-1 between Leaf1 and Spine1, the data stream sent by server L1S2 is distributed to Spine1 via the physical link Leaf1-Spine1-2 between Leaf1 and Spine1, the data stream sent by server L1S3 is distributed to Spine2 via the physical link Leaf1-Spine2-1 between Leaf1 and Spine2, and the data stream sent by server L1S4 is distributed to Spine2 via the physical link Leaf1-Sp2-2 between Leaf1 and Spine2. The data stream sent by server L4S1 is distributed to Spine1 via the physical link Leaf4-Spine1-1 between Leaf4 and Spine1. The data stream sent by server L4S2 is distributed to Spine1 via the physical link Leaf4-Spine1-2 between Leaf4 and Spine1. The data stream sent by server L4S3 is distributed to Spine1 via the physical link Leaf4-Spine2-1 between Leaf4 and Spine2. The data stream sent by server L4S4 is distributed to Spine2 via the physical link Leaf4Spine2-2 between Leaf4 and Spine2. The upstream traffic distribution of other leaves follows the same distribution rules. The downstream data stream sent by Spine1 to L1S1 and L1S3 is distributed to the physical link Leaf1-Spine1-1 between Leaf1 and Spine1. The downstream data stream sent by Spine1 to L1S2 and L1S4 is distributed to the physical link Leaf1-Spine1-2 between Leaf1 and Spine1. Downstream data flows from Spine2 to L1S1 and L1S3 are distributed to the physical link Leaf1-Spine2-1 between Leaf1 and Spine2. Downstream data flows from Spine2 to L1S2 and L1S4 are distributed to the physical link Leaf1-Spine2-2 between Leaf1 and Spine2. Other downstream data flows follow the same distribution rules.
[0034] At this time, there is no ①Leaf hash conflict and ②Spine hash conflict, but in the multi-task concurrent scenario, there is ③Unbalanced traffic among multiple spines. Figure 2In the figure, line m represents one task, and line n represents another task. The servers participating in task m include L1S1, L1S2, L2S1, and L2S2, and the servers participating in task n include L4S1, L4S3, L2S3, and L2S4. L1S1 of task n sends data streams to L2S1, and L1S2 to L2S2. At the same time, L4S1 of task m sends data streams to L2S3, and L4S2 to L2S4. At this time, according to the above distribution rules, these 4 data streams are all distributed to Spine1, and the destination Leaf switch is Leaf2. However, Spine1 and Leaf2 have only two physical links, which will inevitably lead to traffic conflicts. This is ③ Traffic imbalance among multiple spines.
[0035] Reference Figure 3 , Figure 3 The conventional dynamic load balancing solution can dynamically measure the load of each port, and when a new data stream arrives, a port with a lighter load can be selected to send the new data stream according to the load measurement result.
[0036] However, traditional dynamic load balancing solutions have the following problems: 1) The queue length and port bandwidth load are an instantaneous dynamic process. Different measurement time windows and different service traffic models will lead to different measurement results, making it difficult to measure the actual port load.
[0037] 2) Traffic conflicts generate PFC (Priority-based Flow Control), which results in message time intervals. Multiple conflicting data flows all time out and re-select routes within a short period of time, which can easily lead to new conflicts.
[0038] 3) When the interval between messages is set to a long time, rerouting cannot be triggered, and the effect is degraded to be similar to static routing. When the interval is set to a short time, the routing lacks memory and is easy to trigger rerouting, resulting in a new congestion routing cycle.
[0039] 4) In the AI large model training scenario, the iteration cycle is long, and each iteration requires repeated re-routing and the traffic conflict process of the previous iteration.
[0040] In response to the above problems, the embodiments of the present invention set the aging time of the forwarding table entries to be longer to cover a complete iteration cycle of the AI large model training. There is no need to segment the data stream by time intervals, which can avoid the difficulty in selecting the time interval for segmenting the data stream. By selecting the target egress port with the largest available bandwidth from the egress ports that meet the transmission conditions of the data stream to forward the message, the appropriate port can be selected to forward the data stream based on the actual available bandwidth of the egress port, rather than measuring the bandwidth and queue size of the port in real time. This can improve the accuracy of load measurement and improve the load balancing effect, thereby avoiding the network congestion problem caused by the imbalance of traffic load of the AI large model training due to incorrect matching of the egress port, thereby improving the efficiency of resource matching for the overall business flow.
[0041] Figure 4 This is the second flow chart of the flow load balancing method provided by the embodiment of the present invention. Figure 4 The embodiment of the present invention provides a traffic load balancing method, which may specifically include the following steps: Step 401, receiving a message; the message carries the flow identifier of the AI large model training data flow to which it belongs.
[0042] It should be noted that the execution subject of the traffic load balancing method provided in the embodiment of the present invention can be a network device in the parameter plane network applied to AI model training, as a dynamic load sharing feature of an equal-cost path or an aggregated link. Among them, the network device can refer to a network card, a switch (a switch can include leaf and spine), etc.
[0043] After receiving the message, the network device can identify the flow identification information of the AI large model training data flow carried by the message. The flow identification information may include the data flow ID (Identity document), outbound port, source IP (Internet Protocol), destination IP, source port, destination port, protocol number, etc.
[0044] Step 402: If the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, the target egress port with the largest available bandwidth is selected from the egress ports that meet the transmission conditions of the data flow to forward the message, so as to achieve traffic load balancing of the egress ports; wherein the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
[0045] The forwarding record table may refer to a data table used to record the forwarding record information of the network device forwarding the AI large model training data stream. The forwarding record table may include multiple forwarding record table entries, each of which may correspond to a row in the forwarding record table, and a row in the forwarding record table may record all flow information of the same data stream. Specifically, the first column of the forwarding record table may record the flow identifiers of different data streams, and the second column may record the egress port matched by each data stream. In some embodiments, the forwarding record information may also be recorded through a database, and the present invention does not impose specific restrictions on the recording form of the forwarding record information.
[0046] The forwarding record table does not include the flow identifier of the data flow, which may represent that the data flow has not been forwarded, that is, the data flow is a new data flow; the forwarding record table includes the flow identifier of the data flow but does not include the egress port of the data flow, which may represent that the data flow has been forwarded, that is, the data flow is an old data flow, but the egress port matched by the data flow has not been recorded, or the egress port of the recorded data flow is lost or deleted. The embodiment of the present invention can accurately determine whether the AI large model training data flow matches the egress port through the forwarding record table, and refines the two situations of the data flow that does not match the egress port, that is, not only the situation where the new data flow does not match the egress port is considered, but also the situation where the old data flow does not match the egress port is considered.
[0047] In an embodiment of the present invention, after identifying the flow identification information of the AI large model training data flow carried by the message, the flow identification of the data flow can be queried in the forwarding record table, and whether the AI large model training data flow matches the output port can be determined based on the query result.
[0048] If the forwarding record table includes the egress port corresponding to the flow identifier of the data flow, it can mean that the data flow has matched the egress port, and any message of the data flow can be forwarded through the recorded egress port. If the forwarding record table does not include the flow identifier of the data flow, or the forwarding record table includes the flow identifier of the data flow but does not include the egress port corresponding to the data flow, it means that the AI large model training data flow does not match the egress port, then the target egress port with the largest available bandwidth can be selected from the egress ports that meet the transmission conditions of the data flow to forward the message, and the flow identifier of the data flow and the matching target egress port are recorded in the forwarding record table, so as to realize the real-time update of the forwarding record table according to the traffic matching result.
[0049] In an embodiment of the present invention, an egress port can be matched for a data stream according to the available bandwidth of at least one egress port that satisfies the transmission condition of the data stream. The transmission condition can be considered as two cases, the first being bandwidth and the second being delay. For example, the transmission condition can be set to the maximum available bandwidth, or the transmission condition can be set to the available bandwidth being greater than the maximum bandwidth required to transmit the data stream. For another example, the transmission condition can be set to the one with the shortest delay, or other user-defined transmission conditions. The transmission condition can be set according to the needs of the user.
[0050] In some embodiments, if delay information is used as a transmission condition, the delay information of the last transmission to the next hop can be recorded in the forwarding record table for each egress port, and when making port matching, the egress port with the shortest delay can be used as the matching target.
[0051] In the embodiment of the present invention, the available bandwidth of a port can be the bandwidth of the egress port minus the bandwidth of the ingress ports of all data flows flowing to the egress port. If there are multiple data flows with the same ingress port flowing to the egress port, the bandwidth of the ingress port can be deducted only once from the available bandwidth of the egress port, and no repeated deduction is performed.
[0052] Since the available bandwidth determined by any egress port is determined by the traffic matching result of the egress port, and the actual available bandwidth of any egress port also changes with the traffic matching result, that is, the traffic matching result determines the traffic transmitted through any egress port, therefore, the determination time of the available bandwidth will not be delayed by the actual change time of the available bandwidth. Compared with the method of actually measuring the available bandwidth by the amount of data transmitted within the time window, the embodiment of the present invention improves the accuracy of the available bandwidth, and further improves the accuracy of determining the egress port whose available bandwidth meets the transmission condition, thereby avoiding network congestion caused by incorrect matching of the egress port.
[0053] In an embodiment of the present invention, after determining the target egress port with the largest available bandwidth, the message can be forwarded through the target egress port. When a message belonging to the AI large model training data stream is subsequently received, the message can be directly forwarded through the egress port.
[0054] In some embodiments, in the network device, the resource usage of each egress port can also be recorded as a basis for subsequent matching of new data flows to the port, without the need to recalculate the used information of the egress port each time, thereby improving efficiency.
[0055] Figure 5 Schematic diagram of the time interval of the AI large model training data stream provided by the embodiment of the present invention. Figure 5The data stream for AI large model training can have the following characteristics: (1) Periodicity, where each iteration is a large cycle; (2) There are time gaps in the data stream, with large time gaps between iteration cycles, and small time gaps between multiple collective communications within an iteration cycle and between steps within a collective communication; (3) There are few data streams, and the number of data streams at the same time is less than or equal to the number of physical links; (4) At the same time, there is only one data stream on an ingress port, and it is a full-load burst; (5) The data stream is balanced, and the traffic of different data streams is basically the same.
[0056] In the scenario of AI large model training, the same data stream may have features such as time gaps of different sizes and full bandwidth bursts. The embodiment of the present invention does not split the data stream by time intervals. By setting the preset aging time of the forwarding table entries to be longer to cover a complete iteration cycle of AI large model training, the problem of difficulty in selecting the time interval for splitting the data stream in the prior art can be avoided.
[0057] The embodiment of the present invention sets the aging time of the forwarding table entries to be longer to cover a complete iteration cycle of the AI large model training. There is no need to segment the data stream by time intervals, which can avoid the problem of difficulty in selecting the time interval for segmenting the data stream. By selecting the target egress port with the largest available bandwidth from the egress ports that meet the transmission conditions of the data stream to forward the message, the appropriate port can be selected to forward the data stream based on the actual available bandwidth of the egress port, rather than measuring the bandwidth and queue size of the port in real time. This can improve the accuracy of load measurement and improve the load balancing effect, thereby avoiding the problem of network congestion caused by the imbalance of traffic load of the AI large model training due to incorrect matching of the egress port, thereby improving the efficiency of resource matching for the overall business flow.
[0058] Based on any of the above embodiments, selecting a target egress port with the largest available bandwidth from egress ports that meet the transmission conditions of the data flow to forward the message may specifically include: Step S11, for each egress port that meets the transmission conditions of the data flow, based on the physical bandwidth, real-time occupied bandwidth and reserved bandwidth of the egress port, calculating the available bandwidth of the egress port; Step S12: According to the available bandwidth of each egress port, a target egress port with the largest available bandwidth is selected to forward the message.
[0059] Specifically, the target output port P can be calculated by the following formula: D Available bandwidth: B D =MAX(B Physical -B 实时占用带宽 -B 预留带宽 ); Among them, B Dis the actual bandwidth of the target outbound port, B Physical is the physical bandwidth, B 实时占用带宽 To occupy bandwidth in real time, B 预留带宽 To reserve bandwidth.
[0060] In the embodiment of the present invention, after the available bandwidth of each egress port is calculated, a target egress port with the largest available bandwidth may be selected, and the message may be forwarded through the target egress port.
[0061] The embodiment of the present invention calculates the available bandwidth based on the physical bandwidth, real-time occupied bandwidth and reserved bandwidth of the egress port, thereby selecting port resources for the data flow based on the actual remaining bandwidth of the egress port. This can accurately and stably measure the load of each port, select the most suitable port for the data flow, avoid the occurrence of network congestion problems due to load imbalance, and improve the efficiency of resource matching for the overall business flow.
[0062] Based on any of the above embodiments, the real-time occupied bandwidth of the egress port is the transmission demand bandwidth of at least one data stream being transmitted after matching with the egress port, and the reserved bandwidth of the egress port is the transmission demand bandwidth of at least one data stream to be transmitted after matching with the egress port.
[0063] The available bandwidth of any egress port may be determined based on the traffic matching result of the egress port. The traffic matching result of any egress port may indicate whether the egress port matches a data stream, and in the case where any egress port matches a data stream, the traffic matching result also indicates the transmission required bandwidth of at least one other data stream that matches any egress port, and the at least one other data stream may include a data stream that is being transmitted after matching and a data stream that has been matched but is not being transmitted.
[0064] In the embodiment of the present invention, the real-time occupied bandwidth of the egress port is the transmission demand bandwidth of at least one data stream being transmitted after matching with the egress port, and the reserved bandwidth of the egress port is the transmission demand bandwidth of at least one data stream to be transmitted after matching with the egress port. The available bandwidth of the egress port can be obtained by subtracting the bandwidth occupied by other data streams that have occupied the egress port (including occupied and used, occupied but not used) from the maximum bandwidth (physical bandwidth) of the egress port.
[0065] Based on any of the above embodiments, the flow information of any data flow in the forwarding record table includes a receiving timestamp, and the receiving timestamp is the latest timestamp of receiving a message belonging to any of the data flows; the method may also include: Step S21, determining the message transmission status of any data flow based on the receiving timestamp of any data flow in the forwarding record table; Step S22: If no message of any data flow is received within a preset aging time, the data flow is determined to be an inactive data flow, and the flow information of the data flow in the forwarding record table is deleted.
[0066] Figure 6 Schematic diagram of the format of the forwarding record table provided by the embodiment of the present invention. Figure 6 In addition to the flow identifier and the egress port, the flow information of any data flow in the forwarding record table may also include a receiving timestamp, which can be used to indicate the time when the message belonging to any data flow is received after the previous receiving timestamp, that is, the receiving timestamp of any data flow is the latest timestamp of the message belonging to the data flow.
[0067] In the embodiment of the present invention, the message transmission status of any data flow can be determined according to the receiving timestamp of any data flow. If the message of any data flow is not received within the preset aging time, the data flow can be determined to be an inactive data flow. In this case, in order to save storage space and maintain efficient forwarding record information, the flow information of the data flow can be deleted to ensure the validity of the forwarding record information.
[0068] As time goes by, some data flows may become active, while other data flows may become inactive. The embodiment of the present invention allows a network device to dynamically adjust the forwarding record information in its forwarding record table through the aging time mechanism, and only retains the information of currently active or important data flows, thereby improving the performance and efficiency of the network device.
[0069] In some embodiments, the user can configure a preset aging time based on the actual network situation. If no message belonging to any data flow is received within the aging time, the flow information of any data flow in the forwarding record table can be deleted. The aging time can indicate the maximum time interval between two adjacent messages in any data flow. If no message of the data flow is received after the aging time, the data flow is considered to be inactive.
[0070] As an example, for any data stream that is sent periodically, the aging time can be greater than the sending period of any data stream. A data stream that is sent periodically means that the data stream is sent regularly at a certain time interval, that is, the same data stream is sent once every certain period of time. In this way, the aging time is greater than the sending period, so that the periodically sent data stream can be directly forwarded according to the egress port recorded in the forwarding record table without re-matching the egress port, thereby reducing the resources consumed by matching the egress port.
[0071] By setting the aging time to be greater than the sending cycle, it can be ensured that even when the data flow is temporarily inactive, the flow information related to the data flow can still be retained in the forwarding record table. When the data flow becomes active again, the network device can quickly re-identify and match the egress port of the data flow without reconfiguration or learning. In practical applications, the aging time can be adjusted according to the performance, storage limitations or other factors of the network device. It should be noted that too short an aging time may lead to frequent record updates and storage overhead, while too long an aging time may lead to a waste of storage space or unnecessary matching delays.
[0072] Based on any of the above embodiments, the method may further include: if a message of any of the data flows is received within a preset active time, determining that any of the data flows is an active data flow, and increasing the reserved bandwidth of the egress port matching any of the data flows; wherein the preset active time is less than the preset aging time.
[0073] In the embodiment of the present invention, the activity of each data flow can be calculated through the timestamp information, the flow information of the data flow that has been inactive for a long time can be deleted, and the bandwidth configuration can be increased for the highly active data flow.
[0074] Figure 7 Schematic diagram of a process for processing based on data flow activity provided by an embodiment of the present invention. Figure 7 , users can set two standard time thresholds for judging active data flows: active time T min and aging time T max After receiving the message, the network device can calculate the interval time T of the data flow by analyzing the timestamp information of the data flow carried by the message and the timestamp information of the data flow in the forwarding record table. △ , and judge the activity of the data flow based on the interval time.
[0075] If the interval time T △ <Active time T min , the data flow is determined to be an active data flow, and the reserved bandwidth of the egress port matching the data flow is increased, for example, an additional 20% bandwidth may be reserved and allocated.
[0076] If the active time T min <T △ <Aging time T max , then the data flow is determined to be a data flow with normal activity, and the bandwidth of the egress port is reserved according to normal requirements.
[0077] If the active time T △ >Aging time T max, then it is determined that any data flow is an inactive data flow, and aging processing can be performed to delete the flow information of the data flow in the forwarding record table.
[0078] The embodiment of the present invention can identify cold services through an aging processing mechanism, thereby releasing hardware resources. In a scenario where there are many cold services occupying resources, resource utilization can be greatly improved.
[0079] Based on any of the above embodiments, the flow identifier includes at least a source port and a destination port; after the receiving message, it may also include: determining at least one message from the same source port as the same data flow, and determining at least one message sent to the same destination port as the same data flow.
[0080] In the embodiment of the present invention, the network device can identify which data flow the received message belongs to through the flow identification information. The network device can determine the uplink messages from the same source port as the same data flow, and determine the messages sent to the same destination port as the same data flow, so that the number of identified data flows is small, thereby reducing the number of times the data flow is matched with the outbound port, and improving the business operation efficiency.
[0081] Figure 8 This is the second flow chart of the flow load balancing method provided by the embodiment of the present invention. Figure 8 After receiving the message, the network device can identify the flow identification information D1 of the AI large model training data flow to which the message belongs, and search for the flow identification information D1 in the forwarding record table.
[0082] If the egress port corresponding to the flow identifier D1 is found in the forwarding record table, it means that the data flow has matched the egress port, and the message is forwarded through the egress port associated with the record, and the forwarding record table is refreshed.
[0083] If the egress port corresponding to the flow identifier D1 is not found in the forwarding record table, or the flow identifier D1 is not included, it means that the data flow does not match the egress port. From the egress ports that meet the bandwidth requirements of the data flow, the egress port with the largest available bandwidth can be selected as the target egress port. D1 The maximum available bandwidth can be calculated according to the following formula: B D1 =MAX(B Physical -B 实时占用带宽 -B 预留带宽 ); After the target egress port is obtained, the message can be forwarded according to the selected target egress port, and the forwarding record table is refreshed.
[0084] The embodiments of the present invention can be used in the field of deep learning and can optimize the efficiency of collective communication in AI large model training: first, it can greatly improve the accuracy of data stream port selection, so that the data stream can be allocated to the most suitable port, and the overall business operation efficiency is higher; second, it can effectively manage the life cycle of the data stream, and through the aging mechanism, timely exit the inactive data stream, release port resources, and maximize resource utilization.
[0085] The traffic load balancing device provided by the present invention is described below. The traffic load balancing device described below and the traffic load balancing method described above can be referenced to each other.
[0086] Fig. 9 Schematic diagram of the structure of the flow load balancing device provided by the embodiment of the present invention. Fig. 9 The embodiment of the present invention provides a traffic load balancing device, which may specifically include the following modules: The receiving module 901 is used to receive a message; the message carries a flow identifier of the AI large model training data flow to which it belongs; The selection module 902 is used to select the target egress port with the largest available bandwidth from the egress ports that meet the transmission conditions of the data flow to forward the message if the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, so as to achieve traffic load balancing of the egress port; wherein the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
[0087] Based on any of the above embodiments, the selection module includes: A bandwidth calculation submodule, configured to calculate, for each egress port that meets the transmission conditions of the data stream, the available bandwidth of the egress port based on the physical bandwidth, real-time occupied bandwidth and reserved bandwidth of the egress port; The forwarding submodule is used to select a target egress port with the largest available bandwidth to forward the message according to the available bandwidth of each egress port.
[0088] Based on any of the above embodiments, the real-time occupied bandwidth of the egress port is the transmission demand bandwidth of at least one data stream being transmitted after matching with the egress port, and the reserved bandwidth of the egress port is the transmission demand bandwidth of at least one data stream to be transmitted after matching with the egress port.
[0089] Based on any of the above embodiments, the flow information of any data flow in the forwarding record table includes a receiving timestamp, and the receiving timestamp is the latest timestamp of receiving a message belonging to any of the data flows; the device also includes: A transmission status determination module, used to determine the message transmission status of any data flow based on the receiving timestamp of any data flow in the forwarding record table; The flow information deletion module is used to determine that any data flow is an inactive data flow and delete the flow information of any data flow in the forwarding record table if no message of any data flow is received within a preset aging time.
[0090] Based on any of the above embodiments, the device further includes: A bandwidth increasing module, configured to determine that any data flow is an active data flow if a message of any data flow is received within a preset active time, and to increase the reserved bandwidth of an egress port matching any data flow; The preset active time is shorter than the preset aging time.
[0091] Based on any of the above embodiments, the flow identifier includes at least a source port and a destination port; after the receiving message, the method further includes: The data flow determination module is used to determine at least one message from the same source port as the same data flow, and to determine at least one message sent to the same destination port as the same data flow.
[0092] The embodiment of the present invention sets the aging time of the forwarding table entries to be longer to cover a complete iteration cycle of the AI large model training. There is no need to segment the data stream by time intervals, which can avoid the problem of difficulty in selecting the time interval for segmenting the data stream. By selecting the target egress port with the largest available bandwidth from the egress ports that meet the transmission conditions of the data stream to forward the message, the appropriate port can be selected to forward the data stream based on the actual available bandwidth of the egress port, rather than measuring the bandwidth and queue size of the port in real time. This can improve the accuracy of load measurement and improve the load balancing effect, thereby avoiding the problem of network congestion caused by the imbalance of traffic load of the AI large model training due to incorrect matching of the egress port, thereby improving the efficiency of resource matching for the overall business flow.
[0093] Fig.10 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020, and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute the traffic load balancing method, which includes: receiving a message; the message carries the flow identifier of the AI large model training data flow to which it belongs; if the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, then the target egress port with the largest available bandwidth is selected from the egress ports that meet the transmission conditions of the data flow to forward the message, so as to achieve traffic load balancing of the egress port; wherein the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
[0094] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0095] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the traffic load balancing method provided by the above methods, and the method includes: receiving a message; the message carries the flow identifier of the AI large model training data flow to which it belongs; if the flow identifier or the output port corresponding to the flow identifier is not found in the forwarding record table, then from the output ports that meet the transmission conditions of the data flow, select the target output port with the largest available bandwidth to forward the message, so as to achieve traffic load balancing of the output port; wherein the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
[0096] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the traffic load balancing method provided by the above-mentioned methods, the method comprising: receiving a message; the message carries a flow identifier of the AI large model training data flow to which it belongs; if the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, then selecting the target egress port with the largest available bandwidth from the egress ports that meet the transmission conditions of the data flow to forward the message, so as to achieve traffic load balancing of the egress port; wherein the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
[0097] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A traffic load balancing method, characterized in that: A network device in a parameter plane network applied to AI large model training, the method comprising: Receive a message; the message carries a flow identifier of the AI large model training data flow to which it belongs; If the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, the target egress port with the largest available bandwidth is selected from the egress ports that meet the transmission conditions of the data flow to forward the message, so as to achieve traffic load balancing of the egress ports; Among them, the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
2. The traffic load balancing method according to claim 1, characterized in that: The step of selecting a target egress port with the largest available bandwidth from egress ports that meet the transmission conditions of the data flow to forward the message comprises: For each egress port that meets the transmission condition of the data flow, based on the physical bandwidth, real-time occupied bandwidth and reserved bandwidth of the egress port, calculate the available bandwidth of the egress port; According to the available bandwidth of each egress port, a target egress port with the largest available bandwidth is selected to forward the message.
3. The traffic load balancing method according to claim 2, characterized in that: The real-time occupied bandwidth of the egress port is the transmission required bandwidth of at least one data stream being transmitted after matching with the egress port, and the reserved bandwidth of the egress port is the transmission required bandwidth of at least one data stream to be transmitted after matching with the egress port.
4. The traffic load balancing method according to claim 2, characterized in that: The flow information of any data flow in the forwarding record table includes a receiving timestamp, and the receiving timestamp is the latest timestamp of receiving a message belonging to any data flow; the method further includes: Determine the message transmission status of any data flow based on the receiving timestamp of any data flow in the forwarding record table; If no message of any data flow is received within the preset aging time, the any data flow is determined to be an inactive data flow, and the flow information of the any data flow in the forwarding record table is deleted.
5. The traffic load balancing method according to claim 4, characterized in that: The method further comprises: If a message of any of the data flows is received within the preset active time, the any of the data flows is determined to be an active data flow, and the reserved bandwidth of the egress port matching the any of the data flows is increased; The preset active time is shorter than the preset aging time.
6. The traffic load balancing method according to claim 1, characterized in that: The flow identifier includes at least a source port and a destination port; After receiving the message, the method further includes: At least one message from the same source port is determined as the same data flow, and at least one message sent to the same destination port is determined as the same data flow.
7. A traffic load balancing device, characterized in that: include: A receiving module, used for receiving messages; The message carries the flow identifier of the AI large model training data flow to which it belongs; A selection module, for selecting a target egress port with the largest available bandwidth from egress ports that meet the transmission conditions of the data flow to forward the message if the flow identifier or the egress port corresponding to the flow identifier is not found in the forwarding record table, so as to achieve traffic load balancing of the egress ports; Among them, the aging time of the forwarding record table entry is set to cover an iteration cycle of the AI large model training.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the traffic load balancing method as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the traffic load balancing method as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the traffic load balancing method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
A data processing method and network equipment
CN109714266A
Load balancing method and device, electronic equipment and storage medium
CN116915709A
Wireless network load balancing method, system, equipment and medium
CN117580099A
Data stream forwarding method and device, SDN controller and storage medium
CN118101565A
Method for flow statistics, device, and system
WO2023134574A1
Cited By
Resource adjustment method, electronic device, storage medium and program product
CN120711017A