Convolutional neural network inference processing device and convolutional neural network inference processing method
The CNN model with residual layers addresses memory bandwidth issues by employing intermediate, inconsistent, and past layer data storage units, optimizing data management and processing to enhance performance.
Patent Information
- Application Number
- JP2023529430
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-06-25
- Publication Date
- 2024-09-18
- Estimated Expiration
- 2041-06-25
AI Technical Summary
The CNN model with residual layers faces challenges in reducing external memory bandwidth due to the need to transfer data for addition operations, which conventional Layer Fusion methods do not adequately address.
A convolutional neural network inference processing device and method that includes intermediate, inconsistent, and past layer data storage units, allowing for efficient data management and reduction of external memory bandwidth by processing in tiles and utilizing residual layers to add past layer data to intermediate results.
This approach effectively reduces external memory bandwidth by optimizing data storage and processing within the CNN model, particularly when incorporating residual layers, thereby enhancing processing performance.
Smart Images

Figure 0007552904000006 
Figure 0007552904000007 
Figure 0007552904000001
Abstract
Description
[Technical field]
[0001] The disclosed technology relates to a convolutional neural network inference processing device and a convolutional neural network inference processing method. [Background technology]
[0002] In recent years, research and development on convolutional neural network (CNN) inference processing has been actively conducted. In particular, research and development on CNN inference processing has been actively conducted in order to apply image recognition and object recognition using CNN to situations where real-time performance, power saving, and space saving are required, such as surveillance cameras and drones. In a CNN model that performs CNN inference processing, processing is generally performed for each layer of the model, and the processing results for each layer are saved to external memory. However, in the case of a CNN model in which the amount of output data for each layer is large, there is a problem that the external memory bandwidth is strained and this becomes a bottleneck in processing performance.
[0003] A CNN model includes multiple convolution layers, and a common method of CNN inference processing is to process the data on a layer-by-layer basis. In this method, when processing any layer, all input data is convoluted using a convolution filter, and then the processing of the next layer is started. Since the results of the convolution processing are used as input data for the next layer, all convolution processing results for each layer must be stored in memory. In CNN models, the amount of data for the convolution processing results is increasing in order to improve accuracy, and it is becoming difficult to store the amount of data for the processing results for each layer in internal memory. Therefore, a method is adopted in which the processing results for each layer are transferred to external memory and then read out again when processing the next layer. However, there is an upper limit to the external memory bandwidth, which can become a bottleneck in processing performance.
[0004] One method for reducing external memory bandwidth in CNN inference processing is the Layer Fusion method (Non-Patent Document 1). This method performs continuous processing in multiple layers in units of "tiles" obtained by dividing input data into grids. By performing processing in units of tiles, the amount of output data for each layer can be reduced to a level that can be stored in internal memory. This makes it possible to hold data that was transferred to external memory in internal memory, thereby reducing external memory bandwidth. [Prior art documents] [Non-patent literature]
[0005] [Non-Patent Document 1] Fabrizio Indirli et al., A Tile-based Fused-layer CNN Accelerator for FPGAs (2020 27th IEEE International Conference on Electronics, Circuits and Systems (ICECS)) Summary of the Invention [Problem to be solved by the invention]
[0006] Incidentally, a CNN model may be configured to include a residual layer in which a processing result (intermediate data) from a previous convolutional layer is added to the processing results from multiple consecutive convolutional layers.
[0007] However, in the configuration of the cited document 1, although a memory for storing output data in units of tiles is provided, a memory for storing data to be added in the residual layer is not provided. Therefore, when the Layer Fusion method is applied to a CNN model including a residual layer, the data to be added in the residual layer needs to be transferred to an external memory bandwidth, and the external memory bandwidth is not necessarily reduced.
[0008] The present disclosure has been made in consideration of the above circumstances, and aims to propose a convolutional neural network inference processing device and a convolutional neural network inference processing method that can reduce external memory bandwidth when the Layer Fusion method is applied to a CNN model including a residual layer. [Means for solving the problem]
[0009] A first aspect of the present disclosure is a convolutional neural network inference processing device that performs processing in a convolutional neural network including a plurality of convolutional layers and a residual layer that adds intermediate data related to the plurality of convolutional layers as an addition target to a processing result by the plurality of convolutional layers, for each tile that is data obtained by dividing input data into a predetermined size, and that includes an intermediate data storage unit that stores the intermediate data, an inconsistent data storage unit that stores inconsistent data that is data at a location where the processing result and the intermediate data are inconsistent, a past layer data storage unit that stores past layer data that is an addition target in the residual layer that is generated using the inconsistent data related to the tile on which processing was previously performed and the intermediate data, and a processing unit that performs processing by the plurality of convolutional layers and processing by the residual layer that adds the past layer data to the processing result.
[0010] A second aspect of the present disclosure is a convolutional neural network inference processing method that performs processing in a convolutional neural network including a plurality of convolutional layers and a residual layer that adds intermediate data related to the plurality of convolutional layers as an addition target to a processing result by the plurality of convolutional layers, for each tile that is data obtained by dividing input data into a predetermined size, the convolutional neural network inference processing method storing the intermediate data, storing inconsistent data that is data at a location where the processing result and the intermediate data are inconsistent, storing past layer data that is an addition target in the residual layer that is generated using the inconsistent data related to a tile for which processing was previously performed and the intermediate data, and performing processing by the plurality of convolutional layers and processing by the residual layer that adds the past layer data to the processing result. Effect of the Invention
[0011] According to the disclosed technology, when the Layer Fusion method is applied to a CNN model including a residual layer, it is possible to reduce external memory bandwidth. [Brief description of the drawings]
[0012] [Figure 1] FIG. 2 is a schematic diagram illustrating an example of a neural network according to each embodiment. [Diagram 2] FIG. 11 is a schematic diagram illustrating an example of processing in a Layer Fusion method using a CNN including a residual layer according to each embodiment. [Diagram 3] 10A to 10C are schematic diagrams illustrating an example of input data provided for explaining divided tiles according to each embodiment. [Figure 4] FIG. 2 is a block diagram showing a hardware configuration of a convolutional neural network inference processing device according to each embodiment. [Diagram 5] FIG. 1 is a block diagram showing an example of a functional configuration of a convolutional neural network inference processing device 10 according to a first embodiment. [Figure 6]FIG. 1 is a schematic diagram showing an example of a data flow in a process executed by a convolutional neural network according to each embodiment. [Figure 7] 11 is a flowchart illustrating an example of an inference process according to each embodiment. [Figure 8] FIG. 11 is a block diagram showing an example of a functional configuration of a convolutional neural network inference processing device 10 according to a second embodiment. [Figure 9] FIG. 13 is a block diagram illustrating an example of processing in multiple integration layers according to each embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings.
[0014] [First embodiment] First, with reference to Figs. 1 to 3, the processing of a Convolutional Neural Network (CNN) (hereinafter, referred to as "CNN") including a residual layer to which the Layer Fusion method is applied will be described. Fig. 1 is a schematic diagram showing an example of a neural network according to this embodiment. In the following, performing a convolution process with a filter of N pixels x N pixels will be referred to as "N x N convolution process". In addition, in the convolution process according to this embodiment, the filter is slid one slide at a time to perform the convolution. In addition, in this embodiment, N pixels x N pixels will be referred to as "N x N".
[0015] 1, a neural network 100 is configured with a plurality of layers, such as an input layer, an intermediate layer (hidden layer), and an output layer, each of which is made up of nodes 101 that perform processing. In the neural network 100, the nodes 101 in each layer are connected by edges 102, and data processed by each node 101 is propagated in the order of the input layer, intermediate layer, and output layer for processing.
[0016] The CNN according to this embodiment includes a convolution layer and a residual layer in the intermediate layer, processes image data input as input data by the Layer Fusion method, and outputs output data. Here, the Layer Fusion method divides the input data into blocks of a predetermined size (hereinafter, referred to as "tiles"), and continuously executes processing up to a predetermined layer for each tile.
[0017] A normal CNN divides input data into tiles, and when processing of all tiles in one layer is completed, it moves to the next layer and executes processing. On the other hand, a Layer Fusion CNN divides input data into tiles, and in one tile, it executes processing of multiple layers consecutively. It differs from normal CNN processing in that it executes processing for each tile, so that when processing of a predetermined layer is completed, processing of multiple layers is executed for the next tile.
[0018] The residual layer is a layer that adds the addition target to the processing result by the convolution layer. The residual layer adds data input to one convolution layer located upstream among multiple convolution layers, or data processed by one convolution layer located upstream, as the addition target. By adding data processed by a convolution layer located upstream to the processing result, in the consecutive layers, the feature amount obtained upstream is transmitted as it is downstream, and deterioration of the feature amount due to repeated execution of the convolution processing is suppressed. Note that, the residual layer according to this embodiment will be described in a form in which data generated using data processed by one convolution layer among multiple convolution layers is added as the addition target.
[0019] FIG. 2 is a schematic diagram showing an example of processing of the Layer Fusion method by the CNN including a residual layer according to the present embodiment.
[0020] As shown in FIG. 2, the Layer Fusion CNN according to this embodiment performs 1×1 convolution processing in the convolution layer A for the divided tile 1 as processing A, and then performs 3×3 convolution processing in the convolution layer B. After performing a plurality of convolution processing as processing A, the residual layer adds the processing result of the convolution layer A (hereinafter referred to as "intermediate data") to the processing result of the convolution layer B, and transmits and outputs the result as output data to an external memory. When processing A in tile 1 is completed, processing B in tile 2, processing C in tile 3, and processing D in tile 4 are similarly performed in sequence. In this embodiment, a layer that performs a series of processing from the convolution layer A to the residual layer is called an "integration layer". In this embodiment, a form will be described in which the residual layer in the integration layer adds an addition target generated from intermediate data processed by the convolution layer A to the processing result of the convolution layer B belonging to the integration layer.
[0021] As an example of tiles according to the present embodiment, 24×24 input data divided into 8×8 pieces of data is described as one tile, as shown in Fig. 3. In the present embodiment, the order of tiles processed is described as tiles 1 to 9, proceeding from left to right and from top to bottom with tile 1 located at the top left of the input data shown in Fig. 3 as the base point.
[0022] Next, the hardware configuration of the convolutional neural network inference processing device 10 according to this embodiment will be described with reference to Fig. 4. Fig. 4 is a block diagram showing the hardware configuration of the convolutional neural network inference processing device 10 according to this embodiment.
[0023] 4, the convolutional neural network inference processing device 10 includes a CPU (Central Processing Unit) 11, a ROM (Read Only Memory) 12, a RAM (Random Access Memory) 13, a storage 14, an input unit 15, a display unit 16, and a communication interface (I / F) 17. Each component is connected to each other via a bus 18 so as to be able to communicate with each other.
[0024] The CPU 11 is a central processing unit, and executes various programs and controls each part. That is, the CPU 11 reads a program from the ROM 12 or the storage 14, and executes the program using the RAM 13 as a working area. The CPU 11 controls each of the above components and performs various arithmetic processing according to the program stored in the ROM 12 or the storage 14. In this embodiment, an inference processing program for executing processing by CNN is stored in the ROM 12 or the storage 14.
[0025] The ROM 12 stores various programs and various data. The RAM 13 temporarily stores programs or data as a working area. The storage 14 is configured with a storage device such as an HDD (Hard Disk Drive) or an SSD (Solid State Drive), and stores various programs including an operating system, and various data.
[0026] The input unit 15 includes a pointing device such as a mouse, and a keyboard, and is used to perform various input operations.
[0027] The display unit 16 is, for example, a liquid crystal display, and displays various information. The display unit 16 may function as the input unit 15 by adopting a touch panel system.
[0028] The communication interface 17 is an interface for communicating with other devices such as a display device. For this communication, for example, a wired communication standard such as Ethernet (registered trademark) or FDDI, or a wireless communication standard such as 4G, 5G, or Wi-Fi (registered trademark) is used. The communication interface 17 obtains input data from an external memory and transmits output data to the external memory.
[0029] Next, the functional configuration of the convolutional neural network inference processing device 10 will be described with reference to Fig. 5. Fig. 5 is a block diagram showing an example of the functional configuration of the convolutional neural network inference processing device 10 according to this embodiment.
[0030] 5, the convolutional neural network inference processing device 10 includes, as functional components, an acquisition unit 21, a processing unit 22, an output unit 23, and a storage unit 24. The CPU 11 executes an inference processing program to function as the acquisition unit 21, the processing unit 22, the output unit 23, and the storage unit 24. The storage unit 24 includes an intermediate data storage unit 25, an inconsistent data storage unit 26, a past layer data storage unit 27, and an excess data storage unit 28.
[0031] The acquisition unit 21 acquires input data for executing processing by the integration layer from an external memory (not shown).
[0032] The processing unit 22 executes processing of each layer related to CNN including a convolution layer and a residual layer. Here, the processing unit 22 divides the input data acquired by the acquisition unit 21 into tiles, which are data of a predetermined size, and executes processing of each layer related to CNN for each tile. For example, the processing unit 22 divides image data into 8×8 tiles as shown in FIG. 3.
[0033] The output unit 23 outputs the results of the processing performed by the processing unit 22 to an external memory (not shown).
[0034] The storage unit 24 stores each piece of data processed by the processing unit 22 in an intermediate data storage unit 25, an inconsistent data storage unit 26, a past layer data storage unit 27, and an extra data storage unit .
[0035] The intermediate data storage unit 25 is used to store intermediate data processed by a convolutional layer in the processing unit 22 and to pass data from one convolutional layer to another. For example, the intermediate data storage unit 25 stores intermediate data processed by the convolutional layer A shown in Fig. 2. When storing intermediate data processed by the next convolutional layer (for example, the convolutional layer B shown in Fig. 2), the intermediate data storage unit 25 erases the stored data and stores the currently processed intermediate data.
[0036] The inconsistent data storage unit 26 stores data of a portion where there is inconsistency between the processing result by the multiple convolution layers and the intermediate data. For example, the processing result of 7×7 processed by the multiple convolution layers and the intermediate data of 8×8 processed by the convolution layer A shown in FIG. 2 have different dimensions, and an inconsistency occurs. The inconsistent data storage unit 26 stores data of a portion (for example, the right end and the bottom end of the intermediate data) of the 8×8 intermediate data that is inconsistent with the processing result of 7×7. Note that the inconsistent data is used when generating past layer data, which will be described later, in tiles that will be processed later, and the used inconsistent data is erased from the inconsistent data storage unit 26.
[0037] The past layer data storage unit uses inconsistent data in tiles previously processed and intermediate data in the currently processed tile to store past layer data to be added in the residual layer. For example, if there is inconsistent data related to a tile adjacent to the currently processed tile, the past layer data storage unit 27 uses the inconsistent data and the intermediate data of the currently processed tile to generate and store 7×7 past layer data. The past layer data is used as the addition target in the residual layer, and the used past layer data is erased from the past layer data storage unit 27.
[0038] The margin data storage unit 28 stores data of the intermediate data of the currently processed tile at the locations adjacent to unprocessed tiles to be processed thereafter (the right end and bottom end of the intermediate data). Here, the convolution layer B according to this embodiment extends the dimension of the 8×8 intermediate data to a dimension of 9×9 and executes the convolution process. When executing the process by the convolution layer B, if there is margin data of a tile that is adjacent to the currently processed tile and has been processed in the past, the processing unit 22 extends the intermediate data using the margin data. Note that the used margin data is deleted from the margin data storage unit 28.
[0039] Next, each data stored in the storage unit 24 will be described with reference to Fig. 6. Fig. 6 is a schematic diagram showing an example of a data flow in the process executed by the convolutional neural network according to the present embodiment. Note that in the present embodiment, as an example, a data flow when processing tile 2 shown in Fig. 3 as input data will be described.
[0040] 6, when an 8×8 tile 2 is input, the processing unit 22 executes processing by the convolutional layer A and outputs 8×8 intermediate data. Here, the storage unit 24 stores the intermediate data in the intermediate data storage unit 25 until it is input to the next convolutional layer B.
[0041] The storage unit 24 generates past layer data using the intermediate data for tile 2 currently being processed and the inconsistent data for tile 1 (the inconsistent data for tile 1 that was previously processed), and stores the data in the past layer data storage unit 27. Here, the storage unit 24 considers the arrangement of adjacent tiles and combines the inconsistent data corresponding to the portion of tile 1 that contacted tile 2 (the right end of tile 1) with the left end of the intermediate data for tile 2 to generate 7×7 past layer data, and stores the data in the past layer data storage unit 27.
[0042] Furthermore, the storage unit 24 stores the intermediate data in tile 2 that was not used when the previous layer data was generated, and the inconsistent data in tile 1, in the inconsistent data storage unit 26. In this way, by storing the intermediate data of adjacent tiles as inconsistent data, it is possible to reflect the characteristics of the boundary portion generated by dividing the tile in the residual layer described later. Furthermore, since the inconsistent data is intermediate data when processing is performed by the convolution layer A, there is no need to re-execute the 1×1 convolution processing in the boundary portion, and the amount of processing is reduced.
[0043] Meanwhile, the processing unit 22 executes the process of the next convolutional layer B. When executing the process of the convolutional layer B, the processing unit 22 extends the intermediate data of tile 2 stored in the intermediate data storage unit 25 by using the margin data of tile 1 stored in the margin data storage unit 28. Here, the processing unit 22 considers the arrangement of the adjacent tiles, combines the margin data corresponding to the portion of tile 1 that contacted tile 2 (the right end of tile 1) with the left end of the intermediate data of tile 2, generates 9×9 intermediate data, and executes the convolution process. Since there is no tile adjacent to the upper end of tile 2, the upper end of tile 2 is extended by zero padding. In other words, in any tile, if there is margin data of a tile that has been processed in the past and is adjacent to the currently processed tile, the margin data is used to extend the intermediate data. In this way, by combining the margin data of adjacent tiles and executing the convolution process, it is possible to extract the features of the boundary portion generated by the division into tiles. In addition, since the margin data is data that has already undergone 1×1 convolution processing, there is no need to re-execute 1×1 convolution processing at the boundary portion, and the amount of processing is reduced.
[0044] When processing by the convolutional layer B is performed by the processing unit 22, the memory unit 24 stores data corresponding to the right end and bottom end of the intermediate data and the margin data memory unit 28, and stores unused margin data in the margin data memory unit 28.
[0045] Processing unit 22 executes 3×3 convolution processing on the expanded 9×9 intermediate data, and outputs 7×7 processing result data. As processing by the residual layer, processing unit 22 adds the past layer data stored in past layer data storage unit 27 as the addition target to the 7×7 processing result data, and outputs the addition result to output unit 23 as the processing result of the integrated layer.
[0046] Next, the operation of the convolutional neural network inference processing device 10 according to this embodiment will be described with reference to Fig. 7. Fig. 7 is a flowchart showing an example of the inference processing according to this embodiment. The inference processing program shown in Fig. 7 is executed by the CPU 11 reading out the inference processing program from the ROM 12 or the storage 14 and executing it. The inference processing program shown in Fig. 7 is executed, for example, when image data is input as input data and an instruction to execute the inference processing is input. The output unit 23 outputs the processing result of the integration layer to an external memory.
[0047] In step S101, the CPU 11 obtains input data.
[0048] In step S102, the CPU 11 divides the input data into predetermined tiles.
[0049] In step S103, the CPU 11 executes a 1×1 convolution process.
[0050] In step S104, the CPU 11 obtains and stores intermediate data as a processing result of the 1×1 convolution processing.
[0051] In step S105, the CPU 11 generates and stores past layer data using the inconsistent data in tiles previously processed and the intermediate data in the tile currently being processed.
[0052] In step S106, the CPU 11 stores the margin data, the inconsistent data, and the past layer data. Here, the margin data stored in the margin data storage unit 28 and unused margin data and data adjacent to unprocessed tiles in the intermediate data are stored as margin data. In addition, the inconsistent data stored in the inconsistent data storage unit 26 and unused as past layer data and data not used as past layer data in the intermediate data are stored as inconsistent data.
[0053] In step S107, the CPU 11 extends the intermediate data by using the margin data of the past tiles stored in the margin data storage unit 28. Here, if there is no margin data of a tile that has been processed in the past and is adjacent to the currently processed tile, the intermediate data is extended by zero padding.
[0054] In step S108, the CPU 11 executes a 3×3 convolution process using the expanded intermediate data.
[0055] In step S109, the CPU 11 obtains the processing result of the 3×3 convolution processing.
[0056] In step S110, the CPU 11 adds the past layer data stored in the past layer data storage unit 27 to the acquired processing result.
[0057] In step S111, the CPU 11 outputs the result of the addition to the external memory as the output result of the integration layer.
[0058] In step S112, the CPU 11 determines whether or not there is a next tile. If there is no next tile (step S112: YES), the CPU 11 proceeds to step S114. On the other hand, if there is a next tile (step S112: NO), the CPU 11 proceeds to step S113.
[0059] In step S113, the CPU 11 obtains the data of the next tile, and the process proceeds to step S103.
[0060] In step S114, the CPU 11 determines whether or not the processing of all the integrated layers has been performed. If the processing of all the integrated layers has been performed (step S114: YES), the CPU 11 ends the processing. On the other hand, if the processing of all the integrated layers has not been performed (step S114: NO), the CPU 11 proceeds to step S115.
[0061] In step S115, the CPU 11 proceeds to the next integrated layer, and then proceeds to step S101.
[0062] As described above, according to the present embodiment, a Layer is added to a CNN model including a residual layer. When the fusion method is applied, the external memory bandwidth can be reduced.
[0063] [Second embodiment] In the first embodiment, a configuration has been described in which processing in an integration layer (convolutional layer and residual layer) is performed using a single processing unit 22 and storage unit 24. In the present embodiment, a configuration in which a processing unit 22 and a storage unit 24 (hereinafter referred to as a "processing unit") are respectively assigned to each layer in the integration layer will be described with reference to Fig. 8.
[0064] Note that the diagram showing an example of a neural network (see FIG. 1), the diagram showing an example of a CNN including a residual layer in the Layer Fusion method (see FIG. 2), and the diagram showing an example of input data for explaining tiles (see FIG. 3) are the same as those in the first embodiment, and therefore their explanations will be omitted. Also, the diagram showing the hardware configuration of the convolutional neural network inference processing device 10 (see FIG. 4), the diagram showing an example of the data flow in the CNN (see FIG. 6), and the diagram showing an example of the process executed by the CNN (see FIG. 7) are the same as those in the first embodiment, and therefore their explanations will be omitted.
[0065] FIG. 8 is a block diagram showing an example of a functional configuration of the convolutional neural network inference processing device 10 according to the present embodiment. As shown in FIG. 8 as an example, the convolutional neural network inference processing device 10 includes an acquisition unit 21, a processing unit 22A, a processing unit 22B, an output unit 23, a storage unit 24A, a storage unit 24B, and a storage unit 24C. For example, the convolutional layer is assigned with the processing unit 22A and the storage unit 24A as processing units, and the storage unit 24A includes the intermediate data storage unit 25A and the marginal data storage unit 28A. The residual layer is assigned with the processing unit 22B and the storage unit 24B as processing units, and the storage unit 24B includes the intermediate data storage unit 25B and the marginal data storage unit 28B. The storage unit 24C can be shared and used by each layer in the integration layer, and the storage unit 24C includes the inconsistent data storage unit 26 and the past layer data storage unit 27.
[0066] As shown in FIG. 8, a processing unit is assigned to each of the convolutional layer and the residual layer, and thus the source of input data is determined in advance in each layer of the integrated layer. Therefore, when each layer executes processing, it is not necessary to search for input data, and the throughput of data transfer between each layer is improved. Also, as shown in FIG. 8, the storage unit 27B assigned to the residual layer is connected to the convolutional layer. Therefore, the processing result by the residual layer can be input to the convolutional layer, and the processing in the integrated layer can be executed continuously. Also, as shown in FIG. 8, the processing unit 22A in each convolutional layer is connected to the storage unit 24A and the external memory, respectively. Therefore, the processing unit 22A is configured to be able to select the output destination of the processing result from the external memory and the storage unit 24A. Therefore, the processing unit 22A can select the external memory or the storage unit 24A to output the processing result of any convolutional layer in the integrated layer including multiple convolutional layers.
[0067] As described above, the convolutional neural network inference processing device 10 of the second embodiment assigns a processing unit to each layer in the integration layer, and each layer performs processing to execute the processing as the integration layer. This improves the throughput of data transfer for each layer in the integration layer. Furthermore, even if the number of layers belonging to the integration layer is smaller than the number of processing units, it is possible to execute the processing of each layer in the integration layer and output the processing result to an external memory.
[0068] In the above embodiment, the integrated layer is configured by a convolutional layer A that performs 1×1 convolutional processing, a convolutional layer B that performs 3×3 convolutional processing, and a residual layer. However, the present invention is not limited to this. For example, the integrated layer may be configured by a single convolutional layer and a residual layer, or may be configured by three or more convolutional layers and a residual layer.
[0069] In the above embodiment, when the processing of one integrated layer is executed, the processing result is output to an external memory. However, this is not limited to this. When the processing of multiple integrated layers is executed, the processing result may be output to an external memory. For example, as shown in FIG. 9, multiple integrated layers may be combined and the processing result of one integrated layer may be input to the next integrated layer, thereby executing the processing of multiple integrated layers consecutively. When the processing of multiple integrated layers is executed consecutively, the residual layer included in the integrated layer adds past layer data generated from intermediate data by the convolution layer belonging to the same integrated layer to the processing result by the multiple convolution layers belonging to the same integrated layer as the addition target. This suppresses the occurrence of inconsistency by adding data by different integrated layers.
[0070] In the above embodiment, the past layer data is described as 7×7 data. However, the present invention is not limited to this. The past layer data may be changed according to the processing results of the multiple convolution layers. For example, if the processing results of the multiple convolution layers are 10×10 data, the past layer data becomes 10×10 data. In other words, the past layer data may be of any size as long as it corresponds to the size of the data of the processing results of the multiple convolution layers.
[0071] In addition, the inference process executed by the CPU by reading the software (program) in each of the above embodiments may be executed by various processors other than the CPU. In this case, examples of the processor include a PLD (Programmable Logic Device) such as an FPGA (Field-Programmable Gate Array) whose circuit configuration can be changed after manufacture, and a dedicated electric circuit such as an ASIC (Application Specific Integrated Circuit) which is a processor having a circuit configuration designed exclusively for executing a specific process. In addition, the inference process may be executed by one of these various processors, or may be executed by a combination of two or more processors of the same or different types (for example, a plurality of FPGAs, a combination of a CPU and an FPGA, etc.). In addition, the hardware structure of these various processors is, more specifically, an electric circuit that combines circuit elements such as semiconductor elements.
[0072] In addition, in each of the above embodiments, the inference processing program is pre-stored (installed) in the storage 14, but the present invention is not limited to this. The program may be provided in a form stored in a non-transitory storage medium such as a CD-ROM (Compact Disk Read Only Memory), a DVD-ROM (Digital Versatile Disk Read Only Memory), or a USB (Universal Serial Bus) memory. The program may also be downloaded from an external device via a network.
[0073] The following supplementary notes are further disclosed regarding the above embodiment.
[0074] (Additional note 1) Memory, at least one processor coupled to the memory; Including, The processor, A convolutional neural network inference processing device that executes processing in a convolutional neural network including a plurality of convolutional layers and a residual layer that adds intermediate data related to the plurality of convolutional layers as an addition target to a processing result by the plurality of convolutional layers, for each tile that is data obtained by dividing input data into a predetermined size, storing the intermediate data; storing inconsistent data which is data at a location where the processing result and the intermediate data are inconsistent; Store previous layer data to be added in the residual layer generated using the inconsistent data related to the tile on which processing was previously performed and the intermediate data; Executing a process using the plurality of convolution layers and a process using a residual layer that adds the past layer data to the process result; 1. A convolutional neural network inference processing device comprising:
[0075] (Additional note 2) A non-transitory storage medium storing a program executable by a computer to execute processing in a convolutional neural network including a plurality of convolutional layers and a residual layer that adds intermediate data related to the plurality of convolutional layers as an addition target to a processing result by the plurality of convolutional layers, for each tile that is data obtained by dividing input data into a predetermined size, The process in a convolutional neural network is as follows: storing the intermediate data; storing inconsistent data which is data at a location where the processing result and the intermediate data are inconsistent; Store previous layer data to be added in the residual layer generated using the inconsistent data related to the tile on which processing was previously performed and the intermediate data; Executing a process using the plurality of convolution layers and a process using a residual layer that adds the past layer data to the process result; Non-transitory storage medium. [Explanation of symbols]
[0076] 10 Neural network inference processing unit 22, 22A, 22B Processing section 24, 24A, 24B, 24C storage section 25, 25A, 25B Intermediate data storage section 26 Inconsistent Data Storage Unit 27 Past layer data storage section 28, 28A, 28B Extra data storage section 100 Neural Networks
Claims
1. A convolutional neural network inference processing device that executes processing in a convolutional neural network including a plurality of convolutional layers and a residual layer that adds intermediate data related to the plurality of convolutional layers as an addition target to a processing result by the plurality of convolutional layers, for each tile that is data obtained by dividing input data into a predetermined size, an intermediate data storage unit that stores the intermediate data; an inconsistent data storage unit that stores inconsistent data that is data at a location where the processing result and the intermediate data are inconsistent; A past layer data storage unit that stores past layer data to be added in a residual layer generated using the inconsistent data related to the tile on which processing was previously performed and the intermediate data; A processing unit that executes processing by the plurality of convolution layers and processing by the residual layer that adds the past layer data to the processing result; A convolutional neural network inference processing device comprising:
2. a margin data storage unit that stores data of a portion of the intermediate data that contacts an adjacent tile as margin data; The processing unit combines the intermediate data with the margin data stored in the margin data storage unit, and executes processing by the convolutional layers related to the plurality of convolutional layers.
2. The convolutional neural network inference processing apparatus according to claim 1.
3. The processing unit extends the dimension of the intermediate data by combining the marginal data with the intermediate data, and executes the processing by the convolution layer.
3. The convolutional neural network inference processing apparatus according to claim 2.
4. Each of the plurality of convolution layers and residual layers is assigned a corresponding one of the processing units, the intermediate data storage unit, and the marginal data storage unit; The processing unit executes processing by each of the convolutional layers and the residual layer using intermediate data stored in the predetermined intermediate data storage unit and marginal data stored in the marginal data storage unit.
4. A convolutional neural network inference processing device according to claim 2 or 3.
5. The processing unit is further connected to an external memory, and the processing result can be output to the external memory or the intermediate data storage unit.
5. The convolutional neural network inference processing apparatus according to claim 4.
6. The past layer data storage unit combines the inconsistent data related to the adjacent tiles on which processing was previously performed and the intermediate data, and stores the combined data as the past layer data. A convolutional neural network inference processing device according to any one of claims 1 to 5.
7. The neural network configures a layer that executes a series of processes in the plurality of successive convolution layers and the residual layer as an integration layer; The processing unit executes a process of adding the past layer data generated using the intermediate data related to the integrated layer to the processing result related to the integrated layer in an integrated layer to which the residual layer belongs. A convolutional neural network inference processing device according to any one of claims 1 to 6.
8. A convolutional neural network inference processing method, comprising: a convolutional neural network including a plurality of convolutional layers; and a residual layer that adds intermediate data related to the plurality of convolutional layers as an addition target to a processing result by the plurality of convolutional layers, the processing being performed for each tile that is data obtained by dividing input data into a predetermined size, the method comprising: storing the intermediate data; storing inconsistent data which is data at a location where the processing result and the intermediate data are inconsistent; storing past layer data to be added in a residual layer generated using the inconsistent data relating to tiles previously processed and the intermediate data; Executing a process using the plurality of convolution layers and a process using a residual layer that adds the past layer data to the process result; Convolutional neural network inference processing method.
Citation Information
Patent Citations
Hardware implementation of a neural network
EP3832649A1
Neural network engine with tile-based execution
US20190220742A1
