Partition division method, device and program product based on edge cutting number optimization
By optimizing the partitioning positions of boundary task nodes in the directed acyclic graph of large tasks, the number of cut edges between partitions is reduced, solving the problem of low task scheduling efficiency in existing technologies and achieving more efficient task execution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies fail to effectively optimize the number of cut edges when dividing large tasks into multiple levels, resulting in low task scheduling efficiency and inability to meet the requirements of real-time applications.
By obtaining the target directed acyclic graph, the edge gain value of the boundary task node is calculated, and its partition position in the directed acyclic graph is updated according to these values to reduce the number of edges between partitions.
It reduced the overall task execution time, improved task scheduling efficiency, and met the requirements of real-time applications.
Smart Images

Figure CN115437767B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a partitioning method, apparatus, computer equipment, computer storage medium, and computer program product based on edge number optimization. Background Technology
[0002] With the development and popularity of big data and artificial intelligence, a common approach to handling large tasks is to divide them into multiple smaller tasks for scheduling. Specifically, large tasks can be abstracted into directed acyclic graphs (DAGs). By dividing the task nodes in the DAGs into multiple levels, and then scheduling the multiple smaller tasks obtained from the multi-level division, the task scheduling result can be obtained.
[0003] However, when dividing large tasks into multiple levels, the focus is on the number of edges between the different partitions. The more edges there are, the longer the overall execution time of the large task will be, and the lower the task scheduling efficiency will be. Summary of the Invention
[0004] Therefore, it is necessary to provide a partitioning method, apparatus, computer device, computer-readable storage medium, and computer program product based on edge number optimization that can improve task scheduling efficiency in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a partitioning method based on edge count optimization, the method comprising:
[0006] Obtain the target directed acyclic graph for the processing target task; the target directed acyclic graph includes multiple partitions;
[0007] According to the node order of the boundary task nodes in the target directed acyclic graph, the gain value of each tangent edge of the corresponding boundary task node is calculated; the boundary task node is a task node in a partition different from the first partition that has a dependency relationship with the task nodes; the first partition is the partition of the boundary task node in the target directed acyclic graph, and the multiple partitions include the first partition.
[0008] Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0009] In one embodiment, the plurality of partitions further includes a plurality of second partitions, and the step of calculating the edge gain values of the corresponding boundary task nodes according to the node order of the boundary task nodes in the target directed acyclic graph includes:
[0010] Based on the node order of the boundary task nodes in the target directed acyclic graph, and according to the dependency relationship between the corresponding boundary task node and the task nodes in the multiple second partitions, the positive gain value of the corresponding boundary task node is determined.
[0011] After moving the corresponding boundary task nodes to each of the second partitions, the negative gain values of the corresponding boundary task nodes are determined according to the dependency relationship between the corresponding boundary task nodes and the task nodes in the third partition; the third partition includes the first partition and partitions different from the partitions to which the corresponding boundary task nodes were moved.
[0012] Subtracting the positive gain value from each of the negative gain values yields the corresponding edge gain value for each boundary task node.
[0013] In one embodiment, determining the positive gain value of the corresponding boundary task node based on the dependency relationship between the corresponding boundary task node and task nodes in the plurality of second partitions includes:
[0014] The number of task nodes in the multiple second partitions that have a dependency relationship with the corresponding boundary task node is determined as the positive gain value of the corresponding boundary task node.
[0015] In one embodiment, after moving the corresponding boundary task nodes to each of the second partitions, determining the negative gain values of the corresponding boundary task nodes based on their dependencies with the task nodes in the third partition includes:
[0016] The number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node is determined as the movement gain value corresponding to the boundary task node after it moves to each of the second partitions; the movement gain values corresponding to the boundary task node after it moves to each of the second partitions constitute the negative gain values of the corresponding boundary task node.
[0017] In one embodiment, updating the partition position of the corresponding boundary task node in the target directed acyclic graph based on the gain values of each tangent edge of the corresponding boundary task node includes:
[0018] Based on the edge gain values of the corresponding boundary task nodes and the correspondence between the edge gain values of the boundary task nodes and the equalization gain values of the partitions corresponding to the edge gain values, multiple target gain values of the corresponding boundary task nodes are obtained.
[0019] When the maximum target gain value among the multiple target gain values is less than 0, the corresponding boundary task node is kept in the initial partition;
[0020] Alternatively, when the minimum target gain value among the multiple target gain values is greater than or equal to 0, based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, the partition corresponding to the maximum target gain value among the multiple target gain values is determined, and the corresponding boundary task node is added to the partition corresponding to the maximum target gain value, and the corresponding boundary task node is deleted from the initial partition; the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value corresponding to the maximum target gain value among the target gain values.
[0021] In one embodiment, obtaining the target directed acyclic graph for the processing target task includes:
[0022] The directed acyclic graph of the target task is processed according to preset partitioning conditions to obtain the partitioned directed acyclic graph; the preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partition is within a first preset range, and the number of task nodes in the partition is within a second preset range.
[0023] The target directed acyclic graph is obtained by processing the partitioned directed acyclic graph based on a preset partitioning method.
[0024] Secondly, this application provides a partitioning device based on edge count optimization, the device comprising:
[0025] The acquisition module is used to acquire the target directed acyclic graph of the target task; the target directed acyclic graph includes multiple partitions;
[0026] The calculation module is used to calculate the edge gain value of each boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph; the boundary task node is a task node with a dependency relationship between task nodes in a partition different from the first partition, the first partition is the partition of the boundary task node in the target directed acyclic graph, and the multiple partitions include the first partition.
[0027] The update module is used to update the partition position of the corresponding boundary task node in the target directed acyclic graph according to the gain value of each tangent edge of the corresponding boundary task node.
[0028] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0029] Obtain the target directed acyclic graph for the processing target task; the target directed acyclic graph includes multiple partitions;
[0030] According to the node order of the boundary task nodes in the target directed acyclic graph, the gain value of each tangent edge of the corresponding boundary task node is calculated; the boundary task node is a task node in a partition different from the first partition that has a dependency relationship with the task nodes; the first partition is the partition of the boundary task node in the target directed acyclic graph, and the multiple partitions include the first partition.
[0031] Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0032] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0033] Obtain the target directed acyclic graph for the processing target task; the target directed acyclic graph includes multiple partitions;
[0034] According to the node order of the boundary task nodes in the target directed acyclic graph, the gain value of each tangent edge of the corresponding boundary task node is calculated; the boundary task node is a task node in a partition different from the first partition that has a dependency relationship with the task nodes; the first partition is the partition of the boundary task node in the target directed acyclic graph, and the multiple partitions include the first partition.
[0035] Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0036] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0037] Obtain the target directed acyclic graph for the processing target task; the target directed acyclic graph includes multiple partitions;
[0038] According to the node order of the boundary task nodes in the target directed acyclic graph, the gain value of each tangent edge of the corresponding boundary task node is calculated; the boundary task node is a task node in a partition different from the first partition that has a dependency relationship with the task nodes; the first partition is the partition of the boundary task node in the target directed acyclic graph, and the multiple partitions include the first partition.
[0039] Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0040] The aforementioned partitioning method, apparatus, computer device, storage medium, and computer program product based on edge number optimization obtains the target directed acyclic graph of the target task and calculates the edge gain values of the corresponding boundary task nodes according to the node order of the boundary task nodes in the target directed acyclic graph. Then, based on the edge gain values of the corresponding boundary task nodes, the partition position of the corresponding boundary task nodes in the target directed acyclic graph is updated. In this way, by updating the partition position of the boundary task nodes, the number of edges between partitions can be reduced, thereby reducing the overall task execution time and improving task scheduling efficiency. Attached Figure Description
[0041] Figure 1 This is an application environment diagram of a partitioning method based on the number of cut edges in one embodiment;
[0042] Figure 2 This is a flowchart illustrating a partitioning method based on the number of cut edges in one embodiment;
[0043] Figure 3 This is a schematic diagram of a target directed acyclic graph in one embodiment;
[0044] Figure 4 This is a flowchart illustrating the process of calculating the gain values of each tangent edge of the corresponding boundary task node according to the node order of the task nodes in the target directed acyclic graph in one embodiment.
[0045] Figure 5 This is a flowchart illustrating the process of updating the partition position of the corresponding boundary task node in the target directed acyclic graph based on the gain values of each tangent edge of the corresponding boundary task node in one embodiment.
[0046] Figure 6 This is a schematic diagram of a task scheduling method in one embodiment;
[0047] Figure 7 This is a schematic diagram of the refinement process in another embodiment;
[0048] Figure 8 This is a schematic diagram of the optimized partitioning of the target directed acyclic graph in one embodiment;
[0049] Figure 9 This is a structural block diagram of a partitioning device based on the number of cutting edges in one embodiment;
[0050] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0052] With the development and popularity of big data and artificial intelligence, current computer performance is insufficient to meet the demand for computing power. Therefore, parallel computing has become a popular solution, and the problem of scheduling large-scale computing tasks has also emerged.
[0053] Typically, when dealing with large tasks, a common approach is to divide the large task into multiple smaller tasks for scheduling. Specifically, the large task can be abstracted into a directed acyclic graph (DAG). By dividing the task nodes in the DAG into multiple levels, and then scheduling the multiple smaller tasks obtained from the multi-level division, the task scheduling result can be obtained.
[0054] Traditional multi-level partitioning methods can be used to handle large tasks. These methods typically consist of three stages: coarsening, initial partitioning, and refinement. In the coarsening stage, multiple task nodes with strong dependencies in the directed acyclic graph (DAG) are grouped together. Repeating this process multiple times helps the DAG reach a specific size, forming the initial DAG. In the initial partitioning stage, the initial DAG is partitioned. In the refinement stage, the partitioning is performed layer by layer, mapping the initial DAG to the next finer partition, and further optimizing the results. However, most multi-level partitioning methods are based on simple greedy algorithms and cannot perform partitioning from a global perspective, failing to accurately reflect the clustering characteristics and dependencies of the DAG. Therefore, directly using traditional multi-level partitioning methods without considering the additional communication latency caused by edge splitting in the DAG cannot meet the requirements of real-time applications.
[0055] Furthermore, when dividing large tasks into multiple levels, the objectives of the division include optimizing the critical path and maintaining load balancing. The critical path refers to the longest path from the entry node to the exit node in a directed graph. The longer the critical path, the longer the communication time between task nodes in the directed graph may be, resulting in a longer overall task execution time and low task scheduling efficiency. Moreover, after dividing large tasks into partitions, the more edges between different partitions, that is, the more edges between task nodes in different partitions, the longer the communication time between task nodes may be, which will also lead to low task scheduling efficiency.
[0056] In view of this, this application provides a partitioning method based on the number of cut edges. The partitioning method based on the number of cut edges provided in the embodiments of this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network, and the data storage system can store the data that server 104 needs to process. The data storage system can be integrated on server 104. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones and tablets. Server 104 can be implemented as a standalone server or a server cluster composed of multiple servers.
[0057] Specifically, after terminal 102 obtains the target task, terminal 102 can send the target task to server 104. Server 104 obtains the target directed acyclic graph for processing the target task, and calculates the edge gain values of the corresponding boundary task nodes according to the node order of the boundary task nodes in the target directed acyclic graph. Based on the edge gain values of the corresponding boundary task nodes, server 104 updates the partition position of the corresponding boundary task nodes in the target directed acyclic graph. Here, the boundary task nodes are task nodes with dependency relationships in partitions different from the initial partitions. The initial partition is the partition of the boundary task nodes in the target directed acyclic graph.
[0058] In one embodiment, such as Figure 2 As shown, a partitioning method based on edge number optimization is provided, and this method is applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0059] S202, Obtain the target directed acyclic graph of the target task.
[0060] In this embodiment, the target directed acyclic graph includes multiple partitions, and there is a number of cut edges between the multiple partitions. Specifically, there are dependencies between the nodes of the multiple partitions, and the dependency between the task nodes is the number of cut edges corresponding to the task node.
[0061] Specifically, obtaining the target directed acyclic graph for processing the target task includes:
[0062] S1. Process the directed acyclic graph of the target task according to the preset partitioning conditions to obtain the partitioned directed acyclic graph.
[0063] The preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partition is within a first preset range, and the number of task nodes in the partition is within a second preset range; the weight of the task node is used to indicate the execution time of the task corresponding to that task node.
[0064] It is understandable that the total number of nodes in each partition of the directed acyclic graph is equal to the total number of nodes in the directed acyclic graph of the target task.
[0065] S2, based on the preset partitioning method, processes the partitioned directed acyclic graph to obtain the target directed acyclic graph.
[0066] Since the directed graph abstracted from large-scale computing tasks will not have closed loops inside, it is not necessary to guarantee that the intervals are acyclic. Therefore, when processing the partitioned directed acyclic graph, a preset partitioning method with fewer cut edges can be used. This preset partitioning method can be the Kway algorithm or other partitioning algorithms, and this embodiment does not make specific limitations.
[0067] S204. Calculate the gain values of each tangent edge of the corresponding boundary task node according to the node order of the boundary task node in the target directed acyclic graph.
[0068] In this embodiment, the target directed acyclic graph includes multiple task nodes. If a task node has a dependency relationship with task nodes in other partitions, then the task node is a boundary task node of the partition it belongs to. If a task node does not have a dependency relationship with task nodes in other partitions, then the task node is not a boundary task node of the partition it belongs to. If a task node is a boundary task node, the partition in the target directed acyclic graph containing the task node can be called the first partition, and the multiple partitions include the first partition.
[0069] For example, such as Figure 3 As shown, a schematic diagram of a target directed acyclic graph is provided. In this diagram, the lines connecting task nodes in the same partition represent dependencies between task nodes, and the lines connecting task nodes in different partitions also represent dependencies between task nodes in different partitions. Specifically, the target directed acyclic graph includes three partitions: partition 1, partition 2, and partition 3. Partition 1 includes task node 1, task node 2, task node 4, and task node 7; partition 2 includes task node 5, task node 8, and task node 10; and partition 3 includes task node 3, task node 6, and task node 9.
[0070] In partition 1, task node 1 is dependent on task node 2 and task node 4, but not on any task node in partitions 2 and 3. Therefore, task node 1 is not a boundary task node in partition 1. Task node 2 is dependent on task node 3 and task node 8 in partition 3, so task node 2 is a boundary task node in partition 1. Task node 4 is dependent on task node 7 and also on task node 8 in partition 2, so task node 4 is a boundary task node in partition 1. Task node 7 is dependent on task node 8 in partition 2 and task node 6 in partition 3, so task node 7 is a boundary task node in partition 1. In summary, the boundary task nodes in partition 1 are task node 2, task node 4, and task node 7.
[0071] In partition 2, task node 5 is dependent on task nodes 8 and 10, and also on task node 6 in partition 3. Therefore, task node 5 is a boundary task node in partition 2. Task node 8 is dependent on task node 10, and also on task nodes 2, 4, and 7 in partition 1. Therefore, task node 8 is a boundary task node in partition 2. Task node 10 is dependent on task nodes 5 and 8, but it is not dependent on any task node in partitions 1 and 3. Therefore, task node 10 is not a boundary task node in partition 2. In summary, the boundary task nodes in partition 2 are task nodes 5 and 8.
[0072] In partition 3, task node 3 is dependent on task node 6, and also on task node 2 and task node 4 in partition 1. Therefore, task node 3 is a boundary task node in partition 3. Task node 6 is dependent on task node 3, and also on task node 7 in partition 1 and task node 5 in partition 2. Therefore, task node 6 is a boundary task node in partition 3. In summary, the boundary task nodes in partition 3 are task node 3 and task node 6.
[0073] Furthermore, by following the node order corresponding to each boundary task, the edge gain value corresponding to each boundary task node can be calculated sequentially. This edge gain value can reflect the relationship between the number of edges between each boundary task node and other partitions in the target directed acyclic graph. Therefore, updating the position of the boundary task node in the partition based on the edge gain value can effectively reduce the number of edges between different partitions, thereby reducing the overall task execution time and improving task scheduling efficiency.
[0074] S206, based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0075] In this embodiment, when the target directed acyclic graph is obtained, the partition where the node in the target directed acyclic graph is located is determined. Since the gain value of each tangent corresponding to the boundary task node reflects the relationship between the number of tangents in the partition where the boundary task node is located and other partitions, updating the position of the boundary task node in the partition based on the tangent gain value can effectively reduce the number of tangents between different partitions, thereby reducing the overall task execution time and improving task scheduling efficiency.
[0076] In summary, Figure 2 In the illustrated embodiment, by obtaining the target directed acyclic graph of the target task, and calculating the edge gain values of each tangent edge of the corresponding boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph, the partition position of the corresponding boundary task node in the target directed acyclic graph can be updated according to the edge gain values of each tangent edge of the corresponding boundary task node. In this way, by updating the partition position of the boundary task node, the number of tangent edges between partitions can be reduced, thereby reducing the overall task execution time and improving task scheduling efficiency.
[0077] exist Figure 2 Based on the illustrated embodiments, in one embodiment, the multiple partitions include a first partition and multiple second partitions, such as Figure 4 The diagram illustrates a process for calculating the gain values of each tangent edge of a corresponding boundary task node according to the node order of the task nodes in the target directed acyclic graph. This method is then applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0078] S402, according to the node order of the boundary task nodes in the target directed acyclic graph, and based on the dependency relationship between the corresponding boundary task node and the task nodes in multiple second partitions, determine the positive gain value of the corresponding boundary task node.
[0079] Specifically, based on the dependency relationship between the corresponding boundary task node and the task nodes in the multiple second partitions, the positive gain value of the corresponding boundary task node is determined, including: determining the number of task nodes in the multiple second partitions that have a dependency relationship with the corresponding boundary task node as the positive gain value of the corresponding boundary task node.
[0080] For example, combining Figure 3 Taking task node 3 in partition 3 as an example, task node 3 is connected to task node 2 and task node 4 in partition 1. Therefore, the positive gain value of task node 3 is 2.
[0081] S404 After moving the corresponding boundary task nodes to each of the second partitions, determine the negative gain values of the corresponding boundary task nodes based on their dependencies with the task nodes in the third partition.
[0082] In this embodiment, the third partition includes the first partition and a partition different from the partition where the corresponding boundary task node moves. Specifically, after the corresponding boundary task node is moved to each of the second partitions, the negative gain values of the corresponding boundary task node are determined according to the dependency relationship between the corresponding boundary task node and the task nodes in the third partition. This includes: determining the number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node as the gain value of the corresponding boundary task node after it is moved to each of the second partitions; the gain values of the corresponding boundary task node after it is moved to each of the second partitions constitute the negative gain values of the corresponding boundary task node.
[0083] For example, combining Figure 3 Taking task node 3 in partition 3 as an example, partition 3 is the first partition, and the second partitions are partition 1 and partition 2. If task node 3 is moved to partition 1, then the third partition is partition 2 and partition 3. There is no connection between task node 3 in partition 1 and any task node in partition 2, but there is a connection between task node 3 in partition 1 and task node 6 in partition 3. Therefore, the movement gain value of task node 3 after moving to partition 1 is 1. If task node 3 is moved to partition 2, then the third partition is partition 1 and partition 3. There is a connection between task node 3 in partition 2 and task nodes 2 and 4 in partition 1, and there is a connection between task node 3 in partition 2 and task node 6 in partition 3. Therefore, the movement gain value of task node 3 after moving to partition 2 is 3, that is, the negative gain values of task node 3 are (1, 3).
[0084] S406, subtract each negative gain value from the positive gain value to obtain the edge gain value of each corresponding boundary task node.
[0085] For example, combining Figure 3 Taking the corresponding boundary task node as task node 3 as an example, the positive gain value of task node 3 is 2, and the negative gain values of task node 3 are (1, 3). Therefore, the tangent gain value of task node 3 is (1, -1).
[0086] In summary, Figure 4In the illustrated embodiment, by considering the dependencies between the corresponding boundary task node and the task nodes in different partitions, and considering the dependencies between the corresponding boundary task node and the task nodes in different partitions of the partition to which the boundary task node was moved after it was moved to other partitions, the edge gain values obtained based on the positive gain value and each negative gain value can reduce the number of edges between different partitions in the process of large-scale directed graph partitioning when updating the partition position of the corresponding boundary task node based on the edge gain values of the corresponding boundary task node. This reduces the overall task execution time and improves task scheduling efficiency.
[0087] exist Figure 2 Based on the illustrated embodiments, in one of the embodiments, such as Figure 5 The diagram illustrates a process for updating the partition position of a corresponding boundary task node in a target directed acyclic graph based on the gain values of each tangent edge of that node. This method is then applied to… Figure 1 Taking server 104 as an example, the following steps are included:
[0088] S502, based on the edge gain values of the corresponding boundary task nodes and the correspondence between the edge gain values of the boundary task nodes and the equalization gain values of the partitions corresponding to the edge gain values, multiple target gain values of the corresponding boundary task nodes are obtained.
[0089] Specifically, based on the correspondence between the edge gain value of the boundary task node and the equalization gain value of the corresponding partition, the equalization gain value corresponding to each edge gain value of the corresponding boundary task node can be determined, and each edge gain value can be summed with the corresponding equalization gain value to obtain multiple target gain values for the corresponding boundary task node.
[0090] S504: When the maximum target gain value among multiple target gain values is less than 0, keep the corresponding boundary task node in the initial partition.
[0091] In this embodiment, the partition of the boundary task node in the target directed acyclic graph is the initial partition. When the maximum target gain value among multiple target gain values is less than 0, the corresponding boundary task node is kept in the initial partition. That is, the partition position of the boundary task node in the target directed acyclic graph is not changed, so that the boundary task node is still assigned to the initial partition.
[0092] S506, when the minimum target gain value among multiple target gain values is greater than or equal to 0, based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, determine the partition corresponding to the maximum target gain value among multiple target gain values, add the corresponding boundary task node to the partition corresponding to the maximum target gain value, and delete the corresponding boundary task node in the initial partition.
[0093] In this embodiment, the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value of the maximum target gain value among the target gain values. Specifically, the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value can be determined when the moving gain value of the boundary task node is obtained. For example, after moving the boundary task node to another partition different from the initial partition, when obtaining the moving gain value corresponding to the boundary task node after moving the partition based on the dependency relationship between the boundary task node after moving the partition and the task nodes in the partition different from the moved partition, a correspondence can be established between the moving gain value corresponding to the boundary task node after moving the partition and the partition moved by the boundary task node, and the correspondence can be used to determine the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value.
[0094] For example, combining Figure 3 When the negative gain values of task node 3 are (1, 3), the negative gain value of 1 is obtained by moving the boundary task node 3 to partition 1, and the negative gain value of 3 is obtained by moving the boundary task node 3 to partition 2. Therefore, for the boundary task node 3, a correspondence can be established between the negative gain value of 1 and partition 1, and between the negative gain value of -1 and partition 2. When the balanced gain value of partition 1 is 0.5 and the balanced gain value of partition 2 is 1, the target gain values of the boundary task node 3 are (1.5, 4). Then, task node 3 can be moved to the partition corresponding to the target gain value of 4. The target gain value of 4 is obtained based on the negative gain value of 3 and the balanced gain value of partition 2. Therefore, the partition corresponding to the target gain value of 4 is the partition corresponding to the negative gain value of 3, which is partition 2. Therefore, task node 3 is moved to partition 2.
[0095] It is understandable that the specific value of the equalization gain corresponding to the partition in the target directed acyclic graph can be set according to the actual application scenario, and this embodiment does not limit it.
[0096] exist Figure 5In the illustrated embodiment, it can be understood that when the maximum target edge gain value is less than 0, the impact of moving the boundary task node on the partition balance is considered by setting the equalization gain value corresponding to the partition. If moving the boundary task node can greatly improve the partition balance, then some edge count can be sacrificed.
[0097] Based on the above, for example, Figure 6 A schematic diagram of a task scheduling method is provided. The process of abstracting the target task into a directed acyclic graph (DAG) and then processing the abstracted DAG based on preset partitioning conditions to obtain a partitioned DAG is called the coarsening process. The preset partitioning conditions include setting the number of partitions and setting partition balance constraints. The balance constraints include setting the weight of task nodes in each partition within a first preset range and setting the number of task nodes in each partition within a second preset range. The process of processing the partitioned DAG based on a preset partitioning method to obtain the target DAG is called the initial partitioning process. The process of optimizing the number of edges between partitions in the target DAG using a partitioning method based on edge count optimization is called the refinement process. Finally, the task scheduling process is performed on the task nodes in the optimized partitions based on the task scheduling method to obtain the corresponding task scheduling result. The coarsening process, the initial partitioning process, and the refinement process constitute the multi-level partitioning process of the target task's DAG.
[0098] in, Figure 6 The refinement process shown can be described as follows: Figure 7 The diagram illustrates that, specifically, the partitioning result after the initial partitioning process is used as the initial partitioning result for the refinement process. A set of boundary task nodes is determined from the task nodes in the partitions of the initial partitioning result. It is then determined whether the boundary task node set is empty. If the boundary task node set is not empty, the positive gain value and each negative gain value of the corresponding boundary task node are calculated, along with the target gain value of the corresponding boundary task node. This is then used to determine whether the movement condition is met. For example, if the maximum target gain value among multiple target gain values is less than 0, the boundary task node is not moved, and the process of determining whether the boundary task node set is empty continues. If the minimum target gain value among multiple target gain values is greater than or equal to 0, the boundary task node is moved, and the process of determining whether the boundary task node set is empty continues.
[0099] The process of determining whether the boundary task node set is empty can be understood as determining whether to perform the partition optimization process for the boundary task nodes according to the node order in the boundary task node set. If the boundary task node set is empty, it can be understood that the boundary task nodes in the boundary task set have been partitioned and optimized according to the node order in the boundary task node set, and the refinement process can be ended. After moving the boundary task nodes, the boundary task node set can be updated again.
[0100] It is understandable that when optimizing the task nodes in the partition according to the node order in the set of boundary task nodes, the partition optimization result of the previous boundary task node is the partition result before the partition optimization of the next task boundary node, and so on. The partition optimization result of the last boundary task node in the order is the final partition result in the directed acyclic graph of the target.
[0101] For example, combining Figure 3 , Figure 3 To refine the initial partitioning results of the process, a partitioning method based on the number of cut edges is used. Figure 3 Optimization can yield results such as Figure 8 The partitioning results shown, where, in Figure 3 In the middle, there are many dependencies between different partitions, with a total of 7 cut edges, while... Figure 8 As can be seen from the data, the partitioning method based on the number of cut edges optimizes the number of cut edges between partitions, reducing the total number of cut edges to 6. Therefore, the partitioning method based on the number of cut edges proposed in this application can reduce the number of cut edges between different partitions, thereby reducing the task scheduling execution time and improving task scheduling efficiency.
[0102] Based on the above, it can be understood that the partitioning method based on edge number optimization proposed in this application reduces the number of edges in the partitioning process of large-scale directed acyclic graphs, providing feasible support for subsequent task scheduling. Moreover, the partitioning method based on edge number optimization proposed in this application, under the conditions of limited memory and satisfying load balancing constraints, optimizes the impact of the refinement process on the overall result of edge number in multi-level partitioning. While maintaining partition balance, it reduces the number of edges between partitions, making the overall number of edges between partitions after partition optimization as small as possible. This enables effective task scheduling, reduces the overall task execution time, achieves the scheduling goal of minimizing completion time, and also improves resource utilization.
[0103] Furthermore, this application integrates a multi-level partitioning method with a preset partitioning method, such as the Kway method. During the refinement process, the number of cut edges is considered, and the partitioning result obtained using the preset partitioning method is used as the optimization target. This optimizes the overall number of cut edges, improves resource utilization, and allows for the rational allocation of multi-core processor resources and enhanced parallel computing capabilities. It overcomes the lack of communication control between task nodes and effectively accelerates task computation speed and improves overall resource utilization in scenarios involving large-scale computing tasks. Moreover, the refinement process does not require consideration of loops within partitions, thus significantly reducing the number of cut edges and greatly improving subsequent task scheduling performance.
[0104] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0105] Based on the same inventive concept, this application also provides a partitioning apparatus for implementing the partitioning method based on the number of cutting edges as described above. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations in one or more embodiments of the partitioning apparatus based on the number of cutting edges provided below can be found in the limitations of the partitioning method based on the number of cutting edges described above, and will not be repeated here.
[0106] In one embodiment, such as Figure 9 As shown, a partitioning device based on edge number optimization is provided, including: an acquisition module 902, a calculation module 904, and an update module 906, wherein:
[0107] The acquisition module 902 is used to acquire the target directed acyclic graph of the target task; the target directed acyclic graph includes multiple partitions.
[0108] The calculation module 904 is used to calculate the gain value of each tangent edge of the corresponding boundary task node according to the node order of the boundary task node in the target directed acyclic graph. The boundary task node is the task node in a partition different from the first partition that has a dependency relationship with the task node. The first partition is the partition of the boundary task node in the target directed acyclic graph, and multiple partitions include the first partition.
[0109] The update module 906 is used to update the partition position of the corresponding boundary task node in the target directed acyclic graph based on the gain values of each tangent edge of the corresponding boundary task node.
[0110] In one embodiment, the multiple partitions further include multiple second partitions. The calculation module 904 is further configured to determine the positive gain value of the corresponding boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph and the dependency relationship between the corresponding boundary task node and the task nodes in the multiple second partitions; after moving the corresponding boundary task node to each of the second partitions, determine the negative gain value of the corresponding boundary task node according to the dependency relationship between the corresponding boundary task node and the task nodes in the third partition; the third partition includes the first partition and a partition different from the partition to which the corresponding boundary task node was moved; and subtract the positive gain value from each negative gain value to obtain the tangent gain value of the corresponding boundary task node.
[0111] In one embodiment, the calculation module 904 is further configured to determine the number of task nodes in the plurality of second partitions that have a dependency relationship with the corresponding boundary task node as the positive gain value of the corresponding boundary task node.
[0112] In one embodiment, the calculation module 904 is further configured to determine the number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node as the corresponding movement gain value after the corresponding boundary task node moves to each second partition; the corresponding movement gain value after the corresponding boundary task node moves to each second partition constitutes the negative gain value of the corresponding boundary task node.
[0113] The update module 906 is further configured to obtain multiple target gain values for the corresponding boundary task node based on the edge gain values of each edge of the corresponding boundary task node and the correspondence between the edge gain values of the boundary task node and the equalization gain values of the partitions corresponding to the edge gain values; when the maximum target gain value among the multiple target gain values is less than 0, the corresponding boundary task node is kept in the initial partition; or, when the minimum target gain value among the multiple target gain values is greater than or equal to 0, the partition corresponding to the maximum target gain value among the multiple target gain values is determined based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, and the corresponding boundary task node is added to the partition corresponding to the maximum target gain value, and the corresponding boundary task node is deleted from the initial partition; the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value corresponding to the maximum target gain value among the target gain values.
[0114] The acquisition module 902 is also used to process the directed acyclic graph of the target task according to the preset partitioning conditions to obtain the partitioned directed acyclic graph; the preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partitions is within a first preset range, and the number of task nodes in the partitions is within a second preset range; the partitioned directed acyclic graph is processed based on the preset partitioning method to obtain the target directed acyclic graph.
[0115] Each module in the aforementioned partitioning device based on edge count optimization can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0116] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores target tasks. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a partitioning method based on edge count optimization.
[0117] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0118] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0119] Obtain the target directed acyclic graph (DAG) for the processing target task; the target DAG includes multiple partitions;
[0120] According to the node order of the boundary task nodes in the target directed acyclic graph, the gain values of each tangent edge of the corresponding boundary task node are calculated. The boundary task node is the task node with a dependency relationship between task nodes in a partition different from the first partition. The first partition is the partition of the boundary task node in the target directed acyclic graph, and multiple partitions include the first partition.
[0121] Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0122] In one embodiment, the multiple partitions further include multiple second partitions, and the processor, when executing the computer program, further implements the following steps: determining the positive gain value of the corresponding boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph and the dependency relationship between the corresponding boundary task node and the task nodes in the multiple second partitions; after moving the corresponding boundary task node to each of the second partitions respectively, determining the negative gain value of the corresponding boundary task node according to the dependency relationship between the corresponding boundary task node and the task nodes in the third partition; the third partition includes the first partition and the partition different from the partition to which the corresponding boundary task node was moved; subtracting the positive gain value from each negative gain value respectively to obtain the tangent gain value of the corresponding boundary task node.
[0123] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining the number of task nodes in the plurality of second partitions that have a dependency relationship with the corresponding boundary task node as the positive gain value of the corresponding boundary task node.
[0124] In one embodiment, when the processor executes the computer program, it further implements the following steps: determining the number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node as the corresponding movement gain value after the corresponding boundary task node moves to each second partition; the corresponding movement gain values after the corresponding boundary task node moves to each second partition constitute the corresponding negative gain values of the corresponding boundary task node.
[0125] In one embodiment, when the processor executes the computer program, it further implements the following steps: obtaining multiple target gain values for the corresponding boundary task node based on the edge gain values of each corresponding boundary task node and the correspondence between the edge gain values of the boundary task node and the equalization gain values of the partitions corresponding to the edge gain values; when the maximum target gain value among the multiple target gain values is less than 0, keeping the corresponding boundary task node in the initial partition; or, when the minimum target gain value among the multiple target gain values is greater than or equal to 0, determining the partition corresponding to the maximum target gain value among the multiple target gain values based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, adding the corresponding boundary task node to the partition corresponding to the maximum target gain value, and deleting the corresponding boundary task node from the initial partition; the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value corresponding to the maximum target gain value among the target gain values.
[0126] In one embodiment, when the processor executes the computer program, it further performs the following steps: processing the directed acyclic graph of the target task according to preset partitioning conditions to obtain a partitioned directed acyclic graph; the preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partitions is within a first preset range, and the number of task nodes in the partitions is within a second preset range; processing the partitioned directed acyclic graph based on a preset partitioning method to obtain the target directed acyclic graph.
[0127] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0128] Obtain the target directed acyclic graph (DAG) for the processing target task; the target DAG includes multiple partitions;
[0129] According to the node order of the boundary task nodes in the target directed acyclic graph, the gain values of each tangent edge of the corresponding boundary task node are calculated. The boundary task node is the task node with a dependency relationship between task nodes in a partition different from the first partition. The first partition is the partition of the boundary task node in the target directed acyclic graph, and multiple partitions include the first partition.
[0130] Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0131] In one embodiment, the multiple partitions further include multiple second partitions, and the computer program, when executed by the processor, further implements the following steps: determining the positive gain value of the corresponding boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph and based on the dependency relationship between the corresponding boundary task node and the task nodes in the multiple second partitions; after moving the corresponding boundary task node to each of the second partitions respectively, determining the negative gain values of the corresponding boundary task node based on the dependency relationship between the corresponding boundary task node and the task nodes in the third partition; the third partition includes the first partition and partitions different from the partitions moved by the corresponding boundary task node; subtracting the positive gain value from each negative gain value respectively to obtain the tangent gain value of the corresponding boundary task node.
[0132] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the number of task nodes in the plurality of second partitions that have dependencies on the corresponding boundary task nodes as the positive gain value of the corresponding boundary task nodes.
[0133] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: determining the number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node as the corresponding movement gain value after the corresponding boundary task node moves to each second partition; the corresponding movement gain values after the corresponding boundary task node moves to each second partition constitute the negative gain values of the corresponding boundary task node.
[0134] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: obtaining multiple target gain values for the corresponding boundary task node based on the edge gain values of each corresponding boundary task node and the correspondence between the edge gain values of the boundary task node and the equalization gain values of the partitions corresponding to the edge gain values; when the maximum target gain value among the multiple target gain values is less than 0, keeping the corresponding boundary task node in the initial partition; or, when the minimum target gain value among the multiple target gain values is greater than or equal to 0, determining the partition corresponding to the maximum target gain value among the multiple target gain values based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, adding the corresponding boundary task node to the partition corresponding to the maximum target gain value, and deleting the corresponding boundary task node from the initial partition; the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value corresponding to the maximum target gain value among the target gain values.
[0135] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: processing the directed acyclic graph of the target task according to preset partitioning conditions to obtain a partitioned directed acyclic graph; the preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partitions is within a first preset range, and the number of task nodes in the partitions is within a second preset range; processing the partitioned directed acyclic graph based on a preset partitioning method to obtain the target directed acyclic graph.
[0136] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0137] Obtain the target directed acyclic graph (DAG) for the processing target task; the target DAG includes multiple partitions;
[0138] According to the node order of the boundary task nodes in the target directed acyclic graph, the gain values of each tangent edge of the corresponding boundary task node are calculated. The boundary task node is the task node with a dependency relationship between task nodes in a partition different from the first partition. The first partition is the partition of the boundary task node in the target directed acyclic graph, and multiple partitions include the first partition.
[0139] Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph.
[0140] In one embodiment, the multiple partitions further include multiple second partitions, and the computer program, when executed by the processor, further implements the following steps: determining the positive gain value of the corresponding boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph and based on the dependency relationship between the corresponding boundary task node and the task nodes in the multiple second partitions; after moving the corresponding boundary task node to each of the second partitions respectively, determining the negative gain values of the corresponding boundary task node based on the dependency relationship between the corresponding boundary task node and the task nodes in the third partition; the third partition includes the first partition and partitions different from the partitions moved by the corresponding boundary task node; subtracting the positive gain value from each negative gain value respectively to obtain the tangent gain value of the corresponding boundary task node.
[0141] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining the number of task nodes in the plurality of second partitions that have dependencies on the corresponding boundary task nodes as the positive gain value of the corresponding boundary task nodes.
[0142] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: determining the number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node as the corresponding movement gain value after the corresponding boundary task node moves to each second partition; the corresponding movement gain values after the corresponding boundary task node moves to each second partition constitute the negative gain values of the corresponding boundary task node.
[0143] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: obtaining multiple target gain values for the corresponding boundary task node based on the edge gain values of each corresponding boundary task node and the correspondence between the edge gain values of the boundary task node and the equalization gain values of the partitions corresponding to the edge gain values; when the maximum target gain value among the multiple target gain values is less than 0, keeping the corresponding boundary task node in the initial partition; or, when the minimum target gain value among the multiple target gain values is greater than or equal to 0, determining the partition corresponding to the maximum target gain value among the multiple target gain values based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, adding the corresponding boundary task node to the partition corresponding to the maximum target gain value, and deleting the corresponding boundary task node from the initial partition; the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value corresponding to the maximum target gain value among the target gain values.
[0144] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: processing the directed acyclic graph of the target task according to preset partitioning conditions to obtain a partitioned directed acyclic graph; the preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partitions is within a first preset range, and the number of task nodes in the partitions is within a second preset range; processing the partitioned directed acyclic graph based on a preset partitioning method to obtain the target directed acyclic graph.
[0145] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0146] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0147] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A partitioning method based on edge count optimization, characterized in that, Applied to a server, the method includes: Obtain the target directed acyclic graph for the processing target task; the target directed acyclic graph includes multiple partitions; According to the node order of the boundary task nodes in the target directed acyclic graph, the gain value of each tangent edge of the corresponding boundary task node is calculated; the boundary task node is a task node in a partition different from the first partition that has a dependency relationship with the task nodes; the first partition is the partition of the boundary task node in the target directed acyclic graph; the multiple partitions include the first partition. Based on the gain values of each tangent edge of the corresponding boundary task node, update the partition position of the corresponding boundary task node in the target directed acyclic graph for task scheduling of the multi-core processor, enhance the parallel computing capability of the multi-core processor, and reduce the communication latency between partitions. The plurality of partitions further includes a plurality of second partitions. The step of calculating the gain values of each tangent edge of the corresponding boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph includes: According to the node order of the boundary task nodes in the target directed acyclic graph, the number of task nodes in the multiple second partitions that have a dependency relationship with the corresponding boundary task node is determined as the positive gain value of the corresponding boundary task node. The number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node is determined as the movement gain value corresponding to the corresponding boundary task node after it moves to each of the second partitions; the movement gain values corresponding to the corresponding boundary task node after it moves to each of the second partitions constitute the negative gain values of the corresponding boundary task node; the third partition includes the first partition and partitions that are different from the partitions to which the corresponding boundary task node moves. Subtracting the positive gain value from each of the negative gain values yields the corresponding edge gain value for each boundary task node.
2. The method according to claim 1, characterized in that, The step of updating the partition position of the corresponding boundary task node in the target directed acyclic graph according to the gain values of each tangent edge of the corresponding boundary task node includes: Based on the edge gain values of the corresponding boundary task nodes and the correspondence between the edge gain values of the boundary task nodes and the equalization gain values of the partitions corresponding to the edge gain values, multiple target gain values of the corresponding boundary task nodes are obtained. When the maximum target gain value among the multiple target gain values is less than 0, the corresponding boundary task node is kept in the initial partition; Alternatively, when the minimum target gain value among the multiple target gain values is greater than or equal to 0, based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, the partition corresponding to the maximum target gain value among the multiple target gain values is determined, and the corresponding boundary task node is added to the partition corresponding to the maximum target gain value, and the corresponding boundary task node is deleted from the initial partition; the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value corresponding to the maximum target gain value among the target gain values.
3. The method according to claim 1, characterized in that, The acquisition of the target directed acyclic graph for the processing target task includes: The directed acyclic graph of the target task is processed according to preset partitioning conditions to obtain the partitioned directed acyclic graph; the preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partition is within a first preset range, and the number of task nodes in the partition is within a second preset range. The target directed acyclic graph is obtained by processing the partitioned directed acyclic graph based on a preset partitioning method.
4. The method according to claim 2, characterized in that, The step of obtaining multiple target gain values for the corresponding boundary task node based on the edge gain values of each corresponding boundary task node and the correspondence between the edge gain values of the boundary task node and the equalization gain values of the partitions corresponding to the edge gain values includes: Based on the edge gain values of the corresponding boundary task nodes and the correspondence between the edge gain values of the boundary task nodes and the equalization gain values of the partitions corresponding to the edge gain values, the equalization gain values corresponding to the edge gain values of the corresponding boundary task nodes are determined respectively. Each of the stated edge gain values is summed with the corresponding equalization gain value to obtain multiple target gain values for the corresponding boundary task node.
5. A partitioning device based on edge number optimization, characterized in that, Applied to a server, the device includes: The acquisition module is used to acquire the target directed acyclic graph of the target task; the target directed acyclic graph includes multiple partitions; The calculation module is used to calculate the edge gain value of each boundary task node according to the node order of the boundary task nodes in the target directed acyclic graph; the boundary task node is a task node with a dependency relationship between task nodes in a partition different from the first partition, the first partition is the partition of the boundary task node in the target directed acyclic graph, and the plurality of partitions includes the first partition. The update module is used to update the partition position of the corresponding boundary task node in the target directed acyclic graph according to the gain value of each tangent edge of the corresponding boundary task node, so as to use the task scheduling of the multi-core processor, enhance the parallel computing capability of the multi-core processor, and reduce the communication latency between partitions. The plurality of partitions further includes a plurality of second partitions. The calculation module is further configured to, according to the node order of the boundary task nodes in the target directed acyclic graph, determine the number of task nodes in the plurality of second partitions that have a dependency relationship with the corresponding boundary task node as the positive gain value of the corresponding boundary task node; determine the number of task nodes in the third partition that have a dependency relationship with the corresponding boundary task node as the movement gain value of the corresponding boundary task node after moving to each of the second partitions; the movement gain values of the corresponding boundary task nodes after moving to each of the second partitions constitute the negative gain values of the corresponding boundary task node; the third partition includes the first partition and partitions different from the partitions to which the corresponding boundary task node moves; and subtract the positive gain value from each of the negative gain values to obtain the tangent gain value of the corresponding boundary task node.
6. The apparatus according to claim 5, characterized in that, The update module is also used for: Based on the edge gain values of the corresponding boundary task nodes and the correspondence between the edge gain values of the boundary task nodes and the equalization gain values of the partitions corresponding to the edge gain values, multiple target gain values of the corresponding boundary task nodes are obtained. When the maximum target gain value among the multiple target gain values is less than 0, the corresponding boundary task node is kept in the initial partition; Alternatively, when the minimum target gain value among the multiple target gain values is greater than or equal to 0, based on the correspondence between the negative gain value corresponding to the target gain value of the boundary task node and the partition corresponding to the negative gain value, the partition corresponding to the maximum target gain value among the multiple target gain values is determined, and the corresponding boundary task node is added to the partition corresponding to the maximum target gain value, and the corresponding boundary task node is deleted from the initial partition; the partition corresponding to the maximum target gain value among the target gain values is the partition corresponding to the negative gain value corresponding to the maximum target gain value among the target gain values.
7. The apparatus according to claim 5, characterized in that, The acquisition module is also used for: The directed acyclic graph of the target task is processed according to preset partitioning conditions to obtain the partitioned directed acyclic graph; the preset partitioning conditions include: the number of partitions is a preset number, the weight of the task nodes in the partition is within a first preset range, and the number of task nodes in the partition is within a second preset range. The target directed acyclic graph is obtained by processing the partitioned directed acyclic graph based on a preset partitioning method.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Computing task allocation method and device, computer equipment and storage medium
CN114706687A
Data task scheduling method and apparatus, storage medium, and scheduling tool
WO2022151668A1