A method and device for scheduling multi-task traffic for distributed model training

By maintaining a multi-dimensional resource status table and comprehensive priority sorting, the problems of critical flow latency and GPU waiting in the existing scheduling strategy are solved. This achieves coordinated optimization of low-latency transmission of critical flows and resource efficiency, and shortens the overall completion time of multi-job distributed model training.

CN123185159APending Publication Date: 2026-11-27BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611014436.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing scheduling strategies fail to effectively characterize the impact of different training streams on training job completion time in scenarios with multiple concurrent jobs and many-to-many communication, resulting in critical stream delays and GPU waiting, which lengthens the overall iteration time. Existing methods fail to optimize network performance from the perspective of the overall training system.

Method used

By maintaining a multidimensional resource status table, we can perceive the training job set and the stream set, calculate the latency GPU hour loss and training job level priority, select the optimal allocation scheme based on comprehensive priority ranking and preset constraints, and introduce a fairness guarantee mechanism to avoid non-critical streams occupying high-quality resources.

Benefits of technology

It achieves low-latency transmission of key training streams, reduces GPU waiting time, shortens the overall training job completion time, optimizes training-side performance and network-side resource efficiency, and improves the overall efficiency of multi-job distributed model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185159A_ABST
    Figure CN123185159A_ABST
Patent Text Reader

Abstract

The application provides a multi-task flow scheduling method and device for distributed model training, and relates to the technical field of communication technology and artificial intelligence cross technology; a multi-dimensional resource state table is maintained; a training job set and a training flow set are perceived and a feasible scheme set of the training flow is determined; for each training flow, delay GPU hour loss and training job level priority are obtained according to the business attribute of the training job and the training flow and the feasible scheme set calculation; then the comprehensive priority of the training flow is determined; based on the comprehensive priority, each training flow in the training flow set is sorted in descending order; based on the preset constraint condition, a candidate scheme is generated for each training flow after descending order; through a preset joint cost function, based on the business attribute of the training flow and the resource quality of the path in the candidate scheme, an optimal allocation scheme is output to obtain a final scheduling result; the training side performance and the network side resource efficiency are cooperatively optimized, and the overall JCT of multi-job distributed model training is finally shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology and artificial intelligence, and in particular to a method and apparatus for scheduling multi-task traffic for distributed model training. Background Technology

[0002] With the rapid growth in the scale of model parameters and training data, the computing resources within a single data center are no longer sufficient to meet the demands of ultra-large-scale model training. Geographically distributed model training, where multiple data centers in different geographical locations collaborate to complete training tasks, is gradually becoming a key development direction for overcoming computing power bottlenecks. In such scenarios, multiple training jobs are executed concurrently, with each job employing a hybrid parallel strategy for collaborative computation and communication. This results in a large amount of complex training traffic across data center networks, characterized by many-to-many relationships, periodicity, and burstiness. Simultaneously, with the continuous increase in the number of computing chips such as GPUs and TPUs, the proportion of communication overhead in the total training time is constantly increasing, making network performance a core bottleneck affecting Job Completion Time (JCT).

[0003] To meet the requirements of high bandwidth, low latency, and scalable interconnection networks for training geographically distributed models, existing research has proposed the Multi-granularity all-optical metropolitan Spine-Leaf Network (MSLN).

[0004] Existing scheduling strategies primarily optimize network layer performance metrics, such as reducing blocking rates, improving wavelength utilization, or enhancing time slot resource compactness. While these methods can improve network availability, they do not directly characterize the impact of different training streams on the Job Completion Time (JCT). In geographically distributed model training, the true determinant of training performance is not whether a single stream is accepted, but rather whether the stream's completion time prolongs the current iteration's communication phase, increases GPU waiting time, and lengthens the overall job completion time. Therefore, existing solutions that only address network blocking optimization struggle to achieve optimal results from the perspective of the entire training system.

[0005] In real-world scenarios, multiple training streams arriving simultaneously in a network often belong to different jobs, use different parallel methods, and are at different training stages, exhibiting significantly different sensitivities to latency. For example, a pipelined parallel activation value transmission stream may have a greater impact on training efficiency than a normal synchronous stream. Delays in these streams can cause multiple downstream GPUs to idle and wait, thus slowing down training completion. However, existing methods typically employ a request-based sequential access approach, failing to provide a unified quantitative evaluation of the latency characteristics of different streams and the potential impact on GPU idleness. When resources are scarce, the first-arriving streams prioritize low-latency paths, high-quality wavelengths, and smooth, continuous time slots, while later-arriving but more critical streams are allocated to path intervals with higher propagation latency and more time slot fragmentation, potentially causing waiting or even blocking. While this first-come, first-served resource allocation method is simple, in multi-job training scenarios, it leads to increased tail latency on the training side, causing some jobs to be constrained by the delayed completion of a few critical streams, thus significantly lengthening iteration time and overall JCT. Summary of the Invention

[0006] This invention provides a scheduling method and apparatus for multi-task traffic in distributed model training, which solves the defects of existing technologies such as multiple job concurrency, many-to-many communication, latency sensitivity of critical flow, and susceptibility of JCT to communication. It effectively reduces the latency of critical training flow, reduces GPU idle waiting time, and shortens the training job completion time.

[0007] This invention provides a scheduling method for multi-task traffic in distributed model training, comprising the following steps.

[0008] Maintain a multidimensional resource status table; perceive multiple training job sets and training flow sets under each training job within the current joint planning window, and determine the set of feasible solutions for the training flow; wherein, the multidimensional resource status table records the occupancy status of each resource unit under each link and resource granularity in the network; the training flow set includes multiple training flows; For each training stream, the latency GPU hour loss and training job-level priority are calculated based on the training characteristics of the training job to which it belongs, the business attributes of the training stream, and the set of feasible solutions. The product of the latency GPU hour loss and the training job-level priority is determined as the comprehensive priority of the training stream. Based on comprehensive priority, the training streams in the training stream set are sorted in descending order; based on preset constraints, candidate solutions are generated for each training stream after descending order; the preset constraints include unique allocation constraints, wavelength continuity constraints, time slot consistency constraints, and resource mutual exclusion constraints. For each training flow, the optimal allocation scheme is selected from the candidate schemes based on the business attributes of the training flow and the resource quality of the paths in the candidate schemes through a preset joint cost function; the final scheduling result is output based on the optimal allocation scheme.

[0009] According to the present invention, a method for scheduling multi-task traffic for distributed model training determines a set of feasible solutions for the training stream, including: A candidate path set is generated based on the K shortest path algorithm; wherein, the candidate path set includes multiple candidate paths; For each candidate path, each available wavelength, and each starting time slot, resource combinations that simultaneously satisfy wavelength continuity constraints and time slot consistency constraints are selected to form a set of feasible solutions for the training stream. Among them, available wavelength is the wavelength where all links on the path are idle; starting time slot is the first position of a consecutive idle block on the wavelength that can accommodate a data stream and satisfies the offset relationship; resource combination is the combination of path, wavelength and starting time slot.

[0010] According to the present invention, a scheduling method for multi-task traffic in distributed model training is provided. The business attributes of the training stream include: a destination node; for each training stream, based on the training characteristics of the training job to which it belongs, and the business attributes and feasible solution set of the training stream, the latency GPU-hour loss and training job-level priority are calculated, including: The arrival deviation of the training stream is calculated based on the minimum completion time of the training stream under feasible schemes and the computation completion time of the destination node GPU. Based on the parallelism type of the training stream, determine the size of the GPU node set affected by latency; calculate the latency GPU hour loss based on the GPU node set size and the parameters of the hybrid parallelism strategy. The training job priority is calculated based on the weight of the training job to which the training stream belongs, the remaining number of communication iterations, the time of a single communication, and the time of a single computation.

[0011] According to the present invention, a scheduling method for multi-task traffic in distributed model training is provided. For each training stream, based on the business attributes of the training stream and the resource quality of the paths in the candidate schemes, an optimal allocation scheme is selected from the candidate schemes using a preset joint cost function. The method includes: For each candidate scheme of each training stream, the time slot compactness of each path is calculated to obtain the path time slot compactness; where the path time slot compactness is used to evaluate the resource quality of the path. The resource allocation cost of the candidate solution is calculated by using a preset joint cost function based on the completion time of the candidate solution adopted in the training stream and the path slot compactness of the corresponding path of the candidate solution. The candidate solution with the lowest resource allocation cost is determined as the optimal allocation solution.

[0012] According to the present invention, a scheduling method for multi-task traffic in distributed model training calculates the time slot compactness of each path for each candidate scheme of each training flow to obtain the path time slot compactness, including: For each candidate scheme in each training stream, for each link on each path, the slot compactness of a single link is calculated based on the maximum and minimum values ​​of the occupied slot pointer, the number of consecutive free blocks, the number of occupied slot blocks, the number of free slots that satisfy the slot offset relationship between adjacent links, and the link delay; where the maximum and minimum values ​​include the maximum and minimum values. For each path in the candidate scheme, the time slot compactness of multiple single links is summed to obtain the path time slot compactness.

[0013] The method for scheduling multi-task traffic for distributed model training provided by the present invention further includes: Based on the fair guarantee scheduling scheme, fair guarantee scheduling is performed on low-priority training flows that have not been successfully assigned the optimal solution; wherein, the fair guarantee scheduling scheme includes at least one of path detour and flow splitting; low-priority training flows are training flows whose overall priority is lower than the preset priority.

[0014] According to the present invention, a scheduling method for multi-task traffic in distributed model training is provided. Based on a fair and guaranteed scheduling scheme, fair and guaranteed scheduling is performed on low-priority training streams that have not been successfully allocated the optimal solution, including: For low-priority training streams that fail to be assigned the optimal solution, the controller iterates through the remaining alternative paths. Based on a multidimensional resource status table, the sufficiency of idle resources for each candidate path is evaluated, and the candidate path with the highest idle resource sufficiency value is determined as the optimal solution; and a maximum tolerable propagation delay threshold is set for the optimal solution.

[0015] According to the present invention, a scheduling method for multi-task traffic in distributed model training, based on a fair and guaranteed scheduling scheme, performs fair and guaranteed scheduling on low-priority training flows that have not successfully been allocated the optimal solution, and further includes: If a low-priority training stream fails to be assigned an optimal solution but meets the condition of being divisible, the low-priority training stream is split into multiple sub-streams, and a sub-stream allocation scheme is generated for each sub-stream based on a multi-dimensional resource state table. Based on the propagation delay of the target path allocated to each sub-stream, calculate the end-to-end transmission delay difference of each sub-stream; based on the transmission delay difference, set the corresponding receiving offset at the sending end or receiving end so that the data blocks of each sub-stream are reassembled in the original sequence at the receiving end; The allocation schemes for each sub-stream are distributed to the gateway, which then performs time slot encapsulation and transmission control for the sub-streams.

[0016] According to the present invention, a scheduling method for multi-task traffic in distributed model training is provided, which splits the low-priority training stream into multiple sub-streams and generates a sub-stream allocation scheme for each sub-stream based on a multi-dimensional resource state table, including: The splitting granularity is determined based on the number of time slots required for the low-priority training stream and the size of discrete idle resource blocks in the network; based on the splitting intensity, the low-priority training stream is split into multiple sub-streams. Traverse the multidimensional resource status table and match the target path, target wavelength, and target time slot block that satisfy wavelength continuity constraints, time slot consistency constraints, and resource mutual exclusion constraints for each sub-stream to generate a sub-stream allocation scheme.

[0017] This invention also provides a scheduling method for multi-task traffic in distributed model training, comprising the following modules: The resource status maintenance and service awareness module is used to maintain a multi-dimensional resource status table; perceive multiple training job sets and training flow sets under each training job within the current joint planning window, and determine the set of feasible solutions for the training flow; among them, the multi-dimensional resource status table records the occupancy status of each resource unit under each link and resource granularity in the network; the training flow set includes multiple training flows; The unified priority evaluation module is used to calculate the latency GPU hour loss and training job-level priority for each training stream based on the training characteristics of the training job to which it belongs, the business attributes of the training stream, and the set of feasible solutions. The product of the latency GPU hour loss and the training job-level priority is determined as the comprehensive priority of the training stream. The candidate solution generation module is used to sort the training streams in the training stream set in descending order based on comprehensive priority; and to generate candidate solutions for each training stream in descending order based on preset constraints; wherein the preset constraints include unique allocation constraints, wavelength continuity constraints, time slot consistency constraints, and resource mutual exclusion constraints. The optimal solution determination and scheduling module is used to select the optimal allocation scheme from the candidate schemes for each training flow through a preset joint cost function, based on the business attributes of the training flow and the resource quality of the paths in the candidate schemes; and output the final scheduling result based on the optimal allocation scheme.

[0018] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-task traffic scheduling method for distributed model training as described above.

[0019] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a multi-task traffic scheduling method for distributed model training as described above.

[0020] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a multi-task traffic scheduling method for distributed model training as described above.

[0021] The present invention provides a scheduling method and apparatus for multi-task traffic in distributed model training. This method maintains a multi-dimensional resource state table; perceives multiple training job sets and training flow sets under each training job within the current joint planning window, and determines a set of feasible solutions for each training flow; for each training flow, it calculates the latency GPU-hour loss and training job-level priority based on the training characteristics of the training job to which it belongs, the business attributes of the training flow, and the set of feasible solutions; the product of the latency GPU-hour loss and the training job-level priority is determined as the comprehensive priority of the training flow; based on the comprehensive priority, the training flows in the training flow set are sorted in descending order; and based on preset constraints, each training flow in the descending order is then processed sequentially. Candidate schemes are generated; for each training stream, the optimal allocation scheme is selected from the candidate schemes based on the business attributes of the training stream and the resource quality of the paths in the candidate schemes through a preset joint cost function; the final scheduling result is output based on the optimal allocation scheme; by introducing a comprehensive priority evaluation mechanism that integrates stream-level GPU idle loss and training job-level priority, the first-come-first-served flow-by-flow access mode is broken. Resources are allocated after the concurrent streams of multiple jobs are uniformly sorted within the joint planning window, avoiding non-critical streams from preempting low-latency paths and high-quality time slot resources. Thus, while ensuring low-latency transmission of critical streams, the performance of the training side and the resource efficiency of the network side are synergistically optimized, ultimately shortening the overall JCT of multi-job distributed model training. Attached Figure Description

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

[0023] Figure 1 This is a flowchart illustrating the scheduling method for multi-task traffic in distributed model training provided by the present invention.

[0024] Figure 2 This diagram illustrates the problem of existing scheduling methods causing critical training flows to be blocked in multi-job concurrent training scenarios.

[0025] Figure 3 This is the overall system block diagram provided by the present invention.

[0026] Figure 4 This is a schematic diagram of the joint RWTA (Routing-Wavelength-Timeslot Assignment) based on a unified priority flow provided by the present invention.

[0027] Figure 5 This is a schematic diagram of the low-priority flow fairness guarantee provided by the present invention.

[0028] Figure 6 This is a schematic diagram of the multi-task traffic scheduling device for distributed model training provided by the present invention.

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

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

[0031] The following is combined Figures 1 to 7 This invention is described.

[0032] Figure 1 This is a flowchart illustrating the multi-task traffic scheduling method for distributed model training provided by the present invention, as shown below. Figure 1 As shown, the method includes the following: Step 101: Maintain the multidimensional resource status table; perceive the multiple training job sets and the training flow sets under each training job within the current joint planning window, and determine the set of feasible solutions for the training flow; wherein, the multidimensional resource status table records the occupancy status of each resource unit under each link and resource granularity in the network; the training flow set includes multiple training flows.

[0033] In step 101 above, perception refers to the centralized controller actively collecting and parsing the business information of multi-job distributed model training, including but not limited to the source node, destination node, earliest available transmission time, required number of transmission time slots, the Job identifier, and the hybrid parallel strategy parameters of the corresponding Job for each training stream, and converting the training business requirements into quantitative inputs that the scheduling algorithm can process.

[0034] like Figure 2As shown, in real-world scenarios, multiple training streams arriving simultaneously in the network often belong to different jobs, different parallel methods, and different training stages, and their sensitivities to latency vary significantly. For example, a pipelined parallel activation value transmission stream may have a greater impact on training efficiency than a normal synchronous stream. Delays in these streams can cause multiple downstream GPUs to idle and wait, thus slowing down training completion. However, existing methods typically use a request-based sequential access approach, failing to provide a unified quantitative evaluation of the latency characteristics of different streams and the potential impact on GPU idleness. When resources are scarce, the first-arriving streams prioritize low-latency paths, high-quality wavelengths, and smooth, continuous time slots, while later-arriving but more critical streams are allocated to path intervals with higher propagation latency and more time slot fragments, potentially causing waiting or even blocking. While this first-come, first-served resource allocation method is simple, in multi-job training scenarios, it increases tail latency on the training side, causing some jobs to be constrained by the delayed completion of a few critical streams, thus significantly lengthening iteration time and the overall JCT.

[0035] This invention proposes a novel all-optical metropolitan area Spine-Leaf network traffic scheduling method for multi-job distributed model training, in order to address the shortcomings of existing solutions in terms of training performance orientation, concurrent flow joint optimization, and fair resource allocation.

[0036] Based on the optical time slot switching capability of MSLN, and with the goal of optimizing the training job completion time (JCT), the impact of different training streams on iteration latency and GPU idle waiting is introduced into the network resource allocation process, forming a unified evaluation, joint routing-wavelength-time slot allocation, and fair guarantee mechanism for low-priority streams oriented towards multi-job concurrent training streams.

[0037] Unlike existing scheduling methods that primarily target blocking rates, resource utilization, or slot conflict avoidance, this invention performs unified evaluation, sorting, and joint planning on multiple concurrent training streams of multiple jobs within the same joint planning window. This ensures that critical training streams receive priority access to high-quality transmission resources with low latency and low fragmentation, while fair guarantees prevent low-priority streams from being starved for extended periods. This reduces tail latency of training iterations, minimizes GPU idle waiting time, and ultimately shortens the overall JCT of multi-job distributed model training.

[0038] The network topology of this invention is as follows: The all-optical metropolitan area Spine-Leaf network topology includes gateway nodes, Leaf switching nodes, and Spine switching nodes. In the MSLN, Leaf nodes and Spine nodes are fully connected, and each gateway is connected to its corresponding Leaf node, thereby forming an all-optical metropolitan area Spine-Leaf network.

[0039] This invention defines a resource status of A. λ,t,e A λ,t,e =0 indicates that the t-th time slot of wavelength λ on link e is idle; A λ,t,e =1 indicates that the time slot is already occupied. The resource status table is maintained and updated periodically by a centralized controller for subsequent feasibility study generation and resource allocation.

[0040] This invention assumes that the set of training jobs contained in the current joint planning window is J, and the set of concurrent training streams in this joint planning is F. Each training stream f∈F is defined with the following business attributes: Among them, s f and d f Represent the source node and the destination node respectively; a f Indicates the earliest time when the training stream can begin to be sent; D f Indicates the amount of data in the training stream or the number of time slots required; w f Indicates the priority of the stream; j f The Job to which the stream belongs.

[0041] For each flow f, a set of candidate paths is obtained using the K shortest path algorithm. For each path, each wavelength, and the starting time slot in the path set, feasible resource schemes that satisfy the wavelength continuity constraint and the time slot consistency constraint are searched to form a set of feasible schemes for that flow.

[0042] Optionally, step 101, determining the set of feasible solutions for the training stream, includes steps A1 to A2: Step A1: Generate a candidate path set based on the K shortest path algorithm; wherein, the candidate path set includes multiple candidate paths; Step A2: For each candidate path, each available wavelength, and each starting time slot, select resource combinations that simultaneously satisfy wavelength continuity constraints and time slot consistency constraints to form a set of feasible solutions for the training stream. Among them, available wavelength is the wavelength where all links on the path are idle; starting time slot is the first position of a consecutive idle block on the wavelength that can accommodate a data stream and satisfies the offset relationship; resource combination is the combination of path, wavelength and starting time slot.

[0043] In steps A1 to A2 above, for each flow f, a set of candidate paths is obtained using the K shortest path algorithm. For each path, each wavelength, and the starting time slot in the path set, feasible resource schemes that satisfy the wavelength continuity constraint and the time slot consistency constraint are searched, forming a set of feasible schemes for that flow.

[0044] Step 102: For each training stream, calculate the latency GPU hour loss and training job-level priority based on the training characteristics of the training job to which it belongs, the business attributes of the training stream, and the set of feasible solutions; determine the comprehensive priority of the training stream by multiplying the latency GPU hour loss and the training job-level priority.

[0045] In step 102 above, the present invention first establishes a unified evaluation mechanism to assign a unified weight to multiple Jobs and multiple concurrent training streams that arrive at the same time, for subsequent joint scheduling.

[0046] Optionally, the business attributes of the training stream include: the destination node; in step 102, for each training stream, the latency GPU-hour loss and training job-level priority are calculated based on the training characteristics of the training job to which it belongs, the business attributes of the training stream, and the set of feasible solutions, including steps B1 to B3: Step B1: Calculate the flow arrival deviation based on the minimum completion time of the training flow under feasible schemes and the computation completion time of the destination node GPU.

[0047] Step B2: Determine the size of the GPU node set affected by latency based on the parallelism type of the training stream; calculate the latency GPU hour loss based on the GPU node set size and the parameters of the hybrid parallelism strategy.

[0048] Step B3: Calculate the training job priority based on the weight of the training job to which the training stream belongs, the remaining number of communication iterations, the time of a single communication, and the time of a single computation.

[0049] In steps B1 to B3 above, for the training flow f, its completion time under the candidate scheme ω∈Ωf is denoted as ej,f,ω. The basic completion time evaluation of the training flow is defined as: Let comi be the time when the target node GPU completes its computation. Then the deviation of the training stream from the time when the target node completes its computation can be expressed as: When σ > 0, it means that the target GPU completes the computation before the training stream arrives, causing the target node GPU to be in an idle state for a duration of σ. When σ < 0, it means that the target node GPU has not yet completed the computation before the training stream arrives, and the target GPU will not experience idle waiting.

[0050] Define G j,fLet f be the set of nodes that may cause GPU idle waiting when training stream f experiences delays. In one implementation, for a data-parallel AllReduce stream, if the hybrid parallel strategy parameters are (p, t, d), then: For a pipelined parallel PP flow, let s be the number of stages.

[0051] Here, S represents the physical meaning of the potential GPU hour loss when the training stream f experiences a delay. The larger S is, the more significant the impact of the training stream delay on training performance.

[0052] For different jobs, the job priority is defined as follows: Where W represents the weight of the Job itself, R represents the remaining number of communication iterations, Tcomm represents the time of a single communication, and Tcomp represents the time of a single computation. The physical meaning of P is: the larger the weight of the Job itself and the less the remaining iteration time, the higher its priority.

[0053] Combining the Job-level weights with the stream-level weights yields the combined priority of the training stream f: The higher the overall priority, the greater the impact of the training stream on the training of JCT, and its latency and resource quality should be prioritized during subsequent joint scheduling.

[0054] Step 103: Based on the comprehensive priority, sort the training streams in the training stream set in descending order; based on the preset constraints, generate candidate schemes for each training stream after descending order; wherein, the preset constraints include unique allocation constraints, wavelength continuity constraints, time slot consistency constraints, and resource mutual exclusion constraints.

[0055] In step 103 above, as Figure 4 As shown, within each joint planning window, the centralized controller first sorts the flow set F in descending order. For each training flow f to be scheduled, the time slots of each scheme are calculated in its feasible scheme set Ωf, and the scheme that can balance low transmission latency and low time slot fragmentation is selected first.

[0056] Then, the joint RWTA allocation is completed sequentially. Unlike existing sequential access methods, this invention performs unified evaluation and sorting of multiple concurrent training streams before allocation, thereby avoiding the long-term occupation of high-quality resources by early-arriving but less critical streams, which would force later-arriving critical training streams into high-latency path areas and fragmented resource areas.

[0057] The RWTA allocation process of this invention satisfies the following constraints: Unique allocation constraint: Each training stream can choose at most one final scheme, where xf,ω∈{0,1} indicates whether stream f chooses scheme ω. Wavelength continuity constraint: The same training stream should use the same wavelength when transmitted along the entire path. Time slot consistency constraint: The time slot positions of training streams transmitted on adjacent links should satisfy the time slot offset relationship determined by the link delay. Resource mutual exclusion constraint: Any two training streams cannot simultaneously occupy the same resource unit on the same link, the same wavelength, and the same time slot.

[0058] The above constraints guarantee the feasibility and conflict-free forwarding of the training stream under all-optical, bufferless switching conditions.

[0059] Step 104: For each training flow, select the optimal allocation scheme from the candidate schemes based on the business attributes of the training flow and the resource quality of the paths in the candidate schemes through a preset joint cost function; output the final scheduling result based on the optimal allocation scheme.

[0060] In step 104 above, based on the concept of time slot compactness of TC-RWTA, the present invention constructs an improved link / path resource evaluation index, which further considers boundary conditions and link latency, and is used to perceive link resource occupancy and time slot fragmentation.

[0061] After the centralized controller completes joint RWTA allocation and fairness guarantee processing, it outputs the final scheduling result for each training stream. The gateway then uses this result to perform training service admission, stream classification, time slot encapsulation, and transmission control. Whenever a service allocation is completed, released, or scheduling fails, the distributed controller feeds back the resource changes to the centralized controller to update the link-wavelength-time slot resource status table and proceeds to the next joint planning window.

[0062] Optionally, step 104 includes steps C1 to C3: Step C1: For each candidate scheme of each training stream, calculate the time slot compactness of each path to obtain the path time slot compactness; where the path time slot compactness is used to evaluate the resource quality of the path.

[0063] Step C2: Calculate the resource allocation cost of the candidate solution by using a preset joint cost function, based on the completion time of the candidate solution adopted in the training stream and the path slot compactness of the corresponding path of the candidate solution.

[0064] Step C3: Determine the candidate scheme with the lowest resource allocation cost as the optimal allocation scheme.

[0065] Optionally, step C1 includes steps C11 to C12: Step C11: For each candidate scheme in each training stream, for each link on each path, calculate the time slot compactness of a single link based on the maximum and minimum values ​​of the occupied time slot pointer, the number of consecutive free blocks, the number of occupied time slot blocks, the number of free time slots that satisfy the time slot offset relationship between adjacent links, and the link delay; where the maximum and minimum values ​​include the maximum and minimum values.

[0066] Step C12: For each path in the candidate scheme, sum the time slot compactness of multiple single links to obtain the path time slot compactness.

[0067] In step 104 above, let the maximum and minimum values ​​of the occupied time slot pointer on a certain link be Tsmax and Tsmin, respectively, and the number of consecutive free blocks be F. TB The number of occupied time slots is K, the total number of idle time slots is M, the number of idle time slots that satisfy the time slot offset relationship between adjacent links is Md, and L is the link delay.

[0068] The higher this metric, the more concentrated the available time slots that satisfy the propagation constraints are, the smoother the resources are, and the lower the propagation latency, making it more suitable as a carrier link for critical training flows. Based on the compactness of each link on the path, the path time slot compactness can be further calculated to evaluate the resource quality of the entire path.

[0069] Under the premise of satisfying the above constraints, this invention adopts a method that simultaneously considers transmission completion time and path resource quality, and uses a joint cost function to optimize each candidate scheme. For a candidate scheme ω of training stream f, its resource allocation cost is defined as: Where endf,ω represents the completion time when the training stream f adopts candidate scheme ω, g f,ω This indicates the time slot compactness of the corresponding path in this scheme. Further, we have: Finally, for training stream f, the candidate scheme with the lowest cost is selected as the allocation result. This ensures that high-priority training streams receive transmission schemes with shorter completion times, fewer time slot fragments, and better path resources.

[0070] Optionally, the scheduling method for multi-task traffic in distributed model training provided by the present invention further includes step D1: Step D1: Based on the fair guarantee scheduling scheme, perform fair guarantee scheduling on low-priority training flows that have not been successfully assigned the optimal solution; wherein, the fair guarantee scheduling scheme includes at least one of path detour and flow splitting; low-priority training flows are training flows whose overall priority is lower than the preset priority.

[0071] In step D1 above, as Figure 3 As shown, the method of the present invention includes the following functional modules: a resource status maintenance module, used to construct and maintain a three-dimensional resource status table of link-wavelength-timeslot; a unified priority evaluation module, used to perceive multiple job training requests and the service attributes of each training flow; a unified priority evaluation module, used to calculate the comprehensive priority based on the degree of influence of the training flow on JCT; a training service perception module, in conjunction with the RWTA allocation module, used to complete the joint routing-wavelength-timeslot allocation of multiple concurrent training flows based on the comprehensive priority and network resource status; and a fairness guarantee module, used to implement detour scheduling and flow splitting for low-priority flows that have not been successfully allocated priority.

[0072] Optionally, step D1 includes steps D11 to D12: Step D11: For low-priority training streams that have not been successfully assigned the optimal solution, traverse the remaining alternative paths through the controller; Step D12: Based on the multidimensional resource status table, evaluate the sufficiency of idle resources for each candidate path, determine the candidate path with the highest idle resource sufficiency value as the optimal solution, and set the maximum tolerable propagation delay threshold for the optimal solution.

[0073] In steps D11 to D12 above, as follows Figure 5 As shown, to prevent high-priority flows from continuously occupying high-quality resources, thus preventing low-priority flows from obtaining available resources for a long time, this invention further designs a fairness guarantee mechanism for low-priority training flows. When a training flow fails to be successfully allocated in the preferred candidate scheme, detour scheduling, flow splitting, and time slot fragment filling are triggered sequentially.

[0074] When a low-priority flow cannot be successfully allocated in the shortest path or in a high-quality resource area, it is allowed to choose an alternative path with a slightly longer propagation delay but more available resources for forwarding. This improves service acceptance capacity and resource utilization without affecting the guarantee of high-priority flows.

[0075] Optionally, step D1 further includes steps D13 to D15: Step D13: If the low-priority training stream that has not been successfully assigned the optimal solution meets the condition of being splittable, split the low-priority training stream into multiple sub-streams, and generate a sub-stream allocation scheme for each sub-stream based on the multi-dimensional resource state table.

[0076] Step D14: Calculate the end-to-end transmission delay difference of each sub-stream based on the propagation delay of the target path allocated to each sub-stream; based on the transmission delay difference, set the corresponding receiving offset at the sending end or receiving end so that the data blocks of each sub-stream are reassembled in the original sequence at the receiving end.

[0077] Step D15: The allocation scheme for each sub-stream is sent to the gateway, which then performs time slot encapsulation and transmission control for the sub-streams.

[0078] Optionally, step D13 includes steps D131 to D132: Step D131: Determine the splitting granularity based on the number of time slots required for the low-priority training stream and the size of the discrete idle resource blocks in the network; based on the splitting intensity, split the low-priority training stream into multiple sub-streams.

[0079] Step D132: Traverse the multidimensional resource status table, and match the target path, target wavelength, and target time slot block that satisfy the wavelength continuity constraint, time slot consistency constraint, and resource mutual exclusion constraint for each sub-stream to generate a sub-stream allocation scheme.

[0080] In steps D13 to D15 above, for low-priority training streams with large data volume that can be further divided, the present invention allows a single stream to be split into multiple sub-streams or multiple data blocks, and mapped to different paths, different time slots or different wavelengths, respectively, on the premise of meeting the reassembly requirements of the receiver, so as to fill the discrete time slot fragment resources in the network.

[0081] In one implementation, the end-to-end arrival time of each data block is predicted based on the propagation delay of different paths, and the transmission offset is dynamically adjusted to ensure that the data blocks arriving at the receiving end via different paths maintain the same order as much as possible.

[0082] This invention simultaneously possesses the ability to optimize JCT for the training side and optimize network resource status; it has the ability to jointly plan multiple jobs and multiple concurrent training streams; it has the ability to guarantee low latency for latency-sensitive training streams; and it has the ability to adapt well to MSLN network architecture and cooperative control plane.

[0083] The present invention provides a scheduling method for multi-task traffic in distributed model training. This method maintains a multi-dimensional resource state table; perceives multiple training job sets and training stream sets under each training job within the current joint planning window, and determines the set of feasible solutions for each training stream; for each training stream, it calculates the latency GPU-hour loss and training job-level priority based on the training characteristics of its respective training job, the business attributes of the training stream, and the set of feasible solutions; the product of the latency GPU-hour loss and the training job-level priority is determined as the comprehensive priority of the training stream; based on the comprehensive priority, the training streams in the training stream set are sorted in descending order; and based on preset constraints, the order is further refined in descending order. Candidate schemes are generated for each subsequent training stream. For each training stream, the optimal allocation scheme is selected from the candidate schemes based on the business attributes of the training stream and the resource quality of the paths in the candidate schemes through a preset joint cost function. By introducing a comprehensive priority evaluation mechanism that integrates stream-level GPU idle loss and training job-level priority, the first-come-first-served stream-by-stream access mode is broken. Resources are allocated after the concurrent streams of multiple jobs are uniformly sorted within the joint planning window, avoiding non-critical streams from preempting low-latency paths and high-quality time slot resources. This ensures low-latency transmission of critical streams while achieving coordinated optimization of training-side performance and network-side resource efficiency, ultimately shortening the overall JCT of multi-job distributed model training.

[0084] The scheduling device for multi-task traffic in distributed model training provided by the present invention will be described below. The scheduling device for multi-task traffic in distributed model training described below can be referred to in correspondence with the scheduling method for multi-task traffic in distributed model training described above.

[0085] like Figure 6 As shown, the present invention also provides a scheduling method for multi-task traffic in distributed model training, including the following modules: The resource status maintenance and service awareness module 601 is used to maintain a multi-dimensional resource status table; perceive multiple training job sets and training flow sets under each training job within the current joint planning window, and determine the set of feasible solutions for the training flow; wherein, the multi-dimensional resource status table records the occupancy status of each resource unit under each link and resource granularity in the network; the training flow set includes multiple training flows.

[0086] The unified priority evaluation module 602 is used to calculate the latency GPU hour loss and training job level priority for each training stream based on the training characteristics of the training job to which it belongs, the business attributes of the training stream, and the set of feasible solutions. The product of the latency GPU hour loss and the training job level priority is determined as the comprehensive priority of the training stream.

[0087] The candidate scheme generation module 603 is used to sort the training streams in the training stream set in descending order based on comprehensive priority; and to generate candidate schemes for each training stream after descending order based on preset constraints; wherein the preset constraints include unique allocation constraints, wavelength continuity constraints, time slot consistency constraints, and resource mutual exclusion constraints.

[0088] The optimal solution determination and scheduling module 604 is used to select the optimal allocation scheme from the candidate schemes for each training flow through a preset joint cost function, based on the business attributes of the training flow and the resource quality of the paths in the candidate schemes; and output the final scheduling result based on the optimal allocation scheme.

[0089] The present invention provides a scheduling device for multi-task traffic in distributed model training. This device maintains a multi-dimensional resource status table; perceives multiple training job sets and training flow sets under each training job within the current joint planning window, and determines the set of feasible solutions for each training flow; for each training flow, it calculates the latency GPU-hour loss and training job-level priority based on the training characteristics of its respective training job, the business attributes of the training flow, and the set of feasible solutions; it determines the comprehensive priority of the training flow by multiplying the latency GPU-hour loss and the training job-level priority; based on the comprehensive priority, it sorts the training flows in the training flow set in descending order; and based on preset constraints, it generates a schedule for each training flow in descending order. Candidate schemes are generated; for each training stream, the optimal allocation scheme is selected from the candidate schemes based on the business attributes of the training stream and the resource quality of the paths in the candidate schemes through a preset joint cost function; the final scheduling result is output based on the optimal allocation scheme; by introducing a comprehensive priority evaluation mechanism that integrates stream-level GPU idle loss and training job-level priority, the first-come-first-served flow-by-flow access mode is broken. Resources are allocated after the concurrent streams of multiple jobs are uniformly sorted within the joint planning window, avoiding non-critical streams from preempting low-latency paths and high-quality time slot resources. Thus, while ensuring low-latency transmission of critical streams, the collaborative optimization of training-side performance and network-side resource efficiency is achieved, ultimately shortening the overall JCT of multi-job distributed model training.

[0090] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840. The processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a scheduling method for multi-task traffic in distributed model training. This method includes a scheduling method for multi-task traffic in distributed model training.

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

[0092] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the multi-task traffic scheduling method for distributed model training provided by the above methods.

[0093] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a scheduling method for multi-task traffic for distributed model training provided by the methods described above.

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

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

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

Claims

1. A scheduling method for multi-task traffic in distributed model training, characterized in that, include: Maintain a multidimensional resource status table; perceive multiple training job sets and training flow sets under each training job within the current joint planning window, and determine the set of feasible solutions for the training flow; wherein, the multidimensional resource status table records the occupancy status of each resource unit under each link and resource granularity in the network; the training flow set includes multiple training flows; For each training stream, the latency GPU hour loss and training job-level priority are calculated based on the training characteristics of the training job to which it belongs, the business attributes of the training stream, and the set of feasible solutions. The product of the latency GPU hour loss and the training job-level priority is determined as the comprehensive priority of the training stream. Based on the comprehensive priority, the training streams in the training stream set are sorted in descending order; based on preset constraints, candidate schemes are generated for each training stream after descending order; wherein, the preset constraints include unique allocation constraints, wavelength continuity constraints, time slot consistency constraints, and resource mutual exclusion constraints. For each training flow, an optimal allocation scheme is selected from the candidate schemes based on the business attributes of the training flow and the resource quality of the paths in the candidate schemes using a preset joint cost function; the final scheduling result is output based on the optimal allocation scheme.

2. The scheduling method for multi-task traffic in distributed model training according to claim 1, characterized in that, The set of feasible solutions for determining the training stream includes: A candidate path set is generated based on the K shortest path algorithm; wherein, the candidate path set includes multiple candidate paths; For each candidate path, each available wavelength, and each starting time slot, resource combinations that simultaneously satisfy wavelength continuity constraints and time slot consistency constraints are selected to form a set of feasible solutions for the training stream. Wherein, the available wavelength is the wavelength where all links on the path are idle; the starting time slot is the first position of a continuous idle block on the wavelength that can accommodate a data stream and satisfies the offset relationship; the resource combination is a combination of path, wavelength and starting time slot.

3. The scheduling method for multi-task traffic in distributed model training according to claim 1, characterized in that, The business attributes of the training stream include: the destination node; for each training stream, based on the training characteristics of the training job to which it belongs, and the business attributes and feasible solution set of the training stream, the latency GPU-hour loss and training job-level priority are calculated, including: The arrival deviation of the training stream is calculated based on the minimum completion time of the training stream under feasible schemes and the computation completion time of the destination node GPU. Based on the parallelism type of the training stream, determine the size of the GPU node set affected by latency; calculate the latency GPU hour loss based on the GPU node set size and the hybrid parallelism strategy parameters. The training job priority is calculated based on the weight of the training job to which the training stream belongs, the remaining number of communication iterations, the time of a single communication, and the time of a single computation.

4. The scheduling method for multi-task traffic in distributed model training according to claim 1, characterized in that, For each training stream, the optimal allocation scheme is selected from the candidate schemes based on the business attributes of the training stream and the resource quality of the paths in the candidate schemes, using a preset joint cost function. This includes: For each candidate scheme of each training stream, the time slot compactness of each path is calculated to obtain the path time slot compactness; wherein, the path time slot compactness is used to evaluate the resource quality of the path; The resource allocation cost of the candidate solution is calculated by using a preset joint cost function based on the completion time of the training stream when the candidate solution is adopted and the path slot compactness of the path corresponding to the candidate solution. The candidate solution with the lowest resource allocation cost is determined as the optimal allocation solution.

5. The scheduling method for multi-task traffic in distributed model training according to claim 4, characterized in that, For each candidate scheme of each training stream, the time slot compactness of each path is calculated to obtain the path time slot compactness, including: For each candidate scheme in each training stream, for each link on each path, the slot compactness of a single link is calculated based on the maximum and minimum values ​​of the occupied slot pointer, the number of consecutive free blocks, the number of occupied slot blocks, the number of free slots that satisfy the slot offset relationship between adjacent links, and the link delay; where the maximum and minimum values ​​include the maximum and minimum values. For each path in the candidate scheme, the time slot compactness of multiple single links is summed to obtain the path time slot compactness.

6. The scheduling method for multi-task traffic in distributed model training according to claim 1, characterized in that, Also includes: Based on the fair guarantee scheduling scheme, fair guarantee scheduling is performed on low-priority training streams that fail to be assigned the optimal solution; wherein, the fair guarantee scheduling scheme includes at least one of path detour and stream splitting; the low-priority training stream is a training stream whose overall priority is lower than the preset priority.

7. The scheduling method for multi-task traffic in distributed model training according to claim 6, characterized in that, The fair scheduling scheme, which performs fair scheduling on low-priority training streams that have not been successfully allocated the optimal solution, includes: For low-priority training streams that fail to be assigned the optimal solution, the controller iterates through the remaining alternative paths. Based on a multidimensional resource status table, the sufficiency of idle resources for each candidate path is evaluated, and the candidate path with the highest idle resource sufficiency value is determined as the optimal solution; and a maximum tolerable propagation delay threshold is set for the optimal solution.

8. The scheduling method for multi-task traffic in distributed model training according to claim 7, characterized in that, The fair scheduling scheme, which performs fair scheduling on low-priority training streams that have not been successfully allocated the optimal solution, further includes: If a low-priority training stream fails to be allocated an optimal solution but meets the condition of being divisible, the low-priority training stream is divided into multiple sub-streams, and a sub-stream allocation scheme is generated for each sub-stream based on the multi-dimensional resource status table. Based on the propagation delay of the target path allocated to each sub-stream, calculate the end-to-end transmission delay difference of each sub-stream; based on the transmission delay difference, set a corresponding receiving offset at the sending end or receiving end, so that the data blocks of each sub-stream are reassembled in the original sequence at the receiving end; The allocation schemes for each sub-stream are distributed to the gateway, which then performs time slot encapsulation and transmission control for the sub-streams.

9. The scheduling method for multi-task traffic in distributed model training according to claim 8, characterized in that, The step of splitting the low-priority training stream into multiple sub-streams and generating a sub-stream allocation scheme for each sub-stream based on the multi-dimensional resource state table includes: The splitting granularity is determined based on the number of time slots required for the low-priority training stream and the size of discrete idle resource blocks in the network; based on the splitting intensity, the low-priority training stream is split into multiple sub-streams. The multidimensional resource status table is traversed to match the target path, target wavelength, and target time slot block that satisfy the wavelength continuity constraint, time slot consistency constraint, and resource mutual exclusion constraint for each sub-stream, thereby generating a sub-stream allocation scheme.

10. A scheduling device for multi-task traffic in distributed model training, characterized in that, include: The resource status maintenance and service awareness module is used to maintain a multi-dimensional resource status table; perceive multiple training job sets and training flow sets under each training job within the current joint planning window, and determine the set of feasible solutions for the training flow; wherein, the multi-dimensional resource status table records the occupancy status of each resource unit under each link and resource granularity in the network; the training flow set includes multiple training flows; The unified priority evaluation module is used to calculate the latency GPU hour loss and training job level priority for each training stream based on the training characteristics of the training job to which it belongs, the business attributes of the training stream, and the set of feasible solutions. The product of the latency GPU hour loss and the training job level priority is determined as the comprehensive priority of the training stream. The candidate scheme generation module is used to sort the training streams in the training stream set in descending order based on the comprehensive priority; and to generate candidate schemes for each training stream after descending order based on preset constraints; wherein, the preset constraints include unique allocation constraints, wavelength continuity constraints, time slot consistency constraints, and resource mutual exclusion constraints. The optimal solution determination and scheduling module is used to select the optimal allocation scheme from the candidate schemes for each training flow based on the business attributes of the training flow and the resource quality of the paths in the candidate schemes through a preset joint cost function; and output the final scheduling result based on the optimal allocation scheme.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the multi-task traffic scheduling method for distributed model training as described in any one of claims 1 to 9.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the multi-task traffic scheduling method for distributed model training as described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the multi-task traffic scheduling method for distributed model training as described in any one of claims 1 to 9.