Aggregation communication optimization method and system based on programmable network
Through greedy algorithms and linear programming solutions to model optimization programmable switch deployment and gradient routing, the problem of limited programmable network equipment in distributed training systems is solved, efficient resource utilization and performance improvement is achieved, and model training efficiency is significantly improved.
Patent Information
- Application Number
- CN202410921781.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-08
AI Technical Summary
The existing distributed training system does not fully consider the problem of limited number of programmable network devices in the actual network environment when optimization is based on network aggregation, resulting in poor resource constraints and performance and high deployment costs.
The greedy algorithm and linear planning solution model are used to calculate the programmable switch position deployment and gradient routing strategy, reasonably adjust the switch deployment location and gradient routing strategy, optimize the deployment and use of programmable switches, and achieve efficient network aggregation communication.
It improves resource utilization efficiency, reduces deployment costs, significantly improves gradient aggregation throughput, model training efficiency, and avoids suboptimal solutions caused by individual optimization of deployment and routing in traditional solutions.
Smart Images

Figure CN118917382A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a distributed training technology, and in particular to a programmable network-based aggregate communication optimization method and system thereof. Background Art
[0002] With the rapid development of artificial intelligence and network technology, deep neural networks (DNNs) have been widely used in various aspects of the new generation of applications and services, such as computer vision, natural language processing, etc. Due to the rapid growth of data set size and model size, the computing power of a single node can no longer meet the huge computing needs of different application scenarios. Therefore, DNN models usually adopt distributed training (DT) methods. Most distributed training uses a parameter server architecture with multiple worker servers and at least one parameter server (PS) to train DNN models in parallel to alleviate the computational overhead brought by machine learning.
[0003] One feasible method is to use the programmability of programmable network devices and offload the gradient aggregation calculation tasks of distributed training to programmable switches based on in-network computing technology, namely in-network aggregation (INA), thereby significantly reducing the amount of data transmitted over the network and speeding up distributed training. Specifically, in the PS architecture, after the global gradient results calculated by each working node enter the network, only the transmission function of the network is used, that is, the switch is only responsible for forwarding, so that the gradient data finally reaches the PS end and is only aggregated by the PS. Thanks to the development of programmable network devices, the programmability and in-network computing capabilities of programmable switches can provide in-network aggregation functions for DT.
[0004] However, due to the high deployment cost and power consumption cost of advanced programmable network equipment, programmable switches have not yet been popularized in traditional data center networks. The limited programmable network resources greatly restrict the network's on-line computing capabilities.
[0005] Many existing works do not fully consider the constraints of the limited number of programmable network devices in the actual network environment when optimizing distributed training systems based on on-network aggregation. For example, some research works on gradient routing optimization, switch memory resource optimization or protocol design in distributed training based on on-network computing are based on the premise that the network has sufficient on-network computing capabilities and a sufficient number of programmable switches can be deployed at will, but ignore the scarcity of such programmable network device resources in the actual network environment. In this case, if the deployment locations of limited programmable switches cannot be reasonably planned and the computing resources and processing capacity of these devices cannot be fully utilized, it will be difficult to truly achieve efficient utilization of network resources and maximize the performance gains brought by the INA function, such as reducing network communication overhead and improving model training efficiency.
[0006] Therefore, existing work is relatively idealistic and lacks consideration of the actual network environment and realistic constraints. When applied to real scenarios, it may face severe resource constraints, resulting in performance that fails to meet expectations, or requiring additional investment in a large amount of expensive network equipment, greatly increasing deployment costs. Summary of the invention
[0007] In view of the above-mentioned deficiencies in the prior art, the programmable network-based aggregate communication optimization method and system provided by the present invention solve the problem that the existing methods do not fully consider the limited number of programmable network devices in the actual network environment, which restricts the network's on-line computing capabilities.
[0008] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0009] In a first aspect, a method for optimizing aggregated communication based on a programmable network is provided, comprising the steps of:
[0010] S1. According to the distributed training tasks and programmable network topology information, the greedy algorithm and linear programming solution model are used to calculate the programmable switch location deployment and gradient routing strategy, and publish them to all working nodes, switches and parameter servers;
[0011] S2. Deploy programmable switches at corresponding switches in the programmable network according to the programmable switch deployment strategy;
[0012] S3, train the current round of the deep neural network model, cut the gradient into several gradient data packets; identify a programmable switch number for each gradient data packet according to the gradient routing strategy, and send the data packet to the designated programmable switch;
[0013] S4, receiving the gradient data packet, and determining whether the stored number is equal to the programmable switch number identified by the gradient data packet, if so, performing in-network aggregation when the aggregator is available, and sending it to the ToR switch connected to the parameter server for aggregation when it is not available; otherwise, forwarding the gradient data packet to the next hop switch;
[0014] S5: Receive the local aggregation results of all programmable switches and ToR switches and the unaggregated gradient data packets from the working nodes, perform global aggregation to obtain the global gradient, and then return the ACK packet carrying the global gradient to all switches;
[0015] S6. When receiving the ACK packet from the parameter server, clear the identifier field of the aggregator occupied by the gradient fragment carried in the ACK packet, release the memory resources occupied by the aggregator, and broadcast the ACK packet to all working nodes;
[0016] S7. Use the global gradient in the ACK packet to update the parameters of the deep neural network model, complete a gradient aggregation communication, and then return to step S3 for the next gradient aggregation communication until the deep neural network model training is completed.
[0017] Furthermore, the method of calculating the programmable switch location deployment and gradient routing strategy using the greedy algorithm and the linear programming solution model includes:
[0018] S11, initializing the deployment location set to be empty and the unselected set to be all switches in the programmable network;
[0019] S12, using a greedy algorithm to traverse the set of unselected switches, select any switch to deploy a programmable switch, and generate a set of candidate locations where several programmable switches can be deployed;
[0020] S13. For each candidate location set, a linear programming model is used to calculate the optimal value of the aggregate throughput of the programmable switch at the current deployment location;
[0021] S14, selecting a switch corresponding to the maximum value among all the optimal values of aggregate throughput as a programmable switch deployment position, and moving it from the unselected set to the deployment position set;
[0022] S15, determine whether the number of switches in the deployment location set is less than the maximum deployment number of programmable switches; if so, return to step S12, otherwise go to step S16;
[0023] S16. Output deployment location set S m As a programmable switch deployment strategy, the optimal value of aggregate throughput is calculated using and As a gradient routing strategy;
[0024] in, is the aggregate throughput from working node w to programmable switch s; The gradient sending rate at which worker node w sends gradients to parameter server d for global aggregation.
[0025] Furthermore, the linear programming model is expressed as:
[0026] P2maxγ
[0027]
[0028] Among them, P2 is the linear programming model; max is the maximum value; γ is the aggregate throughput; S is the deployment location set; s dis the ToR switch connected to the parameter server d; W is the set of working nodes used for the distributed training task; C is the processing capacity limit of the programmable switch; is the sending rate of the aggregation results sent directly by the programmable switch s to the parameter server d; Send local aggregation results to ToR switches for programmable switches d rate; For ToR switches d The rate at which the aggregation results are sent directly to parameter server d; Send local aggregation results to switch s for worker node w d rate; and The traffic load generated on link e by the transmission gradients from the working node to the programmable switch, the working node to the parameter server, the programmable switch to the ToR switch of the parameter server, and the programmable switch to the parameter server, respectively; is the capacity limit on link e.
[0029] Furthermore, the traffic load and The expression is:
[0030]
[0031] Where e is a link; ψ is an indicator function of whether link e belongs to a certain link set; P w,d is the set of links on the shortest path from the working node w to the parameter server d; For switch s to the ToR switch s connected to parameter server d d The set of links on the shortest path.
[0032] Further, the determination methods available to the aggregator include:
[0033] According to the gradient data packet number identified by the received gradient data packet, an aggregator index for aggregating the current gradient data packet is calculated by a consistent hash algorithm;
[0034] When the number of the received gradient data packet matches the gradient block number of the aggregator identifier calculated by the hash algorithm, the aggregator is available, and the gradient data packet is distributed to the aggregator to wait for aggregation in the network;
[0035] When the number of the received gradient data packet does not match the gradient block number of the aggregator identifier calculated by the hash algorithm, the aggregator is unavailable.
[0036] In a second aspect, a programmable network-based aggregate communication optimization system is provided, comprising:
[0037] The control plane is used to calculate the programmable switch location deployment and gradient routing strategy based on the distributed training tasks and programmable network topology information using a greedy algorithm and a linear programming model, and publish them to all working nodes, switches, and parameter servers;
[0038] The data plane, which includes worker nodes, programmable switches, and parameter servers;
[0039] The working node is used to train the current round of the deep neural network model, cut the gradient parameters into several gradient data packets; identify a programmable switch number for each gradient data packet according to the gradient routing strategy, and send the data packet to the specified programmable switch; and use the global gradient in the ACK packet to update the gradient parameters of the deep neural network model, and continue to perform training when the distributed training is not completed, otherwise complete the aggregate communication optimization;
[0040] A programmable switch is used to receive a gradient data packet and determine whether its number is equal to the programmable switch number identified by the gradient data packet. If so, it performs on-network aggregation when the aggregator is available, and sends it to the ToR switch connected to the parameter server for aggregation when it is not available; otherwise, it forwards the gradient data packet to the next-hop switch; and when receiving an ACK packet from the parameter server, it clears the identifier field of the aggregator occupied by the gradient fragment carried in the ACK packet, releases the memory resources occupied by the aggregator, and broadcasts the ACK packet to all working nodes;
[0041] The parameter server is used to receive the local aggregation results of all programmable switches and ToR switches and the unaggregated gradient data packets from the working nodes, and perform global aggregation to obtain the global gradient, and then return the ACK packet carrying the global gradient to all switches.
[0042] Furthermore, the method of using a greedy algorithm and a linear programming solution model in a control plane to calculate the programmable switch location deployment and gradient routing strategy includes:
[0043] S11, initializing the deployment location set to be empty and the unselected set to be all switches in the programmable network;
[0044] S12, using a greedy algorithm to traverse the set of unselected switches, select any switch to deploy a programmable switch, and generate a set of candidate locations where several programmable switches can be deployed;
[0045] S13. For each candidate location set, a linear programming model is used to calculate the optimal value of the aggregate throughput of the programmable switch at the current deployment location;
[0046] S14, selecting a switch corresponding to the maximum value among all the optimal values of aggregate throughput as a programmable switch deployment position, and moving it from the unselected set to the deployment position set;
[0047] S15, determine whether the number of switches in the deployment location set is less than the maximum deployment number of programmable switches; if so, return to step S12, otherwise go to step S16;
[0048] S16. Output deployment location set S m As a programmable switch deployment strategy, the optimal value of aggregate throughput is calculated using and As a gradient routing strategy;
[0049] in, is the aggregate throughput from working node w to programmable switch s; The gradient sending rate at which worker node w sends gradients to parameter server d for global aggregation.
[0050] Furthermore, the linear programming model is expressed as:
[0051] P2maxγ
[0052]
[0053] Among them, P2 is the linear programming model; max is the maximum value; γ is the aggregate throughput; S is the deployment location set; s d is the ToR switch connected to the parameter server d; W is the set of working nodes used for the distributed training task; C is the processing capacity limit of the programmable switch; is the sending rate of the aggregation results sent directly by the programmable switch s to the parameter server d; Send local aggregation results to ToR switches for programmable switches d rate; For ToR switches d The rate at which the aggregation results are sent directly to parameter server d; Send local aggregation results to switch s for worker node w d rate; and The traffic load generated on link e by the transmission gradients from the working node to the programmable switch, the working node to the parameter server, the programmable switch to the top-of-rack switch of the parameter server, and the programmable switch to the parameter server, respectively; is the capacity limit on link e.
[0054] The beneficial effects of the present invention are:
[0055] 1. The technical solution of the present invention fully considers the limited resources of programmable switches in the real network environment, and maximizes the use of limited programmable switch computing resources by reasonably adjusting the deployment location of switches supporting INA services, thereby improving resource utilization efficiency. This not only achieves economic cost savings, but also ensures a high level of performance.
[0056] 2. The present invention adopts an efficient greedy algorithm to achieve the optimization goal of maximizing the gradient aggregation throughput of distributed training tasks. This method can help each working node to efficiently and quickly find the gradient routing strategy with the best aggregation throughput under the current programmable switch placement position, while alleviating the network communication bottleneck and accelerating the model training process.
[0057] 3. The technical solution of the present invention avoids the suboptimal solution caused by optimizing the two problems separately in the traditional solution by jointly optimizing the deployment location of the programmable switch and the gradient routing. It is difficult to fully consider the mutual influence between the two problems by optimizing the deployment location of the programmable switch and the gradient routing strategy at the same time, and the present invention can make full use of the close connection between the two sub-problems and give full play to the performance advantages of INA technology.
[0058] 4. Experimental tests have verified the effectiveness and efficiency of the solution proposed in this invention. Compared with existing solutions, SPAR is significantly better than other state-of-the-art solutions based on in-network aggregation and can increase the aggregation throughput by 3 times. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 Flowchart of a method for optimizing converged communications over programmable networks.
[0060] Figure 2 A simplified network topology diagram.
[0061] Figure 3 Block diagram of a system optimized for converged communications over programmable networks.
[0062] Figure 4 The performance comparison diagram under different numbers of deployable programmable switches, where (a) is the change result of the aggregate throughput of the working nodes as the number of deployable programmable switches increases; (b) is the change result of the resource utilization of the programmable switches as the number of deployable programmable switches increases.
[0063] Figure 5 The performance comparison diagram under different numbers of working nodes (workloads), where (a) is the change result of the aggregate throughput of the working nodes as the number of working nodes increases; (b) is the change result of the resource utilization of the programmable switch as the number of working nodes increases. DETAILED DESCRIPTION
[0064] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0065] When performing aggregate communication optimization, this solution first needs to obtain distributed training tasks and programmable network topology information. The programmable network topology is a data center network consisting of N nodes and ε links, and the maximum number of programmable switches that can be deployed in the network is K. For tasks that perform distributed training in this network, the tuple {W, d} is used to represent its gradient aggregation request, where W represents the set of working nodes occupied by the task, and d and PS both represent parameter servers.
[0066] refer to Figure 1 , Figure 1 A flowchart of a method for optimizing aggregated communication based on a programmable network is shown; Figure 1 As shown, the method S includes steps S1 to S7.
[0067] In step S1, according to the distributed training tasks and programmable network topology information, the greedy algorithm and linear programming solution model are used to calculate the programmable switch location deployment and gradient routing strategy, and publish them to all working nodes, switches and parameter servers.
[0068] In step S2, according to the programmable switch deployment strategy, a programmable switch is deployed at a corresponding switch in the programmable network;
[0069] In step S3, the current round of training of the deep neural network model is performed, and the gradient is cut into several gradient data packets; according to the gradient routing strategy, a programmable switch number is identified for each gradient data packet, and the data packet is sent to the specified programmable switch.
[0070] The method of identifying the gradient data packet according to the programmable switch number is: using a tuple <aggregation programmable switch number, gradient block number> to identify each gradient data packet, so as to guide each gradient data packet of the working node to the correct programmable switch or parameter server to perform the aggregation operation.
[0071] In step S4, a gradient data packet is received, and it is determined whether the stored number is equal to the programmable switch number identified by the gradient data packet. If so, in-network aggregation is performed when the aggregator is available, and when it is not available, it is sent to the ToR switch connected to the parameter server for aggregation; otherwise, the gradient data packet is forwarded to the next hop switch. The detailed implementation process of step S4 is as follows:
[0072] Since programmable switches have a fixed number, when receiving a gradient data packet from the previous hop, the programmable switch first compares the aggregated programmable switch number identified in the data packet with its own number. If the two numbers do not match, the current switch forwards the gradient packet to the next hop switch according to the routing table; if they match, the switch calculates the aggregator index of the aggregated gradient block based on the gradient block number identified in the gradient packet through a consistent hashing algorithm.
[0073] The memory of the switch adopts a first-come, first-served dynamic allocation strategy. Each aggregator uses an identifier field to uniquely identify the number of the gradient block it is responsible for aggregating. The value of this identifier is set to the number of the first gradient block that arrives at the aggregator. If the aggregator is available, that is, the number of the gradient block that arrives at the switch matches the gradient block number of the aggregator identifier calculated by the hash algorithm, then the gradient packet is assigned to the aggregator and waits for aggregation; if a hash collision occurs, that is, the gradient block number does not match the number of the aggregator identifier, resulting in the assigned aggregator being unavailable, the switch will forward the gradient packet to the top-of-rack switch of the rack where the parameter server is located for aggregation.
[0074] During implementation, the preferred aggregator of this solution may use the following determination methods:
[0075] According to the gradient data packet number identified by the received gradient data packet, an aggregator index for aggregating the current gradient data packet is calculated by a consistent hash algorithm;
[0076] When the number of the received gradient data packet matches the gradient block number of the aggregator identifier calculated by the hash algorithm, the aggregator is available, and the gradient data packet is distributed to the aggregator to wait for aggregation in the network;
[0077] When the number of the received gradient data packet does not match the gradient block number of the aggregator identifier calculated by the hash algorithm, the aggregator is unavailable.
[0078] In step S5, the local aggregation results of all programmable switches and ToR switches and the unaggregated gradient data packets from the working nodes are received, and global aggregation is performed to obtain the global gradient, and then the ACK packet carrying the global gradient is returned to all switches;
[0079] In step S6, when an ACK packet is received from the parameter server, the identifier field of the aggregator occupied by the gradient fragment carried in the ACK packet is cleared, the memory resources occupied by the aggregator are released, and the ACK packet is broadcast to all working nodes;
[0080] In step S7, the global gradient in the ACK packet is used to update the parameters of the deep neural network model, completing a gradient aggregation communication, and then returning to step S3 for the next gradient aggregation communication until the deep neural network model training is completed.
[0081] In one embodiment of the present invention, the method for calculating the location deployment and gradient routing strategy of a programmable switch includes:
[0082] S11, initializing the deployment location set to be empty and the unselected set to be all switches in the programmable network;
[0083] S12, using a greedy algorithm to traverse the set of unselected switches, select any switch to deploy a programmable switch, and generate a set of candidate locations where several programmable switches can be deployed;
[0084] S13. For each candidate location set, a linear programming model is used to calculate the optimal value of the aggregate throughput of the programmable switch at the current deployment location;
[0085] The expression of the linear programming solution model is:
[0086] P2maxγ
[0087]
[0088] Among them, P2 is the linear programming model; max is the maximum value; γ is the aggregate throughput; S is the deployment location set; s d is the ToR switch connected to the parameter server d; W is the set of working nodes used for the distributed training task; C is the processing capacity limit of the programmable switch; is the sending rate of the aggregation results sent directly by the programmable switch s to the parameter server d; Send local aggregation results to ToR switches for programmable switches d rate; For ToR switches d The rate at which the aggregation results are sent directly to parameter server d; Send local aggregation results to switch s for worker node w d rate; and The traffic load generated on link e by the transmission gradients from the working node to the programmable switch, the working node to the parameter server, the programmable switch to the top-of-rack switch of the parameter server, and the programmable switch to the parameter server, respectively; is the capacity limit on link e.
[0089] S14, selecting a switch corresponding to the maximum value among all the optimal values of aggregate throughput as a programmable switch deployment position, and moving it from the unselected set to the deployment position set;
[0090] S15, determine whether the number of switches in the deployment location set is less than the maximum deployment number of programmable switches; if so, return to step S12, otherwise go to step S16;
[0091] S16. Output deployment location set S m As a programmable switch deployment strategy, the optimal value of aggregate throughput is calculated using and As a gradient routing strategy;
[0092] in, is the aggregate throughput from working node w to programmable switch s; The gradient sending rate at which worker node w sends gradients to parameter server d for global aggregation.
[0093] This scheme uses a calculation method that combines the greedy algorithm and the linear programming solution model to not only determine the optimal deployment location of the programmable switch, but also determine the final gradient aggregation routing scheme, that is, the specific gradient sending rate of each working node to each programmable switch.
[0094] In order to facilitate the understanding of the candidate position set, the following Figure 2 A simplified network topology is given to illustrate the generated set of candidate locations for several deployable programmable switches. Figure 2 The network topology is a three-layer network structure. S1 to S5 in the top two layers are switches, W1 to W5 are working nodes, and PS is the parameter server.
[0095] In order to obtain the best aggregate throughput, it is assumed that the budget of programmable switches is three, that is, the maximum number of deployed programmable switches K is 3, the set of unselected switches at the initial moment is {S1, S2, S3, S4, S5}, and the set of deployment locations is empty.
[0096] Starting from K=1, traverse S1 to S5 in sequence, then the candidate location set includes {S1}, {S2}, {S3}, {S4}, {S5} respectively. For each selected location set, an optimal aggregate throughput value will be obtained. Assuming that the optimal aggregate throughput value on S1 is the largest, the first programmable switch can be deployed on S1. At this time, S1 is moved from the unselected switch set to the deployment location set. The unselected switch set is {S2, S3, S4, S5}, and the deployment location set is {S1}.
[0097] Since the maximum value of K is 3, K=1 is less than 3 at this time. Then start from K=2 and traverse S2 to S5 in sequence. The candidate position sets are {S1, S2}, {S1, S3}, {S1, S4}, {S1, S5} respectively. For each selected position set, an optimal aggregate throughput value will be obtained. Assuming that the optimal aggregate throughput value on {S1, S3} is the largest, the second programmable switch can be deployed on S3. At this time, S3 is moved from the unselected switch set to the deployment position set. At this time, the unselected switch set is {S2, S4, S5}, and the deployment position set includes {S1, S3}.
[0098] Similarly, the deployment location of the third programmable switch can be selected.
[0099] When implemented, this solution prefers traffic load and The expression is:
[0100]
[0101] Where e is a link; ψ is an indicator function of whether link e belongs to a certain link set; P w,d is the set of links on the shortest path from the working node w to the parameter server d; For switch s to the ToR switch s connected to parameter server d d The set of links on the shortest path.
[0102] like Figure 3 As shown, the present solution also provides an aggregate communication optimization system based on a programmable network, which includes:
[0103] The control plane is used to calculate the programmable switch location deployment and gradient routing strategy based on the distributed training tasks and programmable network topology information using a greedy algorithm and a linear programming model, and publish them to all working nodes, switches, and parameter servers;
[0104] The data plane, which includes worker nodes, programmable switches, and parameter servers;
[0105] The working node is used to train the current round of the deep neural network model, cut the gradient parameters into several gradient data packets; identify the gradient data packets according to the programmable switch number, and send them to the designated programmable switch; and use the global gradient in the ACK packet to update the gradient parameters of the deep neural network model, and continue to perform the training when the distributed training is not completed, otherwise complete the aggregate communication optimization;
[0106] A programmable switch is used to receive a gradient data packet and determine whether its number is equal to the programmable switch number identified by the gradient data packet. If so, it performs on-network aggregation when the aggregator is available, and sends it to the ToR switch connected to the parameter server for aggregation when it is not available; otherwise, it forwards the gradient data packet to the next-hop switch; and when receiving an ACK packet from the parameter server, it clears the identifier field of all aggregators, releases the memory resources occupied by the aggregator, and broadcasts the ACK packet to all working nodes;
[0107] The parameter server is used to receive the local aggregation results of all programmable switches and ToR switches and the unaggregated gradient data packets from the working nodes, and perform global aggregation to obtain the global gradient, and then return the ACK packet carrying the global gradient to all switches.
[0108] The effects of the scheme are described in detail below in conjunction with specific embodiments:
[0109] A. Network topology settings
[0110] This solution uses a traditional leaf-spine network topology, consisting of 4 core switches, 9 ToR switches, and each ToR switch has 16 hosts on its rack. The bandwidth between each ToR switch and the host is 100Gbps, and the bandwidth between each ToR switch and the core switch is k1×400Gbps. The present invention sets the value of k1 to 1 to 4 to simulate the different bandwidth capacities between the ToR and core switches. In addition, considering the limitation of the in-network computing power in the entire network, a limited number of m programmable switches are used in the experiment, and the capacity of each programmable switch is set to k2×1.6Tbps, where k2 is set to 1 to 4 to simulate the different in-network aggregation capacities on each switch.
[0111] B. Comparison Method
[0112] This solution uses the in-network aggregation method ATP as a comparison method for SPAR (the method of this solution). ATP is a state-of-the-art INA solution for distributed training in data center networks. ATP schedules gradients to the ToR switch closest to each worker node for aggregation and assumes that all ToR switches are programmable switches. However, due to cost reasons, the assumption of fully deploying programmable switches at the ToR layer may be impractical. In order to make the results comparable, ATP is made consistent with this solution, following the constraint of the limit on the number of deployable programmable switches.
[0113] like Figure 4 As shown in FIG. 1 , the number of deployable programmable switches is gradually increased from 1 to 8 to compare the in-network aggregation performance results of SPAR and ATP under different available in-network computing resource budgets. Figure 4 (a) reflects the trend that the aggregate throughput of working nodes increases with the number of deployable programmable switches, and the aggregate throughput of the SPAR method is significantly higher than that of the ATP method under all the numbers of deployable programmable switches; Figure 4 (b) reflects that as the number of deployable programmable switches increases, the programmable switch resource utilization of the SPAR approach is always higher than that of ATP.
[0114] pass Figure 4 The experimental results presented show that under different restrictions on the number of programmable switches, SPAR's performance in working node aggregate throughput and average switch utilization is always better than ATP, and can achieve up to 3 times and 4 times performance improvement respectively.
[0115] like Figure 5 As shown in the figure, the number of deployable programmable switches is fixed to 3, and the number of working nodes is gradually increased from 48 to 128 to simulate the performance comparison under different workloads. Figure 5 (a) reflects the trend that the aggregate throughput of the working nodes decreases as the workload increases, and the aggregate throughput of the SPAR method is significantly higher than that of ATP under all numbers of working nodes; Figure 5 (b) reflects that as the workload increases, the programmable switch resource utilization of the SPAR approach is always higher than that of ATP.
[0116] pass Figure 5 The experimental results presented show that SPAR outperforms ATP in terms of aggregate throughput and switch utilization even under different workloads. Even when the workload is large, SPAR still maintains about 3 times the throughput of ATP and can achieve up to 80% improvement in average switch utilization.
[0117] In summary, this solution jointly optimizes the deployment location of programmable switches and the gradient request routing of working nodes through a greedy algorithm and a linear programming solution model, which not only improves the utilization efficiency of limited network resources, but also amplifies the advantages of on-line computing in performance improvement, improves the aggregate throughput of working nodes, and significantly shortens the overall completion time of model training.
Claims
1. A method for optimizing aggregated communication based on a programmable network, characterized in that: Includes steps: S1. According to the distributed training tasks and programmable network topology information, the greedy algorithm and linear programming solution model are used to calculate the programmable switch location deployment and gradient routing strategy, and publish them to all working nodes, switches and parameter servers; S2. Deploy programmable switches at corresponding switches in the programmable network according to the programmable switch deployment strategy; S3, train the current round of the deep neural network model, cut the gradient into several gradient data packets; identify a programmable switch number for each gradient data packet according to the gradient routing strategy, and send the data packet to the designated programmable switch; S4, receiving the gradient data packet, and determining whether the stored number is equal to the programmable switch number identified by the gradient data packet, if so, performing in-network aggregation when the aggregator is available, and sending it to the ToR switch connected to the parameter server for aggregation when it is not available; otherwise, forwarding the gradient data packet to the next hop switch; S5: Receive the local aggregation results of all programmable switches and ToR switches and the unaggregated gradient data packets from the working nodes, perform global aggregation to obtain the global gradient, and then return the ACK packet carrying the global gradient to all switches; S6. When receiving the ACK packet from the parameter server, clear the identifier field of the aggregator occupied by the gradient fragment carried in the ACK packet, release the memory resources occupied by the aggregator, and broadcast the ACK packet to all working nodes; S7. Use the global gradient in the ACK packet to update the parameters of the deep neural network model, complete a gradient aggregation communication, and then return to step S3 for the next gradient aggregation communication until the deep neural network model training is completed.
2. The method for optimizing aggregate communication according to claim 1, characterized in that: Methods for calculating programmable switch location deployment and gradient routing strategies include: S11, initializing the deployment location set to be empty and the unselected set to be all switches in the programmable network; S12, using a greedy algorithm to traverse the set of unselected switches, select any switch to deploy a programmable switch, and generate a set of candidate locations where several programmable switches can be deployed; S13. For each candidate location set, a linear programming model is used to calculate the optimal value of the aggregate throughput of the programmable switch at the current deployment location; S14, selecting a switch corresponding to the maximum value among all the optimal values of aggregate throughput as a programmable switch deployment position, and moving it from the unselected set to the deployment position set; S15, determine whether the number of switches in the deployment location set is less than the maximum deployment number of programmable switches; if so, return to step S12, otherwise go to step S16; S16. Output deployment location set S m As a programmable switch deployment strategy, the optimal value of aggregate throughput is calculated using and As a gradient routing strategy; in, is the aggregate throughput from working node w to programmable switch s; The gradient sending rate at which worker node w sends gradients to parameter server d for global aggregation.
3. The method for optimizing aggregated communication according to claim 1 or 2, characterized in that: The expression of the linear programming solution model is: P21maX Among them, P2 is the linear programming model; max is the maximum value; γ is the aggregate throughput; S is the deployment location set; s d is the ToR switch connected to the parameter server d; W is the set of working nodes used for the distributed training task; C is the processing capacity limit of the programmable switch; is the sending rate of the aggregation results sent directly by the programmable switch s to the parameter server d; Send local aggregation results to ToR switches for programmable switches d rate; For ToR switches d The rate at which the aggregation results are sent directly to parameter server d; Send local aggregation results to switch s for worker node w d rate; and The traffic load generated on link e by the transmission gradients from the working node to the programmable switch, the working node to the parameter server, the programmable switch to the ToR switch of the parameter server, and the programmable switch to the parameter server, respectively; is the capacity limit on link e.
4. The method for optimizing aggregate communication according to claim 3, characterized in that: Traffic load and The expression is: Where e is a link; ψ is an indicator function of whether link e belongs to a certain link set; P w,d is the set of links on the shortest path from the working node w to the parameter server d; For switch s to the ToR switch s connected to parameter server d d The set of links on the shortest path.
5. The method for optimizing aggregate communication according to claim 1, characterized in that: The determination methods available to aggregators include: According to the gradient data packet number identified by the received gradient data packet, an aggregator index for aggregating the current gradient data packet is calculated by a consistent hash algorithm; When the number of the received gradient data packet matches the gradient block number of the aggregator identifier calculated by the hash algorithm, the aggregator is available, and the gradient data packet is distributed to the aggregator to wait for aggregation in the network; When the number of the received gradient data packet does not match the gradient block number of the aggregator identifier calculated by the hash algorithm, the aggregator is unavailable.
6. A programmable network-based aggregate communication optimization system, characterized in that: include: The control plane is used to calculate the programmable switch location deployment and gradient routing strategy based on the distributed training tasks and programmable network topology information using a greedy algorithm and a linear programming model, and publish them to all working nodes, switches, and parameter servers; The data plane, which includes worker nodes, programmable switches, and parameter servers; The working node is used to train the current round of the deep neural network model, cut the gradient parameters into several gradient data packets; identify a programmable switch number for each gradient data packet according to the gradient routing strategy, and send the data packet to the specified programmable switch; and use the global gradient in the ACK packet to update the gradient parameters of the deep neural network model, and continue to perform training when the distributed training is not completed, otherwise complete the aggregate communication optimization; A programmable switch is used to receive a gradient data packet and determine whether its number is equal to the programmable switch number identified by the gradient data packet. If so, it performs on-network aggregation when the aggregator is available, and sends it to the ToR switch connected to the parameter server for aggregation when it is not available; otherwise, it forwards the gradient data packet to the next-hop switch; and when receiving an ACK packet from the parameter server, it clears the identifier field of all aggregators, releases the memory resources occupied by the aggregator, and broadcasts the ACK packet to all working nodes; The parameter server is used to receive the local aggregation results of all programmable switches and ToR switches and the unaggregated gradient data packets from the working nodes, and perform global aggregation to obtain the global gradient, and then return the ACK packet carrying the global gradient to all switches.
7. The aggregate communication optimization system according to claim 6, characterized in that: The method of using the greedy algorithm and the linear programming model in the control plane to calculate the programmable switch location deployment and gradient routing strategy includes: S11, initializing the deployment location set to be empty and the unselected set to be all switches in the programmable network; S12, using a greedy algorithm to traverse the set of unselected switches, select any switch to deploy a programmable switch, and generate a set of candidate locations where several programmable switches can be deployed; S13. For each candidate location set, a linear programming model is used to calculate the optimal value of the aggregate throughput of the programmable switch at the current deployment location; S14, selecting a switch corresponding to the maximum value among all the optimal values of aggregate throughput as a programmable switch deployment position, and moving it from the unselected set to the deployment position set; S15, determine whether the number of switches in the deployment location set is less than the maximum deployment number of programmable switches; if so, return to step S12, otherwise go to step S16; S16. Output deployment location set S m As a programmable switch deployment strategy, the optimal value of aggregate throughput is calculated using and As a gradient routing strategy; in, is the aggregate throughput from working node w to programmable switch s; The gradient sending rate at which worker node w sends gradients to parameter server d for global aggregation.
8. The programmable network-based aggregate communication optimization system according to claim 7, characterized in that: The expression of the linear programming solution model is: P211 Among them, P2 is the linear programming model; max is the maximum value; γ is the aggregate throughput; S is the deployment location set; s d is the ToR switch connected to the parameter server d; W is the set of working nodes used for the distributed training task; C is the processing capacity limit of the programmable switch; is the sending rate of the aggregation results sent directly by the programmable switch s to the parameter server d; Send local aggregation results to ToR switches for programmable switches d rate; For ToR switches d The rate at which the aggregation results are sent directly to parameter server d; Send local aggregation results to switch s for worker node w d rate; and The traffic load generated on link e by the transmission gradients from the working node to the programmable switch, the working node to the parameter server, the programmable switch to the ToR switch of the parameter server, and the programmable switch to the parameter server, respectively; is the capacity limit on link e.
Citation Information
Patent Citations
Gradient scheduling method and device based on programmable switch under PS architecture
CN114900482A
A method for in-network aggregation load balancing
WO2024063859A1
Cited By
Model training acceleration method and system based on in-network gradient data annular full reduction
CN121660028A
Model training acceleration method and system based on ring all-reduce of mesh gradient data
CN121660028B
Training stage perception type SHARP in-network set communication operator dynamic arrangement system and method
CN122450690A
