Data reuse and operation hardware accelerator for convolutional neural network reasoning

By designing data reuse and computing hardware accelerators for convolutional neural networks, we solve the problem of convolutional neural network computing complexity and hardware resource matching, achieve efficient convolutional computing acceleration, and meet the needs of high computing power and low power consumption. requirements, suitable for edge computing scenarios.

CN118734901APending Publication Date: 2024-10-01FUDAN UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410270299.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-11
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The parameter amount and computational complexity of convolutional neural networks have grown rapidly, making it difficult for hardware systems to meet high computing power and high bandwidth requirements. Especially in edge computing applications, it is difficult to deploy neural network algorithms with high computing power and low power consumption on existing hardware. .

Method used

Design a data reuse and computing hardware accelerator for convolutional neural network inference, including arithmetic unit array, on-chip data distribution network, row buffer, accumulation and buffering and related read and write control logic, capable of performing 2D convolution, convolution Product and depth separable convolution operators are used to reduce computing power consumption and bandwidth requirements through multi-level buffering and data reuse technology.

Benefits of technology

It achieves high computing throughput, low power consumption, and flexible scalability for convolutional neural network hardware acceleration operations to meet the needs of different deep neural network systems, reduces the number of hardware accesses to external storage, and reduces bus occupancy and reading and writing. Memory power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734901A_ABST
    Figure CN118734901A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of integrated circuits, and particularly relates to a data reuse and operation hardware accelerator for convolutional neural network reasoning. The circuit comprises an arithmetic unit array, an on-chip data distribution network and an on-chip data collection network, and is used for inputting a row buffer of a middle cache of a feature map and related read-write control logic, and accumulating and buffering an output part and the cache and related read-write control logic. According to the accelerator, time dimension reuse of weight data, time-space dimension reuse of an input feature map and time dimension reuse of an output feature map are realized by adopting a multi-stage cache and an efficient data stream, so that the data handling demand and operation power consumption of convolution operation are reduced. According to the accelerator, flexible arithmetic unit array design is adopted, convolution operation of multiple convolution operators and multiple hyper-parameters is achieved in a reconfigurable mode, and good expansibility is achieved. The accelerator adopts an on-chip cache strategy, so that off-chip data interaction can be reduced, and the bandwidth pressure of a system bus is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of integrated circuit design, and in particular relates to a data reuse and operation hardware accelerator for convolutional neural network reasoning. Background Art

[0002] With the digitization, automation and intelligence of modern technology, artificial intelligence algorithms with deep learning as the main approach are developing rapidly. In the fields of intelligent security, intelligent driving, image processing, natural language processing, etc., deep learning algorithms have demonstrated extremely high computing accuracy and excellent portability. Nowadays, convolution operations have become a common operator for most deep neural network algorithms. Therefore, optimizing this operator can greatly improve the computing performance of the entire deep neural network.

[0003] Compared with other neural networks, convolutional neural networks have higher implementation performance, lower deployment difficulty, and better interpretability in many tasks. However, in recent years, researchers' requirements for higher precision and higher intelligence have caused the number of parameters and computational complexity of convolutional neural networks to grow rapidly. The iteration speed of the network has far exceeded the update speed of the execution hardware, and the hardware systems in edge computing application scenarios such as intelligent driving are difficult to equip with high-power and high-priced graphics processors, resulting in neural network algorithms with high computing power and bandwidth requirements. It is difficult to deploy on conventional hardware. Therefore, it is necessary to propose a dedicated hardware architecture for convolutional neural network operations to meet the high computing power requirements of convolutional neural networks while achieving high energy efficiency. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to propose a data reuse and computing hardware accelerator for convolutional neural network reasoning, in order to achieve high computing throughput, high energy efficiency ratio, low power consumption, flexible and scalable convolutional neural network hardware acceleration computing, and the acceleration hardware can be widely used in computer vision, natural language processing and other fields that use convolutional neural network algorithms.

[0005] The data reuse and computing hardware accelerator for convolutional neural network reasoning provided by the present invention includes a computing unit and an array formed by the computing unit, an on-chip data distribution network and a collection network, a row buffer for inputting a feature map intermediate cache and a related first read-write control logic, and an accumulation and buffer for outputting a part and a cache and a related second read-write control logic; wherein:

[0006] The hardware accelerator of the present invention is used to execute 2D convolution operators, group convolution operators, depth-separable convolution operators and variant convolution operators with similar computational behaviors. To avoid confusion, the parameters in the convolution calculation are defined as follows: the input feature map size is defined as Hi×Wi, and the number of input channels is defined as IC; the weight kernel size is defined as Kh×Kw, the weight input channel is defined as IC (equal to the feature map input channel), and the number of weight kernels is defined as OC; the output feature map size is defined as Ho×Wo, and the number of feature map output channels is defined as OC (equal to the number of weight kernels); during the block operation process, each row of the operation unit array calculates the partial sum of TIC input channels, and each column calculates the partial sum of TOC output channels.

[0007] The first read-write control logic is responsible for caching the input feature map in the convolution operation. The position of the row buffer in the entire hardware architecture is between the on-chip or off-chip memory and the on-chip data distribution network. In the process of the operation unit array loading the input feature map, the pixel values ​​in the input feature map are loaded into the row buffer for storage, and then the pixel values ​​are output to the on-chip data distribution network, and then used for the convolution calculation input of the operation unit array; the row buffer size is TIC×(Kh×Wi), which means: the pixel values ​​in each Kh adjacent rows of TIC adjacent input channels in the input feature map are cached, and each row has Wi pixel values.

[0008] The on-chip distribution network is responsible for sorting the output data of the row buffer, and then distributing the input feature map to the operation unit array according to the rules. In the operation stage of the current block, while the input feature map is loaded into the row buffer, the row buffer outputs TIC×Kh values ​​to the on-chip distribution network. The input data is TIC input channels, and the Kh row and 1 column pixel values ​​in the feature map of each input channel. The on-chip distribution network reorders the output data of the row buffer so that the data obtained by each operation unit in a single cycle comes from each input channel, and then outputs it to the operation unit array in a broadcast form.

[0009] The operation unit array is responsible for the multiplication and accumulation operation of the convolution operation. The operation unit is an addition tree structure, each leaf node is a multiplier, and there are TIC multipliers in total. The operation unit array is composed of Hn×Wn operation units, where Hn=Kh, Wn=Kw×TOC, and can perform multiplication and accumulation operations of Kh×Kw convolution sliding windows in TIC input channels and TOC output channels per cycle. The entire operation unit array maintains 2×(TIC×TOC×(Kh×Kw)) weight registers, which are responsible for storing weight data pre-fetched from the on-chip distribution network. The actual hardware of the weight register includes 2 sets of current working and shadow, which operate in a ping-pong buffer mode to achieve: pre-fetching the input weight of the next subsequent block operation (completed in the shadow weight register) and supplying the input weight of the current block operation to the operation unit array (completed in the current working weight register) can be performed independently. Each operation unit receives the input feature map from the on-chip distribution network and the input weight from the weight register in each cycle, performs multiplication and accumulation to generate partial sums, and the partial sums are accumulated through the subsequent addition tree, and then accumulated with the partial sum output from the operation unit in the previous row, and then output from the operation unit to the operation unit in the next row. The operation unit array shares the input feature map data in the row direction, and passes the partial sum of the current row to the next row in the column direction by accumulation.

[0010] The on-chip collection network is responsible for correctly aggregating the partial sum outputs of each column in the operation unit array and writing the output partial sums. After the operation unit array completes the multiplication and accumulation operations on the weights and the input feature map, the generated partial sums of each Kw column will be accumulated downward and output from the operation unit array, and finally pass through the on-chip collection network to generate a partial sum of a Kh×Kw convolution sliding window. The input of the on-chip collection network is grouped into Kw columns, and partial sums are collected in the form of pulsating accumulation. The on-chip collection network implements the partial sum gating logic to ensure that the accumulation logic at the start and end stages of the convolution operation is correct. After the accumulation of the on-chip collection network is completed, the output partial sum is added to the accumulated partial sum in the accumulation buffer, and the result is saved back to the accumulation buffer.

[0011] The second read-write control logic is responsible for storing the cumulative sum corresponding to the pixel value of the output feature map. Each cycle of the operation unit array operation will output a part of the cumulative sum, and the pixel value of each output feature map needs to accumulate the results of the multi-cycle operation unit array calculation. Before this process is completed, the cumulative sum buffer will temporarily store part of the cumulative sum, and give valid data and related signals when the accumulation of all block operation results corresponding to the output feature map is completed, and output the results to on-chip or off-chip storage.

[0012] In a neural network, a convolution operation at a certain layer is sequentially split into multiple block operations, and each block operation is independent of each other. The process of inputting feature maps and weights into the hardware, performing multiplication and accumulation operations on the arithmetic unit array, and outputting feature maps to the hardware is all implemented in this order.

[0013] Furthermore, in a convolution operation, the processing flow of the hardware accelerator is as follows:

[0014] (1) Preloading process: weights are loaded from weight memory to weight registers in the arithmetic unit array. At the same time, input feature map loading is started, and input feature maps are transferred from memory to row buffer.

[0015] (2) The first row operation process, when the row buffer is fully filled for the first time and the weight register is fully filled for the first time, the calculation of the operation unit array is started. At this time, the input data in the row buffer enters the operation unit array through the on-chip distribution network and performs multiplication and accumulation operations with the weights in the weight register. At this stage, the current working weight register is filled, and the filling process of the shadow weight register used for the next block operation can be started at the same time.

[0016] Each cycle of the row buffer inputs a column of the operation unit array, and the input feature map is supplied regularly cycle by cycle. At the same time, the partial sum in the operation unit array is accumulated to the on-chip collection network connected to the operation unit at the bottom of each column, and is added to the original cumulative sum in the cumulative sum buffer, and finally stored back in the cumulative sum buffer.

[0017] (3) Operation process: When each column of the row buffer is completely consumed, the TIC row in the row buffer used to store the input feature map corresponding to the oldest row label will not be used in subsequent convolution operations. A new row of input feature maps is transferred from the memory to the TIC row corresponding to the oldest row label in the row buffer. At the same time, the input feature map will bypass the on-chip distribution network and then be transferred to the operation unit array as the input required for the convolution operation of the next row of output feature maps. The process is repeated until the TIC row is refilled, at which time the polling of each column of the row buffer has been completed again. Repeat process (3) until the row dimension of the input feature map in this block operation has been completely traversed, and a block operation is completed.

[0018] After the operation of this block is completed, the operation of the next block is changed. Repeat the process (1), (2), and (3). When a block operation corresponds to the last group of input channels of a certain output channel, after the operation is completed and part or all of it is accumulated into the cumulative sum buffer, the buffer in the cumulative sum is stored in the on-chip or off-chip memory, and then the operation of the next block is performed. When all block operations are realized, the convolution operation task of this layer is completed.

[0019] Compared with the prior art, the beneficial technical effects of the present invention are embodied in:

[0020] (1) The present invention uses a computing unit array to perform convolution operations, which can simultaneously perform multiplication and accumulation operations on multiple input channels and multiple output channels. The computing throughput is large and can meet the high computing power requirements of neural network convolution operations.

[0021] (2) The overall convolution operation process of the present invention is carried out in a block-by-block manner, and the size of the block can be adjusted to adapt to the different operation array sizes and buffer sizes of the hardware to achieve high array utilization. The method has flexible scalability and can well meet the requirements of convolution operations with different hyperparameters and different deep neural network systems.

[0022] (3) The hardware computing block of the present invention is divided in the input feature map row dimension, input channel dimension, and output channel dimension. It is independent of the convolution operator type and has strong flexibility. It can implement a variety of convolution operators including ordinary 1D convolution, 2D convolution, and depth-separable convolution.

[0023] (4) The hardware and method of the present invention can realize the following data reuse mode: for weight data, when the input channel remains unchanged, the weight register of the operation unit array does not need to rewrite the weight, and the weight is reused in the time dimension; for input feature map, the input is broadcast to the operation unit array and temporarily stored in the row buffer, and the input feature map is reused in the time dimension and the space dimension; for output feature map, the output is temporarily stored in the accumulation buffer, and the output feature map is reused in the time dimension. As a result, the hardware realizes high data reuse and reduces the bandwidth requirement and operation power consumption of convolution operation.

[0024] (5) The present invention adopts multi-level buffering, which reduces the number of times the entire hardware accelerator accesses external storage, reduces bus occupancy and power consumption of reading and writing memory, and alleviates the bandwidth pressure of the system where the hardware is located. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is the overall hardware structure block diagram for data reuse and computational acceleration for convolutional neural network inference.

[0026] Figure 2 Schematic diagram of block segmentation and iteration sequence.

[0027] Figure 3 Schematic diagram for row buffering and reading and writing logic.

[0028] Figure 4 Schematic diagram of the timing of input feature map reading and convolution operation.

[0029] Figure 5 This is a diagram of the on-chip distribution network structure.

[0030] Figure 6It is the structure of the operation unit array and the circuit diagram of the operation unit.

[0031] Figure 7 Diagram of the on-chip collection network and accumulation and buffer structure. DETAILED DESCRIPTION

[0032] The overall structure of the hardware accelerator for data reuse and operation of convolutional neural network inference provided by the present invention is as follows: Figure 1 As shown in the figure. The modules are interconnected as shown in the figure. The weights are preloaded into the weight registers in the operation unit array. The input feature map is loaded into the row buffer during the preloading and calculation phases, and the output of the row buffer is connected to the operation unit array through the on-chip distribution network. The input feature map and weights complete the convolution operation in the operation unit array, and the partial sum results are output from the operation unit array to the on-chip collection network and finally accumulated to the cumulative sum buffer. After the valid output feature map is generated, the output feature map is stored.

[0033] like Figure 2 As shown in the figure, the hardware accelerator completes the convolution operation of this layer according to the fixed loop iteration logic. In the compilation stage, the input feature map is divided into multiple blocks of TH×Wi×TIC size, and the corresponding weight size is Kh×Kw×TIC×TOC. From the perspective of the output feature map, the block iteration method of the entire convolution operation is divided into loop 1, loop 2, and loop 3. The relationship between is loop 3(loop 2(loop 1(corresponding to the convolution sliding window convolution operation))). First, loop 1 operation is performed, and the convolution window is slid in a row-first mode in the order shown in the figure, and TH×Wo×TIC×TOC×Kh×Kw times of multiplication and accumulation operations are performed to generate the corresponding partial sums, which are stored in the cumulative sum buffer to complete the operation of one block. After that, loop 2 operation is performed, and the convolution sliding window is moved on the input feature map along the input channel direction in the order shown in the figure. After loop 2 traversal is completed, TH×Wo×TOC valid output feature map pixel values ​​are accumulated in the cumulative sum buffer. The output signal of the cumulative sum buffer is valid, and the output feature map is stored. Finally, input data selection and hardware calculation are performed in the order shown in loop 3. The above process is repeated until the calculation of the entire output feature map is completed.

[0034] In the present invention, the hardware execution mode of each block operation is divided into three stages: a preloading process, before the operation unit array starts the calculation, the weights required for this block calculation are loaded into the weight register, and the input feature map required for the first loop 1 traversal is loaded into the row buffer; the first row operation process, the operation unit array starts the calculation, and the partial sum corresponding to the first row of output feature maps is calculated and output. During this process, the row buffer does not need to load the input feature map, and the rest of the hardware system is the same as the operation process; the overall operation process, the row buffer loads a new row of input feature map data, and at the same time bypasses the data to the on-chip distribution network to perform partial sum calculations on the remaining rows of output feature maps.

[0035] Line buffering and read / write logic such as Figure 3 As shown. The figure takes a group of row buffers in the case of Kh=3 as an example. The row buffer is responsible for storing the input feature map in the convolution operation in this hardware system. The row buffer stores a total of TIC×(Kh×Wi) input feature map pixels, which are divided into TIC groups. Each group stores Kh rows of input feature maps in one input channel. The row buffers are arranged vertically, and each row of the row buffer maintains its own timing state, indicating whether the row is the oldest row, an older row, or the newest row in the traversal of loop 1. Each time the loop body of loop 1 is completed, that is, the calculation of the partial sum of the output feature map of the row is completed, the timing state is updated: the oldest row becomes the newest row, the older row becomes the oldest row, and the newest row becomes the older row. The read and write pointers control the reading and writing of the row buffer during the first row operation and the operation process. The row buffer is read during the first row operation and the operation process. The read pointer controls the reading of all the data in this column of the row buffer. TIC×Kh data are read out of the entire row buffer per cycle, that is, as shown in the figure: the n+1th value of the oldest row buffer, the nth value of the older row buffer, and the n-1th value of the newest row buffer. During the operation process, the row buffer is additionally written. The write pointer always corresponds to the location of a data in the newest row buffer. TIC data are written to the entire row buffer per cycle. The write data loaded into the hardware system will be input to the position controlled by the write pointer, and will be bypassed and replaced with the data of the newest row through the selector. In summary, the three data finally obtained from the row buffer module ensure that the first row contains the data of the oldest row, the second row contains the data of the older row, and the third row contains the data of the newest row.

[0036] The input feature map reading and convolution operation timing are as follows Figure 4As shown. The figure takes the row buffer and the multiplication and accumulation unit in the operation unit array in the case of Kh=3, Kw=3 as an example. There are TIC groups in the row buffer. Each group of row buffer is read from right to left by column. TIC×Kh data are read out in each cycle, corresponding to the input feature map required for the convolution operation of TIC input channels. The operation unit array contains multipliers with dimensions of (TIC×Kh)×(TOC×Kw), TIC×Kh rows, corresponding to the operation of TIC input channels, and TOC×Kw columns, corresponding to the operation of TOC output channels. The multipliers are divided into TIC groups by row. Each group receives Kh inputs from the row buffer in each cycle, and the input feature map is broadcast on the row dimension of the multiplier.

[0037] The on-chip distribution network structure is as follows Figure 5 As shown. The diagram takes the on-chip distribution network structure in the case of Kh=3, TIC=2 as an example. The on-chip distribution network distributes the self-buffered input feature map to the operation unit array in the form of row broadcast, forwarding the input feature map data of TIC input channels per cycle. The row buffer data is grouped and sorted at the front end of the on-chip distribution network. The row buffer gives TIC×Kh input feature map pixel values, which are converted into Kh×TIC data for broadcast after logical sorting shown in the diagram and input to the operation unit array. The operation unit array contains Kh rows of operation units, and each row of operation units receives TIC data.

[0038] Arithmetic unit array structure and arithmetic unit circuit such as Figure 6 As shown. The figure takes the operation unit array and the internal circuit of the operation unit in the case of Kh=3 and TIC=2 as an example. The operation unit array contains a total of Kh×(Kw×TOC) operation units, which can simultaneously complete the convolution operation of TIC input channels and TOC output channels. Each operation unit contains TIC multipliers, and can generate TIC partial sums per cycle. The weight of the convolution operation comes from the weight register of the operation unit array. The input feature map of the convolution operation comes from the on-chip distribution network, and each row of operation units receives TIC input feature map data. The partial sum generated by the operation unit will be passed to the next row and accumulated in the operation unit of the next row until the output operation unit array.

[0039] On-chip collection network and accumulation and buffer structure such as Figure 7 As shown. The diagram takes a group of on-chip collection networks and cumulative sum buffers with Kw=3 as an example. Corresponding to Kw×TOC operation units, each Kw is listed as a group from left to right, with a total of TOC groups. The on-chip collection network accumulates the output feature map pixel value data output by the operation unit as shown in the diagram. Each group eventually generates a partial sum, which is accumulated with the original value stored in the cumulative sum buffer and then stored in the cumulative sum buffer. The cumulative sum buffer has a total of TOC groups, each of which can store output feature map pixel values ​​of TH×Wo.

Claims

1. Data reuse and computational hardware accelerator for convolutional neural network inference, It is characterized in that Used to execute 2D convolution operator, group convolution operator, depth-separable convolution operator and variant convolution operator with similar computational behavior; the parameters in the convolution calculation are defined as follows: the input feature map size is Hi×Wi, and the number of input channels is IC; the weight kernel size is Kh×Kw, the weight input channel is IC, which is equal to the feature map input channel, and the number of weight kernels is OC; the output feature map size is Ho×Wo, and the number of feature map output channels is OC, which is equal to the number of weight kernels; during the block operation process, each row of the operation unit array calculates the partial sum of TIC input channels, and each column calculates the partial sum of TOC output channels; the hardware accelerator structure includes operation units and arrays formed by them, on-chip data distribution network and collection network, row buffers for intermediate cache of input feature maps and related first read-write control logic, and accumulation buffers for output partial sum caches and related second read-write control logic; wherein: The first read-write control logic is responsible for caching the input feature map in the convolution operation; the position of the row buffer in the entire hardware architecture is between the on-chip or off-chip memory and the on-chip data distribution network. In the process of the operation unit array loading the input feature map, the pixel values ​​in the input feature map are loaded into the row buffer for storage, and then the pixel values ​​are output to the on-chip data distribution network, and then used for the convolution calculation input of the operation unit array; the row buffer size is TIC×(Kh×Wi), which means: the pixel values ​​in each Kh adjacent rows of TIC adjacent input channels in the input feature map are cached, and each row has Wi pixel values; The on-chip distribution network is responsible for sorting the output data of the row buffer, and then distributing the input feature map to the operation unit array according to the rules; in the operation stage of the current block, while the input feature map is loaded into the row buffer, the row buffer outputs TIC×Kh values ​​to the on-chip distribution network, and the input data is TIC input channels, and the Kh row and 1 column pixel values ​​in the feature map of each input channel; the on-chip distribution network reorders the output data of the row buffer so that the data obtained by each operation unit in a single cycle comes from each input channel, and then outputs it to the operation unit array in a broadcast form; The operation unit array is responsible for the multiplication and accumulation operations of the convolution operation; the operation unit is an addition tree structure, each leaf node is a multiplier, and there are TIC multipliers in total; the operation unit array is composed of Hn×Wn operation units, where Hn=Kh, Wn=Kw×TOC, and can execute the multiplication and accumulation operations of Kh×Kw convolution sliding windows in TIC input channels and TOC output channels per cycle; the entire operation unit array maintains 2×(TIC×TOC×(Kh×Kw)) weight registers, which are responsible for storing the weight data pre-fetched from the on-chip distribution network; the actual hardware of the weight register includes 2 sets of current working registers and shadow registers, which are operated in a ping-pong buffer manner The following functions are realized: pre-fetching the input weight of the next block operation (completed in the shadow weight register) and supplying the input weight of the current block operation to the operation unit array (completed in the current working weight register) can be performed independently; each operation unit receives the input feature map from the on-chip distribution network and the input weight from the weight register in each cycle, performs multiplication and accumulation calculations to generate partial sums, and the partial sums are accumulated through the subsequent addition tree, and then accumulated with the partial sum output from the operation unit of the previous row, and then output from the operation unit to the operation unit of the next row; the operation unit array shares the input feature map data in the row direction, and passes the partial sum of the current row to the next row in an accumulation manner in the column direction; The on-chip collection network is responsible for correctly aggregating the partial sum output of each column in the operation unit array and writing the output partial sum; after the operation unit array completes the multiplication and accumulation operation of the weight and the input feature map, the generated partial sum of each Kw column is accumulated downward and output from the operation unit array, and finally passes through the on-chip collection network to generate a partial sum of a Kh×Kw convolution sliding window; the input of the on-chip collection network is grouped as Kw columns, and partial sums are collected in the form of pulsating accumulation; the on-chip collection network implements partial sum gating logic to ensure that the accumulation logic at the start and end stages of the convolution operation is correct; after the accumulation of the on-chip collection network is completed, the output partial sum is added to the accumulated partial sum in the accumulation buffer, and the result is saved back to the accumulation buffer; The second read-write control logic is responsible for storing the accumulated sum corresponding to the pixel value of the output feature map; the operation unit array calculates and outputs a part of the accumulated sum in each cycle, and the pixel value of each output feature map accumulates the result calculated by the multi-cycle operation unit array; before this process is completed, the accumulated sum buffer will temporarily store part of the accumulated sum, and when the accumulation of all block operation results corresponding to the output feature map is completed, it will give valid data and related signals, and output the result to on-chip or off-chip storage; In the neural network, a convolution operation of a certain layer is split into multiple block operations in sequence, and each block operation is independent of each other; the process of inputting feature maps and weights into hardware, performing multiplication and accumulation operations on the operation unit array, and outputting feature maps to hardware are all implemented in this order.

2. The data reuse and computing hardware accelerator for convolutional neural network reasoning according to claim 1, It is characterized in that The processing flow is as follows: (1) Preloading: The weights are loaded from the weight memory into the weight registers in the arithmetic unit array; at the same time, the input feature map loading is started, and the input feature map is transferred from the memory into the row buffer; (2) First row operation: After the row buffer is fully filled for the first time and the weight register is fully filled for the first time, the calculation of the operation unit array is started; at this time, the input data in the row buffer enters the operation unit array through the on-chip distribution network and performs multiplication and accumulation operations with the weights in the weight register; at this stage, the current working weight register is filled, and the filling process of the shadow weight register used for the next block operation is started; One column of the input operation unit array is buffered in each cycle, and the input feature map is supplied regularly cycle by cycle; at the same time, the partial sum in the operation unit array is accumulated to the on-chip collection network connected to the operation unit at the bottom of each column, and is added with the original cumulative sum in the cumulative sum buffer, and finally stored back in the cumulative sum buffer; (3) Overall operation: When each column of the row buffer is completely consumed, the TIC row in the row buffer used to store the input feature map corresponding to the oldest row label will not be used in subsequent convolution operations; a new row of input feature maps is transferred from the memory to the TIC row corresponding to the oldest row label in the row buffer, and at the same time, the input feature map is bypassed to the on-chip distribution network and then transferred to the operation unit array as the input required for the convolution operation of the next row of output feature maps; the process is repeated until the TIC row is filled again, at which time the polling of each column of the row buffer has been completed again; the process (3) is repeated until the row dimension of the input feature map in this block operation has been completely traversed, and a block operation is completed; After the operation of this block is completed, the operation of the next block is changed; the processes (1), (2), and (3) are repeated; when a block operation corresponds to the last group of input channels of a certain output channel, after the operation is completed and part or all of it is accumulated into the cumulative sum buffer, the buffer in the cumulative sum is stored in the on-chip or off-chip memory, and then the operation of the next block is performed; when all block operations are realized, the convolution operation task of this layer is completed.

Citation Information

Cited By

  • Neural network reasoning optimization method adaptive to hardware tensor instruction and memory

    CN119416850A

  • Diffusion model reasoning acceleration method based on feature caching and distributed parallelism

    CN120745799A