Method and system for constructing scheduling model, and method and system for scheduling target task
By building a multi-layer scheduling model and using different scheduling algorithms and object structures, the problem of low task allocation efficiency in heterogeneous multi-core architecture is solved, and efficient allocation and processing of tasks on multi-core processing systems is achieved.
Patent Information
- Application Number
- PCT/CN2024/107549
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-28
- Filing Date
- 2024-07-25
- Publication Date
- 2025-03-06
AI Technical Summary
In a heterogeneous multi-core architecture, how to allocate computing tasks reasonably and efficiently to give full play to the advantages of computing power has become a challenge.
A method of building a multi-layer scheduling model is provided. By constructing multiple levels of scheduling models, including the first, second and third layer scheduling models, it is used to schedule tasks at different levels of the multi-core processing system, and different scheduling algorithms (such as fair polling algorithms, greedy algorithms, etc.) and object structures (such as chain structures, graph structures, etc.) are used to optimize task allocation.
Through the use of multi-layer scheduling models, it is possible to achieve reasonable and efficient allocation of tasks on the multi-core processing system, make full use of the computing power of the multi-core processing system, and improve the processing efficiency and memory access efficiency of processing complex computing tasks.
Smart Images

Figure CN2024107549_06032025_PF_FP_ABST
Abstract
Description
Method and system for constructing scheduling model, method and system for scheduling target tasks Technical Field
[0001] The present application relates to the field of computer technology, and more particularly to a method and system for constructing a multi-layer scheduling model, a method and system for scheduling target tasks on a multi-core processing system, and a computer storage medium. Background Art
[0002] As computing models in businesses like the Internet of Things, artificial intelligence, and big data become increasingly complex, policy logic is growing larger and more complex, placing increasing demands on computer data processing capabilities. Furthermore, different applications require different types of computing power, typically including scalar, vector, and matrix cores. However, due to limitations in design complexity and physical implementation, a single core cannot provide sufficient computing power. Furthermore, a single core type cannot provide efficient processing for different operations or is too complex to implement. Therefore, heterogeneous multi-core architectures have gradually become the preferred architecture for providing high-performance computing power.
[0003] In heterogeneous multi-core architectures, with the increasing number of cores and specialized core types for accelerating certain types of operations, the rational and efficient allocation of computing tasks within the heterogeneous multi-core architecture is becoming increasingly important for the actual utilization of computing power. Therefore, it is desirable to provide a universal task scheduling model to implement task scheduling on heterogeneous multi-core architectures.
[0004] Summary of the Invention
[0005] In order to solve or at least alleviate one or more of the above problems, the following technical solutions are provided.
[0006] According to a first aspect of the present application, a method for constructing a multi-layer scheduling model is provided, wherein the multi-layer scheduling model is used to schedule a target task on a multi-core processing system, wherein the multi-core processing system includes a first device and a second device, wherein the first device and the second device each include multiple clusters, and each cluster includes multiple cores. The method includes the following steps: constructing a first-layer scheduling model, wherein the first-layer scheduling model is used to schedule the target task between the first device and the second device according to a first scheduling algorithm; constructing a second-layer scheduling model, wherein the second-layer scheduling model is used to schedule subtasks of the target task between multiple clusters within the first device or the second device according to a second scheduling algorithm; and constructing the multi-layer scheduling model based at least on a cascade of the first-layer scheduling model and the second-layer scheduling model.
[0007] According to the method for constructing a multi-layer scheduling model described in one embodiment of the present application, the method also includes: constructing a third-layer scheduling model, the third-layer scheduling model is used to schedule the subtasks of the subtasks of the target task among the multiple cores in each cluster according to a third scheduling algorithm; and constructing the multi-layer scheduling model based on at least the cascade of the first-layer scheduling model, the second-layer scheduling model and the third-layer scheduling model.
[0008] According to the method for constructing a multi-layer scheduling model described in one embodiment of the present application or any of the above embodiments, the first scheduling algorithm, the second scheduling algorithm and the third scheduling algorithm each include one or more of the following: a fair polling algorithm, a weighted polling algorithm, a least idle first algorithm, a greedy algorithm, and a load balancing-based algorithm.
[0009] According to the method for constructing a multi-layer scheduling model according to one embodiment or any of the above embodiments of the present application, the target task, the subtasks of the target task and the subtasks of the subtasks of the target task each include multiple objects, and the multiple objects are represented based on a combination of one or more of the following structures: a chain structure, a graph structure and a multidimensional array structure.
[0010] According to the method for constructing a multi-layer scheduling model according to one embodiment of the present application or any of the above embodiments, one object in the target task is a plurality of objects included in the subtasks of the target task, and one object in the subtask of the target task is a plurality of objects included in the subtask of the subtask of the target task.
[0011] According to the method for constructing a multi-layer scheduling model according to one embodiment of the present application or any of the above embodiments, at least two objects among the multiple objects are selectively implemented as a first synchronization object and a second synchronization object, and the first synchronization object is configured to start execution in response to the completion of execution of the second synchronization object.
[0012] According to the method for constructing a multi-layer scheduling model in one embodiment or any of the above embodiments of the present application, the first device and the second device are each implemented as a combination of one or more of the following types: a computing device, a storage device, a data moving device, and a data transmission device.
[0013] According to the method for constructing a multi-layer scheduling model described in one embodiment or any of the above embodiments of the present application, the first-layer scheduling model, the second-layer scheduling model and the third-layer scheduling model each include: an object parsing module, which is configured to obtain the target task, the subtask of the target task and one of the subtasks of the subtask of the target task and control information based on the task scheduling request issued by the upper-layer scheduling model, allocate storage resources for the task scheduling request and issue the target task, the subtask of the target task and one of the subtasks of the subtask of the target task based on the control information; a scheduling module, which is configured to execute the task scheduling according to the first scheduling algorithm, the second scheduling algorithm and the third scheduling algorithm. One of the degree algorithm and the third scheduling algorithm schedules the corresponding target task, the subtask of the target task and the subtask of the subtask of the target task on the current layer of equipment resources; an object distribution module is configured to convert the corresponding target task, the subtask of the target task and the subtask of the subtask of the target task scheduled on the current layer of equipment resources into a task form adapted to the next layer scheduling model and issue it based on the usage of the next layer of equipment resources; and a device management module is configured to provide the usage of the current layer of equipment resources and the usage of the next layer of equipment resources to the scheduling module and / or the object distribution module.
[0014] According to the method for constructing a multi-layer scheduling model according to one embodiment of the present application or any of the above embodiments, the scheduling module is further configured to: schedule the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task on the device resources of the current layer according to one of the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm based on the usage of the device resources of the current layer and the usage of the device resources of the next layer.
[0015] According to the method for constructing a multi-layer scheduling model described in one embodiment of the present application or any of the above embodiments, the object distribution module is further configured to: receive a task completion message from the next layer scheduling model, and send the task identification information and corresponding device resource usage obtained based on the task completion message to the scheduling module.
[0016] According to the method for constructing a multi-layer scheduling model described in one embodiment of the present application or any of the above embodiments, the scheduling module is further configured to: update the task completion status and the usage of the current layer equipment resources based on the task identification information and the usage of the corresponding equipment resources; schedule the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task on the current layer equipment resources according to one of the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm based on the updated task completion status and the usage of the current layer equipment resources; and in response to the updated task completion status indicating that the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task are completed, send a message to the object resolution module to indicate the completion of the task scheduling request.
[0017] According to the method for constructing a multi-layer scheduling model described in one embodiment of the present application or any of the above embodiments, the object parsing module is further configured to: in response to receiving a message indicating the completion of a task scheduling request, send the message indicating the completion of the task scheduling request to the upper-level scheduling model and reclaim the storage resources allocated for the task scheduling request.
[0018] According to the second aspect of the present application, a method for scheduling a target task on a multi-core processing system is provided, the method comprising the following steps: receiving a task scheduling request; and inputting the task scheduling request into a multi-layer scheduling model to generate a scheduling result of the target task on the multi-core processing system, wherein the multi-layer scheduling model is constructed according to the method for constructing a multi-layer scheduling model described in the first aspect of the present application.
[0019] According to a third aspect of the present application, a system for constructing a multi-layer scheduling model is provided, the system comprising: a memory; a processor coupled to the memory; and a computer program stored on the memory and running on the processor, wherein the execution of the computer program results in the execution of the steps of the method for constructing a multi-layer scheduling model according to the first aspect of the present application.
[0020] According to the fourth aspect of the present application, a system for scheduling target tasks on a multi-core processing system is provided, the system comprising: a memory; a processor coupled to the memory; and a computer program stored on the memory and running on the processor, the execution of the computer program resulting in the execution of the steps of the method for scheduling target tasks on a multi-core processing system according to the second aspect of the present application.
[0021] According to a fifth aspect of the present application, a computer storage medium is provided, which includes instructions, and the instructions, when run, execute the steps of the method for constructing a multi-layer scheduling model according to the first aspect of the present application.
[0022] According to a sixth aspect of the present application, a computer storage medium is provided, which includes instructions, which, when run, execute the steps of the method for scheduling target tasks on a multi-core processing system according to the second aspect of the present application.
[0023] The solution for constructing a multi-layer scheduling model according to one or more embodiments of the present application can construct a universal task scheduling model to reasonably and efficiently schedule various target tasks on a multi-core processing system, thereby fully utilizing the computing power of the multi-core processing system in task allocation and scheduling, thereby fully leveraging the advantages of the multi-core processing system and improving the processing efficiency and memory access efficiency of using the multi-core processing system to handle complex computing tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and / or other aspects and advantages of the present application will become clearer and easier to understand through the following description of various aspects in conjunction with the accompanying drawings, in which the same or similar elements are represented by the same reference numerals. The accompanying drawings include:
[0025] FIG1 shows a schematic block diagram of a typical multi-core processing system.
[0026] FIG2 shows a flowchart of a method for constructing a multi-layer scheduling model according to one or more embodiments of the present application.
[0027] FIG3 shows a schematic block diagram of a multi-layer scheduling model according to one or more embodiments of the present application.
[0028] FIG4 shows a schematic block diagram of a single-layer scheduling model according to one or more embodiments of the present application.
[0029] 5A-5C are schematic diagrams showing the structures of target tasks according to one or more embodiments of the present application.
[0030] 6A-6B are schematic diagrams illustrating synchronization between multiple objects of a target task according to one or more embodiments of the present application.
[0031] FIG7 shows a flowchart of a method for scheduling a target task on a multi-core processing system according to one or more embodiments of the present application.
[0032] 8A-8C are schematic block diagrams showing typical target tasks and their subtasks.
[0033] FIG9 shows a block diagram of a system for constructing a multi-layer scheduling model according to one or more embodiments of the present application.
[0034] FIG10 shows a block diagram of a system for scheduling target tasks on a multi-core processing system according to one or more embodiments of the present application. DETAILED DESCRIPTION
[0035] The present application is described more fully below with reference to the accompanying drawings, which illustrate exemplary embodiments of the present application. However, the present application may be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. The foregoing embodiments are provided to make the disclosure herein comprehensive and complete, so as to more fully convey the scope of protection of the present application to those skilled in the art.
[0036] In this specification, terms such as "comprise" and "include" indicate that in addition to the units and steps directly and clearly stated in the specification and claims, the technical solution of this application does not exclude the situation where it has other units and steps that are not directly or clearly stated.
[0037] Unless otherwise specified, terms such as "first" and "second" do not indicate the order of units in terms of time, space, size, etc., but are only used to distinguish between units.
[0038] Hereinafter, various exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings.
[0039] FIG1 shows a schematic block diagram of a typical multi-core processing system.
[0040] As shown in FIG1 , a multi-core processing system 100 includes a CPU device 110, a Vector device 120, a Matrix device 130, and a Direct Memory Access (DMA) device 140. For example, the CPU device 110 may include K CPU clusters, each of which may include k CPU cores. The Vector device 120 may include P Vector clusters, each of which may include p Vector cores. The Matrix device 130 may include M Matrix clusters, each of which may include m Matrix cores. The DMA device 140 may include N DMA clusters, each of which may include n DMA cores.
[0041] It should be noted that the multi-core processing system 100 shown in FIG1 is merely exemplary. In addition to being implemented as including a CPU device 110, a Vector device 120, a Matrix device 130, and a DMA device 140, the multi-core processing system 100 may also include a combination of one or more of the following device types: computing devices, such as a CPU, GPU, NPU, DSP, etc.; data movement devices, such as DMA, etc.; storage devices, such as DDR, cache, etc.; and data transmission devices, such as transmission interfaces such as XGE, PCIE, and SRIO. For example, in addition to being implemented as including a CPU device 110, a Vector device 120, a Matrix device 130, and a DMA device 140, the multi-core processing system 100 may also be implemented as including a CPU device, a Vector device, a Matrix device, a hybrid of Matrix and Vector devices, and a DMA device.
[0042] It should be noted that each device type corresponds to different device resource types. For example, the device resource types corresponding to computing devices may include the number of execution units, the memory size of the core, the number of registers, etc. The device resource types corresponding to storage devices may include the storage space size of various levels, etc., and the device resource types corresponding to data movement devices and data transmission devices may include the number of logical channels, etc.
[0043] FIG2 shows a flowchart of a method for constructing a multi-layer scheduling model according to one or more embodiments of the present application. The multi-layer scheduling model is used to schedule target tasks on a multi-core processing system. The multi-core processing system may include a first device and a second device, each of which includes multiple clusters, each of which includes multiple cores. Optionally, the first device and the second device may each be implemented as a combination of one or more of the following types: a computing device, a storage device, a data moving device, and a data transmission device. Exemplarily, the method for constructing a multi-layer scheduling model according to one or more embodiments of the present application will be described below with reference to the multi-core processing system 100 shown in FIG1 .
[0044] As shown in FIG. 2 , in step S201 , a first-layer scheduling model is constructed, where the first-layer scheduling model is used to schedule a target task between a first device and a second device according to a first scheduling algorithm.
[0045] For example, referring to the multi-core processing system 100 shown in FIG1 , the first-level scheduling model may be used to schedule target tasks among the CPU device 110 , the Vector device 120 , the Matrix device 130 , and the DMA device 140 according to a first scheduling algorithm.
[0046] In step S203, a second-layer scheduling model is constructed, where the second-layer scheduling model is used to schedule subtasks of the target task among multiple clusters in the first device or the second device according to a second scheduling algorithm.
[0047] For example, referring to the multi-core processing system 100 shown in Figure 1, the second-level scheduling model can be used to schedule the subtasks of the target task between the K CPU clusters within the CPU device 110 according to the second scheduling algorithm, or the second-level scheduling model can be used to schedule the subtasks of the target task between the P Vector clusters within the Vector device 120 according to the second scheduling algorithm, or the second-level scheduling model can be used to schedule the subtasks of the target task between the M Matrix clusters within the Matrix device 130 according to the second scheduling algorithm, or the second-level scheduling model can be used to schedule the subtasks of the target task between the N DMA clusters within the DMA device 140 according to the second scheduling algorithm.
[0048] In step S205 , a multi-layer scheduling model is constructed based on at least the cascade of the first-layer scheduling model and the second-layer scheduling model.
[0049] Optionally, the method for constructing a multi-layer scheduling model according to one or more embodiments of the present application may further include constructing a third-layer scheduling model, wherein the third-layer scheduling model is used to schedule subtasks of subtasks of the target task among multiple cores within each cluster according to a third scheduling algorithm, and constructing a multi-layer scheduling model based on at least a cascade of the first-layer scheduling model, the second-layer scheduling model, and the third-layer scheduling model. For example, with reference to the multi-core processing system 100 shown in FIG1 , the third-layer scheduling model may be used to schedule subtasks of subtasks of the target task among k cores within CPU cluster 1 according to a third scheduling algorithm, or the third-layer scheduling model may be used to schedule subtasks of subtasks of the target task among p cores within Vector cluster 0 according to a third scheduling algorithm, or the third-layer scheduling model may be used to schedule subtasks of subtasks of the target task among m cores within Matrix cluster 0 according to a third scheduling algorithm, or the third-layer scheduling model may be used to schedule subtasks of subtasks of the target task among n cores within DMA cluster 1 according to a third scheduling algorithm.
[0050] Optionally, the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm can each be independently implemented as a fair round-robin algorithm, a weighted round-robin algorithm, a least idle first algorithm, a greedy algorithm, a load balancing-based algorithm, etc. By flexibly selecting the scheduling algorithm of each layer of scheduling module, the processing efficiency and memory access efficiency of the multi-layer scheduling module in handling complex computing tasks can be improved.
[0051] Optionally, the target task, the subtask of the target task and the subtask of the subtask of the target task can each include multiple objects, and the multiple objects can be represented based on a combination of one or more of the following structures: a chain structure, a graph structure and a multidimensional array structure. It should be noted that the object can be understood as the execution steps in the above-mentioned tasks, subtasks and subtasks of subtasks. Optionally, an object in the target task can be a plurality of objects included in the subtask of the target task, and an object in the subtask of the target task can be a plurality of objects included in the subtask of the subtask of the target task. Optionally, at least two of the multiple objects can be selectively implemented as a first synchronization object and a second synchronization object, and the first synchronization object is configured to start execution in response to the completion of the execution of the second synchronization object. The exemplary structure of the target task, the subtask of the target task and the subtask of the subtask of the target task will be further described in conjunction with Figure 5, and the schematic process for synchronizing between the multiple objects of the target task will be further described in conjunction with Figure 6.
[0052] Optionally, the first-layer scheduling model, the second-layer scheduling model and the third-layer scheduling model can each include an object parsing module, a scheduling module, an object distribution module and a device management module. The following will further describe the schematic block diagram of the single-layer scheduling model and the multi-layer scheduling model cascaded by multiple single-layer scheduling models in combination with Figures 3 and 4.
[0053] According to the method for constructing a multi-layer scheduling model in accordance with one or more embodiments of the present application, a universal task scheduling model can be constructed to reasonably and efficiently schedule various target tasks on a multi-core processing system, thereby fully utilizing the computing power of the multi-core processing system in task allocation and scheduling, thereby fully leveraging the advantages of the multi-core processing system and improving the processing efficiency and memory access efficiency of using the multi-core processing system to process complex computing tasks. The multi-layer scheduling model constructed in accordance with one or more embodiments of the present application can support a variety of structural forms of target tasks and their subtasks (for example, including but not limited to chain structures, graph structures, multi-dimensional array structures and nesting of these structures), can support the same-layer dependency management of multiple objects of the target task and its subtasks and synchronization between cross-layer objects, and can also support different device types and organizational methods, for example, including but not limited to multiple homogeneous or / and heterogeneous computing resources, storage resources, data movement resources, data transmission resources, etc.
[0054] FIG3 shows a schematic block diagram of a multi-layer scheduling model according to one or more embodiments of the present application.
[0055] As shown in FIG3 , the multi-layer scheduling model 300 includes a first-layer scheduling model 310, a second-layer scheduling model 320, and a third-layer scheduling model 330. The construction process of the multi-layer scheduling model 300 can be implemented with reference to the various steps described above in conjunction with FIG2 . In FIG3 , the multi-layer scheduling model 300 can be configured to receive a task scheduling request, process the received task scheduling request to generate a task scheduling result, and the task scheduling result can indicate the allocation of the target task on the multi-core processing system.
[0056] In one embodiment, the first-layer scheduling model 310 can be configured to schedule the target task in the task scheduling request between the first device and the second device according to a first scheduling algorithm, the second-layer scheduling model 320 can be configured to schedule the subtasks of the target task between multiple clusters within the first device or the second device according to a second scheduling algorithm, and the third-layer scheduling model 330 can be configured to schedule the subtasks of the subtasks of the target task between multiple cores within each cluster according to a third scheduling algorithm. Optionally, the first device and the second device can each be implemented as a combination of one or more of the following types: a computing device, a storage device, a data moving device, and a data transmission device, etc. Optionally, the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm can each be independently implemented as a fair round-robin algorithm, a weighted round-robin algorithm, a least idle first algorithm, a greedy algorithm, a load balancing-based algorithm, etc.
[0057] In one embodiment, the third-layer scheduling model 330 may be configured to generate a response indicating that one or more of the subtasks of the target task are scheduled to be completed, and feed the response back to the second-layer scheduling model 320. The second-layer scheduling model 320 may be configured to determine that one of the subtasks of the target task is scheduled to be completed in response to receiving a response indicating that each of the subtasks of the target task is scheduled to be completed. When it is determined that one or more of the subtasks of the target task are scheduled to be completed, the second-layer scheduling model 320 may be configured to generate a response indicating that one or more of the subtasks of the target task are scheduled to be completed, and feed the response back to the first-layer scheduling model 320. The first-layer scheduling model 310 may be configured to determine that the target task is scheduled to be completed in response to receiving a response indicating that each of the subtasks of the target task is scheduled to be completed. When it is determined that the target task is scheduled to be completed, the first-layer scheduling model 310 may be configured to generate a response indicating that the target task is scheduled to be completed.
[0058] It should be noted that the multi-layer scheduling model 300 shown in Figure 3 is only exemplary. Without departing from the spirit and scope of the present application, the multi-layer scheduling model 300 can be implemented as a single-layer scheduling model, a two-layer scheduling model or more multi-layer scheduling models based on the task-oriented application and the hardware architecture of the multi-core processing system.
[0059] FIG4 shows a schematic block diagram of a single-layer scheduling model according to one or more embodiments of the present application.
[0060] As shown in FIG. 4 , the single-layer scheduling model 400 may include an object parsing module 410 , a scheduling module 420 , an object distribution module 430 , and a device management module 440 .
[0061] The object parsing module 410 can be configured to obtain a target task, a subtask of the target task, a subtask of the subtask of the target task, and control information based on a task scheduling request issued by a previous-layer scheduling model, allocate storage resources for the task scheduling request, and issue the target task, the subtask of the target task, and one of the subtasks of the subtask of the target task to the scheduling module 420 based on the control information. Optionally, the control information may include task structure information (e.g., a chain structure, a graph structure, and a multi-dimensional array structure), device type information corresponding to the task (e.g., a computing device, a storage device, a data moving device, and a data transmission device), and other custom information. In one embodiment, when the single-layer scheduling model 400 is a first-layer scheduling model, the object parsing module 410 can be configured to obtain the target task and control information based on the task scheduling request, and issue the target task to the scheduling module 420 based on the control information, wherein the control information may include target task structure information, device type information corresponding to the target task, and other custom information. In one embodiment, when the single-layer scheduling model 400 is a second-layer scheduling model, the object parsing module 410 can be configured to obtain subtasks and control information of the target task based on the task scheduling request and send the subtasks of the target task to the scheduling module 420 based on the control information, wherein the control information may include structural information of the subtasks of the target task, device type information corresponding to the subtasks of the target task, and other custom information. In one embodiment, when the single-layer scheduling model 400 is a third-layer scheduling model, the object parsing module 410 can be configured to obtain subtasks and control information of the subtasks of the target task based on the task scheduling request and send the subtasks of the subtasks of the target task to the scheduling module 420 based on the control information, wherein the control information may include structural information of the subtasks of the subtasks of the target task, device type information corresponding to the subtasks of the subtasks of the target task, and other custom information.
[0062] The scheduling module 420 can be configured to schedule the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task on the current layer device resources according to one of the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm. Optionally, the scheduling module 420 can be configured to schedule the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task on the current layer device resources according to one of the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm based on the usage of the current layer device resources and the usage of the next layer device resources. In one embodiment, when the single-layer scheduling model 400 is a first-layer scheduling model, the scheduling module 420 can be configured to schedule the target task between the first device and the second device according to the first scheduling algorithm. In one embodiment, when the single-layer scheduling model 400 is a second-layer scheduling model, the scheduling module 420 can be configured to schedule the subtasks of the target task between multiple clusters within the first device or the second device according to the second scheduling algorithm. In one embodiment, when the single-layer scheduling model 400 is a third-layer scheduling model, the scheduling module 420 can be configured to schedule the subtasks of the target task across multiple cores within each cluster according to a third scheduling algorithm. Optionally, the first device and the second device can each be implemented as a combination of one or more of the following types: a computing device, a storage device, a data migration device, and a data transmission device. Optionally, the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm can each be independently implemented as a fair round-robin algorithm, a weighted round-robin algorithm, a least idle first algorithm, a greedy algorithm, a load balancing-based algorithm, and the like.
[0063] The object distribution module 430 can be configured to convert the corresponding target task, subtask of the target task, and one of the subtasks of the subtask of the target task scheduled on the current layer of device resources into a task form adapted to the next layer scheduling model and issue it based on the usage of the next layer of device resources. In one embodiment, when the single-layer scheduling model 400 is a first-layer scheduling model, the object distribution module 430 can be configured to convert the target task scheduled between the first device and the second device into a task form adapted to the second-layer scheduling model (for example, converting an object in the target task of the chain structure into a graph structure) and issue it based on the resource usage of multiple clusters within the first device or the second device. In one embodiment, when the single-layer scheduling model 400 is a second-layer scheduling model, the object distribution module 430 can be configured to convert the subtask of the target task scheduled between multiple clusters within the first device or the second device into a task form adapted to the third-layer scheduling model (for example, converting an object in the subtask of the target task of the graph structure into a multidimensional array structure) and issue it based on the resource usage of multiple cores within each cluster.
[0064] Optionally, the object distribution module 430 can be configured to receive a task completion message from a next-layer scheduling model, and send the task identification information and corresponding device resource usage obtained based on the task completion message to the scheduling module 420. In one embodiment, when the single-layer scheduling model 400 is a first-layer scheduling model, the object distribution module 430 can be configured to receive a task completion message regarding a subtask of the target task from the second-layer scheduling model, and send the task identification information regarding the subtask of the target task obtained based on the task completion message and the resource usage of multiple clusters within the first device or the second device to the scheduling module 420. In one embodiment, when the single-layer scheduling model 400 is a second-layer scheduling model, the object distribution module 430 can be configured to receive a task completion message regarding a subtask of a subtask of the target task from a third-layer scheduling model, and send the task identification information regarding the subtask of the subtask of the target task obtained based on the task completion message and the resource usage of multiple cores within each cluster to the scheduling module 420.
[0065] Optionally, the scheduling module 420 can be configured to: update the task completion status and the usage of the device resources at this layer based on the task identification information and the usage of the corresponding device resources; schedule the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task on the device resources at this layer according to one of the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm based on the updated task completion status and the usage of the device resources at this layer; and send a message indicating the completion of the task scheduling request to the object resolution module 410 in response to the updated task completion status indicating that the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task are completed. In one embodiment, when the single-layer scheduling model 400 is a first-layer scheduling model, the object distribution module 430 can be configured to receive a task completion message regarding the subtask of the target task from the second-layer scheduling model, and send the task identification information regarding the subtask of the target task and the resource usage of multiple clusters within the first device or the second device obtained based on the task completion message to the scheduling module 420. The scheduling module 420 can be configured to update the task completion status of the target task (for example, subtask A in the target task has been completed) and the resource usage of the first device and the second device (for example, CPU cluster 1 occupied by subtask A in the target task has been idle) based on the task identification information of the subtask of the target task and the resource usage of multiple clusters within the first device or the second device, schedule the target task between the first device and the second device according to the first scheduling algorithm based on the updated task completion status of the target task and the resource usage of the first device and the second device, and send a message to the object resolution module 410 to indicate the completion of the task scheduling request in response to the updated task completion status indicating that the target task is completed.
[0066] Optionally, the object resolution module 410 may be configured to, in response to receiving a message indicating completion of the task scheduling request, send a message indicating completion of the task scheduling request to an upper-layer scheduling model and reclaim storage resources allocated for the task scheduling request.
[0067] The device management module 440 may be configured to provide the scheduling module 420 and / or the object distribution module 430 with information on the usage of the device resources of the current layer and the usage of the device resources of the next layer. In one embodiment, the device management module 440 may be configured to provide the scheduling module 420 with information on the usage of the device resources of the current layer and the usage of the device resources of the next layer, and to provide the object distribution module 430 with information on the usage of the device resources of the next layer. In one embodiment, the device management module 440 may be configured to provide the scheduling module 420 with information on the usage of the device resources of the current layer and the usage of the device resources of the next layer, and the scheduling module 420 may further provide the object distribution module 430 with information on the usage of the device resources of the next layer.
[0068] 5A-5C are schematic diagrams showing the structures of target tasks according to one or more embodiments of the present application.
[0069] Figure 5A shows a chain structure of tasks, Figure 5B shows a graph structure of tasks, and Figure 5C shows a multidimensional array structure of tasks (e.g., a three-dimensional array structure in the figure). Referring to Figures 5A-5B , arrows represent dependencies between objects, meaning that the object pointed to by the arrow must wait for the object at the source of the arrow to complete before it can begin execution.
[0070] In one or more embodiments of the present application, a single-layer scheduling model can independently select the structure of the target task. For example, the first-layer scheduling model can select the structure of the target task as the chain structure shown in Figure 5A, the second-layer scheduling model can select the structure of the subtasks of the target task as the graph structure shown in Figure 5B, and the third-layer scheduling model can select the structure of the subtasks of the subtasks of the target task as the three-dimensional array structure shown in Figure 5C.
[0071] Alternatively, an object in a target task may be a plurality of objects included in a subtask of the target task, and an object in a subtask of the target task may be a plurality of objects included in a subtask of a subtask of the target task. For example, referring to Figures 5A-5C, object 1 in the chain structure shown in Figure 5A may be a graph structure shown in Figure 5B, and object 0 in the graph structure shown in Figure 5B may be a three-dimensional array structure shown in Figure 5C.
[0072] 6A-6B are schematic diagrams illustrating synchronization between multiple objects of a target task according to one or more embodiments of the present application.
[0073] Figure 6A schematically illustrates synchronization between multiple objects in a chain-like structure, and Figure 6B schematically illustrates synchronization between multiple objects in a graph-like structure. Referring to Figures 6A-6B, objects Set 0 and Set 1 and objects Wait 0 and Wait 1 are implemented as synchronization objects. Object Wait 0 is configured to begin execution in response to the completion of object Set 0, and object Wait 1 is configured to begin execution in response to the completion of object Set 1. The Set-Wait mechanism shown in Figures 6A-6B enables cross-object synchronization, for example, synchronization between objects 1 and 2 and objects 4 and 5 shown in Figure 6A.
[0074] FIG7 shows a flowchart of a method for scheduling a target task on a multi-core processing system according to one or more embodiments of the present application.
[0075] As shown in FIG7 , in step S701, a task scheduling request is received. Optionally, the task scheduling request may include a target task and corresponding control information. Optionally, the control information may include task structure information (e.g., a chain structure, a graph structure, and a multi-dimensional array structure), device type information corresponding to the task (e.g., a computing device, a storage device, a data moving device, and a data transmission device), and other custom information.
[0076] In step S703, the task scheduling request is input into the multi-layer scheduling model to generate a scheduling result of the target task on the multi-core processing system, wherein the multi-layer scheduling model can be constructed according to the method for constructing a multi-layer scheduling model described in one aspect of the present application. Optionally, the multi-layer scheduling model can be constructed with reference to the method for constructing a multi-layer scheduling model described above in conjunction with FIG. 2 . Optionally, the scheduling result of the target task on the multi-core processing system may include a result of scheduling the target task between the first device and the second device, a result of scheduling a subtask of the target task between multiple clusters within the first device or the second device, and a result of scheduling a subtask of the subtask of the target task between multiple cores within each cluster.
[0077] According to one or more embodiments of the present application, the method for scheduling target tasks on a multi-core processing system can reasonably and efficiently schedule various target tasks on the multi-core processing system, thereby fully utilizing the computing power of the multi-core processing system in task allocation and scheduling, thereby fully leveraging the advantages of the multi-core processing system and improving the processing efficiency and memory access efficiency of using the multi-core processing system to handle complex computing tasks.
[0078] 8A-8C are schematic block diagrams showing typical target tasks and their subtasks.
[0079] FIG8A schematically illustrates a segment 800A of a neural network model, where each box represents an operator of the neural network and arrows represent dependencies between operators (i.e., the operator pointed to by the arrow depends on the completion of the execution of the operator from which the arrow originates).
[0080] As an example, the segment 800A of the neural network model can be used as a target task to be reasonably and efficiently scheduled on a multi-core processing system by means of a method for scheduling a target task on a multi-core processing system according to one or more embodiments of the present application. For example, the segment 800A of the neural network model can be input into a first-layer scheduling model according to one or more embodiments of the present application, so that the segment 800A of the neural network model is scheduled between different devices in the multi-core processing system according to a first scheduling algorithm.
[0081] In Figure 8A, Conv2D represents a two-dimensional convolution operation, BatchNorm represents a network layer used to normalize the data distribution to a mean of 0 and a standard deviation of 1, Relu (Rectified Linear Unit) represents a linear rectification function, which is a commonly used activation function in artificial neural networks and usually refers to a nonlinear function represented by a ramp function and its variants, and Eltwise Add represents a basic computational layer used to perform element-by-element addition operations on two or more tensors.
[0082] FIG8B schematically shows two sub-segments 810B and 820B into which the segment 800A of the neural network model shown in FIG8A is divided.
[0083] As an example, the two sub-segments 810B and 820B into which the segment 800A of the neural network model is divided can be reasonably and efficiently scheduled on a multi-core processing system as subtasks of a target task using the method for scheduling a target task on a multi-core processing system according to one or more embodiments of the present application. For example, the two sub-segments 810B and 820B can be input into a second-layer scheduling model according to one or more embodiments of the present application, so that the two sub-segments 810B and 820B are scheduled between multiple clusters within a device of the multi-core processing system according to a second scheduling algorithm.
[0084] FIG8C schematically illustrates one operator 830C included in two sub-segments 810B or 820B into which the segment 800A of the neural network model shown in FIG8B is divided.
[0085] As an example, operator 830C can be implemented as Conv2D, which can be used as a subtask of a subtask of a target task to be reasonably and efficiently scheduled on a multi-core processing system using a method for scheduling a target task on a multi-core processing system according to one or more embodiments of the present application. For example, operator 830C can be input into a third-layer scheduling model according to one or more embodiments of the present application, so that operator 830C is scheduled among multiple cores in each cluster within a device of the multi-core processing system according to a third scheduling algorithm. Schematically, when a two-dimensional convolution operation is performed on an image with a height and width of 224 pixels using operator 830C implemented as Conv2D, operator 830C can be input into a third-layer scheduling model according to one or more embodiments of the present application, so that the third-layer scheduling model can divide the image into Block1, Block2, Block3 and Block4 as shown in Figure 8C and schedule Block1, Block2, Block3 and Block4 among multiple cores in each cluster within a device of a multi-core processing system (for example, the core can be implemented as the minimum computing unit of the multi-core processing system) according to a third scheduling algorithm to perform a two-dimensional convolution operation on Block1, Block2, Block3 and Block4 using one or more of the multiple cores.
[0086] FIG9 shows a block diagram of a system for constructing a multi-layer scheduling model according to one or more embodiments of the present application.
[0087] As shown in Figure 9, the system 90 for constructing a multi-layer scheduling model includes a communication unit 910, a memory 920 (for example, a non-volatile memory such as a flash memory, ROM, a hard drive, a magnetic disk, an optical disk), a processor 930, and a computer program 940 stored on the memory 920 and executable on the processor 930.
[0088] The communication unit 910 serves as a communication interface and is configured to establish a communication connection between the task scheduling system 90 and an external device or network (eg, a cloud, a mobile terminal, a vehicle terminal, etc.).
[0089] The memory 920 stores a computer program 940 that can be executed by the processor 930. In addition, the memory 920 can also store data (e.g., a first-layer scheduling model, a second-layer scheduling model, etc.) generated when the processor 930 executes the computer program and data or commands received from the outside via the communication unit 910.
[0090] The processor 930 is configured to execute the computer program 940 to implement the method for constructing a multi-layer scheduling model according to one or more embodiments of the present application.
[0091] FIG10 shows a block diagram of a system for scheduling target tasks on a multi-core processing system according to one or more embodiments of the present application.
[0092] As shown in Figure 10, the system 100 for scheduling target tasks on a multi-core processing system includes a communication unit 1010, a memory 1020 (for example, a non-volatile memory such as flash memory, ROM, hard disk drive, magnetic disk, optical disk), a processor 1030, and a computer program 1040 stored on the memory 1020 and executable on the processor 1030.
[0093] The communication unit 1010 serves as a communication interface and is configured to establish a communication connection between the task scheduling system 100 and an external device or network (eg, a cloud, a mobile terminal, a vehicle terminal, etc.).
[0094] The memory 1020 stores a computer program 1040 executable by the processor 1030. In addition, the memory 1020 may also store data (eg, a multi-layer scheduling model, target tasks, etc.) generated when the processor 1030 executes the computer program and data or commands received from the outside via the communication unit 1010.
[0095] The processor 1030 is configured to execute the computer program 1040 to implement the method for scheduling a target task on a multi-core processing system according to one or more embodiments of the present application.
[0096] In the applicable situation, the combination of hardware, software or hardware and software can be used to realize the various embodiments provided by the application. Moreover, in the applicable situation, without departing from the scope of the application, the various hardware components and / or software components set forth herein can be combined into a composite component comprising software, hardware and / or both. In the applicable situation, without departing from the scope of the application, the various hardware components and / or software components set forth herein can be divided into a subcomponent comprising software, hardware or both. In addition, in the applicable situation, it is contemplated that the software component can be implemented as a hardware component, and vice versa.
[0097] Software according to the present application (such as program code and / or data) can be stored on one or more computer storage media. It is also contemplated that the software identified herein can be implemented using one or more general or special computers and / or computer systems, networked and / or otherwise. Where applicable, the order of the various steps described herein can be changed, combined into composite steps and / or divided into sub-steps to provide the features described herein.
[0098] The embodiments and examples set forth herein are provided to best illustrate embodiments according to the present application and its specific applications, and thereby enable those skilled in the art to make and use the present application. However, those skilled in the art will appreciate that the above description and examples are provided for ease of illustration and example only. The descriptions set forth are not intended to be exhaustive of all aspects of the present application or to limit the present application to the precise forms disclosed.
Claims
1. A method for constructing a multi-layer scheduling model, characterized in that: The multi-layer scheduling model is used to schedule target tasks on a multi-core processing system, the multi-core processing system includes a first device and a second device, the first device and the second device each include a plurality of clusters, each cluster includes a plurality of cores, and the method includes the following steps: Constructing a first-layer scheduling model, where the first-layer scheduling model is used to schedule the target task between the first device and the second device according to a first scheduling algorithm; Constructing a second-layer scheduling model, where the second-layer scheduling model is used to schedule subtasks of the target task among multiple clusters in the first device or the second device according to a second scheduling algorithm; as well as The multi-layer scheduling model is constructed based on at least a cascade of the first-layer scheduling model and the second-layer scheduling model.
2. The method according to claim 1, wherein the method further comprises: Constructing a third-layer scheduling model, wherein the third-layer scheduling model is used to schedule subtasks of subtasks of the target task among multiple cores in each cluster according to a third scheduling algorithm; as well as The multi-layer scheduling model is constructed based on at least a cascade of the first-layer scheduling model, the second-layer scheduling model and the third-layer scheduling model.
3. The method according to claim 1 or 2, wherein the first scheduling algorithm, the second scheduling algorithm and the third scheduling algorithm each include one or more of the following: a fair polling algorithm, a weighted polling algorithm, a least idle first algorithm, a greedy algorithm, and an algorithm based on load balancing.
4. A method according to claim 1 or 2, wherein the target task, the subtask of the target task and the subtask of the subtask of the target task each include multiple objects, and the multiple objects are represented based on a combination of one or more of the following structures: a chain structure, a graph structure and a multidimensional array structure. 5 . The method according to claim 4 , wherein one object in the target task is a plurality of objects included in a subtask of the target task, and one object in a subtask of the target task is a plurality of objects included in a subtask of a subtask of the target task. 6 . The method according to claim 4 , wherein at least two objects of the plurality of objects are selectively implemented as a first synchronization object and a second synchronization object, the first synchronization object being configured to start execution in response to completion of execution of the second synchronization object.
7. The method according to claim 1, wherein the first device and the second device are each implemented as a combination of one or more of the following types: a computing device, a storage device, a data moving device, and a data transmission device.
8. The method according to claim 1 or 2, wherein the first-layer scheduling model, the second-layer scheduling model and the third-layer scheduling model each include: an object parsing module, configured to obtain the target task, the subtask of the target task, one of the subtasks of the subtask of the target task, and control information based on a task scheduling request issued by an upper-level scheduling model, allocate storage resources for the task scheduling request, and issue the target task, the subtask of the target task, and one of the subtasks of the subtask of the target task based on the control information; a scheduling module configured to schedule the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task on the device resources of the current layer according to one of the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm; An object distribution module, configured to convert the corresponding target task, the subtask of the target task and one of the subtasks of the subtask of the target task scheduled on the device resources of this layer into a task form adapted to the scheduling model of the next layer and distribute it based on the usage of the device resources of the next layer; as well as The device management module is configured to provide the scheduling module and / or the object distribution module with the usage of the device resources of the current layer and the usage of the device resources of the next layer.
9. The method according to claim 8, wherein the scheduling module is further configured to: Based on the usage of the equipment resources in this layer and the usage of the equipment resources in the next layer, the corresponding target task, the subtask of the target task and one of the subtasks of the subtask of the target task are scheduled on the equipment resources in this layer according to one of the first scheduling algorithm, the second scheduling algorithm and the third scheduling algorithm.
10. The method according to claim 8, wherein the object distribution module is further configured to: Receive a task completion message from a next-layer scheduling model, and send task identification information and corresponding device resource usage information obtained based on the task completion message to the scheduling module.
11. The method according to claim 10, wherein the scheduling module is further configured to: Based on the task identification information and the usage of the corresponding device resources, update the task completion status and the usage of the device resources at this layer; Based on the updated task completion status and the usage status of the device resources at this layer, the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task are scheduled on the device resources at this layer according to one of the first scheduling algorithm, the second scheduling algorithm, and the third scheduling algorithm; and In response to the updated task completion status indicating that the corresponding target task, the subtask of the target task, and one of the subtasks of the subtask of the target task are completed, a message indicating the completion of the task scheduling request is sent to the object resolution module.
12. The method according to claim 11, wherein the object parsing module is further configured to: In response to receiving the message indicating the completion of the task scheduling request, the message indicating the completion of the task scheduling request is sent to an upper-layer scheduling model and the storage resources allocated for the task scheduling request are reclaimed.
13. A method for scheduling a target task on a multi-core processing system, characterized in that: The method comprises the following steps: receiving a task scheduling request; and Inputting the task scheduling request into a multi-layer scheduling model to generate a scheduling result of the target task on the multi-core processing system, Wherein, the multi-layer scheduling model is constructed according to the method for constructing a multi-layer scheduling model according to any one of claims 1-12.
14. A system for building a multi-layer scheduling model, characterized in that: The system comprises: Memory; a processor coupled to the memory; and A computer program stored on the memory and running on the processor, wherein the running of the computer program results in the execution of the method for constructing a multi-layer scheduling model according to any one of claims 1 to 12.
15. A system for scheduling target tasks on a multi-core processing system, characterized in that: The system comprises: Memory; a processor coupled to the memory; and A computer program stored on the memory and running on the processor, wherein the running of the computer program causes the method for scheduling target tasks on a multi-core processing system according to claim 13 to be performed.
16. A computer-readable storage medium, characterized in that: The computer storage medium includes instructions, which, when executed, execute the method for constructing a multi-layer scheduling model according to any one of claims 1-12.
17. A computer-readable storage medium, characterized in that: The computer storage medium includes instructions that, when executed, perform the method for scheduling target tasks on a multi-core processing system according to claim 13 .
Citation Information
Patent Citations
SOC multiprocessor dispatching method and apparatus
CN103294554A
Task scheduling method, task scheduling device and multi-core system
CN104820618A
Task processing method and device, task allocation method and device, electronic equipment and medium
CN114546630A
Computing device, operating method of computing device, electronic device, and storage medium
CN115981592A
Method and system for constructing scheduling model and method and system for scheduling target task
CN117215740A