Task management and scheduling method of reconfigurable processor
By obtaining the sub-task execution relationship and resource scheduling strategy in the reconfigurable processor, parallel execution within the loop structure and between multiple loop structures is achieved, and the problem of low execution efficiency of complex loop structure tasks in the existing technology is solved, and the problem of improving the implementation of the task of complex loop structures is improved. Resource utilization and processor performance.
Patent Information
- Application Number
- CN202411235938.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-01-10
AI Technical Summary
Existing reconfigurable processors are inefficient when performing complex loop structure tasks and are unable to effectively deal with the diversity of different types of tasks and application scenarios, resulting in poor resource utilization and performance.
By obtaining the execution relationship between sub-tasks in the task to be executed, combining task characteristics and resource scheduling strategies, determining the resource scheduling strategy and execution order of the sub-task, achieving parallel execution within the loop structure and between multiple loop structures, improving tasks Execution efficiency.
It significantly improves task execution efficiency, and optimizes resource utilization and processor performance by executing multiple subtasks in parallel to adapt to different application needs.
Smart Images

Figure CN119292741A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of high-performance computing technology, and in particular to a task management and scheduling method for a reconfigurable processor. Background Art
[0002] A reconfigurable processor is a flexible and programmable processor that can dynamically reconfigure its hardware structure according to application requirements. Task management and scheduling play a key role in reconfigurable processors, affecting the performance, energy efficiency and resource utilization of the processor.
[0003] Reconfigurable processors are usually faced with the changes of different types of tasks and the diversity of application scenarios. Task management and scheduling methods need to have a certain degree of adaptability and flexibility to effectively respond to different needs and situations. At present, the execution method of tasks with complex loop structures is generally to execute each subtask in the loop structure serially to complete the execution of the entire task.
[0004] However, the above task execution method has the problem of low efficiency. Summary of the invention
[0005] Based on this, it is necessary to provide a task management and scheduling method for a reconfigurable processor that can improve task execution efficiency in response to the above technical problems.
[0006] In a first aspect, the present application provides a task management and scheduling method for a reconfigurable processor, comprising:
[0007] Obtaining the tasks to be executed, and determining the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0008] Determine the resource scheduling strategy corresponding to each subtask in the task to be executed based on the relationship between task characteristics and resource scheduling strategy;
[0009] Execute the tasks to be executed according to the resource scheduling strategies corresponding to each subtask and the execution relationship between the subtasks.
[0010] In one embodiment, executing the to-be-executed task according to the resource scheduling strategy corresponding to each subtask and the execution relationship between the subtasks includes:
[0011] Determine the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask;
[0012] Execute the tasks to be executed according to the execution mode of each subtask and the execution relationship between the subtasks.
[0013] In one embodiment, the above-mentioned determining the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask includes:
[0014] Get information about available resources of the execution system;
[0015] The execution mode of each subtask is determined based on the available resource information and the resource scheduling strategy corresponding to each subtask.
[0016] In one embodiment, executing the to-be-executed task according to the execution mode of each subtask and the execution relationship between the subtasks includes:
[0017] Determine the execution order of each subtask according to the execution relationship between the subtasks;
[0018] Execute the tasks to be executed according to the execution order and execution method of each subtask.
[0019] In one embodiment, the above-mentioned determining the execution relationship between each subtask in the task to be executed includes:
[0020] Obtain the data dependency characteristics between each subtask in the task to be executed;
[0021] According to the data dependency characteristics between the subtasks, the execution relationship between the subtasks in the task to be executed is determined.
[0022] In one embodiment, the resource scheduling strategy corresponding to each subtask in the task to be executed is determined according to the relationship between the task characteristics and the resource scheduling strategy, including:
[0023] Perform real-time analysis on each subtask to determine the real-time characteristics of each subtask; the real-time characteristics include hard real-time characteristics and soft real-time characteristics;
[0024] According to the relationship between task characteristics and resource scheduling strategies, the resource scheduling strategies corresponding to each subtask are determined.
[0025] In a second aspect, the present application also provides a task management and scheduling device for a reconfigurable processor, comprising:
[0026] An acquisition module is used to acquire tasks to be executed and determine the execution relationship between subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0027] A determination module is used to determine the resource scheduling strategy corresponding to each subtask in the task to be executed according to the relationship between the task characteristics and the resource scheduling strategy;
[0028] The execution module is used to execute the tasks to be executed according to the resource scheduling strategies corresponding to the subtasks and the execution relationships between the subtasks.
[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0030] Obtaining the tasks to be executed, and determining the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0031] Determine the resource scheduling strategy corresponding to each subtask in the task to be executed based on the relationship between task characteristics and resource scheduling strategy;
[0032] Execute the tasks to be executed according to the resource scheduling strategies corresponding to each subtask and the execution relationship between the subtasks.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0034] Obtaining the tasks to be executed, and determining the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0035] Determine the resource scheduling strategy corresponding to each subtask in the task to be executed based on the relationship between task characteristics and resource scheduling strategy;
[0036] Execute the tasks to be executed according to the resource scheduling strategies corresponding to each subtask and the execution relationship between the subtasks.
[0037] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0038] Obtaining the tasks to be executed, and determining the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0039] Determine the resource scheduling strategy corresponding to each subtask in the task to be executed based on the relationship between task characteristics and resource scheduling strategy;
[0040] Execute the tasks to be executed according to the resource scheduling strategies corresponding to each subtask and the execution relationship between the subtasks.
[0041] The task management and scheduling method of the above-mentioned reconfigurable processor takes into account the relationship between each loop structure in the task to be executed with a complex loop structure, as well as the relationship between each subtask in the loop structure, and executes the task to be executed in combination with the resource scheduling strategy corresponding to the subtask. Compared with the existing method of executing each subtask in the task to be executed in sequence, the above-mentioned method not only considers the resource scheduling strategy corresponding to the subtask, but also considers the execution relationship between each subtask, thereby realizing the parallel execution of multiple subtasks, greatly improving the execution efficiency of the task. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0043] FIG1 is an application environment diagram of a task management and scheduling method for a reconfigurable processor in one embodiment;
[0044] Figure 2 A flowchart of a task management and scheduling method for a reconfigurable processor in one embodiment;
[0045] Figure 3 A flowchart of a task management and scheduling method for a reconfigurable processor in another embodiment;
[0046] Figure 4 A flowchart of a task management and scheduling method for a reconfigurable processor in another embodiment;
[0047] Figure 5 It is a schematic diagram of the overall framework of the system architecture in one embodiment;
[0048] Figure 6 A flowchart of a task management and scheduling method for a reconfigurable processor in another embodiment;
[0049] Figure 7 A flowchart of a task management and scheduling method for a reconfigurable processor in another embodiment;
[0050] Figure 8 A flowchart of a task management and scheduling method for a reconfigurable processor in another embodiment;
[0051] Fig. 9 A flowchart of a task management and scheduling method for a reconfigurable processor in another embodiment;
[0052] FIG10 is a structural block diagram of a task management and scheduling device for a reconfigurable processor in one embodiment;
[0053] FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] 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.
[0055] A reconfigurable processor is a flexible and programmable processor that can dynamically reconfigure its hardware structure according to application requirements. Task management and scheduling play a key role in reconfigurable processors, affecting the performance, energy efficiency and resource utilization of the processor.
[0056] Reconfigurable processors are usually faced with the changes of different types of tasks and the diversity of application scenarios. Task management and scheduling methods need to have certain adaptability and flexibility to effectively cope with different needs and situations. At present, the execution method of tasks with complex loop structures is generally to serially execute each subtask in the loop structure to complete the execution of the entire task. However, the above task execution method has the problem of low efficiency. This application aims to solve this problem.
[0057] The task management and scheduling method of the reconfigurable processor provided in the embodiment of the present application can be applied in the implementation environment as shown in FIG1 , which includes a server 104. The server 104 can be implemented by an independent server 104 or a server cluster composed of multiple servers 104. The data storage system 102 can store the data that the server 104 needs to process. The data storage system 102 can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the server 104 can obtain the task to be executed, and determine the execution relationship between each subtask in the task to be executed. Then, according to the relationship between the task characteristics and the resource scheduling strategy, the resource scheduling strategy corresponding to each subtask is determined, and then, according to the resource scheduling strategy corresponding to each subtask and the execution relationship between each subtask, the task to be executed is executed.
[0058] In other possible implementations, the task management and scheduling method of the reconfigurable processor provided in the embodiment of the present application can also be applied to terminals, which can be, but are not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. IoT 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.
[0059] Optionally, the task management and scheduling method of the reconfigurable processor provided in the embodiment of the present application is applied to the coarse-grained reconfigurable array (CGRA) hardware and software architecture installed in the server, and the CGRA hardware and software architecture includes an artificial intelligence (AI) compiler, a domain-specific language (DSL) compiler, a CGRA back-end compiler LLVM (Low Level Virtual Machine) and a driver, wherein the AI compiler is used for the AI model, the DSL compiler is used to convert the CGRA code into a low-level representation, and has the advantages of high efficiency and good scalability, LLVM provides efficient code generation and optimization functions, intercepts specific parts of the low-level representation, generates assembly code for the CGRA, and converts the remaining low-level representation into assembly code for the host system, and the driver is used to allow the operating system and the device to communicate.
[0060] In one embodiment, Figure 2 As shown, a task management and scheduling method for a reconfigurable processor is provided, and the method is applied to the server in FIG1 as an example for explanation, including:
[0061] S201: Obtain tasks to be executed, and determine the execution relationship between subtasks in the tasks to be executed.
[0062] The pending tasks refer to unexecuted tasks or tasks to be executed. The pending tasks may be tasks including at least one loop structure, and the loop structure includes at least one subtask.
[0063] The execution relationship includes parallel execution of subtasks within a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks within multiple loop structures.
[0064] In an embodiment of the present application, when the server needs to execute a task to be executed, it can first obtain the task to be executed from the above-mentioned AI compiler, and then determine at least one loop structure in the task to be executed, and determine whether there is data dependency between the loop structures. If there is no data dependency, it means that the loop structures can be executed in parallel. If there is data dependency, it means that the loop structures cannot be executed in parallel. Then, it is determined whether the subtasks in the loop structure can be executed in parallel, and the determination result is determined as the execution relationship between the subtasks in the task to be executed.
[0065] Optionally, multiple subtasks within a larger loop structure may be designed to be executed in parallel, that is, each subtask in the loop structure may be executed in parallel on different computing units.
[0066] Optionally, when the task to be executed includes multiple loop structures, it is possible to first determine whether there is a data dependency between the loop structures. If there is no data dependency between the loop structures, these loop structures can be parallelized, that is, these loop structures can be executed in parallel.
[0067] Optionally, for the case where the task to be executed includes multiple loop structures, if there is a data dependency between the loop structures, but the subtasks within each loop structure are independent, you can consider parallelization at the subtask level, that is, the subtasks within each loop structure can be executed in parallel on different processors, but the data dependency needs to be satisfied when executing the tasks between each loop.
[0068] S202: Determine the resource scheduling strategy corresponding to each subtask according to the relationship between the task characteristics and the resource scheduling strategy.
[0069] Among them, the relationship between task characteristics and resource scheduling strategies refers to determining corresponding resource adjustment strategies for subtasks with different real-time characteristics. The corresponding resource adjustment strategies can be determined in advance according to the real-time characteristics of the subtasks, and after generating the relationship between task characteristics and resource scheduling strategies, the relationship between task characteristics and resource scheduling strategies is stored in the server so that the resource scheduling strategies of each subtask can be directly obtained from the server when determining them.
[0070] For example, if the subtask is determined to be a hard real-time task, the resource adjustment strategy corresponding to the subtask is determined to be a static allocation strategy, that is, when the CGRA system is started, the priority of each subtask is first determined, and the corresponding resources are allocated to each subtask in combination with the priority of each subtask and the available resources of the system to ensure that the execution of the real-time task is not affected by other tasks.
[0071] For example, if a subtask is determined to be a hard real-time task or a soft real-time task, a priority scheduling strategy can be adopted. The CGRA system dynamically schedules the execution order of subtasks according to the priority and deadline of each subtask to ensure that high-priority subtasks can be executed in time.
[0072] For example, for the resource reservation requirements of real-time tasks, a resource reservation strategy can be adopted, that is, a certain amount of hardware resources are reserved for real-time tasks to ensure that the real-time tasks can obtain sufficient resources when needed.
[0073] In an embodiment of the present application, after the task to be executed is obtained as mentioned above, the task to be executed can be divided into multiple sub-tasks, and the relationship between the task characteristics and the resource scheduling strategy can be obtained from the server. Then, based on the relationship between the task characteristics and the resource scheduling strategy, the resource scheduling strategy corresponding to each sub-task can be determined.
[0074] S203: Execute the task to be executed according to the resource scheduling strategy corresponding to each subtask and the execution relationship between the subtasks.
[0075] In an embodiment of the present application, after obtaining the resource scheduling strategy corresponding to each subtask and the execution relationship between the subtasks, the execution order of each subtask can be determined based on the execution relationship between the subtasks, and then the tasks to be executed can be executed based on the execution order of each subtask and the resource scheduling strategy corresponding to each subtask.
[0076] The task management and scheduling method of the reconfigurable processor provided in the embodiment of the present application obtains the task to be executed, determines the execution relationship between each subtask in the task to be executed, determines the resource scheduling strategy corresponding to each subtask in the task to be executed according to the relationship between the task characteristics and the resource scheduling strategy, and executes the task to be executed according to the resource scheduling strategy corresponding to each subtask and the execution relationship between each subtask; the execution relationship includes the parallel execution of each subtask in the loop structure, the parallel execution of multiple loop structures, and the parallel execution of subtasks in multiple loop structures. The above method takes into account the relationship between each loop structure in the task to be executed with a complex loop structure, as well as the relationship between each subtask in the loop structure, and executes the task to be executed in combination with the resource scheduling strategy corresponding to the subtask. Compared with the existing method of executing each subtask in the task to be executed in sequence, the above method not only takes into account the resource scheduling strategy corresponding to the subtask, but also takes into account the execution relationship between each subtask, thereby realizing the parallel execution of multiple subtasks, greatly improving the execution efficiency of the task.
[0077] In one embodiment, based on Figure 2 The embodiment shown, see Figure 3 This embodiment involves how the server executes the task to be executed according to the resource scheduling strategy corresponding to each subtask and the execution relationship between each subtask. Figure 3 As shown, in this embodiment, S203 includes:
[0078] S301 . Determine the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask.
[0079] Among them, resource scheduling strategies include static allocation strategies, priority scheduling strategies and resource reservation strategies.
[0080] The static allocation strategy is executed in such a way that the priority of each subtask is first determined, and then the corresponding resources are allocated to each subtask in combination with the priority of each subtask and the available resources of the system.
[0081] Among them, the execution method corresponding to the priority scheduling strategy is to dynamically schedule the execution order of subtasks according to the priority and deadline of each subtask to ensure that high-priority subtasks can be executed in time.
[0082] Among them, the execution method corresponding to the resource reservation strategy is to estimate the resource usage of the subtasks and reserve a certain amount of hardware resources for the real-time tasks based on the resource usage of the subtasks to ensure that the real-time tasks can obtain sufficient resources when needed.
[0083] In the embodiment of the present application, after the resource scheduling strategies corresponding to the subtasks are determined, the execution mode of each subtask can be determined according to the execution mode of the subtask indicated by the resource scheduling strategies corresponding to the subtasks.
[0084] Optionally, a method for determining the execution mode of a subtask is provided below, such as Figure 4 As shown, the above S301 "determine the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask" includes:
[0085] S3011. Obtain available resource information of the execution system.
[0086] In an embodiment of the present application, before executing a task, the CGRA system may first analyze its own hardware resources (including the number of core processors, the amount of memory, the amount of bandwidth, and real-time performance characteristics, etc.), determine the occupied resource information and available resource information, and obtain the available resource information of the execution system.
[0087] S3012: Determine the execution mode of each subtask according to the available resource information and the resource scheduling strategy corresponding to each subtask.
[0088] The execution mode of the subtask refers to the resource information occupied when the subtask is executed and the execution order of each subtask in the loop structure.
[0089] In the embodiment of the present application, after the available resource information of the execution system is obtained as described above, the execution mode of each subtask can be determined according to the available resource information of the system and the resource scheduling strategy corresponding to each subtask.
[0090] Optionally, if the task to be executed includes a loop structure, which includes 5 subtasks, each subtask is a hard real-time task, complies with the static allocation strategy, and the priority of the 5 subtasks is determined as subtask 1, subtask 3 and subtask 5 corresponding to the highest priority, and subtask 2 and subtask 4 corresponding to the lowest priority, then, according to the resource requirements of subtask 1, subtask 3 and subtask 5, the available resources of the execution system can be allocated to task 1, task 3 and task 5 first, and then the remaining available resources after allocating resources to task 1, task 3 and task 5 can be allocated to task 2 and task 4, thereby obtaining the resource information required for each task during the execution process and the execution order of each subtask in the loop structure.
[0091] It should be noted that the system will dynamically adjust the resource allocation of each subtask based on the resource requirements of each subtask and the current system resource status. First, the system needs to make a simple resource demand forecast for the subtask to be executed, and monitor the usage of various hardware resources in real time. The monitoring results will serve as the basis for resource allocation optimization. On this basis, the resource allocation of each subtask is dynamically adjusted according to the characteristics of each subtask and the status of system resources.
[0092] The overall framework of the system architecture is provided below, including:
[0093] (1) A large-core CPU subsystem, which is mainly responsible for the software operating system (Linux), peripheral management, task scheduling, etc. of the entire chiplet, and realizes efficient interaction between different chiplets;
[0094] (2) Two 256-bit data networks (Master / Slave) and two 32-bit control networks (Master / Slave), supporting decentralized distributed computing between tiles;
[0095] (3) For each data network, there is 1 on-chip integrated DDR + 1 off-chip DDR interface + 1 PCIe interface (1 communicates with the CPU chip and 1 communicates with another CGRA chip).
[0096] Through the overall framework design of the above system architecture, it is ensured that the system architecture can dynamically adjust the allocation of resources according to the characteristics of the task and the resource status of the system. The framework design of the system architecture is as follows Figure 5As shown in the figure, the system architecture consists of a large-core central processing unit (CPU) subsystem, Nor-Flash memory, Joint Test Action Group (JTAG) interface, Time, general-purpose input / output (GPIO), serial data bus (Uart), NOC (a SoC architecture) system, RNPU Cluster group, high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCI-Express) and external double data rate (Double Data Rate, DDR).
[0097] S302: Execute the task to be executed according to the execution mode of each subtask and the execution relationship between the subtasks.
[0098] In an embodiment of the present application, after the execution method of each subtask is obtained as described above, the task to be executed can be executed according to the execution method of each subtask and the execution relationship between the subtasks, according to the resource information required for each subtask during the execution process, the execution order of each subtask in the loop structure, and the execution relationship between the subtasks.
[0099] Optionally, if each subtask in the task to be executed is a parallel execution task, and the first subtask and the second subtask have the highest execution priority, the third subtask has an average priority, and the fourth subtask and the fifth subtask have a lower priority, then when executing the task to be executed, the first subtask and the second subtask can be executed in parallel according to the requirement information of the first subtask and the requirement information of the second subtask, respectively, and then the third subtask can be executed according to the requirement information of the third subtask, and finally the fourth subtask and the fifth subtask can be executed in parallel according to the requirement information of the fourth subtask and the requirement information of the fifth subtask, respectively.
[0100] Optionally, a method for executing a task to be executed is provided below, such as Figure 6 As shown, the above S302 "execute the to-be-executed task according to the execution mode of each subtask and the execution relationship between each subtask" includes:
[0101] S3021. Determine the execution order of each subtask according to the execution relationship between the subtasks.
[0102] In the embodiment of the present application, after the execution relationship between the subtasks is determined as described above, the execution order of the subtasks may be determined according to the execution relationship between the subtasks.
[0103] S3022: Execute the tasks to be executed according to the execution order and execution method of each subtask.
[0104] In the embodiment of the present application, after the execution order of each subtask is determined as above, each subtask can be executed according to the execution order and execution method of each subtask until all subtasks are completed, so as to achieve the completion of the execution of the task to be executed.
[0105] It should be noted that task execution is the core part of the task management and scheduling system. It is responsible for reasonably allocating tasks to available processing units for execution according to the characteristics of the tasks and the system status. First, a task queue needs to be maintained to store the tasks to be executed. Secondly, the task queue should support dynamic addition and deletion of tasks and be able to sort them according to their priorities. Thirdly, the task queue also needs to take into account the special needs of real-time tasks, such as real-time tasks may have higher priorities.
[0106] Then, the system will implement a task scheduler module, which is responsible for allocating tasks to appropriate processing units for execution according to the selected scheduling strategy and resource allocation method. The scheduler will monitor changes in system status and adjust the execution order and resource allocation of tasks as needed.
[0107] The task execution method provided in the embodiment of the present application takes into account the available resources of the system, the resource scheduling strategy corresponding to each subtask and the execution order between each subtask, so that the server can achieve parallel execution according to the execution order between each subtask when each subtask meets the resource requirements, which greatly improves the execution efficiency of the task to a certain extent.
[0108] In one embodiment, based on Figure 2 The embodiment shown, see Figure 7 This embodiment involves the process of how the server determines the execution relationship between each subtask in the task to be executed. Figure 7 As shown, in this embodiment, S201 includes:
[0109] S401: Obtain data dependency characteristics between subtasks in the task to be executed.
[0110] In an embodiment of the present application, when a task to be executed is obtained, the task to be executed can be first split to obtain multiple subtasks in the task to be executed, and the data resources that may be used to complete each subtask are analyzed to obtain the data resources to be used corresponding to each subtask. Then, it is determined whether there is data intersection in the data resources to be used corresponding to each subtask. If there is data intersection, it means that there is a data dependency feature between the subtasks in the task to be executed. If there is no data intersection, it means that there is no data dependency feature between the subtasks in the task to be executed.
[0111] S402: Determine the execution relationship between the subtasks in the task to be executed according to the data dependency characteristics between the subtasks.
[0112] In the embodiment of the present application, after the data dependency characteristics between the subtasks are determined as described above, the execution relationship between the subtasks in the task to be executed can be determined based on the data dependency characteristics between the subtasks.
[0113] Optionally, if there is a data dependency feature between the subtasks, but the subtasks in each loop structure of the task to be executed are independent, then the execution relationship between the subtasks can be determined as parallel execution of the subtasks in multiple loop structures.
[0114] Optionally, if there is no data dependency feature between the subtasks, these loop structures can be parallelized, that is, these loop structures can be executed in parallel, that is, the execution relationship between the subtasks can be determined as multiple loop structures that are executed in parallel.
[0115] It should be noted that in order to determine the data dependency characteristics between each subtask in the task to be executed, the mapper segment division and synchronization mechanism can be introduced at the DSL compiler level to solve the problem that the CGRA mapper cannot be effectively mapped due to the large amount of code inside the loop. The division format is as follows:
[0116] _mapper_ mapper segment name <[other mapper segment names (variables within the segment +)]+>
[0117] {
[0118] / / The statements inside the for loop structure are basic statements;
[0119] (statement)+
[0120] };
[0121] The synchronization format is as follows:
[0122] _task_ return value task name (parameter list)
[0123] {
[0124] (mapperBlock | statement) +;
[0125] Inner_sync (at least two mapper segment names) / / Provides parallelism of multiple mapper segments within a task
[0126] }.
[0127] In addition, there are two main methods for describing the data flow graph corresponding to the execution relationship between each subtask. The first is manual annotation, and the other is automatic generation of DFG by code analysis. In the DSL compiler, data flow variables, computing units, and connection operations are used to describe the flow of data and the calculation process, and specific syntax or operators are used to represent data flow connections. For example, the arrow symbol `->` can be used to indicate the direction of the data flow, or the connection operator can be used to connect the output of one computing unit to the input of another computing unit.
[0128] The method for obtaining the execution relationship between each subtask provided in the embodiment of the present application takes into account the data dependency between each subtask, and determines the execution relationship between each subtask based on the data dependency between each subtask, thereby minimizing idle resources, realizing parallel execution of tasks, and thus accelerating the completion speed of tasks.
[0129] In one embodiment, based on Figure 2-Figure 7 The embodiment shown, see Figure 8 This embodiment involves the process of how the server determines the resource scheduling strategy corresponding to each subtask in the task to be executed according to the relationship between the task characteristics and the resource scheduling strategy. Figure 8 As shown, in this embodiment, S202 includes:
[0130] S501: Perform real-time analysis on each subtask to determine the real-time characteristics of each subtask.
[0131] Among them, real-time characteristics include hard real-time characteristics and soft real-time characteristics.
[0132] In the embodiment of the present application, after the tasks to be executed are determined as described above, the tasks to be executed may be divided into a plurality of subtasks, and then a real-time analysis may be performed on each subtask to determine the real-time characteristics of each subtask.
[0133] Optionally, a real-time analysis may be performed on the execution time requirements, response time requirements, deadline, etc. of each subtask in the task to be executed to obtain the execution time characteristics, response time characteristics and deadline characteristics of each subtask, and the subtask whose execution time characteristics, response time characteristics and deadline characteristics meet the first preset requirements may be determined as a soft real-time task, and the subtask whose execution time characteristics, response time characteristics and deadline characteristics meet the second preset requirements may be determined as a hard real-time task; it should be noted that hard real-time tasks have stricter time constraints.
[0134] S502: Determine the resource scheduling strategy corresponding to each subtask according to the relationship between the task characteristics and the resource scheduling strategy.
[0135] The relationship between the task characteristics and the resource scheduling strategy includes: the hard real-time task corresponds to the static allocation strategy, and the hard real-time task and / or the soft real-time task corresponds to the priority scheduling strategy.
[0136] The static allocation strategy refers to the strategy of first determining the priority of each subtask when the CGRA system is started, and then allocating corresponding resources to each subtask based on the priority of each subtask and the available resources of the system.
[0137] The priority scheduling strategy refers to dynamically scheduling the execution order of subtasks according to the priority and deadline of each subtask to ensure that high-priority subtasks can be executed in time.
[0138] In the embodiment of the present application, after the real-time characteristics of each subtask are obtained as described above, the resource scheduling strategy corresponding to each subtask can be determined according to the relationship between the task characteristics and the resource scheduling strategy.
[0139] The method for determining the resource scheduling strategy corresponding to each subtask provided in the embodiment of the present application is based on the real-time characteristics of each subtask and the relationship between the task characteristics and the resource scheduling strategy. It can perform real-time analysis on the subtasks, thereby dynamically allocating system resources and achieving efficient use of system resources.
[0140] In one embodiment, Fig. 9 As shown, a task management and scheduling method for a reconfigurable processor is also provided, including:
[0141] S10, obtaining data dependency features between subtasks in the task to be executed;
[0142] S11, determining the execution relationship between the subtasks in the task to be executed according to the data dependency characteristics between the subtasks;
[0143] S12, performing real-time analysis on each subtask to determine the real-time characteristics of each subtask;
[0144] S13, determining the resource scheduling strategy corresponding to each subtask according to the relationship between the task characteristics and the resource scheduling strategy;
[0145] S14, obtaining available resource information of the execution system;
[0146] S15, determining the execution mode of each subtask according to the available resource information and the resource scheduling strategy corresponding to each subtask;
[0147] S16, determining the execution order of each subtask according to the execution relationship between the subtasks;
[0148] S17: Execute the tasks to be executed according to the execution order and execution method of each subtask.
[0149] The above method takes into account the relationship between each loop structure in the task to be executed with a complex loop structure, as well as the relationship between each subtask in the loop structure, and executes the task to be executed in combination with the resource scheduling strategy corresponding to the subtask. Compared with the existing method of executing each subtask in the task to be executed in sequence, the above method not only considers the resource scheduling strategy corresponding to the subtask, but also considers the execution relationship between each subtask, thereby realizing the parallel execution of multiple subtasks, greatly improving the execution efficiency of the task.
[0150] 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.
[0151] Based on the same inventive concept, the embodiment of the present application also provides a task management and scheduling device for a reconfigurable processor for implementing the task management and scheduling method for the 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 embodiment of the task management and scheduling device for one or more reconfigurable processors provided below can refer to the limitations of the task management and scheduling method for the reconfigurable processor above, and will not be repeated here.
[0152] In an exemplary embodiment, as shown in FIG10 , a task management and scheduling device for a reconfigurable processor is provided, comprising: an acquisition module 10, a determination module 11 and an execution module 12, wherein:
[0153] The acquisition module 10 is used to acquire the tasks to be executed and determine the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures.
[0154] The determination module 11 is used to determine the resource scheduling strategy corresponding to each subtask in the task to be executed according to the relationship between the task characteristics and the resource scheduling strategy.
[0155] The execution module 12 is used to execute the task to be executed according to the resource scheduling strategy corresponding to each subtask and the execution relationship between the subtasks.
[0156] In an exemplary embodiment, the execution module 12 includes: a determination unit and an execution unit, wherein:
[0157] A determination unit, specifically used to determine the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask;
[0158] The execution unit is specifically used to execute the task to be executed according to the execution mode of each subtask and the execution relationship between each subtask.
[0159] In an exemplary embodiment, the above-mentioned determination unit is further configured to obtain available resource information of the execution system; and determine the execution mode of each subtask according to the available resource information and the resource scheduling strategy corresponding to each subtask.
[0160] In an exemplary embodiment, the execution unit is further configured to determine the execution order of each subtask according to the execution relationship between the subtasks; and execute the task to be executed according to the execution order of each subtask and the execution method of each subtask.
[0161] In an exemplary embodiment, the acquisition module 10 includes: an acquisition unit and a determination unit, wherein:
[0162] An acquisition unit, specifically used to acquire data dependency characteristics between subtasks in the task to be executed;
[0163] The determination unit is specifically used to determine the execution relationship between each subtask in the task to be executed according to the data dependency characteristics between each subtask.
[0164] In an exemplary embodiment, the above-mentioned determination module 11 includes: a first determination unit and a second determination unit, wherein:
[0165] The first determination unit is specifically used to perform real-time analysis on each subtask to determine the real-time characteristics of each subtask; the real-time characteristics include hard real-time characteristics and soft real-time characteristics;
[0166] The second determining unit is specifically used to determine the resource scheduling strategy corresponding to each subtask according to the relationship between the task characteristics and the resource scheduling strategy.
[0167] Each module in the task management and scheduling device of the reconfigurable processor can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0168] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data corresponding to the tasks to be executed. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a task management and scheduling method for a reconfigurable processor is implemented.
[0169] Those skilled in the art will understand that the structure shown in FIG. 11 is merely a block diagram of a partial 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 shown in the figure, or combine certain components, or have a different arrangement of components.
[0170] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0171] Obtaining the tasks to be executed, and determining the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0172] Determine the resource scheduling strategy corresponding to each subtask in the task to be executed based on the relationship between task characteristics and resource scheduling strategy;
[0173] Execute the tasks to be executed according to the resource scheduling strategies corresponding to each subtask and the execution relationship between the subtasks.
[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0175] Determine the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask;
[0176] Execute the tasks to be executed according to the execution mode of each subtask and the execution relationship between the subtasks.
[0177] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0178] Get information about available resources of the execution system;
[0179] The execution mode of each subtask is determined based on the available resource information and the resource scheduling strategy corresponding to each subtask.
[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0181] Determine the execution order of each subtask according to the execution relationship between the subtasks;
[0182] Execute the tasks to be executed according to the execution order and execution method of each subtask.
[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0184] Obtain the data dependency characteristics between each subtask in the task to be executed;
[0185] According to the data dependency characteristics between the subtasks, the execution relationship between the subtasks in the task to be executed is determined.
[0186] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0187] Perform real-time analysis on each subtask to determine the real-time characteristics of each subtask; the real-time characteristics include hard real-time characteristics and soft real-time characteristics;
[0188] According to the relationship between task characteristics and resource scheduling strategies, the resource scheduling strategies corresponding to each subtask are determined.
[0189] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0190] Obtaining the tasks to be executed, and determining the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0191] Determine the resource scheduling strategy corresponding to each subtask in the task to be executed based on the relationship between task characteristics and resource scheduling strategy;
[0192] Execute the tasks to be executed according to the resource scheduling strategies corresponding to each subtask and the execution relationship between the subtasks.
[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0194] Determine the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask;
[0195] Execute the tasks to be executed according to the execution mode of each subtask and the execution relationship between the subtasks.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] Get information about available resources of the execution system;
[0198] The execution mode of each subtask is determined based on the available resource information and the resource scheduling strategy corresponding to each subtask.
[0199] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0200] Determine the execution order of each subtask according to the execution relationship between the subtasks;
[0201] Execute the tasks to be executed according to the execution order and execution method of each subtask.
[0202] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0203] Obtain the data dependency characteristics between each subtask in the task to be executed;
[0204] According to the data dependency characteristics between the subtasks, the execution relationship between the subtasks in the task to be executed is determined.
[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0206] Perform real-time analysis on each subtask to determine the real-time characteristics of each subtask; the real-time characteristics include hard real-time characteristics and soft real-time characteristics;
[0207] According to the relationship between task characteristics and resource scheduling strategies, the resource scheduling strategies corresponding to each subtask are determined.
[0208] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0209] Obtaining the tasks to be executed, and determining the execution relationship between the subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures;
[0210] Determine the resource scheduling strategy corresponding to each subtask in the task to be executed based on the relationship between task characteristics and resource scheduling strategy;
[0211] Execute the tasks to be executed according to the resource scheduling strategies corresponding to each subtask and the execution relationship between the subtasks.
[0212] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0213] Determine the execution mode of each subtask according to the resource scheduling strategy corresponding to each subtask;
[0214] Execute the tasks to be executed according to the execution mode of each subtask and the execution relationship between the subtasks.
[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0216] Get information about available resources of the execution system;
[0217] The execution mode of each subtask is determined based on the available resource information and the resource scheduling strategy corresponding to each subtask.
[0218] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0219] Determine the execution order of each subtask according to the execution relationship between the subtasks;
[0220] Execute the tasks to be executed according to the execution order and execution method of each subtask.
[0221] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0222] Obtain the data dependency characteristics between each subtask in the task to be executed;
[0223] According to the data dependency characteristics between the subtasks, the execution relationship between the subtasks in the task to be executed is determined.
[0224] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0225] Perform real-time analysis on each subtask to determine the real-time characteristics of each subtask; the real-time characteristics include hard real-time characteristics and soft real-time characteristics;
[0226] According to the relationship between task characteristics and resource scheduling strategies, the resource scheduling strategies corresponding to each subtask are determined.
[0227] 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, and the collection, use and processing of relevant data must comply with relevant regulations.
[0228] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. 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, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0229] 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 application.
[0230] 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 management and scheduling method for a reconfigurable processor, characterized in that: The method comprises: Acquire the task to be executed, and determine the execution relationship between each subtask in the task to be executed; the execution relationship includes parallel execution of each subtask in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures; Determine the resource scheduling strategy corresponding to each subtask in the task to be executed according to the relationship between the task characteristics and the resource scheduling strategy; The tasks to be executed are executed according to the resource scheduling strategies corresponding to the subtasks and the execution relationships between the subtasks.
2. The method according to claim 1, characterized in that The executing the to-be-executed task according to the resource scheduling strategy corresponding to each of the subtasks and the execution relationship between the subtasks includes: Determining the execution mode of each of the subtasks according to the resource scheduling strategy corresponding to each of the subtasks; The to-be-executed task is executed according to the execution mode of each of the subtasks and the execution relationship between the subtasks.
3. The method according to claim 2, characterized in that Determining the execution mode of each of the subtasks according to the resource scheduling strategy corresponding to each of the subtasks includes: Get information about available resources of the execution system; The execution mode of each of the subtasks is determined according to the available resource information and the resource scheduling strategy corresponding to each of the subtasks.
4. The method according to claim 2, characterized in that: The executing the to-be-executed task according to the execution mode of each of the subtasks and the execution relationship between the subtasks includes: Determining the execution order of each of the subtasks according to the execution relationship between the subtasks; The tasks to be executed are executed according to the execution order of each of the subtasks and the execution method of each of the subtasks.
5. The method according to claim 1, characterized in that The determining the execution relationship between the subtasks in the task to be executed includes: Obtaining data dependency characteristics between subtasks in the task to be executed; The execution relationship between the subtasks in the task to be executed is determined according to the data dependency characteristics between the subtasks.
6. The method according to claim 1, characterized in that Determining the resource scheduling strategy corresponding to each subtask in the task to be executed according to the relationship between the task characteristics and the resource scheduling strategy includes: Performing real-time analysis on each of the subtasks to determine the real-time characteristics of each of the subtasks; the real-time characteristics include hard real-time characteristics and soft real-time characteristics; The resource scheduling strategy corresponding to each of the subtasks is determined according to the relationship between the task characteristics and the resource scheduling strategy.
7. A task management and scheduling device for a reconfigurable processor, characterized in that: The device comprises: An acquisition module, used to acquire tasks to be executed, and determine the execution relationship between subtasks in the tasks to be executed; the execution relationship includes parallel execution of subtasks in a loop structure, parallel execution of multiple loop structures, and parallel execution of subtasks in multiple loop structures; A determination module, used to determine the resource scheduling strategy corresponding to each subtask in the task to be executed according to the relationship between the task characteristics and the resource scheduling strategy; The execution module is used to execute the tasks to be executed according to the resource scheduling strategies corresponding to the subtasks and the execution relationships between the subtasks.
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 6 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 6 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 6 are implemented.
Citation Information
Cited By
Task processing device, task processing method, electronic equipment and storage medium
CN121579417A