Convolutional neural network acceleration device based on pipeline design
By designing a three-layer pipeline structure and a greedy algorithm on the NVDLA accelerator to optimize the convolution operator size, the problem of insufficient hardware accelerator resource utilization and pipeline efficiency is solved, and efficient deployment and performance improvement of the CNN model are achieved.
Patent Information
- Application Number
- CN202410423502.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2024-08-23
AI Technical Summary
Existing deep learning hardware accelerators such as NVDLA have shortcomings in resource utilization, memory bandwidth, operator size fixity and pipeline efficiency, which limits the efficient deployment and performance improvement of CNN models on hardware.
A convolutional neural network acceleration device based on pipeline design is used, including a data access layer, a convolution calculation layer and a single point calculation layer. The size of the convolution operator is optimized through a greedy algorithm to achieve parallelization and pipelineization of the calculation process and improve the hardware. Resource utilization and computational efficiency.
It significantly improves the operating efficiency and hardware resource utilization of CNN models on the NVDLA accelerator, and provides an efficient and flexible optimization solution to meet the growing needs of deep learning applications.
Smart Images

Figure CN118536561A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning hardware acceleration, and in particular to a technology for optimizing the deployment of convolutional neural networks (CNNs) on dedicated hardware accelerators. Background Art
[0002] Convolutional Neural Network (CNN) is a deep learning model that is widely used in image recognition, speech recognition, natural language processing and other fields. By imitating the structure of the human visual system, CNN can automatically extract the features of the image, thereby achieving efficient image recognition and classification. The core of CNN is the convolution layer and the pooling layer. The convolution layer is used to extract the local features of the image, and the pooling layer is used to reduce the spatial dimension of the features, thereby reducing the amount of calculation and enhancing the generalization ability of the model. CNN has been successfully applied to many fields, such as vehicle and pedestrian detection in autonomous driving, disease diagnosis in medical image analysis, and face recognition in social media.
[0003] As the complexity of CNN models and the amount of data increase, traditional CPU computing power can no longer meet the needs of deep learning. Therefore, hardware accelerators have become the key to improving computing performance. Hardware accelerators include GPUs, FPGAs, ASICs, etc. GPUs are widely used in the field of deep learning due to their powerful parallel processing capabilities. FPGAs and ASICs provide higher energy efficiency and customized acceleration capabilities. Hardware accelerators greatly increase the speed of operations such as convolution and matrix multiplication through parallel computing and dedicated computing units, thereby accelerating the reasoning and training process of the entire CNN model.
[0004] NVDLA (NVIDIA Deep Learning Accelerator) is an open source deep learning hardware accelerator architecture designed to provide high-performance, energy-efficient deep learning inference acceleration. NVDLA has a flexible architecture design, supports multiple data precisions and neural network structures, and can adapt to different application requirements. It achieves efficient acceleration of CNN through dedicated hardware units such as convolution kernels and activation function units. NVDLA is widely used in edge computing devices such as smartphones, drones, self-driving cars, etc. to achieve real-time image recognition, object detection and other deep learning tasks. NVDLA is a scalable hardware architecture designed to provide high-throughput and energy-efficient optimized deep learning inference solutions. Figure 1 The figure shows the composition of the hardware platform NVDLA. Its design mainly includes convolution pipeline, single point data processor (SDP), plane data processor (PDP) and bridge DMA (BDMA). Each component has a specific task and works together to perform reasoning of deep learning models.
[0005] Although hardware accelerators such as NVDLA have achieved remarkable results in accelerating deep learning applications, they still have some limitations, such as insufficient resource utilization, memory bandwidth limitations, fixed operator size, lack of flexible adjustment mechanisms, and insufficient pipeline efficiency, which limit the further improvement of accelerator performance and the efficient deployment of deep learning models on hardware.
[0006] It should be noted that the information disclosed in the above background technology section is only used for understanding the background of the present application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention
[0007] The main purpose of the present invention is to overcome the defects of the above-mentioned background technology and provide a convolutional neural network acceleration device based on pipeline design to improve hardware utilization, shorten model running time, and optimize computing resource allocation.
[0008] To achieve the above object, the present invention adopts the following technical solutions:
[0009] A convolutional neural network acceleration device based on pipeline design has a three-layer pipeline design at the hardware level, and the three-layer structure includes:
[0010] Data access layer, used to efficiently transfer input data and weight data from on-chip or off-chip memory to on-chip cache;
[0011] A convolutional computing layer, used to perform convolutional computing of a convolutional neural network; wherein the convolutional computing layer generates an instruction sequence according to the data in the on-chip cache and predefined convolution parameters, and uses the instruction sequence to guide the execution of the convolutional computing;
[0012] The single-point computing layer is used to perform a series of single-data-point operations on the results of the convolution calculation to complete the post-processing operations before the convolutional neural network outputs the results;
[0013] Among them, after the previous convolution operation is completed, the data access layer reads the next batch of data from the on-chip or off-chip memory and stores it in the on-chip cache. Subsequently, the convolution calculation layer generates the instruction sequence for calculation based on the data in the on-chip cache and the convolution parameters, and the calculation result is transmitted to the single-point calculation layer for the single data point operation.
[0014] Further:
[0015] The data access layer includes a convolution data memory accessor CDMA and a convolution buffer CBUF. The convolution data memory accessor CDMA is used to manage direct memory access operations of data. It obtains input data and weight data from on-chip or off-chip memory, and rearranges and converts the format of the obtained data according to the requirements of pipeline processing, and stores them in the convolution buffer CBUF in a corresponding order. The convolution buffer CBUF serves as a buffer storage area for temporarily storing input data and weight data, alleviating the speed mismatch between data transmission and calculation, so that it can be quickly provided to the convolution calculation layer when needed.
[0016] The convolution buffer CBUF can also temporarily store the intermediate results of the convolution calculation of the convolution calculation layer and write them into the memory buffer WMB.
[0017] The convolution computing layer includes a convolution sequence generator CSC, a convolution multiplication-addition accumulator CMAC and a convolution accumulation-accumulator CACC. The convolution sequence generator CSC generates an instruction sequence according to the data in the on-chip cache and predefined convolution parameters to instruct the convolution multiplication-addition accumulator CMAC to perform convolution multiplication-addition operations according to the instruction sequence, and pass the results to the convolution accumulation-accumulator CACC for accumulation operations.
[0018] The convolution sequence generator CSC also divides and rearranges the input feature map and convolution kernel according to rules to adapt to the parallel computing requirements of the convolution multiplication and accumulation unit CMAC.
[0019] The convolution multiply-add accumulator CMAC includes two parts, CMAC_A and CMAC_B, each of which has a separate control status block CSB interface and register file to support parallel computing.
[0020] The calculation result of the convolution calculation layer is directly transmitted to the single data point processor SDP of the single point calculation layer through the transmission bypass to perform the single data point operation, such as bias addition, activation function calculation and normalization.
[0021] For convolution calculation, a greedy algorithm is used as the search strategy to gradually increase the size of the convolution operator starting from the minimum size. After each size adjustment, the computational efficiency and resource utilization under the hardware resource constraints are evaluated, so as to find the operator size that can maximize the computational efficiency and resource utilization while meeting the hardware resource constraints.
[0022] The size of the convolution operator searched satisfies the following hardware resource limitation constraints: the size of the convolution operator determined by the size of the input feature map and the convolution kernel (weight matrix) is the 2^nth power of the calculation array size 8x8, and the total memory occupied by the input feature map and the convolution kernel does not exceed half the capacity of the on-chip cache of the convolution calculation layer.
[0023] A computing and processing device comprises the convolutional neural network acceleration device based on pipeline design.
[0024] The present invention has the following beneficial effects:
[0025] The convolutional neural network acceleration device based on pipeline design of the present invention has a three-layer pipeline design at the hardware level, adopting a three-layer structure of data access layer, convolution calculation layer and single-point calculation layer, respectively optimizing data access, convolution calculation and single-point calculation tasks to achieve parallelization and pipeline of the calculation process. This design not only improves the speed and efficiency of data processing, but also significantly improves hardware utilization by reducing calculation delays and optimizing resource allocation.
[0026] In the preferred solution, the present invention also uses a greedy algorithm to automatically find the optimal convolution operator size configuration to fully utilize hardware resources and reduce unnecessary calculation and memory consumption. By fine-tuning the operator size, the present invention can find the best configuration solution for different CNN models and hardware platforms, thereby further improving computing efficiency and performance.
[0027] The convolutional neural network acceleration device of the present invention can significantly improve the deployment efficiency of the convolutional neural network (CNN) on the NVDLA accelerator, and provides an efficient and flexible optimization scheme for deploying deep learning models on the NVDLA accelerator. In the preferred scheme, through the combination of pipeline design at the hardware level and convolution operator size search that adapts to hardware resource limitations, the hardware utilization rate and the running speed of the model can be significantly improved, and the allocation of computing resources can be optimized to meet the growing demand for deep learning applications.
[0028] Experimental results show that the present invention can significantly improve the operating efficiency and hardware resource utilization of the CNN model on the NVDLA accelerator.
[0029] Other beneficial effects of the embodiments of the present invention will be further described below. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a diagram of the composition of the hardware platform NVDLA.
[0031] Figure 2 Schematic diagram for comparing the three-stage pipeline structure of an embodiment of the present invention.
[0032] Figure 3 Schematic diagram of the convolution operator calculation process under the pipeline of an embodiment of the present invention.
[0033] Figure 4 Schematic diagram of convolution operator splitting according to an embodiment of the present invention.
[0034] Figure 5 Schematic diagram of a convolution operator size search process according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope and application of the present invention.
[0036] See also Figure 2 and Figure 3 The embodiment of the present invention provides a convolutional neural network acceleration device based on pipeline design, which has a three-layer pipeline design at the hardware level, and the three-layer structure includes a data access layer, a convolution calculation layer and a single-point calculation layer. The data access layer is used to efficiently transfer input data and weight data from on-chip or off-chip memory to on-chip cache; the convolution calculation layer is used to perform convolution calculation of convolutional neural network; wherein the convolution calculation layer generates an instruction sequence according to the data in the on-chip cache and predefined convolution parameters, and uses the instruction sequence to guide the execution of convolution calculation; the single-point calculation layer is used to perform a series of single data point operations on the result of convolution calculation to complete the post-processing operation before the convolutional neural network outputs the result; wherein, after the previous convolution operation is completed, the data access layer reads the next batch of data from the on-chip or off-chip memory and stores it in the on-chip cache, and then the convolution calculation layer generates the instruction sequence according to the data in the on-chip cache and the convolution parameters to perform calculation, and the calculation result is transmitted to the single-point calculation layer for the single data point operation.
[0037] In a preferred embodiment, the data access layer includes a convolution data memory accessor CDMA and a convolution buffer CBUF. The convolution data memory accessor CDMA is used to manage direct memory access operations of data. It obtains input data and weight data from on-chip or off-chip memory, and rearranges and converts the format of the obtained data according to the requirements of pipeline processing, and stores them in the convolution buffer CBUF in a corresponding order. The convolution buffer CBUF serves as a buffer storage area for temporarily storing input data and weight data, alleviating the speed mismatch between data transmission and calculation, so that it can be quickly provided to the convolution calculation layer when needed.
[0038] In a preferred embodiment, the convolution calculation layer includes a convolution sequence generator CSC, a convolution multiplication-addition accumulator CMAC and a convolution multiplication-addition accumulator CACC, and the convolution sequence generator CSC generates an instruction sequence according to the data in the on-chip cache and predefined convolution parameters to instruct the convolution multiplication-addition accumulator CMAC to perform convolution multiplication-addition operations according to the instruction sequence, and pass the results to the convolution multiplication-addition accumulator CACC for accumulation operations. Preferably, the convolution sequence generator CSC also divides and rearranges the input feature map and convolution kernel according to the rules to adapt to the parallel computing requirements of the convolution multiplication-addition accumulator CMAC. Preferably, the convolution multiplication-addition accumulator CMAC includes two parts, CMAC_A and CMAC_B, each of which has a separate control status block CSB interface and register file to support parallel computing.
[0039] In a preferred embodiment, the calculation results of the convolution calculation layer are directly transmitted to the single data point processor SDP of the single point calculation layer through a transmission bypass to perform the single data point operations, such as bias addition, activation function calculation and normalization.
[0040] In a preferred embodiment, a greedy algorithm is used as a search strategy to gradually increase the size of the convolution operator starting from the minimum size, wherein after each size adjustment, the computational efficiency and resource utilization under the hardware resource constraints are evaluated, so as to find the operator size that can maximize the computational efficiency and resource utilization while meeting the hardware resource constraints.
[0041] The specific embodiments of the present invention are further described below.
[0042] In one embodiment, a convolutional neural network acceleration device based on pipeline design and convolution operator size optimization improves the deployment efficiency and performance of CNN models on NVDLA accelerators. The device combines the characteristics of hardware accelerators and the computing requirements of deep learning models, and achieves efficient acceleration of CNN reasoning processes through a carefully designed pipeline structure and intelligent operator size search strategy.
[0043] This embodiment is based on the NVDLA hardware platform. The convolution pipeline is mainly responsible for performing convolution operations, which are the most basic and computationally intensive operations in CNN. In this embodiment, the pipeline includes a convolution data memory accessor (CDMA), a convolution buffer (CBUF), a convolution sequence generator (CSC), a convolution multiply-add accumulator (CMAC), and a convolution accumulator (CACC). The main responsibility of the CDMA component is to obtain data from external memory (such as SRAM or DRAM) and store them in the CBUF in an appropriate order. This process involves data rearrangement and format conversion to ensure that subsequent calculations can be performed efficiently. CBUF is a special buffer for storing input pixel data, input feature data, weight data, and write memory buffer (WMB) data obtained by CDMA. These data are the basis of convolution calculations and need to be quickly accessed and processed. The role of the CSC component is to generate a sequence to control the convolution operation. It generates an instruction sequence based on the data in CBUF and predefined convolution parameters to guide the CMAC component to perform specific calculations. CMAC is the core unit that performs multiplication and addition operations. It receives instructions and data from CSC and performs calculations. CMAC is divided into two parts, CMAC_A and CMAC_B, each with a separate control status block (CSB) interface and register file to support parallel computing. The CACC component is the convolution accumulator, which is responsible for accumulating the partial sums output by CMAC. This process involves summarizing and integrating the intermediate results in preparation for subsequent activation and pooling operations.
[0044] In the convolution pipeline, the flow of data and calculations is strictly in a predetermined order. After the previous convolution operation is completed, the CDMA reads the next batch of data from the on-chip or off-chip memory and stores it in the CBUF. Subsequently, the CSC generates a control sequence based on the data and convolution parameters in the CBUF and sends it to the CMAC for calculation. The CMAC performs multiplication and addition operations and passes the results to the CACC for accumulation. Finally, the accumulated results can be directly transmitted to the SDP through the transmission bypass for single-point data operations such as bias superposition and activation function calculation.
[0045] like Figure 2 and Figure 3 As shown in the figure, in terms of pipeline design, the present invention adopts a three-layer structure, which optimizes data access, convolution calculation and single-point calculation tasks respectively to achieve parallelization and pipeline of the calculation process. This design not only improves the speed and efficiency of data processing, but also significantly improves hardware utilization by reducing calculation delay and optimizing resource allocation.
[0046] In a preferred embodiment, the present invention uses a greedy algorithm to automatically find the optimal convolution operator size configuration to fully utilize hardware resources and reduce unnecessary calculation and memory consumption. By fine-tuning the operator size, the device can find the best configuration solution for different CNN models and hardware platforms, thereby further improving computing efficiency and performance.
[0047] The convolutional neural network acceleration device of the present invention provides an efficient and flexible optimization solution for deploying deep learning models on the NVDLA accelerator. Through the combination of pipeline design and convolution operator size search, the device can significantly improve the running speed and hardware utilization of the model, meeting the growing demand for deep learning applications.
[0048] 1. Pipeline design
[0049] like Figure 2 and Figure 3 As shown, the present invention has a three-layer structure of data access layer, convolution calculation layer and single-point calculation layer in terms of pipeline design, which are optimized for data access, convolution calculation and single data point calculation tasks respectively to achieve parallelization and pipelining of the calculation process. Figure 3 The convolution operator calculation process under the pipeline is shown.
[0050] Data access layer: The main task of this layer is to efficiently transfer input data and weights from external memory to the on-chip cache. To achieve this goal, the embodiment of the present invention adopts CDMA (Convolutional DMA) and CBUFF (Convolution Buffer) components. CDMA is responsible for managing direct memory access (DMA) of data, while CBUFF serves as a temporary storage area for data to alleviate the speed mismatch between data transmission and calculation. By optimizing the scheduling strategy of DMA and the caching strategy of CBUFF, the delay and waiting time of data transmission can be reduced, and the data access efficiency can be improved.
[0051] Convolutional calculation layer: This layer is responsible for performing the core operation in CNN - convolution calculation. The embodiment of the present invention uses CSC (Convolutional Striping Configuration), CMAC (Convolutional MAC Array) and CACC (Convolutional Accumulator) components to achieve efficient convolution operations. CSC is responsible for splitting and rearranging the input feature map and convolution kernel according to certain rules to meet the parallel computing requirements of the CMAC array. The CMAC array is responsible for performing multiplication and addition operations, while CACC is responsible for accumulating and outputting the calculation results. Through the coordinated optimization of these components, fast data processing and efficient computing resource utilization can be achieved.
[0052] Single-point calculation layer: After the convolution calculation, a series of single-data-point operations are usually required on the calculation results, such as bias addition, activation function application, and normalization. The embodiment of the present invention uses the SDP (Single Data Point) component to perform these operations. SDP supports a variety of single-point operations and can achieve rapid processing of these operations through pipeline technology. By optimizing the configuration and scheduling of SDP, the speed and efficiency of data processing can be further improved.
[0053] 2. Convolution operator size search
[0054] Operator splitting is a key technology in deep learning acceleration, especially when deploying convolutional neural networks (CNNs) to hardware accelerators. Its basic principle and execution process mainly revolve around the reasonable splitting of operators according to the limitations of hardware resources (such as buffer size) and the feature maps and weights of the convolutional layers.
[0055] The basic principle of operator splitting is to decompose a large computational task (such as the computation of a complete convolutional layer) into multiple smaller, more manageable and executable subtasks. This split takes into account the physical limitations of the hardware accelerator, such as the available memory (buffer) size, and the strategies adopted to optimize computational efficiency and reduce resource consumption.
[0056] In the context of convolutional layers, an "operator" usually refers to a unit that performs a convolution operation, which involves feature maps (input data) and weights (convolution kernels). The purpose of operator splitting is to adapt to hardware limitations and improve execution efficiency by more reasonably arranging computing tasks and data flows without changing the final calculation results.
[0057] Figure 4 The process of splitting the convolution operator in an embodiment of the present invention is shown. Figure 5 The figure shows the convolution operator size search process in an embodiment of the present invention.
[0058] In order to further optimize the deployment effect of the convolutional neural network on the NVDLA accelerator, the embodiment of the present invention uses a greedy algorithm to search for the size of the convolution operator. The goal of the algorithm is to find the size configuration of the split convolution operator that can maximize the computing efficiency and resource utilization under the premise of meeting the hardware resource constraints.
[0059] Search strategy: The embodiment of the present invention adopts a greedy algorithm to search for the size of the convolution operator. The algorithm starts from the minimum size and gradually increases the size of the convolution operator until the hardware resource limit is reached or the performance is no longer improved. During the search process, the embodiment of the present invention takes into account the constraints of hardware resource limitations, that is, the convolution operator size (feature map and weight) should be the 2^nth power of the calculation array size (8x8), and the sum of the two sizes should be less than the size of CBUFF / 2 (16x32KB).
[0060] Performance evaluation: For each convolution operator size configuration, the embodiment of the present invention actually runs the convolution layer on the NVDLA accelerator and measures its running time and hardware utilization. The running time is measured by the average time of multiple actual runs, and the hardware utilization is estimated by observing the MAC array waveform, that is, looking at the hardware active time and dividing it by the total convolution layer running time.
[0061] Optimization results: By comparing the performance indicators under different configurations, the embodiment of the present invention selects the configuration with the shortest running time and the highest hardware utilization as the optimal solution. The experimental results show that the convolution operator size search optimization of the present invention can significantly improve the running efficiency and hardware resource utilization of the CNN model on the NVDLA accelerator.
[0062] Performance Verification
[0063] In order to verify the effectiveness and performance advantages of the present invention, a series of experiments were conducted on a modified NVDLA accelerator deployed on an FPGA. The following are the specific settings and test environment of the experiment:
[0064] Experimental setup and testing environment
[0065] Hardware configuration: Use the NVDLA accelerator deployed on the FPGA, configured as an 8x8 multiplication-addition computing array, with 16 32KB on-chip cache banks.
[0066] Software environment: On Linux system, programming is implemented using C++ language.
[0067] Test model: Select classic convolutional neural networks such as ResNet50 and VGG for testing.
[0068] Test model description
[0069] VGG: The VGG network is a classic deep convolutional neural network known for its simple and unified structure. The VGG network gradually increases the depth of the network by repeatedly using small-sized convolution kernels and maximum pooling layers, thereby improving the model's expressiveness and recognition accuracy. The VGG network performs well in tasks such as image classification and recognition, and is one of the important benchmarks in the field of deep learning.
[0070] ResNet50: ResNet50 is a variant of the residual network (ResNet) with 50 layers of depth. ResNet solves the gradient vanishing and exploding problems in deep networks by introducing residual connections, allowing the network to be trained efficiently. ResNet50 has been widely used in multiple deep learning tasks for its excellent performance and efficiency, and has become an important benchmark for deep learning research and applications.
[0071] Experimental results and performance analysis
[0072] Pipeline acceleration effect: On the ResNet50 model, the average running time after pipeline optimization was reduced from 159.90ms to 127.99ms, and the performance was improved by 20%.
[0073] Convolution operator size search effect: After optimizing the operator size of the first layer of ResNet50 convolution, the average running time was reduced by 25.1% compared with the default configuration, and the hardware utilization rate was increased from 67% to 89%.
[0074] Full network optimization effect: On the entire ResNet50 and VGG networks, after layer-by-layer operator configuration optimization, the running time was improved by 22% and 5%, 35% and 10% respectively compared with the original toolchain and TVM method.
[0075] Application Examples
[0076] Edge computing devices: Deploy CNN models using this optimization tool on edge computing devices such as smartphones or self-driving cars to achieve faster image processing and real-time decision-making, making the devices more intelligent and responsive.
[0077] Real-time image analysis: In fields such as security monitoring or medical image analysis, the device can accelerate the reasoning process of the CNN model, realize real-time analysis and processing of video streams or medical images, and improve the efficiency and accuracy of the analysis.
[0078] An embodiment of the present invention further provides a storage medium for storing a computer program, which at least performs the above method when executed.
[0079] An embodiment of the present invention further provides a control device, comprising a processor and a storage medium for storing a computer program; wherein the processor is configured to execute at least the method described above when executing the computer program.
[0080] An embodiment of the present invention further provides a processor, wherein the processor executes a computer program and at least executes the method described above.
[0081] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a ferromagnetic random access memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The storage medium described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0082] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0083] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0084] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0085] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0086] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0087] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0088] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0089] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0090] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art of the present invention, several equivalent substitutions or obvious variations can be made without departing from the concept of the present invention, and the performance or use is the same, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A convolutional neural network acceleration device based on pipeline design, characterized in that: A pipeline design with a three-layer structure at the hardware level, the three-layer structure includes: Data access layer, used to efficiently transfer input data and weight data from on-chip or off-chip memory to on-chip cache; A convolutional computing layer, used to perform convolutional computing of a convolutional neural network; wherein the convolutional computing layer generates an instruction sequence according to the data in the on-chip cache and predefined convolution parameters, and uses the instruction sequence to guide the execution of the convolutional computing; The single-point computing layer is used to perform a series of single-data-point operations on the results of the convolution calculation to complete the post-processing operations before the convolutional neural network outputs the results; Among them, after the previous convolution operation is completed, the data access layer reads the next batch of data from the on-chip or off-chip memory and stores it in the on-chip cache. Subsequently, the convolution calculation layer generates the instruction sequence for calculation based on the data in the on-chip cache and the convolution parameters, and the calculation result is transmitted to the single-point calculation layer for the single data point operation.
2. The convolutional neural network acceleration device based on pipeline design as claimed in claim 1, characterized in that: The data access layer includes a convolution data memory accessor CDMA and a convolution buffer CBUF. The convolution data memory accessor CDMA is used to manage direct memory access operations of data. It obtains input data and weight data from on-chip or off-chip memory, and rearranges and converts the format of the obtained data according to the requirements of pipeline processing, and stores them in the convolution buffer CBUF in a corresponding order. The convolution buffer CBUF serves as a buffer storage area for temporarily storing input data and weight data, alleviating the speed mismatch between data transmission and calculation, so that it can be quickly provided to the convolution calculation layer when needed.
3. The convolutional neural network acceleration device based on pipeline design as claimed in claim 2, characterized in that: The convolution buffer CBUF can also temporarily store the intermediate results of the convolution calculation of the convolution calculation layer and write them into the memory buffer WMB.
4. The convolutional neural network acceleration device based on pipeline design according to any one of claims 1 to 3, characterized in that: The convolution computing layer includes a convolution sequence generator CSC, a convolution multiplication-addition accumulator CMAC and a convolution accumulation-accumulator CACC. The convolution sequence generator CSC generates an instruction sequence according to the data in the on-chip cache and predefined convolution parameters to instruct the convolution multiplication-addition accumulator CMAC to perform convolution multiplication-addition operations according to the instruction sequence, and pass the results to the convolution accumulation-accumulator CACC for accumulation operations.
5. The convolutional neural network acceleration device based on pipeline design as claimed in claim 4, characterized in that: The convolution sequence generator CSC also divides and rearranges the input feature map and convolution kernel according to rules to adapt to the parallel computing requirements of the convolution multiplication and accumulation unit CMAC.
6. The convolutional neural network acceleration device based on pipeline design as claimed in claim 4 or 5, characterized in that: The convolution multiply-add accumulator CMAC includes two parts, CMAC_A and CMAC_B, each of which has a separate control status block CSB interface and register file to support parallel computing.
7. The convolutional neural network acceleration device based on pipeline design according to any one of claims 1 to 6, characterized in that: The calculation result of the convolution calculation layer is directly transmitted to the single data point processor SDP of the single point calculation layer through the transmission bypass to perform the single data point operation, such as bias addition, activation function calculation and normalization.
8. The convolutional neural network acceleration device based on pipeline design according to any one of claims 1 to 7, characterized in that: For convolution calculation, a greedy algorithm is used as the search strategy to gradually increase the size of the convolution operator starting from the minimum size. After each size adjustment, the computational efficiency and resource utilization under the hardware resource constraints are evaluated, so as to find the operator size that can maximize the computational efficiency and resource utilization while meeting the hardware resource constraints.
9. The convolutional neural network acceleration device based on pipeline design as claimed in claim 8, characterized in that: The size of the convolution operator searched satisfies the following hardware resource limitation constraints: the size of the convolution operator determined by the size of the input feature map and the convolution kernel is the 2^nth power of the calculation array size 8x8, and the total memory occupied by the input feature map and the convolution kernel does not exceed half the capacity of the on-chip cache of the convolution calculation layer.
10. A computing device, characterized in that: It comprises a convolutional neural network acceleration device based on pipeline design as described in any one of claims 1 to 9.
Citation Information
Cited By
Accelerated operation method and device suitable for neural network normalization calculation
CN119558365A
Multi-model combination development platform, development method and related device
CN119810545A
Multi-model combination development platform, development method and related devices
CN119810545B
Data processing system and method, hardware accelerator and electronic equipment
CN121638344A
Deep neural network reasoning method based on GPU
CN122285544A
