A method and device for distributed model training task offloading based on in-network aggregation
By constructing a network physical topology and logical aggregation model, optimizing the deployment of workers and PS and intra-network aggregation routing, the communication bottleneck problem in distributed model training is solved, achieving more efficient gradient aggregation and resource utilization, and reducing communication overhead.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU INST FOR ADVANCED STUDY USTC
- Filing Date
- 2023-04-03
- Publication Date
- 2026-05-01
AI Technical Summary
Existing distributed model training architectures suffer from communication bottlenecks, especially congestion caused by a large number of workers and a large amount of gradient data, resulting in low gradient aggregation efficiency. Furthermore, existing solutions fail to effectively utilize programmable switch resources and deploy workers and PSs reasonably, increasing communication overhead.
By constructing a network physical topology model and a logical aggregation model, jointly optimizing the assignment of workers and PSs and the aggregation routing within the INA network, selecting the server with the strongest aggregation capability as the master node PS, constructing a degree-constrained minimum Steiner tree, determining the task offloading strategy and gradient sending rate, and using a programmable switch to match and aggregate gradient data.
It significantly accelerates the model training process, reduces communication overhead, improves gradient aggregation efficiency, optimizes the utilization of programmable switch resources, and shortens training time and communication volume.
Smart Images

Figure CN116684308B_ABST
Abstract
Description
A method and apparatus for offloading distributed model training tasks based on intra-network aggregation Technical Field
[0001] This invention relates to the field of in-network computing (INC) technology, and more particularly to a method and apparatus for offloading distributed model training tasks based on in-network aggregation. Background Technology
[0002] With the continuous development of machine learning applications, the scale of machine learning is also growing rapidly. To meet the needs of large-scale machine learning, distributed model training has been widely adopted as a solution. In distributed model training, a mainstream architecture is the parameter server (PS) architecture. The PS architecture mainly consists of worker nodes and parameter servers (PS). In data-parallel scenarios, the scheduler distributes the dataset in chunks to various workers. In one round of training, each worker trains on its assigned dataset locally and sends the training results (i.e., gradient data) to the PS for aggregation. After aggregation, the parameter server returns the results to the worker for the next round of training. This approach can utilize the computing resources of multiple servers, thereby accelerating training. However, in reality, there is a serious communication bottleneck in the current distributed model training architecture. This is because in large-scale distributed model training tasks, the number of workers is large, and the amount of gradient data transmitted by each worker to the PS is also large. This forces the PS to simultaneously receive large amounts of gradient data from multiple workers for aggregation, resulting in congestion and thus reducing the rate of gradient aggregation.
[0003] To address this issue, Intra-Network Aggregation (INA) is a recently proposed and effective solution. The core idea of INA is to leverage pre-deployed programmable switches (FPGAs) within the network to aggregate data along the transmission path. This significantly reduces the amount of data that the PS (Power Switch) needs to aggregate, thereby alleviating congestion and improving the efficiency of gradient aggregation. Related solutions to INA include ATP and PAANAMA. ATP proposes an intra-network aggregation scheme for multi-task scenarios in data centers, enabling best-effort aggregation of gradient data at the rack switches (ToR switches) where workers and PS reside; that is, the switches aggregate gradient data within their capacity and forward the remaining gradients. PAANAMA, by combining switches with FPGAs, greatly improves the aggregation capabilities of programmable switches and delegates all aggregation tasks to the programmable switches. Simultaneously, PAANAMA uses a round-robin approach to avoid congestion for different tasks within the data center network.
[0004] In addition, some solutions address the issue from the perspective of optimizing the offloading of distributed model training tasks. Geryon designed a priority-based traffic scheduling model to reduce congestion for high-priority tasks. DeepSys, based on predictions of computing and memory resources in the data center network, assigns appropriate servers as workers and power servers (PSs) to accelerate training.
[0005] The existing solutions have the following main drawbacks:
[0006] 1. The intranet aggregation scheme only utilizes programmable switch resources to accelerate distributed model training tasks. In reality, in data center networks, the aggregation resources of programmable switches are unevenly distributed and difficult to fully utilize for distributed model training tasks; at the same time, unreasonable worker and PS assignment will increase the number of link hops, thus generating greater communication overhead.
[0007] 2. The essence of the distributed model training task optimization and offloading scheme is to improve the utilization rate of bandwidth resources in the data center network. In reality, it does not reduce the gradient data transmitted in the network for this task, nor does it reduce the load on the PS end. Summary of the Invention
[0008] This invention provides a method and apparatus for offloading distributed model training tasks based on intra-network aggregation. By jointly optimizing the assignment of workers and PS and intra-INA network aggregation routes, it further accelerates model training and reduces the communication overhead generated during training.
[0009] In a first aspect, embodiments of the present invention provide a distributed model training task offloading method based on intra-network aggregation, executed by a controller of a data center network, wherein the data center network includes several servers and programmable switches, and the method includes:
[0010] S1. Construct a network physical topology model for each incoming distributed model training task based on the real-time network topology and network resource information in the data center network.
[0011] S2. Based on the physical topology model, a logical aggregation model is constructed by omitting the forwarding information of gradient data;
[0012] S3. Based on the logical aggregation model and the available aggregation resources in the data center network, determine the task offloading strategy for the distributed model training task.
[0013] Optionally, S3 specifically includes:
[0014] The server with the strongest aggregation capability in the logical aggregation model is selected as the master node PS. The maximum transmission rate of gradient data is calculated based on the available aggregation resources in the logical aggregation model. The logical aggregation model is an aggregation tree with PS as the root node and containing a specified number of worker nodes and a programmable switch.
[0015] Calculate the amount of gradient data that each aggregation node in the logical aggregation model can aggregate at the maximum transmission rate;
[0016] Using the amount of gradient data that each aggregation node can aggregate as a constraint, the logical aggregation model is solved based on a degree-constrained minimum Steiner tree to obtain the task offloading scheduling strategy and gradient sending rate for the distributed model training task.
[0017] Optionally, the method further includes:
[0018] The dataset in the distributed model training task is divided according to the data processing capabilities of each worker node.
[0019] Optionally, the method further includes:
[0020] Based on the task offloading strategy, the received gradient data is matched with the distributed model training task according to the source address through a programmable switch. If the match is successful, the received gradient data is aggregated; otherwise, it is forwarded.
[0021] Secondly, embodiments of the present invention also provide a distributed model training task offloading device based on intra-network aggregation, configured in the controller of a data center network, the data center network including several servers and programmable switches, the method comprising:
[0022] The physical topology model building module is used to build a network physical topology model for each incoming distributed model training task based on real-time network topology and network resource information in the data center network.
[0023] The logical aggregation model construction module is used to construct a logical aggregation model based on the physical topology model by omitting the forwarding information of gradient data;
[0024] The task offloading strategy calculation module is used to determine the task offloading strategy for the distributed model training task based on the logical aggregation model and the available aggregation resources in the data center network.
[0025] Optionally, the task unloading strategy calculation module is specifically used for:
[0026] The server with the strongest aggregation capability in the logical aggregation model is selected as the master node PS. The maximum transmission rate of gradient data is calculated based on the available aggregation resources in the logical aggregation model. The logical aggregation model is an aggregation tree with PS as the root node and containing a specified number of worker nodes and a programmable switch.
[0027] Calculate the amount of gradient data that each aggregation node in the logical aggregation model can aggregate at the maximum transmission rate;
[0028] Using the amount of gradient data that each aggregation node can aggregate as a constraint, the logical aggregation model is solved based on a degree-constrained minimum Steiner tree to obtain the task offloading scheduling strategy and gradient sending rate for the distributed model training task.
[0029] Optionally, it also includes a dataset partitioning module, used to partition the dataset in the distributed model training task according to the data processing capabilities of each worker node.
[0030] Optionally, it also includes: a gradient matching module, used to match the received gradient data with the distributed model training task to which it belongs based on the source address through a programmable switch according to the task offloading strategy. If the match is successful, the received gradient data is aggregated; otherwise, it is forwarded.
[0031] The technical solution of this invention first constructs a network physical topology model for each incoming distributed model training task based on real-time network topology and network resource information in the data center network. Then, based on the physical topology model, a logical aggregation model is constructed by omitting the forwarding information of gradient data. Finally, based on the logical aggregation model and the available aggregation resources in the data center network, a task offloading strategy for the distributed model training task is determined. Compared with existing distributed model training task optimization offloading schemes, this invention jointly optimizes the assignment of workers and PSs and the aggregation routing within the INA network, thereby further accelerating model training and reducing the communication overhead generated during training. Attached Figure Description
[0032] Figure 1 is an overall block diagram of a distributed model training task offloading method based on intra-network aggregation provided by an embodiment of the present invention;
[0033] Figure 2 is a schematic diagram of a physical topology model provided in an embodiment of the present invention;
[0034] Figure 3 is a schematic diagram of a logical topology model provided in an embodiment of the present invention;
[0035] Figure 4a shows the communication volume of each scheme when the scale of the distributed model training task is changed;
[0036] Figure 4b is a graph showing the gradient sending rate of each scheme when the scale of the distributed model training task is changed;
[0037] Figure 4c is a graph showing the total communication time of each scheme when the scale of the distributed model training task is changed;
[0038] Figure 5a is a graph showing the communication volume of each scheme when the intranet aggregated resources are changed;
[0039] Figure 5b is a graph showing the gradient transmission rate of each scheme when the intranet aggregated resources are changed;
[0040] Figure 5c is a graph showing the total communication time of each scheme when the network aggregation resources are changed. Detailed Implementation
[0041] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0042] Example
[0043] This invention provides a distributed model training task offloading method based on intra-network aggregation. The method is executed by the controller of a data center network, which includes several servers and programmable switches.
[0044] Figure 1 is a general block diagram of a distributed model training task offloading method based on intra-network aggregation provided by an embodiment of the present invention. The present invention mainly includes two parts: a control plane and a data plane. The control plane is responsible for constructing a topology model based on the input information, further optimizing and determining the distributed model training task offloading strategy; the data plane is responsible for coordinating intra-network aggregation, including workers, programmable switches, and PS.
[0045] The method specifically includes the following steps:
[0046] S1. Construct a network physical topology model for each incoming distributed model training task based on real-time network topology and network resource information in the data center network.
[0047] The aforementioned network resource information can include server resources and the load status and available resources of programmable switches. For each incoming distributed model training (DT) task, the controller models possible deployment schemes.
[0048] S2. Based on the physical topology model, a logical aggregation model is constructed by omitting the forwarding information of gradient data.
[0049] After obtaining the physical topology model, the physical topology model is optimized by omitting the forwarding information of the gradient data, retaining only the key aggregation path information and worker and PS location information, thereby constructing a logical aggregation model.
[0050] Specifically, describing aggregation schemes using physical topology is a very complex task because, in order to fully utilize aggregation resources in the network, programmable switches need to aggregate a portion of gradient data while forwarding the remaining data. Therefore, this embodiment proposes a logical aggregation model. This logical aggregation model omits the forwarding information of gradient data, retaining only the key aggregation path information and worker and PS location information. For programmable switches, gradient aggregation has a relatively small impact on their forwarding capabilities, and the shortest path can be used by default to send gradient data packets to the next aggregation location. For example, in a topology as shown in Figure 2, a distributed model training task is offloaded, including 1 PS and 8 workers. After calculation, the actual strategy is represented in the physical topology model as shown in Figure 2.
[0051] The corresponding strategy is represented in the logical topology model as shown in Figure 3. In Figure 3, we can easily see that the data aggregated by the programmable switch S2 will be directly aggregated on PS, and the number of edges (degrees) connected to the nodes is directly related to the number of gradient data in the aggregation. This logical topology model greatly simplifies the representation of the aggregation route and facilitates subsequent strategy calculation.
[0052] S3. Based on the logical aggregation model and the available aggregation resources in the data center network, determine the task offloading strategy for the distributed model training task.
[0053] In this embodiment, a logical aggregation model is constructed, with PS as the root and containing a specified number of worker nodes. In this aggregation tree, each node aggregates data sent from its child nodes and sends it to its parent node. Meanwhile, considering the limitations of aggregation capacity, the maximum number of data that each node can aggregate is related to the sending rate.
[0054] Specifically, to maximize training acceleration, this embodiment selects the server with the strongest aggregation capability as the PS and estimates the maximum transmission rate based on available aggregation resources. After obtaining the maximum transmission rate, this embodiment can estimate the constraint on the amount of gradient data that each aggregation point can aggregate at this rate (i.e., the upper limit of the node degree in the aggregation tree).
[0055] To minimize communication overhead during the aggregation process, the aggregation tree sought in this embodiment is actually a degree-constrained minimum Steiner tree rooted at PS. By formalizing the problem, this invention proposes an algorithm based on a degree-constrained minimum Steiner tree to determine the scheduling strategy and gradient sending rate. Through rigorous proof, this algorithm guarantees that: (1) for each worker node, there is one and only one aggregation path to PS. (2) all aggregation nodes will not exceed the aggregation capacity limit. (3) the communication time during the gradient aggregation phase will not be less than 2 / 3 of the optimal solution, and the communication volume will not exceed O(log n) times that of the optimal solution, where n is the number of workers.
[0056] S4. Dataset Partitioning: To ensure that all workers can complete training simultaneously in each round of training, the size of the dataset processed by each worker should be related to its processing capacity.
[0057] S5. Gradient Matching: The programmable switch matches and filters incoming gradients based on their source address and the corresponding distributed model training task according to the task offloading policy. Matching gradients are aggregated, while non-matching gradients are forwarded.
[0058] In this embodiment, the specific gradient matching process is as follows:
[0059] The programmable switch reserves a memory address space for each distributed model training task. The gradients sent by a training task are sent in the form of a series of data packets. Therefore, this memory address space needs to be further subdivided according to the sequence number of the data packets, so that data packets with the same task and the same sequence number from different places (gradient data from different workers or intermediate results of gradient aggregation from different programmable switches) are aggregated together.
[0060] A programmable switch (PLS) has a flow table, where each entry contains a matching field and an action field. The flow table is configured based on the previously obtained task offloading and scheduling policies. When a data packet arrives at the switch, it matches the corresponding entry based on the matching field and then executes the action in the appropriate action field. If neither matches, the default action (usually forwarding) is executed. Specifically, the matching fields match the "data packet source address, distributed model training task number, and data packet sequence number." S6, Gradient Aggregation: The PLS categorizes the data to be aggregated according to the aggregation task ID and allocates corresponding memory for aggregation.
[0061] S7, Global Aggregation: PS collects all gradient data, performs global aggregation, updates parameters based on the results of gradient aggregation, and sends the updated parameters to all workers according to the sending path of the aggregated data.
[0062] The technical solution of this invention first constructs a network physical topology model for each incoming distributed model training task based on real-time network topology and network resource information in the data center network. Then, based on the physical topology model, a logical aggregation model is constructed by omitting the forwarding information of gradient data. Finally, based on the logical aggregation model and the available aggregation resources in the data center network, a task offloading strategy for the distributed model training task is determined. Compared with existing distributed model training task optimization offloading schemes, this invention jointly optimizes the assignment of workers and PSs and the aggregation routing within the INA network, thereby further accelerating model training and reducing the communication overhead generated during training.
[0063] Experimental verification
[0064] This embodiment illustrates the advantages of the technical solution proposed in this invention through some experiments. Existing solutions include DeepSys, ATP, and SOAR. DeepSys is a distributed model training (DT) task offloading scheme in traditional networks, which deploys workers and power switches (PS) on the same rack as much as possible. ATP is a best-effort intra-network aggregation scheme, where programmable switches only aggregate gradient data within their capacity and forward the rest. SOAR is also an intra-network aggregation scheme, which, given a tree-like route, selects appropriate locations to aggregate traffic to minimize communication load. Since neither ATP nor SOAR involves worker and PS deployment, for fairness, this embodiment uses the same deployment scheme as DeepSys.
[0065] Specifically, the performance of each scheme is shown in Figures 4a-c when the scale of the distributed model training task is changed. PARING in Figures 4a-c represents the scheme proposed in this invention. In the experiment, this embodiment increased the number of workers from 2 to 35. Figure 4a shows that PARING has the lowest communication volume per round, and Figure 4b shows that PARING has the highest gradient sending rate and the lowest total communication time per round. The results show that compared with DeepSys, DeepSys+ATP, and DeepSys+SOAR, PARING can reduce the speed of distributed training by 88.6%, 80.7%, and 81%, respectively; and reduce the communication volume by 60.0%, 46.1%, and 19.1%, respectively. This is because PARING jointly optimizes the deployment strategy and intra-network aggregation routing, better balancing the distribution of intra-network aggregation resources while deploying the distributed model training task.
[0066] When the network aggregation resources are changed, the performance of each scheme is shown in Figures 5a-c. In Figure 5, this embodiment increases the number of programmable switches deployed in the network from 2 to 12. PARING consistently outperforms the other three schemes in terms of gradient transmission rate and communication time, and its communication volume is superior to the other schemes, except when the number of programmable switches is large, where it is not significantly different from DeepSys+SOAR. When there are 12 programmable switches, PARING improves the transmission rate by 6.67 times, 2.66 times, and 2.33 times compared to DeepSys, DeepSys+ATP, and DeepSys+SOAR, respectively. This is because PARING can better utilize the more dispersed aggregation resources.
[0067] In summary, through joint optimization of deployment strategies and intranet aggregation routing, the PARING solution provided in this implementation can achieve minimal communication time and low communication overhead.
[0068] Furthermore, this embodiment of the invention also provides a distributed model training task offloading device based on intra-network aggregation, configured in the controller of a data center network, the data center network including several servers and programmable switches, the method comprising:
[0069] The physical topology model building module is used to build a network physical topology model for each incoming distributed model training task based on real-time network topology and network resource information in the data center network.
[0070] The logical aggregation model construction module is used to construct a logical aggregation model based on the physical topology model by omitting the forwarding information of gradient data;
[0071] The task offloading strategy calculation module is used to determine the task offloading strategy for the distributed model training task based on the logical aggregation model and the available aggregation resources in the data center network.
[0072] Optionally, the task unloading strategy calculation module is specifically used for:
[0073] The server with the strongest aggregation capability in the logical aggregation model is selected as the master node PS. The maximum transmission rate of gradient data is calculated based on the available aggregation resources in the logical aggregation model. The logical aggregation model is an aggregation tree with PS as the root node and containing a specified number of worker nodes and a programmable switch.
[0074] Calculate the amount of gradient data that each aggregation node in the logical aggregation model can aggregate at the maximum transmission rate;
[0075] Using the amount of gradient data that each aggregation node can aggregate as a constraint, the logical aggregation model is solved based on a degree-constrained minimum Steiner tree to obtain the task offloading scheduling strategy and gradient sending rate for the distributed model training task.
[0076] Optionally, the device may also include:
[0077] The dataset partitioning module is used to partition the dataset in the distributed model training task according to the data processing capabilities of each worker node.
[0078] Optionally, the device may also include:
[0079] The gradient matching module is used to match the received gradient data with the address of the distributed model training task based on the source address through a programmable switch, according to the task offloading strategy. If the match is successful, the received gradient data is aggregated; otherwise, it is forwarded.
[0080] The distributed model training task offloading device based on intra-network aggregation provided in this embodiment of the invention can execute the distributed model training task offloading method based on intra-network aggregation provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method, which will not be described in detail here.
[0081] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for offloading distributed model training tasks based on intra-network aggregation, characterized in that, Executed by the controller of the data center network, which includes several servers and programmable switches, the process includes: S1, constructing a physical topology model for each incoming distributed model training task based on real-time network topology and network resource information in the data center network; S2, constructing a logical aggregation model based on the physical topology model by omitting the forwarding information of gradient data; S3, determining the task offloading strategy for the distributed model training task based on the logical aggregation model and the available aggregation resources in the data center network; S3 specifically includes: selecting the server with the strongest aggregation capability in the logical aggregation model as the master node PS, calculating the maximum transmission rate of gradient data based on the available aggregation resources in the logical aggregation model; the logical aggregation model is an aggregation tree with PS as the root node and containing a specified number of worker nodes and programmable switches; calculating the amount of gradient data that each aggregation node in the logical aggregation model can aggregate under the maximum transmission rate; using the amount of gradient data that each aggregation node can aggregate as a constraint, solving the logical aggregation model based on a degree-constrained minimum Steiner tree to obtain the task offloading scheduling strategy and gradient transmission rate for the distributed model training task.
2. The method according to claim 1, characterized in that, Also includes: The dataset in the distributed model training task is divided according to the data processing capabilities of each worker node.
3. The method according to claim 1, characterized in that, Also includes: Based on the task offloading strategy, the received gradient data is matched with the distributed model training task according to the source address through a programmable switch. If the match is successful, the received gradient data is aggregated; otherwise, it is forwarded.
4. A distributed model training task offloading device based on intra-network aggregation, characterized in that, The controller configured in the data center network includes several servers and programmable switches. The device includes: a physical topology model construction module, used to construct a network physical topology model for each incoming distributed model training task based on real-time network topology and network resource information in the data center network; a logical aggregation model construction module, used to construct a logical aggregation model based on the physical topology model by omitting gradient data forwarding information; and a task offloading strategy calculation module, used to determine the task offloading strategy for the distributed model training task based on the logical aggregation model and available aggregation resources in the data center network. Specifically, the task offloading strategy calculation module is used to: select the server with the strongest aggregation capability in the logical aggregation model as the master node PS; calculate the maximum gradient data transmission rate based on the available aggregation resources in the logical aggregation model; the logical aggregation model is an aggregation tree with PS as the root node and containing a specified number of worker nodes and programmable switches; calculate the amount of gradient data that each aggregation node in the logical aggregation model can aggregate under the maximum transmission rate; and use the amount of gradient data that each aggregation node can aggregate as a constraint to solve the logical aggregation model based on a degree-constrained minimum Steiner tree to obtain the task offloading strategy scheduling policy and gradient transmission rate for the distributed model training task.
5. The apparatus according to claim 4, characterized in that, Also includes: The dataset partitioning module is used to partition the dataset in the distributed model training task according to the data processing capabilities of each worker node.
6. The apparatus according to claim 4, characterized in that, Also includes: The gradient matching module is used to match the received gradient data with the corresponding distributed model training task based on the source address through a programmable switch, according to the task offloading strategy. If the match is successful, the received gradient data is aggregated; otherwise, it is forwarded.