Task scheduling method, task scheduling system, and computer storage medium

By segmenting and load balancing clustering of directed acyclic graphs, a multi-level task scheduling strategy is generated, which solves the problems of load balancing and data affinity in multi-core systems, and improves the computing and memory access efficiency.

WO2024260118A1PCT designated stage expired Publication Date: 2024-12-26NIO SMART TECHNOLOGY (SHENZHEN) CO LTD +1

Patent Information

Application Number
PCT/CN2024/091071
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-19
Filing Date
2024-05-02
Publication Date
2024-12-26

AI Technical Summary

Technical Problem

When deploying directed acyclic graphs to multi-core systems with non-consistent memory access architectures, the computing power of the multi-core system cannot be fully utilized and load balancing and data affinity cannot be guaranteed.

Method used

By selectively segmenting the graph based on hardware information and the characteristics of directed acyclic graphs, and clustering the segmented graphs using load balancing-based objective functions, a multi-level task scheduling strategy is generated to ensure that the tasks are inconsistent. Distribution and execution on the memory access architecture.

Benefits of technology

It realizes the full use of the advantages of multi-core systems in the non-consistent memory access architecture, ensures processing parallelism and load balancing, and reduces data transmission volume and improves computing and memory access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024091071_26122024_PF_FP_ABST
    Figure CN2024091071_26122024_PF_FP_ABST
Patent Text Reader

Abstract

A task scheduling method, a task scheduling system, and a computer storage medium. The method is used for scheduling a directed acyclic graph on a non-uniform memory access architecture and comprises the following steps: selectively segmenting the directed acyclic graph according to hardware information of the non-uniform memory access architecture and characteristic information of the directed acyclic graph; performing a clustering operation on the segmented directed acyclic graph by using a target function constructed on the basis of load balancing, so as to divide the segmented directed acyclic graph into a plurality of tasks; and generating a multi-level task scheduling strategy on the basis of the allocation of the plurality of tasks on the non-uniform memory access architecture, and sending the multi-level task scheduling strategy to the non-uniform memory access architecture, so that the non-uniform memory access architecture performs distribution and execution of the plurality of tasks according to the multi-level task scheduling strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Task scheduling method, task scheduling system and computer storage medium

[0001] This application claims priority to Chinese patent application 202310737727.7 filed on June 19, 2023 and entitled “Task Scheduling Method, Task Scheduling System and Computer Storage Medium”, the entire disclosure of which is incorporated herein by reference. Technical Field

[0002] The present application relates to the field of computer technology, and more specifically to a task scheduling method, a task scheduling system, and a computer storage medium. Background Art

[0003] With the increasing demand for computer data processing capabilities in businesses such as the Internet of Things, artificial intelligence, and big data, multi-core systems with non-uniform memory access (NUMA) architectures are increasingly being used to improve data processing capabilities. At the same time, the computing models in businesses such as the Internet of Things, artificial intelligence, and big data are becoming increasingly heavy, and the policy logic is gradually becoming larger and more complex. Therefore, it is necessary to split the computing model or program into multiple operators according to the policy logic and organize its data flow through a directed acyclic graph (DAG). In mathematics and computer science, a DAG is a directed graph without directed cycles. In other words, a DAG consists of vertices and directed edges, each edge connecting one vertex to another, making it impossible to start from any vertex and pass through several edges to finally return to that vertex.

[0004] Currently, common neural network computing models are typically represented in the form of a Directed Graph (DAG). Hardware processing devices are increasingly adopting multi-core systems with NUMA architectures to improve computing power. Therefore, it is desirable to deploy DAGs on multi-core systems with NUMA architectures. Current solutions involve randomly or evenly distributing the compute nodes in the DAG graph across multiple cores in the NUMA architecture. However, these solutions fail to fully utilize the computing power of multiple cores in a multi-core system, fail to ensure load balancing across multiple cores, and fail to guarantee data affinity.

[0005] Summary of the Invention

[0006] In order to solve or at least alleviate one or more of the above problems, the following technical solutions are provided.

[0007] According to the first aspect of the present application, a task scheduling method is provided, which is used to schedule a directed acyclic graph on a non-uniform memory access architecture. The task scheduling method includes the following steps: selectively segmenting the directed acyclic graph based on hardware information of the non-uniform memory access architecture and characteristic information of the directed acyclic graph; performing a clustering operation on the segmented directed acyclic graph using an objective function constructed based on load balancing to divide the segmented directed acyclic graph into multiple tasks; and generating a multi-level task scheduling strategy based on the allocation of the multiple tasks on the non-uniform memory access architecture and sending the multi-level task scheduling strategy to the non-uniform memory access architecture, so that the non-uniform memory access architecture distributes and executes the multiple tasks according to the multi-level task scheduling strategy.

[0008] According to the task scheduling method described in an embodiment of the present application, each of the multiple tasks is represented as a directed acyclic graph.

[0009] According to the task scheduling method described in one embodiment of the present application or any of the above embodiments, the non-uniform memory access architecture includes multiple clusters, each of the multiple clusters includes multiple processing cores, and the hardware information of the non-uniform memory access architecture includes the number of clusters and the number of processing cores in each cluster.

[0010] According to the task scheduling method of one embodiment of the present application or any one of the above embodiments, the characteristic information of the directed acyclic graph includes the number of branches of the directed acyclic graph.

[0011] According to the task scheduling method described in one embodiment of the present application or any of the above embodiments, the objective function constructed based on load balancing is constructed according to one or more of the following: the load information of each processing core in the multiple processing cores and the average load information of the multiple processing cores; the execution time of each task in the multiple tasks and the average execution time of the multiple tasks; and the data transmission volume between the multiple tasks and the maximum value of the data transmission volume.

[0012] According to the task scheduling method of one embodiment of the present application or any of the above embodiments, the objective function based on load balancing is constructed as follows:

[0013] Where f represents the objective function built based on load balancing, i represents the i-th task, e represents the e-th tensor used to represent the amount of data transmitted between the tasks, and F i represents the load information of the processing core used to execute the i-th task, C represents the average load information of the multiple processing cores used to execute the multiple tasks, T irepresents the execution time of the i-th task, A represents the average execution time of the multiple tasks, and D e Denotes the data transmission volume of the e-th tensor, D max represents the maximum value of the data transmission amount, and λ1, λ2, and λ3 represent weight coefficients respectively.

[0014] According to the task scheduling method described in one embodiment or any one of the above embodiments of the present application, clustering operation is performed on the segmented directed acyclic graph using an objective function constructed based on load balancing to divide the segmented directed acyclic graph into multiple tasks, including performing the following steps in a cyclic manner: setting each computing node of the segmented directed acyclic graph as a computing task; for each edge of the segmented directed acyclic graph, determining the value of the objective function after merging the computing tasks at both ends of each edge to find the edge that minimizes the value of the objective function; and clustering the computing tasks at both ends of the edge that minimizes the value of the objective function into one task, and using the clustered tasks as new computing tasks to update the segmented directed acyclic graph.

[0015] According to the task scheduling method described in one embodiment of the present application or any of the above embodiments, each step executed in a loop terminates the loop in response to satisfying one or more of the following conditions: the number of loops reaches a predetermined number; and the number of computing nodes in the clustered tasks reaches a predetermined value.

[0016] According to the task scheduling method described in one embodiment or any one of the above embodiments of the present application, the task scheduling method further includes: after dividing the segmented directed acyclic graph into the multiple tasks, adjusting the multiple tasks to a first state and a second state; determining the profit difference between the multiple tasks being in the first state and the multiple tasks being in the second state; and determining to adjust the multiple tasks to the first state in response to the profit difference being greater than or equal to zero, and determining to adjust the multiple tasks to the second state in response to the profit difference being less than zero.

[0017] According to the task scheduling method described in one embodiment of the present application or any one of the above embodiments, adjusting the multiple tasks to the first state includes adjusting one or more computing nodes in the first one or more tasks among the multiple tasks to the second one or more tasks among the multiple tasks to serve as computing nodes of the second one or more tasks, and adjusting the multiple tasks to the second state includes adjusting one or more computing nodes in the second one or more tasks among the multiple tasks to the first one or more tasks among the multiple tasks to serve as computing nodes of the first one or more tasks.

[0018] According to the task scheduling method described in one embodiment or any one of the above embodiments of the present application, generating a multi-level task scheduling strategy based on the distribution of the multiple tasks on the non-uniform memory access architecture includes: constructing the multiple tasks into a directed acyclic graph; determining the number of tasks at each level in the constructed directed acyclic graph and the amount of computation of the tasks; and according to the number of tasks at each level, the amount of computation of the tasks and the number of clusters of the non-uniform memory access architecture, evenly distributing the tasks in each level to one or more clusters of the non-uniform memory access architecture to generate the multi-level task scheduling strategy.

[0019] According to the task scheduling method described in one embodiment or any of the above embodiments of the present application, the multi-level task scheduling strategy includes one or more of the following: a first-level task scheduling strategy, which is used to assign all or part of the multiple tasks to one or more clusters of the non-uniform memory access architecture; a second-level task scheduling strategy, which is used to assign one of the multiple tasks to one or more clusters of the non-uniform memory access architecture; and a third-level task scheduling strategy, which is used to assign the computing nodes on one of the multiple tasks to one or more clusters of the non-uniform memory access architecture.

[0020] According to the task scheduling method described in one embodiment of the present application or any one of the above embodiments, selectively splitting the directed acyclic graph according to the hardware information of the non-uniform memory access architecture and the characteristic information of the directed acyclic graph includes: splitting the directed acyclic graph in response to the number of clusters of the non-uniform memory access architecture being different from the number of branches of the directed acyclic graph.

[0021] According to the task scheduling method described in one embodiment or any one of the above embodiments of the present application, the task scheduling method also includes: in response to the number of clusters of the non-uniform memory access architecture being the same as the number of branches of the directed acyclic graph, allocating each branch of the directed acyclic graph to the corresponding cluster of the non-uniform memory access architecture.

[0022] According to the second aspect of the present application, a task scheduling system is provided, which includes: 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 task scheduling method described in the first aspect of the present application.

[0023] According to a third aspect of the present application, a computer storage medium is provided, which includes instructions, and the instructions, when run, execute the steps of the task scheduling method according to the first aspect of the present application.

[0024] According to one or more embodiments of the present application, the task scheduling scheme can segment a directed acyclic graph and divide the segmented directed acyclic graph into multiple tasks using an objective function constructed based on load balancing, and generate a multi-level task scheduling strategy based on the allocation of the multiple tasks on the non-uniform memory access architecture to distribute and execute the multiple tasks on the non-uniform memory access architecture, thereby fully utilizing the computing power of the non-uniform memory access architecture in task allocation and scheduling, thereby fully leveraging the advantages of the multi-core system of the non-uniform memory access architecture, achieving data affinity while ensuring the processing parallelism and load balancing of the directed acyclic graph on the non-uniform memory access architecture, effectively reducing the amount of data transmitted between different clusters, and improving the computing and memory access efficiency of processing directed acyclic graphs using the non-uniform memory access architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] 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:

[0026] FIG1 shows a schematic block diagram of a multi-core system with a non-uniform memory access architecture.

[0027] FIG2 shows a schematic diagram of a neural network model represented by a directed acyclic graph.

[0028] FIG3 shows a flowchart of a task scheduling method according to one or more embodiments of the present application.

[0029] FIG4 shows a schematic diagram of segmenting a directed acyclic graph according to one or more embodiments of the present application.

[0030] FIG5 shows a schematic diagram of load balancing task allocation according to one or more embodiments of the present application.

[0031] FIG6 shows a schematic diagram of generating a multi-level task scheduling strategy according to one or more embodiments of the present application.

[0032] FIG7 shows a schematic diagram of a multi-level task scheduling strategy according to one or more embodiments of the present application.

[0033] FIG8 shows a block diagram of a task scheduling system according to one or more embodiments of the present application. DETAILED DESCRIPTION

[0034] 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.

[0035] 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.

[0036] 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.

[0037] Hereinafter, various exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings.

[0038] FIG1 shows a schematic block diagram of a multi-core system with a non-uniform memory access architecture.

[0039] As shown in FIG1 , a multi-core system 100 with a non-uniform memory access architecture includes multiple clusters 110, multiple caches 120, and a global memory 130. In the architecture of the multi-core system 100 with a non-uniform memory access architecture, each cluster 110 has multiple processing cores 1101 and is connected to an independent cache 120. The multiple caches 120 can transmit data via a bus and are connected to the global memory 130. This allows for local memory sharing, improving system scalability and performance. However, in the multi-core system 100 with a non-uniform memory access architecture, the multiple processing cores 1101 in the multiple clusters 110 (from left to right, they can be represented as cluster 1, cluster 2, cluster 3, and cluster 4) are often not fully utilized due to load imbalance.

[0040] FIG2 shows a schematic diagram of a neural network model represented by a directed acyclic graph.

[0041] In graph theory, if a directed graph cannot start from a vertex and return to the vertex through several edges, then the graph is a directed acyclic graph, which can include multiple vertices and edges connecting the vertices. As shown in Figure 2, the operation performed by each box can be regarded as a vertex, and each arrow connection in the figure can be regarded as an edge. As an example, a directed acyclic graph 200 can be used to represent a neural network model including operations such as convolution operations, pooling operations, and summation operations, where the operation performed by each box can also be regarded as a computing node. It should be noted that the number of vertices and the number of edges of the directed acyclic graph may be more complex than Figure 2. Figure 2 is only an example of a simplified directed acyclic graph shown for ease of understanding.

[0042] Referring to the directed acyclic graph 200 shown in Figure 2, each computing node corresponds one-to-one to the operation performed, that is, each computing node represents an operation that needs to be performed, and the directed edges between different computing nodes in the directed acyclic graph 200 indicate the dependency relationship between different computing nodes.

[0043] At present, common neural network computing models are usually represented in the form of a directed acyclic graph 200 as shown in Figure 2, and hardware processing devices are increasingly adopting the multi-core system 100 with a non-uniform memory access architecture as shown in Figure 1. However, when deploying a directed acyclic graph on a multi-core system with a non-uniform memory access architecture, the following problems will be faced: 1. How to evenly distribute multiple operations in the directed acyclic graph to the various clusters of the multi-core system with a non-uniform memory access architecture and the various processing cores in the clusters. 2. How to ensure load balancing of each cluster to more effectively utilize the resources of each cluster. 3. How to better ensure data affinity, that is, to let each cluster use as little data as possible in the cache of other clusters. In order to solve or at least alleviate one or more of the above problems, a task scheduling scheme of the present application is provided. The following will be described in detail in conjunction with Figures 3-7 according to one or more embodiments of the present application for scheduling a directed acyclic graph on a non-uniform memory access architecture.

[0044] FIG3 shows a flowchart of a task scheduling method according to one or more embodiments of the present application. The task scheduling method according to one or more embodiments of the present application shown in FIG3 can be used to schedule a directed acyclic graph on a non-uniform memory access architecture, for example, to schedule the directed acyclic graph 200 shown in FIG2 on the multi-core system 100 with the non-uniform memory access architecture shown in FIG1.

[0045] As shown in FIG3 , in step S301 , the directed acyclic graph is selectively segmented according to hardware information of the non-uniform memory access architecture and characteristic information of the directed acyclic graph.

[0046] Optionally, the hardware information of the non-uniform memory access architecture may include the number of clusters and the number of processing cores in each cluster. For example, referring to FIG1 , the number of clusters of the multi-core system 100 with the non-uniform memory access architecture is 4. Optionally, the characteristic information of the directed acyclic graph may include the number of branches of the directed acyclic graph, that is, the number of branches that execute one or more operations in parallel. For example, referring to FIG2 , the number of branches of the directed acyclic graph 200 is 2.

[0047] Optionally, in step S301, when the number of clusters of the non-uniform memory access architecture is different from the number of branches of the directed acyclic graph, the directed acyclic graph may be segmented, and the number of segments may be greater than or equal to the number of clusters to fully utilize the resources of each cluster. When the number of clusters of the non-uniform memory access architecture is the same as the number of branches of the directed acyclic graph, the directed acyclic graph may not be segmented but each branch of the directed acyclic graph may be allocated to a corresponding cluster of the non-uniform memory access architecture.

[0048] FIG4 shows a schematic diagram of a directed acyclic graph according to one or more embodiments of the present application. Referring to FIG4 , it shows a schematic diagram of dividing the directed acyclic graph 200 shown in FIG2 according to the hardware information of the multi-core system 100 with the non-uniform memory access architecture shown in FIG1 and the characteristic information of the directed acyclic graph 200 shown in FIG2 . The directed acyclic graph after division is shown as reference numeral 400. Optionally, the number of clusters of the multi-core system 100 based on the non-uniform memory access architecture is 4 and the number of branches of the directed acyclic graph 200 is 2. The number of divisions of the directed acyclic graph 200 can be greater than or equal to the number of clusters 4. For example, the directed acyclic graph 200 can be divided into at least 4 parts that can be processed in parallel to achieve hardware-adaptive division of the directed acyclic graph 200. For example, in Figure 4, the directed acyclic graph 200 shown in Figure 2 is divided into four parallel parts, and the input of the directed acyclic graph 200 shown in Figure 2 is also divided into input 1, input 2, input 3 and input 4. After executing the four divided directed acyclic graphs, the results of the four summation operations can be generated through a connection operation to generate an output, which can correspond to the output of the directed acyclic graph 200 shown in Figure 2.

[0049] In step S303 , a clustering operation is performed on the segmented directed acyclic graph using an objective function constructed based on load balancing to divide the segmented directed acyclic graph into a plurality of tasks.

[0050] Optionally, in step S303, each of the divided multiple tasks can still be represented as a directed acyclic graph to improve data affinity. Optionally, the objective function constructed based on load balancing can be constructed based on one or more of the following: load information of each processing core in the multiple processing cores and average load information of the multiple processing cores; execution time of each task in the multiple tasks and average execution time of the multiple tasks; and data transmission volume between the multiple tasks and the maximum value of the data transmission volume. In one embodiment, the objective function f constructed based on load balancing can be constructed using the following formula (1):

[0051] Where i represents the i-th task, e represents the e-th tensor used to represent the amount of data transferred between the tasks, and F i represents the load information of the processing core used to execute the i-th task, C represents the average load information of multiple processing cores used to execute multiple tasks, and T i represents the execution time of the i-th task, A represents the average execution time of multiple tasks, and D e represents the data transmission volume of the e-th tensor, D max Represents the maximum value of the data transmission volume, and λ1, λ2, and λ3 represent weight coefficients respectively. It should be noted that the weight coefficients λ1, λ2, and λ3 can be understood as being used to limit the proportion of each of the three items in formula (1) in the objective function f. The larger the weight coefficient λ1, the higher the load balancing degree between the processing cores, the larger the weight coefficient λ2, the higher the complexity balancing degree between multiple tasks, and the larger the weight coefficient λ3, the smaller the data transmission volume between tasks, and the sum of λ1, λ2, and λ3 is equal to 1. In the objective function f represented by formula (1), the sizes of the weight coefficients λ1, λ2, and λ3 can be flexibly set according to the actual requirements for the load balancing degree between the processing cores, the complexity balancing degree between multiple tasks, and the data transmission volume between tasks.

[0052] Optionally, in step S303, clustering the partitioned directed acyclic graph using an objective function constructed based on load balancing to divide the partitioned directed acyclic graph into multiple tasks may include performing the following steps in a loop: setting each computing node of the partitioned directed acyclic graph as a computing task; for each edge of the partitioned directed acyclic graph, determining the value of the objective function after merging the computing tasks at both ends of each edge to find the edge that minimizes the value of the objective function; and clustering the computing tasks at both ends of the edge that minimizes the value of the objective function into one task, and using the clustered tasks as new computing tasks to update the partitioned directed acyclic graph. Optionally, the above steps performed in a loop may terminate the loop in response to one or more of the following conditions being met: the number of loops reaches a predetermined number; and the number of computing nodes in the clustered tasks reaches a predetermined value.

[0053] As an example, with reference to FIG4 , each computing node of the directed acyclic graph 400 after segmentation can be set as a computing task, and for each edge of the directed acyclic graph 400 after segmentation (i.e., the connection between each operation box in FIG4 ), the value of the objective function after the computing tasks at both ends of each edge are merged is determined to find the edge that minimizes the value of the objective function. Exemplarily, when it is determined that the value of the objective function after the computing tasks at both ends of the edge indicated by arrow 410 in FIG4 are merged is the minimum, the convolution operation and pooling operation at both ends of the edge indicated by arrow 410 can be clustered into a task 40, and task 40 can be used as a new computing node to update the directed acyclic graph 400 after segmentation. After updating the directed acyclic graph 400 after segmentation, the value of the objective function after the computing tasks at both ends of each edge are merged can be re-determined for each edge of the updated directed acyclic graph 400 to find the edge that minimizes the value of the objective function. For example, when it is determined that the value of the objective function after the computation tasks at both ends of the edge indicated by arrow 420 in FIG4 are merged is the minimum, the convolution operations at both ends of the edge indicated by arrow 420 can be clustered into a task 40', and task 40' is used as a new computation node to update the segmented directed acyclic graph 400. This is repeated in this way until the number of loops reaches a predetermined number or the number of computation nodes in the clustered tasks reaches a predetermined value and the loop is terminated. For example, the loop can be terminated when the number of computation nodes in the clustered tasks reaches 100 or when the number of loops reaches 1000.

[0054] The result of performing a clustering operation on the partitioned directed acyclic graph using the load balancing-based objective function described in step S303 to divide the partitioned directed acyclic graph into multiple tasks can be seen in FIG5 , which shows a load balancing task allocation schematic diagram 500 according to one or more embodiments of the present application. As shown in FIG5 , the partitioned directed acyclic graph shown in FIG4 is divided into Task 1, Task 2, Task 3, Task 4, and Task 5 through the clustering operation.

[0055] Optionally, after performing a clustering operation on the partitioned directed acyclic graph using an objective function constructed based on load balancing to divide the partitioned directed acyclic graph into a plurality of tasks, the plurality of tasks may be fine-tuned to adjust the plurality of tasks to a first state and a second state, determine the profit difference between the plurality of tasks being in the first state and the plurality of tasks being in the second state, and determine to adjust the plurality of tasks to the first state in response to the profit difference being greater than or equal to zero, and determine to adjust the plurality of tasks to the second state in response to the profit difference being less than zero. Optionally, adjusting the plurality of tasks to the first state includes adjusting one or more computing nodes in a first one or more tasks among the plurality of tasks to a second one or more tasks among the plurality of tasks to serve as computing nodes for the second one or more tasks, and adjusting the plurality of tasks to the second state includes adjusting one or more computing nodes in the second one or more tasks among the plurality of tasks to a first one or more tasks among the plurality of tasks to serve as computing nodes for the first one or more tasks.

[0056] As an example, referring to FIG5 , after the segmented directed acyclic graph is divided into Task 1, Task 2, Task 3, Task 4, and Task 5 through a clustering operation, one or more computing nodes in Task 1, Task 2, Task 3, Task 4, and Task 5 can be fine-tuned to make the execution time more balanced among Task 1, Task 2, Task 3, Task 4, and Task 5. For example, the computing nodes of the pooling operation in Task 1 can be adjusted to Task 2 to serve as computing nodes of Task 2, which is used as the first state of Task 1, Task 2, Task 3, Task 4, and Task 5. The computing nodes of the pooling operation in Task 2 can be adjusted to Task 1 to serve as computing nodes of Task 1, which is used as the second state of Task 1, Task 2, Task 3, Task 4, and Task 5. For example, the pooling operation in Task 4 may be adjusted to Task 3 to serve as the computing node of Task 3, and the summing operation in Task 2 may be adjusted to Task 1 to serve as the computing node of Task 1, thereby serving as the first state of Task 1, Task 2, Task 3, Task 4, and Task 5, and the computing node of the summing operation in Task 3 may be adjusted to Task 2 to serve as the computing node of Task 2, thereby serving as the second state of Task 1, Task 2, Task 3, Task 4, and Task 5. After Task 1, Task 2, Task 3, Task 4, and Task 5 are adjusted to the first state and the second state, the profit difference between Task 1, Task 2, Task 3, Task 4, and Task 5 in the first state and in the second state may be determined using the following formula (2):

[0057] where f before represents the objective function of multiple tasks in the first state, f after represents the objective functions of multiple tasks in the second state, i represents the i-th task that undergoes fine-tuning, j represents the j-th task that undergoes fine-tuning, e represents the e-th tensor used to represent the amount of data transmission between tasks, F i represents the load information of the processing core used to execute the i-th task in the first state, F j represents the load information of the processing core used to execute the jth task in the first state, C represents the average load information of multiple processing cores used to execute multiple tasks in the first state, and F i ' represents the load information of the processing core used to execute the i-th task in the second state, F j ' represents the load information of the processing core for executing the jth task in the second state, C' represents the average load information of multiple processing cores for executing multiple tasks in the second state, T i Indicates the execution time of the i-th task in the first state, T j represents the execution time of the jth task in the first state, A represents the average execution time of multiple tasks in the first state, T i' represents the execution time of the i-th task in the second state, T j ' represents the execution time of the jth task in the second state, A' represents the average execution time of multiple tasks in the second state, D e represents the data transfer amount of the e-th tensor in the first state, D max Indicates the maximum value of data transmission in the first state, D e ' represents the data transmission amount of the e-th tensor in the second state, D max ' represents the maximum value of the data transmission volume in the second state, and λ1, λ2, and λ3 represent weight coefficients respectively. It should be noted that the weight coefficients λ1, λ2, and λ3 can be understood as the proportions of the three items in formula (2) respectively. The larger the weight coefficient λ1, the higher the load balancing degree between the processing cores, the larger the weight coefficient λ2, the higher the complexity balancing degree between multiple tasks, and the larger the weight coefficient λ3, the smaller the data transmission volume between tasks, and the sum of λ1, λ2, and λ3 is equal to 1. In formula (2), the sizes of the weight coefficients λ1, λ2, and λ3 can be flexibly set according to the actual requirements for the load balancing degree between the processing cores, the complexity balancing degree between multiple tasks, and the data transmission volume between tasks.

[0058] After determining the profit difference between Task 1, Task 2, Task 3, Task 4, and Task 5 in the first state and the second state using the above formula (2), one or more computing nodes in Task 1, Task 2, Task 3, Task 4, and Task 5 can be fine-tuned based on the profit difference to make the execution time of Task 1, Task 2, Task 3, Task 4, and Task 5 more balanced. For example, when the profit difference between Task 1, Task 2, Task 3, Task 4, and Task 5 in the first state and the second state is positive, it can be determined that Task 1, Task 2, Task 3, Task 4, and Task 5 are adjusted to the first state, for example, the computing node of the pooling operation in Task 1 is adjusted to Task 2 to serve as the computing node of Task 2. When the profit difference between Task 1, Task 2, Task 3, Task 4, and Task 5 in the first state and the second state is negative, it can be determined that Task 1, Task 2, Task 3, Task 4, and Task 5 are adjusted to the second state, for example, the computing node of the pooling operation in Task 2 is adjusted to Task 1 to serve as the computing node of Task 1.

[0059] In step S305, a multi-level task scheduling strategy is generated based on the allocation of multiple tasks on the non-uniform memory access architecture and the multi-level task scheduling strategy is sent to the non-uniform memory access architecture, so that the non-uniform memory access architecture distributes and executes multiple tasks according to the multi-level task scheduling strategy.

[0060] Optionally, in step S305, the multiple tasks divided in step S303 can be constructed into a directed acyclic graph, the number of tasks at each level in the constructed directed acyclic graph and the computational complexity of the tasks are determined, and based on the number of tasks at each level, the computational complexity of the tasks and the number of clusters of the non-uniform memory access architecture, the tasks in each level are evenly distributed to one or more clusters of the non-uniform memory access architecture to generate a multi-level task scheduling strategy.

[0061] As an example, in conjunction with the multi-core system 100 with a non-uniform memory access architecture shown in FIG1 and the load-balanced task allocation diagram 500 shown in FIG5 , after the partitioned directed acyclic graph is divided into task 1, task 2, task 3, task 4, and task 5 through a clustering operation, the partitioned tasks 1, task 2, task 3, task 4, and task 5 can be constructed into a directed acyclic graph, such as the directed acyclic graph 600 shown in FIG6 . In FIG6 , the partitioned tasks 1, task 2, task 3, task 4, and task 5 are constructed into the directed acyclic graph 600, wherein tasks 1, task 2, task 3, task 4 are at level 1 and task 5 is at level 2. After the divided tasks 1, 2, 3, 4, and 5 are constructed into a directed acyclic graph 600, the number of tasks in level 1 and level 2 and the computational load of the tasks can be determined, and based on the number of tasks in each level, the computational load of the tasks, and the number of clusters of the non-uniform memory access architecture, the tasks in each level can be evenly distributed to one or more clusters of the non-uniform memory access architecture to generate a multi-level task scheduling strategy. In conjunction with Figure 6, taking the multi-core system 100 of the non-uniform memory access architecture shown in Figure 1 as an example, the number of clusters of the multi-core system 100 of the non-uniform memory access architecture is 4, and the number of tasks at level 1 is 4, so tasks 1, 2, 3, and 4 at level 1 can be respectively distributed to the 4 clusters of the multi-core system 100 of the non-uniform memory access architecture; the number of tasks at level 2 is 1, so task 5 at level 2 can be distributed to the 4 clusters of the multi-core system 100 of the non-uniform memory access architecture. It should be noted that when the number of tasks at a certain level of the directed acyclic graph constructed based on the divided tasks is greater than 4, the tasks at this level can be divided into 4 parts according to the computational amount of the tasks and respectively allocated to the 4 clusters of the multi-core system 100 with a non-uniform memory access architecture; when the number of tasks at a certain level of the directed acyclic graph constructed based on the divided tasks is less than 4, for example, when there are 2 tasks, one of the tasks can be allocated to 2 of the 4 clusters of the multi-core system 100 with a non-uniform memory access architecture, and the other task can be allocated to the other 2 of the 4 clusters of the multi-core system 100 with a non-uniform memory access architecture.

[0062] Optionally, the multi-level task scheduling policy may include one or more of the following: a first-level task scheduling policy for allocating all or part of the multiple tasks to one or more clusters of the non-uniform memory access architecture; a second-level task scheduling policy for allocating one of the multiple tasks to one or more clusters of the non-uniform memory access architecture; and a third-level task scheduling policy for allocating computing nodes on one of the multiple tasks to one or more clusters of the non-uniform memory access architecture. Optionally, the multi-level task scheduling policy may be represented in the form of a binary file for easy reading by the non-uniform memory access architecture.

[0063] The multi-level task scheduling strategy generated based on the allocation of multiple tasks on the non-uniform memory access architecture described in step S305 can be referred to as shown in FIG7 , which shows a schematic diagram 700 of a multi-level task scheduling strategy according to one or more embodiments of the present application. In conjunction with the multi-core system 100 with a non-uniform memory access architecture shown in FIG1 , as shown in FIG7 , for example, box 710 shows a first-level task scheduling strategy, i.e., for allocating task 1, task 2, task 3, task 4, and task 5 to clusters 1, 2, 3, and 4 of the multi-core system 100 with a non-uniform memory access architecture; boxes 720, 730, 740, 750, and 760 show a second-level task scheduling strategy, i.e., for allocating task 1 to cluster 1 of the multi-core system 100 with a non-uniform memory access architecture, and task 2 to cluster 4 of the multi-core system 100 with a non-uniform memory access architecture. To cluster 2 of the multi-core system 100 of the non-uniform memory access architecture, task 3 is assigned to cluster 3 of the multi-core system 100 of the non-uniform memory access architecture, task 4 is assigned to cluster 4 of the multi-core system 100 of the non-uniform memory access architecture, and task 5 is assigned to clusters 1, 2, 3, and 4 of the multi-core system 100 of the non-uniform memory access architecture; box 770 shows the third-level task scheduling strategy, which is used to assign the computing node pooling operation in task 2 to clusters 2 and 3 of the multi-core system 100 of the non-uniform memory access architecture. It should be noted that the multi-level task scheduling strategy diagram 700 shown in Figure 7 is only schematic. Without departing from the spirit and scope of the present application, other forms of multi-level task scheduling strategies can also be generated based on the allocation of multiple tasks on the non-uniform memory access architecture to allocate the divided multiple tasks and the multiple computing nodes in each task to one or more clusters of the non-uniform memory access architecture.

[0064] By generating a multi-level task scheduling strategy based on the allocation of multiple tasks on a non-uniform memory access architecture, the non-uniform memory access architecture can fully realize hardware parallelism, load balancing, and affinity between task data when distributing and executing multiple tasks according to the generated multi-level task scheduling strategy, thereby fully utilizing the hardware resources of the non-uniform memory access architecture and improving the computing and memory access efficiency of processing directed acyclic graphs using the non-uniform memory access architecture.

[0065] According to one or more embodiments of the present application, the task scheduling method can segment a directed acyclic graph and divide the segmented directed acyclic graph into multiple tasks using an objective function constructed based on load balancing, and generate a multi-level task scheduling strategy based on the allocation of the multiple tasks on the non-uniform memory access architecture to distribute and execute the multiple tasks on the non-uniform memory access architecture, thereby fully utilizing the computing power of the non-uniform memory access architecture in task allocation and scheduling, thereby fully leveraging the advantages of the multi-core system of the non-uniform memory access architecture, achieving data affinity while ensuring the processing parallelism and load balancing of the directed acyclic graph on the non-uniform memory access architecture, effectively reducing the amount of data transmitted between different clusters, and improving the computing and memory access efficiency of processing directed acyclic graphs using the non-uniform memory access architecture.

[0066] FIG8 shows a block diagram of a task scheduling system according to one or more embodiments of the present application.

[0067] As shown in FIG8 , the task scheduling system 80 includes a communication unit 810 , a memory 820 (e.g., a non-volatile memory such as a flash memory, a ROM, a hard disk drive, a magnetic disk, an optical disk), a processor 830 , and a computer program 840 stored on the memory 820 and executable on the processor 830 .

[0068] The communication unit 810 serves as a communication interface and is configured to establish a communication connection between the task scheduling system 80 and an external device or network (eg, a cloud, a mobile terminal, etc.).

[0069] The memory 820 stores a computer program 840 that can be executed by the processor 830. In addition, the memory 820 can also store data generated when the processor 830 executes the computer program (for example, a partitioned directed acyclic graph, a multi-level task scheduling strategy, etc.) and data or commands received from the outside via the communication unit 810.

[0070] The processor 730 is configured to execute the computer program 840 to implement the task scheduling method according to one or more embodiments of the present application.

[0071] According to one or more embodiments of the present application, the task scheduling system can segment a directed acyclic graph and divide the segmented directed acyclic graph into multiple tasks using an objective function constructed based on load balancing, and generate a multi-level task scheduling strategy based on the allocation of the multiple tasks on the non-uniform memory access architecture to distribute and execute the multiple tasks on the non-uniform memory access architecture, thereby fully utilizing the computing power of the non-uniform memory access architecture in task allocation and scheduling, thereby fully leveraging the advantages of the multi-core system of the non-uniform memory access architecture, achieving data affinity while ensuring the processing parallelism and load balancing of the directed acyclic graph on the non-uniform memory access architecture, effectively reducing the amount of data transmitted between different clusters, and improving the computing and memory access efficiency of processing directed acyclic graphs using the non-uniform memory access architecture.

[0072] 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.

[0073] 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.

[0074] 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 task scheduling method, characterized in that: The task scheduling method is used to schedule a directed acyclic graph on a non-uniform memory access architecture, and the task scheduling method comprises the following steps: Selectively segmenting the directed acyclic graph according to the hardware information of the non-uniform memory access architecture and the characteristic information of the directed acyclic graph; Performing a clustering operation on the segmented directed acyclic graph using an objective function constructed based on load balancing to divide the segmented directed acyclic graph into a plurality of tasks; as well as A multi-level task scheduling strategy is generated based on the allocation of the multiple tasks on the non-uniform memory access architecture and the multi-level task scheduling strategy is sent to the non-uniform memory access architecture, so that the non-uniform memory access architecture distributes and executes the multiple tasks according to the multi-level task scheduling strategy. 2 . The method according to claim 1 , wherein each task in the plurality of tasks is represented as a directed acyclic graph.

3. The method according to claim 1, wherein the non-uniform memory access architecture includes multiple clusters, each of the multiple clusters includes multiple processing cores, and the hardware information of the non-uniform memory access architecture includes the number of the clusters and the number of processing cores in each cluster. The method according to claim 1 , wherein the characteristic information of the directed acyclic graph includes the number of branches of the directed acyclic graph.

5. The method according to claim 3, wherein the objective function constructed based on load balancing is constructed according to one or more of the following: load information of each processing core of the plurality of processing cores and average load information of the plurality of processing cores; an execution time of each of the plurality of tasks and an average execution time of the plurality of tasks; and The data transmission amount between the plurality of tasks and the maximum value of the data transmission amount.

6. The method according to claim 5, wherein the objective function based on load balancing is constructed as follows: Where f represents the objective function constructed based on load balancing, i represents the i-th task, e represents the e-th tensor used to represent the amount of data transmitted between the tasks, and F i represents the load information of the processing core used to execute the i-th task, C represents the average load information of the multiple processing cores used to execute the multiple tasks, T i represents the execution time of the i-th task, A represents the average execution time of the multiple tasks, and D e represents the data transfer amount of the e-th tensor, D max represents the maximum value of the data transmission amount, and λ1, λ2, and λ3 represent weight coefficients respectively.

7. The method according to claim 1, wherein clustering the segmented directed acyclic graph using an objective function constructed based on load balancing to divide the segmented directed acyclic graph into a plurality of tasks comprises executing the following steps in a cyclic manner: Setting each computing node of the segmented directed acyclic graph as a computing task; For each edge of the segmented directed acyclic graph, determine the value of the objective function after the computing tasks at both ends of each edge are merged, so as to find the edge that minimizes the value of the objective function; as well as The computing tasks at both ends of the edge that minimizes the value of the objective function are clustered into one task, and the clustered tasks are used as new computing tasks to update the segmented directed acyclic graph.

8. The method according to claim 7, wherein each step performed in a loop terminates the loop in response to one or more of the following conditions being met: The number of cycles reaches a predetermined number; and The number of computing nodes in the clustered tasks reaches a predetermined value.

9. The method according to claim 1, wherein the task scheduling method further comprises: After dividing the segmented directed acyclic graph into the plurality of tasks, adjusting the plurality of tasks to a first state and a second state; determining a revenue difference between the plurality of tasks being in the first state and the plurality of tasks being in the second state; as well as In response to the yield difference being greater than or equal to zero, it is determined that the plurality of tasks are adjusted to the first state, and in response to the yield difference being less than zero, it is determined that the plurality of tasks are adjusted to the second state.

10. The method of claim 9, wherein adjusting the plurality of tasks to the first state comprises adjusting one or more computing nodes in a first one or more tasks among the plurality of tasks to a second one or more tasks among the plurality of tasks to serve as computing nodes of the second one or more tasks, and adjusting the plurality of tasks to the second state comprises adjusting one or more computing nodes in a second one or more tasks among the plurality of tasks to a first one or more tasks among the plurality of tasks to serve as computing nodes of the first one or more tasks.

11. The method according to claim 3, wherein generating a multi-level task scheduling strategy based on the allocation of the plurality of tasks on the non-uniform memory access architecture comprises: constructing the plurality of tasks into a directed acyclic graph; Determine the number of tasks at each level in the constructed directed acyclic graph and the amount of computation required for the tasks; as well as According to the number of tasks in each level, the computational load of the tasks and the number of clusters of the non-uniform memory access architecture, the tasks in each level are evenly distributed to one or more clusters of the non-uniform memory access architecture to generate the multi-level task scheduling strategy.

12. The method according to claim 3, wherein the multi-level task scheduling strategy comprises one or more of the following: A first-level task scheduling strategy for allocating all or part of the plurality of tasks to one or more clusters of the non-uniform memory access architecture; A second-level task scheduling strategy for allocating one of the plurality of tasks to one or more clusters of the non-uniform memory access architecture; as well as The third level task scheduling strategy is used to allocate computing nodes on one of the multiple tasks to one or more clusters of the non-uniform memory access architecture.

13. The method according to claim 3 or 4, wherein selectively segmenting the directed acyclic graph according to the hardware information of the non-uniform memory access architecture and the characteristic information of the directed acyclic graph comprises: The directed acyclic graph is segmented in response to the number of the clusters of the non-uniform memory access architecture being different from the number of branches of the directed acyclic graph.

14. The method according to claim 13, wherein the task scheduling method further comprises: In response to the number of the clusters of the non-uniform memory access architecture being the same as the number of branches of the directed acyclic graph, each branch of the directed acyclic graph is allocated to the non-uniform memory access architecture. Corresponding clusters of memory access architectures.

15. A task scheduling system, characterized in that: The system comprises: Memory; a processor coupled to the memory; and A computer program stored in the memory and running on the processor, wherein the running of the computer program results in the execution of the task scheduling method according to any one of claims 1 to 14.

16. A computer-readable storage medium, characterized in that: The computer storage medium comprises instructions, which, when executed, execute the task scheduling method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Multi-dimensional resource management architecture and method based on space-air-ground integrated network

    CN114422455A

  • Data processing method and device, computer equipment and storage medium

    CN114580606A

  • Neural network model deployment method, system and device and storage medium

    CN115796041A

  • Task scheduling method, task scheduling system and computer storage medium

    CN116841710A

Cited By

  • Large model reasoning scheduling method based on off-network computing power server

    CN119537032A

  • Compiling optimization method and device for computational graph, equipment and medium

    CN119806542A

  • Intelligent computing power cluster task allocation method and system based on cloud edge collaboration

    CN120560816A