A neural network pipeline multi-core parallel computing method

The neural network pipeline multi-core parallel computing method through automatic hardware scheduling and allocation solves the problems of difficult software scheduling and high computing delay in traditional multi-core processor systems, and achieves efficient neural network computing parallelism, which is suitable for a variety of neural network models. Speed ​​up, reduce latency and improve performance.

CN115034366BActive Publication Date: 2024-10-29THE 54TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORPORATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210649920.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2024-10-29
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

When traditional multi-core processor systems implement parallel neural network computing, software scheduling is expensive and difficult, and cannot effectively reduce computing delays. It also lacks versatility and flexibility and cannot adapt to the acceleration needs of different neural network models.

Method used

The neural network pipeline multi-core parallel computing method with automatic hardware scheduling and allocation is used to decompose a single neural network algorithm into multiple sub-steps and execute them in parallel through multiple neural network processor cores. Synchronization signals are used to achieve task scheduling, reduce computing delays and Improve performance.

Benefits of technology

It implements pipeline-based parallel computing, reduces computing delays, improves computing performance, and does not require the participation of external software. It has high ease of use and flexibility, and is suitable for accelerating a variety of neural network models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115034366B_ABST
    Figure CN115034366B_ABST
Patent Text Reader

Abstract

The present invention proposes a neural network pipeline multi-core parallel computing method, which belongs to the field of deep learning technology and can realize the parallel computing of different parts of a single neural network algorithm by multiple neural network processor cores in parallel. The present invention disassembles a single algorithm into multiple sub-steps and distributes them to multiple neural network processor cores through hardware automatic scheduling and allocation. In each calculation process, multiple neural network processor cores execute different parts of a single neural network algorithm in parallel, thereby realizing pipeline-based parallel computing. The method reduces computing delay and improves computing performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to a neural network pipeline multi-core parallel computing method, which can realize parallel computing of different parts of a single neural network algorithm executed in parallel by multiple neural network processor cores. Background Art

[0002] In recent years, deep learning technology has made great progress and has been widely used in many fields such as image classification, target recognition, and natural language processing. However, with the increase in the number of neural network layers and the increase in the scale of training data, higher requirements are placed on the processing speed and operating power consumption of neural networks, making it imperative to accelerate neural network calculations.

[0003] Existing neural network acceleration computing can be divided into two major types. One is to accelerate specific models, that is, the hardwareization of algorithms. This type can achieve higher performance and lower power consumption for specific algorithms, but it has poor versatility. Once the algorithm needs to be replaced, whether it is a performance upgrade or a functional improvement at the algorithm level, the hardware acceleration solution needs to be redesigned. Another type of neural network acceleration computing is software-defined neural network acceleration computing, that is, a general-purpose neural network processor. By decomposing the computing requirements of the neural network model, designing the instruction set, and then designing the neural network processor, neural network acceleration is achieved. This method has good versatility. Different neural network models are called by the application program, and different neural network models can be accelerated without changing the hardware design.

[0004] For general-purpose neural network processors, a multi-core system can be formed by calling multiple processor cores in the same system. Traditional multi-core processor systems implement multi-core parallel computing through software scheduling. This multi-core scheduling has a large software overhead and usually requires software personnel to develop multi-core parallel software systems, which is also difficult to design. In addition, traditional multi-core processor systems usually use multiple processor cores to run the same or different algorithms at the same time and complete computing tasks for different data. The core goal is to improve computing throughput. However, this method of improving computing throughput cannot effectively reduce computing latency. Summary of the invention

[0005] In view of this, the present invention proposes a neural network pipeline multi-core parallel computing method, which can realize the accelerated computing of neural network algorithms.

[0006] To achieve the above object, the technical solution adopted by the present invention is:

[0007] A neural network pipeline multi-core parallel computing method, which uses hardware automatic scheduling and allocation to break down a single neural network algorithm into multiple sub-steps and allocate them to multiple neural network processor cores; in each calculation process, multiple neural network processor cores execute different sub-steps of a single neural network algorithm in parallel, thereby realizing pipeline-based parallel computing.

[0008] A neural network pipeline multi-core parallel computing method comprises the following steps:

[0009] (1) storing the binary data of the neural network algorithm into the memory and decomposing it into N binary sub-data, wherein the N binary sub-data are loaded by N neural network processors respectively, where N ≥ 2; the binary data of the neural network algorithm comes from the output result of the compiler supporting the neural network processor;

[0010] (2) Load M data to be calculated into the memory. The data to be calculated is used by all neural network processor cores, M ≥ 2;

[0011] (3) Through automatic hardware scheduling and allocation, binary sub-data is allocated to each neural network processor core, and the calculation of the first neural network processor core as the first-level pipeline is started;

[0012] (4) The calculation completion information of the first-level pipeline triggers the start of the second-level pipeline, that is, the second neural network processor core. At the same time, the calculation completion information of the first-level pipeline is fed back to step (3), thereby starting a new calculation task;

[0013] (5) Starting from the second level of pipeline, the calculation completion information of this level of pipeline triggers the next level of pipeline, that is, the start of the next neural network processor core. At the same time, the calculation completion information of this level of pipeline is fed back to the previous level of pipeline, thereby triggering the previous level of pipeline to start a new calculation task;

[0014] (6) The calculation completion information of the Nth level pipeline triggers the end judgment task. At the same time, the calculation completion information of the Nth level pipeline is fed back to the previous level pipeline, thereby triggering the N-1th level pipeline to start a new calculation task;

[0015] (7) The task ends and determines whether the calculation is completed. If not, the end information is fed back to the Nth level pipeline, thereby triggering the Nth level pipeline to start a new calculation task. If completed, the task enters the end stage.

[0016] (8) At the end of the task, resources are released, and then the task exits and returns to the ok state.

[0017] Furthermore, in step (1), the binary data of the neural network algorithm is evenly divided into N binary sub-data, so that the binary sub-data allocated to each neural network processor core is approximately equal.

[0018] Furthermore, task scheduling is achieved between different neural network processor cores through synchronization signals, and the synchronization signals include synchronization trigger signals and synchronization wait signals, wherein the synchronization trigger signal is used to notify the corresponding neural network processor core to start calculation, and the synchronization wait signal is used to notify the corresponding neural network processor core to execute a wait and suspend operation.

[0019] Compared with the prior art, the present invention has the following advantages:

[0020] 1. The present invention is based on pipeline parallel computing, which reduces computing delay and improves computing performance.

[0021] 2. With the present invention, pipeline allocation is completely completed automatically by hardware, does not require the participation of external software, and has great ease of use. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a computational graph model for neural network algorithms.

[0023] Figure 2 Flowchart for multi-core parallel computing of neural network pipeline. DETAILED DESCRIPTION

[0024] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0025] A neural network pipeline multi-core parallel computing method, which uses hardware automatic scheduling and allocation to break down a single algorithm into multiple sub-steps and allocate them to multiple neural network processor cores. In each calculation process, multiple neural network processor cores execute different parts of a single neural network algorithm in parallel, thereby realizing pipeline-based parallel computing. This method reduces computing latency and improves computing performance.

[0026] Specifically, the method comprises the following steps:

[0027] (1) A neural network algorithm binary data is loaded into the memory. The algorithm binary data is the output result from the compiler supporting the neural network processor. The algorithm binary data contains all the information of a neural network algorithm (including configuration and parameters). The binary data is divided into N parts according to the number of neural network processor cores N, so that the algorithm binary data of each neural network processor core is approximately equal. The binary sub-data only contains a part of the complete neural network algorithm binary data, and the N binary sub-data will be loaded by the N neural network processors respectively.

[0028] (2) Load M data to be calculated into the memory, and the data to be calculated is used by all neural network processor cores.

[0029] (3) Computation allocation. Binary sub-data is allocated to each neural network processor core. At the same time, the calculation of the first-level pipeline (the first neural network processor core) is started.

[0030] After multiple neural network processor cores complete the allocation of neural network algorithm tasks, different neural network processor cores implement task scheduling through synchronization signals. The synchronization signal includes a synchronization trigger signal and a synchronization wait signal. Among them, the synchronization trigger signal is sent by a neural network processor core to multiple neural network processor cores, and notifies the multiple neural network processor cores that the neural network processor core calculation is completed. The synchronization wait signal refers to the neural network processor core executing the wait suspend operation. The synchronization wait signal can stop the neural network processor core from calculating, and the synchronization trigger signal can start the neural network processor core from calculating. The automatic scheduling of the processor can be achieved by stopping and starting by the synchronization signal.

[0031] (4) First-level pipeline calculation. The calculation completion information will trigger the start of the next level of pipeline (the second neural network processor core). At the same time, the completion information will also be fed back to the calculation allocation step, thereby triggering the calculation allocation step to start a new calculation task.

[0032] (5) Second-level pipeline calculation. The calculation completion information will trigger the start of the next-level pipeline (the Nth neural network processor core). At the same time, the completion information will also be fed back to the previous-level pipeline, thereby triggering the previous-level pipeline to start a new calculation task.

[0033] (6) Nth level pipeline calculation. At the last level of pipeline calculation, the calculation end information will trigger the end judgment task. At the same time, the end information will also be fed back to the previous level of pipeline (N-1th neural network processor core), thereby triggering the N-1th level of pipeline to start a new calculation task.

[0034] (7) Finally, determine whether the calculation is completed. If not, feedback the completion information to the Nth level pipeline, thereby triggering the Nth level pipeline to start a new calculation task. If completed, enter the next task completion stage.

[0035] (8) After all calculations are completed and resources are released, the calculation software exits and returns to the ok state.

[0036] Here is a more specific example:

[0037] A neural network pipeline multi-core parallel computing method, the method is based on a compiler module, a memory module, a distributor module, a neural network processor module, and a pipeline control module, wherein:

[0038] Compilation module, used to compile neural network algorithms into binary data;

[0039] Memory module, used to load binary data of neural network algorithm and data to be calculated;

[0040] The distributor module is used to distribute binary sub-data and data to be calculated to the neural network processor module and start new calculation tasks;

[0041] A neural network processor module is used for the neural network processor core to process data to be calculated;

[0042] The pipeline control module is used to allocate computing resources and realize parallel computing of multi-stage pipeline neural network processor cores.

[0043] Reference Figure 1 , the input / output of the computation graph is tensor data, and the type of the computation graph represents the type of operation. The accelerated computing of the neural network algorithm refers to the neural network processor obtaining the input tensor in the computation graph model, implementing the computing function of the corresponding computing type of the computation graph, and calculating the output tensor result.

[0044] Reference Figure 2 After the neural network algorithm is compiled into algorithm binary data by the compilation module, the algorithm binary data and the data to be calculated are loaded into the memory module respectively. The distributor module allocates binary sub-data and data to be calculated to the neural network processor module, and starts the calculation of the first level of pipeline (the first neural network processor core) at the same time. The calculation end information will trigger the start of the next level of pipeline (the second neural network processor core), and the end information will also be fed back to the calculation allocation step, thereby triggering the calculation allocation step to start a new calculation task.

[0045] The end information of the second-level pipeline calculation will trigger the start of the next-level pipeline (the Nth neural network processor core). At the same time, the end information will also be fed back to the previous level of pipeline, thereby triggering the previous level of pipeline to start a new computing task.

[0046] The Nth level of pipeline is the last level of pipeline calculation. The calculation end information will trigger the end judgment task. At the same time, the end information will also be fed back to the previous level of pipeline (N-1th neural network processor core), thereby triggering the N-1th level of pipeline to start a new calculation task.

[0047] Finally, it is determined whether the calculation is completed. If not, the end information is fed back to the Nth level pipeline, thereby triggering the Nth level pipeline to start a new calculation task. If completed, it enters the next task end stage. After the calculation is completed, the computing software exits and returns to the ok state after releasing the resources.

[0048] In summary, the present invention disassembles a single algorithm into multiple sub-steps and distributes them to multiple neural network processor cores through automatic hardware scheduling and allocation. In each calculation process, multiple neural network processor cores execute different parts of a single neural network algorithm in parallel, thereby realizing parallel calculation based on pipeline. This method reduces calculation delay, improves calculation performance, and can realize parallel calculation of different parts of a single neural network algorithm executed by multiple neural network processor cores in parallel.

Claims

1. A neural network pipeline multi-core parallel computing method, It is characterized in that The steps include: (1) storing the binary data of the neural network algorithm into a memory and decomposing it into N binary sub-data, wherein the N binary sub-data are loaded by N neural network processors respectively, where N≥2; the binary data of the neural network algorithm comes from the output result of the compiler supporting the neural network processor; (2) Load M data to be calculated into the memory. The data to be calculated is used by all neural network processor cores, M ≥ 2; (3) Allocate binary sub-data to each neural network processor core through automatic hardware scheduling and allocation, and start the calculation of the first neural network processor core as the first-level pipeline; (4) The calculation completion information of the first-level pipeline triggers the start of the second-level pipeline, that is, the second neural network processor core. At the same time, the calculation completion information of the first-level pipeline is fed back to step (3), thereby starting a new calculation task; (5) Starting from the second level of pipeline, the calculation completion information of the current level of pipeline triggers the start of the next level of pipeline, that is, the next neural network processor core. At the same time, the calculation completion information of the current level of pipeline is fed back to the previous level of pipeline, thereby triggering the previous level of pipeline to start a new calculation task; (6) The calculation completion information of the Nth level pipeline triggers the end judgment task. At the same time, the calculation completion information of the Nth level pipeline is fed back to the previous level pipeline, thereby triggering the N-1th level pipeline to start a new calculation task; (7) End judgment task: judge whether the calculation is completed. If not, feedback the end information to the Nth level pipeline, thereby triggering the Nth level pipeline to start a new calculation task; if completed, enter the task end stage; (8) At the end of the task, resources are released, and then the task exits and returns to the ok state; Task scheduling is achieved between different neural network processor cores through synchronization signals, and the synchronization signals include synchronization trigger signals and synchronization wait signals, wherein the synchronization trigger signal is used to notify the corresponding neural network processor core to start calculation, and the synchronization wait signal is used to notify the corresponding neural network processor core to execute wait and suspend operations.

2. A neural network pipeline multi-core parallel computing method according to claim 1, It is characterized in that In step (1), the binary data of the neural network algorithm is evenly divided into N binary sub-data, so that the binary sub-data allocated to each neural network processor core is approximately equal.

Citation Information

Patent Citations

  • Hardware agnostic deep neural network compiler

    CN112149812A

  • Parallelization method, system and program

    US20110107162A1