Search

CN-122019159-A - Dynamic task scheduling method and system for hybrid neural network

CN122019159ACN 122019159 ACN122019159 ACN 122019159ACN-122019159-A

Abstract

The invention discloses a dynamic task scheduling method and a system for a hybrid neural network, which are applied to the field of task scheduling of a neural network accelerator and comprise the steps of carrying out subtask decomposition on a calculation task of a current neural network layer, constructing a task scheduling table containing state information of a front task based on task dependency information, dynamically updating the state by monitoring a completion event notification in the execution process so as to realize on-demand triggering and iterative scheduling of the subtasks, and immediately generating a data preloading instruction if the data loading instruction of a next neural network layer is detected to be stored in a corresponding instruction queue during the execution of any subtask of the current layer, so that the data loading operation of the next layer is executed in parallel with the calculation of the current layer. The dynamic task scheduling method for the hybrid neural network provided by the invention realizes the dynamic scheduling and cross-layer water overlapping in real operation, and remarkably improves the utilization rate of hardware resources and the throughput efficiency of the system.

Inventors

  • REN AO
  • Yao Tengqi
  • SONG YANG

Assignees

  • 重庆大学

Dates

Publication Date
20260512
Application Date
20260127

Claims (10)

  1. 1. The dynamic task scheduling method for the hybrid neural network is characterized by comprising the following steps of: Decomposing the calculation task of the current neural network layer to obtain each subtask; Constructing a task schedule according to task dependency information corresponding to the computing task, wherein the task dependency information defines a data dependency relationship between the subtasks, and the task schedule records front task state information of the subtasks; the task scheduling process is executed based on the task scheduling table, and the task scheduling process comprises the steps of determining the state information of the front-end task as a target subtask in a completion state, and generating an execution instruction for the target subtask to trigger the execution of the target subtask; monitoring and receiving a completion event notification corresponding to the target subtask, and updating the target subtask in the task schedule to be in a completion state according to the completion event notification; iteratively executing the scheduling flow based on the updated task scheduling table until each subtask in the current neural network layer is completed according to the data dependency relationship; when any subtask of the current neural network layer is executed, judging whether a data loading subtask of the next neural network layer meets a pre-trigger condition or not based on the task dependency information; And when the data loading subtask meets the triggering condition, generating a data preloading instruction before the subtask of the current neural network layer is completed so as to trigger the data loading subtask to be executed in parallel with the subtask of the current neural network layer.
  2. 2. The method for dynamic task scheduling for hybrid neural network according to claim 1, wherein the decomposing the computing task of the current neural network layer to obtain each subtask comprises: acquiring a task scheduling instruction corresponding to the calculation task of the current neural network layer; Determining the subtask type of the task scheduling instruction according to the operation code of each task scheduling instruction; And distributing the task scheduling instruction to a corresponding instruction queue according to the corresponding subtask type to obtain each subtask.
  3. 3. The method for dynamic task scheduling for hybrid neural network according to claim 1, wherein the constructing a task schedule according to task dependency information corresponding to the computing task comprises: according to the task dependency information, respectively setting corresponding preset target values for the subtasks, wherein the preset target values represent the times of receiving the completion event notification before executing the subtasks; Respectively initializing a current count value for each subtask, wherein the current count value is used for accumulating the times of receiving the completion event notification; and taking the current count value and the corresponding preset target value as the pre-task state information to construct the task scheduling table.
  4. 4. The hybrid neural network oriented dynamic task scheduling method of claim 3, wherein the monitoring and receiving a completion event notification corresponding to the target subtask, and updating the target subtask in the task schedule to a completion state according to the completion event notification, comprises: Executing an adding operation on the current count value corresponding to the target subtask in the task schedule according to the completion event notification; and when the current count value is equal to the preset target value corresponding to the target subtask, updating the target subtask into a completion state in the task scheduling table.
  5. 5. The method for dynamic task scheduling for hybrid neural network according to claim 1, wherein the determining whether the data loading subtask of the next neural network layer satisfies the pre-trigger condition based on the task dependency information comprises: In the execution process of any subtask of the current neural network layer, detecting whether a data loading instruction of the next neural network layer is stored in the corresponding instruction queue; And if the data loading instruction is stored in the corresponding instruction queue, judging that the data loading subtask meets the pre-trigger condition.
  6. 6. A hybrid neural network oriented dynamic task scheduling system, comprising: The task decomposition module is used for decomposing the calculation task of the current neural network layer to obtain each subtask; The task scheduling table construction module is used for constructing a task scheduling table according to task dependency information corresponding to the computing task, wherein the task dependency information defines the data dependency relationship among the subtasks, and the task scheduling table records the front task state information of the subtasks; The scheduling execution module is used for executing a scheduling flow based on the task scheduling table and comprises the steps of determining the state information of the front-end task as a target subtask in a completion state, and generating an execution instruction for the target subtask to trigger the execution of the target subtask; The state updating module is used for monitoring and receiving a completion event notification corresponding to the target subtask, and updating the target subtask in the task scheduling table into a completion state according to the completion event notification; The iteration control module is used for iteratively executing the scheduling flow based on the updated task scheduling table until each subtask in the current neural network layer is completed according to the data dependency relationship; the pre-trigger judging module is used for judging whether a data loading subtask of the next neural network layer meets a pre-trigger condition or not based on the task dependency information when any one of the subtasks of the current neural network layer is executed; and the pre-loading instruction generation module is used for generating a data pre-loading instruction before the subtask of the current neural network layer is completed when the data loading subtask meets the triggering condition so as to trigger the data loading subtask to be executed in parallel with the subtask of the current neural network layer.
  7. 7. The hybrid neural network oriented dynamic task scheduling system of claim 6, wherein the task decomposition module comprises: the instruction acquisition unit is used for acquiring a task scheduling instruction corresponding to the calculation task of the current neural network layer; the type determining unit is used for determining the subtask type of the task scheduling instruction according to the operation code of each task scheduling instruction; And the classification unit is used for distributing the task scheduling instruction to the corresponding instruction queue according to the corresponding subtask type to obtain each subtask.
  8. 8. The hybrid neural network oriented dynamic task scheduling system of claim 6, wherein the schedule construction module comprises: the target value presetting unit is used for respectively setting corresponding preset target values for the subtasks according to the task dependency information, wherein the preset target values represent the times of receiving the completion event notification before executing the subtasks; the initialization unit is used for initializing a current count value for each subtask respectively, and the current count value is used for accumulating the times of receiving the completion event notification; and the construction unit is used for constructing the task schedule by taking the current count value and the corresponding preset target value as the pre-task state information.
  9. 9. The hybrid neural network oriented dynamic task scheduling system of claim 8, wherein the status updating module comprises: An operation unit, configured to perform an add operation on a current count value corresponding to the target subtask in the task schedule according to the completion event notification; And the data updating unit is used for updating the target subtask into a completion state in the task scheduling table when the current count value is equal to the preset target value corresponding to the target subtask.
  10. 10. The hybrid neural network oriented dynamic task scheduling system of claim 6, wherein the pre-trigger determination module comprises: The detection unit is used for detecting whether a data loading instruction of the next neural network layer is stored in the corresponding instruction queue or not in the execution process of any subtask of the current neural network layer; and the judging unit is used for judging that the data loading subtask meets the pre-trigger condition if the data loading instruction is stored in the corresponding instruction queue.

Description

Dynamic task scheduling method and system for hybrid neural network Technical Field The invention relates to the technical field of task scheduling of neural network accelerators, in particular to a dynamic task scheduling method and system for a hybrid neural network. Background With the rapid development of artificial intelligence technology, convolutional Neural Network (CNN) and Transformer (transducer) hybrid architecture neural network models are widely used in the fields of computer vision, natural language processing and the like. Such hybrid models typically have complex computational structures and diverse data accuracy requirements that place high throughput, low latency, and energy efficient complex demands on the hardware accelerator. The existing neural network accelerator adopts a static task scheduling strategy, and the task execution sequence and the dependency relationship of the existing neural network accelerator are determined before operation. Under the strategy, the data loading operation of each neural network layer can be started after the complete completion of the calculation tasks of the layer, so that each subsequent functional unit is difficult to run continuously in the pipeline, periodic idle of hardware resources is caused, and the further improvement of the throughput capacity of the system is limited. Disclosure of Invention The invention provides a dynamic task scheduling method and a system for a hybrid neural network, which aim to solve the technical problems that data loading and computing operations cannot be overlapped and the utilization rate of hardware resources is limited due to lack of flexibility in running of task scheduling in the interlayer execution process of the neural network, so as to achieve the effects of improving the parallelism of task levels, reducing the idle period of a pipeline and improving the overall throughput efficiency of the system. In order to solve the above technical problems, an embodiment of the present invention provides a dynamic task scheduling method for a hybrid neural network, including: Decomposing the calculation task of the current neural network layer to obtain each subtask; Constructing a task schedule according to task dependency information corresponding to the computing task, wherein the task dependency information defines a data dependency relationship between the subtasks, and the task schedule records front task state information of the subtasks; the task scheduling process is executed based on the task scheduling table, and the task scheduling process comprises the steps of determining the state information of the front-end task as a target subtask in a completion state, and generating an execution instruction for the target subtask to trigger the execution of the target subtask; monitoring and receiving a completion event notification corresponding to the target subtask, and updating the target subtask in the task schedule to be in a completion state according to the completion event notification; iteratively executing the scheduling flow based on the updated task scheduling table until each subtask in the current neural network layer is completed according to the data dependency relationship; when any subtask of the current neural network layer is executed, judging whether a data loading subtask of the next neural network layer meets a pre-trigger condition or not based on the task dependency information; And when the data loading subtask meets the triggering condition, generating a data preloading instruction before the subtask of the current neural network layer is completed so as to trigger the data loading subtask to be executed in parallel with the subtask of the current neural network layer. As one preferable solution, the decomposing the computing task of the current neural network layer to obtain each subtask includes: acquiring a task scheduling instruction corresponding to the calculation task of the current neural network layer; Determining the subtask type of the task scheduling instruction according to the operation code of each task scheduling instruction; And distributing the task scheduling instruction to a corresponding instruction queue according to the corresponding subtask type to obtain each subtask. As one preferable mode, the constructing a task schedule according to the task dependency information corresponding to the computing task includes: according to the task dependency information, respectively setting corresponding preset target values for the subtasks, wherein the preset target values represent the times of receiving the completion event notification before executing the subtasks; Respectively initializing a current count value for each subtask, wherein the current count value is used for accumulating the times of receiving the completion event notification; and taking the current count value and the corresponding preset target value as the pre-task state information to construct t