A neural network acceleration array based on weighted cyclic data flow

By introducing the neural network acceleration array design of weighted circular data flow into the convolutional neural network, the data-intensive and calculation-intensive problems of the convolutional neural network are solved, achieving more efficient data processing and calculation speed, and reducing power consumption. and delay.

CN115936064BInactive Publication Date: 2024-09-20UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202211141844.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-20
Publication Date
2024-09-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Convolutional neural networks have data-intensive and computational-intensive problems in data processing, resulting in data processing speeds that are slower than data generation speeds, and existing hardware accelerators are insufficient in achieving high-speed data transmission and calculations.

Method used

This paper proposes a weighted cyclic data flow (WR) neural network acceleration array design method. By implementing weighted cyclic data flow in the spatial domain computing structure, it reduces the repeated calls and movements of input data, fully reuses weight values ​​and input feature map data, and reduces External memory accesses.

Benefits of technology

It effectively reduces overall power consumption and latency, improves system performance, and improves the efficiency and calculation speed of convolution operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115936064B
    Figure CN115936064B
Patent Text Reader

Abstract

The present invention specifically relates to a neural network acceleration array based on a weighted cyclic data flow, which fully reuses the weight values ​​and input feature map data read from the memory, greatly reduces the access to the external memory, and belongs to the field of hardware acceleration technology for neural networks. In the field of artificial intelligence chips, convolution operations account for more than 90% of the computational workload of the entire convolutional neural network model. In order to reduce the repeated calls and movements of input data in the spatial domain computing structure and maximize data reuse, the present invention proposes a weighted cyclic data flow. By designing a PE array based on a weighted cyclic data flow, the convolution operation is optimized, effectively reducing the power consumption and latency of the hardware acceleration structure, thereby improving the overall performance of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hardware acceleration of neural networks, and in particular to a method for designing a neural network acceleration array based on weighted cyclic data flow. Background Art

[0002] With the rapid development of Internet of Things technology, wearable smart products use various parts of the human body as interfaces to the Internet, truly realizing a human-machine integrated product experience with the characteristics of miniaturized, portable and intelligent wearable products, providing consumers with portable real-time information collection and data services, and having greater technical content and market appeal.

[0003] Unfortunately, designing high-performance wearable computing devices is not an easy task and its realization faces many challenges. This field is the intersection of different research fields such as computer science and engineering, and uses various technologies such as microelectronics and wireless communications. Advances in microelectronics technology have led to small-sized, low-power AI chips suitable for wearable computing devices.

[0004] In the field of artificial intelligence chips, deep learning, which belongs to the category of machine learning, has been widely used in image classification, speech recognition, object detection, etc., and has achieved remarkable results. Convolutional neural networks, recursive neural networks and deep belief networks are the main focuses of deep learning research, among which the most advanced is the convolutional neural network.

[0005] The typical convolutional neural network structure includes: convolution layer, activation layer, pooling layer, fully connected layer and input and output feature maps. The function of the convolution layer is feature extraction, the function of the pooling layer is pixel compression, and the function of the fully connected layer is classification. The convolution layer is a computationally intensive operation, while the fully connected layer is a data-intensive operation.

[0006] Convolutional neural networks have three bottleneck problems in data processing: First, they are data-intensive, requiring a huge amount of data to be processed. Second, they are computationally intensive, requiring a large amount of computing resources and time to process and store data. Third, there is a speed mismatch problem, that is, the data processing speed is slower than the data generation speed. Therefore, dedicated chips suitable for artificial intelligence architectures are in urgent need of development, and the realization of neural network accelerators with high-speed data transmission and high-speed computing will be of great significance in many aspects.

[0007] At present, due to the improvement of hardware performance, the acceleration of neural network training and inference mainly adopts the form of CPU, GPU, FPGA and ASIC. About twenty years ago, CPU was the mainstream for implementing neural network algorithms, and its optimization field was mainly concentrated in the software part. The increasing computational cost of CNN requires hardware to accelerate its reasoning process. In terms of GPU, GPU clusters can accelerate very large networks with more than 1 billion parameters in parallel. The mainstream GPU clustering neural network usually uses the distributed SGD algorithm. Many studies have further exploited this parallelism and strived to achieve communication between different clusters. FPGA has become a good platform for CNN hardware acceleration because of its many attractive features. In general, FPGA provides higher energy efficiency than CPU and GPU, and has higher performance than CPU. Compared with GPU, the throughput of FPGA is tens of gigaflops and memory access is limited. In addition, it does not support floating-point calculations by itself, but has lower energy consumption. Application-specific integrated circuit ASIC is a dedicated processor designed for specific applications. Although ASIC has low flexibility, long development cycle and high cost, it has the advantages of small size, low power consumption, fast computing speed and high reliability.

[0008] There are two typical architectures for neural network hardware accelerators: time domain computing architecture (tree structure) and spatial domain computing architecture (PE array structure). The tree structure centrally controls the arithmetic computing units and storage resources based on the instruction stream. Each arithmetic logic unit obtains the operation data from the centralized storage system and writes the results back to it. It consists of a multiplication and addition tree, a buffer for allocating input values, and a prefetch buffer. In the PE array structure, each arithmetic operation unit has a local memory, and the entire architecture adopts data flow control, that is, all PE units form a processing chain relationship, and data is directly transferred between PEs. It consists of a global buffer, FIFO, and PE array. Each PE consists of one or more multipliers and adders, which can achieve highly parallel computing.

[0009] There are four typical data flow modes for neural network hardware accelerators: data flow without local reuse, fixed input flow, fixed output flow, and fixed weight flow. For data flow without local reuse, in order to maximize storage capacity and minimize off-chip memory bandwidth, local storage is not allocated to PE, but all areas are allocated to the global buffer to increase its capacity. It must transmit input feature maps in multiple channels, transmit convolution kernel weights in a single channel, and then accumulate partial sums through the PE array. For input fixed flow, the computing core reads the input feature map into the local input register; the computing core fully reuses these input data and updates all relevant output partial sums in the output cache; the updated output partial sums are written back to the output cache. For output fixed flow, the computing core reads each channel of the input feature map into the local input register; the output part stored in the computing core output register is fully reused to complete the full accumulation in the direction of the three-dimensional convolution channel; the final output feature map is written to the output cache after pooling. For the weight-fixed stream, the computing core reads the input feature map blocks into local input registers; the computing core uses these input data to update the output partial sum of the blocks; the block convolution kernel weights stored in the weight cache are fully reused to update the output partial sum stored in the output cache.

[0010] Figure 1 Figure 1 is a simple convolutional layer diagram, where 10 is a 7×7 input feature map, 11 is a 3×3 convolution kernel, and 12 is a 5×5 output feature map. The convolution kernel window slides on 10 in a "Z" shape row by row to perform convolution operations, and the result is 12. The convolution operation occupies more than 90% of the computational workload of the entire convolutional neural network model. Therefore, by designing a structured PE array and optimizing the convolution operation, the area and power consumption of the hardware acceleration structure can be effectively reduced, thereby improving the overall performance of the system. Summary of the invention

[0011] In view of the above background content, the present invention proposes an acceleration array design method for neural network convolution layer operations. It can be applied to FPGA or ASIC neural network hardware accelerator design as the computing part of AI acceleration processor.

[0012] In the spatial domain computing structure, each computing unit is controlled by data flow, so the key is to solve the data flow problem. In order to reduce the repeated calls and movements of input data and maximize data reuse, it is best to input feature maps at one time, so the weight ring dataflow (WR) is proposed.

[0013] Based on the proposed WR data flow, the present invention constructs a new neural network PE array architecture. Assuming that the convolution kernel size of a certain convolution layer is K 2, then the size of the corresponding PE array is also K 2 The PE units are interconnected horizontally for data movement and vertically for weight circulation.

[0014] The advantages of the present invention mainly include: fully reusing the weight values ​​and input feature map data read from the memory, greatly reducing the access to the external memory, and reducing the overall power consumption and delay. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 Schematic diagram of the convolutional layer;

[0016] Figure 2 Schematic diagram of weight cycle data flow;

[0017] Figure 3 A schematic diagram of a neural network acceleration array based on weighted cyclic data flow;

[0018] Figure 4 Workflow diagram for the weight loop data flow PE array DETAILED DESCRIPTION

[0019] The following is a detailed description of the weight cycle data flow and the corresponding array hardware implementation of the present invention in conjunction with the accompanying drawings:

[0020] The weighted cyclic data flow is specifically embodied as follows Figure 2 As shown, 20 is the size of N 2 Input feature map, here we assume that N is 7, then the convolution kernel of the first cycle is 201, and the size is K 2 , here we assume that K is 3, and the number of rows it slides ranges from 1 to K. In the next cycle of convolution kernel 202, the number of rows it slides ranges from 2 to K+1, and so on for the convolution kernels of cycles 203 and 204;

[0021] Depend on Figure 1 From the operation rules of the convolutional layer, we know that after each row change, only one row of data in the 11-window is updated. That is, only one row of the original K rows of data is discarded. Therefore, if all data are updated after each row change, the amount of data access will be greatly increased. Therefore, the position of the existing data rows is kept unchanged, and only the updated rows are used to cover the discarded data rows.

[0022] Neural network acceleration array based on weighted cyclic data flow such as Figure 3 As shown, containing K 2The array of PE units 301 simulates the sliding of the convolution kernel window row by row on the image. First, the weight values ​​on the convolution kernel are preset into the PE array 30. When K rows of image rows are simultaneously moved into the array for convolution, the process was originally called weight fixed flow. However, the WR flow proposed in this study is slightly different. It connects the weights of each column and provides a path for the weight flow, namely the vertical loop line in 30.

[0023] for Figure 4 The PE array workflow diagram shown in the figure shows that the PE array works as follows:

[0024] 1) First, input image rows 1 to K at the same time, until the input feature map data is filled with 30 for the first time, shift the image rows to the right as a whole according to the step size, and perform convolution operations in sequence;

[0025] 2) After the input feature graphs from rows 1 to K are traversed, one row of the image is updated. The remaining K-1 rows of data that have not been updated continue to be re-input in a loop;

[0026] 3) When each periodic image row of 31 is updated, the weight of 30 is cyclically shifted down by row as a whole and stored in a single weight register of 301 for each row, and the K rows of image rows of 30 are shifted right as a whole for convolution;

[0027] 4) When the image rows are updated, the operation ends after 30 completes the convolution of the last K rows of the input feature map.

[0028] A single 301 is mainly composed of a multiplier, an adder and a weight register. The preset weight is first input into the weight register for storage and is continuously reused until the image line is updated, and then it is cyclically moved down to the weight register of the next line 301.

[0029] Before the input feature map data is first filled with 30, the input excitation does not pass through the multiplier, but is directly output to the forward excitation signal, passing the data to 301 on the right.

[0030] When the input feature map data fills 30 and the convolution operation begins, the input excitation and weight are input to the multiplier to generate a partial sum. This partial sum is accumulated with the input partial sum signal from the left to generate the forward partial sum, which is input to 301 on the right. When the partial sum of each row reaches the rightmost side of 30, it is aggregated by K-1 edge adders to obtain the final convolution result.

[0031] In addition to the above structure, the adder part can also be replaced with an addition tree structure.

[0032] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the art can make some possible changes and modifications to the technical solution of the present invention by using the above-mentioned methods and technical contents without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.

Claims

1. A neural network acceleration array based on weighted cyclic data flow, characterized in that: The PE array size is the size of the convolution window. The PE units are connected horizontally for data movement and vertically for weight cyclic movement. The weight value on the convolution kernel is preset into the PE array. Before the input feature map data fills the PE array for the first time, the input feature map does not pass through the multiplier, but is directly output to the PE unit on the right. The convolution operation is not performed until the input feature map data fills the PE array. The size of the convolution window is K×K. First, input image rows 1 to K at the same time, until the input feature map data first fills the PE array, and then shift the image rows right as a whole according to the step size, and perform convolution operations in sequence; when the input feature map rows 1 to K are traversed, one row of image rows is updated; the remaining K-1 rows of data that have not been updated continue to be re-input in a loop; when the image row is updated, the weight of the PE array is shifted down in a loop by row, and stored in the weight register of a single PE unit in each row, and the K rows of image rows of the PE array are shifted right as a whole for convolution; when the image row is updated, the PE array completes the convolution of the last K rows of the input feature map, and the operation ends; When the input feature map is shifted right, the weights remain unchanged in the array. Each time the data is shifted right, the array is convolved once. When the input feature map data fills the PE array and the convolution operation begins, the input feature map and the weight are input into the multiplier to generate a partial sum; this partial sum is accumulated with the input partial sum signal from the left to generate the forward partial sum, which is input into the PE unit on the right; when the partial sum of each row reaches the rightmost side of the PE array, it is summarized by K-1 edge adders to obtain the final convolution result.

2. The neural network acceleration array according to claim 1, characterized in that: Except for the first K image rows entering at the same time, the image row update interval is one cycle after the PE array traverses the convolution K rows, instead of flowing once per beat like the systolic array.

3. The neural network acceleration array according to claim 1, characterized in that: A PE unit consists of at least one data register, a multiplier, and an adder.

4. The neural network acceleration array according to claim 1, characterized in that: In addition to data transmission signals, the PE unit also has some control signals to control data flow.

Citation Information

Patent Citations

  • Neural network processor based on systolic array

    CN107578098A

  • Computing array based neural network processor

    CN107918794A

  • Data recombination method for systolic array structure

    CN110674927A

  • Neural network accelerator convolution calculation device and method based on systolic array

    CN113869507A

  • Computing convolutions using a neural network processor

    US20170103316A1