Convolution processing method, device, convolutional neural network accelerator and storage medium

By dividing the data groups in the convolution neural network into multiple pipelines for parallel operations, and using the tap signal to trigger the pipeline for multiplication and addition operations, the problem of low convolution processing efficiency is solved and efficient convolution processing is achieved.

CN113705795BActive Publication Date: 2024-12-17SHENZHEN SMARTMORE TECH CO LTD +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202111086222.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2024-12-17
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

The convolution processing efficiency in convolutional neural network processing is low, mainly due to the huge amount of data and the difficulty in ensuring processing efficiency.

Method used

By determining the data group to be multiplied and added, and determining the number of pipelines with an integer multiple relationship less than the number of data groups based on the number of data groups, the data group is divided equally into each pipeline for parallel multiplied and added operations, and the pipeline is triggered by tapping signals Perform multiplication and addition operations to improve processing efficiency.

Benefits of technology

Compared with serial operations, the efficiency of convolution processing is improved, the circuit area and power consumption are reduced, and efficient convolution operations are realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113705795B_ABST
    Figure CN113705795B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and provides a convolution processing method, device, convolutional neural network accelerator and storage medium. The method can improve the efficiency of convolution processing, and the method mainly includes: determining multiple data groups to be multiplied and added; each data group includes weight data and feature data; according to the number of data groups, determining the number of pipelines used for multiplication and addition operations; the number of pipelines has an integer multiple relationship with the number of data groups and is less than the number of data groups; and dividing the multiple data groups into equal parts into each pipeline for multiplication and addition operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a convolution processing method, device, convolutional neural network accelerator and storage medium. Background Art

[0002] With the advent of the era of artificial intelligence, convolutional neural networks are being used in a variety of scenarios. Convolutional processing is essential in the processing of convolutional neural networks. This convolutional processing mainly involves multiplication and addition of weight data and feature data. The amount of data involved is huge, and the efficiency of convolutional processing is difficult to guarantee. Summary of the invention

[0003] Based on this, it is necessary to provide a convolution processing method, device, convolutional neural network accelerator and storage medium to address the above-mentioned technical problems.

[0004] A convolution processing method, the method comprising:

[0005] Determine a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0006] According to the number of the data groups, determining the number of pipelines for multiplication and addition operations; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups;

[0007] The multiple data groups are equally divided into each pipeline for multiplication and addition operations.

[0008] In one embodiment, if the data group includes two weight data and one feature data, dividing the multiple data groups equally into each pipeline for multiplication and addition operation includes:

[0009] When performing multiplication and addition operations on the current data group on the pipeline, for one of the weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the one of the weight data and the feature data through a beat signal, and for another weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the other weight data and the feature data through a signal between the beat signal and the next beat signal.

[0010] In one embodiment, the method further comprises:

[0011] After completing the multiplication and addition operation for the current data group on the pipeline, the pipeline is triggered by the next beat signal to perform the multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data.

[0012] In one of the embodiments, the number of data groups is consistent with the number of weight data included in the convolution kernel.

[0013] In one embodiment, each pipeline performs multiplication and addition operations in parallel.

[0014] A convolution processing device, comprising:

[0015] A data group determination module is used to determine a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0016] A pipeline number determination module, used to determine the number of pipelines used for multiplication and addition operations according to the number of the data groups; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups;

[0017] The first multiplication-addition operation module is used to divide the multiple data groups into equal parts and assign them to each pipeline for multiplication-addition operation.

[0018] In one embodiment, if the data group includes two weight data and one feature data, the first multiplication and addition operation module is also used to trigger the pipeline to perform multiplication and addition operations on one of the weight data included in the current data group and the feature data through a beat signal when performing multiplication and addition operations on the current data group on the pipeline, and to trigger the pipeline to perform multiplication and addition operations on another weight data included in the current data group and the feature data through a signal between the beat signal and the next beat signal.

[0019] In one embodiment, the device also includes a second multiplication and addition operation module, which is used to trigger the pipeline to perform a multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal after completing the multiplication and addition operation for the current data group on the pipeline.

[0020] A convolutional neural network accelerator includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0021] Determine a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0022] According to the number of the data groups, determining the number of pipelines for multiplication and addition operations; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups;

[0023] The multiple data groups are equally divided into each pipeline for multiplication and addition operations.

[0024] In one of the embodiments, the processor further implements the following steps when executing the computer program: when performing multiplication and addition operations on the current data group on the pipeline, for one of the weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the one of the weight data and the feature data through a beat signal, and for another weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the other weight data and the feature data through a signal between the beat signal and the next beat signal.

[0025] In one of the embodiments, the processor also implements the following steps when executing the computer program: after completing the multiplication and addition operation for the current data group on the pipeline, triggering the pipeline to perform the multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal.

[0026] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0027] Determine a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0028] According to the number of the data groups, determining the number of pipelines for multiplication and addition operations; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups;

[0029] The multiple data groups are equally divided into each pipeline for multiplication and addition operations.

[0030] In one of the embodiments, the processor further implements the following steps when executing the computer program: when performing multiplication and addition operations on the current data group on the pipeline, for one of the weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the one of the weight data and the feature data through a beat signal, and for another weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the other weight data and the feature data through a signal between the beat signal and the next beat signal.

[0031] In one of the embodiments, the processor also implements the following steps when executing the computer program: after completing the multiplication and addition operation for the current data group on the pipeline, triggering the pipeline to perform the multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal.

[0032] The above-mentioned convolution processing method, device, convolutional neural network accelerator and storage medium determine multiple data groups to be multiplied and added; each data group includes weight data and feature data; according to the number of data groups, the number of pipelines used for multiplication and addition operations is determined; the number of pipelines is an integer multiple of the number of data groups and is less than the number of data groups; the multiple data groups are equally divided into each pipeline for multiplication and addition operations. In the present application, the number of pipelines for multiplication and addition operations is determined according to the number of data groups including weight data and feature data, and each data group is equally divided into each pipeline for multiplication and addition operations. Compared with serial operations on each data group, the processing efficiency is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 Schematic diagram of a computing architecture of a convolution processing method in one embodiment;

[0034] Figure 2 is a schematic flow chart of a convolution processing method in one embodiment;

[0035] Figure 3 Schematic diagram of a computing architecture of a convolution processing method in one embodiment;

[0036] Figure 4 Schematic diagram of a computing architecture of a convolution processing method in one embodiment;

[0037] Figure 5 4 is a structural block diagram of a convolution processing device in one embodiment. DETAILED DESCRIPTION

[0038] 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.

[0039] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0040] The present application provides a convolution processing method, which can be applied to the convolution processing of an image by a convolutional neural network accelerator, and the convolutional neural network accelerator may include an FPGA chip (Field Programmable Gate Array). Based on the characteristics of the computing unit (such as DSP48) of the convolutional neural network accelerator, the present application uses multiple pipelines in parallel to perform multiplication and addition operations on weight data and feature data, solving the problem of long serial calculation time and storing the results of the previous level calculation.

[0041] The following combination Figure 1 to Figure 2 This method mainly includes the following steps:

[0042] Step S201, determining a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0043] Exemplarily, for a 3×3 convolution kernel, the convolution kernel includes 9 weight data (which can be recorded as W0, W1, W2, W3, W4, W5, W6, W7, W8 and W9 respectively), and each weight data is multiplied and added with the corresponding feature data on the feature map (which can be recorded as A0, A1, A2, A3, A4, A5, A6, A7, A8 and A9 respectively), and the result is used as the convolution operation result (which can be recorded as SUM), that is, SUM=A0*W0+A1*W1+A2*W2+A3*W3+A4*W4+A5*W5+A6*W6+A7*W7+A8*W8.

[0044] Among them, each weight data and the feature data corresponding to each weight can be taken as a data group to obtain 9 data groups to be multiplied and added, such as (A0, W0), (A1, W1) and (A2, W2), etc.; the number of data groups is consistent with the number of weight data included in the convolution kernel.

[0045] Step S202, determining the number of pipelines used for multiplication and addition operations according to the number of the data groups; wherein the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups.

[0046] Among them, Figure 1 As shown, each pipeline for multiplication and addition operations may include a multiplier 101 and an adder 102, where the multiplier 101 is used to perform multiplication operations on weight data and feature data, and the adder 102 is used to add multiple results output by the multiplier.

[0047] If the number of data groups is 9, then the number of pipelines used for multiplication and addition operations can be determined to be 3; if the number of data groups is 16, then the number of pipelines can be determined to be 2 or 4 or 8; the number of pipelines has an integer multiple relationship with the amount of data groups and is less than the number of data groups.

[0048] Step S203: divide the plurality of data groups equally into each pipeline for multiplication and addition operations

[0049] like Figure 1 As shown, for the 9 data groups (A0, W0), (A1, W1), (A2, W2), (A3, W3), (A4, W4), (A5, W5), (A6, W6), (A7, W7) and (A8, W8), (A0, W0), (A1, W1) and (A2, W2) can be divided into the same pipeline, (A3, W3), (A4, W4) and (A5, W5) can be divided into the same pipeline, (A6, W6), (A7, W7) and (A8, W8) can be divided into the same pipeline; each pipeline performs multiplication and addition operations on 3 data groups, so each pipeline can be said to have 3-stage pipeline multiplication and addition operations; on a pipeline, the beats of the first stage pipeline need to be used for the multiplication and addition operations of the second stage pipeline, and the beats of the second stage pipeline need to be used for the multiplication and addition operations of the third stage pipeline. As shown in FIG. Figure 1 As shown, after each pipeline completes the multiplication and addition operation of the corresponding data group, the output results of each pipeline are added together, and the obtained output is used as the convolution operation result SUM.

[0050] In the above-mentioned convolution processing method, the number of pipelines for multiplication and addition operations is determined according to the number of data groups including weight data and feature data, and each data group is equally divided into each pipeline for multiplication and addition operations. Compared with performing serial operations on each data group, the processing efficiency is higher.

[0051] like Figure 3 As shown, the 3×3 convolution data (weight data and feature data) data stream is input to the multi-channel operation unit, and each channel has a Figure 1 The computing architecture shown.

[0052] If adopted Figure 4 As shown, a single-stage cascade is used for series connection, and the calculated values ​​(weight data and feature data) are beat at each stage, with a total of 8 beats to complete a 3×3 convolution operation; and in the convolution processing method provided in the present application, each pipeline can perform multiplication and addition operations in parallel to improve computing efficiency.

[0053] In the convolution processing method proposed in the present application, when the calculated value (such as weight data) switches back and forth between two values, a beat control switching signal is used to switch the value of each multiplication operation instead of the original method of directly beating the calculated value. This can reduce the number of flip flops (triggers) and reduce the circuit area and power consumption for implementing the operation.

[0054] Specifically, the above-mentioned step S203 may further include: when performing multiplication and addition operations on the current data group on the pipeline, for one of the weight data included in the current data group, triggering the pipeline to perform multiplication and addition operations on one of the weight data and the feature data through a beat signal, and for another weight data included in the current data group, triggering the pipeline to perform multiplication and addition operations on the other weight data and the feature data through a signal between the beat signal and the next beat signal.

[0055] For example, if two convolution kernels are required to perform convolution operations on the feature maps respectively, then the above data group may include two weight data and one feature data, and the two weight data belong to each convolution kernel respectively, for example (A 01 , A 02 , W0), A 01 and A 02 They belong to the first convolution kernel and the second convolution kernel respectively.

[0056] At this time, if the data group includes two weight data and needs to switch between the two weight data, the beat signal can be used to trigger A 01 The multiplication and addition operation of W0 is performed, and the signal between the beat signal and the next beat signal is used to trigger A 02 Multiplication and addition operation with W0.

[0057] In the above implementation, as the clock can switch between the two weight data, the beat processing of the weight data is omitted, and the number of flip flops used in the operation circuit is reduced.

[0058] In order to better understand the above method, an application example of the convolution processing method of the present application is described in detail below.

[0059] Furthermore, the following steps are included: after completing the multiplication and addition operation for the current data group on the pipeline, triggering the pipeline to perform the multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal.

[0060] Exemplarily, the first data group (A) is completed in the first pipeline. 01 , A 02After the multiplication and addition operation of W0), the first pipeline can be triggered by the next beat signal to perform the second data group (A 11 , A 12 , A in W1) 11 Multiplication and addition operation with W1.

[0061] In the above method, after completing the multiplication and addition operation of the current data group, the pipeline is triggered by the next beat signal to perform the multiplication and addition operation of one of the weight data and the corresponding feature data included in the next data group, thereby ensuring the normal progress of the convolution processing.

[0062] In one embodiment, the convolution processing method can be applied to a scenario where an FPGA chip performs convolution processing on an image, and the image can be an image including an object to be detected (such as a vehicle, a pedestrian, etc.). Depending on the convolution kernel, the convolution processing on the image has different effects; for example, when the convolution kernel is an edge detection operator, the edge in the image can be highlighted by performing convolution processing on the image using the edge detection operator; for another example, when the convolution kernel is an image smoothing operator, the image can be improved in smoothness and reduced in noise by performing convolution processing on the image using the image smoothing operator.

[0063] The convolution processing of an image using a convolution kernel mainly involves multiplying the weight data of the convolution kernel and the corresponding image feature data, and adding the multiplication results. Correspondingly, the data group in this embodiment is a data group for performing convolution processing on an image, and each data group includes the feature data of the image and the weight data of the convolution kernel; wherein each pipeline includes a multiplier and an adder for performing multiplication and addition operations on the corresponding data group.

[0064] In this embodiment, the convolution kernel is a 3×3 edge detection operator, including 9 weight data (which can be recorded as W0, W1, W2, W3, W4, W5, W6, W7, W8 and W9 respectively), and the image is obtained by shooting a vehicle; in order to highlight the contour of the vehicle in the image, the edge detection operator can be used to perform convolution processing on the image, and the feature data of the image are recorded as A0, A1, A2, A3, A4, A5, A6, A7, A8 and A9 respectively. Correspondingly, 9 data groups to be multiplied and added can be obtained: (A0, W0), (A1, W1), (A2, W2), (A3, W3), (A4, W4), (A5, W5), (A6, W6), (A7, W7) and (A8, W8).

[0065] Next, (A0, W0), (A1, W1) and (A2, W2) are divided into the same pipeline, (A3, W3), (A4, W4) and (A5, W5) are divided into the same pipeline, (A6, W6), (A7, W7) and (A8, W8) are divided into the same pipeline; each pipeline performs multiplication and addition operations on 3 data groups, that is, each pipeline has 3 levels of multiplication and addition operations; on one pipeline, the beat of the first level pipeline needs to be used for the multiplication and addition operations of the second level pipeline, and the beat of the second level pipeline needs to be used for the multiplication and addition operations of the third level pipeline. After each pipeline completes the multiplication and addition operation of the corresponding data group, the output results of each pipeline are added together, and the output obtained is used as the convolution operation result SUM=A0*W0+A1*W1+A2*W2+A3*W3+A4*W4+A5*W5+A6*W6+A7*W7+A8*W8.

[0066] Similarly, other feature data of the image are multiplied and added in the above manner to obtain corresponding convolution operation results; based on multiple convolution operation results, the vehicle outline can be highlighted on the image.

[0067] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0068] In one embodiment, Figure 5 As shown, a convolution processing device is provided, comprising:

[0069] The data group determination module 501 is used to determine a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0070] A pipeline number determination module 502, used to determine the number of pipelines used for multiplication and addition operations according to the number of the data groups; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups;

[0071] The first multiplication-addition operation module 503 is used to divide the multiple data groups into equal parts and assign them to each pipeline for multiplication-addition operation.

[0072] In one embodiment, if the data group includes two weight data and one feature data, the first multiplication and addition operation module 503 is also used to trigger the pipeline to perform multiplication and addition operations on one of the weight data included in the current data group and the feature data through a beat signal when performing multiplication and addition operations on the current data group on the pipeline, and to trigger the pipeline to perform multiplication and addition operations on another weight data included in the current data group and the feature data through a signal between the beat signal and the next beat signal.

[0073] In one embodiment, the device also includes a second multiplication and addition operation module, which is used to trigger the pipeline to perform a multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal after completing the multiplication and addition operation for the current data group on the pipeline.

[0074] In one of the embodiments, the number of data groups is consistent with the number of weight data included in the convolution kernel.

[0075] In one embodiment, each pipeline performs multiplication and addition operations in parallel.

[0076] For the specific definition of the convolution processing device, please refer to the definition of the convolution processing method above, which will not be repeated here. Each module in the above-mentioned convolution processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the form of hardware, or stored in the memory in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0077] In one embodiment, a convolutional neural network accelerator is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0078] Determine a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0079] According to the number of the data groups, determining the number of pipelines for multiplication and addition operations; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups;

[0080] The multiple data groups are equally divided into each pipeline for multiplication and addition operations.

[0081] In one of the embodiments, the processor further implements the following steps when executing the computer program: when performing multiplication and addition operations on the current data group on the pipeline, for one of the weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the one of the weight data and the feature data through a beat signal, and for another weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the other weight data and the feature data through a signal between the beat signal and the next beat signal.

[0082] In one of the embodiments, the processor also implements the following steps when executing the computer program: after completing the multiplication and addition operation for the current data group on the pipeline, triggering the pipeline to perform the multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal.

[0083] In one of the embodiments, the number of data groups is consistent with the number of weight data included in the convolution kernel.

[0084] In one embodiment, each pipeline performs multiplication and addition operations in parallel.

[0085] 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:

[0086] Determine a plurality of data groups to be multiplied and added; each data group includes weight data and feature data;

[0087] According to the number of the data groups, determining the number of pipelines for multiplication and addition operations; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups;

[0088] The multiple data groups are equally divided into each pipeline for multiplication and addition operations.

[0089] In one of the embodiments, the processor further implements the following steps when executing the computer program: when performing multiplication and addition operations on the current data group on the pipeline, for one of the weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the one of the weight data and the feature data through a beat signal, and for another weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the other weight data and the feature data through a signal between the beat signal and the next beat signal.

[0090] In one of the embodiments, the processor also implements the following steps when executing the computer program: after completing the multiplication and addition operation for the current data group on the pipeline, triggering the pipeline to perform the multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal.

[0091] In one of the embodiments, the number of data groups is consistent with the number of weight data included in the convolution kernel.

[0092] In one embodiment, each pipeline performs multiplication and addition operations in parallel.

[0093] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned 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 memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. 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).

[0094] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0095] The above 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 invention patent. 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 patent of the present application shall be subject to the attached claims.

Claims

1. A convolution processing method, characterized in that: The method comprises: Determine a plurality of data groups to be multiplied and added; the data groups are data groups for performing convolution processing on the image, including feature data of the image and weight data of the convolution kernel; According to the number of the data groups, determining the number of pipelines for multiplication and addition operations; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups; When the data group includes two weight data and one feature data, when performing multiplication and addition operations on the current data group on the pipeline, for one of the weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the one of the weight data and the feature data through a beat signal, and for another weight data included in the current data group, the pipeline is triggered to perform multiplication and addition operations on the another weight data and the feature data through a signal between the beat signal and the next beat signal; The outputs of each pipeline are added together, and the result obtained is used as the convolution operation result.

2. The method according to claim 1, characterized in that The method further comprises: After completing the multiplication and addition operation for the current data group on the pipeline, the pipeline is triggered by the next beat signal to perform the multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data.

3. The method according to claim 1 or 2, characterized in that The number of the data groups is consistent with the number of weight data included in the convolution kernel.

4. The method according to claim 1 or 2, characterized in that: Each pipeline performs multiplication and addition operations in parallel.

5. A convolution processing device, characterized in that: The device comprises: A data group determination module is used to determine a plurality of data groups to be multiplied and added; the data group is a data group for performing convolution processing on an image, including feature data of the image and weight data of a convolution kernel; A pipeline number determination module, used to determine the number of pipelines used for multiplication and addition operations according to the number of the data groups; the number of the pipelines is an integer multiple of the number of the data groups and is smaller than the number of the data groups; The first multiplication and addition operation module is used for, when the data group includes two weight data and one feature data, when performing multiplication and addition operation of the current data group on the pipeline, for one of the weight data included in the current data group, triggering the pipeline to perform multiplication and addition operation of the one weight data and the feature data through a beat signal, and for another weight data included in the current data group, triggering the pipeline to perform multiplication and addition operation of the other weight data and the feature data through a signal between the beat signal and the next beat signal; adding the results output by each pipeline, and obtaining the result as the convolution operation result.

6. The device according to claim 5, characterized in that The device also includes a second multiplication and addition operation module, which is used to trigger the pipeline to perform a multiplication and addition operation of one of the weight data included in the next data group and the corresponding feature data through the next beat signal after completing the multiplication and addition operation for the current data group on the pipeline.

7. The device according to claim 5 or 6, characterized in that The number of the data groups is consistent with the number of weight data included in the convolution kernel.

8. The device according to claim 5 or 6, characterized in that Each pipeline performs multiplication and addition operations in parallel.

9. A convolutional neural network accelerator, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Artificial intelligence convolution processing method and device, readable storage medium, and terminal

    CN109313723A

  • Artificial intelligence parallel processing method, device, readable storage medium and terminal

    CN109416755A

  • FPGA-based parallel convolutional neural network accelerator and acceleration method

    CN110598844A

  • Data processing method and device, equipment and medium

    CN110647975A

  • Convolutional network accelerator, configuration method and computer readable storage medium

    CN111416743A