A routing arrangement method for in-network aggregation
Patent Information
- Application Number
- CN202311103072.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-08-30
AI Technical Summary
现有的在网聚合方案及其路由的管控设计都没有考虑这一限制,因此存在实用性有限、性能不佳的问题
[0065]本发明考虑到可编程交换机中各pipeline不共享状态的特点,建模准确描述这一约束,并针对可编程交换机和普通交换机混合的场景设计路由方案,最大限度发挥设备的在网聚合能力,提升分布式应用的性能。还可以为其他能受益于在网聚合机制的分布式系统提供性能优化的路由编排方法,比如利用在网聚合进行数据恢复的分布式存储系统。
Smart Images

Figure CN117081982B_ABST
Abstract
Description
Technical Field
[0001] This invention pertains to optimization and control technology for routing in network aggregation, and particularly relates to a routing orchestration method for network aggregation. Background Technology
[0002] In recent years, machine learning has developed rapidly. With the increasing size of datasets and models, researchers have begun to build distributed machine learning systems to accelerate training. A widely used distributed machine learning communication framework is the Parameter Server (PS) architecture. This architecture mainly includes two roles: parameter server nodes and training nodes (workers). Taking the popular data-parallel distributed training as an example: multiple workers use different datasets to calculate the model's gradients locally and then send them to the PS; the PS aggregates these gradients and distributes them to all workers; finally, the workers receive the aggregated gradients and update their models to continue training computation. Because PS-based aggregation is a many-to-one communication method, the biggest communication bottleneck in the entire system lies in the PS's ingress bandwidth. In-Network Aggregation (INA) is a method to alleviate this problem. By transferring some or even all of the aggregation work from the PS to switches or other network devices, INA can reduce the amount of data transmitted in the network, alleviating the bottleneck faced by the PS node. In practice, workers can exchange not only aggregated gradients but also aggregated and updated model parameters. INA can also accelerate communication in this regard.
[0003] Clearly, the prerequisite for in-network aggregation is that related data must simultaneously pass through devices with in-network aggregation capabilities during transmission in order to be aggregated. Therefore, routing orchestration and scheduling are key to unlocking the in-network aggregation capabilities of the network. For complex network devices such as routers and switches, the device's data forwarding plane (also known as the "data plane" or "forwarding plane") is usually divided into multiple pipelines, each responsible for processing data on a portion of the ports. Different pipelines do not share internal storage space, preventing direct sharing of state information between pipelines. For example, the data plane of a programmable switch based on the Tofino chip contains four pipelines. In the packet processing flow, each port contains an Ingress Pipeline related to ingress port processing logic and an Egress Pipeline related to egress port processing logic. A packet, after being processed by the Ingress Pipeline at the ingress port, eventually reaches the Egress Pipeline at the egress port for further processing, and is ultimately forwarded to subsequent devices, discarded, or subjected to other operations. In implementation, for performance and design convenience considerations, many current in-network aggregation solutions are specifically designed to run the aggregation logic within the Ingress Pipeline. This means that even if related flows pass through the same device, aggregation will not occur as long as they do not share the same Ingress Pipeline. Existing on-network aggregation schemes and their routing management designs do not take this limitation into account, thus resulting in limited practicality and poor performance. Summary of the Invention
[0004] To address the aforementioned pipeline-related constraints, a routing method is designed to maximize network bandwidth utilization and network aggregation capabilities, thereby achieving the highest overall throughput. This invention provides a routing orchestration method for network aggregation.
[0005] The present invention provides a routing orchestration method for network aggregation, comprising the following steps:
[0006] Step 1: Obtain network topology information, including the connections between each switch, worker, and parameter server (PS) node, bandwidth limits, the number of pipelines per programmable switch, and their correspondence with ports.
[0007] The network is constructed using a folded Clos topology (e.g., Leaf-Spine), with some switches being programmable switches. Each programmable switch contains P pipelines, each responsible for different ports, and has data aggregation and forwarding functions. Each worker and PS accesses the network through a switch. The aggregation framework is based on a parameter server; each aggregation task includes one PS and multiple workers. Workers send the data to be aggregated to the PS of that task. There are a total of K aggregation tasks in the system, where the PS corresponding to the k-th task is numbered D[k], and the set of workers is N[k]. w The worker of the k-th task sends the data to be aggregated to PSD[k] at a rate r[k].
[0008] Step 2: Expand the network composed of switch nodes into a non-foldable form, so that each link is unidirectional; calculate all shortest paths from the worker to the corresponding PS for each aggregation task, extract these paths and the switches they pass through, and add the corresponding worker nodes and PS nodes to form a new directed graph network topology; abstract the programmable switch in this topology, and then transform the link state into 9 link parameters as model input.
[0009] Based on the internal pipeline structure, each programmable switch is expanded into P input pipelines (INP) and one output pipeline (OP). The P INPs and OPs are directly connected, with the link bandwidth equal to the switching capacity of the device. Therefore, there are three types of forwarding nodes in the network: INPs, OPs, and ordinary switches (CS). The relationships between these three nodes are: 1) INPs can receive data from other CSs, OPs, and workers, attempt to aggregate it, and send it to the OP of the same programmable switch; 2) OPs can only receive data from INPs within the same programmable switch and forward it to the next-hop INP, CS, or PS; 3) CSs can receive data from workers, other CSs, and OPs, and forward it to the next-hop INP, PS, or other CS.
[0010] Number all workers, PS, CS, INP, and OP, and use set N for each. W N PS N CS N INP N OP Record its number.
[0011] use This represents the available bandwidth of the directed link between node u and node v in the network topology, and uses the connection relationship between nodes in the network topology as... The binary constant representation includes a total of 9 link parameters based on the different allowed values of u and v:
[0012] This indicates whether a link exists between worker i and CS j.
[0013] This indicates whether a link exists between worker i and INP j.
[0014] This indicates whether a link exists between CS i and CS j.
[0015] This indicates whether a link exists between CS i and PS j.
[0016] This indicates whether a link exists between CS i and INP j.
[0017] This indicates whether a link exists between INP i and OP j.
[0018] This indicates whether a link exists between OP i and PS j.
[0019] This indicates whether a link exists between OP i and CS j.
[0020] This indicates whether a link exists between OP i and INP j.
[0021] use This represents the set of aggregation task numbers that use the links between nodes u and v to form their shortest paths.
[0022] Using K inp,i This represents the set of all aggregate task numbers that use INP i to form their shortest path.
[0023] Using K op,i This represents the set of all aggregate task numbers that use OP i to form their shortest path.
[0024] Using K cs,i This represents the set of all aggregate task numbers that use CS i to form their shortest path.
[0025] Step 3: Build the model and solve it.
[0026] Let the variable r[k] represent the sending rate of the worker corresponding to task k. If all aggregated tasks belong to the same training job using a data parallel strategy, the goal of the model is to maximize the sum of the sending rates r[k] of all aggregated task workers, i.e., the objective function is: Maximize∑ k=1,…,K r[k]. The model includes the following constraints:
[0027] (1) Variables and basic constraints
[0028] For each INP i and the aggregation task k∈K that may use that INP inp,i Define a binary variable x[k]. inp,i This indicates whether there is traffic for task k on this INP:
[0029] x[k] inp,i ∈{0,1},(i,k)∈{(i,k):i∈N INP ∧k∈K inp,i}
[0030] for For links with a value of 1, define a non-negative integer variable. Indicates the tasks available on the corresponding link. The ratio of the flow rate to r[k], where N represents a non-negative integer:
[0031]
[0032] (2) Worker Data Sending Constraints
[0033] For each aggregation task, worker i will definitely send the data to the corresponding access switch v, which may be CS or INP.
[0034]
[0035] (3) INP aggregation constraint
[0036] For aggregation task k that may use INP i, since INP can aggregate data, the sending rate of INP i is either 1 unit r[k] or 0, depending on whether other workers, OPs, or CS nodes are sending data for task k to this INP and sending it to the corresponding OP at this rate:
[0037]
[0038]
[0039]
[0040] Where M is a very large constant.
[0041] (4) OP forwarding constraints
[0042] For aggregation task k, the total rate received by OP i is equal to the total rate sent:
[0043]
[0044] (5) CS forwarding constraints
[0045] For aggregation task k, the total rate received by CS i is equal to the total rate sent:
[0046]
[0047] (6) Link bandwidth constraints
[0048] The sum of the bandwidth of all tasks passing through each link does not exceed the capacity of that link, which satisfies the condition that... Rate limiting;
[0049]
[0050] Step 4: Generate routes based on the solution results of the model.
[0051] For the aggregation task k, we will solve for the result. Using bandwidth resources to generate routes means finding a path to PSD[k] for each worker. Since the available paths are all the shortest paths from the worker to the PS, and the original network topology is a Clos topology, there will be no loops. For each worker, starting from that node, by continuously searching for the next-hop forwarding node, it will eventually reach the PS.
[0052] For each INP i and the aggregation task k that may use that INP, use R[k]. inp,i Record the determined transmission path from INP to D[k], initialized to an invalid value, indicating that it has not yet been determined.
[0053] For worker i of each aggregation task k, the route is determined starting from i, and the specific process is as follows:
[0054] S1. Assume the current node is g. If g is INP and R[k]... inp,i If a defined path information has already been saved, the path is reused directly, and S5 is executed; if g is a PSD[k] node, S5 is also executed; if g is a worker, CS, or OP, S2 is executed.
[0055] S2. Traverse all allowed next-hop nodes and find one such node. The node h is used as the next hop route. If more than one h satisfies the condition, one is randomly selected and S3 is executed.
[0056] S3. If h is not an OP node, Decrease by one, which means consuming one unit of bandwidth resource to execute S4.
[0057] S4. Update the current node to h and execute S1.
[0058] S5. Once the route from worker i of aggregation task k to its D[k] node is determined, the path from INP i through that path to the current PSD[k] node is recorded in R[k]. inp,i middle.
[0059] After obtaining the results, the parameters to be handled by each aggregation task are proportionally allocated according to the r[k] value of each aggregation task, and the data is transmitted according to the planned route.
[0060] Furthermore, regarding routing selection in the case of multiple training jobs, there are a total of S training jobs, where job s contains multiple aggregate tasks, and the set of task numbers is T. s The goal of the mathematical model is to maximize the minimum value among the sums of r[k] of all tasks, i.e. After obtaining the results, for each task s, T s The r[k] values of each aggregation task are proportionally allocated to the proportion of parameters that the aggregation task is responsible for.
[0061] Furthermore, a two-stage solution method is adopted to accelerate the model solution. In the first stage, all CSs in the intermediate switch are ignored, and only the programmable intermediate switch (PMS) is retained for model solution. In the second stage, the model solution results from the first stage are taken, and variables related to the PMS are recorded. and Take the parameters that are greater than 0, and in the second stage, require that these parameters must be greater than 0 as an additional constraint. Then, incorporate all CS into the model for solution.
[0062] Furthermore, a method to reduce the selection range is adopted to accelerate the solution of the model, by limiting the number of PMS that can be selected for each task to LIMIT. PMS A ratio value PERCENT is provided, and the total number of PMS is N. PMS So, LIMIT PMS =N PMS*PERCENT; The selection of PMS adopts a variance-based selection method: each INP under PMS is scored, and the score is the number of flows that may pass through that INP. When the scores of INPs under the programmable switch differ greatly, the ingress bandwidth pressure of INPs with higher scores will be too high. Therefore, the scores of INPs under the same switch should preferably differ less, expressed by variance. PMS with smaller variance will be selected first.
[0063] In a multi-tasking scenario, to reduce the overlap of PMS used by different tasks, a roundrobin approach is used to assign switches to each task. Each time a selection is made, the candidate PMS with the smallest variance that has not been selected by that task is selected from the candidate PMS list and removed from the candidate list. The same operation is then performed for the next task. If all candidate PMSs have been selected but the allocation process is not yet complete, the candidate PMS list is restored and the selection continues.
[0064] The beneficial technical effects of this invention are as follows:
[0065] This invention takes into account the characteristic that pipelines in a programmable switch do not share states, accurately models and describes this constraint, and designs routing schemes for scenarios where programmable switches and ordinary switches are mixed, maximizing the on-network aggregation capabilities of the devices and improving the performance of distributed applications. It can also provide performance-optimized routing and orchestration methods for other distributed systems that can benefit from on-network aggregation mechanisms, such as distributed storage systems that utilize on-network aggregation for data recovery. Attached Figure Description
[0066] Figure 1 This is an overall flowchart of the routing orchestration method for network aggregation according to the present invention.
[0067] Figure 2 The Leaf-Spine architecture was selected as an example for implementing this invention.
[0068] Figure 3 This diagram illustrates how a programmable switch can be abstracted into two INPs and one OP.
[0069] Figure 4 A diagram illustrating the scoring of different programmable Spine switches. Detailed Implementation
[0070] The invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods, taking the Leaf-Spine architecture as an example.
[0071] The flowchart of a routing orchestration method for network aggregation according to the present invention is as follows: Figure 1 As shown, the specific steps include:
[0072] Step 1: Obtain network topology information, including the connections between each switch, worker, and parameter server (PS) node, bandwidth limits, the number of pipelines per programmable switch, and their correspondence with ports;
[0073] Leaf-Spine architecture, such as Figure 2 As shown, it includes 3 Leaf switches (L0, L1, L2) and 3 Spine switches (S0, S1, S2). Each Leaf switch is connected to several workers, and one Leaf switch is connected to a PS.
[0074] Based on their relative position in the network topology, switches are divided into two categories: Leaf switches and Spine switches. From the perspective of whether the data plane is programmable, switches are further divided into programmable switches and ordinary switches (CS). In this invention, a programmable data plane switch can be abstracted into several INPs and OPs. A programmable Spine switch PSS (i.e., a type of PMS) is a description of its location and function.
[0075] The network consists of programmable switches (PLS), each containing P pipelines, each responsible for a different port. The PLS aggregates gradient data sent by multiple workers, and the gradient may undergo multiple aggregations to reach PS from a worker. Intuitively, we should aim for as many aggregations as possible, but simple routing may not achieve optimal results. Our goal is to find an optimal route that maximizes overall transmission efficiency.
[0076] The aggregation framework is a parameter-server based framework, where each task contains one Service Provider (PS) and multiple workers. Figure 2 This is shown as a single aggregation task. The entire system contains a total of K aggregation tasks, where the PS number corresponding to the k-th task is D[k], and the set of workers is N[k]. w .
[0077] Step 2: Calculate the model input: Expand the network composed of switch nodes into a non-foldable form, so that each link is unidirectional; calculate all shortest paths from the worker to the corresponding PS for each aggregation task, extract these paths and the switches they pass through, and add the corresponding worker nodes and PS nodes to form a new directed graph network topology; in this topology, the programmable switch is abstracted, and then the link state is transformed into 9 link parameters as model input.
[0078] Workers send gradients to the PS, and some gradients will be aggregated during transmission (they may be aggregated multiple times). To shorten the transmission path and reduce the selection range, a new topology will be extracted from the original network topology. The new topology only contains the shortest path from the worker to the PS (there may be more than one). These paths are directed to avoid routing loops.
[0079] Since gradients may be aggregated multiple times, all workers' sending rates are set to the same value r[k]. If workers use different sending rates, aggregation will fail, especially when the PS is directly connected to a programmable switch. Fast flows need to wait for slow flows, leading to excessively high switch memory usage, which further exacerbates the already limited internal memory of the switch.
[0080] Within a programmable switch, because different pipelines are independent of each other, we abstract the pipelines as individual nodes. Each programmable switch is expanded to have P input pipelines (INP) and one output pipeline (OP), such as... Figure 3 As shown, the programmable switch is abstracted into two INPs and one OP. Therefore, there are three types of forwarding nodes in the network: INP (Input Pipeline), OP (Output Pipeline), and CS (Common Switch). The relationship between the three nodes is as follows: 1) INP can receive data from other CSs, OPs, and workers, and attempt to aggregate and send it to the OP of the same programmable switch; 2) OP can only receive data from INPs of the same programmable switch and send it to the next-hop INP, CS, or PS; 3) CS can receive data from workers and other CSs and OPs and forward it to the next-hop INP, PS, or other CS.
[0081] use This represents the available bandwidth of the directed link between node u and node v in the network topology, and uses the connection relationship between nodes in the network topology as... The binary constant representation includes a total of 9 link parameters based on the different allowed values of u and v:
[0082] Convert the topology into 9 types of link parameters:
[0083] This indicates whether a link exists between worker i and CS j.
[0084] This indicates whether a link exists between worker i and INP j.
[0085] This indicates whether a link exists between CS i and CS j.
[0086] This indicates whether a link exists between CS i and PS j.
[0087] This indicates whether a link exists between CS i and INP j.
[0088] This indicates whether a link exists between INP i and OP j.
[0089] This indicates whether a link exists between OP i and PS j.
[0090] This indicates whether a link exists between OP i and CS j.
[0091] This indicates whether a link exists between OP i and INP j.
[0092] Other model constants are detailed in Table 1.
[0093] Table 1 Model constants
[0094]
[0095]
[0096] Step 3: Build the model and solve it.
[0097] Let the variable r[k] represent the sending rate of the worker corresponding to task k. If all aggregated tasks belong to the same training job using a data parallel strategy, the goal of the model is to maximize the sum of the sending rates r[k] of all aggregated task workers, i.e., the objective function is: Maximize∑ k=1,…,K r[k]. The model includes the following constraints:
[0098] (1) Variables and basic constraints
[0099] For each INP i and the aggregation task k∈K that may use that INP inp,i Define a binary variable x[k]. inp,i This indicates whether there is traffic for task k on this INP:
[0100] x[k] inp,i ∈{0,1},(i,k)∈{(i,k):i∈N INP ∧k∈K inp,i}
[0101] In this invention, for task k, the data transmission rate on all links is 0 or a multiple of r[k], so for For links with a value of 1, define a non-negative integer variable. Indicates the tasks available on the corresponding link. The ratio of the flow rate to r[k], where N represents a non-negative integer:
[0102]
[0103] Meanwhile, considering that bandwidth is not allocated in fine granularity in the network, we also set r[k] to an integer.
[0104] (2) Worker Data Sending Constraints
[0105] Each worker i in an aggregation task will send data to the corresponding access switch v, which may be CS or INP.
[0106]
[0107] (3) INP aggregation constraint
[0108] For aggregation task k that may use INP i, since INP can aggregate data, the sending rate of INP i is either 1 unit r[k] or 0, depending on whether other workers, OPs, or CS nodes are sending data for task k to this INP and sending it to the corresponding OP at this rate:
[0109]
[0110]
[0111]
[0112] Where M is a large constant, and it is recommended to take the value of the total number of workers. When other nodes send data to this INP, x[k]... inp,i The value is 1, guaranteed by the first constraint; when no other node sends data to this INP, x[k] is 1. inp,i The value is 0, which is guaranteed by the second constraint.
[0113] (4) OP forwarding constraints
[0114] For aggregation task k, the total rate received by OP i is equal to the total rate sent:
[0115]
[0116] In this case, the OP will only receive data from INPs within the same switch and will forward it to other INPs, CSs, and PSs.
[0117] (5) CS forwarding constraints
[0118] For aggregation task k, the total rate received by CS i is equal to the total rate sent:
[0119]
[0120] The CS receives data from the worker, OP and other CSs and sends it to the INP, other CSs and PS.
[0121] (6) Link bandwidth constraints
[0122] The sum of the bandwidth of all tasks passing through each link does not exceed the capacity of that link, which satisfies the condition that... Rate limiting;
[0123]
[0124] Step 4: Generate routes based on the solution results of the model.
[0125] For the aggregation task k, we use the solution results Using bandwidth resources to generate routes means finding a path to PSD[k] for each worker. Since the available paths are all the shortest paths from the worker to the PS, and the original network topology is a Clos topology, there will be no loops. For each worker in each aggregation task, starting from that worker, we continuously search for the next-hop forwarding node, which will eventually reach the PS.
[0126] Since INP aggregates multiple flows into one, only one path needs to be found among the flows participating in the aggregation; the subsequent paths of the other flows remain consistent with this single path. For each INP i and the aggregation task k that may use this INP, use R[k]. inp,i Record the determined transmission path from INP to PSD[k], initialized to an invalid value, indicating that it has not yet been determined. Therefore, only the path needs to be found for the first flow passing through INP i, and subsequent flows passing through the same INP can directly reuse this information.
[0127] For each worker, start the pathfinding from that worker. Assuming the current node is g, traverse... Find node h such that That is, choose h as the next hop. If g is a worker, CS, or OP, let Decrementing by one indicates consuming one unit of bandwidth resource and modifying the current node to h. If g is INP and R[k]... inp,i If a route exists in the INP, it is reused directly; otherwise, it is treated as the first flow passing through the INP and routing continues. Subsequent routes starting from this INP are recorded in R[k]. inp,i .
[0128] After obtaining the results, the parameters to be handled by each aggregation task are proportionally allocated according to the r[k] value of each aggregation task, and the data is transmitted according to the planned route.
[0129] For multiple training assignments:
[0130] The system may contain multiple training jobs, denoted as S, where job s contains multiple aggregate tasks, and the set of task IDs is T. s The goal of the mathematical model is to maximize the minimum value among the sums of r[k] for each task, in order to ensure a certain degree of fairness. After obtaining the results, for each task s, T s The r[k] values of each aggregation task are proportionally allocated to the proportion of parameters that the aggregation task is responsible for.
[0131] For accelerating the solution:
[0132] Our model is a pure integer programming model, which is slow to solve when encountering large-scale networks. Therefore, we designed two methods to accelerate the solution, sacrificing some performance for efficiency.
[0133] (1) Two-stage solution
[0134] After testing, we found that most workers in the optimal route choose programmable switches, so we can first determine which programmable switches to use. Since the access switches for workers are predetermined, such as the Leaf switches in a Leaf-Spine architecture, we will only make selections for intermediate switches, such as Spine switches. In the first stage, we ignore all client switches (CS) in the intermediate switches and only retain the programmable intermediate switch PMS for model solving; in the second stage, we take the model solution results from the first stage and record the variables related to PMS: and Take the parameters that are greater than 0, and in the second stage, require that these parameters must be greater than 0 as an additional constraint. Then, incorporate all CS into the model for solution.
[0135] (2) Reduce the range of choices
[0136] Experiments have shown that the more PMSs a task has, the slower the solution becomes. Therefore, we can limit the number of PMSs that can be selected for each task to a maximum of LIMIT. PMS A ratio value PERCENT is provided, and the total number of PMS is N. PMS So, LIMIT PMS =N PMS *PERCENT; The PMS selection employs a variance-based method: each INP under the PMS is scored, with the score representing the number of flows that can potentially pass through that INP. When the scores of INPs within a programmable switch differ significantly, the ingress bandwidth pressure on INPs with higher scores becomes excessive. Therefore, it is best if the scores of INPs within the same switch are relatively similar, expressed as variance. PMSs with lower variances are preferentially selected. Figure 4 For example, we need to score INP2, INP3, INP4, and INP5. For INP2, OP0 and CS1 might transmit data to it, and its score is the number of streams sent by OP0 and CS1. Since data is aggregated, the number of streams sent by OP0 is 2, not 3, so INP2's score is 2 + 3 = 5. Similarly, the scores for INP3, INP4, and INP5 are 1, 2, and 4, respectively. We calculate the variance of the INP scores under two PSSs (i.e., PMSs). The variance of the scores for INP2 and INP3 in PSS0 is 8, and the variance of the scores for INP4 and INP5 in PSS1 is 2. If this task can only select one PSS, we will choose PSS0.
[0137] In a multi-tasking scenario, to reduce the overlap of PMS used by different tasks, a roundrobin approach is used to assign switches to each task. Each time a selection is made, the candidate PMS with the smallest variance that has not been selected by that task is selected from the candidate PMS list and removed from the candidate list. The same operation is then performed for the next task. If all candidate PMSs have been selected but the allocation process is not yet complete, the candidate PMS list is restored and the selection continues.
[0138] These two accelerated solution methods require minimal changes to the model; the main modifications are to the input data, specifically the constants. Method 1 involves fixing part of the result from the first solution in the second solution. The first solution does not change the model, while the second solution requires adding constraints, i.e., fixing some parameters to a fixed value. Method 2, on the other hand, only requires changing the input data.
Claims
1. A routing orchestration method for network aggregation, characterized in that, Includes the following steps: Step 1: Obtain network topology information, including the connections between each switch, worker, and parameter server (PS) node, bandwidth limits, the number of pipelines per programmable switch, and their correspondence with ports; The network is constructed using a folded Clos topology, with some switches being programmable switches. Each programmable switch contains P pipelines, each responsible for different ports, and has data aggregation and forwarding functions. Each worker and PS accesses the network through a switch. The aggregation framework is based on a parameter server; each aggregation task includes one PS and multiple workers. Workers send the data to be aggregated to the PS of that task. There are a total of K aggregation tasks in the system, where the PS corresponding to the k-th task is numbered D[k], and the set of workers is N[k]. w The worker of the k-th task sends the data to be aggregated to PSD[k] at a rate r[k]. Step 2: Unfold the network composed of switch nodes into a non-foldable form, making each link unidirectional; calculate all shortest paths from the worker to the corresponding PS for each aggregation task, extract these paths and the switches they pass through, and add the corresponding worker nodes and PS nodes to form a new directed graph network topology; abstract the programmable switches in this topology, and then transform the link states into 9 link parameters as model inputs; based on the internal pipeline structure, expand each programmable switch into P input pipelines INP and one output pipeline OP, with P INPs and OP directly connected, and the link bandwidth being the switching capacity of the device; therefore, there are three types of forwarding nodes in the network: INP, OP, and ordinary switch CS; the relationship between the three nodes is: 1) INP can receive data from other CS, OP, and workers, attempt to aggregate and send it to the OP of the same programmable switch; 2) OP can only receive data from INP of the same programmable switch and send it to the next hop INP, CS, or PS; 3) CS can receive data from workers and other CS and OP, and forward it to the next hop INP, PS, or other CS. Number all workers, PS, CS, INP, and OP, and use set N for each. W N PS N CS N INP N OP Record its number; use This represents the available bandwidth of the directed link between node u and node v in the network topology, and uses the connection relationship between nodes in the network topology as... The binary constant representation includes a total of 9 link parameters based on the different allowed values of u and v: Indicates whether a link exists between worker i and CS j; Indicates whether a link exists between worker i and INP j; Indicates whether a link exists from CS i to CS j; Indicates whether a link exists from CS i to PS j; Indicates whether a link exists from CS i to INP j; Indicates whether a link exists between INP i and OP j; Indicates whether a link exists between OP i and PS j; Indicates whether a link exists from OP i to CS j; Indicates whether a link exists between OP i and INP j; use This represents the set of aggregation task numbers that use the links between nodes u and v to form their shortest paths; Using K inp,i This represents the set of all aggregate task numbers that use INP i to form their shortest path; Using K op,i This represents the set of all aggregate task numbers that use OP i to form their shortest path; Using K cs,i This represents the set of all aggregated task numbers that use CSi to form their shortest paths; Step 3: Build the model and solve it; Let the variable r[k] represent the sending rate of the worker corresponding to task k. If all aggregated tasks belong to the same training job using a data parallel strategy, the goal of the model is to maximize the sum of the sending rates r[k] of all aggregated task workers, i.e., the objective function is: Maximize∑ k=1,...,K r[k]; The model includes the following constraints: (1) Variables and basic constraints For each INP i and the aggregation task k∈K that may use that INP inp,i Define a binary variable x[k]. inp,i This indicates whether there is traffic for task k on this INP: x[k] inp,i ∈{0,1},(i,k)∈{(i,k):i∈N INP ∧k∈K inp,i } for For links with a value of 1, define a non-negative integer variable. Indicates the tasks available on the corresponding link. The ratio of the flow rate to r[k], where N represents a non-negative integer: (2) Worker Data Sending Constraints For each aggregation task, worker i will definitely send the data to the corresponding access switch v, which may be CS or INP. (3) INP aggregation constraint For aggregation task k that may use INP i, since INP can aggregate data, the sending rate of INP i is either 1 unit r[k] or 0, depending on whether other workers, OPs, or CS nodes are sending data for task k to this INP and sending it to the corresponding OP at this rate: Where M is a constant with a very large value; (4) OP forwarding constraints For an aggregation task k that passes through one OP i, the total rate received by the node is equal to the total rate sent: (5) CS forwarding constraints For an aggregation task k passing through a CSi, the total rate received by a node is equal to the total rate sent: (6) Link bandwidth constraints The sum of the bandwidth of all tasks passing through each link does not exceed the capacity of that link, which satisfies the condition that... Rate limiting; Step 4: Generate routes based on the model's solution results; For the aggregation task k, we will solve for the result. Using bandwidth resources to generate routes means finding a path to PSD[k] for each worker; since the available paths are all the shortest paths from the worker to PS, and the original network topology is a Clos topology, there will be no loops; for each worker of each aggregation task, starting from that node, by continuously searching for the next hop forwarding node, it will eventually reach PS. For each INP i and the aggregation task k that may use that INP, use R[k]. inp,i Record the determined transmission path from INP to D[k], initialized to an invalid value, indicating that it has not yet been determined; For worker i of each aggregation task k, the route is determined starting from i, and the specific process is as follows: S1. Assume the current node is g. If g is INP and R[k]... inp,i If a defined path is already saved, the path is reused directly, and S5 is executed; if g is a PSD[k] node, S5 is also executed; if g is a worker, CS, or OP, S2 is executed. S2. Iterate through all allowed next-hop nodes and find one such node. The node h is used as the next hop route. If more than one h satisfies the condition, one is randomly selected, and then S3 is executed. S3. If h is not an OP node, Decrease by one, which means consuming one unit of bandwidth resource and executing S4. S4. Update the current node to h, and execute S1; S5. Once the route from worker i of aggregation task k to its PSD[k] node is determined, the path from INP i to this PSD[k] node along this path is recorded in R[k]. inp,i middle; After obtaining the results, the parameters to be handled by each aggregation task are proportionally allocated according to the r[k] value of each aggregation task, and the data is transmitted according to the planned route.
2. The routing orchestration method for network aggregation according to claim 1, characterized in that, For routing selection in the case of multiple training jobs, there are a total of S training jobs, where job s contains multiple aggregate tasks, and the set of task numbers is T. s The goal of the mathematical model is to maximize the minimum value among the sums of r[k] of all tasks, i.e. After obtaining the results, for each task s, T s The r[k] values of each aggregation task are proportionally allocated to the proportion of parameters that the aggregation task is responsible for.
3. The routing orchestration method for network aggregation according to claim 1, characterized in that, A two-stage solution method is used to accelerate the model solution. In the first stage, all CSs in the intermediate switch are ignored, and only the programmable intermediate switch (PMS) is retained for model solution. In the second stage, the model solution results from the first stage are taken, and variables related to the PMS are recorded. and Take the parameters that are greater than 0, and in the second stage, require that these parameters must be greater than 0 as an additional constraint. Then, incorporate all CS into the model for solution.
4. The routing orchestration method for network aggregation according to claim 1, characterized in that, To accelerate the model solution, a method of reducing the selection range is adopted, by limiting the number of PMS that can be selected for each task to LIMIT. PMS A ratio value PERCENT is provided, and the total number of PMS is N. PMS So, LIMIT PMS =N PMS *PERCENT; The selection of PMS adopts a variance-based selection method: each INP under PMS is scored, and the score is the number of flows that may pass through that INP. When the scores of INPs under the programmable switch differ greatly, the ingress bandwidth pressure of INPs with higher scores will be too high. Therefore, the scores of INPs under the same switch should preferably be smaller, expressed by variance, and PMS with smaller variance will be selected first. In a multi-tasking scenario, to reduce the overlap of PMS used by different tasks, a round-robin approach is used to assign switches to each task. Each time a switch is selected, the PMS with the smallest variance that has not been selected by the task is chosen from the candidate PMS list and removed from the candidate list. The same operation is then performed for the next task. If all candidate PMSs have been selected but the allocation process is not yet complete, the candidate PMS list is restored and the selection continues.