Data flow structure and operation method for minimizing external memory access in resnet of binary neural network

By employing binarization and optimized operations, the data flow structure minimizes external memory access in ResNet, addressing inefficiencies and improving power efficiency and computation speed in ResNet applications for BNNs.

WO2024177263A1PCT designated stage expired Publication Date: 2024-08-29KOREA ELECTRONICS TECH INST
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2023/021637
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-24
Filing Date
2023-12-27
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

Residual Networks (ResNet) face inefficiencies in power consumption and computation speed due to excessive external memory access, particularly when dealing with large input data sizes that exceed internal memory capacity, leading to redundant data reads and increased memory operations.

Method used

Implementing a data flow structure and calculation method that utilizes binarization of neural network data, reducing the number of bits in data formats from floating point to binary and integer, thereby minimizing external memory access through optimized operations such as binary convolution, batch normalization, and activation functions, which allows for reduced external memory reads and writes.

Benefits of technology

This approach significantly reduces external memory access by 50%, enhancing both power efficiency and calculation speed in ResNet applications, especially when applied to Binary Neural Networks (BNNs).

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2023021637_29082024_PF_FP_ABST
    Figure KR2023021637_29082024_PF_FP_ABST
Patent Text Reader

Abstract

A data flow structure and an operation method for minimizing external memory access in ResNet of a BNN are provided. An operation method according to an embodiment of the present invention performs an activation operation for floating point type-input data stored in an external memory so as to output same as binary data and store same in an internal memory, and then performs a convolution operation, and a normalization and an ADD operation. Accordingly, in application to ResNet of a BNN, access to external memory RW can be dramatically reduced (50% reduced), whereby both power efficiency and operation speed in a BNN operation device can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Dataflow structure and computational method for minimizing external memory access in binary neural networks.

[0001] The present invention relates to neural network operations, and more particularly, to a data flow and a corresponding operation method for minimizing external memory access in a ResNet (Residual Network).

[0002] ResNet solves the vanishing gradient problem that occurs when network depth increases by learning the differences between input and output data. Figure 1 illustrates the data flow in a typical ResNet.

[0003] In ResNet, when the input data is large, it is divided into sizes that can be processed in internal memory and then the computation is performed. However, in the case of Conv2D, the computation result is obtained only after data input is completed for all channels of the desired kernel size.

[0004] For example, if the data (1) of Kernel × Channel as in Fig. 2 is of a size that can be stored in the internal memory, operations such as Conv2D operation, BatchNor, and Add operation for the final output data can be performed without additional external memory input / output.

[0005] However, as shown in Fig. 3, if the data (1, 2, 3) of Kernetl × Channel is larger than the size that can be stored in the internal memory, more external memory input / output is required. In the case of Fig. 3, all data for Conv2D must be input through three Reads from the external memory, that is, Read of Kernetl × Channel data (1), Read of Kernetl × Channel data (2), and Read of Kernetl × Channel data (3) to enable operation.

[0006] Furthermore, in order to finally generate the output data, the data (1) of Kernetl × Channel must be read again and an Add operation must be performed. Therefore, the problem arises that all input data must be read twice.

[0007] The present invention has been devised to solve the above problems, and the purpose of the present invention is to provide a method for reducing external memory RW in applying ResNet of BNN, thereby improving power efficiency and operation speed.

[0008] According to one embodiment of the present invention for achieving the above object, a neural network operation method includes the steps of performing an activation operation on input data of a first format stored in an external memory and outputting data of a second format; performing a convolution operation on the data of the second format to extract feature data and outputting data of a third format; normalizing the feature data of the third format; and adding the normalized feature data and the input data stored in the external memory.

[0009] The number of data bits in the second format is less than the number of data bits in the first format. The first format may be a floating point format, and the second format may be a binary format.

[0010] The convolution operation can be a binary convolution operation. The neural network can be a ResNet with a BNN applied. The third format can be an integer format.

[0011] The normalization step normalizes the feature data in the third format, thereby outputting the normalized feature data in the first format. The data in the second format generated by the activation operation can be stored in internal memory.

[0012] Normalization can be batch normalization.

[0013] A neural network operation device according to another embodiment of the present invention includes: an operation module that performs an activation operation on input data of a first format stored in an external memory to output data of a second format, extracts feature data from the data of the second format by a convolution operation, outputs data of a third format, normalizes the feature data of the third format, and adds the normalized feature data and the input data stored in the external memory; and an internal memory that stores data of the second format generated by the activation operation.

[0014] A neural network operation method according to another embodiment of the present invention includes the steps of performing an activation operation on input data of a first format stored in an external memory and outputting data of a second format; performing a convolution operation on the data of the second format to extract feature data and outputting data of a third format; and normalizing the feature data of the third format.

[0015] A neural network operation device according to another embodiment of the present invention includes: an operation module that performs an activation operation on input data of a first format stored in an external memory to output data of a second format, extracts feature data of the second format data by a convolution operation, outputs data of a third format, and normalizes the feature data of the third format; and an internal memory that stores data of the second format generated by the activation operation.

[0016] As described above, according to embodiments of the present invention, in applying ResNet to BNN, access to external memory RW is drastically reduced (50% reduction), thereby improving both power efficiency and computational speed in the BNN computation device.

[0017] Figure 1. Data flow in ResNet

[0018] Figure 2. When Kernel Size × Channel < Internal SRAM

[0019] Figure 3. When Kernel Size × Channel > Internal SRAM

[0020] Figure 4, ResNet data flow and operation method in BNN applicable to one embodiment of the present invention.

[0021] Figure 5. Data flow for multiple layers of ResNet to which an embodiment of the present invention can be applied.

[0022] Fig. 6. Operation module for the boxed portion in Fig. 5

[0023] Fig. 7. BNN computational device according to another embodiment of the present invention.

[0024] Hereinafter, the present invention will be described in more detail with reference to the drawings.

[0025] In an embodiment of the present invention, a data flow structure and corresponding computational method for minimizing external memory access in a ResNet (Residual Network) are presented. This technique minimizes redundant reading of data used in a ResNet by applying the data binarization characteristics of a BNN (binarized Neural Network) to the ResNet.

[0026] FIG. 4 is a diagram illustrating a ResNet data flow and computational method in a BNN applicable to one embodiment of the present invention. Unlike the conventional ResNet presented in FIG. 1, where all data in the flow are floating point data, the ResNet to which the embodiment of the present invention is applicable, presented in FIG. 4, has different data formats applied in each computational process.

[0027] Data input from external memory (Input, S110), output data of batch normalization (BarchNorm, S140), and output data of ADD operation (S150) are also floating data, but output data of activation operation (Activation, S120) is binarized data, and output data of 2D binary convolution operation (BConv2D, S130) is integer data.

[0028] A detailed description of each operation process follows.

[0029] In the input stage (S110), input data stored in external memory is read. The input data is floating data with a large number of data bits.

[0030] In the activation operation (S120), input data is input into the activation function to perform the activation operation. The activation function is implemented so that the operation result is output as binary data with a small number of data bits. The operation result in the activation operation (S120) is stored in the internal memory.

[0031] Since storing input data, which is floating data, requires a very large capacity, external memory is used, but in the case of binarized data converted by the activation operation (S120), the number of bits is reduced to 1 / 32 of that of floating data, so it can be sufficiently stored in internal memory with a relatively small capacity.

[0032] In the 2D binary convolution operation (S130), feature data is extracted through a convolution operation on the binarized data stored in the internal memory, and the feature data is implemented to be output as data in integer format.

[0033] In batch normalization (S140), the feature data extracted from the 2D binary convolution operation (S130) is normalized, and the normalized feature data is implemented to be output as data in floating point format.

[0034] In an embodiment of the present invention, the output data of the activation operation (S120) is implemented as binarized data, thereby eliminating the need for external memory access until the subsequent 2D binary convolution operation (S130) and batch normalization (S140). This minimizes access to external memory for data input / output.

[0035] In the ADD operation (S150), the normalized feature data in floating point format, which is the result of the operation by batch normalization (S140), and the input data in floating point format input from external memory are added together.

[0036] The operation result of the ADD operation (S150) is stored in external memory and is also used in the next activation operation (S120).

[0037] Figure 5 shows the data flow for multiple layers of ResNet to which an embodiment of the present invention can be applied.

[0038] If the binarized data BIF#0, which is the result of the activation operation of each layer, is stored in the internal memory, the integer data POP#0, which is the result of the convolution, and the floating data BN#0, which is the result of normalization using it, can be generated without inputting external memory.

[0039] To generate the final output data OF#0 of the next ResNet, IF#0 is read from external memory and Add#0 operation is performed. The output data OF#0 generated in this way is stored in external memory and becomes the input data IF#0 for the next layer operation. Afterwards, the binarized input data BIF#1 for the next layer operation is stored in internal memory to prepare for the next operation.

[0040] The boxed portion in Fig. 5 can be expressed as one module as shown in Fig. 6, and the module is composed of a 2D binary convolution operation (BConv2D), batch normalization (BarchNorm), ADD operation, and activation operation (Activation).

[0041] In Figure 6, IF represents input / output to external memory, and BIF represents input / output to internal memory.

[0042] FIG. 7 is a diagram illustrating the configuration of a BNN computational device according to another embodiment of the present invention. For ease of understanding, an external memory (10) is additionally illustrated in FIG. 7. As illustrated, the BNN computational device according to an embodiment of the present invention comprises a DMA (210), a controller (220), an internal memory (230), and a computational module (240).

[0043] DMA (210) is configured to access external memory (210), reads input data from external memory (210), provides it to the operation module (240), and writes output data of the operation module (240) to the external memory (210).

[0044] The operation module (240) is composed of operation elements for performing the aforementioned 2D binary convolution operation (BConv2D), batch normalization (BarchNorm), ADD operation, and activation operation (Activation).

[0045] The internal memory (230) is a memory for storing binary data, which is the result of an activation operation. The controller (220) is a configuration for controlling the overall operation of the BNN operation device.

[0046] So far, we have presented a data flow structure and corresponding operation method for minimizing external memory access in ResNet by applying the data binarization characteristics of BNN to ResNet.

[0047] By doing so, access to external memory RW in the application of ResNet to BNN can be drastically reduced (50% reduction), thereby improving both power efficiency and computational speed in the BNN computation unit.

[0048] Meanwhile, it goes without saying that the technical idea of ​​the present invention can also be applied to a computer-readable recording medium containing a computer program that performs the functions of the device and method according to the present embodiment. In addition, the technical idea according to various embodiments of the present invention can be implemented in the form of computer-readable code recorded on a computer-readable recording medium. The computer-readable recording medium can be any data storage device that can be read by a computer and store data. For example, the computer-readable recording medium can be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical disk, a hard disk drive, etc. In addition, the computer-readable code or program stored on the computer-readable recording medium can be transmitted through a network connected between computers.

[0049] In addition, although the preferred embodiments of the present invention have been illustrated and described above, the present invention is not limited to the specific embodiments described above, and various modifications can be made by a person having ordinary skill in the art to which the present invention pertains without departing from the gist of the present invention as claimed in the claims, and such modifications should not be understood individually from the technical idea or prospect of the present invention.

Claims

1. A step of activating input data of the first format stored in external memory and outputting it as data of the second format; A step of extracting feature data by convolution operation on data of the second format and outputting it as data of the third format; Step of normalizing the feature data of the third format; A neural network operation method, characterized by including a step of summing normalized feature data and input data stored in an external memory.

2. In claim 1, The number of data bits in the second format is A neural network operation method characterized by having a smaller number of data bits than the first format.

3. In claim 2, The first form is, It is in floating point format, The second form is, A neural network operation method characterized by being in a binary format.

4. In claim 3, The convolution operation is, A neural network operation method characterized by a binary convolution operation.

5. In claim 4, Neural networks, A neural network operation method characterized by being a ResNet with BNN applied.

6. In claim 3, The third form is, A neural network operation method characterized by being in integer format.

7. In claim 3, The normalization step is, A neural network operation method characterized by normalizing feature data in a third format and outputting feature data normalized in a first format.

8. In claim 1, The second type of data generated by the activation operation is A neural network operation method characterized in that it is stored in internal memory.

9. In claim 1, Normalization is A neural network operation method characterized by batch normalization.

10. An operation module that performs an activation operation on input data of the first format stored in an external memory to output data of the second format, extracts feature data from the data of the second format by a convolution operation, outputs data of the third format, normalizes the feature data of the third format, and adds the normalized feature data and the input data stored in the external memory; and A neural network operation device characterized by including an internal memory for storing a second format of data generated by an activation operation.

11. A step of activating input data of the first format stored in external memory and outputting it as data of the second format; A step of extracting feature data by convolution operation on data of the second format and outputting it as data of the third format; A neural network operation method characterized by including a step of normalizing feature data of a third format.

12. An operation module that performs an activation operation on input data of the first format stored in an external memory to output data of the second format, extracts feature data from the data of the second format by a convolution operation, outputs data of the third format, and normalizes the feature data of the third format; and A neural network operation device characterized by including an internal memory for storing a second format of data generated by an activation operation.

Citation Information

Patent Citations

  • Deep neural network execution method, execution device, learning method, learning device, and program

    JP2020532777A

  • Life prediction system of combustion unit and life prediction method of combustion unit using pressure monitoring and total organic carbon analyzer equipped with this

    KR102671234B1

  • Compute near memory convolution accelerator

    US20200034148A1

  • Compute in memory-based machine learning accelerator architecture

    US20220414443A1