A cluster job scheduling method and system

By introducing normal and special scheduling modes on the computing cluster, and combining reinforcement learning and resource optimization, the efficiency and fairness issues of scheduling strategies under resource constraints are solved, and efficient and fair job scheduling is achieved.

CN119621272BActive Publication Date: 2025-11-04CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +3

Patent Information

Application Number
CN202411693800.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-11-04
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

On resource-constrained computing clusters, existing scheduling strategies struggle to balance efficiency and fairness. Long-tail jobs may experience excessively long waiting times due to resource constraints, impacting user experience.

Method used

A combination of normal scheduling mode and special scheduling mode is adopted. The normal scheduling mode optimizes resource allocation through reinforcement learning model to minimize the average job completion time, while the special scheduling mode detects long-tail jobs and prioritizes resource allocation to speed up their completion. Switching scheduling modes achieves a balance between efficiency and fairness.

Benefits of technology

While ensuring system efficiency, it significantly reduces the completion time of long-tail jobs, improves scheduling fairness, and reduces the standard deviation of job completion time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621272B_ABST
    Figure CN119621272B_ABST
Patent Text Reader

Abstract

The application discloses a kind of cluster job scheduling method and system, the computing job submitted by user is modeled as directed acyclic graph DAG, to convert real-time scheduling problem into the allocation problem between resource and DAG.The application includes two scheduling modes of normal scheduling and special state scheduling, to realize efficiency target and fair target respectively.The normal scheduling mode is based on graph neural network, job information is collected from local to whole, and these information is input to reinforcement learning model, to give scheduling decision of minimizing average job completion time.The special state scheduling mode detects long tail job according to the statistical law of job execution time in real time, and carries out special optimization for long tail job, to reduce long tail job completion time by preferentially allocating resources for it.The scheduling system is converted between the two scheduling modes, to achieve the trade-off between efficiency and fairness.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cluster task scheduling and reinforcement learning, and particularly relates to a cluster job scheduling method and system. BACKGROUND

[0002] In recent years, with the popularity of mobile devices, the improvement of software ecology and the continuous progress of Internet communication technology, society has entered the era of big data. Under such background, computing clusters integrate and share the resources of multiple computing devices, transfer information between devices through communication networks, strive to achieve reasonable allocation of resources, and improve the execution efficiency of computing tasks. In fact, computing clusters have become one of the important methods for processing computing tasks in the era of big data.

[0003] On a computing cluster, a scheduler plays an important role in managing and distributing system resources and scheduling user job execution. According to whether useful information is extracted from the job, the scheduling strategy can be divided into two categories: traditional static strategy and content-aware dynamic strategy.

[0004] The first category is the traditional static scheduling strategy, including first-come-first-served (i.e., allocating resources in the order of arrival time of the cluster), shortest job first (i.e., jobs with shorter expected execution time are preferentially scheduled), and fair scheduling (i.e., all jobs equally share all resources). Their characteristics are that they do not need to consider specific data distribution and structure, but use pre-established rules to deal with different jobs. The great benefit is that the cost of strategy development is low, reducing the workload of modification and debugging, but the generalization is not high enough. In the case of limited resources and numerous user requests, it is difficult to avoid affecting the overall performance of the system. For example, using the shortest job first scheduling strategy, if some shorter jobs are continuously requested after the arrival of a long job, the long job will be unable to obtain resources for a long time.

[0005] The second category is the content-aware dynamic scheduling strategy. This way extracts useful information from the job, such as execution phase characteristics and data dependency, to help develop strategies that meet high-level optimization goals. By understanding the information of each computing task itself, the scheduler can start from a more macro perspective, comprehensively consider the current resource and job situation in the system, focus on the global system, fully utilize limited resources, and give a scheduling method close to the optimal solution. Although this strategy can achieve good results, it requires a lot of domain knowledge and time and effort for manual fine-tuning, which is difficult and has poor generalization.

[0006] According to the analysis of the current signature inventor on the current cluster job scheduling, it is found that there are still the following problems: (1) the resource limitation problem on the cluster. Due to the increase of data size, there is also a resource limitation in the computing cluster, that is, the resources available in the current system cannot meet the needs of all computing tasks at the same time. At this time, the contradiction between resources and needs makes it a challenge to complete the real-time scheduling of data processing jobs on the distributed computing cluster. (2) The efficiency requirement of scheduling. Each user hopes that his computing request can be responded quickly, which requires the system to have a large throughput, so the average completion time of the job needs to be as small as possible, and the user's request should not wait for too long. (3) The fairness requirement of scheduling. In some busy period, the computing cluster may receive a large number of user requests with different structures and different needs in a short time, and due to the resource limitation, the system is difficult to reasonably allocate the available resources while ensuring fairness, which may cause some jobs to be in the state of waiting for scheduling, and even because of the emergence of jobs with higher priority, it may fall into "starvation", which will seriously affect the user experience of some users.

[0007] Therefore, there is an urgent need for a scheduling strategy that takes into account efficiency and fairness on a resource-limited computing cluster. SUMMARY

[0008] The purpose of the present application is to provide a cluster job scheduling method and system, which optimizes the execution of long jobs in the case of as small as possible average completion time of the job and as large as possible system throughput, so as to achieve the trade-off between efficiency and fairness.

[0009] In order to solve the above technical problems, the present application provides the following technical scheme: a cluster job scheduling method, including two scheduling modes of normal scheduling and special scheduling, the normal scheduling mode is used for long-term real-time processing of computing job information to be scheduled, and a scheduling execution decision is given, and the special scheduling mode is used for optimizing long-tail jobs.

[0010] Among them, the normal scheduling mode includes:

[0011] An information representation module represents the computing job in the form of a directed acyclic graph (DAG), each node of the DAG corresponds to a stage of the job, and each directed edge corresponds to the dependency relationship between stages.

[0012] An information extraction module extracts graph embedding information from a directed acyclic graph (DAG) structure of a computing job, the graph embedding information including three dimensions, one of which is single-node embedding information representing information of each node itself and all child nodes thereof, one of which is single-job embedding information representing overall information of each job, and the other of which is global embedding information representing overall information between jobs;

[0013] A scheduling decision module gives a scheduling decision of minimizing average job completion time according to job information globally and locally by using a reinforcement learning model on the extracted graph embedding information, and submits the scheduling decision to a cluster in the form of a binary tuple including a job node to be scheduled and a corresponding parallel limit.

[0014] The normal scheduling mode is further configured to efficiently divide resources in the case of insufficient system resources, concentrate resources to complete jobs with early arrival times, and virtualize actual information in the system, so that the normal scheduling mode only needs to consider at most N jobs, efficiently executes by using the information extraction and scheduling decision modules, and thus guarantees that the cluster system minimizes average job completion time as much as possible in a resource-limited scenario.

[0015] The special scheduling mode includes:

[0016] A long job detection module is configured to approximately estimate execution time of a job according to a statistical law of estimated execution time of the job, detect whether a long-tail job appears in the system according to the approximately estimated execution time of the job, and switch the system from the normal scheduling mode to the special scheduling mode after detecting the long-tail job, specifically including: summing up estimated execution times of each stage carried by the job itself as the estimated execution time of the job, comparing the estimated execution time with a set long-tail job execution time threshold T, and determining the job as a long-tail job and switching to the special scheduling mode for preferentially scheduling the long-tail job for execution once the threshold is exceeded.

[0017] A resource division module is configured to dynamically divide available resources according to actual available resource conditions in the system after detecting the long-tail job, and allocate resources for the long-tail job.

[0018] A long job preferential scheduling module is configured to preferentially schedule the detected long-tail job, and switch the system from the special scheduling mode to the normal scheduling mode after the long-tail job is completed.

[0019] The execution time of the approximate estimation of the long job detection module is based on the execution time distribution of a large number of jobs in an actual system, and the number of long tail jobs is small in statistical law, and the execution time is long, so the approximate estimation can be used to detect the long tail job. The long tail job refers to those jobs that occur accidentally but have very long execution time, such as jobs exceeding 99th percentile JCT, which generally have large data scale to query and have the longest actual completion time. If the long tail job completion time is too different from the average JCT, it means that the corresponding scheduling execution may ignore fairness.

[0020] The special state scheduling mode is used to optimize the long tail job completion time to ensure fairness. For the measurement of fairness, two indicators are used, which are the standard deviation of the completion time of all jobs and the ratio of the long tail job completion time to the average JCT. The smaller the standard deviation and the ratio, the smaller the difference between the completion time of each job, that is, the better the fairness.

[0021] The scheduling method is suitable for job scheduling of a resource limited system, and switches between a normal scheduling mode and a special scheduling mode to fully utilize computing and storage resources, and considers efficiency and fairness. The resource limited system is used to represent the situation that computing and storage resources cannot simultaneously meet the needs of all jobs in an actual production environment. The normal scheduling mode is used to reduce the average completion time of all jobs to achieve the efficiency target; and the special scheduling mode is used to reduce the completion time of long tail jobs to achieve the fairness target.

[0022] According to the above technical solution, each node of the DAG in the information representation module of the normal scheduling mode is a serial task sequence, and the DAG representation of each job contains the estimated execution time of each task, which provides a basis for the approximate estimation of the long job detection module of the special scheduling mode.

[0023] The information representation module of the normal scheduling mode also provides part of the attribute information of each node, which includes but is not limited to the number of tasks to be executed in the node, and the expected execution time of each task.

[0024] According to the above technical solution, the graph embedding information includes single node embedding information, single job embedding information and global embedding information.

[0025] The single node embedding stores information from the node and all its child nodes; the single job embedding aggregates the information of the entire DAG; on this basis, combined with the embedding information of each job, the cluster information is obtained, and the global embedding is integrated. The information stored in these embedding vectors is not hard coded, but determined by the system itself in the learning process.

[0026] Single-node embedding information is used to describe the aggregation information of a certain node itself and all its child nodes in the DAG, and the top-down access order is adopted to calculate layer by layer from the leaf nodes of the DAG. In each step of the message passing process of the graph neural network, if all the child nodes of the current node v to be calculated have completed the integration of information, the embedding information of the node v is calculated according to the embedding vectors of all the child nodes.

[0027] Single-job embedding information is used to describe the overall information of a certain job corresponding to the DAG. A sink point t is additionally added for each DAG, and a directed edge is added between each original node and t, that is, each original node is a child node of t. The sink point t is used to collect and aggregate the information of each node. The embedding information of each job is represented by y i .

[0028] Global embedding information is used to describe the overall information reflected by the DAG corresponding to all jobs in the current system. In addition to the sink point t added in the single-job embedding information, a super sink point r is additionally added, and a directed edge is added between each sink point t and r, that is, each sink point t is a child node of r. The super sink point r is used to collect and aggregate the information of each job, and is represented by z.

[0029] According to the above technical solution, it is assumed that is the directed acyclic graph G i corresponding to the i-th job, and x is the original attribute vector of node v in G

[0030] .

[0031] wherein, represents the embedding vector of node v, f1(.) and g1[.] are nonlinear transformation functions for vectors, realized by a neural network; ξ(v) represents the set of child nodes of node v; g1[.] represents the summary of the embedding information of the child nodes, represents the own attributes of node v;

[0032] The single-job embedding vector calculation formula is: wherein represents the embedding vector of node u in job i, f2(.) and g2[.] are nonlinear transformation functions for vectors;

[0033] The global embedding vector calculation formula is: z = g3[∑ i f3(y i )], wherein y i represents the single-job embedding vector of job i, f3(.) and g3[.] are nonlinear transformation functions for vectors.

[0034] According to the technical solution, the execution step of the reinforcement learning model comprises:

[0035] The scheduling decision is encoded as a binary tuple (s, limit), wherein s represents the next scheduled stage, that is, the node in the corresponding DAG; limit represents the upper limit of the resources available to the job in which s is located;

[0036] The next scheduled stage s is selected, and the scheduling score of each currently schedulable execution node v is calculated using the scoring function q using the already calculated graph embedding information in the three dimensions The scoring function q is implemented by a neural network and is used to map the embedding vectors to scalar values, accepts 3 parameters as input, and the 3 parameters are the single-node embedding information of the stage v The single-job embedding information y of the job in which the stage v is located i And the global embedding information z, and outputs the corresponding scheduling score; the scheduling score is used to represent the priority of scheduling v for execution next time, and the greater the score, the greater the probability of being selected for scheduling;

[0037] After calculating the scheduling scores of all schedulable execution nodes v, the probability of the node v being the next scheduled node is calculated through a softmax operation, and the one with the maximum probability s is selected for execution;

[0038] The parallelism limit is selected, and the parallelism score of the resource limit l of each job is calculated using the scoring function w, which is implemented by a neural network and is used to map the embedding vectors to scalar values, accepts 3 parameters as input, and the 3 parameters are the single-job embedding information y i , the global embedding information z, and the parallelism l of the corresponding job, and outputs the corresponding parallelism score; the parallelism score is used to represent the priority of allocating a certain number of resources to a job, and the greater the score, the greater the probability of allocating the corresponding number of resources;

[0039] After calculating the parallelism scores of each job, the probability of selecting the parallelism is calculated through a softmax operation, and according to the already selected scheduling execution node s, the job i in which it is located is found, and the resource limit limit of the job i with the maximum probability is selected.

[0040] According to the technical solution, the probability formula of the node v being the next scheduled node is:

[0041]

[0042] Wherein, P(node=v) represents the probability of the node v being the next scheduled node, ζ t is the set of all schedulable nodes, This represents the scheduling score of node v in job i. Let j(u) represent the scheduling score of schedulable node u, where j(u) is the job to which node u belongs.

[0043] According to the above technical solution, the reinforcement learning model uses the policy gradient algorithm to update the parameters of the neural network using gradient descent, and both the graph neural network and the policy network are differentiable; during training, the reinforcement learning agent updates its own parameters as follows:

[0044]

[0045] Where α is the learning rate, T is the number of decisions, and π is the number of decisions made. θ (s k ,a k ) indicates that when the parameter is θ, in state s k Take action a k The probability, k represents a certain decision round, s k This indicates the state of the current round, a. k This indicates the actions taken in this round. This indicates the gradient of r with respect to θ. k′ b represents the reward obtained from each action taken in the future rounds. k It is a baseline value used to reduce policy gradient discrepancies.

[0046] To learn a comprehensive and reliable scheduling policy, the reinforcement learning model is trained using continuously arriving jobs. However, since the parameters of the policy network are randomly generated in the early stages of training, the policy given by the reinforcement learning agent at this time lacks generalization ability and does not have good performance, making efficient scheduling impossible. The idea of ​​course learning is adopted to continuously improve the generalization ability of the model and save training time. Specifically, the training is terminated earlier in the first few rounds, and the training length is gradually increased in subsequent training rounds, allowing the parameters of the reinforcement learning agent to be gradually optimized, thereby gradually adapting to increasingly complex scheduling situations.

[0047] According to the above technical solution, the resource allocation module of the special scheduling mode dynamically allocates the existing available resources on the cluster. Each job can obtain the same maximum number of resources. The resource allocation module prioritizes allocating resources to long jobs until the long jobs reach the resource limit or there are no available resources in the system. The specific execution steps include:

[0048] 1) Assuming the total resources are n, the currently available resources are f, and the number of unfinished jobs is U, then following the principle of fairness, the maximum amount of resources that each job can be allocated is:

[0049]

[0050] 2) For each long tail job in the system, allocate resources preferentially, assuming that the amount of resources allocated to a long tail job is cur, if cur < limit, it means that the long tail job can continue to allocate resources, and the long tail job continues to allocate the updated amount of resources:

[0051] cur <- min(limit, f);

[0052] The above formula means that the long tail job reaches the upper limit limit of the allocatable resources, or allocates all available resources f, and the function min(.) represents the minimum value of the two;

[0053] 3) If there is still available resource after the long tail job allocates resources, the remaining available resource is allocated to other jobs;

[0054] 4) Repeat steps 2) and 3) until the resource allocation is completed.

[0055] According to the technical solution, the long job priority scheduling module of the special scheduling mode is also used to encode the strategy given by the resource division module into the form of a binary tuple, so as to be compatible with the scheduling decision module of the normal scheduling mode, thereby improving the stability of system operation and the compatibility of the system.

[0056] Another embodiment is also included, the cluster job scheduling system models the computing job submitted by the user as a directed acyclic graph DAG, thereby converting the real-time cluster job scheduling problem into an allocation problem between resources and DAG, and a cluster job scheduling method according to the technical solution is used to allocate resources to the DAG to realize real-time cluster job scheduling.

[0057] Compared with the prior art, the present application has the beneficial effects that: the present application fully considers the resource-constrained situation, efficiency requirement and fairness guarantee of cluster scheduling, and the present application can not only utilize the efficient strategy given by the reinforcement learning model to minimize the average job completion time as much as possible in most cases (normal scheduling mode), but also utilize the optimization algorithm of resource dynamic division to speed up the completion speed of the long tail job when detecting the long tail job (special scheduling mode), so as to balance efficiency and fairness. The present application greatly reduces the long tail job completion time with a small increase in average job completion time, thereby maintaining efficiency and greatly improving fairness. BRIEF DESCRIPTION OF DRAWINGS

[0058] The accompanying drawings are used to provide a further understanding of the present application, and constitute a part of the specification, and are used to explain the present application together with embodiments of the present application, and do not constitute a limitation of the present application. In the drawings:

[0059] Figure 1 is a running mode diagram of a cluster job scheduling system of the present application;

[0060] Figure 2 is a flow diagram of an embodiment normal scheduling mode;

[0061] Figure 3 is a schematic diagram of extracting DAG single node embedded information in the embodiment normal scheduling mode;

[0062] Figure 4 is a schematic diagram of extracting DAG single job embedded information and global embedded information in the embodiment normal scheduling mode;

[0063] Figure 5 is an execution flow diagram of the embodiment actual job information virtualization;

[0064] Figure 6 is a comparison diagram of the present application and other scheduling strategies in average JCT;

[0065] Figure 7 is a comparison diagram of the present application and other scheduling strategies in the standard deviation of average JCT;

[0066] Figure 8 is a comparison diagram of the present application and other scheduling strategies in the ratio of average JCT and long tail JCT. DETAILED DESCRIPTION

[0067] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0068] Embodiment 1 is a cluster job scheduling system, which is a scheduling system running on a large-scale computing cluster. The system models the user-submitted computing jobs as a directed acyclic graph (DAG), thereby converting the real-time scheduling problem into a resource allocation problem between the DAG. The system contains two scheduling modes, normal and special, which are used to achieve efficiency and fairness goals, respectively. The normal scheduling mode is based on a graph neural network, which collects job information from local to global and inputs these information into a reinforcement learning model to minimize the average job completion time (JCT). The special scheduling mode detects long tail jobs in real time according to the statistical law of job execution time and performs special optimization for long tail jobs to complete as soon as possible to reduce the long tail job completion time. The scheduling system switches between the two scheduling modes to balance efficiency and fairness.

[0069] An operating mode of a cluster job scheduling system is as follows: Figure 1 As shown, it accepts job requests and system resource information externally and outputs scheduling strategies; internally, it operates on two scheduling modes. The left side shows the normal scheduling mode, which includes: an information representation module, an information extraction module, and a scheduling decision module.

[0070] The information representation module is used to model and maintain the information of each job in the structure of a Directed Acyclic Graph (DAG). Each DAG corresponds to a computation job, each node in the DAG corresponds to a stage of the computation job, and each directed edge in the DAG from node i to node j corresponds to the fact that stage j in the computation job can only start execution after stage i is completed. Each node in the DAG also contains a sequence of tasks to be executed serially, carrying relevant attribute values.

[0071] Building upon the information representation module, the information extraction module employs a graph convolutional neural network to encode the state information in the DAG. The encoded information is termed an embedding vector. The graph embedding process takes the DAG corresponding to all jobs as input and outputs three types of embedding vectors: single-node embedding, single-job embedding, and global embedding. These represent information at the node, job, and global levels, respectively, meaning that the graph embedding information of jobs in the DAG is collected from three dimensions.

[0072] The scheduling decision module, based on the DAG information obtained from the information extraction module, uses a reinforcement learning (RL) model to infer a decision that is as efficient as possible. Specifically, to avoid increasing system complexity due to an excessively large action space and long action sequences, and to ensure proper training of reinforcement learning, a two-dimensional action is used to represent a decision, in the form (s, limit). Here, s represents the next stage to be scheduled, and limit is the upper limit of resources that the job containing s can use. If there are T actions in one episode of reinforcement learning, a reward value r is obtained based on the effect of the k-th action. k When the high-level scheduling objective is to minimize the average JCT, r k =-(t) k -t k-1 )J k J k This refers to [t] k-1 ,t k The number of jobs in the system within the specified time frame.

[0073] The right side is a special state scheduling mode, including a long job detection module, a resource division module and a long job priority scheduling module.

[0074] The long job detection module is configured to approximately estimate the execution time of a job according to a statistical law of the estimated execution time of the job, detect whether a long tail job appears in the system according to the approximately estimated execution time of the job, and switch the system from the normal state scheduling mode to the special state scheduling mode after detecting the long tail job. Specifically, the estimated execution time of the job is obtained by summing up the estimated execution time of each stage carried by the job itself, and compared with a set long tail job execution time threshold T. Once the threshold is exceeded, the job is determined as a long tail job, and the special state scheduling is switched to, and the long tail job is preferentially scheduled for execution.

[0075] The resource division module is configured to dynamically divide the available resources into long tail job allocation resources according to the actual available resource situation in the system after detecting the long tail job.

[0076] The long job priority scheduling module is configured to preferentially schedule the detected long tail job, and switch the system from the special state scheduling mode to the normal state scheduling mode after the long tail job is completed.

[0077] Embodiment 2 is a cluster job scheduling method, including two scheduling modes of normal state scheduling and special state scheduling. The normal state scheduling mode is used for long-term real-time processing of to-be-scheduled computing job information, and gives a scheduling execution decision. The special state scheduling mode is used for optimization of long tail jobs.

[0078] The information representation module represents the computing job in the form of a directed acyclic graph (DAG). Each node of the DAG corresponds to a stage of the job, and each directed edge corresponds to a dependency relationship between stages. Each node of the DAG is a serial task sequence. The DAG representation of each job includes the estimated execution time of each task. Each node of the DAG also has a serially executed task sequence with relevant attribute values.

[0079] The information extraction module extracts corresponding graph embedding information from the directed acyclic graph (DAG) structure of the computing job using a graph convolutional neural network, encodes the extracted DAG graph embedding information, and refers to the encoded information as an embedding vector. The graph embedding process takes all job corresponding DAGs as input, and outputs three types of embedding vectors, namely single node embedding, single job embedding and global embedding, which are used to represent information at the node, job and global levels.

[0080] The single-node embedding information is used to describe the aggregation information of a certain node in the DAG and all child nodes of the node, and the bottom-up access order is adopted to calculate layer by layer from the leaf nodes of the DAG. In each step of the message passing process of the graph neural network, all child nodes of the current node to be calculated have completed the integration of information, and the embedding vectors of all child nodes can be directly used to calculate the embedding information of the node v, thereby realizing the upward transmission of information, which is formally described as follows:

[0081] Suppose is the directed acyclic graph G corresponding to the ith job i The original attribute vector of the node v, and the embedding vector of the node v can be obtained according to the following formula:

[0082]

[0083] Wherein, f and g are nonlinear transformation functions for vectors, realized by a neural network, and different nonlinear transformation functions are used in the three embedding dimensions; ξ(v) represents the set of child nodes of node v; the first item on the right side of the equal sign is the summary of the child node embedding information, and the second item is the attribute of node v , that is, the embedding of v itself.

[0084] For single-job embedding information, a sink point t is additionally added to each DAG, and a directed edge is added between each original node and t, that is, each original node is a child node of t, and the sink point t is used to collect and aggregate the information of each node. The embedding information of each job is represented by y i .

[0085] The global embedding information is used to describe the overall information reflected by the DAG corresponding to all jobs in the current system. In addition to the sink point t added in the single-job embedding information, a super sink point r is additionally added, and a directed edge is added between each sink point t and r, that is, each sink point t is a child node of r, and the super sink point r is used to collect and aggregate the information of each job, which is represented by z.

[0086] The scheduling decision module is used to give a scheduling decision that minimizes the average job completion time according to the global and local job information by using a reinforcement learning model on the extracted graph embedding information, and submits the scheduling decision to the cluster in the form of a binary tuple. The specific execution steps include:

[0087] A two-dimensional action is used to represent a decision, in the form of (s, limit). Where s is the next stage to be scheduled, and limit is the upper limit of the amount of resources that the job in s can use. If there are T actions in an episode of reinforcement learning, then according to the effect of the kth action, a reward value r kWhen the high-level scheduling goal is to minimize the average JCT, r k = -(t k -t k-1 )J k , where J k denotes the number of jobs in the system in the time range [t k-1 , t k ]. The goal of the reinforcement learning algorithm is to minimize the expected penalty:

[0088]

[0089] According to Little's law, minimizing the number of jobs in the system also minimizes the average JCT. The parameters of the neural network are updated using the gradient descent algorithm with the policy gradient method, denoted as π θ (s t , a t ), which represents the probability of taking action a t in state s t when the parameters are θ; during the training process, the reinforcement learning agent updates its parameters as follows:

[0090]

[0091] where α is the learning rate, T is the number of decisions, π θ (s k , a k ) represents the probability of taking action a k in state s k when the parameters are θ, k represents a decision round, s k represents the state in which the round is in, a k represents the action taken in the round, represents the gradient with respect to θ, r k′ represents the reward obtained by taking action in each future round, and b k is a baseline value used to reduce the difference in policy gradient.

[0092] To learn a comprehensive and reliable scheduling strategy, the reinforcement learning model uses continuously arriving jobs for training. However, since the parameters of the policy network are randomly generated in the early training, the strategy given by the reinforcement learning at this time lacks generalization and does not have good effects, making it unable to efficiently schedule. The idea of curriculum learning is used to continuously improve the generalization of the model and save training time, which is implemented as follows:

[0093] In the initial training rounds, the training is terminated early, and the training length is gradually increased in the subsequent training rounds, allowing the parameters of the reinforcement learning to be slowly optimized and gradually adapt to more complex scheduling situations.

[0094] Considering the resource constraint, in order to make full use of the resources, it is not appropriate to let the reinforcement learning model schedule many jobs at the same time, which will increase the number of waiting jobs and reduce the average JCT. The actual job information in the system is virtualized, and the normal scheduling mode only perceives a part of the jobs, thereby improving the execution efficiency of the part of the jobs. In short, an execution pool is set for the scheduling range of the reinforcement learning, and the jobs enter the execution pool according to the submission order, and if the execution pool is full, the jobs wait for vacancies, and only the jobs in the execution pool are scheduled, thereby ensuring the fairness of the first-arrived jobs in the resource-constrained scenario. The binary tuple includes the job node to be scheduled for execution and the corresponding parallel limit.

[0095] The special state scheduling mode includes:

[0096] The long job detection module is configured to approximately estimate the execution time of the job according to the statistical law of the estimated execution time of the job, detect whether the long-tail job appears in the system according to the approximately estimated execution time of the job, and switch the system from the normal scheduling mode to the special scheduling mode after detecting the long-tail job, and specifically includes: summing the estimated execution time of each stage carried by the job itself, taking the result as the estimated execution time of the job, and comparing it with the set long-tail job execution time threshold T, and once the threshold is exceeded, the job is determined as a long-tail job, and the special state scheduling is switched to, and the long-tail job is preferentially scheduled for execution. Specifically, the calculation of the job request received by the cluster usually gives the expected calculation time of each task in each stage of the job, and since the static period cannot accurately know the resources obtained by the job and the parallelism adopted, summing the expected calculation time of all tasks in the job is an intuitive idea to estimate the calculation time of the entire job. In the case of resource constraint, one of the optimization goals concerned by the present application is the execution time of the 99th percentile job, and through experiments, it can be verified that the overall distribution trend is still approximate, and the completion time of most jobs is concentrated in a shorter part, and the number of long jobs is very small, and a trend is that the longer the completion time is, the fewer the number is. According to such a statistical law, it is reasonable to use the cumulative expected time of all tasks to approximately estimate the percentile of the actual completion time. In implementation, whenever a job with an expected calculation time exceeding the threshold T is received, it can be considered that a long-tail job is found, and the system is switched from the normal scheduling mode to the special scheduling mode, and the long-tail job is optimized.

[0097] The resource division module is configured to allocate more computing and storage resources to the long-tail jobs according to the actual available resource situation in the system after detecting the long-tail jobs, and specifically, the limited available resources are preferentially allocated to the long-tail jobs to accelerate the completion speed of the long-tail jobs. According to the principle of fairness, the maximum amount of resources that each job can obtain is the same by dynamically dividing the available resources on the cluster, but the resource division module also preferentially allocates resources to the long jobs until the long jobs reach the resource upper limit or there is no available resource in the system. The execution steps include:

[0098] 1) Assuming that the total amount of resources is n, the currently available resource amount is f, and the number of jobs that have not been completed is U, then according to the design principle of fairness, the maximum amount of resources that each job can be allocated is:

[0099]

[0100] 2) Preferentially allocate resources to each long-tail job in the system. Assuming that the amount of resources allocated to a long-tail job is cur, if cur < limit, it means that the long-tail job can continue to allocate resources, and the updated resource amount allocated to the long-tail job is:

[0101] cur <- min(limit, f);

[0102] , which represents the amount of resources allocated to the long-tail job, is the minimum of the resource limit of the job and the currently available resources, and min represents the minimum function;

[0103] 3) If there is still available resource after the long-tail job allocates resources, the remaining available resources are allocated to other jobs;

[0104] 4) Repeat steps 2) and 3) until the resources are allocated.

[0105] The long job preferential scheduling module is configured to preferentially schedule the detected long-tail jobs, encode the scheduling decision into a binary tuple, preferentially schedule the long-tail jobs to obtain resources and perform calculations according to the allocation strategy of the resource division module, until all long-tail jobs in the system are completed, and switch the system from the special state scheduling mode to the normal state scheduling mode after the long-tail jobs are completed.

[0106] When there is no long-tail job in the system, the system exits the special state scheduling mode and enters the normal state scheduling mode, and makes efficient scheduling decisions using the sensed job information.

[0107] A comparison experiment is conducted between the cluster job scheduling method proposed in the present application and the same type of cluster job scheduler in the prior art, and the experimental results are as follows Figure 6 and Figure 7The indicators are the average values of multiple rounds of experiments, because the system is deployed in a real-time environment. Figure 6 is a comparison chart of average JCT, which is used to characterize the efficiency of the system scheduling strategy. The lower the average JCT, the greater the system throughput, and the more efficient the scheduling strategy. Figure 7 and Figure 8 are respectively the JCT standard deviation and the ratio of long-tail JCT to average JCT. The lower the two, the smaller the difference between the completion times of various jobs, and the more fair the scheduling strategy. Compared with the other two existing systems, Decima and heuristic algorithm, the efficiency of the scheduler proposed in the present application is significantly better than the heuristic algorithm, and the fairness is significantly better than Decima, achieving a balance between efficiency and fairness. Among them, Decima is an efficient scheduling system using reinforcement learning.

[0108] It should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or action from another entity or action, and do not necessarily require or imply that there is any such actual relationship or order between these entities or actions. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment.

[0109] Finally, it should be noted that the above only describes the preferred embodiments of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A cluster job scheduling method comprising two scheduling modes of normal scheduling and special scheduling, the normal scheduling mode is used for long-term real-time processing of to-be-scheduled computing job information and giving a scheduling execution decision, and the special scheduling mode is used for optimizing long-tail jobs, and the method is characterized in that: the normal scheduling mode comprises: an information representation module, which represents a computing job in the form of a directed acyclic graph (DAG), each node of the DAG corresponds to a stage of the job, and each directed edge corresponds to a dependency relationship between stages; an information extraction module, which extracts corresponding graph embedding information by using a directed acyclic graph (DAG) structure of a computing job; and a scheduling decision module, which is used for giving a scheduling decision of minimizing an average job completion time according to job information on a global and local basis by using a reinforcement learning model on the extracted graph embedding information, and submitting the scheduling decision to a cluster in the form of a binary tuple, the binary tuple comprising a job node to be scheduled for execution and a corresponding parallel limit; the special scheduling mode comprises: a long job detection module, which is used for approximately estimating an execution time of a job according to a statistical law of a job estimated execution time, detecting whether a long-tail job appears in the system according to the approximately estimated execution time of the job, and switching the system from the normal scheduling mode to the special scheduling mode after detecting the long-tail job, specifically comprising: summing up estimated execution times of all stages carried by the job itself, taking the result as the estimated execution time of the job, and comparing the estimated execution time with a set long-tail job execution time threshold T, and once the threshold is exceeded, the job is determined as a long-tail job, and the special scheduling is switched to, and the long-tail job is preferentially scheduled for execution; a resource division module, which is used for dynamically dividing available resources according to actual available resource conditions in the system after detecting the long-tail job, and allocating resources for the long-tail job; and a long job preferential scheduling module, which is used for preferentially scheduling the detected long-tail job, and switching the system from the special scheduling mode to the normal scheduling mode after the long-tail job is completed. Each node of the DAG in the information representation module of the normal scheduling mode is a serial task sequence inside the node, and the DAG representation of each job includes an estimated execution time of each task. The information representation module of the normal scheduling mode further provides partial attribute information of each node itself, and the partial attribute information includes but is not limited to a number of tasks to be executed in the node and an expected execution time of each task. The graph embedding information comprises single-node embedding information, single-job embedding information and global embedding information. The single-node embedding information is used for describing aggregated information of a node itself and all child nodes of the node in the DAG, and an access order from bottom to top is adopted to calculate layer by layer from leaf nodes of the DAG, and in each step of message passing of a graph neural network, if all child nodes of a node v to be calculated have completed integration of information, embedding information of the node v is calculated according to embedding vectors of all child nodes. ​ ​ ​ ​ 2. The cluster job scheduling method of claim 1, wherein: ​ ​ 3. The cluster job scheduling method of claim 1, wherein: ​ ​ Single-job embedding information is used for describing overall information of a DAG corresponding to a job, and a sink point t is additionally added to each DAG, and a directed edge is added between each original node and the sink point t, which is used for collecting and aggregating information of each node in the DAG; Global embedding information is used for describing overall information of DAGs corresponding to all jobs in the current system, and a super sink point r is additionally added to each sink point t, and a directed edge is added between each sink point t and the super sink point r, which is used for collecting and aggregating information of each job in the system.

4. The cluster job scheduling method of claim 3, wherein: Assume is the directed acyclic graph G corresponding to the ith job i The original attribute vector of node v, the embedding vector of node v formula: wherein, denotes the embedding vector of node v in job i, f1(.) and g1[.] are both non-linear transformation functions for vectors, implemented by neural networks; ξ(v) denotes the set of child nodes of node v; g1[.] denotes the summary of the embedding information of child nodes, denotes the self attributes of node v; The single-job embedding vector calculation formula is as follows: wherein, denotes the embedding vector of node u in job i, f2(.) and g2[.] are non-linear transformation functions for vectors; The global embedding vector calculation formula is as follows: z = g3[∑ i f3(y i )] ; where y i represents a single-job embedding vector for job i, f3(.) and g3[.] are non-linear transformation functions for vectors.

5. The cluster job scheduling method of claim 1, wherein: The execution steps of the reinforcement learning model include: The scheduling decision is coded as a binary tuple (s, limit), wherein s represents a stage to be scheduled next, that is, a node in the corresponding DAG; and limit represents an upper limit of resources available to a job where s is located; Select the next scheduled stage s, using the scoring function q to calculate the scheduling score of each currently schedulable execution node v, taking the already calculated graph embedding information as input scheduling score The priority for scheduling v to execute next is represented by the score, the larger the score, the greater the probability of being selected for scheduling; After calculating the scheduling scores of all schedulable execution nodes v, the probability of the node v as the next scheduling node is calculated through a softmax operation, and the node s with the maximum probability is selected for scheduling and execution; The parallel limit is selected, the graph embedding information calculated is used as input, and the parallel degree score of the resource limit l of each job is calculated by using a scoring function w, and the parallel degree score is used to represent the priority of allocating the number of resources to a job, and the greater the score is, the greater the probability of allocating the corresponding number of resources is; After calculating the parallel degree scores of each job, the probability of selecting the parallel degree is calculated through a softmax operation, and the resource limit limit with the maximum probability of the job i where the scheduling and execution node s is located is selected.

6. The cluster job scheduling method of claim 5, wherein The probability calculation formula of the node v as the next scheduling node is as follows: where P(node = v) denotes the probability of node v being the next scheduled node, ζ t is the set of all schedulable nodes at the current time, denotes the scheduling score of node v in job i, denotes the scheduling score of schedulable node u, j(u) is the job that node u belongs to.

7. The cluster job scheduling method of claim 5, wherein: The reinforcement learning model uses a policy gradient algorithm to perform gradient descent update on parameters of a neural network, and both the graph neural network and the policy network are differentiable; in the training process, the process of updating the parameters θ of the reinforcement learning agent is as follows: wherein a is a learning rate, T is a number of decision times, and θ (s k ,a k ) represents a probability of taking an action a k in a state s k when a parameter is θ, k represents a certain decision round, s k represents a state in which the round is located, a k represents an action taken in the round, represents a gradient with respect to θ, r k′ represents a reward obtained by taking an action in each round in the future, and b k is a baseline value for reducing a policy gradient difference.

8. The cluster job scheduling method of claim 1, wherein: The resource allocation module of the special state scheduling mode performs dynamic allocation on the existing available resources on the cluster, and each job can obtain the same number of resources at most, the resource allocation module preferentially allocates resources to long jobs until the long jobs reach the resource upper limit or there is no available resource in the system, and the specific execution steps include: 1) Assuming that the total amount of resources is n, the currently available resource amount is f, and the number of jobs not completed is U, then according to the fairness design principle, each job can be allocated at most: 2) Each long-tail job in the system is preferentially allocated resources, assuming that the amount of resources allocated to a long-tail job is cur, if cur < limit, it means that the long-tail job can continue to allocate resources, and the updated resource amount allocated to the long-tail job is: cur←min(limit,f) cur represents the resource amount allocated to the long-tail job, which is the minimum value of the resource limit limit of the job and the currently available resource f, and min(.) represents the minimum value function. 3) if there are still some available resources after the long tail job is allocated resources, then the remaining available resources are allocated to other jobs; 4) repeat step 2) and step 3) until the resources are allocated.

9. The cluster job scheduling method of claim 1, wherein: The long job priority scheduling module of the special state scheduling mode is further configured to encode the strategy given by the resource division module into the form of a (s, limit) binary tuple.

10. A cluster job scheduling system, characterized by: The cluster job scheduling system models the computing job submitted by a user as a directed acyclic graph (DAG), and performs resource allocation on the DAG according to the cluster job scheduling method of any one of claims 1 to 9 to realize real-time scheduling of the cluster job.

Citation Information

Patent Citations

  • Cloud computing based business system scheduling method and apparatus

    CN105868004A

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

    CN119003127A

Cited By

  • A method and system for intelligent project progress tracking and resource scheduling

    CN122414752A