CGRA operator scheduling method

By optimizing the uniformity of data flow graph operators and dynamically scheduling loop bodies in CGRA, the problems of low hardware resource utilization and fixed loop intervals in the existing technology are solved, and more efficient parallel computing performance is achieved.

CN118585293AInactive Publication Date: 2024-09-03BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310205724.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing CGRA operator mapping algorithm is limited by hardware resource constraints and data dependencies in scheduling performance optimization, resulting in low utilization of processor hardware resources and fixed emission intervals between loops, which affects parallel computing efficiency.

Method used

Heuristically adjust the arrangement of Data Flow Graph (DFG) operators, optimize the uniformity of operators, use a greedy strategy to schedule loop bodies, and dynamically adjust the emission cycle interval between loops to improve the utilization of hardware resources.

Benefits of technology

It improves the utilization of processor hardware resources, shortens the time interval between loops, and improves the efficiency of parallel computing and the execution performance of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585293A
    Figure CN118585293A
Patent Text Reader

Abstract

The invention discloses a CGRA operator scheduling method. The CGRA operator scheduling method is characterized in that a traditional fixed-period iterative modular scheduling algorithm (iiterated modular scheduling algorithm) which is applied to development of a coarse-grained reconfigurable processor compiler (hereinafter referred to as CGRA) is improved and optimized. According to the method, the concept of operator uniformity is provided, the uniform arrangement of DFG operators is optimized, an optimal scheduling time point between ASAP and ALAP is found for each operator for scheduling, and after the arranged DFG is rescheduled, a greedy software pipeline strategy mode for transmitting single circulation as much as possible is adopted, so that the scheduling efficiency is improved. According to actual available hardware resources, the next cycle is sent as much as possible, and the time is for the parallel software pipeline of the DFG subjected to uniform scheduling. According to the method, a software pipeline strategy mode of transmitting a single cycle as much as possible is utilized, and uniform operator arrangement is adopted, so that a certain time sequence period is prevented from occupying excessive PEs to influence scheduling, hardware resources are prevented from being wasted by too few operators, and the execution efficiency of a processor is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of parallel computing acceleration, and in particular relates to a CGRA operator scheduling method. Background Art

[0002] Course Grained Reconfigurable Architecture (CGRA) is a processor architecture between Application Specified Integrated Circuit ASIC and Field Programmable Gate Array. It is a parallel computing mode in the air domain. It organizes different computing logics through the hardware architecture of the air domain to schedule the calculation of operators. It uses configurable resources to perform calculations close to the efficiency of dedicated circuits. At the same time, the utilization rate of hardware resources used is lower than that of field programmable gate arrays. The software compiler designed for the chip under this architecture is different from the compiler that directly generates machine instructions. Instead, it needs to extract the control flow and data flow in the software, generate the configuration flow information of the processor configuration, and map the control flow, data flow and configuration flow to the processor to run, thereby completing the software-defined computing.

[0003] The operator mapping algorithm for parallel computing in the popular CGRA mainly adopts the modular scheduling mapping algorithm, which maps the parallelized loop operator to the PE node of CGRA, arranges the operator in time in the ASAP manner, and launches a loop in a fixed cycle to realize the parallel computing processing of the loop. The optimization algorithms derived from this algorithm, such as REGImap, RAMP, MEMmap and EPImap, all use the fixed cycle and ASAP scheduling mode to perform software pipelining in operator scheduling to realize parallel computing processing. In theory, the performance of the program executed on the coarse-grained reconfigurable processor is mainly limited by the hardware resource constraints and the data dependencies of the compiled program, and the optimization of scheduling performance lies in how to reach the boundary of the above two constraint points as much as possible. Therefore, improving the utilization of the processor hardware resources as much as possible and reducing the launch interval between loops during software pipelining will help improve the efficiency of parallel computing and optimize the time required for the processor to execute the program. Summary of the invention

[0004] In view of the above analysis, the present invention aims to disclose a CGRA operator scheduling method. By heuristically adjusting the arrangement of DFG operators, the uniformity of operator arrangement is optimized, and then the next cycle in the software pipeline is scheduled as much as possible in a greedy manner, so as to improve the utilization of processor hardware and achieve the purpose of optimizing processing calculations.

[0005] The invention discloses a CGRA operator scheduling method, which comprises two steps of operator homogenization preprocessing and greedy scheduling loop body.

[0006] The operator uniformization preprocessing mainly includes optimizing the DFG of software pipeline through the uniformity index defined in the invention. The uniformity index is characterized by calculating the average degree of operator arrangement of the DFG itself, specifically calculating the inverse of the sum of squares of the difference between the number of operators scheduled by the DFG in each cycle and the number of operators scheduled in the average cycle. The smaller the value, the higher the uniformity of the operator scheduling arrangement. The number of operators scheduled in the average cycle is the number of operators of the DFG divided by the length of the critical path of the DFG itself.

[0007] Furthermore, the uniformity index optimization process is characterized by re-optimizing the ASAP scheduling time and ALAP scheduling time of the DFG operator to uniformly arrange the operators.

[0008] For the input DFG, calculate the ASAP scheduling time of all operators in the DFG, and calculate the ALAP scheduling time of all operators in the DFG. Arrange the DFG according to the ASAP scheduling method and calculate the length of the critical path. According to the latest scheduling time, traverse the operators at that scheduling time from the slowest scheduling time to the fastest scheduling time.

[0009] If the number of operators scheduled within this time is less than or equal to the average number of operators scheduled at a single time, then switch to the previous scheduling time for traversal, and all operators at this scheduling time are scheduled according to the current time. If the number of operators scheduled within this time is greater than the average number of operators scheduled at a single time, then traverse the scheduling operators at the current time, and obtain the successor node of each operator. Since the successor node of the operator has been scheduled before, the scheduling time of the successor node can be obtained. The minimum value of the scheduling time of all successor nodes and the ALAP scheduling time of the current node is taken as the latest feasible scheduling time of the current node, and traverse from the latest feasible scheduling time of the current node to the earliest ASAP scheduling time. If a time is obtained and the number of operators scheduled at this time is less than the average number of operators, then the operator is scheduled at the current time. If the node still cannot find a time to schedule, then the node is scheduled at its earliest ASAP scheduling time.

[0010] The greedy scheduling loop strategy is characterized in that when scheduling the software pipeline loop of DFG, the loop body will be scheduled as much as possible, and the emission cycle interval between loops will not be a fixed cycle, but a variable and unfixed cycle.

[0011] The feature of scheduling the loop body as much as possible is specifically to traverse the number of loops for the DFG that needs to parallelize the software pipeline. First, the minimum startup interval of the loop body Recurrence limit is calculated between the DFG loops and the DFG loops, and the hardware PE resources are expanded according to the scheduling time. For each loop, it is calculated whether there are enough hardware resources to provide operators for scheduling at the time that is the minimum startup interval away from the previous loop. If not, its scheduling time is increased until there are enough resources for the loop to be scheduled. The subsequent loops still use this scheduling strategy to schedule each loop body of the loop in this greedy way.

[0012] The present invention can achieve the following beneficial effects:

[0013] The present invention utilizes operator homogenization preprocessing to prevent hardware resources from occupying too many operators at one moment, thereby resulting in too few remaining hardware resources at that moment, which affects the start of the next loop. It also prevents hardware resources from occupying too few operators at certain moments, resulting in insufficient use of hardware resources. Thereafter, for the scheduling of loops, a greedy strategy of starting the loop as much as possible is adopted, which avoids the problem of relatively sparse operator arrangement caused by gradually increasing the loop start interval when starting the loop algorithm in a fixed period, so that the arrangement between loop bodies becomes more compact during software pipelining, thereby improving the efficiency of hardware resource utilization. The hardware occupancy rate of the processor PE is improved under the software pipelining condition, the time interval between loops in parallel computing is shortened, the execution efficiency of the processor is improved, and the time required for executing the program is shortened. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings are only for the purpose of illustrating specific examples and are not to be considered as limiting the present invention. Like reference symbols denote like parts throughout the drawings.

[0015] Figure 1 It is a flow chart of a method for uniform DFG scheduling in an embodiment of the present invention.

[0016] Figure 2 The flowchart is a method for greedy scheduling loop body in an embodiment of the present invention.

[0017] Figure 3 It is an operator graph of the ASAP scheduling DFG in the embodiment of the present invention.

[0018] Figure 4It is an operator graph of the uniform scheduling DFG in the embodiment of the present invention.

[0019] Figure 5 This is the software pipelining result of greedy scheduling after uniform scheduling of DFG in an embodiment of the present invention.

[0020] Figure 6 This is a structural diagram of the scheduling method of the present invention. DETAILED DESCRIPTION

[0021] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used to illustrate the principles of the present invention together with the embodiments of the present invention.

[0022] An embodiment of the present invention discloses a CGRA operator scheduling algorithm, including performing homogenization preprocessing on DFG operators and performing a greedy scheduling loop strategy.

[0023] The homogenization preprocessing process of the operator can refer to the example Figure 1 , specifically:

[0024] exist Figure 1 Step 1. For the input DFG, calculate the ASAP scheduling time of all operators of DFG: for time i, find all nodes whose in-degree is 0 at that time, then the ASAP scheduling time of these nodes is i, and reduce the in-degree of the successor nodes of these nodes by 1, and increase i by 1. Repeat the previous process until the ASAP scheduling time of all nodes is calculated.

[0025] exist Figure 1 Step 2: For the input DFG, calculate the ALAP scheduling time of all operators of the DFG: for time i, find all nodes whose out-degree is 0 at that time, then the ALAP scheduling time of these nodes is i, and reduce the out-degree of the successor nodes of these nodes by 1, and i is reduced by 1. Repeat the previous process until the ALAP scheduling time of all nodes is calculated.

[0026] exist Figure 1 Step 3: Schedule DFG according to the previously calculated ASAP scheduling time. Figure 3 An example of ASAP scheduling of DFG is given. In the 0th cycle, 2 operators are scheduled, in the 1st cycle, 3 operators are scheduled, in the 2nd cycle, 2 operators are scheduled, and in the 3rd cycle, 1 operator is scheduled. The length of its critical path is calculated. The critical path is a path from the fastest scheduled operator to the slowest scheduled operator of DFG. The length is the time difference between the fastest and the latest scheduled. Figure 3 In this example, the critical path is the path of operators 0, 2, 5, 7, with a length of 4. The average number of operators scheduled in time is the total number of operators divided by the length of the critical path.

[0027] exist Figure 1 In step 6 to step 13, the operators scheduled in the current time are traversed from the latest scheduling time to the earliest scheduling time. If the number of operators in the current scheduling time is less than or equal to the number of operators scheduled in the average time, then all operators in the current scheduling time retain the original scheduling time; if the number of operators in the current scheduling time is greater than the number of operators scheduled in the average time, then each operator in the current scheduling time is traversed, and the earliest scheduling time of the operator is its ASAP scheduling time, and the latest scheduling time of the operator is the minimum of the scheduling time of its successor operator and its ALAP scheduling time. Traverse from the latest scheduling time of the operator to the earliest scheduling time of the operator. If the number of operators scheduled in a certain time is less than the number of operators in the average time, then the operator is scheduled in this time. Until the operator in the current scheduling time is less than or equal to the number of operators scheduled in the average time. If the operator cannot find a feasible time to schedule, then the operator is scheduled at its ASAP scheduling time. All operators are processed according to the above process. An example of a homogenized operator is as follows Figure 4 As shown, the operator schedules two operators in each cycle.

[0028] For the DFG of the uniform scheduling operator, take the example Figure 2 The flow strategy shown performs greedy scheduling on the loop body of DFG, specifically:

[0029] For the DFG that needs to be parallelized software pipeline, it is traversed according to its cycle number. For each DFG cycle that needs to be scheduled, such as Figure 2 As shown in step 1, the minimum start interval between a single cycle and the next cycle is subject to its Reccurence constraint, that is, the length of the longest loop path between its internal operators. Figure 2 Step 2: Start scheduling from the first cycle with an initial time of 0, and the subsequent cycle scheduling time is the previous cycle scheduling time with the minimum start interval as the minimum time difference. Figure 2 Step 4: If there are enough hardware resources for the loop to be scheduled at this time, the loop will be scheduled at this time. If there are not enough hardware resources for the loop to be scheduled, the minimum start time difference will be incremented by 1. The scheduling time is the previous loop scheduling time plus the minimum start time difference. Then check whether there are enough hardware resources for scheduling. Until scheduling is possible, schedule according to the current time. For the results of the example scheduling, refer to Figure 5 .

[0030] The complete process of the invention is realized through the above-mentioned DFG homogenization processing and greedy scheduling method.

[0031] In summary, the present invention utilizes the homogenized DFG operator to avoid the situation where too many operators in one cycle affect the scheduling of the next loop body, and also avoids the situation where too few operators cause waste of idle PEs. At the same time, the loop body is scheduled in a greedy manner, so that the average scheduling time interval between loop bodies is reduced, thereby achieving a higher PE utilization rate of DFG scheduling on CGRA and improving the processor operation efficiency.

[0032] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A CGRA operator scheduling method, It is characterized in that Including homogenization preprocessing of DFG operators and greedy scheduling loop strategy after homogenization preprocessing. The CGRA operator scheduling method includes two steps: DFG operator homogenization preprocessing and greedy scheduling loop body.

2. The operator homogenization preprocessing according to claim 1 mainly includes optimizing the DFG of software pipeline through the uniformity index defined in the invention.

3. According to the uniformity index described in claim 2, Features Calculate the average degree of operator arrangement of DFG itself, specifically, calculate the inverse of the sum of the squares of the difference between the number of operators scheduled in each cycle of DFG and the number of operators scheduled in the average cycle. The larger the value, the more uniform the operator scheduling arrangement. The number of operators scheduled in the average cycle is the number of operators in DFG divided by the length of the critical path of DFG itself.

4. According to the uniformity index optimization process described in claim 2, Features The optimal scheduling time is selected between the ASAP scheduling time and the ALAP scheduling time of the DFG operator to achieve uniform arrangement of the operators. For the input DFG, calculate the ASAP scheduling time of all operators in the DFG, and calculate the ALAP scheduling time of all operators in the DFG. Arrange the DFG according to the ASAP scheduling method and calculate the length of the critical path. According to the latest scheduling time, traverse the operators at the scheduling time from the slowest scheduling time to the fastest scheduling time, and enrich the scheduling time for the traversed operators according to the arrangement results.

5. Select the optimal scheduling time according to claim 4, Features Explore the feasible scheduling time that can improve the uniformity of DFG within the subsequent scheduling time of the operator. If the subsequent scheduling time can schedule the operator and improve the uniformity, the operator will be scheduled at this time.

6. According to claim 5, the exploration of the operator successor scheduling time is specifically to start scheduling the operator from the latest time. If the number of scheduled operators within this time is less than or equal to the average number of operators scheduled at a single time, then the operator can be switched to the previous scheduling time for traversal, and all operators at this scheduling time are scheduled according to the current time. If the number of scheduled operators within this time is greater than the average number of operators scheduled at a single time, then the scheduling operators at the current time are traversed, and the successor node of the operator is obtained for each operator. Since the successor node of the operator has been scheduled before, the scheduling time of the successor node can be obtained. The minimum value of the scheduling time of all successor nodes and the ALAP scheduling time of the current node is taken as the latest feasible scheduling time of the current node, and the traversal is performed from the latest feasible scheduling time of the current node to the earliest ASAP scheduling time. If a time is obtained and the number of operators scheduled at this time is less than the average number of operators, then the operator is scheduled at the current time. If the node still cannot find a time for scheduling, then the node is scheduled at its earliest ASAP scheduling time.

7. According to the greedy scheduling loop strategy described in claim 1, Features When scheduling the software pipeline loop of DFG, the loop body will be scheduled as much as possible, and the emission cycle interval between loops will not be a fixed cycle, but a variable and unfixed cycle.

8. According to the feature of scheduling the loop body as much as possible as described in claim 7, specifically, for the DFG that needs to parallelize the software pipeline, the number of loops is traversed, first the minimum startup interval of the loop body Recurrence limit is calculated between the DFG loops and the DFG loops, and the hardware PE resources are expanded according to the scheduling time. For each loop, calculate whether there are enough hardware resources to provide operators for scheduling at the time that is the minimum startup interval away from the previous loop. If not, increase its scheduling time until there are enough resources for the loop to be scheduled. The subsequent loops still use this scheduling strategy to schedule each loop body of the loop in this greedy way.