A cnn acceleration system based on in-memory computing macro
By using a CNN acceleration system based on in-memory computing macros, the data transmission and computation process are optimized, solving the problems of data movement and repeated access in CNN computation. This achieves high energy efficiency and low latency computation results, making it suitable for neural network deployment on edge devices.
Patent Information
- Application Number
- CN202410881966.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-07-03
AI Technical Summary
In existing technologies, CNN computation suffers from a large amount of data movement and repeated access, resulting in low computational efficiency and high energy consumption.
A CNN acceleration system based on in-memory computation macro is adopted, including a temporary storage module, a state control module, a ping-pong buffer module, an in-memory computation cluster module, a weight buffer module, and an addition tree module. It directly accesses off-chip memory through a dedicated bus and interface, uses in-memory computation macro to perform convolution and fully connected operations, and combines the ping-pong buffer and weight buffer modules to optimize data transmission and prefetching.
It achieves high energy efficiency and low latency CNN acceleration, reduces data latency between the CPU and peripherals, reduces weight update latency, improves computational efficiency and energy efficiency, and is suitable for neural network deployment on edge devices.
Smart Images

Figure CN119005281B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a CNN acceleration system based on in-memory computing macro. Background Technology
[0002] Computing in Memory (CIM) is a computing architecture that integrates data processing and storage functions onto a single chip, thereby reducing the need for data to move between the processor and memory. This architecture can significantly improve computing efficiency, reduce power consumption, and accelerate processing speed, especially in scenarios requiring large amounts of data movement and repeated access, such as deep learning and big data analytics.
[0003] CNN, or Convolutional Neural Network, is a deep learning architecture particularly well-suited for processing data with a grid structure, such as images (2D grids) and videos (3D grids). CNNs identify patterns and features in images by mimicking the workings of the human visual system. Below are some key concepts and components of CNNs:
[0004] Convolutional Layer: This is the core of a CNN, responsible for extracting local features from input data (such as images). Each convolutional layer consists of multiple convolutional kernels (or filters) that slide across the input data, calculating a weighted sum of local regions to generate a feature map.
[0005] Activation Function: After the convolutional layer, there is usually a non-linear activation function, such as ReLU (Rectified Linear Unit), which can help the network learn more complex features.
[0006] Pooling Layer: Pooling layers are used to reduce the spatial size of feature maps, thereby reducing the number of parameters and computational cost, while making feature detection more robust. Common pooling operations include max pooling and average pooling.
[0007] Fully Connected Layer: In the last few layers of a CNN, feature maps are flattened and passed to fully connected layers. These layers map the learned high-level features to the final output, such as classification labels.
[0008] Batch Normalization: This is a technique used to accelerate the training process and improve the stability of the model by reducing the internal covariate bias by normalizing the input of the layers.
[0009] Dropout: This is a regularization technique that prevents overfitting by randomly dropping some network connections during training.
[0010] Loss function: Used to evaluate the difference between the model's prediction and the true label. Common loss functions include cross-entropy loss and mean squared error loss.
[0011] Optimizer: Used to adjust the weights and biases of a network to minimize the loss function. Common optimizers include SGD (Stochastic Gradient Descent).
[0012] As can be seen, CNNs involve a large amount of data movement and repeated access, so how to accelerate CNNs based on in-memory computing has become an urgent technical problem to be solved. Summary of the Invention
[0013] In view of the above problems, this application is proposed to provide a CNN acceleration system based on in-memory computation macro that overcomes or at least partially solves the above problems. The technical solution is as follows:
[0014] This application provides a CNN acceleration system based on in-memory computation macro, including: a temporary storage module, a state control module, a ping-pong buffer module, an in-memory computation cluster module, a weight buffer module, an addition tree module, and a data reconfigurability control module;
[0015] The central processing unit (CPU) sends instructions representing configuration registers to the state control module of the CNN acceleration system via the bus. The state control module sends the instructions of the first layer of the CNN model to the data reconfigurable control module for instruction decoding, resulting in sequential weight update instructions, activation prefetch instructions, in-memory computation instructions, and result write-back instructions.
[0016] First, the weight update instruction is executed. The weight buffer module reads the weight data from the off-chip memory through the local dedicated four-way serial peripheral interface bus. Then, the weight data in the weight buffer module is written into the in-memory computing cluster module.
[0017] After the weight update instruction is executed, the activation prefetch instruction is executed, and the feature data in the temporary storage module is input into the ping-pong buffer module. When writing to the ping-pong buffer, the data in the ping-pong buffer is written to the in-memory computing macro of the in-memory computing cluster module; when writing to the ping-pong buffer, the data in the ping-pong buffer is written to the in-memory computing macro of the in-memory computing cluster module, and so on until all the input feature data of one layer is written to the in-memory computing macro.
[0018] Then, the in-memory computation instruction is started, the corresponding in-memory computation macro in the in-memory computation cluster module is enabled to start the computation, and after the computation is completed, a signal indicating that the current layer operation is completed is sent to the status control module.
[0019] The addition tree module accumulates the output results of each in-memory macro and, upon receiving a write-back instruction, sends the accumulated result to the temporary storage module for the next layer of CNN computation.
[0020] In one possible implementation, the temporary storage module and the state control module are respectively connected to the CPU as independent endpoints via a bus.
[0021] In one possible implementation, the weight buffer module has the same capacity as the in-memory computing cluster module.
[0022] In one possible implementation, the weight buffer module reads the weight data from the off-chip memory again through a local dedicated four-way serial peripheral interface bus to prepare for the arrival of the next weight update instruction.
[0023] In one possible implementation, the in-memory computing cluster module consists of multiple in-memory computing macros.
[0024] In one possible implementation, the temporary storage module stores the input feature data of the first layer of the CNN model, waiting for the activation prefetch instruction.
[0025] In one possible implementation, the temporary storage module also stores the activation data of the intermediate layers of the CNN model.
[0026] In one possible implementation, the state control module includes a memory-mapped state register file and an instruction register cache file.
[0027] In one possible implementation, the weight data of the CNN model is distributed across multiple in-memory computation macros. The in-memory computation macros used for weight mapping of each layer are sent by the CPU to the registers of the in-memory computation cluster module of the CNN acceleration system via the bus, thereby enabling the relevant in-memory computation macros to be in a working state, while other in-memory computation macros are in a non-working state.
[0028] In one possible implementation, the in-memory computation Macro performs convolution and fully connected operations on the CNN model, while the nonlinear operations in the CNN model are handled by the CPU.
[0029] By employing the above technical solutions, the CNN acceleration system based on in-memory computing macro provided in this application embodiment features high energy efficiency and low latency. The temporary storage module and the state control module, each acting as independent endpoints connected to the CPU via a bus, significantly reduce data latency between the CPU and peripherals. A dedicated four-way serial peripheral interface bus is used between the CNN acceleration system and the off-chip memory controller to directly read off-chip flash data, which helps reduce weight update latency during CNN inference. The ping-pong buffer module helps hide the input activation prefetch time, thereby reducing latency, and is compatible with in-memory computing. The weight buffer module of the same capacity in the cluster module can prefetch weights off-chip, which has lower power consumption and less latency than directly accessing off-chip memory. Using in-memory computing macros to perform convolution and fully connected operations is inherently energy efficient. The in-memory computing cluster module consists of multiple in-memory computing macros. To address the difference in the number of parameters between different layers of the CNN algorithm, each in-memory computing macro has an independent enable switch and can be configured to operate according to the specific number of parameters involved in the operation. This reduces power consumption and improves energy efficiency. Attached Figure Description
[0030] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0031] Figure 1 This paper illustrates the architecture of a CNN acceleration system based on in-memory computing macro provided in an embodiment of this application.
[0032] Figure 2 This diagram illustrates the mapping between input feature data and weight data provided in an embodiment of this application.
[0033] Figure 3 A schematic diagram of the operation of the ping-pong buffer module provided in an embodiment of this application is shown. Detailed Implementation
[0034] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the term "comprising" and its variations should be interpreted as open-ended terms meaning "including but not limited to."
[0036] This application provides a CNN acceleration system based on in-memory computation macro, such as... Figure 1 As shown, this CNN acceleration system based on in-memory computation macro, also known as CIMA, can specifically include a scratchpad module, a status control module, a ping-pong buffer module, an in-memory computation cluster module, a weight buffer module, an add tree module, and a data reconfigurable control module (DREC module).
[0037] The in-memory computation macro here can also be written as CIM Macro. CIM Macro can be responsible for performing specific functions or tasks, such as convolution operations or fully connected operations.
[0038] The scratch pad module is used to receive the activation data from the first layer of the CNN and can also store activation data from the intermediate layers without overflowing into the main memory of the CPU (Central Processing Unit) or off-chip.
[0039] Here, the storage hierarchy is typically as follows, from fastest to slowest:
[0040] Registers: Internal storage units of the CPU used to store instructions and data, and have the fastest access speed.
[0041] Cache: A high-speed memory located inside or adjacent to the CPU, used to temporarily store frequently accessed data and instructions.
[0042] Main memory (RAM): The computer's primary storage resource, slower than cache but faster than external storage.
[0043] Off-chip storage (such as hard drives): Storage devices located outside the CPU, with the slowest access speed but the largest capacity.
[0044] Ping-pong buffer module: The ping-pong input buffer at the CIM Macro input helps improve accelerator utilization and hide input latency.
[0045] The in-memory computing cluster module (CIM cluster module) consists of multiple CIM macros forming a larger-scale CIM array to accommodate the numerous vector-matrix multiplication operations in CNNs. Multiple CIM macros facilitate divide-and-conquer; unused CIM macros are disabled, thus reducing power consumption. It should be noted that... Figure 1 The CIM Macro0 to CIM Macro 7 shown are merely illustrative and do not limit the scope of this embodiment.
[0046] Weight buffer module: used for cached prefetching of weight data, which helps reduce the latency of updating weights directly from off-chip.
[0047] Add tree module: accumulates the output results of each CIM Macro.
[0048] Status control module (i.e. Status ctrl module): contains memory-mapped status register file and instruction register cache file.
[0049] The Data Reconfigurable Control Module (DREC) decodes commands, which can be categorized into four types: weight update commands, input activation prefetch commands, in-memory calculation commands, and result write-back commands. In-memory calculation commands can also be written as CIM calculation commands.
[0050] exist Figure 1 In this context, the working principle of a CNN acceleration system is as follows:
[0051] The central processing unit (CPU) sends instructions representing configuration registers to the state control module of the CNN acceleration system via the bus. The state control module sends the instructions of the first layer of the CNN model to the data reconfigurable control module for instruction decoding, resulting in sequential weight update instructions, activation prefetch instructions, in-memory computation instructions, and result write-back instructions.
[0052] First, the weight update instruction is executed. The weight buffer module reads the weight data from the off-chip memory through the local dedicated four-way serial peripheral interface (i.e., SPI, Serial Peripheral Interface) bus. Then, the weight data in the weight buffer module is written into the in-memory computing cluster module.
[0053] After the weight update instruction is executed, the activation prefetch instruction is executed, and the feature data in the temporary storage module is input into the ping-pong buffer module. When writing to the ping-pong buffer, the data in the ping-pong buffer is written to the in-memory computing macro of the in-memory computing cluster module; when writing to the ping-pong buffer, the data in the ping-pong buffer is written to the in-memory computing macro of the in-memory computing cluster module, and so on until all the input feature data of one layer is written to the in-memory computing macro.
[0054] Then, the in-memory computation instruction is started, the corresponding in-memory computation macro in the in-memory computation cluster module is enabled to start the computation, and after the computation is completed, a signal indicating that the current layer operation is completed is sent to the status control module.
[0055] The addition tree module accumulates the output results of each in-memory macro and, upon receiving a write-back instruction, sends the accumulated result to the temporary storage module for the next layer of CNN computation.
[0056] The CNN acceleration system based on in-memory computing macros provided in this application has the characteristics of high energy efficiency and low latency. The temporary storage module and the state control module are connected to the CPU as independent endpoints via a bus, which can greatly reduce the latency of data entering and leaving the CPU and peripherals. A dedicated four-way serial peripheral interface bus is used between the CNN acceleration system and the controller of off-chip memory to directly read off-chip flash memory data, which helps to reduce the weight update latency during CNN inference. The ping-pong buffer module helps to hide the input activation prefetch time, thereby reducing latency. Using the weight buffer module, weights can be prefetched off-chip in advance, which has lower energy consumption and less latency than directly accessing off-chip memory. Using in-memory computing macros to perform convolution and fully connected operations is inherently energy efficient. The in-memory computing cluster module consists of multiple in-memory computing macros. To address the difference in the number of parameters between different layers of the CNN algorithm, each in-memory computing macro has an independent working enable switch and can be configured to match the number of parameters involved in the operation to enable the working mode, which can reduce power consumption and thus improve energy efficiency.
[0057] This application provides a possible implementation where the temporary storage module and the state control module are connected to the CPU via a bus as independent endpoints. The bus here can be an AHB bus (Advanced High-performance Bus), a high-performance on-chip bus used to connect different processors and peripherals in a System on Chip (SoC) to achieve high-speed data transfer between the processor core, memory, and peripherals.
[0058] This application provides a possible implementation where the weight buffer module has the same capacity as the in-memory computing cluster module. Using the weight buffer module allows for pre-fetching weights off-chip, resulting in lower power consumption and less latency compared to directly accessing off-chip memory. The off-chip memory can be flash memory or similar devices; this embodiment does not limit this.
[0059] This application provides a possible implementation method in which the weight buffer module reads the weight data on the off-chip memory again through the local dedicated four-way serial peripheral interface bus to prepare for the arrival of the next weight update instruction.
[0060] This application provides a possible implementation method in which the in-memory computing cluster module is composed of multiple in-memory computing macros. In this way, to address the issue of the difference in the number of parameters between different layers of the CNN algorithm, each in-memory computing macro has an independent working enable switch and can be configured to start the working mode according to the specific number of parameters involved in the operation, which can reduce power consumption and thus improve energy efficiency.
[0061] This application provides a possible implementation where a temporary storage module stores the input feature data of the first layer of a CNN model, awaiting activation prefetch instructions. Alternatively, activation data from intermediate layers can also be stored here without overflowing into the CPU's main memory or off-chip memory.
[0062] This application provides a possible implementation method in which the weight data of the CNN model is distributed across multiple in-memory computation macros. The in-memory computation macros used for weight mapping of each layer are sent by the CPU to the registers of the in-memory computation cluster module of the CNN acceleration system via the bus, thereby enabling the relevant in-memory computation macros to be in a working state, while other in-memory computation macros are in a non-working state.
[0063] This application provides a possible implementation method in which the in-memory computation Macro performs convolution and fully connected operations on the CNN model, while the nonlinear operations in the CNN model are handled by the CPU.
[0064] The above introduces Figure 1 The embodiments shown have various implementation methods for each stage. The following will further explain the CNN acceleration system based on in-memory computing macro of this application through specific embodiments.
[0065] exist Figure 1 In the CNN acceleration system architecture diagram shown, the top-level module's interface conforms to the AHB bus protocol, facilitating its subsequent connection to the MCU (Micro Controller Unit) via the AHB bus as a peripheral or coprocessor. The scratch pad module and the status control module (Status ctrl module) are connected to the CPU as independent endpoints via the AHB bus, significantly reducing data latency between the CPU and peripherals. A dedicated four-channel SPI bus is used between the CNN acceleration system and the Flash controller to directly read data from the off-chip flash memory, which helps reduce weight update latency during CNN inference.
[0066] In CNN models, convolution and fully connected operations account for more than 90% of all computations. In-memory computation macros based on SRAM (Static Random Access Memory) are suitable for a large number of vector multiplication operations. Therefore, using in-memory computation macros for fully connected and convolution operations will have a significant speedup effect. Meanwhile, a small number of non-linear operations such as activation and pooling in CNN models can be handled by the CPU. As the main controller of this CNN acceleration system, the CPU allows the software to calculate the output feature map size and the number of CIM macros to be mapped for each layer based on the input feature map size, the number of convolution kernel parameters, and the specific CNN model. This information can then be directly sent to the corresponding registers in the CNN acceleration system. Specifically, assuming convolution operations are performed on the feature maps W, H, and C, and the convolution kernels R, S, and C, with K kernels, LP padding on the left, RP padding on the right, BP padding on the bottom, and TP padding on the top, a horizontal stride of SX, a vertical stride of SY, horizontal kernel dilation of DX, and vertical dilation of DY, and output feature map sizes U, V, and Z, as shown below:
[0067]
[0068] Z = K
[0069] Figure 2This diagram illustrates the mapping of input feature data and weight data provided in this embodiment of the application, specifically the mapping method of input feature maps (IFMs) and convolutional kernels (K*K*D*N) in the CIM Macro. A 3D convolutional kernel of size K×K×D can be unfolded into a long vertical column of length K×K×D, and the number of convolutional kernels (Kernel depth) is equal to N, with a total of N columns of such vertical columns. Therefore, in any layer, the convolutional kernel can be mapped into a large weight matrix whose length and width are equal to K×K×D and N, respectively. Thus, to obtain the total output feature maps (OFMs), in each epoch, a portion of the IFM (shown as a blue cube) will be multiplied by each 3D kernel. For example, initially, the upper right portion of the IFM (blue cube) will be unfolded into a long vertical column and applied to the rows of this large weight matrix. If we assume a single OFM has a size of W×W and a channel depth of N, then in each cycle, there are a total of N such OFMs. The first channel OFM is called the 1st OFM, and the last channel OFM is called the Nth OFM. Thus, the sum of the dot products of the first kernel (i.e., the leftmost column of the weight matrix) will be the first element of the first OFM, the sum of the dot products of the second kernel will be the first element of the second OFM, and so on. Therefore, in the first cycle, the first element of each OFM channel can be obtained from front to back. Since the number of parameters varies greatly between layers of a CNN model, the weight matrix will be distributed across multiple CIM Macros. The CIM Macro used for weight mapping in each layer is sent by the CPU to the register corresponding to the CIM cluster in the CNN acceleration system via the bus, thus enabling the relevant CIM Macro to be active while other CIM Macros are inactive. This helps reduce energy consumption and improve the utilization rate of CIM Macros.
[0070] The workflow is as follows: The CPU sends instructions (i.e., instructions indicating configuration registers, as shown in Table 1 below) to the Status ctrl module of the CNN acceleration system via the bus. Then, the instructions of the first layer of the CNN model can be sent to the DREC module for instruction decoding. This can be divided into four stages of pipeline operation: First, the weight update instruction is executed. The Weight buffer module reads the external Flash weight data through a local dedicated four-channel SPI bus. The Weight buffer module has the same capacity as the CIM cluster module and is used for weight prefetching to reduce the latency of external memory access. Then, the weight data in the Weight buffer module is written to the CIM cluster. The Weight buffer reads Flash data again via SPI to prepare for the arrival of the next Weight update instruction.
[0071] After the Weight update command completes, the Act prefectch command is executed. The Scratch pad module stores the input feature data of the first layer. When the Act prefectch command arrives, the feature data in the Scratch pad is input into the Ping-pong buffer. When writing the pong, the data in the ping is written to the CIM Macro, and when writing the ping, the data in the pong is written to the CIM Macro. This process continues until all the input feature data of the first layer has been written to the CIM Macro. Figure 3 As shown.
[0072] Then, the CIM Macro command is enabled to begin calculation. Once the calculation is complete, a layer_done signal is sent to the Status ctrl module to indicate that the calculation for this layer is finished. The addition tree module will sum the partial outputs of CIMMacro to obtain the final result, and after receiving the Result wb command, it will send the calculation result to the Scrachpad module.
[0073] Table 1 Register settings for the CNN acceleration system
[0074] register describe Bit width CIMMacroenable Indicate which CIM Macros are used 16 bits Weightupdate Weight update 1 bit Actprefectch Activate prefetch 1 bit Resultwb Write the result back 1 bit
[0075] This embodiment features high energy efficiency and low latency. The Scratch pad module and Status ctrl module are connected to the CPU as independent endpoints via the AHB bus, which greatly reduces the latency of data entering and leaving the CPU and peripherals. A dedicated four-channel SPI bus is used between the CNN acceleration system and the Flash controller to directly read off-chip flash data, which helps reduce the weight update latency during CNN inference. The Ping-pong buffer helps hide the input activation prefetch time, thereby reducing latency. Using a weight buffer of the same capacity as the CIM cluster allows for prefetching weights off-chip, resulting in lower energy consumption and less latency than directly accessing off-chip Flash. Using CIM Macros to perform convolution and fully connected operations is inherently energy efficient. The CIM cluster module consists of multiple CIM Macros. To address the difference in parameter amounts between different layers of the CNN algorithm, each CIM Macro has an independent enable switch and can be configured to operate according to the specific number of parameters involved in the operation, thereby reducing power consumption and improving energy efficiency.
[0076] The high energy consumption and bandwidth requirements of neural network models limit the application of artificial intelligence on energy-constrained devices. In-memory computing (CIM), with its high energy efficiency, offers new opportunities for the deployment of neural networks on edge devices. However, the design of a complete CNN acceleration system based on CIM is still in its early stages. This embodiment provides a novel approach to an in-memory computing-based CNN acceleration system, vertically optimizing the system's storage hierarchy and the direction of control and data flow, thereby exhibiting an optimal energy-efficient system that is beneficial for the deployment of neural models on edge devices.
[0077] Those skilled in the art will clearly understand that the specific working process of the systems, devices, and modules described above can be referred to the corresponding process in the foregoing method embodiments. For the sake of brevity, it will not be repeated here.
[0078] Those skilled in the art will understand that the technical solution of this application, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several program instructions to cause an electronic device (e.g., a personal computer, server, or network device) to execute all or part of the steps of the methods described in the embodiments of this application when running the program instructions. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0079] Alternatively, all or part of the steps of the foregoing method embodiments can be implemented by hardware (such as electronic devices like personal computers, servers, or network devices) associated with program instructions. The program instructions can be stored in a computer-readable storage medium. When the program instructions are executed by the processor of the electronic device, the electronic device executes all or part of the steps of the methods described in the embodiments of this application.
[0080] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that within the spirit and principles of this application, modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the corresponding technical solutions to leave the protection scope of this application.
Claims
1. A CNN acceleration system based on in-memory computation macro, characterized in that, include: The module includes a temporary storage area, a state control module, a ping-pong buffer module, an in-memory computing cluster module, a weight buffer module, an addition tree module, and a data reconfigurability control module. The central processing unit (CPU) sends instructions representing configuration registers to the state control module of the CNN acceleration system via the bus. The state control module sends the instructions of the first layer of the CNN model to the data reconfigurable control module for instruction decoding, resulting in sequential weight update instructions, activation prefetch instructions, in-memory computation instructions, and result write-back instructions. First, the weight update instruction is executed. The weight buffer module reads the weight data from the off-chip memory through the local dedicated four-way serial peripheral interface bus. Then, the weight data in the weight buffer module is written into the in-memory computing cluster module. After the weight update instruction is executed, the activation prefetch instruction is executed, and the feature data in the temporary storage module is input into the ping-pong buffer module. When writing to the ping-pong buffer, the data in the ping-pong buffer is written to the in-memory computing macro of the in-memory computing cluster module; when writing to the ping-pong buffer, the data in the ping-pong buffer is written to the in-memory computing macro of the in-memory computing cluster module, and so on until all the input feature data of one layer is written to the in-memory computing macro. Then, the in-memory computation instruction is started, the corresponding in-memory computation macro in the in-memory computation cluster module is enabled to start the computation, and after the computation is completed, a signal indicating that the current layer operation is completed is sent to the status control module. The addition tree module accumulates the output results of each in-memory macro and, upon receiving a write-back instruction, sends the accumulated result to the temporary storage module for the next layer of CNN computation.
2. The CNN acceleration system according to claim 1, characterized in that, The temporary storage module and the state control module are each connected to the CPU via a bus as independent endpoints.
3. The CNN acceleration system according to claim 1 or 2, characterized in that, The weight buffer module has the same capacity as the in-memory computing cluster module.
4. The CNN acceleration system according to claim 1 or 2, characterized in that, The weight buffer module reads the weight data from the off-chip memory again through the local dedicated four-way serial peripheral interface bus to prepare for the arrival of the next weight update instruction.
5. The CNN acceleration system according to claim 1 or 2, characterized in that, The in-memory computing cluster module consists of multiple in-memory computing macros.
6. The CNN acceleration system according to claim 1 or 2, characterized in that, The temporary storage module stores the input feature data of the first layer of the CNN model, waiting for the activation prefetch instruction.
7. The CNN acceleration system according to claim 6, characterized in that, The temporary storage module also stores the activation data of the intermediate layers of the CNN model.
8. The CNN acceleration system according to claim 1 or 2, characterized in that, The status control module includes a memory-mapped status register file and an instruction register cache file.
9. The CNN acceleration system according to claim 1 or 2, characterized in that, The weight data of a CNN model is distributed across multiple in-memory computation macros. The in-memory computation macros used for weight mapping in each layer are sent by the CPU to the registers of the in-memory computation cluster module of the CNN acceleration system via the bus, thereby enabling the relevant in-memory computation macros to be in a working state, while other in-memory computation macros are in a non-working state.
10. The CNN acceleration system according to claim 1 or 2, characterized in that, The in-memory computation macro performs convolution and fully connected operations on the CNN model, while the non-linear operations in the CNN model are handled by the CPU.
Citation Information
Patent Citations
In-memory computing device and method based on ping-pong structure
CN114625691A
Real-time information systems and methodology based on continuous homomorphic processing in linear information spaces
US20170032016A1
