Deep neural network accelerator based on dynamically reconfigurable systolic tensor computing engine
Through the design of a dynamically reconfigurable systolic tensor computing engine, the problem of low tensor multiplication operation efficiency in large-scale DNN models is solved, and a deep neural network accelerator with high throughput, low latency and low energy consumption is realized, which is suitable for complex Large-scale DNN algorithm model.
Patent Information
- Application Number
- CN202210548997.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-05-20
AI Technical Summary
When the existing two-dimensional systolic array computing system processes tensor multiplication operations of large-scale deep neural network models, it suffers from low throughput, high latency, high resource usage and high energy consumption, and cannot effectively cope with complex large-scale DNN algorithm models. .
Adopts a deep neural network accelerator based on a dynamic reconfigurable systolic tensor computing engine, including HBM high-speed memory interface, weight parameter storage unit, tensor sorting module, activation value vector storage unit, dynamic reconfigurable systolic tensor array computing engine unit , accumulator and matrix transpose vector unit, through dynamic reconstruction of systolic tensor array parallel operations and pipeline processing, combined with floating point, fixed point and shift operations, to reduce frequent memory access and power consumption.
It significantly improves the computing throughput of large-scale DNN models, reduces computing latency and energy consumption, achieves efficient resource utilization, and has low energy consumption and high-precision model computing speed.
Smart Images

Figure CN114781632B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neural network field dedicated application chip acceleration computing architecture technology, in particular to a deep neural network accelerator based on a dynamically reconfigurable pulsating tensor computing engine. Background Art
[0002] With the rapid and vigorous development of artificial intelligence technology (AI), deep neural networks (DNN) have become one of the most popular artificial intelligence technologies today, due to their extremely outstanding performance in solving many problems in the field of AI. However, the excellent performance of DNN comes at the cost of an exponential increase in the number of model parameters and the amount of computation. The network is deeper and more complex, and the tensor multiplication operations of the weight information and feature map information of the network layer make it impossible for traditional processors to effectively perform such operations. Traditional processors have low throughput and high power consumption in such operations.
[0003] The existing computing model system is mainly based on the two-dimensional systolic array computing engine. Although this type of operation can accelerate the matrix operations of most DNN models, it is still necessary to matrix-split the tensor when performing tensor multiplication operations. The matrix multiplication operation is the most basic operation unit. Usually, tensor multiplication operations need to be replaced by a large number of matrix multiplication operations, which makes this type of computing model system design unable to efficiently operate large-scale DNN models. The main disadvantages of the two-dimensional systolic array computing system model when processing tensor operations in large-scale DNN models are low computing throughput, high computing latency, high resource usage, and high energy consumption. Summary of the invention
[0004] The present invention provides a deep neural network accelerator based on a dynamically reconfigurable pulsating tensor computing engine, which solves the technical problem of how to improve the throughput of large-scale DNN model operations, reduce computing latency, and reduce resource occupancy and energy consumption, so as to effectively cope with more complex large-scale DNN algorithm models in the future.
[0005] In order to solve the above technical problems, the present invention provides a deep neural network accelerator based on a dynamically reconfigurable systolic tensor operation engine, comprising: an HBM high-speed memory interface, a weight parameter storage unit, a tensor sorting module, an activation value vector storage unit, a dynamically reconfigurable systolic tensor array operation engine unit, an accumulator and a matrix transposition vector unit, and a scalar operation unit;
[0006] The HBM high-speed memory interface is used to transfer the weight tensor and feature map tensor of the deep neural network from the DRAM external memory to the weight parameter storage unit and the activation value vector storage unit respectively;
[0007] The weight parameter storage unit is used to send the weight tensors stored in the weight parameter storage unit to the multiple tensor sorting units of the tensor sorting module in parallel, and the activation value vector storage unit is used to send the feature map tensors stored in the weight parameter storage unit to the dynamically reconfigurable systolic tensor array computing engine unit in parallel;
[0008] The plurality of tensor sorting units are used to sort and optimize the weight tensors sent in, complete the decomposition of the tensors into matrices, and then send them into the dynamically reconfigurable systolic tensor array computing engine unit;
[0009] The dynamically reconfigurable systolic tensor array operation engine unit is used to dynamically reconstruct multiple systolic tensor array operation engines according to the input weight tensor and the feature map tensor and perform parallel multiplication and accumulation operations on them respectively, and output corresponding multiplication and accumulation operation results to the accumulator and the matrix transposition vector unit;
[0010] The accumulator and matrix transposition vector unit are used to perform accumulation caching and asynchronous matrix transposition operations on the input multiplication and accumulation operation results, and output the final operation results of the weight tensor and the feature map tensor to the scalar operation unit;
[0011] The scalar operation unit is used to perform a data operation operation on the input final operation result under a specific application scenario, and output the corresponding data operation result to the activation value vector storage unit as a new feature map tensor of the deep neural network to participate in the next round of calculation or directly as the final reasoning result of the deep neural network;
[0012] The HBM high-speed memory interface is also used to retrieve the final inference result of the deep neural network from the activation value vector storage unit and transmit it to the DRAM external memory.
[0013] Specifically, the dynamically reconfigurable systolic tensor array computing engine unit includes a plurality of the systolic tensor computing engines, the number and computing mode of each of the systolic tensor computing engines are dynamically determined by an external compiler; the input of each of the systolic tensor computing engines is a weight tensor and a feature map tensor of variable dimensions, and the plurality of systolic tensor computing engines independently and parallelize pipeline computing, and finally obtain a plurality of computing results which are input into the accumulator and the matrix transposition vector unit.
[0014] Specifically, the number of the pulsating tensor operation engines is determined by the compiler based on the available resources of the FPGA hardware and the maximum number of model calculation graphs that can be executed in parallel; the operation methods of the pulsating tensor operation engines include floating-point operations, fixed-point operations and shift operations, and the compiler determines the corresponding operation method based on the quantization method of the neural network model.
[0015] Specifically, each of the systolic tensor operation engines includes an instruction controller, a weight parameter register group, a feature map register group, an operation array and an output buffer; the process of each of the systolic tensor operation engines performing tensor multiplication operations includes the following steps:
[0016] 1) The instruction controller sends a weight parameter register group index control signal to the weight parameter register group to transfer the weight tensor from the connected tensor sorting unit to the weight parameter register group;
[0017] 2) the instruction controller sends a feature map register group index control signal to the feature map register group to load the feature map tensor from the activation value vector storage unit into the feature map register group;
[0018] 3) The instruction controller sends a control signal of the operator to the operation array and starts the operation array to complete the tensor operation;
[0019] 4) Saving the calculation results of the operation array into the output buffer;
[0020] 5) The output buffer outputs the calculation results of the operation array to the accumulator and the matrix transposition vector unit.
[0021] Specifically, the operation array is composed of A×A arrays. 2 Each of the operation array families consists of B arranged in a B×B array. 2 Each of the operation units has C rows×C columns of input and C rows×C columns of output, and completes the dot product operation and output of two C-dimensional vectors;
[0022] When performing high-order matrix multiplication operations, the pulsating tensor operation engine will first divide the input matrix into blocks according to the operation array dimension, and then send each block matrix to each operation array family according to a certain clock cycle sequence. Each operation array family calculates the dot product of some elements of the product matrix in a pipeline concurrent manner, and the calculation results are temporarily stored in the inter-family register. At the same time, the temporary stored results are sent to the next operation array family in different clock cycles. When the temporary stored data is sent to the bottom of the operation array, the accumulator and tensor transposition unit at the bottom process the operation results and dimensional transformation, and output the calculation results.
[0023] Specifically, the operation process of each operation array family is:
[0024] All row data of matrix 1 are sent to the operation unit in the vertical direction at the same time, and all column data of matrix 2 are sent to the operation unit in the horizontal direction at the same time. The operation unit that receives the data transmits the input data in the vertical and horizontal directions at the same time. Each operation unit completes the dot product operation of two C-dimensional vectors, that is, completes the calculation of an element of the result matrix D, B 2 Each operation unit completes the calculation of each element of the result matrix D in one clock cycle, and temporarily stores and outputs the matrix operation results in the horizontal direction and the vertical direction respectively.
[0025] Specifically, the scalar operation unit includes an operation controller, a multi-port input and output register group, a general arithmetic logic operation unit, a data input buffer unit, and a data output buffer unit; the data input buffer unit is connected to the accumulator and the matrix transposition vector unit, and the data output buffer unit is connected to the activation value vector storage unit;
[0026] The specific operation process of the scalar operation unit includes the following steps:
[0027] 1) The operation controller controls the data input buffer unit to load input tensor data and nonlinear parameter data into the general arithmetic logic operation unit;
[0028] 2) the operation controller controls and starts the general arithmetic logic operation unit to perform nonlinear operation on the input tensor data using nonlinear parameter data;
[0029] 3) The general arithmetic logic operation unit sends the result of the nonlinear operation to the data output buffer unit, and the multi-port input and output register group serves as the memory of the general arithmetic logic operation unit to provide corresponding data storage and data reading operations.
[0030] Specifically, the accumulator and matrix transposition vector unit includes a multi-port vector input interface, a multi-way parallel adder, a fast matrix transposition unit, a data output interface, and an operation type configuration parameter register; the multi-port vector input interface is connected to the output interface of the dynamically reconfigurable systolic tensor array operation engine unit, and is used to transmit its multiplication and accumulation operation results to the multi-way parallel adder, and the multi-way parallel adder performs accumulation and transmits the accumulation results to the fast matrix transposition unit, and the fast matrix transposition unit performs dimensional transformation to obtain a tensor matrix consistent with the network layer dimension, and then the data output interface outputs the dimensional transformed tensor matrix to the scalar operation unit, and the operation type configuration parameter register is used to configure the specific parameter information and transformation type of the tensor dimensional transformation during dimensional transformation.
[0031] The present invention provides a deep neural network accelerator based on a dynamically reconfigurable systolic tensor operation engine, which adopts a dynamically reconfigurable systolic tensor array operation engine unit. The unit adopts a compiler and hardware collaborative dynamic reconfigurable configuration mode. The compiler configures the number of engines and the calculation mode according to specific scenarios and parameters. The systolic tensor operation array realizes high-throughput tensor multiplication calculation. The output of the previous stage calculation engine is used as the input of the next stage engine. The data flow flows from the top layer to the end of the engine array in sequence, avoiding frequent memory access operations during the calculation process, and realizing uninterrupted high-concurrency pipeline matrix operations. Three dynamically configurable arithmetic operation units are adopted, namely floating-point multiplication operation, dynamic fixed-point multiplication and shift operation, to reduce hardware dynamic power consumption. Replacing arithmetic operation with shift operation can greatly reduce operation delay and system power consumption. The weight parameter storage unit stores the weight tensor, and the tensor sorting module is used to unpack the sparse network weights and sort and optimize the network layer parameters to complete the parallel pipeline operation. The activation value vector storage unit is used as the on-chip high-speed data temporary storage area of the neural network computing engine to improve the data reuse rate and reduce the interaction with the external memory. The accumulator and the matrix transposition vector unit are used to complete the cumulative summation of the calculation results, the fast processing of the matrix transposition and the tensor dimension transformation, and the scalar operation unit is used to realize the nonlinear function calculation of the network model. On the whole, the present invention effectively reduces the delay and energy consumption of tensor multiplication operations in deep neural networks, can realize the online reconfiguration of dynamic accelerators according to specific applications and FPGA hardware parameter platforms, and has the advantages of high resource utilization, low energy consumption, low precision loss, and fast model operation speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a module structure diagram of a deep neural network accelerator based on a dynamically reconfigurable systolic tensor computing engine provided by an embodiment of the present invention;
[0033] Figure 2 It is a workflow diagram of a deep neural network accelerator based on a dynamically reconfigurable systolic tensor computing engine provided by an embodiment of the present invention;
[0034] Figure 3 is an architecture diagram of a systolic tensor array computing engine provided by an embodiment of the present invention;
[0035] Figure 4 is an architectural diagram of a computing array family provided by an embodiment of the present invention;
[0036] Figure 5 is an architecture diagram of a computing array provided by an embodiment of the present invention;
[0037] Figure 6 It is an architecture diagram of a scalar operation unit provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The following specifically illustrates the implementation mode of the present invention in conjunction with the accompanying drawings. The embodiments are provided for illustrative purposes only and cannot be understood as limiting the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.
[0039] The embodiment of the present invention provides a deep neural network accelerator based on a dynamically reconfigurable systolic tensor computing engine, such as Figure 1 As shown, it includes HBM high-speed memory interface, weight parameter storage unit, tensor sorting module, activation value vector storage unit, dynamically reconfigurable systolic tensor array operation engine unit, accumulator and matrix transposition vector unit, and scalar operation unit. For the neural network model operation process, refer to Figure 2 The flowchart shown:
[0040] The HBM high-speed memory interface is used to load the weight tensor and feature map tensor of the deep neural network from the DRAM external memory into the weight parameter storage unit and the activation value vector storage unit respectively;
[0041] The weight parameter storage unit of the operation controller is used to send the weight tensors stored in itself to the multiple tensor sorting units of the tensor sorting module in parallel, and the activation value vector storage unit is used to send the feature map tensors stored in itself to the dynamically reconfigurable pulsating tensor array operation engine unit in parallel;
[0042] Multiple tensor sorting units are used to sort and optimize the input weight tensors, complete the decomposition of tensors into matrices, and then send them to the dynamically reconfigurable systolic tensor array computing engine unit;
[0043] The dynamically reconfigurable systolic tensor array operation engine unit is used to dynamically reconstruct multiple systolic tensor array operation engines according to the input weight tensor and feature map tensor and perform parallel multiplication and accumulation operations on them respectively, and output the corresponding multiplication and accumulation operation results to the accumulator and the matrix transposition vector unit;
[0044] The accumulator and matrix transposition vector unit are used to accumulate and cache the input multiplication and accumulation operation results and asynchronously process the matrix transposition operation, and output the final operation results of the weight tensor and the feature map tensor to the scalar operation unit;
[0045] The scalar operation unit is used to perform data operation operations on the input final operation results in specific application scenarios, and output the corresponding data operation results to the activation value vector storage unit as a new feature map tensor of the deep neural network to participate in the next round of calculation or directly as the final reasoning result of the deep neural network;
[0046] The HBM high-speed memory interface is also used to retrieve the final inference results of the deep neural network from the activation value vector storage unit and transfer them to the DRAM external memory.
[0047] like Figure 1 As shown, the dynamically reconfigurable systolic tensor array operation engine unit includes multiple systolic tensor operation engines, wherein the number and operation mode of the systolic tensor operation engines are dynamically determined by an external compiler. The number of systolic tensor operation engines is determined by the compiler according to the available resources of the FPGA hardware and the maximum number of parallel executions of the model calculation graph. The operation mode of the systolic tensor operation engine includes floating-point operation, fixed-point operation and shift operation. The compiler determines the corresponding operation mode according to the quantization mode of the neural network model, wherein the quantization mode of the neural network model can select any of the three quantization modes of fixed-point quantization (corresponding to fixed-point operation) and quadratic exponential quantization (corresponding to shift operation) and floating-point operation, or a combination of two quantization modes, such as fixed-point quantization and quadratic exponential quantization. The input of each systolic tensor operation engine is a variable-dimensional weight tensor and a feature map tensor. Multiple systolic tensor operation engines are independently parallel pipelined and finally obtain multiple operation results and input them into the accumulator and the matrix transposition vector unit.
[0048] Specifically, the compiler dynamically reconstructs the dimensions of multiple pulsating tensor engines and operation arrays according to the input weight tensors and feature map tensors, and multiple operation engines complete the neural network model calculation graph tensor operations in parallel. When the operation array completes the three-dimensional convolution operation in the neural network, it first decomposes the high-dimensional feature map tensor into multiple two-dimensional matrices, decomposes the high-dimensional weight parameters (convolution kernels) into multiple two-dimensional matrices, and then inputs the operation array to complete the convolution operation of the input feature map using matrix multiplication.
[0049] like Figure 3 As shown, the systolic tensor operation engine includes an instruction controller, a weight parameter register group, a feature map register group, an operation array and an output buffer. The instruction control signal includes an operator control signal, a weight parameter register group index control signal, and a feature map register group index control signal. The process of the systolic tensor operation engine performing tensor multiplication operation is divided into the following steps: 1) The instruction controller sends a weight parameter register group index control signal to the weight parameter register group to transfer the weight tensor from the tensor sorting unit to the weight parameter register group; 2) The instruction controller sends a feature map register group index control signal to the feature map register group to transfer the feature map data from the activation value vector storage unit to the feature map register group; 3) The instruction controller sends an operator control signal to the operation array and starts the operation array to complete the tensor operation (such as calculating the convolution operation of the tensor in the neural network); 4) Save the calculation result of the operation array to the output buffer; 5) The output buffer outputs the calculation result of the operation array to the accumulator and the matrix transpose vector unit.
[0050] like Figure 4 As shown, the operation array of the pulsating tensor operation engine is composed of A×A arrays. 2 Each operation array family consists of B arranged in a B×B array. 2 Each operation unit is composed of Figure 4 In a DP4 module, each operation unit has C rows × C columns of input and C rows × C columns of output, completing the dot product operation and output of 2 C-dimensional vectors. Here Figure 4 Take A=2, B=4, C=4 as an example.
[0051] When performing high-order matrix multiplication operations, the pulsating tensor operation engine will first divide the input matrix into blocks according to the operation array dimension, and then send each block matrix to each operation array family according to a certain clock cycle sequence. Each operation array family calculates the dot product of some elements of the product matrix in a pipeline concurrent manner, and the calculation results are temporarily stored in the inter-family registers. At the same time, the temporary stored results are sent to the next operation array family at different clock cycles. When the temporary stored data is sent to the bottom of the operation array, the accumulator and tensor transposition unit at the bottom process the operation results and dimensional transformation, and output the calculation results, thereby completing the multiplication acceleration operation of two high-order matrices. The data flow of its operation array is as follows: Figure 4 Shown on the left.
[0052] like Figure 4 As shown on the right, the DP4 module includes a floating-point multiplication module (float module in the figure), a fixed-point multiplication module (fix module in the figure), a shift module (shift module in the figure), and a result register (ACC module in the figure). The weight tensor inputs are W0, W1, W2, and W3, and the feature input tensors are A0, A1, A2, and A3. The instruction controller sends out an operation mode selection signal, a data path selection signal, and a bypass input selection signal. The operation mode selection signal controls the DP4 module to select the type of multiplication operation module to be executed. The data path selection signal is used to select the bypass input data and the multiplier operation result output. The bypass input selection signal controls the input source of the DP4 module bias input data.
[0053] like Figure 5As shown, taking B=4 and C=4 as an example, an operation array family of the pulsating tensor operation engine includes 4×4 DP4 modules (operation units), which complete the multiplication operation of two 4×4 matrices in one clock cycle. The execution process is specifically as follows: all row data of matrix 1 are simultaneously sent to the DP4 module in the vertical direction, and all column data of matrix 2 are simultaneously sent to the DP4 module in the horizontal direction. The DP4 module that receives the data simultaneously transmits the input data in the vertical and horizontal directions. Each DP4 module completes the dot product operation of two 4-dimensional vectors, that is, completes the calculation of an element of the result matrix D. 16 DP4 modules can simultaneously calculate each element of the result matrix D in one clock cycle, and temporarily store and output the matrix operation results in the horizontal and vertical directions respectively.
[0054] The accelerator in this example uses a dynamically reconfigurable pulsating tensor array hybrid computing engine (dynamically reconfigurable pulsating tensor operation engine), and adopts a compiler (software) and hardware collaborative reconfigurable design mode. The compiler configures the number and computing mode of the pulsating operation array according to the specific application. The pulsating tensor operation array can realize a computing form based on data flow. The output of the upper array is used as the input of the lower array. The data flow flows from the top layer to the lower end of the operation array in sequence, avoiding frequent memory access operations during the operation process, realizing uninterrupted computing and high-concurrency pipelines, and reducing computing power consumption. This accelerator uses three dynamically configurable matrix multiplication operation units, such as Figure 4 As shown on the right, floating-point multiplication operations (float module in the figure), fixed-point multiplication (fix module in the figure), and shift operations (shift module in the figure) are used to reduce the dynamic power consumption of the hardware. In particular, shift operations replacing floating-point operations and fixed-point operations can significantly reduce operation latency and system power consumption.
[0055] like Figure 6 As shown, the scalar operation unit designed in this example includes an operation controller, a multi-port input and output register group, a general arithmetic logic operation unit, a data input buffer unit, and a data output buffer unit. The data input buffer unit is connected to the accumulator and the matrix transposition vector unit, and the data output buffer unit is connected to the activation value vector storage unit. The specific operation process is: 1) The operation controller controls the data input buffer unit to load the input tensor data and nonlinear parameter data to the general arithmetic logic operation unit; 2) The operation controller controls the start of the general arithmetic logic operation unit to use the nonlinear parameter data to perform nonlinear operations on the input tensor data, such as ReLu activation function operations, and normalizes the activation values (BatchNormalization); 3) The general arithmetic logic operation unit sends the results of the nonlinear operation to the data output buffer unit. The multi-port input and output register group acts as a memory of the general arithmetic logic operation unit to provide corresponding data storage and data reading operations.
[0056] The HBM high-speed memory interface designed for this accelerator uses the third-generation high-speed memory interface (HBM3). HBM3 contains 8 independent memory data access channel buses, of which the 8 memory data access channel buses are respectively connected to 8 independent storage areas of the DRAM external memory. HBM3 provides 4 independent channels to the weight parameter storage unit and the activation value vector storage unit respectively. Each channel contains an independent 32-bit address bus and a 128-bit bidirectional data bus for connecting the signal lines corresponding to each channel of the weight parameter storage unit and the activation value vector storage unit.
[0057] Furthermore, the weight parameter storage unit of the accelerator design of this example uses a weight parameter SRAM cache based on the on-chip Ping-Pong mechanism to store weight tensors. The input interface of the weight parameter SRAM cache is connected to the data read and write channel of HBM3, which is used to load the weight data of the network model from the DRAM external memory. The output interface of the weight parameter SRAM cache is connected to the tensor sorting module of the next level, which is used to optimize the sorting of tensor data to speed up the systolic array operation speed. The handshake signal and control signal of the weight parameter SRAM cache are connected to the status request interface of HBM3, which is used to send a data transmission interrupt signal to the external master CPU chip. The input valid control signal of the weight parameter SRAM cache is connected to the valid status request interface of HBM3, which is used to notify the external master CPU to start data transmission. The weight information output status identification signal of the weight parameter SRAM cache is connected to the data read indication signal line of the tensor sorting module, and the tensor sorting module accesses the weight information of the weight parameter SRAM cache through the on-chip bus.
[0058] The activation value vector storage unit of the accelerator design in this example uses an on-chip activation value SRAM cache as the on-chip high-speed data temporary storage area of the dynamically reconfigurable systolic tensor array operation engine unit to improve data reuse and reduce interaction with external memory. The on-chip activation value SRAM cache specifically includes a multi-port data output interface, a data input interface, a bidirectional data transmission bus interface, a data register, and an address register. The multi-port data output interface is connected to the dynamically reconfigurable systolic tensor array operation engine unit, and is used to transmit the feature map tensor to the feature map register group of each systolic tensor operation engine. The data input interface is connected to the output port of the accumulator and the matrix transposition vector unit, and is used to transmit the operation result data of the scalar operation unit to the activation value vector storage unit. The bidirectional data transmission bus interface is connected to the data transmission bus of the HBM high-speed memory interface, and is used for data transmission between the DRAM external memory and the activation value vector storage unit, such as the prediction input data of the transmission model.
[0059] The accelerator in this example uses an accumulator and a matrix transposition vector unit to complete the cumulative summation of calculation results, fast processing of matrix transposition and tensor dimension transformation. The accumulator and matrix transposition vector unit include a multi-port vector input interface, a multi-way parallel adder, a fast matrix transposition unit, a data output interface, and an operation type configuration parameter register; the multi-port vector input interface is connected to the output interface of the dynamically reconfigurable systolic tensor array operation engine unit, which is used to transmit its multiplication and accumulation operation results to the multi-way parallel adder, which is accumulated by the multi-way parallel adder and then transmitted to the fast matrix transposition unit, which performs dimension transformation to obtain a tensor matrix consistent with the network layer dimension, and then the data output interface outputs the dimension-transformed tensor matrix to the scalar operation unit, and the operation type configuration parameter register is used to configure the specific parameter information and transformation type of the tensor dimension transformation during the dimension transformation, such as transposition and channel flipping.
[0060] An embodiment of the present invention provides a deep neural network accelerator based on a dynamically reconfigurable systolic tensor operation engine, which adopts a dynamically reconfigurable systolic tensor array operation engine unit. The unit adopts a compiler and hardware collaborative dynamic reconfigurable configuration mode. The compiler configures the number of engines and the calculation mode according to specific scenarios and parameters. The systolic tensor operation array realizes high-throughput tensor multiplication calculation. The output of the previous stage calculation engine is used as the input of the next stage engine. The data flow flows from the top layer to the end of the engine array in sequence, avoiding frequent memory access operations during the calculation process, and realizing uninterrupted high-concurrency pipeline matrix operations. Three dynamically configurable arithmetic operation units are adopted, namely floating-point multiplication operation, dynamic fixed-point multiplication and shift operation, to reduce hardware dynamic power consumption. Replacing arithmetic operation with shift operation can greatly reduce operation delay and system power consumption. The weight parameter storage unit stores the weight tensor, and the tensor sorting module is used to unpack the sparse network weights and sort and optimize the network layer parameters to complete the parallel pipeline operation. The activation value vector storage unit is used as the on-chip high-speed data temporary storage area of the neural network computing engine to improve the data reuse rate and reduce the interaction with the external memory. The accumulator and the matrix transposition vector unit are used to complete the cumulative summation of the calculation results, the fast processing of the matrix transposition and the tensor dimension transformation, and the scalar operation unit is used to realize the nonlinear function calculation of the network model. On the whole, the present invention effectively reduces the delay and energy consumption of tensor multiplication operations in deep neural networks, can realize the online reconfiguration of dynamic accelerators according to specific applications and FPGA hardware parameter platforms, and has the advantages of high resource utilization, low energy consumption, low precision loss, and fast model operation speed.
[0061] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A deep neural network accelerator based on a dynamically reconfigurable systolic tensor computing engine, It is characterized in that include: It includes HBM high-speed memory interface, weight parameter storage unit, tensor sorting module, activation value vector storage unit, dynamically reconfigurable systolic tensor array operation engine unit, accumulator and matrix transposition vector unit, and scalar operation unit; The HBM high-speed memory interface is used to transfer the weight tensor and feature map tensor of the deep neural network from the DRAM external memory to the weight parameter storage unit and the activation value vector storage unit respectively; The weight parameter storage unit is used to send the weight tensors stored in the weight parameter storage unit to the multiple tensor sorting units of the tensor sorting module in parallel, and the activation value vector storage unit is used to send the feature map tensors stored in the weight parameter storage unit to the dynamically reconfigurable systolic tensor array computing engine unit in parallel; The plurality of tensor sorting units are used to sort and optimize the weight tensors sent in, complete the decomposition of the tensors into matrices, and then send them into the dynamically reconfigurable systolic tensor array computing engine unit; The dynamically reconfigurable systolic tensor array operation engine unit is used to dynamically reconstruct multiple systolic tensor array operation engines according to the input weight tensor and the feature map tensor and perform parallel multiplication and accumulation operations on them respectively, and output corresponding multiplication and accumulation operation results to the accumulator and the matrix transposition vector unit; The accumulator and matrix transposition vector unit are used to perform accumulation caching and asynchronous matrix transposition operations on the input multiplication and accumulation operation results, and output the final operation results of the weight tensor and the feature map tensor to the scalar operation unit; The scalar operation unit is used to perform a data operation operation on the input final operation result under a specific application scenario, and output the corresponding data operation result to the activation value vector storage unit as a new feature map tensor of the deep neural network to participate in the next round of calculation or directly as the final reasoning result of the deep neural network; The HBM high-speed memory interface is also used to fetch the final inference result of the deep neural network from the activation value vector storage unit and transmit it to the DRAM external memory; The dynamically reconfigurable systolic tensor array computing engine unit includes a plurality of the systolic tensor computing engines, the number and computing mode of each of the systolic tensor computing engines are dynamically determined by an external compiler; the input of each of the systolic tensor computing engines is a weight tensor and a feature map tensor of variable dimensions, and the plurality of systolic tensor computing engines independently and parallelize pipeline computing, and finally obtain a plurality of computing results and input them into the accumulator and the matrix transposition vector unit.
2. The deep neural network accelerator based on the dynamically reconfigurable systolic tensor computing engine according to claim 1, It is characterized in that The number of the pulsating tensor operation engines is determined by the compiler based on the available resources of the FPGA hardware and the maximum number of model calculation graphs that can be executed in parallel; the operation methods of the pulsating tensor operation engines include floating-point operations, fixed-point operations and shift operations, and the compiler determines the corresponding operation method based on the quantization method of the neural network model.
3. The deep neural network accelerator based on the dynamically reconfigurable systolic tensor computing engine according to claim 1, Features: Each of the systolic tensor operation engines includes an instruction controller, a weight parameter register group, a feature map register group, an operation array and an output buffer; the process of each of the systolic tensor operation engines performing tensor multiplication operations includes the following steps: 1) The instruction controller sends a weight parameter register group index control signal to the weight parameter register group to transfer the weight tensor from the connected tensor sorting unit to the weight parameter register group; 2) the instruction controller sends a feature map register group index control signal to the feature map register group to load the feature map tensor from the activation value vector storage unit into the feature map register group; 3) The instruction controller sends a control signal of the operator to the operation array and starts the operation array to complete the tensor operation; 4) Saving the calculation results of the operation array into the output buffer; 5) The output buffer outputs the calculation results of the operation array to the accumulator and the matrix transposition vector unit.
4. The deep neural network accelerator based on the dynamically reconfigurable systolic tensor computing engine according to claim 3, Features: The operation array is composed of A arranged in an A×A array 2 Each of the operation array families consists of B arranged in a B×B array. 2 Each of the operation units has C rows×C columns of input and C rows×C columns of output, and completes the dot product operation and output of two C-dimensional vectors; When performing high-order matrix multiplication operations, the pulsating tensor operation engine first divides the input matrix into blocks according to the operation array dimension, and then sends each block matrix to each operation array family according to a certain clock cycle sequence. Each operation array family calculates the dot product of some elements of the product matrix in a pipeline concurrent manner, and the calculation results are temporarily stored in the inter-family register. At the same time, the temporarily stored results are sent to the next operation array family in different clock cycles. When the temporarily stored data is sent to the bottom of the operation array, the accumulator and tensor transposition unit at the bottom process the operation results and dimensional transformation, and output the calculation results.
5. The deep neural network accelerator based on the dynamically reconfigurable systolic tensor computing engine according to claim 4, It is characterized in that The operation process of each operation array family is: All row data of matrix 1 are sent to the operation unit in the vertical direction at the same time, and all column data of matrix 2 are sent to the operation unit in the horizontal direction at the same time. The operation unit that receives the data transmits the input data in the vertical and horizontal directions at the same time. Each operation unit completes the dot product operation of two C-dimensional vectors, that is, completes the calculation of an element of the result matrix D, B 2 Each operation unit completes the calculation of each element of the result matrix D in one clock cycle, and temporarily stores and outputs the matrix operation results in the horizontal direction and the vertical direction respectively.
6. The deep neural network accelerator based on the dynamically reconfigurable systolic tensor computing engine according to claim 1, It is characterized in that The scalar operation unit includes an operation controller, a multi-port input and output register group, a general arithmetic logic operation unit, a data input buffer unit, and a data output buffer unit; the data input buffer unit is connected to the accumulator and the matrix transposition vector unit, and the data output buffer unit is connected to the activation value vector storage unit; The specific operation process of the scalar operation unit includes the following steps: 1) The operation controller controls the data input buffer unit to load input tensor data and nonlinear parameter data into the general arithmetic logic operation unit; 2) the operation controller controls and starts the general arithmetic logic operation unit to perform nonlinear operation on the input tensor data using nonlinear parameter data; 3) The general arithmetic logic operation unit sends the result of the nonlinear operation to the data output buffer unit, and the multi-port input and output register group serves as the memory of the general arithmetic logic operation unit to provide corresponding data storage and data reading operations.
7. The deep neural network accelerator based on the dynamically reconfigurable systolic tensor computing engine according to claim 1, Features: The accumulator and matrix transposition vector unit includes a multi-port vector input interface, a multi-way parallel adder, a fast matrix transposition unit, a data output interface, and an operation type configuration parameter register; the multi-port vector input interface is connected to the output interface of the dynamically reconfigurable systolic tensor array operation engine unit, and is used to transmit its multiplication and accumulation operation results to the multi-way parallel adder, and the multi-way parallel adder performs accumulation and then transmits the accumulation results to the fast matrix transposition unit, and the fast matrix transposition unit performs dimensional transformation to obtain a tensor matrix consistent with the network layer dimension, and then the data output interface outputs the dimensional transformed tensor matrix to the scalar operation unit, and the operation type configuration parameter register is used to configure the specific parameter information and transformation type of the tensor dimensional transformation during the dimensional transformation.
