Heterogeneous cluster scheduling method and device, electronic equipment and storage medium

By developing a scheduling method in a heterogeneous cluster, obtaining the kernel resource occupation and task resource requirements, sorting and allocating, the problem of insufficient resource utilization and task processing speed of heterogeneous clusters is solved, and more efficient resource utilization and model flexibility is achieved.

CN119781913AActive Publication Date: 2025-04-08TSINGHUA UNIVERSITY

Patent Information

Application Number
CN202411731484.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-08
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

Heterogeneous clusters have shortcomings in resource utilization and task processing speed, and due to their dependence on specific hardware, the flexibility and portability of the model are limited, resulting in complex allocation and management of computing resources.

Method used

A heterogeneous cluster scheduling method is proposed. By obtaining the kernel resource occupation that meets the response conditions, the kernel sorts to determine the scheduling order; obtaining the resource requirements of the tasks to be completed, and the task sorts to determine the execution order; based on the kernel scheduling order and the task execution order, the target kernel to be completed is determined, and the task is assigned to the corresponding kernel.

Benefits of technology

It improves the resource utilization rate and task processing speed of heterogeneous clusters, reduces the probability of task blocking, enhances the flexibility and portability of the machine learning model, and makes the cluster load more balanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781913A_ABST
    Figure CN119781913A_ABST
Patent Text Reader

Abstract

The invention relates to a heterogeneous cluster scheduling method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a resource occupation condition of at least one first kernel meeting a response condition; sorting the first kernels based on the occupation conditions of the resources to obtain a kernel scheduling sequence; obtaining at least one to-be-completed task submitted by the client, and sorting the to-be-completed tasks based on resource requirements for executing the to-be-completed tasks to obtain a task execution sequence; based on the kernel scheduling sequence and the task execution sequence, determining a target first kernel corresponding to each to-be-completed task; and allocating each to-be-completed task to the respective corresponding target first kernel. By using the method disclosed by the invention, the utilization rate of cluster computing resources can be improved, and the probability of task congestion is reduced. The training and reasoning process of machine learning can be independent of a specific chip, the flexibility and transportability of a machine model are improved, and the load of a cluster is more balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a heterogeneous cluster scheduling method and device, an electronic device, and a storage medium. Background Art

[0002] In today's era of rapid development of information technology, data centers are becoming increasingly important as the core infrastructure supporting cloud computing, big data, artificial intelligence and other applications. In this context, heterogeneous clusters are an important part of data centers, and the study of their scheduling problems is particularly important.

[0003] As an effective solution, heterogeneous clusters can provide powerful computing capabilities by integrating different types of computing resources (such as CPU, GPU, FPGA, etc.). However, in actual use, some computing resources are still inappropriately idle and some tasks are blocked. Resource utilization and task processing speed need to be improved.

[0004] Moreover, since heterogeneous machine learning clusters may require hardware with specific processing capabilities to support the training and reasoning of machine learning models, this may lead to dependence on specific hardware, limiting the flexibility and portability of the model, making the allocation and management of computing resources more complicated; different types of machine learning models may also cause unbalanced cluster load. Summary of the invention

[0005] In view of this, the present disclosure proposes a heterogeneous cluster scheduling solution.

[0006] According to one aspect of the present disclosure, a heterogeneous cluster scheduling method is provided, which is applied to a software-defined scheduler, including: obtaining resource occupancy of at least one first core that meets a response condition; sorting each first core based on the resource occupancy to obtain a core scheduling order; obtaining at least one to-be-completed task submitted by a client, and sorting each to-be-completed task based on the resource requirements for executing each to-be-completed task to obtain a task execution order; determining a target first core corresponding to each to-be-completed task based on the core scheduling order and the task execution order; and assigning each to-be-completed task to its corresponding target first core.

[0007] In one possible implementation, the at least one first kernel includes all the kernels in the cluster, the response condition includes responding to the comprehensive polling of the scheduler, the resource occupancy status includes the first resource occupancy status, and obtaining the resource occupancy status of at least one first kernel that meets the response condition includes: when the comprehensive polling is started, obtaining the first resource occupancy status of each kernel, the first resource occupancy status being data provided by the kernel in response to the comprehensive polling of the scheduler; sorting the first kernels based on the resource occupancy status to obtain the kernel scheduling order includes: determining at least one first available kernel from the kernels of the cluster according to the first resource occupancy status; determining the first time required for each first available kernel to reach an idle state; determining the first scheduling order of each first available kernel according to the first time, and using the first scheduling order as the kernel scheduling order.

[0008] In one possible implementation, the response condition includes: the completion rate of the current task is not less than the completion rate threshold, the at least one first kernel includes a first spare idle kernel in the cluster whose completion rate of the current task is not less than the completion rate threshold, the resource occupancy includes a second resource occupancy, and obtaining the resource occupancy of at least one first kernel that meets the response condition includes: obtaining the second resource occupancy of each first spare idle kernel, the second resource occupancy being data provided to the scheduler by each first spare idle kernel when the completion rate of the current task is not less than the completion rate threshold; sorting the first kernels based on the resource occupancy to obtain the kernel scheduling order includes: determining the second time required for each first spare idle kernel to reach an idle state according to each second resource occupancy; determining the second scheduling order of each first spare idle kernel according to each second time, and using the second scheduling order as the kernel scheduling order.

[0009] In a possible implementation, the response condition includes: sending a callable indication to the client, the at least one first kernel includes a second spare idle kernel in the cluster that actively sends the callable indication to the client, the resource occupancy status includes a third resource occupancy status, and obtaining the resource occupancy status of at least one first kernel that meets the response condition includes: responding to a startup instruction of the client, polling each second spare idle kernel to obtain the third resource occupancy status of each second spare idle kernel, the startup instruction is an instruction generated by the client in response to the callable indication, and the startup instruction includes information for locating the second spare idle kernel in the cluster; the first kernels are sorted based on the resource occupancy status to obtain the kernel scheduling order, including: determining the third time required for each second spare idle kernel to reach an idle state according to the third resource occupancy status; determining the third scheduling order of each second spare idle kernel according to the third time, and using the third scheduling order as the kernel scheduling order.

[0010] In one possible implementation, the method of obtaining at least one to-be-completed task submitted by the client, and sorting each to-be-completed task based on the resource requirements for executing each to-be-completed task to obtain a task execution order includes: when the to-be-completed task does not include an execution priority, sorting the at least one to-be-completed task according to the submission time and resource requirements of each to-be-completed task to obtain the task execution order; when the to-be-completed task includes an execution priority, sorting the at least one to-be-completed task according to the execution priority and resource requirements of each to-be-completed task to obtain the task execution order.

[0011] In a possible implementation, the method also includes: obtaining a first pointer corresponding to each target first kernel, the first pointer pointing to a buffer in a shared space, and the same buffer storing resource occupancy and to-be-completed tasks of the same first kernel; obtaining the resource occupancy of at least one first kernel that meets the response condition, including: based on each first pointer, obtaining the resource occupancy provided by each first kernel from the shared space; determining the target first kernel corresponding to each to-be-completed task based on the kernel scheduling order and the task execution order, including: based on the first pointer corresponding to each target first kernel, storing the to-be-completed tasks corresponding to each target first kernel in the buffer indicated by the corresponding first pointer; allocating each to-be-completed task to the corresponding target first kernel, including: sending a task fetch instruction to each target first kernel.

[0012] In a possible implementation, the task execution order includes the subtask execution order, and the method further includes: fine-grained division of each task to be completed to obtain multiple subtasks; the sorting of each task to be completed to obtain the task execution order includes: when the task to be completed does not include an execution priority, the subtasks are sorted according to the submission time of the task to be completed and the connection order of each subtask of the same task to be completed to obtain the task execution order; when the task to be completed includes an execution priority, the subtasks inherit the execution priority of the corresponding task to be completed, and the subtasks are sorted according to the execution priority and the connection order of each subtask of the same task to be completed to obtain the task execution order; based on the kernel scheduling order and the task execution order, determining the target first kernel corresponding to each task to be completed includes: matching the kernel scheduling order, the first kernel with the same order in the task execution order, and the subtasks with each other, and taking the first kernel matching the subtask as the target first kernel to complete the subtask.

[0013] According to another aspect of the present disclosure, a heterogeneous cluster scheduling device is provided, including:

[0014] A resource occupancy status acquisition unit, configured to acquire resource occupancy status of at least one first core that meets a response condition;

[0015] A kernel scheduling order determining unit, used for sorting the first kernels based on the occupancy of each resource to obtain a kernel scheduling order;

[0016] A task execution order determination unit is used to obtain at least one to-be-completed task submitted by a client, and to sort the to-be-completed tasks based on resource requirements for executing the to-be-completed tasks to obtain a task execution order;

[0017] a target first kernel determining unit, configured to determine a target first kernel corresponding to each to-be-completed task based on the kernel scheduling order and the task execution order;

[0018] The task allocation unit is used to allocate each to-be-completed task to its corresponding target first core.

[0019] In a possible implementation, the at least one first core includes all cores in the cluster, the response condition includes responding to a comprehensive poll of the scheduler, and the resource occupancy status acquisition unit is further configured to:

[0020] When comprehensive polling is enabled, obtaining first resource occupancy status of each core, where the first resource occupancy status is data provided by the core in response to comprehensive polling of the scheduler;

[0021] The kernel scheduling order determination unit is further used for:

[0022] Determining at least one first available core from the cores of the cluster according to the occupation of each of the first resources;

[0023] Determining a first time duration required for each first available core to reach an idle state;

[0024] A first scheduling order of each first available core is determined according to each of the first time lengths, and the first scheduling order is used as the core scheduling order.

[0025] In a possible implementation, the response condition includes: a completion rate of the current task is not less than a completion rate threshold, the at least one first core includes a first standby idle core in the cluster whose completion rate of the current task is not less than the completion rate threshold, the resource occupancy includes a second resource occupancy, and the resource occupancy acquisition unit is further used to:

[0026] Acquire a second resource occupancy status of each first prepared idle core, where the second resource occupancy status is data provided to the scheduler by each first prepared idle core when the completion rate of the current task is not less than the completion rate threshold;

[0027] The kernel scheduling order determination unit is further used for:

[0028] Determine, according to the occupation status of each second resource, a second time duration required for each first prepared idle core to reach an idle state;

[0029] According to each of the second time lengths, a second scheduling order of each of the first prepared idle cores is determined, and the second scheduling order is used as the core scheduling order.

[0030] In a possible implementation, the response condition includes: sending a callable indication to the client, the at least one first core includes a second standby idle core in the cluster that actively sends the callable indication to the client, the resource occupancy includes a third resource occupancy,

[0031] The resource occupancy status acquisition unit is further used to:

[0032] In response to a startup instruction from the client, poll each second standby idle core to obtain a third resource occupancy status of each second standby idle core, wherein the startup instruction is an instruction generated by the client in response to the callable indication, and the startup instruction includes information for locating the second standby idle core in the cluster;

[0033] The kernel scheduling order determination unit is further used for:

[0034] Determine, according to the occupation of each third resource, a third time duration required for each second prepared idle core to reach an idle state;

[0035] According to each of the third durations, a third scheduling order of each of the second prepared idle cores is determined, and the third scheduling order is used as the core scheduling order.

[0036] In a possible implementation, the task execution order determination unit is used to:

[0037] In the case where the to-be-completed tasks do not include an execution priority, the at least one to-be-completed task is sorted according to the submission time and resource requirements of each of the at least one to-be-completed tasks to obtain the task execution order;

[0038] In the case that the to-be-completed tasks include execution priorities, the at least one to-be-completed task is sorted according to the execution priorities and resource requirements of each of the at least one to-be-completed tasks to obtain the task execution order.

[0039] In a possible implementation, the device includes:

[0040] A first pointer acquisition unit, used for acquiring first pointers corresponding to respective target first kernels, wherein the first pointers point to a buffer in a shared space, and the same buffer stores resource occupancy and to-be-completed tasks of the same first kernel;

[0041] The resource occupancy status acquiring unit is used to:

[0042] Based on each first pointer, obtaining resource occupancy provided by each first kernel from the shared space;

[0043] The target first kernel determination unit is used to:

[0044] Based on the first pointers corresponding to the target first kernels, the to-be-completed tasks corresponding to the target first kernels are stored in the buffers indicated by the first pointers corresponding to the target first kernels;

[0045] The task allocation unit is used to:

[0046] Send a fetch task instruction to each target first core.

[0047] In a possible implementation, the task execution order includes a subtask execution order, and the apparatus further includes:

[0048] A subtask division unit is used to divide each task to be completed into fine-grained parts to obtain multiple subtasks;

[0049] The task execution order determination unit is further used to:

[0050] In the case where the to-be-completed task does not include an execution priority, the subtasks are sorted according to the submission time of the to-be-completed task and the connection order of the subtasks of the same to-be-completed task to obtain the task execution order;

[0051] In the case where the to-be-completed task includes an execution priority, the subtasks inherit the execution priority of the corresponding to-be-completed task, and the subtasks are sorted according to the execution priority and the connection order of the subtasks of the same to-be-completed task to obtain the task execution order;

[0052] The target first kernel determination unit is further used for:

[0053] The first kernel and the subtask having the same sequence in the kernel scheduling order and the task execution order are matched with each other, and the first kernel matching the subtask is used as the target first kernel to complete the subtask.

[0054] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0055] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0056] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0057] The disclosed embodiment abandons the method of obtaining the resource occupancy in the cluster through the hardware scheduler on each chip. Instead, a scheduler for the entire cluster is established based on software, and the cores on each chip directly provide the resource occupancy of the core to the scheduler. Break the chip boundaries and take the computing power of the cluster as a whole. Consider the resource occupancy of each core in a fine-grained manner to improve the rationality of task allocation, improve the utilization rate of cluster computing resources, and reduce the probability of task blocking. In addition, since each core is considered in a fine-grained manner, this method does not rely on the hardware scheduler on the chip, and does not limit the model and performance of each chip in the entire cluster. As long as the resource occupancy meets the requirements of the task to be completed, the core can execute the task to be completed, and the task to be completed does not need to rely on a specific chip. In this way, the training and reasoning process of machine learning can be independent of a specific chip, which improves the flexibility and portability of the model and makes the cluster load more balanced.

[0058] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0060] Figure 1 A schematic diagram of a flow chart of a heterogeneous cluster scheduling method provided in an embodiment of the present disclosure.

[0061] Figure 2 A schematic diagram of the structure of a heterogeneous cluster scheduling device provided in an embodiment of the present disclosure.

[0062] Figure 3 A schematic diagram of the structure of another heterogeneous cluster scheduling device provided in an embodiment of the present disclosure.

[0063] Figure 4 A schematic diagram of the structure of an electronic device for heterogeneous cluster scheduling provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0064] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0065] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0066] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0067] In today's era of rapid development of information technology, data centers are becoming increasingly important as the core infrastructure supporting cloud computing, big data, artificial intelligence and other applications. In this context, heterogeneous clusters are an important part of data centers, and the study of their scheduling problems is particularly important.

[0068] Heterogeneous clusters allocate tasks based on the chip resource occupancy provided by the hardware scheduler on each chip. The hardware scheduler evaluates the resource occupancy of the entire chip as a whole. Therefore, it may happen that some computing resources of the chip are still idle, but the overall resource occupancy rate reaches the threshold, and tasks cannot be allocated to such chips. This results in idle computing resources in the cluster, but tasks need to wait before they can be allocated, resulting in task blocking. In addition, the reasoning and training of machine learning models may be dependent on specific hardware (such as a certain model of chip), which limits the flexibility and portability of the model, and may also cause unbalanced load in the cluster.

[0069] Moreover, the same type of chips are usually used in the cluster. This is because the resource usage sent by each hardware scheduler can be comparable, which facilitates task allocation. This further increases the dependence of machine learning models on specific hardware.

[0070] Figure 1 The following is a flow chart of a heterogeneous cluster scheduling method provided by an embodiment of the present disclosure. The method is applied to a software-defined scheduler. Figure 1 As shown, the method includes:

[0071] S11, obtaining resource occupancy status of at least one first core that meets a response condition.

[0072] A cluster may include multiple cores, which may be distributed on different or the same chips, or some of the cores may be distributed on the same chip. A cluster may include multiple chips, and the models and performance of the chips may be the same or different. The response condition in the embodiment of the present disclosure may be a condition for the core to provide the scheduler with the resource occupancy of the core itself. The core and the scheduler may communicate directly. The response condition may be a condition triggered by the outside of the core, and the core responds to the trigger. The response condition may also be a condition triggered by the inside of the core, and the core responds to the trigger. In this way, the timing of the core providing the resource occupancy can be standardized, and a reasonable frequency of provision can be obtained, which not only meets the needs of task allocation, reduces the waiting time for task allocation, but also reduces the probability of communication blocking due to frequent provision of resource occupancy. Moreover, the resource occupancy that can be provided is more targeted and effective, and the probability of obtaining useless information is reduced.

[0073] For ease of description, the kernel that meets the response condition is named the first kernel. The resource occupancy may include one or more indicators. These indicators alone or in combination can characterize the load of the kernel. Exemplarily, the resource occupancy may include one or more of the following: the proportion of time a single kernel is occupied within a preset time period, the proportion of the computing power used by a single kernel to the computing power of the single kernel, the time difference required to reach the idle state, the running speed, the completion rate of the current task being executed, etc. The resource occupancy of each first kernel is expressed in the same form. That is, the indicators, formats, lengths, and units of the indicators contained in the resource occupancy of each first kernel are the same.

[0074] S12: sorting the first cores based on the occupancy of each resource to obtain a core scheduling order.

[0075] In the embodiment of the present disclosure, the first cores may be directly sorted according to one or more indicators in the resource occupancy situation; or the resource occupancy situation may be used to perform calculations to obtain calculation results, and the first cores may be sorted according to the calculation results. In this way, the kernel scheduling order may be obtained. The kernel scheduling order may represent the order in which each first core obtains tasks to be completed.

[0076] Exemplarily, the higher the computing power idleness of the first core is, the higher its position in the core scheduling order is.

[0077] Exemplarily, the shorter the time it takes for the first core to reach the idle state, the higher its position in the core scheduling sequence.

[0078] The above is only an example, showing the case of considering only one aspect for sorting, and multiple aspects can also be considered for sorting, or multiple sortings can be performed according to different emphases to obtain multiple kernel scheduling orders. The embodiment of the present disclosure does not limit the sorting rules of the first kernel.

[0079] S13, obtaining at least one to-be-completed task submitted by the client, and sorting the to-be-completed tasks based on resource requirements for executing the to-be-completed tasks to obtain a task execution order.

[0080] The client can respond to external input and obtain tasks to be completed. The client can also execute a script to obtain tasks to be completed from the outside. The client and the scheduler can communicate directly and submit tasks to be completed to the scheduler. Tasks to be completed can include operation instructions, operands, etc. The client can submit the tasks to be completed themselves to the scheduler, or submit the storage address of the tasks to be completed to the scheduler.

[0081] Each pending task may include a resource requirement, or the scheduler may calculate the corresponding resource requirement based on the pending task. Each pending task may correspond to a resource requirement. The resource requirement may represent the amount of computing resources required for the kernel.

[0082] For example, when the resource requirements of the tasks to be completed are relatively balanced, the tasks to be completed may be sorted according to their submission time to obtain the task execution order.

[0083] Exemplarily, each task to be completed may be sorted according to resource requirements to obtain a task execution order.

[0084] The above is only an example, showing the situation of considering only one aspect for sorting, and multiple aspects can also be considered for sorting. The embodiment of the present disclosure does not limit the sorting rules for the tasks to be completed.

[0085] S14, determining a target first kernel corresponding to each task to be completed based on the kernel scheduling order and the task execution order.

[0086] In the disclosed embodiment, the to-be-completed task in the task execution sequence can be assigned to the first core with the same rank in the core scheduling sequence. For the convenience of description, the first core that has obtained the to-be-completed task can be named as the target first core of the to-be-completed task.

[0087] S15, allocating each to-be-completed task to its corresponding target first core.

[0088] The scheduler may send the to-be-completed task itself to the target first core of the to-be-completed task, or may send the storage address of the to-be-completed task to the target first core of the to-be-completed task.

[0089] The disclosed embodiment abandons the method of obtaining the resource occupancy in the cluster through the hardware scheduler on each chip. Instead, a scheduler for the entire cluster is established based on software, and the cores on each chip directly provide the resource occupancy of the core to the scheduler. Break the chip boundaries and take the computing power of the cluster as a whole. Consider the resource occupancy of each core in a fine-grained manner to improve the rationality of task allocation, improve the utilization rate of cluster computing resources, and reduce the probability of task blocking. In addition, since each core is considered in a fine-grained manner, this method does not rely on the hardware scheduler on the chip, and does not limit the model and performance of each chip in the entire cluster. As long as the resource occupancy meets the requirements of the task to be completed, the core can execute the task to be completed, and the task to be completed does not need to rely on a specific chip. In this way, the training and reasoning process of machine learning can be independent of a specific chip, which improves the flexibility and portability of the model and makes the cluster load more balanced.

[0090] In one possible implementation, the at least one first kernel includes all the kernels in the cluster, the response condition includes responding to the comprehensive polling of the scheduler, the resource occupancy status includes the first resource occupancy status, and obtaining the resource occupancy status of at least one first kernel that meets the response condition includes: when the comprehensive polling is started, obtaining the first resource occupancy status of each kernel, the first resource occupancy status being data provided by the kernel in response to the comprehensive polling of the scheduler; sorting the first kernels based on the resource occupancy status to obtain the kernel scheduling order includes: determining at least one first available kernel from the kernels of the cluster according to the first resource occupancy status; determining the first time required for each first available kernel to reach an idle state; determining the first scheduling order of each first available kernel according to the first time, and using the first scheduling order as the kernel scheduling order.

[0091] In the embodiment of the present disclosure, the scheduler may poll each core in the cluster according to a preset polling frequency. For the sake of description, the polling is named comprehensive polling. For the core, the response condition may be a response to the comprehensive polling of the scheduler. In this way, each core will be queried, so each core satisfies the response condition. Therefore, in the embodiment of the present disclosure, each core in the cluster may be the first core.

[0092] Each core responds to the query (full polling) of the scheduler and provides its own resource occupancy status to the scheduler. For the sake of distinction, the resource occupancy status of the core in this embodiment is named as the first resource occupancy status.

[0093] In an embodiment of the present disclosure, the first available core can be selected according to one or more indicators in the first resource occupancy situation. For example, the first available core can be a core whose completion rate of the current task being executed is higher than the completion rate threshold; or the first available core can be a core whose resource utilization rate is lower than the utilization rate threshold, etc. Then, the first duration of each first available core can be determined. If the first duration is one of the indicators of the first resource occupancy situation, it can be directly obtained and used. If the first duration is not an indicator in the first resource occupancy situation, the first duration can be calculated using the first resource occupancy situation. The first available cores can be sorted according to the first duration of each first available core, so that the first available core with a smaller first duration is assigned to the task to be completed earlier. In this way, the first scheduling order of each first available core can be obtained. The first scheduling order is used as the core scheduling order. In an embodiment, the core scheduling order represents the order in which the first available cores are scheduled (i.e., the order in which they are assigned to the task to be completed).

[0094] In the disclosed embodiment, each core only needs to wait for the scheduler to fully poll, and in response to the full poll, provide the scheduler with the first resource occupancy status. No setting is required on the core side, which reduces the workload. The scheduler can first select the first available core according to the first resource occupancy status, and then sort them, which reduces the workload of sorting and takes into account the accuracy and efficiency of determining the kernel scheduling order.

[0095] In one possible implementation, the response condition includes: the completion rate of the current task is not less than the completion rate threshold, the at least one first kernel includes a first spare idle kernel in the cluster whose completion rate of the current task is not less than the completion rate threshold, the resource occupancy includes a second resource occupancy, and obtaining the resource occupancy of at least one first kernel that meets the response condition includes: obtaining the second resource occupancy of each first spare idle kernel, the second resource occupancy being data provided to the scheduler by each first spare idle kernel when the completion rate of the current task is not less than the completion rate threshold; sorting the first kernels based on the resource occupancy to obtain the kernel scheduling order includes: determining the second time required for each first spare idle kernel to reach an idle state according to each second resource occupancy; determining the second scheduling order of each first spare idle kernel according to each second time, and using the second scheduling order as the kernel scheduling order.

[0096] In the disclosed embodiment, each core can evaluate the completion rate of the current task it is currently performing according to the preset first evaluation frequency. When the completion rate is not less than the completion rate threshold, the core can provide its resource occupancy to the scheduler. In the disclosed embodiment, the first core is a core whose current task completion rate is not less than the completion rate threshold. For ease of description, in the disclosed embodiment, the core whose current task completion rate is not less than the completion rate threshold can be named as the first standby idle core; the resource occupancy of the first standby idle core can be named as the second resource occupancy.

[0097] In an embodiment of the present disclosure, if the second duration is one of the indicators of the second resource occupancy, it can be directly obtained and used. If the second duration is not an indicator in the first resource occupancy, the second duration can be calculated using the second resource occupancy. The first standby idle cores can be sorted according to their second durations, so that the first standby idle cores with smaller second durations are assigned to the tasks to be completed sooner. In this way, the second scheduling order of the first standby idle cores can be obtained. The second scheduling order is used as the kernel scheduling order. In this embodiment, the kernel scheduling order represents the order in which the first standby idle cores are scheduled (i.e., the order in which they are assigned to the tasks to be completed).

[0098] In the disclosed embodiment, the scheduler does not need to process the resource occupancy of all cores, but only needs to process the second resource occupancy of the first prepared idle core, thereby reducing the occupancy of storage resources, improving the processing speed, and thus improving the efficiency of obtaining the core scheduling order.

[0099] In a possible implementation, the response condition includes: sending a callable indication to the client, the at least one first kernel includes a second spare idle kernel in the cluster that actively sends the callable indication to the client, the resource occupancy status includes a third resource occupancy status, and obtaining the resource occupancy status of at least one first kernel that meets the response condition includes: responding to a startup instruction of the client, polling each second spare idle kernel to obtain the third resource occupancy status of each second spare idle kernel, the startup instruction is an instruction generated by the client in response to the callable indication, and the startup instruction includes information for locating the second spare idle kernel in the cluster; the first kernels are sorted based on the resource occupancy status to obtain the kernel scheduling order, including: determining the third time required for each second spare idle kernel to reach an idle state according to the third resource occupancy status; determining the third scheduling order of each second spare idle kernel according to the third time, and using the third scheduling order as the kernel scheduling order.

[0100] In the disclosed embodiment, each core can evaluate the completion rate of the current task it is currently performing, or evaluate the waiting time required to reach the idle state, etc., according to the preset second evaluation frequency. For the convenience of description, the core whose completion rate of the current task is not less than the completion rate threshold can be named as the second standby idle core. The second standby idle core can send a callable indication to the client. The client can inform the outside in a visual way to remind the external device or user that there is a core that is about to be idle and can input a task to be completed.

[0101] The client can generate a startup instruction for starting the scheduler to poll all the second standby idle cores when the instruction generation condition is met. The disclosed embodiment does not limit the generation condition. For example, the generation condition can be that the number of callable indications received by the client reaches the first number, or the generation condition can be that the callable indication is received for a fourth duration. The startup instruction can include information that enables the scheduler to locate the second standby idle core in the cluster, for example, the startup instruction can include a core identifier. In response to the startup instruction, the scheduler polls each second standby idle core. Each second standby idle core responds to the polling of the scheduler and provides its own resource occupancy to the scheduler. For the sake of distinction, the resource occupancy of the second standby idle core in this starting embodiment is named the third resource occupancy.

[0102] In an embodiment of the present disclosure, if the third duration is one of the indicators of the third resource occupancy, it can be directly obtained and used. If the third duration is not an indicator in the third resource occupancy, the third duration can be calculated using the third resource occupancy. The second standby idle cores can be sorted according to the third duration of each second standby idle core, so that the first standby idle core with a smaller third duration is assigned to the task to be completed earlier. In this way, the third scheduling order of each second standby idle core can be obtained. The third scheduling order is used as the kernel scheduling order. In an embodiment of the present disclosure, the kernel scheduling order represents the order in which the third standby idle cores are scheduled (i.e., the order in which they are assigned to the task to be completed).

[0103] In the disclosed embodiment, the second standby idle core directly sends the callable indication to the client, and the client instructs the scheduler to poll the second standby idle core. In this way, time is gained for obtaining the tasks to be completed, and the waiting time for the tasks to be completed is shortened. The scheduler can basically synchronize the tasks to be completed and the occupancy of the third resource, reduce the idle rate of the second standby idle core, and improve the core utilization rate.

[0104] In one possible implementation, the method of obtaining at least one to-be-completed task submitted by the client, and sorting each to-be-completed task based on the resource requirements for executing each to-be-completed task to obtain a task execution order includes: when the to-be-completed task does not include an execution priority, sorting the at least one to-be-completed task according to the submission time and resource requirements of each to-be-completed task to obtain the task execution order; when the to-be-completed task includes an execution priority, sorting the at least one to-be-completed task according to the execution priority and resource requirements of each to-be-completed task to obtain the task execution order.

[0105] In the embodiment of the present disclosure, the task to be completed may include the task itself, and may also include the submission time, and / or the required resource requirements, and / or the execution priority.

[0106] In the disclosed embodiment, users can submit tasks on the client according to the importance of the tasks, and then the tasks to be completed can be sorted according to the submission time and resource requirements, so that among the tasks with the same resource requirements, the tasks with earlier submission time are first assigned to the target first kernel. It is also possible that multiple clients submit tasks to be completed in the same period, and the tasks to be completed need to include execution priorities, so the tasks to be completed can be sorted according to execution priorities and resource requirements, so that among the tasks with the same resource requirements, the tasks with higher execution priorities are first assigned to the target first kernel.

[0107] In the past, when a chip hardware scheduler was used to allocate tasks, scheduling could only be performed according to one strategy. However, the method of the embodiment of the present disclosure makes kernel scheduling more flexible and applicable to a wider range of scenarios.

[0108] In a possible implementation, the method also includes: obtaining a first pointer corresponding to each target first kernel, the first pointer pointing to a buffer in a shared space, and the same buffer storing resource occupancy and to-be-completed tasks of the same first kernel; obtaining the resource occupancy of at least one first kernel that meets the response condition, including: based on each first pointer, obtaining the resource occupancy provided by each first kernel from the shared space; determining the target first kernel corresponding to each to-be-completed task based on the kernel scheduling order and the task execution order, including: based on the first pointer corresponding to each target first kernel, storing the to-be-completed tasks corresponding to each target first kernel in the buffer indicated by the corresponding first pointer; allocating each to-be-completed task to the corresponding target first kernel, including: sending a task fetch instruction to each target first kernel.

[0109] The shared space is a storage space. The shared space may include multiple buffers, each of which may correspond to a kernel. Each buffer may store the resource occupancy of the corresponding kernel and the pending tasks assigned to the corresponding kernel. The scheduler may store the pending tasks in the buffer, and the kernel obtains the pending tasks from the buffer; the kernel may store the resource occupancy in the buffer, and the scheduler obtains the resource call status from the buffer. The resource occupancy and the pending tasks are not stored at the same time, so the same buffer may be used to alternately store the resource occupancy and the pending tasks of the corresponding kernel, saving storage space and improving the utilization of storage space.

[0110] Each buffer corresponds to a first pointer, so the buffer, the kernel, and the first pointer correspond to each other. The target first kernel stores its own resource occupancy in a buffer in the shared space. Each target first kernel can correspond to a buffer. The target first kernel sends the first pointer of its corresponding buffer to the scheduler. The scheduler obtains the resource occupancy from the buffer in the shared space based on the first pointer. After the target first kernel is assigned to each task to be completed, the task to be completed is stored in the buffer corresponding to the matching target first kernel, and a task fetch instruction is sent to the matching target first kernel. The target first kernel responds to the task fetch instruction and uses the first pointer of each corresponding buffer to obtain the task to be completed from the corresponding buffer. The kernel and the resource scheduler do not need to transmit resource occupancy and tasks to be completed, but only need to transmit the first pointer and the task fetch instruction, which reduces the amount of data transmission between the kernel and the resource scheduler and saves communication resources.

[0111] In a possible implementation, the task execution order includes the subtask execution order, and the method further includes: fine-grained division of each task to be completed to obtain multiple subtasks; the sorting of each task to be completed to obtain the task execution order includes: when the task to be completed does not include an execution priority, the subtasks are sorted according to the submission time of the task to be completed and the connection order of each subtask of the same task to be completed to obtain the task execution order; when the task to be completed includes an execution priority, the subtasks inherit the execution priority of the corresponding task to be completed, and the subtasks are sorted according to the execution priority and the connection order of each subtask of the same task to be completed to obtain the task execution order; based on the kernel scheduling order and the task execution order, determining the target first kernel corresponding to each task to be completed includes: matching the kernel scheduling order, the first kernel with the same order in the task execution order, and the subtasks with each other, and taking the first kernel matching the subtask as the target first kernel to complete the subtask.

[0112] The scheduler can also divide the tasks to be completed into subtasks. The tasks to be completed can correspond to two or more subtasks. There can be a connection order between subtasks. The connection order can represent the execution order of subtasks. In addition, the connection order can represent the flow of intermediate data generated by subtasks between subtasks. When the tasks to be completed do not contain execution priorities, the subtasks can be sorted according to the submission time of the tasks to be completed and the connection order of the subtasks corresponding to the same tasks to be completed. When the tasks to be completed contain execution priorities, the subtasks corresponding to the tasks to be completed can inherit the execution priority of the tasks to be completed. Then the subtasks can be sorted according to the execution priority and the connection order of the subtasks corresponding to the same tasks to be completed. And the execution order of the subtasks is used as the task execution order.

[0113] In the disclosed embodiment, the tasks to be completed are subdivided and the subtasks are sorted. The tasks are divided into blocks and assigned to the target first core for execution, which reduces the probability of task blocking and makes the computing resources in the cluster more refined, thereby improving the utilization rate of the computing resources in the cluster.

[0114] In a possible implementation, the resource occupancy of the first core includes: occupancy rate, utilization rate, delay time of waiting events, etc. of the streaming multiprocessor in the first core. The compilers of each chip in the cluster may be modified so that the resource occupancy of each first core includes the same indicators, the same length, and the same format.

[0115] Figure 2A schematic diagram of the structure of a heterogeneous cluster scheduling device provided for an embodiment of the present disclosure. The device includes: n clients, m cores, where n and m are positive integers. These cores may be cores on multiple chips within the cluster. The chips in the cluster may be a central processing unit (CPU), a graphics processing unit (GPU), a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), etc. The embodiment of the present disclosure does not limit the specific model and type of the chip. The device also includes: a software-defined scheduler and a shared space for storing data. The scheduler may include: a resource extraction unit, a resource management unit, and a task planning unit.

[0116] Each kernel can communicate with each client; each kernel can communicate with the scheduler, and each client can communicate with the scheduler. Both the scheduler and the kernel can store and retrieve data from the shared space.

[0117] In the disclosed embodiment, each core can evaluate the completion rate of the current task it is currently performing according to a preset second evaluation frequency. A core with a completion rate of not less than 95% can be used as a second standby idle core. The second standby idle core can send a callable indication to the client. The client generates a start instruction when the instruction generation condition is met, and sends the start instruction to the scheduler. The scheduler polls each second standby idle core in response to the start instruction. In response to the polling of the scheduler, the second standby idle core stores the third resource occupancy status in a buffer in the shared space ( Figure 2 The buffer is not shown in the figure). Each second prepared idle core sends the first pointer of the buffer corresponding to each to the scheduler. The scheduler can use the first pointer to obtain the third resource occupancy of each second prepared idle core from the shared space. The client sends the task to be completed to the scheduler. The resource extraction unit extracts available information from the third resource occupancy. The resource management unit sorts the second prepared idle cores based on the available information to obtain the kernel scheduling order. The task planning unit sorts the tasks to be completed to obtain the task execution order, and matches the tasks to be completed with each second prepared idle core based on the kernel scheduling order and the task execution order, and determines the target first core for each task to be completed. The scheduler stores the task to be completed in the buffer corresponding to the target first core based on the first pointer of the buffer corresponding to the target first core, and sends a task fetch instruction to each target first core. Each target first core fetches the task to be completed from the shared space based on the first pointer of the buffer corresponding to each target first core and executes it.

[0118] Figure 3 A schematic diagram of the structure of another heterogeneous cluster scheduling device provided in an embodiment of the present disclosure. The device 20 includes:

[0119] A resource occupancy status acquisition unit 21, configured to acquire resource occupancy status of at least one first core that meets a response condition;

[0120] A kernel scheduling order determining unit 22, configured to sort the first kernels based on the resource occupancy status to obtain a kernel scheduling order;

[0121] The task execution order determination unit 23 is used to obtain at least one to-be-completed task submitted by the client, and sort the to-be-completed tasks based on the resource requirements for executing the to-be-completed tasks to obtain the task execution order;

[0122] A target first kernel determining unit 24 is used to determine a target first kernel corresponding to each to-be-completed task based on the kernel scheduling order and the task execution order;

[0123] The task allocating unit 25 is used to allocate each to-be-completed task to its corresponding target first core.

[0124] In a possible implementation, the at least one first core includes all cores in the cluster, the response condition includes responding to a comprehensive poll of the scheduler, and the resource occupancy status acquisition unit 21 is further configured to:

[0125] When comprehensive polling is enabled, obtaining first resource occupancy status of each core, where the first resource occupancy status is data provided by the core in response to comprehensive polling of the scheduler;

[0126] The kernel scheduling order determination unit 22 is further used for:

[0127] Determining at least one first available core from the cores of the cluster according to the occupation of each of the first resources;

[0128] Determining a first time duration required for each first available core to reach an idle state;

[0129] A first scheduling order of each first available core is determined according to each of the first time lengths, and the first scheduling order is used as the core scheduling order.

[0130] In a possible implementation, the response condition includes: a completion rate of the current task is not less than a completion rate threshold, the at least one first core includes a first standby idle core in the cluster whose completion rate of the current task is not less than the completion rate threshold, the resource occupancy includes a second resource occupancy, and the resource occupancy acquisition unit 21 is further used to:

[0131] Acquire a second resource occupancy status of each first prepared idle core, where the second resource occupancy status is data provided to the scheduler by each first prepared idle core when the completion rate of the current task is not less than the completion rate threshold;

[0132] The kernel scheduling order determination unit 22 is further used for:

[0133] Determine, according to the occupation status of each second resource, a second time duration required for each first prepared idle core to reach an idle state;

[0134] According to each of the second time lengths, a second scheduling order of each of the first prepared idle cores is determined, and the second scheduling order is used as the core scheduling order.

[0135] In a possible implementation, the response condition includes: sending a callable indication to the client, the at least one first core includes a second standby idle core in the cluster that actively sends the callable indication to the client, the resource occupancy includes a third resource occupancy,

[0136] The resource occupancy status acquiring unit 21 is further configured to:

[0137] In response to a startup instruction from the client, poll each second standby idle core to obtain a third resource occupancy status of each second standby idle core, wherein the startup instruction is an instruction generated by the client in response to the callable indication, and the startup instruction includes information for locating the second standby idle core in the cluster;

[0138] The kernel scheduling order determination unit 22 is further used for:

[0139] Determine, according to the occupation of each third resource, a third time duration required for each second prepared idle core to reach an idle state;

[0140] According to each of the third durations, a third scheduling order of each of the second prepared idle cores is determined, and the third scheduling order is used as the core scheduling order.

[0141] In a possible implementation, the task execution order determination unit 23 is used to:

[0142] In the case where the to-be-completed tasks do not include an execution priority, the at least one to-be-completed task is sorted according to the submission time and resource requirements of each of the at least one to-be-completed tasks to obtain the task execution order;

[0143] In the case that the to-be-completed tasks include execution priorities, the at least one to-be-completed task is sorted according to the execution priorities and resource requirements of each of the at least one to-be-completed tasks to obtain the task execution order.

[0144] In a possible implementation, the device 20 includes:

[0145] A first pointer acquisition unit, used for acquiring first pointers corresponding to respective target first kernels, wherein the first pointers point to a buffer in a shared space, and the same buffer stores resource occupancy and to-be-completed tasks of the same first kernel;

[0146] The resource occupancy status acquiring unit 21 is used to:

[0147] Based on each first pointer, obtaining resource occupancy provided by each first kernel from the shared space;

[0148] The target first kernel determination unit 24 is used to:

[0149] Based on the first pointers corresponding to the target first kernels, the to-be-completed tasks corresponding to the target first kernels are stored in the buffers indicated by the first pointers corresponding to the respective ones;

[0150] The task allocation unit 25 is used to:

[0151] Send a fetch task instruction to each target first core.

[0152] In a possible implementation, the task execution sequence includes a subtask execution sequence, and the apparatus 20 further includes:

[0153] A subtask division unit is used to divide each task to be completed into fine-grained parts to obtain multiple subtasks;

[0154] The task execution order determination unit 23 is further used to:

[0155] In the case where the to-be-completed task does not include an execution priority, the subtasks are sorted according to the submission time of the to-be-completed task and the connection order of the subtasks of the same to-be-completed task to obtain the task execution order;

[0156] In the case where the to-be-completed task includes an execution priority, the subtasks inherit the execution priority of the corresponding to-be-completed task, and the subtasks are sorted according to the execution priority and the connection order of the subtasks of the same to-be-completed task to obtain the task execution order;

[0157] The target first kernel determination unit 24 is further configured to:

[0158] The first kernel and the subtask having the same sequence in the kernel scheduling order and the task execution order are matched with each other, and the first kernel matching the subtask is used as the target first kernel to complete the subtask.

[0159] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0160] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0161] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0162] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0163] Figure 4 A schematic diagram of the structure of an electronic device for heterogeneous cluster scheduling provided by an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal device. Figure 4 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0164] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,LinuxTM , FreeBSD TM or similar.

[0165] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0166] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0167] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0168] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0169] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0170] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0171] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0172] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0173] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0174] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A heterogeneous cluster scheduling method, characterized in that: Applied to software-defined schedulers, including: Obtaining resource occupancy status of at least one first core that meets the response condition; Based on the occupancy of each resource, the first cores are sorted to obtain a core scheduling order; Obtain at least one to-be-completed task submitted by the client, and sort the to-be-completed tasks based on resource requirements for executing the to-be-completed tasks to obtain a task execution order; Determining a target first kernel corresponding to each task to be completed based on the kernel scheduling order and the task execution order; Allocate each to-be-completed task to its corresponding target first core.

2. The method according to claim 1, characterized in that: The at least one first core includes all cores in the cluster, the response condition includes responding to the comprehensive polling of the scheduler, the resource occupancy includes the first resource occupancy, and obtaining the resource occupancy of the at least one first core that meets the response condition includes: When comprehensive polling is enabled, obtaining first resource occupancy status of each core, where the first resource occupancy status is data provided by the core in response to comprehensive polling of the scheduler; The step of sorting the first kernels based on the resource occupancy status to obtain a kernel scheduling order includes: Determining at least one first available core from the cores of the cluster according to the occupation of each of the first resources; Determining a first time duration required for each first available core to reach an idle state; A first scheduling order of each first available core is determined according to each of the first time lengths, and the first scheduling order is used as the core scheduling order.

3. The method according to claim 1, characterized in that The response condition includes: a completion rate of the current task is not less than a completion rate threshold, the at least one first core includes a first standby idle core in the cluster whose completion rate of the current task is not less than the completion rate threshold, the resource occupancy includes a second resource occupancy, and obtaining the resource occupancy of the at least one first core that meets the response condition includes: Acquire a second resource occupancy status of each first prepared idle core, where the second resource occupancy status is data provided to the scheduler by each first prepared idle core when the completion rate of the current task is not less than the completion rate threshold; The step of sorting the first kernels based on the resource occupancy status to obtain a kernel scheduling order includes: Determine, according to the occupation status of each second resource, a second time duration required for each first prepared idle core to reach an idle state; According to each of the second time lengths, a second scheduling order of each of the first prepared idle cores is determined, and the second scheduling order is used as the core scheduling order.

4. The method according to claim 1, characterized in that The response condition includes: sending a callable indication to the client, the at least one first core includes a second standby idle core in the cluster that actively sends the callable indication to the client, the resource occupancy includes a third resource occupancy, The obtaining of resource occupancy of at least one first core that meets the response condition includes: In response to a startup instruction from the client, poll each second standby idle core to obtain a third resource occupancy status of each second standby idle core, wherein the startup instruction is an instruction generated by the client in response to the callable indication, and the startup instruction includes information for locating the second standby idle core in the cluster; The step of sorting the first kernels based on the resource occupancy status to obtain a kernel scheduling order includes: Determine, according to the occupation of each third resource, a third time duration required for each second prepared idle core to reach an idle state; According to each of the third durations, a third scheduling order of each of the second prepared idle cores is determined, and the third scheduling order is used as the core scheduling order.

5. The method according to claim 1, characterized in that The step of obtaining at least one to-be-completed task submitted by the client, and sorting the to-be-completed tasks based on resource requirements for executing the to-be-completed tasks to obtain a task execution order includes: In the case where the to-be-completed tasks do not include an execution priority, the at least one to-be-completed task is sorted according to the submission time and resource requirements of each of the at least one to-be-completed tasks to obtain the task execution order; In the case that the to-be-completed tasks include execution priorities, the at least one to-be-completed task is sorted according to the execution priorities and resource requirements of each of the at least one to-be-completed tasks to obtain the task execution order.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining first pointers corresponding to respective target first kernels, wherein the first pointers point to a buffer in a shared space, and the same buffer stores resource occupancy and to-be-completed tasks of the same first kernel; The obtaining of resource occupancy of at least one first core that meets the response condition includes: Based on each first pointer, obtaining resource occupancy provided by each first kernel from the shared space; The determining the target first kernel corresponding to each task to be completed based on the kernel scheduling order and the task execution order includes: Based on the first pointers corresponding to the target first kernels, the to-be-completed tasks corresponding to the target first kernels are stored in the buffers indicated by the first pointers corresponding to the target first kernels; The step of allocating each to-be-completed task to its corresponding target first kernel comprises: Send a fetch task instruction to each target first core.

7. The method according to claim 1, characterized in that The task execution sequence includes the subtask execution sequence, and the method further includes: Divide each task to be completed into fine-grained parts to obtain multiple subtasks; The step of sorting the tasks to be completed to obtain the task execution order includes: In the case where the to-be-completed task does not include an execution priority, the subtasks are sorted according to the submission time of the to-be-completed task and the connection order of the subtasks of the same to-be-completed task to obtain the task execution order; In the case where the to-be-completed task includes an execution priority, the subtasks inherit the execution priority of the corresponding to-be-completed task, and the subtasks are sorted according to the execution priority and the connection order of the subtasks of the same to-be-completed task to obtain the task execution order; The determining the target first kernel corresponding to each task to be completed based on the kernel scheduling order and the task execution order includes: The first kernel and the subtask having the same sequence in the kernel scheduling order and the task execution order are matched with each other, and the first kernel matching the subtask is used as the target first kernel to complete the subtask.

8. A heterogeneous cluster scheduling device, characterized in that: include: A resource occupancy status acquisition unit, configured to acquire resource occupancy status of at least one first core that meets a response condition; A kernel scheduling order determining unit, used for sorting the first kernels based on the occupancy of each resource to obtain a kernel scheduling order; A task execution order determination unit is used to obtain at least one to-be-completed task submitted by a client, and to sort the to-be-completed tasks based on resource requirements for executing the to-be-completed tasks to obtain a task execution order; a target first kernel determining unit, configured to determine a target first kernel corresponding to each to-be-completed task based on the kernel scheduling order and the task execution order; The task allocation unit is used to allocate each to-be-completed task to its corresponding target first core.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1 to 7 when executing the instructions stored in the memory.

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

Citation Information

Patent Citations

  • Video task parallelization method, device and heterogeneous cluster system in heterogeneous cluster

    CN109101339A

  • Heterogeneous many-core processor-oriented multi-task parallel scheduling method

    CN112416539A

  • Task scheduling method and device, electronic equipment and storage medium

    CN114138439A

  • Task scheduling method, device and system

    CN114911586A

  • Artificial intelligence-based task scheduling method and related equipment

    CN115292016A

Cited By

  • Kernel-level heterogeneous collaborative AI reasoning method, device and equipment and storage medium

    CN121365739A