Task scheduling method and device, electronic equipment, storage medium and program product

By selecting the most suitable target MPU for task scheduling, the problem of low task execution efficiency in existing technologies is solved, and resource utilization and task load balancing are improved.

CN121833191APending Publication Date: 2026-04-10MOORE THREADS TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing credit-based task scheduling schemes fail to reflect whether microprocessors (MPUs) can execute tasks efficiently, resulting in low task execution efficiency.

Method used

By determining the required credit value and resource requirements of the computing task, and combining the remaining amount and remaining credit value of the MPU, the most suitable target MPU is selected for task scheduling, ensuring resource utilization and task load balancing.

Benefits of technology

It improved task execution efficiency, ensured task load balancing among MPUs, and enhanced resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833191A_ABST
    Figure CN121833191A_ABST
Patent Text Reader

Abstract

The invention provides a task scheduling method and device, electronic equipment, a storage medium and a program product, and relates to the technical field of parallel computing and task scheduling, the method comprises the following steps: in response to a received to-be-scheduled computing task, determining a demand credit value and a resource demand quantity corresponding to the computing task, determining the residual quantity of resources in each MPU (Microprocessor Unit) and the residual credit value of each MPU; determining a target MPU from each MPU based on the demand credit value, the demand quantity of the resources, the residual quantity of the resources in each MPU and the residual credit value of each MPU; and scheduling the calculation task to the target MPU. According to the method, the task dynamic scheduling based on resource awareness can be realized, so that the task load balance among MPUs is ensured while the task execution efficiency is improved, and the resource utilization rate can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of parallel computing and task scheduling, and particularly relates to a task scheduling method and device, electronic equipment, storage medium and program product. BACKGROUND

[0002] In a multi-core Graphics Processing Unit (GPU) architecture, each GPU computing core usually contains multiple Microprocessor Units (MPUs). When a computing task is submitted to the GPU, the computing task is decomposed into hundreds or even thousands of workgroups (WGs), which are distributed to the computing cores of the GPU, and the Front-End (FE) of each computing core is responsible for scheduling the WGs to the MPUs inside the computing core for execution. At present, the commonly used scheduling scheme of the front-end scheduler is based on credit value, which can reflect whether an MPU can receive a task, but it cannot reflect whether the MPU can efficiently execute the task.

[0003] Therefore, how to improve the task execution efficiency becomes a technical problem to be solved. SUMMARY

[0004] Embodiments of the present disclosure provide a task scheduling method, a task scheduling device, electronic equipment, a computer readable storage medium and a computer program product.

[0005] In a first aspect, the embodiments of the present disclosure provide a task scheduling method, including: in response to receiving a computing task to be scheduled, determining a demand credit value corresponding to the computing task and a demand amount of resources, and determining a remaining amount of resources in each MPU and a remaining credit value of each MPU; determining a target MPU from each MPU based on the demand credit value, the demand amount of resources, the remaining amount of resources in each MPU and the remaining credit value of each MPU; and scheduling the computing task to the target MPU.

[0006] In some optional implementation manners of the embodiments of the present disclosure, the above determining the target MPU from each MPU based on the demand credit value, the demand amount of resources, the remaining amount of resources in each MPU and the remaining credit value of each MPU includes: determining, as a candidate MPU, each MPU whose remaining credit value is greater than or equal to the demand credit value and whose remaining amount of resources is greater than or equal to the demand amount of resources; and determining the target MPU from the candidate MPUs.

[0007] In some optional implementation of the embodiments of the present disclosure, the method for determining the target MPU from the candidate MPUs comprises: in the case that the type of the resource corresponding to the computing task is one, determining the target MPU based on the MPU with the largest remaining amount of the resource in the candidate MPUs.

[0008] In some optional implementation of the embodiments of the present disclosure, the method for determining the target MPU from the candidate MPUs comprises: in the case that the type of the resource corresponding to the computing task is multiple, determining the target MPU from the candidate MPUs based on the resource type priority corresponding to the multiple types of resources and the remaining amount of the multiple types of resources in the candidate MPUs.

[0009] In some optional implementation of the embodiments of the present disclosure, the method for determining the target MPU from the candidate MPUs based on the resource type priority corresponding to the multiple types of resources and the remaining amount of the multiple types of resources in the candidate MPUs comprises: determining the target type of resource according to the resource type priority; determining the target MPU from the candidate MPUs based on the target type of resource; wherein, in response to determining that the number of the candidate MPUs with the largest remaining amount of the target type of resource is multiple, determining the target type of resource in the next round according to the resource type priority, and continuing to determine the target MPU based on the target type of resource in the next round.

[0010] In some optional implementation of the embodiments of the present disclosure, the method for scheduling tasks further comprises: in response to determining that the number of the candidate MPUs with the largest remaining amount of the target type of resource is one, determining the candidate MPU with the largest remaining amount of the target type of resource as the target MPU.

[0011] In some optional implementation of the embodiments of the present disclosure, the method for scheduling tasks further comprises: in response to traversing all the multiple types of resources according to the resource type priority, and determining multiple intermediate MPUs based on the target type of resource with the lowest priority, determining the target MPU from the multiple intermediate MPUs.

[0012] In some optional implementation of the embodiments of the present disclosure, the method for determining the target MPU from the multiple intermediate MPUs comprises one of: determining the target MPU from the multiple intermediate MPUs based on the result of round-robin arbitration on the multiple intermediate MPUs; determining the target MPU from the multiple intermediate MPUs based on the MPU priority corresponding to the multiple intermediate MPUs; determining the target MPU from the multiple intermediate MPUs based on the depth of the task queue corresponding to each of the multiple intermediate MPUs.

[0013] In some optional implementations of the embodiments of the present disclosure, the multiple types of resources include unified storage resources and task identification resources, and the resource type priority indicates that the priority of the unified storage resources is higher than the priority of the task identification resources; and the determining of the target MPU from the candidate MPUs based on the resource type priority corresponding to the multiple types of resources and the remaining amounts of the multiple types of resources in the candidate MPUs includes: in response to determining that the number of the candidate MPUs with the maximum remaining amount of the unified storage resources is one, determining the candidate MPU with the maximum remaining amount of the unified storage resources as the target MPU; or in response to determining that the number of the candidate MPUs with the maximum remaining amount of the unified storage resources is multiple, determining the target MPU from the multiple candidate MPUs based on the task identification resources.

[0014] In some optional implementations of the embodiments of the present disclosure, the multiple types of resources further include at least one of shared cache resources and register resources.

[0015] In some optional implementations of the embodiments of the present disclosure, the task scheduling method can further include: updating the remaining credit value and the remaining amount of the resource corresponding to the target MPU recorded in the resource state table based on the demand amount of the resource.

[0016] In the second aspect, the embodiments of the present disclosure provide a task scheduling apparatus, including: a determining module, a screening module and a scheduling module. The determining module is configured to, in response to receiving a computing task to be scheduled, determine a demand credit value corresponding to the computing task and a demand amount of a resource, and determine a remaining amount of the resource in each microprocessor (MPU) and a remaining credit value of each MPU. The screening module is configured to determine a target MPU from the MPUs based on the demand credit value, the demand amount of the resource, the remaining amount of the resource in each MPU and the remaining credit value of each MPU. The scheduling module is configured to schedule the computing task to the target MPU.

[0017] In some optional implementations of the embodiments of the present disclosure, the screening module is further configured to: determine, as a candidate MPU, each MPU with a remaining credit value greater than or equal to the demand credit value and a remaining amount of the resource greater than or equal to the demand amount of the resource; and determine the target MPU from the candidate MPUs.

[0018] In some optional implementations of the embodiments of the present disclosure, the screening module is further configured to: in a case where the type of the resource corresponding to the computing task is one, determine the target MPU based on the MPU with the maximum remaining amount of the resource in the candidate MPUs.

[0019] In some optional implementation of the embodiments of the present disclosure, the screening module is further configured to: in a case where the type of the resource corresponding to the computing task is multiple, determine the target MPU from the candidate MPUs based on the resource type priority corresponding to the multiple types of resources and the remaining amount of the multiple types of resources in the candidate MPUs.

[0020] In some optional implementation of the embodiments of the present disclosure, the screening module is further configured to: determine the target type of resource according to the resource type priority; determine the target MPU from the candidate MPUs based on the target type of resource; and in response to determining that the number of the candidate MPUs with the maximum remaining amount of the target type of resource is multiple, determine the target type of resource in the next round according to the resource type priority, and continue to determine the target MPU based on the target type of resource in the next round.

[0021] In some optional implementation of the embodiments of the present disclosure, the screening module is further configured to: in response to determining that the number of the candidate MPUs with the maximum remaining amount of the target type of resource is one, determine the candidate MPU with the maximum remaining amount of the target type of resource as the target MPU.

[0022] In some optional implementation of the embodiments of the present disclosure, the screening module is further configured to: in response to traversing all the multiple types of resources according to the resource type priority and determining multiple intermediate MPUs based on the target type of resource with the lowest priority, determine the target MPU from the multiple intermediate MPUs.

[0023] In some optional implementation of the embodiments of the present disclosure, the screening module is further configured to perform one of the following: determine the target MPU from the multiple intermediate MPUs based on the result of round-robin arbitration on the multiple intermediate MPUs; determine the target MPU from the multiple intermediate MPUs based on the MPU priority corresponding to the multiple intermediate MPUs; and determine the target MPU from the multiple intermediate MPUs based on the depth of the task queue corresponding to each of the multiple intermediate MPUs.

[0024] In some optional implementation of the embodiments of the present disclosure, the multiple types of resources include unified storage resources and task identification resources, and the resource type priority indicates that the priority of the unified storage resources is higher than the priority of the task identification resources; and the screening module is further configured to: in response to determining that the number of the candidate MPUs with the maximum remaining amount of the unified storage resources is one, determine the candidate MPU with the maximum remaining amount of the unified storage resources as the target MPU; or in response to determining that the number of the candidate MPUs with the maximum remaining amount of the unified storage resources is multiple, determine the target MPU from the multiple candidate MPUs based on the task identification resources.

[0025] In some optional implementation of the embodiments of the present disclosure, the multiple types of resources further include at least one of a shared cache resource and a register resource.

[0026] In some optional implementation of the embodiments of the present disclosure, the task scheduling apparatus can further include an updating module configured to update the remaining credit value and the remaining amount of the resource corresponding to the target MPU recorded in the resource state table based on the demand amount of the resource.

[0027] In a third aspect, the embodiments of the present disclosure provide an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to implement the task scheduling method as described in any implementation of the first aspect.

[0028] In a fourth aspect, the embodiments of the present disclosure provide a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to enable a computer to implement the task scheduling method as described in any implementation of the first aspect.

[0029] In a fifth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program, the computer program being used to enable a processor to implement the task scheduling method as described in any implementation of the first aspect.

[0030] According to the technical scheme provided by the embodiments of the present disclosure, when receiving a computing task to be scheduled, the demand amount of the resource required for executing the computing task and the demand credit value corresponding to the computing task can be determined, and the remaining credit value and the remaining amount of the resource in each MPU in the GPU computing core corresponding to the computing task can be determined, and based on this, a target MPU that meets the computing task and can receive the computing task is selected from the MPUs included in the GPU computing core. In this way, the task dynamic scheduling based on resource awareness can be implemented to improve the task execution efficiency while ensuring the task load balancing among the MPUs, thereby improving the resource utilization.

[0031] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent through the following description. BRIEF DESCRIPTION OF DRAWINGS

[0032] Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings: Figure 1A flowchart of a task scheduling method provided by an embodiment of the present disclosure; Figure 2 A flowchart of another task scheduling method provided by an embodiment of the present disclosure; Figure 3 An architecture schematic diagram of a task scheduling system in an application scenario provided by an embodiment of the present disclosure; Figure 4 A structural block diagram of a task scheduling device provided by an embodiment of the present disclosure; Figure 5 A structural schematic diagram of an electronic device suitable for executing a task scheduling method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0033] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0034] It should be noted that in the technical solutions of the present disclosure, the collection, acquisition, storage, processing, transmission, provision, disclosure and application of user personal information (such as user image-related information involved in the calculation task) are performed with the user's knowledge and explicit authorization, in accordance with relevant laws and regulations, and do not violate public order and good customs.

[0035] The technical solutions of the embodiments of the present disclosure and the technical effects produced by the technical solutions of the present disclosure will be described below by describing several optional embodiments. It should be noted that the following embodiments can be mutually referenced, borrowed or combined. For the same terms, similar features and similar implementation steps in different embodiments, they will not be described repeatedly.

[0036] Reference is made to Figure 1 , Figure 1 A flowchart of a task scheduling method provided by an embodiment of the present disclosure, the task scheduling method is executed by an execution subject processor, wherein the flowchart 100 includes the following steps: Step 101: In response to receiving a to-be-scheduled calculation task, determining the demand credit value corresponding to the calculation task and the demand amount of resources, and determining the remaining amount of resources in each microprocessor MPU and the remaining credit value of each MPU.

[0037] The step is to determine the required amount of resources and the required credit (Credit) corresponding to the computing task (i.e., the required credit) when the above-mentioned execution subject (e.g., GPU or GPU computing core) of the task scheduling method receives a computing task to be scheduled, and to determine the remaining amount of resources and the remaining credit in each MPU in the GPU computing core corresponding to the computing task, so as to realize resource awareness. The remaining credit can be used to determine whether the MPU can receive the task, and the remaining amount of resources can be understood as the available amount of resources in the MPU that can be used to execute a new computing task. In this embodiment, the computing task to be scheduled can exist in the form of a work group (WG), which can be regarded as a basic scheduling unit and a parallel execution unit for executing a computing task in parallel, and can be a set of threads, i.e., can include multiple threads.

[0038] It should be noted that the required credit corresponding to different computing tasks is determined according to the specific conditions of each computing task, and the required credit corresponding to different computing tasks can be the same or different.

[0039] In some optional implementations in the embodiments of the present disclosure, the types of resources required to execute the above-mentioned computing task can include, but are not limited to, at least one of a task identification (Task ID) resource, a unified store (US) resource, a shared cache resource, and a register resource. The task identification resource can be used for task scheduling and positioning (such as data addressing), and can be used for thread identification and management. The unified store resource is a general write resource for accessing an external hierarchical memory system in the MPU. The shared cache resource is a dedicated write resource for accessing a local shared memory in the MPU. The register resource is the fastest and smallest storage resource on the GPU, which is usually located inside the MPU and is used to store local variables and intermediate calculation results required during the execution of a single thread.

[0040] In some optional implementations in the embodiments of the present disclosure, the required amount of the above-mentioned task identification resource can be understood as the number of task identifications required to execute the computing task. The required amount of the above-mentioned US resource can be understood as the size of the US resource required to execute the computing task. The required amount of the above-mentioned shared cache resource can be understood as the size of the shared cache resource required to execute the computing task. The required amount of the above-mentioned register resource can be understood as the number of register files used to execute the computing task.

[0041] Step 102: determining a target MPU from the MPUs based on the required credit, the required amount of resources, the remaining amount of resources in each MPU, and the remaining credit of each MPU.

[0042] In this embodiment, based on the demand credit value corresponding to the above-mentioned computing task, the demand amount of resources, the remaining amount of resources in each MPU and the remaining credit value of each MPU, a target MPU that meets the requirements of the computing task and can receive the computing task can be selected from the MPUs included in the GPU computing core, so as to ensure that the resource utilization rate can be improved.

[0043] Step 103: Schedule the computing task to the target MPU.

[0044] According to the task scheduling method provided in this disclosure, upon receiving a computing task to be scheduled, the required amount of resources for executing the computing task and the corresponding credit value of the computing task can be determined through parsing. The remaining credit value and remaining resources of each MPU in the GPU computing core corresponding to the computing task can also be determined. Based on this, target MPUs that meet the requirements of the computing task and can receive the computing task can be selected from the MPUs contained in the GPU computing core. In this way, resource-aware dynamic task scheduling can be achieved, which improves task execution efficiency while ensuring task load balancing among MPUs, thereby improving resource utilization.

[0045] Please refer to Figure 2 , Figure 2 A flowchart of another task scheduling method provided in this disclosure embodiment, the task scheduling method being executed by an execution entity processor, wherein process 200 includes the following steps: Step 201: In response to receiving a computing task to be scheduled, determine the required credit value and resource requirement corresponding to the computing task, and determine the remaining amount of resources in each microprocessor (MPU) and the remaining credit value of each MPU.

[0046] Step 202: Based on the demand credit value, the demand for resources, the remaining amount of resources in each MPU, and the remaining credit value of each MPU, determine the target MPU from each MPU.

[0047] Step 203: Schedule the computing task to the target MPU.

[0048] Steps 201-203 above are the same as those mentioned above. Figure 1 The steps 101-103 shown are the same. For the same parts, please refer to the corresponding parts of the previous embodiment. They will not be repeated here.

[0049] Step 204: Based on the resource demand, update the remaining credit value and remaining resource quantity corresponding to the target MPU recorded in the resource status table.

[0050] In this embodiment, the resource state table can be pre-configured to maintain the real-time resource usage of each MPU, i.e., the resource state table is used to maintain the latest remaining amount of resources of each MPU and the latest remaining value of the credit corresponding to each MPU. That is, after the computing task is scheduled to the target MPU to execute the computing task, the same amount of resources as required for executing the computing task can be taken from the remaining amount of resources of the target MPU, and at this time, the remaining amount of resources of the target MPU in the resource state table needs to be updated adaptively. Meanwhile, the target MPU is used to execute the computing task, and the remaining credit value corresponding to the target MPU currently maintained in the resource state table also needs to be deducted by the required credit value corresponding to the computing task to realize dynamic update of the credit value. In this way, the resource usage and the credit value of the MPU are dynamically maintained through the resource state table, which can provide a reliable basis for realizing accurate resource perception of the MPU.

[0051] Optionally, the resource state table can be maintained in the granularity of GPU computing core, i.e., the corresponding resource state table is dynamically maintained for each GPU computing core.

[0052] In some optional implementation manners of any of the above embodiments of the present disclosure, the following content can also be included: in response to detecting that the target MPU has completed the execution of the computing task, the resources used by the target MPU in executing the computing task are released, and the remaining credit value and the remaining amount of resources corresponding to the target MPU recorded in the resource state table are updated. In this way, by realizing the recycling of resources and credit values, the dynamic maintenance of the resource state table is further realized, and the accuracy of the resource state and the credit value of each type of MPU maintained in the resource state table can be ensured.

[0053] In some optional implementation manners of any of the above embodiments of the present disclosure, the resource state table can be maintained for each MPU in the GPU computing core, i.e., the resource state table can be maintained in the granularity of MPU.

[0054] In some optional implementation manners of any of the above embodiments of the present disclosure, the above Figure 1 or Figure 2 On the basis of the corresponding embodiments, the step 102 or the step 202 can be implemented as the following content: the MPU whose remaining credit value is greater than or equal to the required credit value and whose remaining amount of resources is greater than or equal to the required amount of resources is determined as a candidate MPU; and the target MPU is determined from the candidate MPU.

[0055] In this embodiment, the MPU currently capable of receiving the computing task from the MPU included in the GPU computing core corresponding to the computing task can be first screened out, that is, the MPU with the remaining credit value greater than or equal to the credit value required for executing the computing task (i.e., the required credit value) and the remaining amount of resource greater than or equal to the required amount of resource is screened out as a candidate MPU, that is, the MPU sufficient for both the required amount of resource and the required credit value of the computing task is screened out as a candidate MPU, and then the target MPU for receiving the computing task can be determined from the candidate MPU. In this way, the computing task can be avoided to be scheduled to the MPU sufficient in credit value but insufficient in key resource for actually executing the task, so that the task execution rate or delay caused by insufficient resource can be avoided.

[0056] In some optional implementations of the embodiments of the present disclosure, in the case that the type of resource corresponding to the computing task is one type, the step of determining the target MPU from the candidate MPUs can be implemented as: determining the target MPU based on the MPU with the largest remaining amount of resource in the candidate MPUs. In this way, the resource utilization rate can be improved.

[0057] In an optional example, in the case that the number of the MPUs with the largest remaining amount of resource in the candidate MPUs is one, the MPU with the largest remaining amount of resource can be determined as the target MPU for receiving the computing task.

[0058] In another optional example, in the case that the number of the MPUs with the largest remaining amount of resource in the candidate MPUs is multiple, a corresponding arbitration strategy can be used to select one of the multiple MPUs with the largest remaining amount of resource as the target MPU. Here, the multiple MPUs with the largest remaining amount of resource can be referred to as multiple intermediate MPUs, and the arbitration strategy for determining the target MPU from the multiple intermediate MPUs can include one of the following: (1) determining the target MPU from the multiple intermediate MPUs based on the result of round-robin arbitration on the multiple intermediate MPUs.

[0059] In this embodiment, the result of the round-robin arbitration on the plurality of intermediate MPUs can be determined based on a round-robin sequence corresponding to the plurality of intermediate MPUs, the result of the round-robin arbitration being used to indicate an MPU in the plurality of intermediate MPUs that should currently receive the task, which can be determined as the target MPU. In this way, on the basis of screening the plurality of intermediate MPUs by comprehensively considering the credit values representing whether each MPU can receive the task, whether the remaining amount of resources is sufficient to meet the task execution demand, and the like, that is, on the basis of effectively perceiving the resource state inside the MPUs, the target MPU for receiving the computing task can be determined according to the round-robin sequence, so as to realize dynamic task scheduling between the MPUs. Thus, it can be avoided that the task is allocated to an MPU with insufficient resources, and the MPU becomes a system bottleneck due to depletion of a specific resource, thereby avoiding causing severe imbalance of load inside the GPU computing core. Therefore, by using this implementation manner, the task load balancing can be ensured.

[0060] In some optional implementations of the embodiments of the present disclosure, the round-robin sequence corresponding to the plurality of intermediate MPUs can be a dedicated round-robin sequence set in advance for the set of the plurality of intermediate MPUs, or a round-robin sequence set in advance for all the MPUs in the GPU computing core, and when the plurality of intermediate MPUs are determined, the round-robin sequence corresponding to the plurality of intermediate MPUs can be obtained according to the relative ordering of the plurality of intermediate MPUs in the round-robin sequence set in advance for all the MPUs in the GPU computing core.

[0061] (2) Determining a target MPU from the plurality of intermediate MPUs based on MPU priorities corresponding to the plurality of intermediate MPUs.

[0062] In this embodiment, the target MPU can be determined based on the MPU priorities corresponding to the plurality of intermediate MPUs, and the MPU with the highest MPU priority can be determined as the target MPU. In this way, on the basis of screening the plurality of intermediate MPUs by comprehensively considering the credit values representing whether each MPU can receive the task, whether the remaining amount of each type of resource is sufficient to meet the task execution demand, and the like, that is, on the basis of effectively perceiving the resource state inside the MPUs, the target MPU for receiving the computing task can be determined according to the MPU priorities, that is, the most suitable MPU is selected to improve resource utilization, and it can be avoided that the task is allocated to an MPU with insufficient resources, and the MPU becomes a system bottleneck due to depletion of a specific resource.

[0063] In some optional implementations of the embodiments of the present disclosure, the MPU priority corresponding to the plurality of intermediate MPUs can be a dedicated priority order pre-set for the plurality of intermediate MPUs; or the priority order is pre-set for all the MPUs in the GPU computing core, and when the plurality of intermediate MPUs are determined, the MPU priority corresponding to the plurality of intermediate MPUs can be obtained according to the relative order of the plurality of intermediate MPUs in the MPU priority order pre-set for all the MPUs in the GPU computing core.

[0064] (3) Determining a target MPU from the plurality of intermediate MPUs based on the depths of the task queues corresponding to the plurality of intermediate MPUs respectively.

[0065] In this embodiment, the target MPU can be determined from the plurality of intermediate MPUs based on the depths of the task queues corresponding to the plurality of intermediate MPUs respectively, where the depth of the task queue of each target MPU can represent the number of tasks that have been received but not completed. In this way, on the basis of screening the plurality of intermediate MPUs by comprehensively considering the credit values representing whether each MPU can receive tasks, whether the remaining amounts of each type of resource are sufficient to meet the task execution demand, and the like, that is, on the basis of effectively perceiving the resource state in the MPU, the target MPU that can most efficiently execute the computing task is selected according to the depth of the task queue of each target MPU. Thus, it is possible to avoid assigning tasks to MPUs with insufficient resources, to avoid MPUs becoming system bottlenecks due to depletion of specific resources, and to improve resource utilization.

[0066] In some optional implementations of the embodiments of the present disclosure, in the case where the type of resource corresponding to the computing task is multiple, the step of determining the target MPU from the candidate MPUs can be implemented as: determining the target MPU from the candidate MPUs based on the resource type priority corresponding to the multiple types of resources and the remaining amounts of the multiple types of resources in the candidate MPUs.

[0067] In this embodiment, in the case where the type of resource corresponding to the computing task is multiple, in order to improve the task execution efficiency while ensuring the task load balancing among the MPUs of the GPU computing core, the target MPU for receiving the computing task can be determined by comprehensively considering the resource type priority among the multiple types of resources and the remaining amounts of each type of resource among the multiple types of resources in each candidate MPU.

[0068] In some optional implementation of the embodiments of the present disclosure, the resource type priority can be determined based on the sensitivity of the computing task to each type of resource in the plurality of types of resources. The sensitivity of the computing task to each type of resource can be used to represent the degree of influence of each type of resource on the successful execution of the computing task. A high sensitivity resource type means that the type of resource has a great influence on the successful execution of the computing task, i.e., a high sensitivity resource type is more likely to be a performance bottleneck during the execution of the computing task, and the demand for the resource should be prioritized. That is, the resource type priority can be understood as the order of resource types that need to be ensured to have sufficient resources during the execution of the computing task, and the resource type priority can be dynamically adjusted according to actual application conditions, which can be adjusted according to the analysis of the characteristics of the computing task and / or the identification of performance bottlenecks, etc.

[0069] In some optional implementation of the embodiments of the present disclosure, the sensitivity of the computing task to each type of resource in the plurality of types of resources is related to the task type to which the computing task belongs. In one example, if the task type to which the computing task belongs is a high parallel task intensive type, the sensitivity of the computing task to each type of resource is ranked from high to low, i.e., the resource type priority can be: task identification resource > register resource > shared cache resource > unified storage resource. In another example, if the type to which the computing task belongs is a memory access intensive type, the sensitivity of the computing task to each type of resource is ranked from high to low, i.e., the resource type priority can be: unified storage resource > task identification resource > shared cache resource > register resource. In yet another example, if the type to which the computing task belongs is a computing intensive type, the sensitivity of the computing task to each type of resource is ranked from high to low, i.e., the resource type priority can be: register resource > shared cache resource > task identification resource > unified storage resource. In yet another example, if the type to which the computing task belongs is a data reuse intensive type, the sensitivity of the computing task to each type of resource is ranked from high to low, i.e., the resource type priority can be: shared cache resource > task identification resource > register resource > unified storage resource.

[0070] In this embodiment, by setting the resource type priority, the demand for the type of resource with the highest priority can be prioritized to be satisfied, which helps to improve the task execution efficiency.

[0071] In some optional implementation of any of the above-mentioned embodiments of the present disclosure, the step of determining the target MPU from the candidate MPUs based on the resource type priority corresponding to the plurality of types of resources and the remaining amount of the plurality of types of resources in the candidate MPUs can be implemented as follows: determining the target type of resource according to the resource type priority; determining the target MPU from the candidate MPUs based on the target type of resource; wherein, in response to determining that the number of the candidate MPUs with the maximum remaining amount of the target type of resource is one, the candidate MPU with the maximum remaining amount of the target type of resource is determined as the target MPU; or in response to determining that the number of the candidate MPUs with the maximum remaining amount of the target type of resource is more than one, the target type of resource in the next round is determined according to the resource type priority, and the target MPU is determined based on the target type of resource in the next round.

[0072] In one optional implementation of the embodiments of the present disclosure, the step of determining the target MPU based on the target type of resource in the next round comprises: in response to determining that the number of the candidate MPUs with the maximum remaining amount of the target type of resource in the next round is one, the candidate MPU with the maximum remaining amount of the target type of resource in the next round is determined as the target MPU; otherwise, the target type of resource in the next round is determined according to the resource type priority until the target MPU ends the polling, or the polling of the plurality of types of resources according to the resource type priority is completed, the plurality of intermediate MPUs based on the type of resource with the lowest priority are obtained, and the target MPU is determined from the plurality of intermediate MPUs.

[0073] Further optionally, in response to traversing the plurality of types of resources according to the resource type priority, and determining the plurality of intermediate MPUs based on the target type of resource with the lowest priority, the step of determining the target MPU from the plurality of intermediate MPUs can be implemented as follows: the target MPU is determined from the plurality of intermediate MPUs by using the arbitration strategy. The process of determining the target MPU based on the arbitration strategy can be referred to the description of the foregoing corresponding part, and will not be described here again to avoid repetition.

[0074] It can be understood that the process of determining the target MPU from the candidate MPUs based on the resource type priority corresponding to the plurality of types of resources and the remaining amount of the plurality of types of resources in the candidate MPUs is a process of determining the target MPU according to the resource type priority in a loop, and can also be described as: determining the target type of resource according to the resource type priority; determining the number of candidate MPUs with the largest remaining amount of the target type of resource; in response to determining that the number of candidate MPUs with the largest remaining amount of the target type of resource is one, determining the candidate MPU with the largest remaining amount of the target type of resource as the target MPU; or in response to determining that the number of candidate MPUs with the largest remaining amount of the target type of resource is multiple, determining a new target type of resource (corresponding to the target type of resource of the next round described above) according to the resource type priority, and performing the step of determining the number of candidate MPUs with the largest remaining amount of the new target type of resource until the target MPU is determined, or until the target MPU is determined from the multiple intermediate MPUs in response to traversing all the types of resources according to the resource type priority and determining the multiple intermediate MPUs based on the type of resource with the lowest priority.

[0075] In this embodiment, the target type of resource is first determined from the multiple types of resources according to the resource type priority associated with the multiple types of resources, and the candidate MPUs with the largest remaining amount of the target type of resource are compared with each other to determine the candidate MPU with the largest remaining amount of the target type of resource. If only one candidate MPU can be determined through the comparison of the remaining amounts in this round, the candidate MPU with the largest remaining amount of the target type of resource can be determined as the target MPU for receiving the computing task. If multiple candidate MPUs with the largest remaining amount of the target type of resource are determined through the comparison of the remaining amounts in this round, a new round of comparison needs to be started, that is, a new target type of resource needs to be determined according to the resource type priority, and the step of comparing the remaining amounts of the new target type of resource of the multiple candidate MPUs with each other is performed. If only one candidate MPU can be determined, the loop ends; otherwise, a new round of comparison needs to be started again until the condition for ending the loop is met: only one target MPU can be determined, or multiple intermediate MPUs are obtained by polling the multiple types of resources in turn according to the resource type priority. Through the polling based on the resource type priority, the most suitable MPU for receiving the computing task can be locked efficiently and accurately, thereby improving the resource utilization.

[0076] In a specific implementation manner of the embodiments of the present disclosure, the multiple types of resources corresponding to the computing task described above include unified storage resources and task identification resources, and the resource type priority corresponding to the resources including the unified storage resources and the task identification resources indicates that the priority of the unified storage resources is higher than the priority of the task identification resources. In this case, the step of determining the target MPU from the candidate MPUs based on the resource type priority corresponding to the multiple types of resources and the remaining amounts of the multiple types of resources in the candidate MPUs can be implemented as: In response to determining that the number of candidate MPUs with the largest remaining amount of unified storage resource is one, the candidate MPU with the largest remaining amount of unified storage resource is determined as the target MPU; or in response to determining that the number of candidate MPUs with the largest remaining amount of unified storage resource is multiple, the target MPU is determined from the multiple candidate MPUs based on the task identification resource.

[0077] In response to determining that the number of candidate MPUs with the largest remaining amount of unified storage resource is one, the candidate MPU with the largest remaining amount of unified storage resource is determined as the target MPU; or in response to determining that the number of candidate MPUs with the largest remaining amount of unified storage resource is multiple, the target MPU is determined from the multiple candidate MPUs based on the task identification resource.

[0078] Further, in the specific implementation, the multiple types of resources corresponding to the computing task can further include at least one of shared cache resource and register resource on the basis of the unified storage resource and the task identification resource, and the process of determining the target MPU can be performed according to the above embodiments, which will not be described herein again.

[0079] To deepen the understanding, the present disclosure further gives a specific implementation scheme in combination with one specific application scenario, and provides a task dynamic scheduling scheme based on resource perception, which can be applied to cores (corresponding to the computing core in the above embodiments) of a multi-core GPU, each GPU core includes multiple MPUs, and each MPU has independent resources. In the implementation scheme, the key resources for executing the task include two types of resources, US and task ID, and the credit value required for executing the task is 1 (corresponding to the required credit value in the above embodiments).

[0080] Please refer to Figure 3The task scheduling system 300 can include a task receiving module 31, a credit management module 32, a resource monitoring module 33, a scheduling decision module 34, an arbitration module 35, a task dispatch module 36, and a state update module 37.

[0081] In the embodiments of the present disclosure, the task receiving module can include a buffer queue 311 and a task parsing unit 312. The GPU core to-be-executed WG (corresponding to the computing task to be scheduled in the above embodiment) received by the task receiving module can be stored in the buffer queue, and the task parsing unit is configured to extract various resource information required by the to-be-executed WG, including the demand amount of the Unified Store resource and the demand amount of the Task ID resource.

[0082] The credit management module is configured to maintain and update the credit count of each MPU (corresponding to the remaining credit value in the above embodiment), and to realize the task deliverability judgment. The credit management module can maintain the credit counter of each MPU in the form of a credit state table, and the initial value of the credit counter is the maximum value of the WG that can be received by each MPU. When scheduling a task, the credit count of each MPU is first queried, and only the MPU with a credit count greater than 0 is selected as a candidate (i.e., only the MPU with a credit count greater than or equal to 1 is selected as a candidate). For example, each time a task / WG is delivered to an MPU, the credit count corresponding to the MPU is reduced by 1, and when the MPU completes the task and returns a corresponding signal, the credit count corresponding to the MPU is increased by 1.

[0083] The resource monitoring module is configured to maintain a resource state table, which records the resource usage of each MPU, i.e., records the remaining amount of the Unified Store resource and the remaining amount of the Task ID resource of each MPU. For the candidate MPU with a credit count greater than 0 selected by the credit management module, it is queried whether the remaining resources of the MPU meet the task requirements, i.e., whether the remaining amount of each type of resource can cover the corresponding demand amount, and resource matching is performed. For the MPU with insufficient resources, the MPU with insufficient resources is excluded from the candidate MPUs.

[0084] Exemplarily, a GPU core contains 4 MPUs, and receives a WG to be scheduled, and the resource demand required for running the Workgroup is obtained by analysis: 1 Task ID; 32 KB Unified Store.

[0085] The resource state of the 4 MPUs at this time (before executing the task) is shown in Table 1 below: Table 1

[0086] The above scheduling decision module is used to select the candidate MPU in combination with the Credit Count and the resource state table. Optionally, when the multiple candidate MPUs screened by the above resource monitoring module all have a Credit count greater than 0 (i.e. the available Credit in Table 1 above) and sufficient resources, the resource remaining amount of each candidate MPU is selected according to the priority: first, compare the remaining amount of Unified Store of each candidate MPU; if the remaining amount of Unified Store is the same, compare the remaining amount of Task ID of each candidate MPU. If the remaining amounts of the two resources are equal, enter the Round Robin step.

[0087] The above arbitration module is used to select a target MPU by using the Round Robin arbitration strategy in the case that the multiple candidate MPUs have the same condition, i.e. the resource remaining amount is equal, so as to ensure the fairness of scheduling.

[0088] Exemplarily, continuing the above example, all MPUs are traversed, and the MPU with sufficient Credit is given priority, wherein MPU2 does not have sufficient Credit, and the candidate MPUs are MPU0, MPU1 and MPU3. Further, the resource state of the candidate MPU0, MPU1 and MPU3 is checked respectively, wherein the Unified Store and Task ID of MPU0 and MPU3 both meet the demand, and the Unified Store of MPU1 does not meet the demand, and the candidate MPUs are MPU0 and MPU3.

[0089] According to the resource type priority, MPU0 and MPU3 are selected from the candidate MPUs, and the remaining Unified Store (i.e. the available US) is given priority, and if they are equal, the remaining Task ID (i.e. the available Task ID) is further considered, wherein the available Task ID of MPU3 is the most, and finally MPU3 is the best choice.

[0090] The above task distribution module is used to distribute or schedule the task to the final target MPU determined by the arbitration module.

[0091] The state updating module is configured to update the Credit Count of the target MPU in the credit state table and the UnifiedStore size (Size) and Task ID count value (Count) of the target MPU in the resource state table when the task distribution module distributes a task to the selected target MPU, and update the Credit Count of the target MPU and release the corresponding resources by updating each state table when the target MPU finishes executing the task and returns a corresponding signal, so as to ensure the accuracy of subsequent scheduling.

[0092] For example, in the above example, the WG is scheduled to the buffer queue of MPU3, and is sent to MPU3. The state updating module updates the Credit and resource state of MPU3 accordingly, and the result is shown in Table 2 as follows: Table 2

[0093] For example, the task scheduling system 300 can be implemented as a front-end scheduler of a GPU core, that is, the front-end scheduler implements task scheduling by using the above-mentioned scheduling strategy based on Credit and resource awareness, and maintains a Credit counter and a corresponding state table for each MPU.

[0094] When the execution of the WG on MPU3 ends, MPU3 feeds back the end of the task and the amount of released resources, and the state updating module updates the Credit Count and the resource state table.

[0095] The implementation scheme provided by the embodiments of the present disclosure has the following beneficial effects: (1) Avoiding task back pressure and resource shortage, and ensuring scheduling stability: by introducing a Credit Count management mechanism, the Credit state of the downstream MPU is checked before the task is allocated (for example, the GPU core front-end scheduler can perform the checking), so as to ensure that the task is only distributed to the MPU that is capable of receiving the task, avoid performance reduction caused by task back pressure, and improve the stability of the system. On the basis of Credit checking, the remaining resource situation of the MPU is further considered, and it is ensured that the task distribution does not exceed the resource carrying capacity of the MPU, so as to avoid the situation that the MPU cannot execute the task in time due to insufficient resources.

[0096] (2) Improve resource utilization: scheduling decisions not only rely on Credit, but also introduce resources such as Unified Store and Task ID required for task execution as reference basis, i.e. in the scheduling process, the use of key resources such as Unified Store and Task ID is considered, and the most abundant MPU is dynamically selected, so that the task is preferentially allocated to the most abundant MPU, thereby reducing the situation that the task cannot be executed due to insufficient resources, improving the overall utilization of GPU internal resources, and improving the execution efficiency of the task.

[0097] (3) Realize multi-dimensional load balancing: by dynamically monitoring the resource and Credit state of multiple MPUs, Credit management and resource monitoring are combined, so that tasks can be evenly distributed on different MPUs, avoiding the situation that some MPUs are overloaded while others are idle, improving overall throughput and resource utilization, and improving parallel execution efficiency. At the same time, a rotation arbitration mechanism is introduced, when the remaining resources of multiple MPUs are the same, a rotation arbitration method is used to select the target MPU, ensuring that the scheduling result is fair, avoiding the situation that some MPUs are in a "starvation" state for a long time, and ensuring the fairness of scheduling.

[0098] (4) Strong flexibility and scalability: support dynamic adjustment of resource priority, can increase the perception of other resources such as "registers" and "shared caches" according to the characteristics of different GPU architectures, to adapt to different application load characteristics, and only a little logic needs to be added to the scheduler.

[0099] In this way, through the implementation scheme, the situation of uneven load in GPU scheduling can be avoided, by selecting the MPU with the most remaining resources required for task execution when multiple MPUs have Credit and required resources, and when the resource conditions of multiple MPUs are the same, a rotation arbitration mechanism can be further introduced to ensure the load balancing of tasks between MPUs.

[0100] Further reference Figure 4 , as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a task scheduling device, which corresponds to the method embodiment shown in Figure 1 , and the device can be applied in various electronic devices (such as GPUs, etc.).

[0101] As Figure 4As shown, the task scheduling apparatus 400 of the embodiments of the present disclosure can include a determining module 401, a screening module 402 and a scheduling module 403. The determining module 401 is configured to, in response to receiving a to-be-scheduled computing task, determine a demand credit value corresponding to the computing task and a demand amount of resources, and determine a remaining amount of resources in each microprocessor MPU and a remaining credit value of each MPU. The screening module 402 is configured to determine a target MPU from the MPUs based on the demand credit value, the demand amount of resources, the remaining amount of resources in each MPU and the remaining credit value of each MPU. The scheduling module 403 is configured to schedule the computing task to the target MPU.

[0102] In the task scheduling apparatus 400 provided by the embodiments of the present disclosure, the specific processes of the determining module 401, the screening module 402 and the scheduling module 403 and the technical effects brought by the specific processes can be respectively referred to the specific processes of the determining module 401, the screening module 402 and the scheduling module 403 and the technical effects brought by the specific processes. Figure 1 The related descriptions of steps 101-103 in the corresponding embodiments will not be repeated here.

[0103] In some optional implementations of the embodiments of the present disclosure, the screening module 402 is further configured to: determine, as a candidate MPU, an MPU in which the remaining credit value is greater than or equal to the demand credit value and the remaining amount of resources is greater than or equal to the demand amount of resources; and determine the target MPU from the candidate MPUs.

[0104] In some optional implementations of the embodiments of the present disclosure, the screening module 402 is further configured to: in a case where the type of resources corresponding to the computing task is one type, determine the target MPU based on an MPU in which the remaining amount of resources is the largest among the candidate MPUs.

[0105] In some optional implementations of the embodiments of the present disclosure, the screening module 402 is further configured to: in a case where the type of resources corresponding to the computing task is multiple types, determine the target MPU from the candidate MPUs based on a resource type priority corresponding to the multiple types of resources and the remaining amounts of the multiple types of resources in the candidate MPUs.

[0106] In some optional implementations of the embodiments of the present disclosure, the screening module 402 is further configured to: determine a target type of resources according to the resource type priority; and determine the target MPU from the candidate MPUs based on the target type of resources; wherein in response to determining that the number of candidate MPUs in which the remaining amount of the target type of resources is the largest is multiple, determine a next round of target type of resources according to the resource type priority, and continue to determine the target MPU based on the next round of target type of resources.

[0107] In some optional implementation of the embodiments of the present disclosure, the screening module 402 is further configured to: in response to determining that the number of the candidate MPU with the largest remaining amount of the target type of resource is one, determine the candidate MPU with the largest remaining amount of the target type of resource as the target MPU.

[0108] In some optional implementation of the embodiments of the present disclosure, the screening module 402 is further configured to: in response to traversing all the types of resource according to the resource type priority, and determining the plurality of intermediate MPUs based on the target type of resource with the lowest priority, determine the target MPU from the plurality of intermediate MPUs.

[0109] In some optional implementation of the embodiments of the present disclosure, the screening module 402 is further configured to perform one of the following: determine the target MPU from the plurality of intermediate MPUs based on a result of round-robin arbitration on the plurality of intermediate MPUs; determine the target MPU from the plurality of intermediate MPUs based on MPU priorities corresponding to the plurality of intermediate MPUs; and determine the target MPU from the plurality of intermediate MPUs based on depths of task queues respectively corresponding to the plurality of intermediate MPUs.

[0110] In some optional implementation of the embodiments of the present disclosure, the plurality of types of resource includes unified storage resource and task identification resource, and the resource type priority indicates that the priority of the unified storage resource is higher than the priority of the task identification resource; and the screening module 402 is further configured to: in response to determining that the number of the candidate MPU with the largest remaining amount of the unified storage resource is one, determine the candidate MPU with the largest remaining amount of the unified storage resource as the target MPU; or in response to determining that the number of the candidate MPU with the largest remaining amount of the unified storage resource is a plurality, determine the target MPU from the plurality of candidate MPUs based on the task identification resource.

[0111] In some optional implementation of the embodiments of the present disclosure, the plurality of types of resource further includes at least one of shared cache resource and register resource.

[0112] In some optional implementation of the embodiments of the present disclosure, the task scheduling apparatus 400 can further include an updating module (not shown in the figure) configured to update the remaining credit value corresponding to the target MPU and the remaining amount of the resource recorded in the resource state table based on the demand amount of the resource.

[0113] The embodiment can exist as a device embodiment corresponding to the above method embodiment. When receiving a to-be-scheduled computing task, the device embodiment can analyze and determine a required amount of resources required for executing the computing task and a demand credit value corresponding to the computing task, and determine a remaining credit value and a remaining amount of resources in each MPU in a GPU computing core corresponding to the computing task, and based on this, screen a target MPU that meets the computing task and can receive the computing task from the MPUs included in the GPU computing core. In this way, resource-aware task dynamic scheduling can be implemented to improve task execution efficiency while ensuring task load balancing between MPUs, thereby improving resource utilization.

[0114] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to implement the task scheduling method described in any of the above embodiments when executed.

[0115] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer readable storage medium, which stores computer instructions for enabling a computer to implement the task scheduling method described in any of the above embodiments when executed.

[0116] According to an embodiment of the present disclosure, the present disclosure further provides a computer program product, which comprises a computer program executable by a processor to implement the task scheduling method described in any of the above embodiments.

[0117] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the present disclosure described and / or claimed in this document.

[0118] As Figure 5As shown, the electronic device 500 includes a computing unit 501 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0119] A plurality of components in the electronic device 500 are connected to the I / O interface 505, including an input unit 506 such as a keyboard, a mouse, and the like, an output unit 507 such as various types of displays, a speaker, and the like, a storage unit 508 such as a magnetic disk, an optical disk, and the like, and a communication unit 509 such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0120] The computing unit 501 can be various general and / or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, and the like. The computing unit 501 performs various methods and processes described above, such as the task scheduling method. For example, in some embodiments, the task scheduling method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the task scheduling method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the task scheduling method by any other appropriate means, such as by means of firmware.

[0121] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0122] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, or entirely on a remote machine or server.

[0123] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical conductors, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0124] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0125] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0126] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain. Among them, the cloud server is also called a cloud computing server or a cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and virtual private server (VPS, Virtual Private Server) services.

[0127] According to the technical scheme provided by the embodiment of the present disclosure, when a to-be-scheduled computing task is received, the required amount of resources required for executing the computing task and the demand credit value corresponding to the computing task can be determined, and the remaining credit value and the remaining amount of resources in each MPU in the GPU computing core corresponding to the computing task are determined, and based on this, a target MPU that meets the computing task and can receive the computing task is selected from the MPUs included in the GPU computing core. In this way, the task dynamic scheduling based on resource awareness can be realized, so as to improve the task execution efficiency while ensuring the task load balancing between the MPUs, thereby improving the resource utilization.

[0128] It should be understood that the steps shown above can be reordered, added, or deleted. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical scheme of the present disclosure can be achieved, and the present disclosure is not limited herein.

[0129] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A task scheduling method, comprising: In response to receiving a computing task to be scheduled, the system determines the required credit value and resource requirement corresponding to the computing task, and determines the remaining resource quantity and remaining credit value of each microprocessor (MPU). Based on the demand credit value, the demand amount of the resources, the remaining amount of resources in each MPU, and the remaining credit value of each MPU, a target MPU is determined from each MPU; The computing task is scheduled to the target MPU.

2. The method according to claim 1, wherein, The step of determining the target MPU from the MPUs based on the demand credit value, the demand amount of the resources, the remaining amount of resources in each MPU, and the remaining credit value of each MPU includes: The MPUs whose remaining credit value is greater than or equal to the demand credit value and whose remaining resource quantity is greater than or equal to the demand quantity of the resource are identified as candidate MPUs. The target MPU is determined from the candidate MPUs.

3. The method according to claim 2, wherein, Determining the target MPU from the candidate MPUs includes: If the type of resource corresponding to the computing task is one, the target MPU is determined based on the MPU with the largest remaining resource among the candidate MPUs.

4. The method according to claim 2, wherein, Determining the target MPU from the candidate MPUs includes: When there are multiple types of resources corresponding to the computing task, the target MPU is determined from the candidate MPUs based on the resource type priority corresponding to the multiple types of resources and the remaining amount of the multiple types of resources in the candidate MPUs.

5. The method according to claim 4, wherein, The step of determining the target MPU from the candidate MPUs based on the resource type priority corresponding to multiple resource types and the remaining amount of the multiple resource types in the candidate MPUs includes: Determine the target type of resources according to the priority of the resource types described above; Based on the resources of the target type, the target MPU is determined from the candidate MPUs; wherein, in response to the determination of multiple candidate MPUs with the largest remaining amount of resources of the target type, the resources of the target type in the next round are determined according to the priority of the resource type, and the target MPU is further determined based on the resources of the target type in the next round.

6. The method according to claim 5, wherein, The method further includes: In response to determining that the number of candidate MPUs with the largest remaining amount of resources of the target type is one, the candidate MPU with the largest remaining amount of resources of the target type is determined as the target MPU.

7. The method according to claim 5, wherein, The method includes: In response to traversing the multiple resource types according to the resource type priority and determining multiple intermediate MPUs based on the lowest priority target type resource, the target MPU is determined from the multiple intermediate MPUs.

8. The method according to claim 7, wherein, Determining the target MPU from the plurality of intermediate MPUs includes one of the following: Based on the results of the round-robin arbitration of the plurality of intermediate MPUs, the target MPI is determined from the plurality of intermediate MPUs; The target MPU is determined from the plurality of intermediate MPUs based on the MPU priority corresponding to the plurality of intermediate MPUs; The target MPU is determined from the multiple intermediate MPUs based on the depth of the task queues corresponding to each of the multiple intermediate MPUs.

9. The method according to claim 4, wherein, The various types of resources include unified storage resources and task identification resources, and the resource type priority indicates that the priority of the unified storage resources is higher than the priority of the task identification resources; as well as The step of determining the target MPU from the candidate MPUs based on the resource type priority corresponding to multiple resource types and the remaining amount of the multiple resource types in the candidate MPUs includes: In response to determining that the number of candidate MPUs with the largest remaining amount of the unified storage resource is one, the candidate MPU with the largest remaining amount of the unified storage resource is determined as the target MPU; or In response to determining that there are multiple candidate MPUs with the largest remaining amount of the unified storage resources, the target MPU is determined from the multiple candidate MPUs based on the task identifier resource.

10. The method according to claim 9, wherein, The various types of resources also include at least one of shared cache resources and register resources.

11. The method according to any one of claims 1 to 10, wherein, The method further includes: Based on the demand for the resources, update the remaining credit value and remaining amount of resources corresponding to the target MPU recorded in the resource status table.

12. A task scheduling device, comprising: The determination module is configured to, in response to receiving a computing task to be scheduled, determine the demand credit value and resource demand corresponding to the computing task, and determine the remaining resource amount and remaining credit value of each microprocessor (MPU). The filtering module is configured to determine a target MPU from the MPUs based on the demand credit value, the demand amount of the resources, the remaining resources of each MPU, and the remaining credit value of each MPU. The scheduling module is configured to schedule the computing tasks to the target MPU.

13. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the task scheduling method according to any one of claims 1-11.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the task scheduling method according to any one of claims 1-11.

15. A computer program product comprising a computer program, wherein, When the computer program is executed by the processor, it implements the task scheduling method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Scheduling method and device and storage medium

    CN117651063A

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

    CN119718658A

  • Credit-based scheduling using load prediction

    US20230401089A1