Self-adaptive scheduling method for accelerating distributed training operation
Optimizing the distributed training of deep learning jobs through adaptive scheduling methods solves the problems of resource competition and network bandwidth limitations, achieves more efficient processing efficiency, and significantly reduces the completion time.
Patent Information
- Application Number
- CN202410891413.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In distributed training of deep learning jobs, the traditional job-exclusive GPU mode cannot meet the growing demand, resulting in resource competition and network bandwidth limitations, affecting processing efficiency.
An adaptive scheduling method is proposed to accelerate distributed training jobs. It optimizes job scheduling and migration by determining job and device priorities, designing the optimal number of job divisions, calculating migration overhead, considering job result storage methods, and designing job reservation methods. process to reduce resource constraints and network interference.
In a real distributed heterogeneous system, the overall completion time is reduced by about 26% on average, and the average job completion time is reduced by about 15%, which is significantly better than existing methods and improves processing efficiency.
Smart Images

Figure CN118779077A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence and big data technology, and in particular to an adaptive scheduling method for accelerating distributed training operations. Background Art
[0002] With the development of artificial intelligence technology, application services based on deep neural networks are becoming increasingly popular, especially in the fields of voice assistants, autonomous driving, and smart medicine. These services rely on basic models such as pattern recognition and machine vision, and are implemented through deep learning jobs trained in data centers. Using parallel computing methods to train deep learning jobs can effectively reduce the time it takes to complete jobs, and GPUs have become an important part of solving the problem due to their high concurrent computing power. However, with the growing demand for deep learning services, the computing power of a single data center is limited, and distributed heterogeneous systems have emerged. Their characteristics are that a single job is divided into multiple tasks and placed on different devices for execution. The traditional job-exclusive GPU model no longer meets the demand, and job colocation and distributed computing have become new strategies to improve processing efficiency. However, resource competition and network bandwidth limitations remain a challenge. Summary of the invention
[0003] The purpose of the present invention is to provide an adaptive scheduling method for accelerating distributed training jobs, to address the equipment interference and network interference problems caused by co-location training of jobs, and to reasonably schedule different types of deep learning training jobs, so as to achieve the goal of reducing the overall completion time and accelerating prediction efficiency.
[0004] To achieve the above object, the present invention provides an adaptive scheduling method for accelerating distributed training jobs, comprising the following steps:
[0005] Step 1: Determine the priorities of jobs and equipment to provide effective support for scheduling;
[0006] Step 2: Design the optimal number of job divisions to reduce the impact of resource constraints;
[0007] Step 3: Design a migration cost calculation method to reduce the cost of job migration;
[0008] Step 4: Consider the way to save the job results and determine whether the job needs to be migrated;
[0009] Step 5: Design a job reservation method to reduce unnecessary job migration;
[0010] Step 6: Select the best reserved execution time to improve the reserved execution effect of the job.
[0011] Optionally, during the execution of step 1, the urgency of different jobs is distinguished by calculating job priority and device priority; the calculation of the job priority gives priority to first-come-first-served, runtime overhead, and the number of remaining job cycles, with the goal of ensuring that jobs with longer runtime requirements and jobs that have just started are given priority; the calculation of the device priority gives priority to resource utilization, the number of tasks, and interference factors, with the goal of reducing interference caused by job co-location and distributed networks.
[0012] Optionally, the calculation of interference factors for job colocation and job exclusive completion time t s The colocation completion time t c In step 1, the single cycle execution time t e to replace the job colocation completion time t c , using a single job prediction time t p to replace the job's exclusive completion time t s , co-location interference factor inter co The calculation formula is as follows:
[0013]
[0014] Optionally, during the execution of step 2, the job resource requirements are represented by the job parameter size and floating-point operation number characteristic table, and the number of tasks to be divided is dynamically adjusted; at the same time, when the device has many idle resources and the job demand is small, the classic scheduling method is used to reduce overhead, and the parameters of the scheduling method are updated; if the parameters are not updated for multiple consecutive jobs, the parameter update will be forced to ensure the effectiveness of the scheduling method.
[0015] Optionally, during the execution of step 3, the saving and reading time of the job checkpoint and the distributed communication waiting time are considered, and the corresponding costs are calculated to make scheduling decisions to reduce unnecessary overhead.
[0016] Optionally, in step 4, the migration is performed only when the time requirement of the migration job is satisfied that the remaining completion time after the migration is less than the sum of the migration time and the remaining time before the migration; otherwise, the migration is canceled.
[0017] Optionally, during the execution of step 6, the reservation method will pack the selected jobs into the reservation queue and notify the scheduling method to process them first. If the scheduling method considers that the reservation is unreasonable after analysis, the job will be moved back to the waiting queue and scheduled as a normal job; the decision of whether to execute the reservation method is to set the threshold θ as the upper limit of the migration time. The threshold θ of 0 means that once the job is completed, the reservation method can be executed immediately.
[0018] The present invention provides an adaptive scheduling method for accelerating distributed training jobs, which involves three processes: scheduling, migration and reservation. First, the job completion time is predicted through modeling analysis and machine learning, and the optimal job division method is designed. Then, considering the overhead of job migration, a method for estimating the overhead of job migration is designed to reduce the overhead. Finally, since the overhead of migration is not negligible, a reservation method is designed to reduce unnecessary migration. The present invention adopts a prediction model based on job and node characteristics and a hierarchical selection strategy for efficient scheduling. By analyzing the necessity of job migration and considering the migration cost, as well as the relationship between scheduling and migration, a reservation method for optimization is designed for the scheduling method. In a comparative test in a real distributed heterogeneous system, the method of the present invention reduces the overall completion time by an average of about 26%, and the average job completion time by about 15%, which is significantly better than the existing method, proving its effectiveness. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a schematic diagram of the technical solution structure of an adaptive scheduling method for accelerating distributed training jobs of the present invention.
[0021] Figure 2 It is a schematic diagram of the overall framework of a specific embodiment of the present invention.
[0022] Figure 3 It is a flowchart of a scheduling method in a specific embodiment of the present invention.
[0023] Figure 4 It is a schematic diagram of a job migration scenario of a specific embodiment of the present invention.
[0024] Figure 5 It is a schematic diagram of an improved job scheduling scenario of a specific embodiment of the present invention.
[0025] Figure 6 It is a flowchart of a reservation method according to a specific embodiment of the present invention. DETAILED DESCRIPTION
[0026] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0027] The present invention provides an adaptive scheduling method for accelerating distributed training operations, comprising the following steps:
[0028] Step 1: Determine the priorities of jobs and equipment to provide effective support for scheduling;
[0029] Step 2: Design the optimal number of job divisions to reduce the impact of resource constraints;
[0030] Step 3: Design a migration cost calculation method to reduce the cost of job migration;
[0031] Step 4: Consider the way to save the job results and determine whether the job needs to be migrated;
[0032] Step 5: Design a job reservation method to reduce unnecessary job migration;
[0033] Step 6: Select the best reserved execution time to improve the reserved execution effect of the job.
[0034] The execution process of the adaptive scheduling method for accelerating distributed training jobs of the present invention involves three parts: scheduling, migration and reservation. The process structure of the technical method is as follows: Figure 1 shown.
[0035] The following is further described in conjunction with specific embodiments and execution processes:
[0036] In this embodiment, MYME (MyMethod) is used to represent the method of the present invention, such as Figure 2 As shown in the figure, the job pool includes a waiting queue and a reserved queue, and the reserved queue has a higher priority. The system connects multiple nodes and devices through Ethernet, and uses the scheduling method to allocate jobs to heterogeneous system nodes. When there are fewer jobs, the migration condition analyzes the node resources and migrates the jobs to optimize the job completion time. The reservation strategy is used as an auxiliary to reduce the migration overhead. By matching the jobs being executed and waiting, the matching information is submitted to the reserved queue and the scheduling method is notified to prioritize the processing. The scheduling method chooses to accept or cancel the reserved jobs according to the real-time resource situation to ensure the efficient operation of the system.
[0037] Step 1: Determine the priorities of jobs and equipment to provide effective support for scheduling.
[0038] The goal of the scheduling method is to quickly and efficiently place jobs on appropriate devices for execution.j and device priority PR d , so that the scheduling method can distinguish the urgency of different jobs. The calculation of job priority takes into account several aspects: first come first served (waiting time t1), running time overhead (t2) and the number of remaining cycles of the job (e1). The goal is to ensure that jobs with longer running time requirements and jobs that have just started are given priority. The calculation is shown in formula (1), where w represents the weight value.
[0039]
[0040] The calculation of device priority takes into account several aspects: resource utilization (GPU resource utilization r util , memory resource utilization r mem , network resource utilization rate r net ), number of tasks (r task ) and interference factors (co-location interference factors co , network interference factors net ), the goal is to reduce the interference caused by job co-location and distributed networks, and ensure that devices with light load and less interference are given priority. This dual priority mechanism improves the efficiency and fairness of job scheduling.
[0041]
[0042] In addition, the calculation of co-located interference factors is related to the exclusive completion time of the task (t s ) and the colocation completion time (t c ). Generally expressed as inter co =(t c -t s ) / t s However, there is no unified method for obtaining its specific value. In the present invention, the single cycle execution time (t e ) to replace the job colocation completion time (t c ), using a single job prediction time (t p ) to replace the job exclusive completion time (t s ), this is because the prediction value of the prediction model is trained based on historical operation data. After derivation, its complete calculation is shown in formula (3).
[0043]
[0044] Internet interference factors t) is reflected in the parameter synchronization between tasks. Since the network has a maximum transmission rate (PBC, Peak Bandwidth Capacity), the parameter synchronization between different tasks will cause competition for limited resources. It is expressed by formula (4). t It is related to the number of synchronization parameters (SN, Sync Number) and the size of synchronization parameters (SD, Sync Data). To calculate the interference level within a cycle (t), it is necessary to obtain the network resource utilization at each moment.
[0045]
[0046] Step 2: Design the optimal number of job divisions to reduce the impact of resource constraints.
[0047] In distributed scheduling, the number of job task divisions is one of the core issues. Some previous studies believe that the optimal number of divisions (m b ), or randomly select the number of partitions, but these methods are not applicable when resources are limited. The advantage of the present invention is that the resource requirements of the job are represented by the characteristic table of the job parameter size and the number of floating point operations (given by t e ×e1 reflects), dynamically adjust the number of tasks to be divided (m), and use formula (5) to calculate. At the same time, when there are many idle resources in the device and the job demand is small, the classic scheduling method is used to reduce the overhead and update the parameters of the scheduling method. If the parameters are not updated for multiple consecutive jobs, the parameter update will be forced to ensure the effectiveness of the scheduling method. The basic scheduling process is as follows Figure 3 shown.
[0048]
[0049] Step 3: Design a migration cost calculation method to reduce the cost of job migration.
[0050] The goal of job migration is to optimize resource allocation and improve job execution efficiency by reallocating jobs being executed to more suitable devices. The present invention is designed around two phenomena: the first phenomenon is that when a job is about to be completed, if the migration method finds a better device, the possible result of migrating it is that the time cost of migration is almost the same as the expected reduction in job completion time, resulting in a waste of efficiency. Another phenomenon is that some jobs are migrated to the original devices after being migrated to new devices. These phenomena show that the migration method does not fully consider the cost. In order to solve these two phenomena, the present invention identifies the main migration costs, namely the time to save and read the job checkpoint and the distributed communication waiting time, and calculates the corresponding costs to make scheduling decisions to reduce unnecessary migrations, as shown in formula (6), with ts and t l Indicates that the other is distributed communication waiting, with t d The migration cost t m As shown in the following formula.
[0051] tmW5×t, +W. 6×t+w7×ta(6)
[0052] Step 4: Consider how to save the job results and determine whether the job needs to be migrated.
[0053] During the job migration process, it is necessary to temporarily save the data of the training job and then transfer the data. The present invention uses different methods to save the model submitted by the user according to whether it exists. If the model submitted by the user does not have the same record in the historical record, the model is considered to be newly submitted, so the TorchSave method is used to save it completely (parameters and model preservation). If it is found that the model submitted by the user has the same record in the historical record, it is considered that the model has been trained, but it is repeatedly submitted for other reasons, so the TorchCheckpoint method is used to save parameters (without saving the model). However, due to the overhead of the migration method, the present invention is more inclined to reduce unnecessary migration. When there are fewer jobs waiting in the job queue, the probability of migration increases to make full use of resources. Migration is performed only when the demand for the migration job meets the requirement that the remaining completion time after migration is less than the sum of the migration time and the remaining time before migration. Otherwise, the migration will be canceled to ensure that the migration decision can bring actual performance improvement.
[0054] Step 5: Design a job reservation method to reduce unnecessary job migration.
[0055] All-Reduce distributed training strategy is a common solution. However, any failure in any task will affect the progress of its job. In response to the problem raised in step 4, the present invention designs a job reservation method to assist the scheduling method and reduce the possibility of job migration. Through experiments, it is believed that when the device is idle and there are fewer jobs in the job queue, it is possible to migrate jobs. Figure 4 As shown, when job A is completed ( Figure 4 (b)), after calculation using the migration method, it is found that job C is most disturbed, so job C needs to be migrated ( Figure 4 (c) and ( Figure 4 (d))).
[0056] like Figure 5As shown in the figure, assuming there is a job A that is about to be completed and a job D that is being executed, in order to avoid unnecessary migration, the job reservation method reserves the required idle devices for job D by predicting the remaining execution time of job A. Job D is marked as a job waiting for reservation and placed in a virtual reservation queue. Once job A is completed, job D will be quickly assigned to an idle device, avoiding unreasonable migration of other jobs (such as job C). This strategy effectively reduces the migration cost and improves the efficiency of distributed training.
[0057] Step 6: Select the best reserved execution machine to improve the reserved execution effect of the job.
[0058] In order to correctly and effectively execute the job reservation method, it is necessary to select the best reservation execution time. The key step is how to select an appropriate threshold θ to decide whether to execute the reservation method. Ideally, θ is 0, which means that the reservation method can be executed immediately once the job is completed, but this is difficult to achieve in reality. Through experiments, it is found that setting θ as the upper bound of the migration time is a better choice. This is because the upper bound of the migration time is related to the performance of the device. The reservation method will package the selected jobs into the reservation queue and notify the scheduling method to give priority to them. If the scheduling method considers that the reservation is unreasonable after analysis, the job will be moved back to the waiting queue and scheduled as a normal job. The process of the reservation method is as follows Figure 6 shown.
[0059] Furthermore, the present invention also verifies the superiority by comparing with corresponding scheduling methods to evaluate their performance in resource-constrained heterogeneous systems.
[0060] The corresponding methods are: Gandiva (based on deep learning job co-location and migration strategy), Tiresias (aims to reduce the average job completion time and adopt different priority calculation methods), MLF-H (scheduling by building a model and considering job characteristics, as well as migration strategy when overloaded), SJF (shortest job first method, scheduling according to the expected running time of the job), Greedy (greedy method, pursuing local optimal cluster utilization) and Load Balance (load balancing method, assigning jobs to the node with the least load). All methods adopt the job co-location strategy to verify their effectiveness in optimizing job scheduling and acceleration under different resource constraints.
[0061] Table 1. Comparison of overall completion time of different scheduling methods
[0062]
[0063] After experimental verification, the performance of different methods in resource-constrained environments was compared. As shown in Tables 1 and 2, Gandiva and MLF-H have significantly improved the overall completion time and average job completion time compared to traditional methods due to the optimization of job co-location. The Tiresias method performed poorly due to its short running time and insufficient information acquisition. Among the traditional methods, Greedy is overloaded due to excessive pursuit of node utilization, and SJF ignores resource competition and has limited performance. In contrast, the LB method performs better by balancing node loads. The MYME method proposed in the present invention not only takes job co-location into account, but also optimizes it for resource-constrained environments, which reduces its overall completion time by about 26% and the average job completion time by about 15%, showing significant advantages.
[0064] Table 2 Comparison of average job completion time of different scheduling methods
[0065]
[0066] In summary, when there are many idle resources in the device and the job demand is small, the classic scheduling method is used to reduce the overhead and update the scheduling parameters. This method can effectively reduce the overhead of the scheduling method itself. In the comparative test in a real distributed heterogeneous system, the method proposed in the present invention reduces the overall completion time by an average of about 26%, and the average job completion time by about 15%, which is significantly better than the existing method, proving its effectiveness.
[0067] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. An adaptive scheduling method for accelerating distributed training jobs, characterized in that: The following steps are involved: Step 1: Determine the priorities of jobs and equipment to provide effective support for scheduling; Step 2: Design the optimal number of job divisions to reduce the impact of resource constraints; Step 3: Design a migration cost calculation method to reduce the cost of job migration; Step 4: Consider the way to save the job results and determine whether the job needs to be migrated; Step 5: Design a job reservation method to reduce unnecessary job migration; Step 6: Select the best reserved execution time to improve the reserved execution effect of the job.
2. The adaptive scheduling method for accelerating distributed training jobs according to claim 1, characterized in that: During the execution of step 1, the urgency of different jobs is distinguished by calculating job priority and device priority; the calculation of the job priority gives priority to first-come-first-served, running time overhead and the number of remaining job cycles, with the goal of ensuring that jobs with longer running time requirements and jobs that have just started are given priority; the calculation of the device priority gives priority to resource utilization, the number of tasks and interference factors, with the goal of reducing the interference caused by job co-location and distributed networks.
3. The adaptive scheduling method for accelerating distributed training jobs according to claim 2, characterized in that: Calculation of interference factors of co-location of tasks and exclusive completion time t of tasks s The colocation completion time t c In step 1, the single cycle execution time t e to replace the job colocation completion time t c , using a single job prediction time t p to replace the job's exclusive completion time t s , co-location interference factor inter co The calculation formula is as follows:
4. The adaptive scheduling method for accelerating distributed training jobs according to claim 3, characterized in that: During the execution of step 2, the job resource requirements are represented by the job parameter size and floating-point operation characteristics, and the number of tasks to be divided is dynamically adjusted; at the same time, when the device has many idle resources and the job demand is small, the classic scheduling method is used to reduce overhead and update the parameters of the scheduling method; if the parameters are not updated for multiple consecutive jobs, the parameter update will be forced to ensure the effectiveness of the scheduling method.
5. The adaptive scheduling method for accelerating distributed training jobs according to claim 4, characterized in that: During the execution of step 3, the saving and reading time of the job checkpoint and the distributed communication waiting time are considered, and the corresponding costs are calculated to make scheduling decisions to reduce unnecessary overhead.
6. The adaptive scheduling method for accelerating distributed training jobs according to claim 5, characterized in that: In step 4, the migration is performed only when the time requirement of the migration job is satisfied that the remaining completion time after the migration is less than the sum of the migration time and the remaining time before the migration; otherwise, the migration is canceled.
7. The adaptive scheduling method for accelerating distributed training jobs according to claim 6, characterized in that: During the execution of step 6, the reservation method will package the selected jobs into the reservation queue and notify the scheduling method to give priority to them. If the scheduling method considers that the reservation is unreasonable after analysis, the job will be moved back to the waiting queue and scheduled as a normal job. The decision of whether to execute the reservation method is to set the threshold θ as the upper limit of the migration time. A threshold θ of 0 means that once the job is completed, the reservation method can be executed immediately.
