Task scheduling method and device, electronic equipment and computer readable storage medium

By combining tasks and matching graph theory in a distributed computing environment, combined with the execution time conditions of the task group, the efficient resource utilization and processing efficiency of the task scheduling method are achieved, and the problem of low resource utilization in the existing technology is solved. .

CN119248456APending Publication Date: 2025-01-03BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411496746.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In a distributed computing environment, how to reasonably schedule tasks to make full use of computing resources and improve processing efficiency is an urgent problem to be solved, especially in the process of machine learning model training, it is difficult for the existing technology to effectively utilize the resources of multiple computing units. , resulting in inefficiency.

Method used

Through a task scheduling method, multiple tasks to be dispatched are obtained and combined into a task group. According to the estimated execution time and execution time conditions of the task group on the reference calculation unit, the graph theory method is used to match and allocate the calculation unit. To maximize matching weights and minimize total execution costs, task group splitting in the case of free resources to better utilize resources.

Benefits of technology

It achieves more efficient resource utilization and processing efficiency, significantly improves the accuracy and matching efficiency of the task group, and can realize optimized scheduling of the task group while meeting execution time constraints, improving overall processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248456A_ABST
    Figure CN119248456A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a task scheduling method and device, electronic equipment and a computer readable storage medium, and belongs to the technical field of distributed systems and deep learning. The method comprises the following steps: acquiring a plurality of tasks to be scheduled; the multiple tasks are combined to obtain one or more task groups so as to maximize the sum of matching weights of all the task groups, and the matching weights of the task groups are determined at least according to the estimated execution duration of the task groups on the calculation units of the reference type and are in negative correlation with the estimated execution duration of the task groups on the calculation units of the reference type; the reference type is at least one of computing unit types contained in the cluster; and respectively determining scheduling results for the more than one task group, wherein the scheduling results comprise the calculation units distributed for the task groups. According to the invention, computing resources can be fully utilized and the processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed systems and deep learning technology, and in particular to a task scheduling method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the advent of the big data era, distributed computing has become a necessary means to handle large-scale data and complex problems. For example, machine learning technology is an important branch of artificial intelligence. With the continuous growth of data volume and the increasing complexity of computing requirements, distributed computing is gradually used in the training process of machine learning models, that is, using a cluster of multiple computing units to complete the training task.

[0003] Based on distributed computing, how to reasonably schedule tasks to fully utilize computing resources and improve processing efficiency has become an urgent problem to be solved. Summary of the invention

[0004] In view of this, the present application provides a task scheduling method, device, electronic device and computer-readable storage medium, so as to improve resource utilization and processing efficiency.

[0005] This application provides the following solutions:

[0006] In a first aspect, a task scheduling method is provided, which is applied to a cluster including multiple computing units, and the method includes:

[0007] Get multiple tasks to be scheduled;

[0008] Combining the plurality of tasks to obtain more than one task group to maximize the sum of matching weights of the task groups, wherein the matching weight of the task group is determined at least according to an estimated execution time of the task group on a computing unit of a reference type and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type, wherein the reference type is at least one of the computing unit types included in the cluster;

[0009] Scheduling results are determined for the one or more task groups respectively, wherein the scheduling results include computing units allocated to the task groups.

[0010] Optionally, the matching weight of the task group is determined based at least on an estimated execution time of the task group on a computing unit of a reference type, including:

[0011] Determine the estimated execution time of each task group on each type of computing unit included in the cluster;

[0012] The computing unit with the shortest estimated execution time is used as the computing unit of the reference type corresponding to the task group;

[0013] A matching weight of the task group is determined according to an estimated execution time of the task group on a computing unit of a reference type.

[0014] Optionally, the matching weight of the task group is also determined according to the similarity of the execution time conditions corresponding to the tasks included in the task group, and is positively correlated with the similarity of the execution time conditions corresponding to the tasks included in the task group.

[0015] Optionally, combining the multiple tasks to obtain more than one task group includes:

[0016] Constructing an undirected graph, the undirected graph comprising nodes and edges, the nodes representing tasks, and the edges between two nodes representing matching weights of the task groups formed by the two nodes;

[0017] Using a search algorithm to search the undirected graph, obtaining an edge set with the maximum sum of matching weights, wherein the edge set includes mutually non-intersecting edges;

[0018] The node combinations corresponding to the edges in the edge set are respectively determined as task groups, and the remaining nodes in the undirected graph are respectively used as task groups.

[0019] Optionally, determining scheduling results for the one or more task groups respectively includes: allocating computing units to the one or more task groups from the cluster to minimize the total execution cost of the one or more task groups on the allocated computing units, the total execution cost being determined at least based on the estimated execution time of the one or more task groups on the allocated computing units and being positively correlated with the estimated execution time of the one or more task groups on the allocated computing units.

[0020] Optionally, the scheduling result also includes the execution order of the task groups on the assigned computing units;

[0021] The total execution cost is also determined according to the extent to which the execution time conditions corresponding to the one or more task groups are satisfied, wherein the execution time conditions corresponding to the task group are determined according to the execution time conditions corresponding to each task included in the task group.

[0022] Optionally, determining the scheduling results for the one or more task groups respectively includes:

[0023] Constructing a bipartite graph, the bipartite graph comprising a first node set, a second node set and an edge, the nodes in the first node set respectively represent task groups, the nodes in the second node set represent a combination of computing units and execution orders, the execution order is the execution order of the task groups on the computing units, the two endpoints of the edge are respectively a node in the first node set and a node in the second node set, and the edge represents an execution cost of the task group corresponding to one endpoint on the computing unit corresponding to the other endpoint;

[0024] Use a weighted matching algorithm to determine the edge set with the minimum total execution cost;

[0025] According to each edge in the edge set, a computing unit corresponding to another endpoint and an execution order are allocated to a task group corresponding to one endpoint of the edge.

[0026] Optionally, the method further comprises:

[0027] After computing units are allocated to the one or more task groups, if the cluster further includes idle computing units, some of the task groups are split, and some of the tasks obtained after the splitting are allocated to the idle computing units.

[0028] Optionally, splitting part of the task groups includes:

[0029] Determining the execution efficiency of each task group according to the estimated execution time of the one or more task groups on the assigned computing units;

[0030] The task groups to be split are determined based on execution efficiency.

[0031] Optionally, the estimated execution time of the task group on the computing unit is determined in the following manner:

[0032] Pre-execute each task in the task group on the computing unit for several rounds to determine the execution time of each task stage when each task is executed separately on the computing unit;

[0033] The execution duration of each task stage when each task is executed individually on the computing unit is used to estimate the estimated execution duration of the task group when it is executed concurrently and interleaved on the computing unit. The concurrent and interleaved execution includes concurrent execution of each task in the task group, and the task stages corresponding to each task are interleaved in time.

[0034] Optionally, using the execution time of each task stage when the task is executed individually on the computing unit, estimating the estimated execution time of the task group when it is executed concurrently and interleaved on the computing unit includes:

[0035] According to the execution time of each task stage when each task in the task group is executed separately on the computing unit, the function call duration of each task, the resource synchronization time and resource competition information of each task stage when the task group is executed concurrently and staggered on the computing unit, the execution time of each task stage when the task group is executed concurrently and staggered on the computing unit is estimated respectively;

[0036] The execution duration of each task stage when the task group is executed concurrently and interleaved on the computing unit is summed to obtain an estimated execution duration when the task group is executed concurrently and interleaved on the computing unit.

[0037] Optionally, estimating the execution duration of each task stage when the task group is concurrently and interleavedly executed on the computing unit according to the execution duration of each task stage when each task in the task group is executed separately on the computing unit, the function call duration of each task, the resource synchronization time and resource competition information at each stage when the task group is concurrently and interleavedly executed on the computing unit includes:

[0038] According to the timing of concurrent interleaving execution of the task group on the computing unit, for each task stage, each task in the task group is sequentially used as the current task to perform the following processing, to obtain the time-consuming parameter value corresponding to each task stage, and the time-consuming parameter value obtained in each task stage is respectively used as the execution duration of each task stage when the task group is concurrently interleaved on the computing unit; wherein the processing performed on the current task includes:

[0039] The time-consuming parameter value is updated using the larger value of the function call duration of the current task and the time-consuming parameter value, wherein the initial time-consuming parameter value of each task is 0;

[0040] The execution time of the current task in the current task phase is superimposed with the first time consumption, and the first time consumption is updated using the superimposed time consumption, wherein the initial first time consumption is 0;

[0041] In the case where resource synchronization is required in the current task phase, the resource synchronization time is superimposed on the first time consumption, and then the time consumption parameter value is updated using the larger value of the first time consumption and the time consumption parameter value;

[0042] In the case of resource competition between task groups at the current stage, the interference coefficient is used to correct the current time-consuming parameter value and the first time-consuming value respectively;

[0043] The initial execution duration used in the next stage is obtained by using the current time-consuming parameter value exceeding the first time-consuming duration.

[0044] Optionally, the task is a model training task, the task stages include: a forward propagation stage, a back propagation stage and a network communication stage, and the computing unit includes a GPU.

[0045] In a second aspect, a task scheduling device is provided, the device comprising:

[0046] A task acquisition unit, configured to acquire a plurality of tasks to be scheduled;

[0047] a task combining unit configured to combine the plurality of tasks to obtain more than one task group to maximize the sum of matching weights of the task groups, wherein the matching weight of the task group is determined at least according to an estimated execution time of the task group on a computing unit of a reference type, and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type, wherein the reference type is at least one of the computing unit types included in the cluster;

[0048] The resource allocation unit is configured to determine scheduling results for the one or more task groups respectively, and the scheduling results include computing units allocated to the task groups.

[0049] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0050] According to a fourth aspect, there is provided an electronic device, comprising:

[0051] one or more processors; and

[0052] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of the first aspects above.

[0053] In a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.

[0054] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0055] 1) This application combines multiple task groups to be scheduled to obtain task groups based on the method of maximizing the sum of matching weights of each task group, and determines the scheduling results based on the task groups. The matching weight of the task group is determined at least based on the estimated execution time of the task group on the computing unit in the cluster. On the one hand, this method of sharing computing units by task groups can make more full use of computing resources. On the other hand, by maximizing the sum of matching weights of each task group, the overall processing efficiency of multiple tasks to be scheduled can be improved as much as possible.

[0056] 2) In the present application, the estimated execution time of the task group on each type of computing unit contained in the cluster is determined, and the computing unit with the shortest estimated execution time is used as the computing unit of the reference type corresponding to the task group, that is, the computing unit type with the highest execution efficiency is used as the reference type, and the matching weight of the task group is determined based on the estimated execution time of the task group on the computing unit of the reference type, so that the task group obtained based on this matching can improve the execution efficiency as much as possible.

[0057] 3) When combining multiple tasks to be scheduled to obtain a task group, in addition to considering the estimated execution time, the application further considers the similarity of the execution time conditions corresponding to each task, that is, the combination of tasks is achieved under the premise of satisfying the task execution time constraints, so as to achieve a balance between the execution time conditions and the overall efficiency, thereby obtaining a more optimized task group.

[0058] 4) This application constructs multiple tasks to be scheduled in the form of an undirected graph, uses nodes to represent tasks, and the edge between two nodes represents the matching weight of the two nodes constituting the task group, and searches the undirected graph to obtain the final optimal solution, i.e., the task group. This implementation method based on graph theory can significantly improve the accuracy and matching efficiency of the task group.

[0059] 5) When determining the computing units and execution order for more than one task group, the present application takes minimizing the total execution cost of these task groups as the scheduling principle, wherein the execution cost of the task group is determined by the estimated execution time corresponding to the task group. In other words, the scheduling goal is to maximize the overall execution efficiency of the task group, thereby maximizing the overall processing efficiency of multiple tasks to be scheduled.

[0060] 6) In addition to allocating computing units to task groups, the present application can further determine the execution order of task groups on computing units. Based on this, the scheduling principle adopted when scheduling task groups further considers the degree to which the execution time conditions corresponding to the task groups are satisfied, that is, the scheduling of task groups is achieved under the premise of satisfying the task execution time constraints, achieving a balance between the execution time conditions and the overall efficiency, thereby obtaining a more optimized scheduling result.

[0061] 7) This application constructs the task group, computing unit and task execution order into the form of an undirected graph, where the nodes in the first node set represent the task group respectively, the nodes in the second node set represent the combination of computing unit and execution order, and the edge represents the execution cost of the task group corresponding to one endpoint on the computing node corresponding to another endpoint. The weighted matching algorithm is used to search the undirected graph to obtain the final optimal solution, which is the computing unit and execution order assigned to the task group. This implementation method based on graph theory can significantly improve the accuracy of the scheduling results and the efficiency of determining the scheduling results.

[0062] 8) After allocating computing resources to each task group, if there are still idle computing units in the cluster, the present application can split some task groups and allocate some of the tasks obtained after the split to the idle computing units, so as to make fuller use of computing resources and further improve the overall execution efficiency of the tasks.

[0063] 9) When determining the split task group, the present application can determine the execution efficiency of the task group based on the estimated execution time of the task group on the assigned computing unit, and determine the split task group based on the execution efficiency, so as to be able to split the task group with low execution efficiency and transfer part of it to the idle computing unit, thereby further improving the overall execution efficiency of the task.

[0064] 10) The present application pre-executes each task in the task group on the computing unit for several rounds to determine the execution time of each stage when each task is executed separately on the computing unit, and then estimates the estimated execution time of the task group when it is executed concurrently and staggered on the computing unit. This method can use the execution time obtained by pre-execution as a reference, thereby improving the accuracy of determining the estimated execution time when the task group is executed concurrently and staggered.

[0065] 11) When estimating the estimated execution time of a task group when it is executed concurrently and interleaved on a computing unit, in addition to considering the execution time of each stage when each task is executed separately on the computing unit, the function call duration, resource synchronization time and resource competition information of each task are also comprehensively considered to improve the accuracy of the estimate so that it is as consistent as possible with the actual execution situation.

[0066] 12) The task scheduling method provided in this application can be applied to model training tasks to reasonably allocate GPU resources for multiple model training tasks to be scheduled, thereby maximizing the overall processing efficiency of the tasks.

[0067] Of course, any product implementing the present application does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0069] Figure 1 A flowchart of a task scheduling method provided in an embodiment of the present application;

[0070] Figure 2 A schematic diagram of a bipartite graph provided in an embodiment of the present application;

[0071] Figure 3 The two tasks provided in the embodiment of the present application are executed concurrently and interleaved on the same computing unit;

[0072] Figure 4 A schematic diagram of a task scheduling system provided in an embodiment of the present application;

[0073] Figure 5 A schematic block diagram of a task scheduling device provided in an embodiment of the present application;

[0074] Figure 6 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0075] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0076] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0077] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0078] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0079] Figure 1 The flowchart of the task scheduling method provided in the embodiment of the present application is applied to a cluster including multiple computing units, such as Figure 1 As shown in , the method may include the following steps:

[0080] Step 101: Acquire multiple tasks to be scheduled.

[0081] Step 103: Combine the above multiple tasks to obtain more than one task group to maximize the sum of the matching weights of each task group, wherein the matching weight of the task group is determined at least according to the estimated execution time of the task group on the computing unit of the reference type, and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type, and the type of the computing unit of the reference type is at least one of the computing unit types included in the cluster.

[0082] Step 105: Determine scheduling results for the one or more task groups respectively, where the scheduling results include computing units allocated to the task groups.

[0083] It can be seen from the above process that this application combines multiple task groups to be scheduled to obtain task groups based on the method of maximizing the sum of the matching weights of each task group, and determines the scheduling results based on the task groups. The matching weight of the task group is determined at least based on the estimated execution time of the task group on the computing unit in the cluster. On the one hand, this method of sharing computing units by task groups can make more full use of computing resources. On the other hand, by maximizing the sum of the matching weights of each task group, the overall processing efficiency of multiple tasks to be scheduled can be improved as much as possible.

[0084] The following describes in detail each step in the above process and the effects that can be further produced in combination with the embodiments. First, the above step 101, namely "obtaining multiple tasks to be scheduled", is described in detail in combination with the embodiments.

[0085] In a task scheduling system based on a distributed computing cluster, an interface is usually provided for users. Users can declare task information through the interface, where the task information may include information such as task type, computing resource requirements, etc. For example, for a training task, the user can declare the type of model to be trained, the type and / or size of the GPU to be used, and further include information such as training data, training deadline, etc.

[0086] After receiving the task information, the task scheduling system parses the task information, creates the task and submits the task to the task queue. The task scheduling system reads the task from the task queue for scheduling, so multiple tasks to be scheduled can be obtained from the task queue.

[0087] As one of the possible implementation methods, tasks in the task queue may be scheduled periodically, and all tasks to be scheduled in the task queue may be read to execute a subsequent scheduling method.

[0088] As another achievable method, the timing of scheduling tasks in the task queue can be determined based on the actual execution status of the tasks and / or the idle status of computing resources (i.e., each computing unit). For example, if most of the tasks to be executed have been completed and there is a certain degree of idle computing resources, a certain number of tasks to be scheduled can be taken from the task queue.

[0089] The above step 103, namely "combining the above multiple tasks to obtain more than one task group", is described in detail below in conjunction with an embodiment.

[0090] Combine multiple tasks to be scheduled to obtain more than one task group, and schedule computing units in the form of task groups so that one task group shares one computing unit. For example, the tasks included in a task group can be executed on one computing unit in a concurrent interleaved execution manner. In an embodiment of the present application, a task combination method that takes into account the overall efficiency of tasks is provided. When multiple tasks are matched to obtain a task group, the matching principle adopted is to maximize the sum of the matching weights of each task group, wherein the matching weight of the task group is determined at least according to the estimated execution time of the task group on the computing unit of the reference type, and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type.

[0091] For ease of understanding, the reference type of computing unit involved is first described. The reference type involved in the embodiment of the present application can be at least one of the computing unit types included in the cluster. For example, if the cluster contains two types of GPUs, one of the GPU types can be used as the reference type of the task group.

[0092] As one of the feasible ways, a computing unit type with the best performance in the cluster can be selected, and the computing unit of this type can be used as a computing unit of the reference type. The execution time of each task group on the computing unit of the reference type is estimated, and the matching weight of each task group is calculated accordingly. For example, if the cluster contains two types of GPUs, the GPU with the strongest computing power can be used as a computing unit of the reference type to estimate the estimated execution time of each task group.

[0093] As another achievable method, the estimated execution time of the task group on each type of computing unit contained in the cluster can also be determined, and the computing unit with the shortest estimated execution time can be used as the computing unit of the reference type corresponding to the task group. The execution time of the task group on the computing unit of the reference type is estimated, and the matching weight of the task group is calculated accordingly. For example, if the cluster contains two types of GPUs, the estimated execution time can be determined for each task group on the two types of GPUs. Taking task group a as an example, the estimated execution time of task group a on the two types of GPUs can be determined, and the GPU with the shortest estimated execution time can be used as the computing unit of the reference type corresponding to task group a. The computing unit of the reference type corresponding to each task group can be determined in a similar manner.

[0094] How to estimate the estimated execution time of the task group on the reference type computing unit will be described in detail in subsequent embodiments. After determining the estimated execution time of each task group on the reference type computing unit, an indicator eff_value can be used to represent the execution efficiency of the task group, which is positively correlated with the estimated execution time of the task group on the reference type computing unit. For example:

[0095]

[0096] Among them, jobs represents the task group, Duration(j) represents the estimated execution time of task j in the task group jobs on the computing unit of the reference type, and InterleavingDuration(jobs) represents the estimated execution time of the task group jobs on the computing unit of the reference type.

[0097] As one of the feasible ways, the matching weight of the task group jobs can be determined according to eff_value. The matching weight is negatively correlated with eff_value, that is, the smaller the eff_value is, the greater the matching weight of the task group jobs is.

[0098] In some cases, tasks have certain execution time conditions. For example, when declaring task information, the user declares the deadline of the task, and the task needs to be completed within the deadline. Therefore, in addition to efficiency considerations, the execution time condition restrictions need to be considered when determining the task group. Because a task group consisting of multiple tasks will have a longer execution time than a single task, it is easy to exceed the deadline. If two tasks with a large difference in deadlines are placed in the same task group, in order to avoid exceeding the deadline, the earliest deadline in the task group needs to be used as the deadline of the entire task group, which forces the task group to be scheduled earlier, affecting scheduling flexibility.

[0099] In view of this, the embodiment of the present application further considers the execution time conditions of each task when determining the task group, and combines tasks with similar execution conditions into the same task group as much as possible. That is, when multiple tasks to be scheduled are matched to obtain more than one task group, the matching weight of the task group is also determined according to the similarity of the execution time conditions corresponding to the tasks contained in the task group, and is positively correlated with the similarity of the execution time conditions corresponding to the tasks contained in the task group.

[0100] In order to reflect the similarity of the execution time conditions corresponding to each task, an indicator ddl_value can be used to indicate the similarity of the execution time conditions corresponding to each task contained in the task group, for example:

[0101]

[0102] Among them, n represents the number of tasks contained in the task group jobs, D j and A j They represent the deadline and arrival time of task j respectively, where the arrival time can be the time when the task enters the task queue.

[0103] The matching weight total_value of the task group can be determined by the above eff_value and ddl_value, where total_value is negatively correlated with eff_value and positively correlated with ddl_value. For example:

[0104] total_value=w·eff_value+(1-w)·ddl_value (3)

[0105] Wherein w is a weighting coefficient, which is a preset value and can adopt an empirical value or an experimental value.

[0106] When multiple tasks are combined to obtain more than one task group in this step, the task group with the smallest sum of matching weights of the corresponding task groups is determined based on the matching weights of the task groups. There are many matching methods that can be used, and here is a feasible method based on graph search. Specifically, an undirected graph can be constructed first, represented as G<V, E>. The undirected graph includes nodes V and edges E. The nodes represent tasks, and the edges between the nodes represent the matching weights of the task groups formed by the two nodes. Then a search algorithm is used to search the undirected graph, and the result of the search is to find some task groups, which are essentially non-intersecting edges, and the goal is to maximize the sum of matching weights of these task groups. In other words, the search obtains the edge set with the largest sum of matching weights, and the edge set contains non-intersecting edges. The node combinations corresponding to each edge in the edge set are respectively determined as each task group, and the remaining nodes in the undirected graph (i.e., nodes that are not matched to other nodes) are separately used as task groups.

[0107] The above search algorithm may adopt, for example, Edmonds' blossom algorithm, breadth-first algorithm, and the like.

[0108] The above step 105, namely "determining scheduling results for the above one or more task groups respectively", is described in detail below in conjunction with an embodiment.

[0109] For a task group, the factors that affect its execution end time mainly include two: which type of computing unit is used and the execution order of each task in the task group. Therefore, if the computing units in the cluster are homogeneous, you only need to consider the execution order of each task. If you only consider efficiency issues without considering the constraints of execution time conditions, you only need to consider the type of computing unit. If the computing units in the cluster are heterogeneous and the constraints of execution time conditions are considered, you need to consider the above two factors, that is, when scheduling the task group, the scheduling result mainly includes the computing units assigned to the task group and the execution order of each task contained in the task group.

[0110] In this step, when scheduling resources for the task group, the first thing to consider is the efficiency issue. The scheduling principles adopted mainly include: minimizing the total execution cost of more than one task group, the total execution cost is determined at least based on the estimated execution time of more than one task group on the assigned computing unit, and is positively correlated with the estimated execution time of the more than one task group on the assigned computing unit. Among them, the estimated execution time of the task group on the assigned computing unit is essentially only related to the type of computing unit, and the estimated execution time of the task group on the computing unit of this type can be used.

[0111] For example, the total execution cost can be obtained from the execution cost of each task group. If task group i is assigned to computing unit X, the corresponding execution cost C1 can be expressed as:

[0112] C1=(m-1)×T+t (4)

[0113] Where n is the number of tasks contained in task group i, T is the average execution time of the task group on computing unit X (this type of computing unit), t is the execution time of task group i on computing unit X (this type of computing unit), and m represents the execution order of task group i on computing unit X. That is, the mth execution means that there are m-1 other task groups that need to be executed on computing unit X.

[0114] Furthermore, when scheduling resources for a task group, the constraints of the execution time conditions may also be considered. For example, it is possible to ensure that each task is completed within the deadline. Therefore, the above-mentioned total execution cost may also be determined according to the degree to which the execution time conditions corresponding to the one or more task groups are satisfied, wherein the execution time conditions corresponding to the task group are determined according to the execution time conditions corresponding to each task included in the task group.

[0115] In this case, the execution cost of each task group can further consider the cost C2, for example

[0116] C2=max(0,(m-1)×T+tD) (5)

[0117] Where D is the deadline of task group i, which can be the earliest deadline among the deadlines of the tasks included in the task group.

[0118] The value obtained by weighted summing the above C1 and C2 can be used as the execution cost C corresponding to the m-th execution of the task group i assigned to the computing unit X.

[0119] When determining the scheduling result, each task group is essentially assigned a "computing unit-execution order" combination. Therefore, the above scheduling problem is also transformed into a matching problem, matching the task group with the "computing unit-execution order" combination. The matching goal is to minimize the total execution cost. There are many matching methods that can be used. Here is a feasible method. First, construct a bipartite graph, such as Figure 2 As shown in , the nodes in the bipartite graph may include two parts: a first node set U and a second node set V. The nodes in the first node set represent each task group, and the nodes in the second node set represent a combination of a computing unit and an execution order. The edges in the bipartite graph connect the nodes in the first node set and the nodes in the second node set. The edges represent the execution cost of the task group corresponding to one endpoint on the computing unit corresponding to the other endpoint. The execution cost can be calculated in the above-mentioned manner, for example, the value obtained by weighted summation of the above C1 and C2. Then, a weighted matching algorithm is used to determine the edge set with the smallest total execution cost, that is, to solve the minimum weight maximum matching result. Then, based on each edge in the determined edge set, the computing unit corresponding to the other endpoint and the execution order are assigned to the task group corresponding to one endpoint of the edge.

[0120] It should be noted that the computing units assigned to the task group are usually idle computing units in the cluster (i.e., computing units with idle resources). After the scheduling result is determined through the above process, there may still be idle computing resources, which may be due to excessive combination of the tasks to be scheduled. In this case, some task groups can be split and some of the tasks obtained after the split can be assigned to idle computing units.

[0121] When determining whether there is an over-combination of tasks to be scheduled, the weight of the worst-performing computing unit among the computing units assigned to the tasks to be scheduled can be set to 1, and the weights of other computing units can be set to the performance ratio of the computing unit to the worst-performing computing unit. The weights of all assigned computing units are summed to obtain the total demand for computing units corresponding to this scheduling result. If the total demand for computing units corresponding to this scheduling result is less than the sum of the demands for computing units required by each task contained in the task information, it means that the tasks to be scheduled are over-combined. For example, the total demand for computing units corresponding to this scheduling result is 8 GPUs, and in the task information corresponding to the tasks to be scheduled, the sum of the computing units required by each task is 10 GPUs, which means that the tasks to be scheduled are over-combined.

[0122] When splitting a task group, the task group can be selected for splitting at any time. The execution efficiency of the task group can also be determined based on the estimated execution time of the task group on the assigned computing unit, and the split task group can be determined based on the execution efficiency. The execution efficiency of the task group can be reflected by the execution cost of the above-mentioned task group.

[0123] Since both step 103 and step 105 above involve the estimated execution time of the task group on the computing unit, the estimation method of the estimated execution time is described in detail below in conjunction with an embodiment.

[0124] Usually for each task, there may be one or more task stages. Taking model training as an example, since data acquisition (i.e., obtaining training data) and preprocessing are completed in independent processes and are not bottlenecks in training tasks, the various task stages that affect the execution time of model training mainly include the forward propagation stage, the reverse propagation stage, and the network communication stage, wherein the network communication stage is mainly the gradient synchronization performed with the main thread during the gradient synchronization process. In an embodiment of the present application, each task in the task group can be pre-executed on the computing unit for several rounds to determine the execution time of each task stage when each task is executed separately on the computing unit; then, the execution time of each task stage when each task is executed separately on the computing unit is used to estimate the estimated execution time of the concurrent interleaved execution of the task group on the computing unit. In an embodiment of the present application, the so-called concurrent interleaved execution refers to the concurrent execution of each task in the task group, and the task stages corresponding to each task are interleaved in time, which will be described in conjunction with examples later.

[0125] Since in the embodiment of the present application, each task in the task group shares the same computing unit, for example, each task in the task group is executed in a concurrent interleaved manner, which means that the computing resources used in one task stage will appear in other task stages. Therefore, when estimating the execution time of the task group on the computing unit, it is necessary not only to consider the execution time of each task stage when each task is executed separately on the computing unit, but also to consider the interference generated when each task in the task group uses the same resources in the same stage, and the impact of resource competition when each task has resource competition. As a feasible method, the execution time of each task stage when the task group is executed concurrently and interleaved on the computing unit can be estimated for each task stage. Taking one of the task stages i as an example, the execution time of the task stage i when each task in the task group is executed separately on the computing unit, the function call duration of each task, the resource synchronization time and resource competition information of the task group in the task stage i when the task group is executed concurrently and interleaved on the computing unit are estimated. Then, the execution time of each task stage when the task group is executed concurrently and interleaved on the computing unit is summed up to obtain the estimated execution time of the task group when it is executed concurrently and interleaved on the computing unit.

[0126] The following describes the above process using the model training task as an example. Since the timing of concurrent interleaving execution of the task group on the computing unit is predetermined, the following processing can be performed on each task group as the current task for each task stage according to the timing of concurrent interleaving execution of the task group on the computing unit to obtain the time-consuming parameter value corresponding to each task stage:

[0127] Assume that the current task stage is i and the current task is j, and use the larger value of the function call duration Sj of the current task and the value of the time parameter R to update the value of the time parameter R, where the initial value of the time parameter R is 0. Among them, the time parameter R is a variable used to determine the execution time of the task group in the task stage i. Since the events required for a task stage include at least the time for the main thread to make a function call, if the execution duration of the task stage i is greater than or equal to the function call duration Sj, it means that the main thread can complete the function call within the duration of R, and no additional waiting time will be added. Otherwise, the main thread cannot complete the function call within the duration of R, and the computing unit needs additional waiting time. Therefore, the larger value of the call duration Sj and R is first assigned to the time parameter R, that is, R←max(R,Sj). The time parameter R is initially 0 and is continuously updated subsequently.

[0128] Then the execution time Fj of the current task j in the current task stage i is superimposed with the first time fi,j, and the first time f is updated using the superimposed time i,j , that is, f i,j ←fi,j +F j Among them, the first time-consuming f i,j It is a variable, which is initially set to 0 and is continuously updated in the subsequent process.

[0129] by Figure 3 As shown in the example, Figure 3 The figure shows that two tasks (task 1 and task 2) are executed concurrently and interleaved on the same computing unit. Usually, a computing unit can only process one task at a time. For the forward propagation stage, Figure 3 As shown in, the execution time fi,j of the forward propagation phase of task 1 is Fj.

[0130] When resource synchronization is required in the current task stage i, the resource synchronization time is superimposed on the first time consumption fi,j, expressed as syncTime(fi,j), and then the larger value of the first time consumption and the time consumption parameter value is used to update the value of the time consumption parameter R, expressed as R←max(R,syncTime(fi,j)).

[0131] like Figure 3 As shown in , the computing resources are synchronized after executing the related calculations of the forward propagation of Task 2, and the resource synchronization time needs to be superimposed. The current time-consuming parameter R is the duration of the function call. If the first time-consuming time is still within R after the resource synchronization time is superimposed, R remains unchanged; if the first time-consuming time superimposed on the resource synchronization time exceeds R, R is updated using the first time-consuming time superimposed on the resource synchronization time.

[0132] In some practical processes, such as the characteristics of model training and deep learning training frameworks, the use of resources by different tasks cannot be completely isolated. Therefore, when estimating the execution time, it is necessary to consider the impact of resource competition between tasks. Resource competition refers to the situation where different tasks are executed on the same computing unit at the same time in terms of timing, such as Figure 3 As shown in , the forward propagation related calculations of task 1 and the back propagation related calculations of task 2 compete on the GPU. The interference caused by resource competition will cause additional overhead. Therefore, the interference coefficient can be used to correct the current time-consuming parameter R value and the first time-consuming fi,j.

[0133] Then continue to execute the above process for the next task in the task group, and the final R is used as the time-consuming parameter value of task stage i, recorded as Ri.

[0134] Repeat the above process for the next task stage i+1. Before performing the above estimation for the next task stage i+1, it is determined that the current time parameter R value exceeds the duration t of the first duration fi,j, which means that it is necessary to wait for a duration t in the next stage. Therefore, the duration t can be used as the initial execution duration f for the next task stage. i+1,j .

[0135] Get the time-consuming parameter R of three consecutive task stages i , R i+1 and R i+2 After R i , R i+1 and R i+2 In fact, it represents the execution time of the three task stages when the task group is executed concurrently and interleaved on the computing unit. The sum is taken as the estimated execution time T when the task group is executed concurrently and interleaved on the computing unit. That is, T←R i +R i+1 +R i+2 .

[0136] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0137] To facilitate the understanding of the entire technical solution, here is a simple example:

[0138] Assume that the multiple tasks to be scheduled include: Task 1, Task 2, Task 3, Task 4, Task 5 and Task 6, and the idle GPUs in the cluster include GPU1, GPU2 and GPU3, where GPU1 and GPU2 belong to type a, and GPU3 belongs to type b.

[0139] Pre-execute each task on type a GPU and type b GPU for several rounds to obtain the execution time of each task stage of each task on each type of GPU, so as to estimate the execution time of the task group. For example, after combining the tasks in pairs, the estimated execution time of each task group on each type of GPU is obtained.

[0140] For each task group, the GPU with the shortest estimated execution time can be used as the reference type computing unit. Based on the estimated execution time of each task group on the reference type computing unit and the similarity of the deadlines of the tasks in the task group, the matching weight corresponding to each task group is determined. Each task is used as a node, and the matching weights between tasks are used as the edges between nodes to construct an undirected graph. The flower tree algorithm is used for search and matching, and each task group is obtained according to the matching results, such as task group 1 (task 1 and task 3), task group 2 (task 2 and task 5), and task group 3 (task 3 and task 4).

[0141] Then a bipartite graph is constructed. The first node set in the bipartite graph includes nodes for each task group, that is, it includes three nodes; the second node set in the bipartite graph includes nodes for combinations of "GPU-execution order", for example, a node is "GPU1-1st execution", indicating that the task group is the first to be executed on GPU1. Another example is that a node is "GPU1-2nd execution", indicating that the task group is the second to be executed on GPU1. There is an edge between the nodes in the first node set and the nodes in the second node set, indicating the execution cost of the task group executing in the execution order on the computing node. The execution cost is determined by the corresponding estimated execution time and the degree to which the deadline is met. A weighted matching algorithm is used to determine the matching result with the minimum total execution cost.

[0142] For example:

[0143] Task Group 1 (Task 1 and Task 3) - "GPU1 - 1st execution"

[0144] Task Group 2 (Task 2 and Task 5) - "GPU1 - 2nd execution"

[0145] Task Group 3 (Task 3 and Task 4) - "GPU2 - 1st execution"

[0146] Since there is still an idle resource GPU3, the task group with poor performance can be split. Assuming that the task group 3 has the highest execution cost, task group 3 can be split and task 4 can be transferred to GPU3 for execution, thereby making better use of computing resources.

[0147] In order to verify the effect of the task scheduling method provided in the embodiment of the present application, the task scheduling method provided in the present application is compared with the traditional method. A resource scheduling system that also uses parallel interleaved execution of task groups is selected from the resource scheduling system using the traditional method, and its scheduling method is recorded as scheduling method 1, and the task scheduling method provided in the embodiment of the present application is recorded as scheduling method 2. Experiments were conducted based on the same model training scenario, and the experimental results obtained are shown in Table 1.

[0148] Table 1

[0149] method Method 2 Method 1 Average completion time of the task (the completion time of the method used in this application is taken as 1) 1.00 1.05 The rate at which tasks meet their deadlines 78.66% 62.07%

[0150] It can be seen that the task scheduling method provided in the embodiment of the present application is about 5% shorter in average completion time than the method adopted by the traditional task scheduling system, and the deadline satisfaction rate is also significantly improved.

[0151] In addition, by comparing the number of remaining queued tasks between Method 1 and Method 2, when Method 2 adopted in the embodiment of the present application performs scheduling in a cluster, the number of remaining queued tasks is less than that of Method 1 adopted by the traditional scheduling system in most of the time.

[0152] Further comparing method 1 and method 2 in terms of the number of tasks exceeding the deadline, method 2 adopted in the embodiment of the present application has a smaller number of jobs exceeding the deadline when the number of jobs in queue is large.

[0153] Figure 4 A schematic diagram of a task scheduling system provided in an embodiment of the present application, such as Figure 4 As shown in , the task scheduling system 400 includes: an interface service device 410 , a task coordination device 420 , a task scheduling device 430 and a task group coordination device 440 .

[0154] The interface service device 410 is configured to receive task information from the user and submit the task information to the task coordination device. The interface service device 410 may be, for example, an API server, which provides an interface for the user, through which the user can declare the task, that is, submit the task information.

[0155] The task coordination device 420 is configured to submit the corresponding task to the queue to be scheduled according to the task information. The task coordination device 420 can be, for example, a task reconciler. In this process, the interface service device 410 can submit a task to the task coordination device 420, and the task coordination device 420 creates a profile task to trigger the interface service device 410 to parse the task information and obtain task related information therefrom. The interface service device 410 updates the task status using the task related information, and the task can be used as a task to be scheduled. The task coordination device 420 submits the task to the queue to be scheduled.

[0156] The task scheduling device (JobPack Operator) 430 is configured to execute the resource scheduling method provided by the embodiment of the present application. It mainly includes: obtaining multiple tasks to be scheduled from the queue to be scheduled; combining multiple tasks to obtain more than one task group to maximize the sum of the matching weights of each task group, wherein the matching weight of the task group is determined at least according to the estimated execution time of the task group on the computing unit of the reference type, and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type, and the reference type is at least one of the computing unit types contained in the cluster; determining the scheduling results for more than one task group respectively, and the scheduling results include the computing units assigned to the task group; submitting the scheduling results (JobPack) to the task group coordination device via the interface service device 410.

[0157] The JobPack Reconciler 440 is configured to schedule the computing unit to execute the multiple tasks to be scheduled using the scheduling results.

[0158] The above-mentioned interface service device 410, task coordination device 420, task scheduling device 430 and task group coordination device 440 can all be set on the server side, can be set on an independent server respectively, or can be set on a server group composed of multiple servers. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak service scalability in traditional physical hosts and virtual private servers (VPS, Virtual Private Server) services.

[0159] Figure 5 A schematic block diagram of a task scheduling device provided in an embodiment of the present application, such as Figure 5 As shown in , the task scheduling device 430 may include: a task acquisition unit 431, a task combination unit 432 and a resource allocation unit 433, and may further include a duration estimation unit 434. The main functions of each component unit are as follows:

[0160] The task acquisition unit 431 is configured to acquire a plurality of tasks to be scheduled.

[0161] The task combination unit 432 is configured to combine multiple tasks to obtain more than one task group to maximize the sum of the matching weights of each task group, wherein the matching weight of the task group is determined at least according to the estimated execution time of the task group on the computing unit of the reference type, and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type, and the reference type is at least one of the computing unit types included in the cluster.

[0162] The resource allocation unit 433 is configured to determine scheduling results for the one or more task groups respectively, and the scheduling results include computing units allocated to the task groups.

[0163] As one of the achievable methods, the task combination unit 432 can be further configured to: determine the estimated execution time of the task group on each type of computing unit included in the cluster; use the computing unit with the shortest estimated execution time as the computing unit of the reference type corresponding to the task group; and determine the matching weight of the task group based on the estimated execution time of the task group on the computing unit of the reference type.

[0164] Furthermore, the task combination unit 432 can further determine the matching weight of the above task group according to the similarity of the execution time conditions corresponding to the tasks included in the task group, and the matching weight of the task group is positively correlated with the similarity of the execution time conditions corresponding to the tasks included in the task group.

[0165] As one of the achievable methods, the task combination unit 432 can be specifically configured as follows: constructing an undirected graph, the undirected graph including nodes and edges, the nodes representing tasks, the edge between two nodes representing the matching weights of the two nodes constituting a task group; using a search algorithm to search the undirected graph to obtain an edge set with the largest sum of matching weights, the edge set containing non-intersecting edges; determining the node combinations corresponding to each edge in the edge set as task groups, and determining the remaining nodes in the undirected graph as separate task groups.

[0166] As one of the achievable methods, when the resource allocation unit 433 determines the scheduling results for the above-mentioned one or more task groups respectively, it can be specifically configured as: allocating computing units to the above-mentioned one or more task groups from the cluster to minimize the total execution cost of the above-mentioned one or more task groups, the total execution cost is determined at least based on the estimated execution time of the above-mentioned one or more task groups on the allocated computing units, and is positively correlated with the estimated execution time of the above-mentioned one or more task groups on the allocated computing units.

[0167] Furthermore, the scheduling result also includes the execution order of the task groups on the assigned computing units. The total execution cost is also determined according to the degree to which the execution time conditions corresponding to the above-mentioned one or more task groups are satisfied, wherein the execution time conditions corresponding to the task groups are determined according to the execution time conditions corresponding to the tasks included in the task groups.

[0168] As one of the achievable methods, the resource allocation unit 433 can be specifically configured as: constructing a bipartite graph, the bipartite graph including a first node set, a second node set and edges, the nodes in the first node set respectively represent task groups, the nodes in the second node set represent a combination of computing units and execution orders, the execution order is the execution order of the task groups on the computing units, the two endpoints of the edge are respectively the nodes in the first node set and the nodes in the second node set, the edge represents the execution cost of the task group corresponding to one endpoint on the computing unit corresponding to the other endpoint; using a weighted matching algorithm to determine the edge set with the minimum total execution cost; according to each edge in the edge set, allocating the computing unit corresponding to the other endpoint and the execution order to the task group corresponding to one endpoint of the edge.

[0169] Furthermore, the resource allocation unit 433 can be further configured to: after allocating computing units to the above-mentioned one or more task groups, if the cluster also includes idle computing units, split some of the task groups and allocate some of the tasks obtained after the split to the idle computing units.

[0170] As one of the implementable ways, the resource allocation unit 433 may determine the execution efficiency of each task group according to the estimated execution time of the above-mentioned one or more task groups on the allocated computing unit; and determine the task group to be split according to the execution efficiency.

[0171] As one of the implementable ways, the duration estimation unit 434 may be configured to determine the estimated execution duration of the task group on the computing unit in the following way:

[0172] Pre-execute each task in the task group on the computing unit for several rounds to determine the execution time of each task stage when each task is executed separately on the computing unit;

[0173] The execution time of each task stage when each task is executed separately on the computing unit is used to estimate the estimated execution time of the task group during concurrent interleaved execution on the computing unit. The concurrent interleaved execution includes concurrent execution of each task in the task group, and the task stages corresponding to each task are interleaved in time.

[0174] As one of the implementable ways, the duration estimation unit 434 estimates the estimated execution duration of the task group during concurrent interleaved execution on the computing unit by using the execution duration of each task stage when the task is executed separately on the computing unit, and can be specifically configured as follows:

[0175] According to the execution time of each task stage when each task in the task group is executed separately on the computing unit, the function call duration of each task, the resource synchronization time and resource competition information of each task stage when the task group is executed concurrently and staggered on the computing unit, the execution time of each task stage when the task group is executed concurrently and staggered on the computing unit is estimated respectively;

[0176] The execution time of each task stage when the task group is executed concurrently and interleaved on the computing unit is summed up to obtain the estimated execution time when the task group is executed concurrently and interleaved on the computing unit.

[0177] As one of the implementable ways, the duration estimation unit 434 can be specifically configured as follows when estimating the execution duration of each task stage when the task in the task group is executed concurrently and interleaved on the computing unit, based on the execution duration of each task stage when each task in the task group is executed separately on the computing unit, the function call duration of each task, and the resource synchronization time and resource competition information of each stage when the task group is executed concurrently and interleaved on the computing unit:

[0178] According to the timing of concurrent interleaving execution of the task group on the computing unit, for each task stage, each task in the task group is sequentially processed as the current task execution, and the time-consuming parameter value corresponding to each task stage is obtained, and the time-consuming parameter value obtained in each task stage is respectively used as the execution duration of each task stage when the task group is concurrently interleaved on the computing unit; wherein, the processing of the current task execution includes:

[0179] The time-consuming parameter value is updated using the larger value of the function call duration of the current task and the time-consuming parameter value, wherein the initial time-consuming parameter value of each task is 0;

[0180] The execution time of the current task in the current task phase is superimposed with the first time consumption, and the first time consumption is updated using the superimposed time consumption, wherein the initial first time consumption value is 0;

[0181] When resource synchronization is required in the current task phase, the resource synchronization time is superimposed on the first time consumption, and then the time consumption parameter value is updated using the larger value of the first time consumption and the time consumption parameter value;

[0182] When there is resource competition between task groups in the current stage, the interference coefficient is used to correct the current time parameter value and the first time respectively; the duration by which the current time parameter value exceeds the first time is used to obtain the initial execution duration used in the next stage.

[0183] As one of the feasible ways, the above task is a model training task, the above task stages include: a forward propagation stage, a back propagation stage and a network communication stage, and the above computing unit includes a GPU.

[0184] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0185] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0186] In addition, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods in the aforementioned method embodiments are implemented.

[0187] And an electronic device, comprising:

[0188] one or more processors; and

[0189] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of the aforementioned method embodiments.

[0190] The present application also provides a computer program product, including a computer program, which implements the steps of any one of the methods in the aforementioned method embodiments when executed by a processor.

[0191] in, Figure 6The architecture of the electronic device is shown as an example, which may include a processor 610, a video display adapter 611, a disk drive 612, an input / output interface 613, a network interface 614, and a memory 620. The processor 610, the video display adapter 611, the disk drive 612, the input / output interface 613, the network interface 614, and the memory 620 may be communicatively connected via a communication bus 630.

[0192] Among them, the processor 610 can be implemented by a general-purpose CPU, a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., to execute relevant programs to implement the technical solutions provided in this application.

[0193] The memory 620 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 620 can store an operating system 621 for controlling the operation of the electronic device 600, and a basic input and output system (BIOS) 622 for controlling the low-level operation of the electronic device 600. In addition, a web browser 623, a data storage management system 624, and a task scheduling device 430, etc. can also be stored. The above-mentioned task scheduling device 430 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided by the present application is implemented by software or firmware, the relevant program code is stored in the memory 620 and is called and executed by the processor 610.

[0194] The input / output interface 613 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0195] The network interface 614 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0196] The bus 630 comprises a pathway for transmitting information between the various components of the device (eg, the processor 610, the video display adapter 611, the disk drive 612, the input / output interface 613, the network interface 614, and the memory 620).

[0197] It should be noted that, although the above device only shows a processor 610, a video display adapter 611, a disk drive 612, an input / output interface 613, a network interface 614, a memory 620, a bus 630, etc., in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.

[0198] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a computer program product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0199] The technical solution provided by the present application is described in detail above. The principle and implementation method of the present application are described in detail using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A task scheduling method, applied to a cluster including multiple computing units; characterized in that: The method comprises: Get multiple tasks to be scheduled; Combining the multiple tasks to obtain more than one task group to maximize the sum of matching weights of the task groups, wherein the matching weight of the task group is determined at least according to an estimated execution time of the task group on a computing unit of a reference type and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type, wherein the reference type is at least one of the computing unit types included in the cluster; Scheduling results are determined for the one or more task groups respectively, wherein the scheduling results include computing units allocated to the task groups.

2. The method according to claim 1, characterized in that The matching weight of the task group is determined based on at least the estimated execution time of the task group on the computing unit of the reference type, including: Determine the estimated execution time of each task group on each type of computing unit included in the cluster; The computing unit with the shortest estimated execution time is used as the computing unit of the reference type corresponding to the task group; A matching weight of the task group is determined according to an estimated execution time of the task group on a computing unit of a reference type.

3. The method according to claim 1, characterized in that: The matching weight of the task group is also determined according to the similarity of the execution time conditions corresponding to the tasks included in the task group, and is positively correlated with the similarity of the execution time conditions corresponding to the tasks included in the task group.

4. The method according to any one of claims 1 to 3, characterized in that Combining the multiple tasks to obtain more than one task group includes: Constructing an undirected graph, the undirected graph comprising nodes and edges, the nodes representing tasks, and the edges between two nodes representing matching weights of the task groups formed by the two nodes; Searching the undirected graph to obtain an edge set with the maximum sum of matching weights, wherein the edge set includes mutually non-intersecting edges; The node combinations corresponding to the edges in the edge set are respectively determined as task groups, and the remaining nodes in the undirected graph are respectively used as task groups.

5. The method according to claim 1, characterized in that Determining scheduling results for the one or more task groups respectively includes: Computing units are allocated to the one or more task groups from the cluster to minimize a total execution cost of the one or more task groups on the allocated computing units, wherein the total execution cost is determined at least based on an estimated execution time of the one or more task groups on the allocated computing units and is positively correlated with the estimated execution time of the one or more task groups on the allocated computing units.

6. The method according to claim 5, characterized in that The scheduling result also includes the execution order of the task groups on the assigned computing units; The total execution cost is also determined according to the extent to which the execution time conditions corresponding to the one or more task groups are satisfied, wherein the execution time conditions corresponding to the task group are determined according to the execution time conditions corresponding to each task included in the task group.

7. The method according to claim 6, characterized in that Determining scheduling results for the one or more task groups respectively includes: Constructing a bipartite graph, the bipartite graph comprising a first node set, a second node set and an edge, the nodes in the first node set respectively represent task groups, the nodes in the second node set represent a combination of computing units and execution orders, the execution order is the execution order of the task groups on the computing units, the two endpoints of the edge are respectively a node in the first node set and a node in the second node set, and the edge represents an execution cost of the task group corresponding to one endpoint on the computing unit corresponding to the other endpoint; Use a weighted matching algorithm to determine the edge set with the minimum total execution cost; According to each edge in the edge set, a computing unit corresponding to another endpoint and an execution order are allocated to a task group corresponding to one endpoint of the edge.

8. The method according to claim 1, characterized in that: The method further comprises: After computing units are allocated to the one or more task groups, if the cluster further includes idle computing units, some of the task groups are split, and some of the tasks obtained after the splitting are allocated to the idle computing units.

9. The method according to claim 8, characterized in that The splitting of some task groups includes: Determining the execution efficiency of each task group according to the estimated execution time of the one or more task groups on the assigned computing units; The task groups to be split are determined based on execution efficiency.

10. The method according to any one of claims 1 to 3, 5, 6, 8 and 9, characterized in that The estimated execution time of a task group on a compute unit is determined as follows: Pre-execute each task in the task group on the computing unit for several rounds to determine the execution time of each task stage when each task is executed separately on the computing unit; The execution duration of each task stage when each task is executed individually on the computing unit is used to estimate the estimated execution duration of the task group when it is executed concurrently and interleaved on the computing unit. The concurrent and interleaved execution includes concurrent execution of each task in the task group, and the task stages corresponding to each task are interleaved in time.

11. The method according to claim 10, characterized in that Using the execution time of each task stage when the task is executed individually on the computing unit, estimating the estimated execution time of the task group when it is executed concurrently and interleaved on the computing unit includes: According to the execution time of each task stage when each task in the task group is executed separately on the computing unit, the function call duration of each task, the resource synchronization time and resource competition information of each task stage when the task group is executed concurrently and staggered on the computing unit, the execution time of each task stage when the task group is executed concurrently and staggered on the computing unit is estimated respectively; The execution duration of each task stage when the task group is executed concurrently and interleaved on the computing unit is summed to obtain an estimated execution duration when the task group is executed concurrently and interleaved on the computing unit.

12. The method according to claim 11, characterized in that The method of estimating the execution duration of each task stage when each task in the task group is executed separately on the computing unit, the function call duration of each task, the resource synchronization time and resource competition information of each stage when the task group is executed concurrently and interleaved on the computing unit, comprises: According to the timing of concurrent interleaved execution of the task group on the computing unit, for each task stage, each task in the task group is sequentially processed as the current task execution, and the time-consuming parameter value corresponding to each task stage is obtained, and the time-consuming parameter value obtained in each task stage is respectively used as the execution duration of each task stage when the task group is concurrently interleaved on the computing unit; wherein the processing of the current task execution includes: The time-consuming parameter value is updated using the larger value of the function call duration of the current task and the time-consuming parameter value, wherein the initial time-consuming parameter value of each task is 0; The execution time of the current task in the current task phase is superimposed with the first time consumption, and the first time consumption is updated using the superimposed time consumption, wherein the initial first time consumption is 0; In the case where resource synchronization is required in the current task phase, the resource synchronization time is superimposed on the first time consumption, and then the time consumption parameter value is updated using the larger value of the first time consumption and the time consumption parameter value; In the case of resource competition between task groups at the current stage, the interference coefficient is used to correct the current time-consuming parameter value and the first time-consuming value respectively; The initial execution duration used in the next stage is obtained by using the current time-consuming parameter value exceeding the first time-consuming duration.

13. A task scheduling device, characterized in that: The device comprises: A task acquisition unit, configured to acquire a plurality of tasks to be scheduled; a task combining unit configured to combine the plurality of tasks to obtain more than one task group to maximize the sum of matching weights of the task groups, wherein the matching weight of the task group is determined at least according to an estimated execution time of the task group on a computing unit of a reference type, and is negatively correlated with the estimated execution time of the task group on the computing unit of the reference type, wherein the reference type is at least one of the computing unit types included in the cluster; The resource allocation unit is configured to determine scheduling results for the one or more task groups respectively, and the scheduling results include computing units allocated to the task groups.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

15. An electronic device, characterized in that: include: one or more processors; as well as A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of claims 1 to 12.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.