Task scheduling method and device, storage medium, system and program product

By obtaining the resource allocation of tasks to be allocated and candidate computing nodes, determining the target computing node and allocating the tasks to them, the problem of insufficient resource utilization in the prior art is solved, and efficient balanced allocation and utilization of resources is achieved.

CN119536993APending Publication Date: 2025-02-28THE FOURTH PARADIGM BEIJING TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411487738.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

When existing machine learning platforms schedule tasks to nodes in container clusters, tasks often fail to fully utilize the computing resources on the nodes, resulting in waste of resources.

Method used

By obtaining the resource occupancy ratio of the task to be allocated and the computing resource ratio of the candidate computing node, the target computing node is determined from the candidate computing node, so that it matches the proportion of different types of computing resources of the task to be allocated, so that the task is allocated to the target computing node.

Benefits of technology

The balanced allocation of resources is achieved, the resource fragmentation and waste caused during task scheduling is reduced, and the resource utilization rate is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536993A_ABST
    Figure CN119536993A_ABST
Patent Text Reader

Abstract

The invention provides a task scheduling method and device, a storage medium, a system and a program product, and the task scheduling method comprises the steps: in response to a task scheduling request of a to-be-allocated task, obtaining a resource occupation ratio of the to-be-allocated task and a computing resource ratio of a plurality of candidate computing nodes, the resource occupation ratio comprises the ratio of different types of computing resources needing to be occupied when the corresponding task is executed, and the computing resource ratio comprises the ratio of different types of computing resources possessed by the corresponding computing node; determining a target computing node from the plurality of candidate computing nodes according to the resource occupation ratio of the to-be-allocated task and the computing resource ratio of the plurality of candidate computing nodes, so that the target computing node is matched with the proportion of different types of computing resources of the to-be-allocated task; and distributing the to-be-distributed task to the target computing node. According to the method, resource fragments and waste caused in the task scheduling process can be reduced, and the resource utilization rate is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of computer software, and more specifically, to a task scheduling method, device, storage medium, system and program product. Background Art

[0002] With the development of artificial intelligence technology, machine learning models have been widely used, either alone or embedded in applications. In addition to model reasoning (i.e., using the model directly to complete calculations), model updates and iterations are also required. These computing tasks require a lot of computing resources.

[0003] There are machine learning platforms in related technologies, which usually use container technology to automatically deploy, expand and manage applications, and can centrally execute reasoning and update tasks of machine learning models. However, when existing machine learning platforms schedule tasks to nodes in a container cluster, the execution of tasks often cannot fully utilize the computing resources on the nodes, resulting in resource waste, which needs to be optimized. Summary of the invention

[0004] The present disclosure provides a task scheduling method, device, storage medium, system and program product, which are used to solve at least one of the above problems.

[0005] According to one aspect of the present disclosure, a task scheduling method is provided, the task scheduling method comprising: in response to a task scheduling request for a task to be assigned, obtaining a resource occupancy ratio of the task to be assigned and a computing resource ratio of multiple candidate computing nodes, wherein the resource occupancy ratio includes the ratio of different types of computing resources required to execute the corresponding task, and the computing resource ratio includes the ratio of different types of computing resources possessed by the corresponding computing node; determining a target computing node from the multiple candidate computing nodes according to the resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes, so that the target computing node matches the ratio of different types of computing resources of the task to be assigned; and assigning the task to be assigned to the target computing node.

[0006] Optionally, determining the target computing node from the multiple candidate computing nodes based on the resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes includes: inputting the resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes into a task allocation model to obtain the target computing node, wherein the task allocation model is trained based on the resource occupancy ratio of multiple sample tasks and the computing resource ratio of multiple sample computing nodes, the multiple sample computing nodes are used to execute the multiple sample tasks, and the multiple sample computing nodes are completely different from or at least partially identical to the multiple candidate computing nodes.

[0007] Optionally, the task allocation model includes a reinforcement learning model; after the step of allocating the task to be allocated to the target computing node, the task scheduling method also includes: obtaining the remaining computing resource ratio of the target computing node, wherein the remaining computing resource ratio includes the proportion of different types of computing resources that have not been occupied in the corresponding computing node; and determining the feedback signal of the reinforcement learning model based on the remaining computing resource ratio of the target computing node.

[0008] Optionally, determining the feedback signal of the reinforcement learning model according to the remaining computing resource ratio of the target computing node includes: when the remaining computing resource ratio of the target computing node is outside a preset ratio range, determining that the feedback signal of the reinforcement learning model is a penalty signal.

[0009] Optionally, determining the target computing node from the multiple candidate computing nodes based on the resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes includes: in the case where any computing node among the multiple candidate computing nodes has an assigned task being executed, determining the target computing node from the multiple candidate computing nodes based on the computing resource ratios of the multiple candidate computing nodes, the resource occupancy ratio of the assigned task and the corresponding candidate computing nodes, and the resource occupancy ratio of the task to be assigned.

[0010] Optionally, the method of determining a target computing node from the multiple candidate computing nodes based on the resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes, so that the target computing node matches the ratio of different types of computing resources for the task to be assigned, includes: in the case where there are multiple tasks to be assigned, determining the target computing node for each task to be assigned from the multiple candidate computing nodes based on the resource occupancy ratio of each task to be assigned and the computing resource ratio of the multiple candidate computing nodes, the number of tasks to be assigned corresponding to each target computing node being at least one, so that the ratio of different types of computing resources for each target computing node matches the total ratio of different types of computing resources for the corresponding tasks to be assigned.

[0011] According to another aspect of the present disclosure, a task scheduling device is provided, which includes: a first acquisition unit, configured to obtain the resource occupancy ratio of the task to be assigned and the computing resource ratio of multiple candidate computing nodes in response to a task scheduling request of the task to be assigned, wherein the resource occupancy ratio includes the ratio of different types of computing resources required to execute the corresponding task, and the computing resource ratio includes the ratio of different types of computing resources possessed by the corresponding computing node; a determination unit, configured to determine a target computing node from the multiple candidate computing nodes based on the resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes, so that the target computing node matches the ratio of different types of computing resources of the task to be assigned; and an allocation unit, configured to allocate the task to be assigned to the target computing node.

[0012] Optionally, the determination unit is also configured to input the resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes into a task allocation model to obtain the target computing node, wherein the task allocation model is trained based on the resource occupancy ratio of multiple sample tasks and the computing resource ratio of multiple sample computing nodes, and the multiple sample computing nodes are used to execute the multiple sample tasks, and the multiple sample computing nodes are completely different from or at least partially identical to the multiple candidate computing nodes.

[0013] Optionally, the task allocation model includes a reinforcement learning model, and the task scheduling device also includes: a second acquisition unit, configured to obtain the remaining computing resource ratio of the target computing node after the allocation unit allocates the task to be allocated to the target computing node, wherein the remaining computing resource ratio includes the proportion of different types of computing resources that have not been occupied in the corresponding computing node; a feedback unit, configured to determine the feedback signal of the reinforcement learning model based on the remaining computing resource ratio of the target computing node.

[0014] Optionally, the feedback unit is further configured to determine that the feedback signal of the reinforcement learning model is a penalty signal when the remaining computing resource ratio of the target computing node is outside a preset ratio range.

[0015] Optionally, the determination unit is also configured to determine the target computing node from the multiple candidate computing nodes based on the computing resource ratios of the multiple candidate computing nodes, the resource occupancy ratios of the assigned tasks, and the corresponding candidate computing nodes and the resource occupancy ratios of the tasks to be assigned, when any computing node among the multiple candidate computing nodes has an assigned task being executed.

[0016] Optionally, the determination unit is also configured to determine the target computing node for each task to be assigned from the multiple candidate computing nodes according to the resource occupancy ratio of each task to be assigned and the computing resource ratio of the multiple candidate computing nodes when there are multiple tasks to be assigned, and each target computing node corresponds to at least one task to be assigned, so that the proportion of different types of computing resources of each target computing node matches the total proportion of different types of computing resources of the corresponding tasks to be assigned.

[0017] According to another aspect of the present disclosure, a computer-readable storage medium storing instructions is provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the task scheduling method as described above.

[0018] According to another aspect of the present disclosure, a system is provided including at least one computing device and at least one storage device storing instructions, wherein when the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the task scheduling method as described above.

[0019] According to another aspect of the present disclosure, a computer program product is provided, comprising instructions, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the task scheduling method as described above.

[0020] According to the task scheduling method, device, storage medium, system and program product of the exemplary embodiments of the present invention, by obtaining the resource occupancy ratio of the task to be assigned and the computing resource ratio of the candidate computing nodes, the specific number of computing resources is not directly calculated, but task allocation is achieved based on the ratio of different computing resources. This can reflect the size relationship of different types of computing resources, meet the needs of balanced resource allocation, reduce resource fragmentation and waste caused by the task scheduling process, and improve resource utilization.

[0021] Additional aspects and / or advantages of the present general inventive concept will be set forth in part in the following description and in part will be apparent from the description or may be learned through practice of the present general inventive concept. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] These and / or other aspects and advantages of the present disclosure will become clear and more easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0023] Figure 1 is a flowchart illustrating a task scheduling method according to an exemplary embodiment of the present disclosure;

[0024] Figure 2 is a system architecture diagram showing a machine learning platform according to a specific embodiment of the present disclosure;

[0025] Figure 3 is a block diagram illustrating a task scheduling apparatus according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of the embodiments of the present invention as defined by the claims and their equivalents. Various specific details are included to assist in understanding, but these details are considered to be exemplary only. Therefore, one of ordinary skill in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. In addition, descriptions of well-known functions and structures are omitted for clarity and brevity.

[0027] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0028] Refer to the following Figures 1 to 3 A task scheduling method, apparatus, storage medium, system, and program product according to exemplary embodiments of the present disclosure are described in detail.

[0029] Figure 1 is a flow chart showing a task scheduling method according to an exemplary embodiment of the present disclosure. The task scheduling method according to an exemplary embodiment of the present disclosure can be implemented in a computing device with sufficient computing power.

[0030] Reference Figure 1In step S101, in response to a task scheduling request of a task to be assigned, a resource occupancy ratio of the task to be assigned and a computing resource ratio of multiple candidate computing nodes are obtained.

[0031] The resource occupancy ratio includes the ratio of different types of computing resources required to execute the corresponding task, and the computing resource ratio includes the ratio of different types of computing resources possessed by the corresponding computing node. Different types of computing resources include, for example, at least one of cpu (central processing unit), memory, and gpu (graphics processing unit). Although the units of these different types of computing resources are different, the numerical values ​​are close in magnitude, so the numerical values ​​of each type of computing resources can be directly used to calculate their ratio. For example, when a task requires a 64 core cpu and 64 GB of memory, the resource occupancy ratio of the task is 1:1, and the computing resource ratio of the computing node is the same.

[0032] It should be noted that regarding the acquisition of the computing resource ratio of the computing node and the resource occupancy ratio of the task to be assigned, if the computing resources of the computing node are clear and fixed, then its computing resource ratio can be directly obtained and calculated. If it is not fixed, it can be regularly updated. The resource occupancy ratio of the task to be scheduled is often not clearly marked, so it is necessary to count the resource occupancy of historical tasks in advance. To this end, as an example, the task type and resource occupancy ratio of the historical tasks that have been executed before can be counted and analyzed to clarify the resource occupancy ratio of different types of tasks. When executing step S101, the corresponding type of resource occupancy ratio can be obtained according to the task type of the task to be assigned. At the same time, the statistics can be continuously executed, and the resource occupancy ratio of different types of tasks can be updated regularly to ensure the validity of the data.

[0033] In step S102, a target computing node is determined from multiple candidate computing nodes according to the resource occupation ratio of the task to be assigned and the computing resource ratio of multiple candidate computing nodes, so that the target computing node matches the ratio of different types of computing resources of the task to be assigned.

[0034] By using the ratio of different types of computing resources to match the tasks to be assigned and the candidate computing nodes, rather than using the specific amount of computing resources, it can reflect the size relationship of different types of computing resources, meet the needs of balanced resource allocation, reduce resource fragmentation and waste caused by task scheduling, and improve resource utilization.

[0035] In step S103, the task to be assigned is assigned to the target computing node.

[0036] This step may perform task allocation based on the calculation result of step S102.

[0037] Next, how to determine the target computing node in step S102 will be described from different perspectives. It should be noted that the following embodiments are directed to different perspectives and are not parallel implementation methods, so they can be combined with each other to form a more comprehensive embodiment.

[0038] In some embodiments, optionally, step S102 includes: inputting the resource occupancy ratio of the task to be assigned and the computing resource ratio of multiple candidate computing nodes into the task allocation model to obtain the target computing node, wherein the task allocation model is trained based on the resource occupancy ratio of multiple sample tasks and the computing resource ratio of multiple sample computing nodes, the multiple sample computing nodes are used to execute multiple sample tasks, and the multiple sample computing nodes are completely different from or at least partially the same as the multiple candidate computing nodes. By training the task allocation model based on the resource occupancy ratio of the sample tasks and the computing resource ratio of the sample computing nodes, the task allocation model can learn how to consider the ratio relationship of different types of computing resources in the process of scheduling tasks. Then, the trained task scheduling model is used to determine the target computing node, which can achieve efficient determination of the target computing node.

[0039] As an example, when training a task allocation model, a customized model can be trained specifically for multiple candidate computing nodes, that is, the multiple sample computing nodes used in training the model are exactly the same as the multiple candidate computing nodes being targeted; or the candidate computing nodes can be ignored and a general model can be trained. At this time, the multiple sample computing nodes used in training the model can be completely different from the multiple candidate computing nodes that will be targeted later, or they can be partially the same, and the present disclosure does not impose any restrictions on this.

[0040] Further optionally, the task allocation model includes a reinforcement learning model; after step S103, the task scheduling method according to the exemplary embodiment of the present disclosure further includes: obtaining the remaining computing resource ratio of the target computing node, wherein the remaining computing resource ratio includes the ratio of different types of computing resources that have not been occupied in the corresponding computing node; according to the remaining computing resource ratio of the target computing node, determining the feedback signal of the reinforcement learning model. By using the reinforcement learning model as the task allocation model, there is no need to provide an accurate allocation plan when preparing training samples like a deep learning model, that is, there is no need to prepare sample target computing nodes as references in training, but only needs to determine the feedback information of reinforcement learning according to the allocation results in the training process, which can be adapted to the goal of improving task scheduling efficiency. In addition, after the task allocation model obtained by applying the training is determined, by checking the ratio of different types of computing resources that are not occupied by the target computing node after accepting the task to be assigned, that is, the remaining computing resource ratio of the target computing node after executing step S103, it is possible to understand whether the remaining computing resource ratio is balanced, thereby reflecting whether there is resource waste in the target computing node, and then continue to determine the feedback signal of the reinforcement learning model, and realize continuous optimization and updating during the use of the model. As an example, during the training phase, feedback signals may be manually input by a staff member.

[0041] Further optionally, the step of determining the feedback signal of the reinforcement learning model according to the remaining computing resource ratio of the target computing node includes: when the remaining computing resource ratio of the target computing node is outside the preset ratio range, determining the feedback signal of the reinforcement learning model as a penalty signal. By configuring the preset ratio range to represent the balanced computing resource ratio, the feedback information of the reinforcement learning model can be automatically obtained through data comparison, thereby improving the efficiency of determining the feedback signal.

[0042] As an example, when the remaining computing resource ratio of the target computing node is within a preset ratio range, a feedback signal may not be generated, that is, the model may not be improved. Alternatively, the feedback signal of the reinforcement learning model may be determined as a reward signal to further optimize the model. The present disclosure does not impose any restrictions on this.

[0043] Regarding the setting and comparison of the preset ratio range, for the case where there are two types of computing resources of concern, for example, only the CPU and memory are of concern, the preset ratio range can be the value range of the ratio of the CPU to the memory. At this time, the remaining computing resource ratio of the target computing node is the ratio of the CPU and memory that have not been occupied. It can be directly determined whether the remaining computing resource ratio is within the preset ratio range.

[0044] In the case where there are more than two types of computing resources of interest, in one example, the amounts of different types of computing resources can be normalized, and the standard for the normalization is to set the preset ratio range to an approximately evenly divided ratio range. For example, in the case where three types of computing resources are of interest at the same time, the preset ratio range can be approximately equal to 1:1:1. At this time, after the remaining computing resources of the target computing node are normalized, if the remaining computing resource ratio is approximately equal to 1:1:1, it is considered that the remaining computing resource ratio of the target computing node is within the preset ratio range, otherwise it is considered that the remaining computing resource ratio of the target computing node is outside the preset ratio range.

[0045] In another example, in order to facilitate clear comparison and reduce normalization processing, several computing resource type pairs can also be determined based on these computing resource types, which can ensure that each computing resource type can be directly or indirectly compared with other computing resource types. Of course, these computing resource types can also be paired in pairs to ensure that each computing resource type can be directly compared with other computing resource types. For example, for the case of paying attention to cpu, memory and gpu at the same time, two computing resource type pairs can be determined, namely cpu and memory, cpu and gpu, and the computing resource type pair of memory and gpu can be further determined. After determining the computing resource type pair, a value range can be set for each computing resource type pair, which is used as a preset ratio range together, and the ratio of each computing resource type pair is also calculated for the remaining computing resource ratio. When performing the comparison, it is necessary to consider that the remaining computing resource ratio of the target computing node is within the preset ratio range only when the ratio of each computing resource type pair is within the corresponding value range, otherwise it is considered that the remaining computing resource ratio of the target computing node is outside the preset ratio range.

[0046] In some embodiments, optionally, step S102 includes: when there are multiple tasks to be assigned, according to the resource occupancy ratio of each task to be assigned and the computing resource ratio of multiple candidate computing nodes, the target computing node of each task to be assigned is determined from multiple candidate computing nodes, and the number of tasks to be assigned corresponding to each target computing node is at least one, so that the ratio of different types of computing resources of each target computing node matches the total ratio of different types of computing resources of each corresponding task to be assigned. In the case where there are multiple tasks to be assigned, each task to be assigned can be assigned, and the corresponding target computing node can be determined to achieve coordinated scheduling of multiple tasks to be assigned and multiple candidate computing nodes. It should be understood that the number of tasks to be assigned corresponding to each target computing node is at least one, which means that different tasks to be assigned can be assigned to the same computing node as long as different types of computing resources match as a whole. In addition, a task to be assigned can also have multiple target computing nodes, that is, the task to be assigned can be cut according to the required resource occupancy ratio and the computing resource ratio of the candidate computing nodes, and the task to be assigned is executed through multiple target computing nodes to achieve the best resource utilization.

[0047] In some embodiments, optionally, step S102 includes: when any computing node among multiple candidate computing nodes has an assigned task being executed, determine the target computing node from multiple candidate computing nodes according to the computing resource ratio of multiple candidate computing nodes, the resource occupancy ratio of the assigned task, and the resource occupancy ratio of the corresponding candidate computing node and the task to be assigned. For the situation where there are assigned tasks in one or some candidate computing nodes, by considering the resource occupancy ratio of the assigned task and the corresponding candidate computing node that executes the task when assigning a new task, it is possible to roughly understand the current remaining computing resource ratio of each candidate computing node, so that the task scheduling result is more reliable. As an example, in a specific implementation, the sample assigned tasks can be added to the training sample, or the above-mentioned situation where there are multiple tasks to be assigned can be used to regard the assigned tasks as tasks to be assigned, and the target computing node corresponding to the assigned task is limited in advance to the candidate computing node that actually executes the assigned task. The present disclosure does not limit the specific implementation method.

[0048] Next, a task scheduling method according to an exemplary embodiment of the present disclosure is introduced in conjunction with a specific embodiment. This specific embodiment relates to intelligent scheduling of AI training tasks, aiming to optimize the allocation and utilization of resources in a k8s (Kubernetes) cluster through a machine learning method.

[0049] In the machine learning platform, the ratio of cpu, memory, gpu and other resources of k8s cluster workers (corresponding to the computing nodes mentioned above) is different. Different types of training tasks have different requirements for cpu, memory, and gpu resources, that is, the proportion of each type of resource occupied is also different. The traditional k8s scheduler only considers whether the total amount of node resources matches the task resource requirements, without distinguishing the proportion of different resources such as cpu, memory, and gpu, which will cause some resources to be excessively fragmented and wasted. For example, scheduling multiple tasks with high cpu occupancy and low memory occupancy to nodes with high memory ratio will cause a waste of memory resources; scheduling tasks with high memory occupancy and low cpu occupancy to nodes with high cpu ratio will cause a waste of cpu resources.

[0050] For example, the computing resources of worker node worker1 are: 128 cores cpu, 2048 GB memory, 8 GPU cards, which is a node with a high memory ratio. The computing resources of worker node worker2 are: 256 cores cpu, 256 GB memory, 0 GPU cards, which is a node with a high cpu ratio.

[0051] The resource occupation of k8s tasks (jobs) that undertake training tasks is also different. For example, the computing resources occupied by the task of job1 type (which can be expressed as job_type_1) are: 64 core cpu, 64 GB memory, 4 GPU cards, and its cpu and memory ratio is 1:1, which is a task with a high cpu occupation ratio. The computing resources occupied by the task of job2 type (which can be expressed as job_type_2) are 1 core cpu, 256 GB memory, and 0 GPU cards. Its cpu and memory ratio is 1:256, which is a task with a high memory occupation ratio.

[0052] In traditional machine learning platforms, when two tasks of type job1 are scheduled to worker1, the CPU and GPU resources of worker1 will be instantly occupied, and a large amount of memory resources will be wasted. When a task of type job2 is scheduled to worker2, the memory resources of worker2 will be instantly occupied, and a large amount of CPU resources will be wasted.

[0053] There are some scheduling optimization methods in related technologies that strictly limit the resource ratio of training tasks, but this may cause additional resources to be forced to be allocated to unnecessary tasks.

[0054] This specific embodiment proposes an intelligent scheduling method based on the resource occupancy characteristics of training tasks, which optimizes scheduling through machine learning. For example, scheduling 1 job1 type task and 7 job2 type tasks to worker1 can reduce resource waste. The main steps of this method are as follows:

[0055] 1. Count the ratio of various resources (such as CPU and memory) of each working node, which is recorded as computing resource ratio.

[0056] 2. Count the proportion of each type of resources occupied by each type of training task, and record it as the resource occupancy ratio.

[0057] 3. Through machine learning modeling, learn the optimal matching mode between the computing resource ratio of the node and the resource occupancy ratio of the task.

[0058] 4. Based on the learned model, when scheduling a new task, select the target work node that is most complementary to the resource occupancy characteristics of the task.

[0059] This method can flexibly combine multiple tasks with complementary resource occupancy and schedule them to the most suitable node, minimize resource fragmentation, and improve overall resource utilization without the need to additionally restrict the resource ratio of tasks.

[0060] Specifically, the system architecture of the machine learning platform is as follows: Figure 2 As shown, it includes a k8s cluster control node (k8smaster), a k8s cluster working node (k8s workers), a monitoring system and a scheduler, and the task scheduling method of the embodiment of the present disclosure is executed by the scheduler.

[0061] The scheduling process of the entire system is as follows.

[0062] 1. The monitoring system collects the quotas of various resources (such as CPU, memory, GPU, etc.) on each worker node, calculates their ratios, and reports them to the scheduler regularly.

[0063] 2. The monitoring system collects historical resource usage statistics for each type of job (such as job_type_1, job_type_2, etc.), calculates its average resource usage ratio, for example, the resource usage ratio of job_type_1 is cpu:memory = 1:1, and the resource usage ratio of job_type_2 is cpu:memory = 1:256, and reports it to the scheduler regularly.

[0064] 3. The scheduler trains the task allocation model (such as the reinforcement learning model) based on the collected features such as the worker computing resource ratio and the job resource occupancy ratio, and learns the optimal task scheduling combination strategy.

[0065] 4. When scheduling a new task (corresponding to the tasks to be scheduled in the previous article), the scheduler selects the worker node with the most complementary resource ratio according to the resource occupancy characteristics (i.e. resource occupancy ratio) of the task type to which the new task belongs, combined with the trained task allocation model. For example, job_type_1 and job_type_2 are complementary, and can be preferentially scheduled to the worker1 node with the same high memory ratio.

[0066] 5. The scheduler issues scheduling decisions, and the k8s cluster executes task scheduling.

[0067] 6. During the task running process, the monitoring system continuously feeds back the task resource usage to the scheduler, such as the remaining computing resource ratio of the worker node, which is used to evaluate the optimization scheduling quality and improve the task allocation model.

[0068] In summary, this specific embodiment analyzes the task resource occupancy and intelligently schedules tasks with complementary requirements to the best working node to reduce resource waste. By intelligently matching the task resource occupancy characteristics with the node resource ratio, the resource fragmentation and waste caused by the training tasks during the scheduling process can be minimized, greatly improving the cluster resource utilization of the machine learning platform. Compared with the traditional scheduling method that limits the task resource ratio, it is more flexible and will not force the allocation of additional resources that are not required by the task, which has significant advantages.

[0069] It should be understood that in other specific embodiments, the task allocation model can also use mathematical optimization methods such as multi-objective optimization and integer programming to solve the problem with worker computing resource allocation and job resource occupancy allocation as constraints. In addition, the task scheduling method disclosed in the present invention is not limited to machine learning platforms, but can also be used in fields such as big data and scientific computing to schedule computing tasks with uneven resource requirements.

[0070] Figure 3 is a block diagram illustrating a task scheduling apparatus according to an exemplary embodiment of the present disclosure.

[0071] Reference Figure 3 The task scheduling device 300 includes a first acquisition unit 301 , a determination unit 302 , and an allocation unit 303 .

[0072] The first acquisition unit 301 can respond to the task scheduling request of the task to be assigned, and obtain the resource occupancy ratio of the task to be assigned and the computing resource ratio of multiple candidate computing nodes, wherein the resource occupancy ratio includes the ratio of different types of computing resources required to execute the corresponding task, and the computing resource ratio includes the ratio of different types of computing resources possessed by the corresponding computing node.

[0073] The determination unit 302 may determine a target computing node from multiple candidate computing nodes according to the resource occupancy ratio of the task to be assigned and the computing resource ratio of multiple candidate computing nodes, so that the target computing node matches the ratio of different types of computing resources of the task to be assigned.

[0074] The allocating unit 303 may allocate the to-be-allocated tasks to the target computing nodes.

[0075] Optionally, the determination unit 302 may also input the resource occupancy ratio of the task to be assigned and the computing resource ratio of multiple candidate computing nodes into the task allocation model to obtain the target computing node, wherein the task allocation model is trained based on the resource occupancy ratio of multiple sample tasks and the computing resource ratio of multiple sample computing nodes, the multiple sample computing nodes are used to execute multiple sample tasks, and the multiple sample computing nodes are completely different from or at least partially the same as the multiple candidate computing nodes.

[0076] Optionally, the task allocation model includes a reinforcement learning model, and the task scheduling device 300 further includes a second acquisition unit and a feedback unit (both not shown in the figure). The second acquisition unit may acquire the remaining computing resource ratio of the target computing node after the allocation unit 303 allocates the task to be allocated to the target computing node, wherein the remaining computing resource ratio includes the ratio of different types of computing resources that have not been occupied in the corresponding computing node; the feedback unit may determine the feedback signal of the reinforcement learning model according to the remaining computing resource ratio of the target computing node.

[0077] Optionally, the feedback unit may also determine that the feedback signal of the reinforcement learning model is a penalty signal when the remaining computing resource ratio of the target computing node is outside a preset ratio range.

[0078] Optionally, the determination unit 302 may also determine the target computing node from multiple candidate computing nodes based on the computing resource ratios of the multiple candidate computing nodes, the resource occupancy ratios of the assigned tasks, and the resource occupancy ratios of the corresponding candidate computing nodes and the tasks to be assigned, when any computing node among the multiple candidate computing nodes has an assigned task being executed.

[0079] Optionally, when there are multiple tasks to be assigned, the determination unit 302 may also determine the target computing node for each task to be assigned from multiple candidate computing nodes based on the resource occupancy ratio of each task to be assigned and the computing resource ratio of multiple candidate computing nodes, and each target computing node corresponds to at least one task to be assigned, so that the proportion of different types of computing resources of each target computing node matches the total proportion of different types of computing resources of the corresponding tasks to be assigned.

[0080] The above has been referred to Figures 1 to 3A task scheduling method and apparatus according to exemplary embodiments of the present disclosure are described.

[0081] Figure 3 Each unit in the task scheduling device shown may be configured as software, hardware, firmware, or any combination of the above items to perform a specific function. For example, each unit may correspond to a dedicated integrated circuit, or may correspond to a pure software code, or may correspond to a module that combines software and hardware. In addition, one or more functions implemented by each unit may also be uniformly executed by components in a physical entity device (e.g., a processor, a client, or a server, etc.).

[0082] In addition, refer to Figure 1 The described task scheduling method can be implemented by a program (or instruction) recorded on a computer-readable storage medium. For example, according to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions can be provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the task scheduling method according to the present disclosure.

[0083] The computer program in the computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. It should be noted that the computer program can also be used to perform additional steps in addition to the above steps or perform more specific processing when performing the above steps. The contents of these additional steps and further processing have been described in reference to Figure 1 It is mentioned in the description of the related method, so it will not be repeated here to avoid repetition.

[0084] It should be noted that the various units in the task scheduling device according to the exemplary embodiment of the present disclosure can completely rely on the operation of the computer program to realize the corresponding functions, that is, each unit corresponds to each step in the functional architecture of the computer program, so that the entire system is called through a special software package (for example, lib library) to realize the corresponding function.

[0085] on the other hand, Figure 3 The various units shown may also be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof. When implemented by software, firmware, middleware, or microcode, the program code or code segment for performing the corresponding operation may be stored in a computer-readable medium such as a storage medium, so that the processor may perform the corresponding operation by reading and running the corresponding program code or code segment.

[0086] For example, an exemplary embodiment of the present disclosure may also be implemented as a computing device, which includes a storage component and a processor, wherein a computer executable instruction set is stored in the storage component, and when the computer executable instruction set is executed by the processor, a task scheduling method according to an exemplary embodiment of the present disclosure is executed.

[0087] Specifically, the computing device can be deployed in a server or client, or can be deployed on a node device in a distributed network environment. In addition, the computing device can be a PC, a tablet device, a personal digital assistant, a smart phone, a web application, or other device capable of executing the above instruction set.

[0088] Here, the computing device is not necessarily a single computing device, but may also be any device or circuit collection that can execute the above instructions (or instruction sets) individually or jointly. The computing device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that is interconnected with a local or remote (e.g., via wireless transmission) interface.

[0089] In a computing device, a processor may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, a processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0090] According to the exemplary embodiment of the present disclosure, some operations described in the task scheduling method can be implemented by software, some operations can be implemented by hardware, and in addition, these operations can also be implemented by a combination of software and hardware.

[0091] The processor may execute instructions or codes stored in one of the storage components, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transmission protocol.

[0092] The storage component may be integrated with the processor, for example, RAM or flash memory is arranged within an integrated circuit microprocessor, etc. In addition, the storage component may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The storage component and the processor may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor can read files stored in the storage component.

[0093] In addition, the computing device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the computing device may be connected to each other via a bus and / or a network.

[0094] The task scheduling method according to the exemplary embodiment of the present disclosure can be described as various interconnected or coupled functional blocks or functional diagrams. However, these functional blocks or functional diagrams can be equally integrated into a single logical device or operate according to non-exact boundaries.

[0095] Therefore, refer to Figure 1 The described task scheduling method may be implemented by a system including at least one computing device and at least one storage device storing instructions.

[0096] According to an exemplary embodiment of the present disclosure, at least one computing device is a computing device for executing a task scheduling method according to an exemplary embodiment of the present disclosure, and a computer executable instruction set is stored in the storage device. When the computer executable instruction set is executed by the at least one computing device, the execution reference Figure 1 The described task scheduling method.

[0097] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided, including instructions, which, when executed by at least one computing device, prompt the at least one computing device to perform the task scheduling method according to the present disclosure.

[0098] The above describes various exemplary embodiments of the present disclosure, and it should be understood that the above description is only exemplary and not exhaustive, and the present disclosure is not limited to the disclosed exemplary embodiments. Without departing from the scope and spirit of the present disclosure, many modifications and changes are obvious to those of ordinary skill in the art. Therefore, the scope of protection of the present disclosure should be based on the scope of the claims.

Claims

1. A task scheduling method, characterized in that: The task scheduling method comprises: In response to a task scheduling request of a task to be assigned, obtaining a resource occupancy ratio of the task to be assigned and a computing resource ratio of multiple candidate computing nodes, wherein the resource occupancy ratio includes a ratio of different types of computing resources required to execute the corresponding task, and the computing resource ratio includes a ratio of different types of computing resources possessed by the corresponding computing node; Determine a target computing node from the plurality of candidate computing nodes according to the resource occupation ratio of the task to be assigned and the computing resource ratio of the plurality of candidate computing nodes, so that the target computing node matches the ratio of different types of computing resources of the task to be assigned; Allocate the task to be allocated to the target computing node.

2. The task scheduling method according to claim 1, characterized in that: The determining a target computing node from the multiple candidate computing nodes according to the resource occupation ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes comprises: The resource occupancy ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes are input into the task allocation model to obtain the target computing node, wherein the task allocation model is trained based on the resource occupancy ratio of multiple sample tasks and the computing resource ratio of multiple sample computing nodes, the multiple sample computing nodes are used to execute the multiple sample tasks, and the multiple sample computing nodes are completely different from or at least partially the same as the multiple candidate computing nodes.

3. The task scheduling method according to claim 2, characterized in that: The task allocation model includes a reinforcement learning model; After the step of allocating the to-be-allocated task to the target computing node, the task scheduling method further includes: Obtaining a remaining computing resource ratio of the target computing node, wherein the remaining computing resource ratio includes a ratio of different types of computing resources that have not been occupied in the corresponding computing node; A feedback signal of the reinforcement learning model is determined according to the remaining computing resource ratio of the target computing node.

4. The task scheduling method according to claim 3, characterized in that: The step of determining the feedback signal of the reinforcement learning model according to the remaining computing resource ratio of the target computing node includes: When the remaining computing resource ratio of the target computing node is outside a preset ratio range, the feedback signal of the reinforcement learning model is determined to be a penalty signal.

5. The task scheduling method according to any one of claims 1 to 4, characterized in that: The determining a target computing node from the multiple candidate computing nodes according to the resource occupation ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes comprises: In the case that any computing node among the multiple candidate computing nodes has an assigned task being executed, the target computing node is determined from the multiple candidate computing nodes based on the computing resource ratio of the multiple candidate computing nodes, the resource occupancy ratio of the assigned task, and the resource occupancy ratio of the corresponding candidate computing nodes and the task to be assigned.

6. The task scheduling method according to any one of claims 1 to 4, characterized in that: The determining a target computing node from the multiple candidate computing nodes according to the resource occupation ratio of the task to be assigned and the computing resource ratio of the multiple candidate computing nodes, so that the target computing node matches the ratio of different types of computing resources of the task to be assigned, comprises: In the case where there are multiple tasks to be assigned, the target computing node for each task to be assigned is determined from the multiple candidate computing nodes according to the resource occupancy ratio of each task to be assigned and the computing resource ratio of the multiple candidate computing nodes, and the number of tasks to be assigned corresponding to each target computing node is at least one, so that the proportion of different types of computing resources of each target computing node matches the total proportion of different types of computing resources of the corresponding tasks to be assigned.

7. A task scheduling device, characterized in that: The task scheduling device comprises: A first acquisition unit is configured to, in response to a task scheduling request for a task to be assigned, acquire a resource occupancy ratio of the task to be assigned and a computing resource ratio of multiple candidate computing nodes, wherein the resource occupancy ratio includes a ratio of different types of computing resources required to execute the corresponding task, and the computing resource ratio includes a ratio of different types of computing resources possessed by the corresponding computing node; a determining unit configured to determine a target computing node from the plurality of candidate computing nodes according to the resource occupation ratio of the task to be assigned and the computing resource ratio of the plurality of candidate computing nodes, so that the target computing node matches a ratio of different types of computing resources of the task to be assigned; The allocating unit is configured to allocate the to-be-allocated task to the target computing node.

8. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the task scheduling method according to any one of claims 1 to 6.

9. A system comprising at least one computing device and at least one storage device storing instructions, characterized in that: When the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the task scheduling method according to any one of claims 1 to 6.

10. A computer program product comprising instructions, characterized in that When the instructions are executed by at least one computing device, the at least one computing device is prompted to perform the task scheduling method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Database comparison task scheduling method and device and medium

    CN120849066A