Task partitioning method and device for coarse-grained reconfigurable processor
By selecting the search algorithm based on the communication cost and execution cost, optimizing the task division of the coarse-grained reconfigurable processor, the problem of large data transmission volume and long critical paths in traditional methods is solved, and the system operation efficiency is improved.
Patent Information
- Application Number
- CN202210250947.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-03-15
AI Technical Summary
The traditional task division method for coarse-grained reconfigurable processors leads to large data transmission across modules and long critical paths, and the actual operating efficiency of the system is inefficient.
By selecting the appropriate search algorithm (depth or breadth priority) based on the communication cost and execution cost of the target subtask, when the number of nodes currently contained in the target subtask is less than the hardware resources, the nodes are added to the subtask, optimize the node division, and reduce the number of nodes. Data transfer volume and critical paths.
It effectively reduces the cross-module data transmission time and sub-task execution time, improves the actual operating efficiency of the system, and realizes multi-objective balanced optimization of task division.
Smart Images

Figure CN114817119B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a task partitioning method, apparatus, computer equipment, storage medium and computer program product for a coarse-grained reconfigurable processor. Background Art
[0002] The Coarse-grained Reconfigurable Architecture (CGRA) can quickly switch configurations to change the computing functions of the hardware. When the number of hardware resources is less than the number required for the target task, the target task needs to be divided into several subtasks. The subtasks reuse the same hardware resources in turn to implement the functions of each subtask, thereby completing the function of the original target task. Among them, the target task can be regarded as a node set composed of multiple nodes, each of which can represent a calculation or operation on the data. The target task can be divided into multiple subtasks by dividing the nodes.
[0003] Traditional task partitioning methods for coarse-grained reconfigurable processors are divided into breadth-first partitioning algorithms and depth-first partitioning algorithms. Among them, the breadth-first partitioning algorithm first assigns different levels to the nodes in the data flow graph. Then, the node layering is implemented through the As Soon As Possible (ASAP) scheduling algorithm. After the level is assigned, the nodes are placed into modules layer by layer from the highest level to the lowest level, realizing the breadth-first traversal of the nodes. The depth-first partitioning algorithm is to put closely related operations into one module as much as possible.
[0004] However, the breadth-first partitioning algorithm has a large amount of data transmission across modules, a long data transmission time, and a long actual system running time. The depth-first partitioning algorithm has a long critical path, a long execution time for subtasks, and a long actual system running time. Therefore, the actual system running efficiency of the traditional task partitioning method for coarse-grained reconfigurable processors is low. Summary of the invention
[0005] Based on this, it is necessary to provide a task partitioning method, apparatus, computer equipment, computer-readable storage medium and computer program product for a coarse-grained reconfigurable processor that can improve the actual operating efficiency of the system in response to the above technical problems.
[0006] In a first aspect, the present application provides a task partitioning method for a coarse-grained reconfigurable processor.
[0007] The method comprises:
[0008] Determine the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask;
[0009] Determining a search algorithm corresponding to the target subtask based on the communication cost, the execution cost and a preset search algorithm judgment rule;
[0010] Based on the search algorithm, the target node of this division is determined, and when the number of nodes currently included in the target subtask is less than the target hardware resources, the target node is added to the target subtask, and the nodes currently included in the target subtask are returned to determine the communication cost and execution cost steps of the target subtask.
[0011] In one embodiment, the determining the search algorithm corresponding to the target subtask based on the communication cost, the execution cost and a preset search algorithm judgment rule includes:
[0012] Adding the communication cost and the execution cost to obtain the total cost of the target subtask;
[0013] Calculating the communication cost ratio of the communication cost to the total cost according to the communication cost and the total cost;
[0014] The search algorithm corresponding to the target subtask is determined according to the communication cost ratio and a preset search algorithm judgment threshold.
[0015] In one of the embodiments, the search algorithm includes a depth-first search algorithm and a breadth-first search algorithm;
[0016] Determining the search algorithm corresponding to the target subtask according to the communication cost ratio and a preset search algorithm judgment threshold includes:
[0017] When the communication cost ratio is greater than or equal to a preset search algorithm judgment threshold, determining that the search algorithm corresponding to the target subtask is a depth-first search algorithm;
[0018] When the communication cost ratio is less than a preset search algorithm judgment threshold, it is determined that the search algorithm corresponding to the target subtask is a breadth-first search algorithm.
[0019] In one embodiment, determining the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask includes:
[0020] Determine the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask according to the nodes currently included in the target subtask;
[0021] Determining the communication cost of the target subtask according to the data communication volume and a preset penalty term coefficient;
[0022] According to the critical path, the execution cost of the target subtask is determined.
[0023] In one embodiment, determining the target node for this division based on the search algorithm includes:
[0024] According to the current task division result, a ready node table corresponding to the current task division result is determined; the ready node table includes ready nodes; the ready nodes are nodes to which all predecessor nodes have been allocated;
[0025] Based on the search algorithm, the target node for this division is determined in the ready node table.
[0026] In one of the embodiments, when the number of nodes currently included in the target subtask is equal to the target hardware resources, the method further includes:
[0027] For each node included in the target subtask, according to the target task to which the target subtask belongs, determining whether a successor node of the node is in the target subtask;
[0028] If the successor node of the node is not in the target subtask, generating a target storage node corresponding to the node;
[0029] For each previous node included in the division result of the previous target subtask, determine whether a successor node of the previous node is in the target subtask according to the target task and the target subtask;
[0030] If the successor node of the previous node is in the target subtask, generating a target node corresponding to the previous node in the target subtask;
[0031] A division result corresponding to the target subtask is determined according to the target subtask, each of the target storage nodes and each of the target fetching nodes.
[0032] In a second aspect, the present application also provides a task partitioning device for a coarse-grained reconfigurable processor. The device comprises:
[0033] A cost determination module, used to determine the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask;
[0034] An algorithm determination module, used to determine the search algorithm corresponding to the target subtask based on the communication cost, the execution cost and a preset search algorithm judgment rule;
[0035] The node determination module is used to determine the target node of this division based on the search algorithm, and when the number of nodes currently included in the target subtask is less than the target hardware resources, add the target node to the target subtask, return the nodes currently included in the target subtask, and determine the communication cost and execution cost steps of the target subtask.
[0036] In one embodiment, the algorithm determination module is specifically used to:
[0037] Adding the communication cost and the execution cost to obtain the total cost of the target subtask;
[0038] Calculating the communication cost ratio of the communication cost to the total cost according to the communication cost and the total cost;
[0039] The search algorithm corresponding to the target subtask is determined according to the communication cost ratio and a preset search algorithm judgment threshold.
[0040] In one of the embodiments, the search algorithm includes a depth-first search algorithm and a breadth-first search algorithm;
[0041] The algorithm determination module is specifically used for:
[0042] When the communication cost ratio is greater than or equal to a preset search algorithm judgment threshold, determining that the search algorithm corresponding to the target subtask is a depth-first search algorithm;
[0043] When the communication cost ratio is less than a preset search algorithm judgment threshold, it is determined that the search algorithm corresponding to the target subtask is a breadth-first search algorithm.
[0044] In one embodiment, the cost determination module is specifically used to:
[0045] Determine the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask according to the nodes currently included in the target subtask;
[0046] Determining the communication cost of the target subtask according to the data communication volume and a preset penalty term coefficient;
[0047] According to the critical path, the execution cost of the target subtask is determined.
[0048] In one embodiment, the node determination module is specifically used to:
[0049] According to the current task division result, a ready node table corresponding to the current task division result is determined; the ready node table includes ready nodes; the ready nodes are nodes to which all predecessor nodes have been allocated;
[0050] Based on the search algorithm, the target node for this division is determined in the ready node table.
[0051] In one of the embodiments, when the number of nodes currently included in the target subtask is equal to the target hardware resources, the apparatus further includes:
[0052] For each node included in the target subtask, according to the target task to which the target subtask belongs, determining whether a successor node of the node is in the target subtask;
[0053] If the successor node of the node is not in the target subtask, generating a target storage node corresponding to the node;
[0054] For each previous node included in the division result of the previous target subtask, determine whether a successor node of the previous node is in the target subtask according to the target task and the target subtask;
[0055] If the successor node of the previous node is in the target subtask, generating a target node corresponding to the previous node in the target subtask;
[0056] A division result corresponding to the target subtask is determined according to the target subtask, each of the target storage nodes and each of the target fetching nodes.
[0057] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps described in the first aspect are implemented.
[0058] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps described in the first aspect are implemented.
[0059] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps described in the first aspect are implemented.
[0060] The above-mentioned task division method, device, computer equipment, storage medium and computer program product for coarse-grained reconfigurable processors determine the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask; determine the search algorithm corresponding to the target subtask based on the communication cost, the execution cost and the preset search algorithm judgment rule; determine the target node of this division based on the search algorithm, and add the target node to the target subtask when the number of nodes currently included in the target subtask is less than the target hardware resources, and return to the step of determining the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask. In this way, each time a node is divided for a subtask, its communication cost and execution cost are measured according to the current situation of the subtask, and a node is selected through a corresponding search algorithm, so that the method can reduce the amount of cross-module data transmission and shorten the critical path, thereby not only reducing the data transmission time, but also reducing the execution time of the subtask, thereby improving the actual operation efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A schematic diagram of a flow chart of a task partitioning method for a coarse-grained reconfigurable processor in one embodiment;
[0062] Figure 2 A flowchart of determining a search algorithm step corresponding to a target subtask based on a communication cost, an execution cost and a preset search algorithm judgment rule in an embodiment;
[0063] Figure 3 A flowchart of determining the search algorithm steps corresponding to the target subtask according to the communication cost ratio and the preset search algorithm judgment threshold in one embodiment;
[0064] Figure 4 A flowchart of the steps of determining the communication cost and execution cost of a target subtask in one embodiment;
[0065] Figure 5 A schematic diagram of a flow chart of a step of determining a target node for this division based on a search algorithm in an embodiment;
[0066] Figure 6 A schematic diagram of a deadlock phenomenon in one embodiment;
[0067] Figure 7 It is a flowchart of a task partitioning method for a coarse-grained reconfigurable processor in another embodiment;
[0068] Figure 8 is a schematic diagram of a target task in one embodiment;
[0069] Fig. 9is a schematic diagram of a target subtask in an embodiment;
[0070] Fig.10 is a schematic diagram of another target subtask in one embodiment;
[0071] Fig.11 It is a structural block diagram of a task partitioning device for a coarse-grained reconfigurable processor in one embodiment;
[0072] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0074] In one embodiment, Figure 1 As shown, a task partitioning method for a coarse-grained reconfigurable processor is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers. In this embodiment, the method includes the following steps:
[0075] Step 101, determining the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask.
[0076] In the embodiment of the present application, the target task is the total task that the coarse-grained reconfigurable processor needs to perform. The target task is the task to be divided. The target subtask is the subtask obtained by dividing the target task. The data flow graph (Data FlowGraph, DFG) includes nodes and edges. The node represents a calculation or some operation performed on the data. The edge represents the actual value transmitted to and from the node, usually represented by an arrow. The subgraph is the data flow graph corresponding to the target subtask. The module is used to execute the target subtask.
[0077] The terminal may determine the edges currently included in the target subtask based on the target task and the nodes currently included in the target subtask. Specifically, the terminal may locate the nodes currently included in the target subtask in the target task and determine the edges connected to the nodes currently included in the target subtask. Then, the terminal uses the edges connected to the nodes currently included in the target subtask as the edges currently included in the target subtask.
[0078] Then, the terminal can determine the subgraph currently corresponding to the target subtask according to the nodes and edges currently included in the target subtask. Specifically, the terminal can connect the nodes and edges currently included in the target subtask according to the connection between the nodes and edges in the data flow graph corresponding to the target task to obtain the subgraph currently corresponding to the target subtask.
[0079] Then, the terminal can determine the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask according to the subgraph currently corresponding to the target subtask. Then, the terminal can calculate the communication cost and execution cost of the target subtask according to the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask. Among them, the execution cost is the execution time cost, which is the delay of a module to execute the task operation, which is equal to the critical path delay of this module. The critical path is the logical path with the longest delay from input to output. The shorter the critical path, the smaller the execution cost, the faster the processing speed of the module, and the less the total processing time of the system. The communication cost is the communication time cost, which is the delay of a module to perform data exchange operations with modules corresponding to other target subtasks, which depends on the total amount of data exchanged between the module and the modules corresponding to other target subtasks. If the total amount of data exchanged between a module and the modules corresponding to other target subtasks is small, fewer access nodes need to be generated, thereby reducing the memory access overhead. The smaller the communication cost, the faster the data exchange speed of the module, and the less the total processing time of the system.
[0080] Step 102, determining the search algorithm corresponding to the target subtask based on the communication cost, the execution cost and the preset search algorithm judgment rule.
[0081] In an embodiment of the present application, the terminal may pre-set a search algorithm judgment rule. Then, the terminal may calculate the communication cost ratio based on the communication cost and the execution cost. The communication cost ratio is used to indicate the proportion of the communication cost. Then, the terminal may determine the search algorithm corresponding to the target subtask according to the communication cost ratio and the search algorithm judgment rule. The search algorithm is an algorithm for task division. The search algorithm judgment rule includes the corresponding relationship between the communication cost ratio and the search algorithm.
[0082] Step 103, based on the search algorithm, determine the target node of this division, and when the number of nodes currently included in the target subtask is less than the target hardware resources, add the target node to the target subtask, and return to the step of determining the communication cost and execution cost of the target subtask based on the nodes currently included in the target subtask.
[0083] In an embodiment of the present application, the terminal can determine the target node for this division based on the search algorithm.
[0084] In one example, when the search algorithm is a depth-first search algorithm, the terminal searches for the successor nodes corresponding to the nodes currently included in the target subtask. The successor node is the node after the current node according to the connection order of the data flow graph. Then, the terminal selects a successor node from these successor nodes as the target node for this division. In this way, by using the depth-first search algorithm and taking the successor node as the target node for this division, the communication cost of the target subtask can be reduced, and the execution time of the subtask can be reduced while reducing the data transmission time, thereby improving the actual operation efficiency of the system.
[0085] In one example, when the search algorithm is a depth-first search algorithm, for each candidate node, the terminal calculates the communication volume contribution of the candidate node to reducing the communication volume. If a candidate node is added to the current target subtask, it can cause the cross-module data transmission volume to decrease, then the terminal determines that the communication volume contribution of the candidate node is a positive number. If a candidate node is added to the current target subtask, it can cause the cross-module data transmission volume to increase, then the terminal determines that the communication volume contribution of the candidate node is a negative number. If a candidate node is added to the current target subtask, it can cause the cross-module data transmission volume to remain unchanged, then the terminal determines that the communication volume contribution of the candidate node is 0. Then, the terminal determines the target node of this division according to the communication volume contribution corresponding to each candidate node. For example, the terminal can arbitrarily select an alternative node from each candidate node whose communication volume contribution is a positive number as the target node of this division. For example, the terminal compares the communication volume contribution corresponding to each candidate node, and uses the candidate node with the largest communication volume contribution as the target node of this division.
[0086] In one example, when the search algorithm is a breadth-first search algorithm, for each node currently included in the target subtask, the terminal determines the same-layer node that is located at the same layer as the node. Then, the terminal selects a same-layer node from the same-layer nodes corresponding to each node as the target node for this division. In this way, by using the breadth-first search algorithm, the same-layer node is used as the target node for this division. The same-layer node can be parallel to the existing operations in the target subtask, which can increase the parallelism and reduce the execution cost of the target subtask. While reducing the data transmission time, it also reduces the execution time of the subtask, thereby improving the actual operation efficiency of the system.
[0087] Then, the terminal can compare the number of nodes currently included in the target subtask with the target hardware resources. In the case where the number of nodes currently included in the target subtask is less than the target hardware resources, the terminal locates the target node in the data flow graph corresponding to the target task and determines the edge corresponding to the target node. Then, the terminal adds the target node and the edge corresponding to the target node to the target subtask and returns to step 101.
[0088] When the number of nodes currently included in the target subtask is equal to the target hardware resources, the terminal uses the current division result corresponding to the target subtask as the division result corresponding to the target subtask. Then, the terminal creates a new target subtask and selects the starting node to be placed in the new target subtask. Specifically, the terminal can arbitrarily select a node from the candidate nodes as the target node and add the target node to the new target subtask. Then, the terminal can return to step 101, divide the target node for the new target subtask, and determine the division result corresponding to the new target subtask.
[0089] When no nodes can be divided, the terminal stops dividing and forms the division result of the target task with the division results corresponding to each target subtask.
[0090] In the above-mentioned task division method for coarse-grained reconfigurable processors, the terminal determines the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask; then, based on the communication cost, execution cost and preset search algorithm judgment rules, the search algorithm corresponding to the target subtask is determined; then, based on the search algorithm, the target node of this division is determined, and when the number of nodes currently included in the target subtask is less than the target hardware resources, the target node is added to the target subtask, and the communication cost and execution cost step of the target subtask are determined according to the nodes currently included in the target subtask. In this way, each time the node is divided for the subtask, its communication cost and execution cost are measured according to the current situation of the subtask, and the node is selected through the corresponding search algorithm, so that the method can reduce the amount of data transmission across modules and shorten the critical path, thereby not only reducing the data transmission time, but also reducing the execution time of the subtask, thereby improving the actual operation efficiency of the system. At the same time, this compromise between improving parallelism and reducing communication volume makes the method a multi-objective balanced optimization algorithm. In addition, through the corresponding search algorithm, breadth-first traversal or depth-first traversal can be performed, and nodes that meet the search algorithm are searched first each time the target node is determined, which narrows the range of alternative nodes, greatly reduces the number of traversals, and greatly improves the efficiency of task division.
[0091] In one embodiment, Figure 2 As shown, based on the communication cost, the execution cost and the preset search algorithm judgment rule, the specific process of determining the search algorithm corresponding to the target subtask includes the following steps:
[0092] Step 201, add the communication cost and the execution cost to obtain the total cost of the target subtask.
[0093] In an embodiment of the present application, the terminal may add the communication cost and the execution cost, calculate the sum of the communication cost and the execution cost, and use the sum as the total cost of the target subtask.
[0094] Step 202, calculating the communication cost ratio of the communication cost to the total cost according to the communication cost and the total cost.
[0095] In the embodiment of the present application, the terminal may divide the communication cost by the total cost to calculate the ratio of the communication cost to the total cost. Then, the terminal may use the ratio of the communication cost to the total cost as the communication cost ratio.
[0096] Step 203, determining the search algorithm corresponding to the target subtask according to the communication cost ratio and a preset search algorithm judgment threshold.
[0097] In an embodiment of the present application, the terminal may pre-set and store a search algorithm judgment threshold. The search algorithm judgment threshold is used to judge the division algorithm currently corresponding to the target subtask. The search algorithm judgment threshold is an empirical parameter. For example, the search algorithm judgment threshold may be γ, and 0<≤1. Then, the terminal may compare the communication cost ratio with the preset search algorithm judgment threshold to obtain a communication cost ratio comparison result. Then, the terminal may determine the search algorithm corresponding to the target subtask based on the communication cost ratio comparison result.
[0098] In the above-mentioned task partitioning method for coarse-grained reconfigurable processors, the terminal adds the communication cost and the execution cost to obtain the total cost of the target subtask; then, based on the communication cost and the total cost, the communication cost ratio of the communication cost to the total cost is calculated; then, based on the communication cost ratio and the preset search algorithm judgment threshold, the search algorithm corresponding to the target subtask is determined. In this way, the communication cost ratio is calculated through the communication cost and the execution cost, and the search algorithm is determined according to the communication cost ratio, so as to achieve a compromise between the communication cost and the execution cost, so that each time the node is divided for the subtask, the method can reduce the amount of data transmission across modules and shorten the critical path, thereby not only reducing the data transmission time, but also reducing the execution time of the subtask, thereby improving the actual operation efficiency of the system. At the same time, this compromise between improving parallelism and reducing communication volume makes this method a multi-objective balanced optimization algorithm.
[0099] In one embodiment, the search algorithm includes a depth-first search algorithm and a breadth-first search algorithm.
[0100] like Figure 3 As shown, according to the communication cost ratio and the preset search algorithm judgment threshold, the specific process of determining the search algorithm corresponding to the target subtask includes the following steps:
[0101] Step 301: When the communication cost ratio is greater than or equal to a preset search algorithm judgment threshold, it is determined that the search algorithm corresponding to the target subtask is a depth-first search algorithm.
[0102] In the embodiment of the present application, when the communication cost ratio is greater than or equal to the preset search algorithm judgment threshold, the terminal determines that the search algorithm corresponding to the target subtask is a depth-first search algorithm, wherein the depth-first search algorithm is used to search for the successor node of the node currently included in the target subtask.
[0103] Step 302: When the communication cost ratio is less than a preset search algorithm judgment threshold, it is determined that the search algorithm corresponding to the target subtask is a breadth-first search algorithm.
[0104] In the embodiment of the present application, when the communication cost ratio is less than the preset search algorithm judgment threshold, the terminal determines that the search algorithm corresponding to the target subtask is a breadth-first search algorithm. Among them, the breadth-first search algorithm is used to search for parallel nodes of the node currently included in the target subtask. The parallel node of a node is a node located at the same layer as the node.
[0105] In the above-mentioned task partitioning method for coarse-grained reconfigurable processors, when the communication cost ratio is greater than or equal to the preset search algorithm judgment threshold, the search algorithm corresponding to the target subtask is determined to be a depth-first search algorithm; when the communication cost ratio is less than the preset search algorithm judgment threshold, the search algorithm corresponding to the target subtask is determined to be a breadth-first search algorithm. In this way, when the communication cost ratio is too high, the depth-first search algorithm is adopted, and the successor node is used as the target node, which can reduce the communication cost of the current module; when the communication cost ratio is too low, that is, when the execution cost is too high, the breadth-first search algorithm is adopted, and the parallel node is used as the target node to increase the parallelism of the operation in the current module, so that the execution cost of the current module will not be too high, and the execution cost of the module is reduced when the partition is completed. Therefore, compared with other task partitioning methods for coarse-grained reconfigurable processors, this method can not only reduce the amount of data transmission across modules, but also shorten the critical path, thereby not only reducing the data transmission time, but also reducing the execution time of subtasks, thereby improving the actual operation efficiency of the system. At the same time, this compromise between improving parallelism and reducing communication volume makes this method a multi-objective balanced optimization algorithm.
[0106] In one embodiment, Figure 4 As shown, according to the nodes currently included in the target subtask, the specific process of determining the communication cost and execution cost of the target subtask includes the following steps:
[0107] Step 401 : Determine the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask according to the nodes currently included in the target subtask.
[0108] In an embodiment of the present application, the terminal can locate the nodes currently included in the target subtask in the target task, and determine the edges connected to the nodes currently included in the target subtask. Then, the terminal uses the edges connected to the nodes currently included in the target subtask as the edges currently included in the target subtask. Then, the terminal can connect the nodes and edges currently included in the target subtask according to the connection between the nodes and the edges in the data flow graph corresponding to the target task, and obtain the subgraph currently corresponding to the target subtask.
[0109] Then, the terminal can determine the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask based on the subgraph currently corresponding to the target subtask. Specifically, for each node currently contained in the target subtask, the terminal can add the number of edges connecting the node with other subtasks to obtain the data communication volume corresponding to the node with other target subtasks. Then, the terminal adds the data communication volume corresponding to each node with other target subtasks to obtain the data communication volume of the target subtask with other target subtasks. At the same time, the terminal can determine at least one logical path from input to output in the subgraph currently corresponding to the target subtask. Then, the terminal can compare the logical paths to determine the critical path.
[0110] Step 402: Determine the communication cost of the target subtask according to the data communication volume and the preset penalty coefficient.
[0111] In an embodiment of the present application, the terminal may pre-set a penalty term coefficient. Then, the terminal may multiply the data communication volume by the penalty term coefficient, and use the obtained product as the communication cost of the target subtask. Among them, the penalty term coefficient is a regular penalty term. Generally, the data communication time is proportional to the data communication volume, that is, the communication cost is proportional to the data communication volume. Therefore, the communication cost of the target subtask can be obtained in this way.
[0112] Step 403: Determine the execution cost of the target subtask according to the critical path.
[0113] In the embodiment of the present application, the terminal calculates the execution time of the target subtask according to the critical path and obtains the execution cost of the target subtask. Generally, the execution time of the target subtask is determined by the critical path of the target subtask. Therefore, the execution cost of the target subtask can be obtained in this way.
[0114] In the above-mentioned task partitioning method for coarse-grained reconfigurable processors, the terminal determines the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask according to the nodes currently included in the target subtask; then determines the communication cost of the target subtask according to the data communication volume and the preset penalty coefficient; and then determines the execution cost of the target subtask according to the critical path. In this way, the communication cost and execution cost of the target subtask are calculated by the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask, so that each time the node is divided for the subtask, the communication cost and execution cost of the subtask are measured according to the current situation of the subtask, and the node is selected through the corresponding search algorithm, so that the method can reduce the cross-module data transmission volume and shorten the critical path, thereby not only reducing the data transmission time, but also reducing the execution time of the subtask, thereby improving the actual operation efficiency of the system. At the same time, in this way, a compromise is made between improving parallelism and reducing communication volume, making this method a multi-objective balanced optimization algorithm.
[0115] In one embodiment, the terminal may determine the communication cost of the target subtask according to the data communication volume and the preset penalty coefficient, and then add the communication cost and the execution cost to obtain the total cost of the target subtask, which can be expressed as:
[0116] cost = ex_cost + α × com_
[0117] Among them, ex_ is the execution cost of the target subtask, α×com_cost is the communication cost of the target subtask, com_cost is the data communication volume between the target subtask and other target subtasks, α is the penalty term coefficient, and cost is the total cost of the target subtask. In this way, the communication volume and module execution time are converted into a unified total cost function in a weighted manner, so that each time a node is divided for a subtask, its communication cost and execution cost are measured according to the current situation of the subtask, and the node is selected through the corresponding search algorithm, so that this method can not only reduce the data transmission time, but also reduce the execution time of the subtask, thereby improving the actual operation efficiency of the system.
[0118] Then, the terminal divides the communication cost by the total cost and uses the quotient as the communication cost ratio, which can be expressed as:
[0119] β=(α×com_cost) /
[0120] Among them, β is the communication cost ratio.
[0121] Then, the terminal can compare the communication cost ratio with the preset search algorithm judgment threshold γ (0<≤1, empirical parameter) to obtain the communication cost ratio comparison result. When the communication cost ratio is greater than or equal to the preset search algorithm judgment threshold, the terminal determines that the search algorithm corresponding to the target subtask is the depth-first search algorithm, and uses the depth-first search function (sel_dfs_node) to search for the target node of this division. When the communication cost ratio is less than the preset search algorithm judgment threshold, the terminal determines that the search algorithm corresponding to the target subtask is the breadth-first search algorithm, and uses the breadth-first search function (sel_bfs_node) to search for the target node of this division.
[0122] In one embodiment, Figure 5 As shown, based on the search algorithm, the specific process of determining the target node for this division includes the following steps:
[0123] Step 501: Determine the ready node table corresponding to the current task division result according to the current task division result.
[0124] The ready node table includes ready nodes, which are nodes to which all predecessor nodes have been allocated.
[0125] In an embodiment of the present application, the terminal determines the nodes to which all predecessor nodes have been assigned based on the current task division result. The current division result is the current subtask division result corresponding to the target task. Then, the terminal uses these obtained nodes as ready nodes. Next, the terminal generates a ready node table corresponding to the current task division result based on these ready nodes.
[0126] The predecessor node is the node before the current node according to the connection order of the data flow graph. Figure 6 As shown, the target task includes nodes A, B, C, D, E, F, G, and H. Nodes A, B, E, and G are assigned to module P. 1 In the example, nodes C, D, F, and H are allocated in module P. 2 In the example, the predecessor nodes of node G are node E and node F, and the predecessor nodes of node E are node A and node B.
[0127] Among them, in actual applications, some nodes are natural ready nodes. For example, variable operators, immediate operators, global register operators, etc. The terminal can directly use these operators as ready nodes. This considers the support for special operators and increases practical applicability. At the same time, putting natural ready nodes directly into the ready node table can shorten the program execution time and thus improve the efficiency of task division.
[0128] In one example, the terminal may establish a ready node table through a ready node function (get_rdy_lst).
[0129] Step 502: Based on the search algorithm, determine the target node for this division in the ready node table.
[0130] In an embodiment of the present application, the terminal can determine the target node for this division in the ready node table based on the search algorithm.
[0131] In one example, when the search algorithm is a depth-first search algorithm, the terminal searches for successor nodes corresponding to each node currently included in the target subtask. Then, for each of these successor nodes, the terminal determines whether the successor node is in the ready node table. If the successor node is in the ready node table, the terminal uses the successor node as a candidate node. Then, the terminal selects one candidate node from these candidate nodes as the target node for this division.
[0132] In one example, when the search algorithm is a breadth-first search algorithm, for each node currently included in the target subtask, the terminal determines the peer nodes at the same layer as the node. Then, for each of these peer nodes, the terminal determines whether the peer node is in the ready node table. If the peer node is in the ready node table, the terminal uses the peer node as a candidate node. Then, the terminal selects one of these candidate nodes as the target node for this division.
[0133] When the ready node table is empty, it indicates that all nodes in the data flow graph of the current task have been arranged into appropriate modules, and the partitioning process is over. At this time, the terminal stops the partitioning and forms the partitioning result of the target task with the partitioning results corresponding to each target subtask.
[0134] In the above-mentioned task partitioning method for coarse-grained reconfigurable processors, the terminal determines the ready node table corresponding to the current task partitioning result according to the current task partitioning result; and then determines the target node of this partitioning in the ready node table based on the search algorithm. Figure 6 As shown, node G is assigned to module P 1 , while the predecessor node F of node G is assigned to module P 1 The successor module P 2 , thus causing deadlock. In this way, each time a node is divided for a subtask, a new ready node table is generated according to the current situation of the subtask, and a node is selected from the ready node table, and the ready nodes in the ready node table are all nodes to which all predecessor nodes have been assigned. Therefore, the target nodes divided by this method are all nodes that will not cause deadlock, and the situation in which the predecessor node of a node is assigned to the subsequent subtask of the node, that is, the subsequent module, will not occur during the division of this method. Therefore, this method can effectively avoid the phenomenon of deadlock.
[0135] In one embodiment, Figure 7 As shown, when the number of nodes currently included in the target subtask is equal to the target hardware resources, the specific process of the method further includes the following steps:
[0136] Step 701 : for each node included in the target subtask, according to the target task to which the target subtask belongs, determine whether the successor node of the node is in the target subtask.
[0137] In the embodiment of the present application, for each node included in the target subtask, the terminal can locate the node in the data flow graph corresponding to the target task to which the target subtask belongs, and determine the successor node of the node. Then, the terminal determines whether the successor node of the node is in the target subtask, and obtains the successor node judgment result corresponding to the node.
[0138] Step 702: If the successor node of the node is not in the target subtask, generate a target storage node corresponding to the node.
[0139] In the embodiment of the present application, if the successor node of the node is not in the target subtask, the terminal generates a target storage node corresponding to the node and numbers the target storage node corresponding to the node. The target storage node (store, st) is used to store the data generated by the edges of the original data flow graph that are cut off due to task division in the context register, so that the next subgraph can take it out and continue the calculation.
[0140] Step 703: for each previous node included in the division result of the previous target subtask, determine whether the successor node of the previous node is in the target subtask according to the target task and the target subtask.
[0141] In an embodiment of the present application, the terminal may first determine whether the target subtask is the first target subtask corresponding to the target task. If the target subtask is not the first target subtask corresponding to the target task, then for each previous node included in the division result of the previous target subtask, the terminal may locate the previous node in the data flow graph corresponding to the target task and determine the successor node of the previous node. Then, the terminal may locate the successor node of the previous node in the subgraph currently corresponding to the target subtask and determine whether the successor node of the previous node is in the target subtask.
[0142] If the target subtask is the first target subtask corresponding to the target task, the terminal does not generate a target fetching node. In this way, it is first determined whether the target subtask is the first target subtask corresponding to the target task, and when the target subtask is the first target subtask corresponding to the target task, there is no data inflow, and no target fetching node needs to be generated, which can shorten the program execution time and improve the efficiency of task division.
[0143] Step 704: If the successor node of the previous node is in the target subtask, generate a target node corresponding to the previous node in the target subtask.
[0144] In the embodiment of the present application, if the successor node of the previous node is in the target subtask, the terminal generates a target fetch node corresponding to the previous node in the target subtask according to the number of the previous node. The target fetch node (load, ld) is used to fetch the data generated by the edge of the original data flow graph that was cut off due to task division in the context register to continue calculation.
[0145] Step 705: Determine the division result corresponding to the target subtask according to the target subtask, each target storage node and each target fetching node.
[0146] In an embodiment of the present application, the terminal adds each target storage node, each target retrieval node, the edges corresponding to each target storage node, and the edges corresponding to each target retrieval node to the target subtask according to the connection relationship between the nodes in the data flow graph corresponding to the target task to which the target subtask belongs, and obtains the division result corresponding to the target subtask.
[0147] In the above-mentioned task partitioning method for coarse-grained reconfigurable processors, for each node included in the target subtask, according to the target task to which the target subtask belongs, it is determined whether the successor node of the node is in the target subtask; if the successor node of the node is not in the target subtask, a target storage node corresponding to the node is generated; for each previous node included in the partition result of the previous target subtask, according to the target task and the target subtask, it is determined whether the successor node of the previous node is in the target subtask; if the successor node of the previous node is in the target subtask, a target fetching node corresponding to the previous node in the target subtask is generated; according to the target subtask, each target storage node and each target fetching node, the partitioning result corresponding to the target subtask is determined. In this way, the generation of access nodes is considered to increase the practical applicability of task partitioning. In addition, the simultaneous generation of access nodes in this way can solve the communication interruption problem caused by task partitioning, and can also generate correct configuration information for the subsequent compilation process. Furthermore, through the traversal method, the connection relationship between subtasks is detected, thereby generating one-to-one access nodes, and establishing a one-to-one access node relationship between partitions, ensuring the correct association between subtasks and the correct flow of data between different partitions, thereby ensuring that the subtasks generated by the partitions can run correctly.
[0148] In one embodiment, Figure 8 As shown, the target task includes: node ld2, node #10, node st8, node 3, node 4, node 5, node 6, node 7 and node 9. The terminal determines the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask; then determines the search algorithm corresponding to the target subtask based on the communication cost, execution cost and preset search algorithm judgment rules; then, based on the search algorithm, determines the target node of this division, and when the number of nodes currently included in the target subtask is less than the target hardware resources, adds the target node to the target subtask, and returns to the step of determining the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask. When the number of nodes currently included in the target subtask is equal to the target hardware resources, the terminal uses the current division result corresponding to the target subtask as the division result corresponding to the target subtask. The division result corresponding to the target subtask includes: node ld2, node #10, node 4, node 5 and node 9.
[0149] If the successor node of node 9 included in the target subtask is not included in the target subtask, the terminal generates a target storage node st13 corresponding to the node. If the successor node of node 5 included in the target subtask is not included in the target subtask, the terminal generates a target storage node st14 corresponding to the node. Then, the terminal determines the division result corresponding to the target subtask according to the target subtask, the target storage node st13 and the target storage node st14, such as Fig. 9 shown.
[0150] Then, the terminal creates a new target subtask, and selects any node from the candidate nodes as the target node, and adds the target node to the new target subtask. Then, the terminal can divide the target node for the new target subtask and determine the division result corresponding to the new target subtask. The division result corresponding to the target subtask includes: node st8, node 3, node 6, and node 7.
[0151] If the division result of the previous target subtask contains the successor node 3 of the previous node 9 in the target subtask, the terminal generates the target node ld13 corresponding to the previous node 9 in the target subtask. If the division result of the previous target subtask contains the successor node 3 and node 6 of the previous node 5 in the target subtask, the terminal generates the target node ld14 corresponding to the previous node 5 in the target subtask. Then, the terminal determines the division result corresponding to the target subtask according to the target subtask, the target node ld13 and the target node ld14, as follows: Fig.10 shown.
[0152] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0153] Based on the same inventive concept, the embodiment of the present application also provides a task partitioning device for a coarse-grained reconfigurable processor for implementing the task partitioning method for a coarse-grained reconfigurable processor involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more task partitioning devices for coarse-grained reconfigurable processors provided below can refer to the limitations of the task partitioning method for coarse-grained reconfigurable processors above, and will not be repeated here.
[0154] In one embodiment, Fig.11 As shown, a task partitioning device 1100 for a coarse-grained reconfigurable processor is provided, comprising: a cost determination module 1110, an algorithm determination module 1120 and a node determination module 1130, wherein:
[0155] The cost determination module 1110 is used to determine the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask;
[0156] An algorithm determination module 1120, configured to determine a search algorithm corresponding to the target subtask based on the communication cost, the execution cost and a preset search algorithm judgment rule;
[0157] The node determination module 1130 is used to determine the target node of this division based on the search algorithm, and when the number of nodes currently included in the target subtask is less than the target hardware resources, add the target node to the target subtask, return the nodes currently included in the target subtask, and determine the communication cost and execution cost step of the target subtask.
[0158] Optionally, the algorithm determination module 1120 is specifically configured to:
[0159] Adding the communication cost and the execution cost to obtain the total cost of the target subtask;
[0160] Calculating the communication cost ratio of the communication cost to the total cost according to the communication cost and the total cost;
[0161] The search algorithm corresponding to the target subtask is determined according to the communication cost ratio and a preset search algorithm judgment threshold.
[0162] Optionally, the search algorithm includes a depth-first search algorithm and a breadth-first search algorithm;
[0163] The algorithm determination module 1120 is specifically used to:
[0164] When the communication cost ratio is greater than or equal to a preset search algorithm judgment threshold, determining that the search algorithm corresponding to the target subtask is a depth-first search algorithm;
[0165] When the communication cost ratio is less than a preset search algorithm judgment threshold, it is determined that the search algorithm corresponding to the target subtask is a breadth-first search algorithm.
[0166] Optionally, the cost determination module 1110 is specifically configured to:
[0167] Determine the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask according to the nodes currently included in the target subtask;
[0168] Determining the communication cost of the target subtask according to the data communication volume and a preset penalty term coefficient;
[0169] According to the critical path, the execution cost of the target subtask is determined.
[0170] Optionally, the node determination module 1130 is specifically configured to:
[0171] According to the current task division result, a ready node table corresponding to the current task division result is determined; the ready node table includes ready nodes; the ready nodes are nodes to which all predecessor nodes have been allocated;
[0172] Based on the search algorithm, the target node for this division is determined in the ready node table.
[0173] Optionally, when the number of nodes currently included in the target subtask is equal to the target hardware resources, the device 1100 further includes:
[0174] For each node included in the target subtask, according to the target task, determining whether a successor node of the node is in the target subtask;
[0175] If the successor node of the node is not in the target subtask, generating a target storage node corresponding to the node;
[0176] For each previous node included in the division result of the previous target subtask, determine whether a successor node of the previous node is in the target subtask according to the target task and the target subtask;
[0177] If the successor node of the previous node is in the target subtask, generating a target node corresponding to the previous node in the target subtask;
[0178] A division result corresponding to the target subtask is determined according to the target subtask, each of the target storage nodes and each of the target fetching nodes.
[0179] Each module in the above-mentioned task partitioning device for coarse-grained reconfigurable processors can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0180] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a task division method for a coarse-grained reconfigurable processor is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0181] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0182] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0183] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0184] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0185] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0186] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0187] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0188] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A task partitioning method for a coarse-grained reconfigurable processor, characterized in that: The method comprises: Determine the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask; Determining a search algorithm corresponding to the target subtask based on the communication cost, the execution cost and a preset search algorithm judgment rule; Based on the search algorithm, determine the target node of this division, and when the number of nodes currently included in the target subtask is less than the target hardware resources, add the target node to the target subtask, return the nodes currently included in the target subtask, and determine the communication cost and execution cost step of the target subtask; Wherein, the search algorithm includes a depth-first search algorithm and a breadth-first search algorithm; the search algorithm corresponding to the target subtask is determined based on the communication cost, the execution cost and the preset search algorithm judgment rule, including: adding the communication cost and the execution cost to obtain the total cost of the target subtask; calculating the communication cost ratio of the communication cost to the total cost according to the communication cost and the total cost; when the communication cost ratio is greater than or equal to the preset search algorithm judgment threshold, determining that the search algorithm corresponding to the target subtask is a depth-first search algorithm; when the communication cost ratio is less than the preset search algorithm judgment threshold, determining that the search algorithm corresponding to the target subtask is a breadth-first search algorithm; Among them, determining the communication cost and execution cost of the target subtask based on the nodes currently included in the target subtask includes: determining the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask based on the nodes currently included in the target subtask; determining the communication cost of the target subtask based on the data communication volume and a preset penalty item coefficient; determining the execution cost of the target subtask based on the critical path.
2. The method according to claim 1, characterized in that Determining the target node for this division based on the search algorithm includes: According to the current task division result, a ready node table corresponding to the current task division result is determined; the ready node table includes ready nodes; the ready nodes are nodes to which all predecessor nodes have been allocated; Based on the search algorithm, the target node for this division is determined in the ready node table.
3. The method according to claim 1, characterized in that In the case where the number of nodes currently included in the target subtask is equal to the target hardware resources, the method further includes: For each node included in the target subtask, according to the target task to which the target subtask belongs, determining whether a successor node of the node is in the target subtask; If the successor node of the node is not in the target subtask, generating a target storage node corresponding to the node; For each previous node included in the division result of the previous target subtask, determine whether a successor node of the previous node is in the target subtask according to the target task and the target subtask; If the successor node of the previous node is in the target subtask, generating a target node corresponding to the previous node in the target subtask; A division result corresponding to the target subtask is determined according to the target subtask, each of the target storage nodes and each of the target fetching nodes.
4. The method according to claim 2, characterized in that: In the case where the search algorithm is a depth-first search algorithm, determining the target node for this division in the ready node table based on the search algorithm includes: Searching for successor nodes corresponding to each node currently included in the target subtask; For each successor node, determining whether the successor node is in the ready node table; If the successor node is in the ready node table, the successor node is used as a candidate node; Among the candidate nodes, one candidate node is selected as the target node for this division.
5. A task partitioning device for a coarse-grained reconfigurable processor, characterized in that: The device comprises: A cost determination module, used to determine the communication cost and execution cost of the target subtask according to the nodes currently included in the target subtask; An algorithm determination module, used to determine the search algorithm corresponding to the target subtask based on the communication cost, the execution cost and a preset search algorithm judgment rule; A node determination module is used to determine the target node of this division based on the search algorithm, and when the number of nodes currently included in the target subtask is less than the target hardware resources, add the target node to the target subtask, return the communication cost and execution cost step of the target subtask according to the nodes currently included in the target subtask; Wherein, the search algorithm includes a depth-first search algorithm and a breadth-first search algorithm; the algorithm determination module is specifically used to: add the communication cost and the execution cost to obtain the total cost of the target subtask; calculate the communication cost ratio of the communication cost to the total cost according to the communication cost and the total cost; when the communication cost ratio is greater than or equal to a preset search algorithm judgment threshold, determine that the search algorithm corresponding to the target subtask is a depth-first search algorithm; when the communication cost ratio is less than a preset search algorithm judgment threshold, determine that the search algorithm corresponding to the target subtask is a breadth-first search algorithm; Among them, the cost determination module is specifically used to: determine the data communication volume between the target subtask and other target subtasks and the critical path of the target subtask based on the nodes currently included in the target subtask; determine the communication cost of the target subtask based on the data communication volume and the preset penalty item coefficient; determine the execution cost of the target subtask based on the critical path.
6. The device according to claim 5, characterized in that The node determination module is specifically used for: According to the current task division result, a ready node table corresponding to the current task division result is determined; the ready node table includes ready nodes; the ready nodes are nodes to which all predecessor nodes have been allocated; Based on the search algorithm, the target node for this division is determined in the ready node table.
7. The device according to claim 5, characterized in that In a case where the number of nodes currently included in the target subtask is equal to the target hardware resources, the device further includes: A first determination module is used to determine, for each node included in the target subtask, whether a successor node of the node is included in the target subtask according to the target task; A first generating module, configured to generate a target storage node corresponding to the node if the successor node of the node is not in the target subtask; A second determination module is used to determine, for each previous node included in the division result of the previous target subtask, whether a successor node of the previous node is in the target subtask according to the target task and the target subtask; A second generating module, configured to generate a target node corresponding to the previous node in the target subtask if the successor node of the previous node is in the target subtask; The third determination module is used to determine the division result corresponding to the target subtask according to the target subtask, each target storage node and each target fetching node.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
