Pulse neural network accelerator, pulse neural network computation method, and computation device
By reconstructing the convolutional layer and the fully connected layer into different processing modes in the edge-type spiking neural network accelerator, and using the array controller and pingping cache to optimize the calculation, the insufficient processing performance and weight of the edge-type accelerator in the existing technology are solved. Solve the problem of low utilization and achieve more efficient computing performance.
Patent Information
- Application Number
- PCT/CN2024/090531
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2024-04-29
- Publication Date
- 2024-10-03
AI Technical Summary
Existing edge-type pulse neural network accelerators have fully deployed customized hardware, which limits the expansion of the scale and structure of the neural network, resulting in insufficient processing performance, low weight utilization of the fully connected layer, and unbalanced calculations.
By reconstructing the convolutional layer and fully connected layer of the spiking neural network into a single time step processing mode and a multi-time step processing mode, the array controller is used to reduce the number of adders per processing unit, improve the reuse rate of weights, and Optimize computational efficiency through pingping cache and membrane potential update modules.
It improves the weight utilization of the fully connected layer, reduces the number of adders inside the processing unit, alleviates the sparse imbalance problem of pulse signals, and improves computing efficiency, especially when processing sparse feature maps, which significantly improves performance.
Smart Images

Figure CN2024090531_03102024_PF_FP_ABST
Abstract
Description
Pulse neural network accelerator, pulse neural network computing method and computing device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 31, 2023, with application number 202310360048.2 and application name “Pulse Neural Network Accelerator, Pulse Neural Network Computation Method and Computing Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present invention relates to the technical field of spiking neural networks, and in particular to a spiking neural network accelerator, a spiking neural network computing method, and a computing device. Background Art
[0003] Spiking neural network (SNN) is a new generation of artificial neural network model inspired by biological neuroscience. SNN has excellent spatiotemporal information processing capabilities. With the vigorous development of SNN research, the demand for hardware accelerators to run SNN is becoming increasingly strong. SNN accelerators are divided into large-scale SNN accelerators and edge-type SNN accelerators. Edge-type SNN accelerators can be directly coupled with retinal sensors. With the development of retinal sensors, the importance of edge-type SNN accelerators has become more prominent. Existing edge-type SNN accelerators are generally fully expanded customized hardware, which is not conducive to the expansion of the scale and structure of neural networks, and limits the processing performance of edge-type SNN accelerators.
[0004] Summary of the Invention
[0005] In order to solve the above problems, an SNN accelerator is provided in an embodiment of the present application, which allows the convolutional layer and fully connected layer of the SNN to be reconstructed into a single time step processing mode and a multi-time step processing mode, which can improve the utilization rate of the weights of the fully connected layer. The array controller can reconstruct the PEs of the PE array so that an addition tree is formed between adjacent PEs, reducing the number of adders inside each PE to alleviate the problem of sparse imbalance of pulses of different PEs. The array controller can reconstruct the PE array to improve the utilization rate of arrays with different feature scales. In addition, the present application also provides a pulse neural network calculation method and a computing device corresponding to the SNN accelerator.
[0006] To this end, the following technical solutions are adopted in the embodiments of the present application:
[0007] In a first aspect, an embodiment of the present application provides a pulse neural network accelerator, comprising: a processing unit array, comprising a plurality of processing units, the plurality of processing units being configured to receive input pulse signals and weight information, perform weighted accumulation on the input pulse signals of one time step to obtain a partial sum of one time step, and / or perform weighted accumulation on the input pulse signals of multiple time steps to obtain a partial sum of multiple time steps; a membrane potential update module being connected to the processing unit array, for receiving the partial sum of the processing unit array and the membrane potential information of the previous time step, obtaining the membrane potential information of the current time step based on the partial sum of the processing unit array and the membrane potential information of the previous time step, and generating an output pulse signal.
[0008] In this embodiment, the PE array uses a single time-step processing mode when performing calculations in the convolutional layer of the SNN, which allows for full reuse of weights. When performing calculations in the fully connected layer of the SNN, the PE array uses a multi-time-step processing mode, which allows for partial sum accumulation of multiple time steps at a time, thereby increasing the reuse rate of weights.
[0009] In one embodiment, the multiple processing units are specifically used to receive the input pulse signal of the one time step and the weight signal, and perform weighted accumulation on the input pulse signal of the one time step in the convolution layer of the pulse neural network to obtain the partial sum of the one time step; the membrane potential update module is specifically used to obtain the membrane potential information of the current time step or the membrane potential information of multiple time steps based on the partial sum of the one time step and the membrane potential information of the previous time step in the convolution layer of the pulse neural network, and generate an output pulse signal.
[0010] In this embodiment, when the PE array performs calculations in the convolutional layer of the SNN, PEs in a row can share data from the weight voltage cache and calculate the partial sum of an output channel. Different rows correspond to different output channels, allowing the PE array to process the partial sum of a time step. When the membrane potential update module performs calculations in the convolutional layer of the SNN, each update unit of the membrane potential update module receives the membrane potential of a time step and the partial sum of the PE array, thereby updating the membrane potential and activating the output pulse signal. There is no need to transmit the membrane potential horizontally, and the weights can be fully reused.
[0011] In one embodiment, the multiple processing units are specifically used to receive the input pulse signals and the weight signals of the multiple time steps, and perform weighted accumulation on the input pulse signals of the multiple time steps in the fully connected layer of the pulse neural network to obtain the partial sum of the multiple time steps; the membrane potential update module is specifically used to obtain the membrane potential information of the multiple time steps based on the partial sum of the multiple time steps and the membrane potential information of the previous time step in the fully connected layer of the pulse neural network, and generate an output pulse signal.
[0012] In this embodiment, the PE array can take advantage of the low reuse rate of weights when performing calculations in the fully connected layer of the SNN. The SNN accelerator uses a multi-timestep processing mode in the fully connected layer of the SNN. The PE array processes the partial sum accumulation of multiple time steps at a time, which can increase the reuse rate of weights. The membrane potential update module needs to forward the membrane potential at different times in the column direction to activate the pulse signals at multiple times.
[0013] In one embodiment, the membrane potential update module includes a plurality of update units, which are arranged in the form of an array and interconnected, and the array refers to a model in which the processing units are arranged in an N×M format, where N and M are positive integers greater than 1; the update units in one column of the plurality of update units are used to update the membrane potential information of the first time step in the fully connected layer of the pulse neural network, obtain the updated membrane potential information, and transmit it to the update units in the next column, so that the update units in the next column update the membrane potential information of the next time step of the first time step.
[0014] In one embodiment, the multiple processing units are arranged in the form of an array and connected to each other, and the array refers to a model in which the processing units are arranged in an N×M format, where N and M are positive integers greater than 1; the multiple processing units include a first processing unit and a second processing unit, and the first processing unit is connected to the second processing unit. The number of input channels of the multiple processing units in the first processing unit is less than the number of input pulse signals in one time step, and part of the input pulse signals are input to the input channel of the second processing unit.
[0015] In this embodiment, when the input channels of a processing unit are less than the number of input pulse signals of one time step, the processing unit cannot independently process the input pulse signals of one time step, and can call the input channels of other processing units to enable the processing unit to process the input pulse signals of one time step.
[0016] In one embodiment, the processing unit array determines that the width of the characteristic graph carried by the input pulse signal is smaller than a set threshold, and the multiple processing units are formed into at least two PE arrays.
[0017] In this embodiment, the processing unit array may reconstruct the PE array into multiple PE arrays based on the size change characteristics of the feature map, and may increase the input channels of the PE array to improve the computational efficiency of the PE array.
[0018] In one embodiment, it further includes: at least one weight ping-pong cache connected to the processing unit array, and used to store weight information of the PE array respectively.
[0019] In this embodiment, the processing unit array can use the ping-pong cache of the weights, so that the ping-pong cache of the weights corresponds to a PE array respectively, which can increase the number of input channels of a PE calculation to improve the utilization rate of the PE array.
[0020] In a second aspect, an embodiment of the present application provides a pulse neural network calculation method, which is executed by a pulse neural network accelerator and includes: receiving an input pulse signal and weight information; performing weighted accumulation on the input pulse signal of one time step to obtain a partial sum of one time step, and / or performing weighted accumulation on the input pulse signals of multiple time steps to obtain a partial sum of multiple time steps; based on the partial sum of one time step and / or the partial sum of the multiple time steps and the membrane potential information of the previous time step, obtaining the membrane potential information of the current time step or the membrane potential information of multiple time steps, and generating an output pulse signal.
[0021] In one embodiment, the weighted accumulation of the input pulse signal of a time step to obtain the partial sum of the time step includes: weighted accumulation of the input pulse signal of the time step in the convolution layer of the pulse neural network to obtain the partial sum of the time step; the obtaining of the membrane potential information of the current time step based on the partial sum of the time step and the membrane potential information of the previous time step, and the generating of the output pulse signal include: obtaining the membrane potential information of the current time step based on the partial sum of the time step and the membrane potential information of the previous time step in the convolution layer of the pulse neural network, and generating the output pulse signal.
[0022] In one embodiment, the weighted accumulation of input pulse signals of multiple time steps to obtain the partial sum of multiple time steps includes: weighted accumulation of input pulse signals of multiple time steps in the fully connected layer of the pulse neural network to obtain the partial sum of the multiple time steps; the membrane potential information of the current time step is obtained based on the partial sum of the multiple time steps and the membrane potential information of the previous time step, and the output pulse signal is generated, including: in the fully connected layer of the pulse neural network, the membrane potential information of the multiple time steps is obtained based on the partial sum of the multiple time steps and the membrane potential information of the previous time step, and the output pulse signal is generated. In a third aspect, a computing device is provided in an embodiment of the present application, including: at least one memory, at least one processor, the at least one processor is used to execute instructions stored in the at least one memory, so that the processor executes various possible embodiments of the second aspect.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute the various possible implementation methods of the second aspect.
[0024] In a fifth aspect, an embodiment of the present application provides a computer program product, characterized in that the computer program product stores instructions, and when the instructions are executed by a computer, the computer implements the various possible implementation methods of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0026] FIG1 is a schematic diagram of the architecture of an SNN accelerator provided in an embodiment of the present application;
[0027] FIG2 is a schematic diagram of a data flow formation process of a pulse computing core calculation provided in an embodiment of the present application;
[0028] FIG3 is a circuit diagram of adjacent PE addition tree reconstruction provided in an embodiment of the present application;
[0029] FIG4 is a circuit diagram of a reconfigurable PE provided in an embodiment of the present application;
[0030] FIG5 is a schematic diagram of the architecture of the PE array reconstruction provided in an embodiment of the present application;
[0031] FIG6 is a schematic diagram of the data flow formation process of the single time step calculation mode and the multi-time step calculation mode provided in the embodiment of the present application;
[0032] FIG7( a ) is a schematic diagram of the circuit architecture of the PE array and membrane potential update module provided in an embodiment of the present application to implement a single time step processing mode;
[0033] FIG7( b ) is a schematic diagram of the circuit architecture of the PE array and membrane potential update module provided in an embodiment of the present application to implement a multi-time step processing mode;
[0034] FIG8 is a flow chart of the SNN calculation method provided in an embodiment of the present application;
[0035] FIG9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0036] FIG10 is a schematic diagram of the architecture of a data center provided in an embodiment of the present application;
[0037] FIG11 is a schematic diagram of the architecture of another data center provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0039] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.
[0040] The terms "first" and "second" in this specification and claims are used to distinguish different objects rather than to describe a specific order of objects. For example, "first response message" and "second response message" are used to distinguish different response messages rather than to describe a specific order of response messages.
[0041] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0042] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.
[0043] SNNs, also known as third-generation neural networks, consist of convolutional and fully connected layers, similar to conventional neural networks. When an SNN receives a pulse sequence from a retinal sensor, its convolutional layer performs a convolution operation on the pulse sequence using a discrete convolution algorithm, passing the result as a pulse address to the fully connected layer. Each equivalent neuron in the fully connected layer of the SNN connects to each equivalent neuron in the convolutional layer with different weights, and the convolutional layer processes the pulse addresses to produce the computational result.
[0044] In existing SNN accelerators, the feature maps carried by the pulse signals received by the SNN can reuse weights horizontally and vertically, while the fully connected layer cannot reuse feature maps at different locations, resulting in low utilization of the fully connected layer weights. Moreover, the feature maps received by the SNN are sparse, with a certain sparsity in the channel direction, which leads to computational imbalance in the SNN accelerator.
[0045] In order to solve the defects of existing SNN accelerators, the embodiments of the present application provide a new SNN accelerator, SNN computing method and computing device.
[0046] FIG1 is a schematic diagram of the architecture of an SNN accelerator provided in an embodiment of the present application. As shown in FIG1 , the SNN accelerator 100 includes a microcontroller 110, a pulse computing core 120, an input / output (IO) direct memory access (DMA) interface 130, and a bus 140. The microcontroller 110, the pulse computing core 120, and the IO DMA interface 130 are each connected to each other via the bus 140.
[0047] The microcontroller 110 is used to control the operation process and data scheduling of the SNN accelerator 100. The microcontroller 110 may be internally provided with an instruction memory 111 and a data memory 112. The instruction memory 111 may store instruction data. The data memory 112 may store operation data.
[0048] The pulse computing core 120 is the core of the SNN accelerator 100 and is used to perform SNN calculations. The pulse computing core 120 includes an array controller 1201, a processing element (PE) array 1202, a membrane potential update module 1203, an input pulse loading module 1204, an output pulse storage module 1205, a weight loading module 1206, an intermediate value memory access module 1207, a membrane potential memory access module 1208, a control instruction memory 1209, an input and output cache 1210, and a weight voltage cache 1211.
[0049] The array controller 1201 is used to control the operation of each module within the pulse computing core 120 .
[0050] The PE array 1202 is used to accumulate weights based on the pulse signal.
[0051] The membrane potential update module 1203 is used to update the membrane potential and activation pulse signal.
[0052] The input pulse loading module 1204 is used to load the pulse signal stored in the input / output buffer 1210 into the PE array 1202 .
[0053] The output pulse storage module 1205 is used to load the pulse signal activated by the membrane potential updating module 1203 into the input and output buffer 1210 , and to store the pulse signal activated by the membrane potential updating module 1203 .
[0054] The weight loading module 1206 is used to load the weights of the SNN stored in the weight voltage cache 1211 into the PE array 1202 .
[0055] The intermediate value access module 1207 is used to load the partial sum stored in the weight voltage cache 1211 into the PE array 1202 , and load the weight of the pulse signal of the PE array 1202 into the weight voltage cache 1211 .
[0056] The membrane potential memory access module 1208 is used to load the membrane potential stored in the weight voltage cache 1211 into the membrane potential update module 1203 , and to load the membrane potential of the membrane potential update module 1203 into the weight voltage cache 1211 .
[0057] The control instruction memory 1209 is used to store control instructions configured by the pulse computing core 120 .
[0058] The input and output buffer 1210 is used to store the input pulse signal, intermediate pulse signal and output pulse signal of the SNN.
[0059] The weight voltage buffer 1211 is used to store the weights, partial sums and membrane potentials of the SNN.
[0060] The IO DMA interface 130 is used to complete data caching inside the SNN accelerator 100 and data transfer outside the SNN accelerator 100 .
[0061] In the present application, the microcontroller 110, array controller 1201, PE array 1202, membrane potential update module 1203, input pulse loading module 1204, output pulse storage module 1205, weight loading module 1206, intermediate value memory access module 1207, and membrane potential memory access module 1208 of the SNN accelerator 100 can be implemented by one or more processors. The processor can include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0062] The processor can be divided into a microcontroller 110, an array controller 1201, a PE array 1202, a membrane potential update module 1203, an input pulse loading module 1204, an output pulse storage module 1205, a weight loading module 1206, an intermediate value memory access module 1207, and a membrane potential memory access module 1208 according to the execution function. All of them can be implemented by software, or by hardware, or by a combination of software and hardware. For example, the implementation of the microcontroller 110 is described below using the microcontroller 110 as an example. Similarly, the implementation of the array controller 1201, the PE array 1202, the membrane potential update module 1203, the input pulse loading module 1204, the output pulse storage module 1205, the weight loading module 1206, the intermediate value memory access module 1207, and the membrane potential memory access module 1208 can refer to the implementation of the microcontroller 110.
[0063] As an example of a software functional unit, the microcontroller 110 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the microcontroller 110 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0064] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0065] As an example of a hardware functional unit, the microcontroller 110 may include at least one computing device, such as a computing device. Alternatively, the microcontroller 110 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0066] The multiple computing devices included in the microcontroller 110 can be distributed in the same region or in different regions. The multiple computing devices included in the rule management unit 510 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the microcontroller 110 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0067] It should be noted that, in other embodiments, the microcontroller 110 can be used to execute any step in the SNN calculation method, the array controller 1201 can be used to execute any step in the SNN calculation method, the PE array 1202 can be used to execute any step in the SNN calculation method, the membrane potential update module 1203 can be used to execute any step in the SNN calculation method, the input pulse loading module 1204 can be used to execute any step in the SNN calculation method, the output pulse storage module 1205 can be used to execute any step in the SNN calculation method, the weight loading module 1206 can be used to execute any step in the SNN calculation method, the intermediate value memory access module 1207 can be used to execute any step in the SNN calculation method, and the membrane potential memory access module 1208 can be used to execute any step in the SNN calculation method.
[0068] The steps that the microcontroller 110, array controller 1201, PE array 1202, membrane potential update module 1203, input pulse loading module 1204, output pulse storage module 1205, weight loading module 1206, intermediate value memory access module 1207 and membrane potential memory access module 1208 are responsible for implementing can be specified as needed. The microcontroller 110, array controller 1201, PE array 1202, membrane potential update module 1203, input pulse loading module 1204, output pulse storage module 1205, weight loading module 1206, intermediate value memory access module 1207 and membrane potential memory access module 1208 respectively implement different steps in the SNN calculation method to achieve all the functions of the SNN accelerator 100.
[0069] In the present application, the instruction memory 111, data memory 112, control instruction memory 1209, input and output cache 1210, and weight voltage cache 1211 of the SNN accelerator 100 can be implemented by one or more memories. The memory may include a volatile memory, such as a random access memory (RAM). The memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0070] The memory may store executable program code, and the processor executes the executable program code to respectively implement the functions of the aforementioned microcontroller 110, array controller 1201, PE array 1202, membrane potential update module 1203, input pulse loading module 1204, output pulse storage module 1205, weight loading module 1206, intermediate value memory access module 1207, and membrane potential memory access module 1208, thereby implementing the SNN calculation method. In other words, the memory stores instructions for executing the SNN calculation method. Alternatively, the memory stores executable code, and the processor executes the executable code to respectively implement the functions of the aforementioned SNN accelerator 100, thereby implementing the SNN calculation method. In other words, the memory stores instructions for executing the SNN calculation method.
[0071] The IO DMA interface 130 may be implemented by one or more communication interfaces, such as a network interface card, a transceiver, or other transceiver module, to implement communication between the SNN accelerator 100 and other communication devices.
[0072] The bus 140 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 140 may be divided into an address bus, a data bus, a control bus, etc. The bus 140 may include a path for transmitting information between various components of the SNN accelerator 100 (e.g., the microcontroller 110, the pulse computing core 120, and the IO DMA interface 130).
[0073] In an embodiment of the present application, the data flow during the calculation process of the pulse calculation core 120 is a data flow with fixed weights and fixed output parts. As shown in Figure 2, in the PE array 1202, each PE can complete the weight accumulation of L input channels at a time. L is a positive integer greater than or equal to 2. In one embodiment, when the convolution kernel of the SNN accelerator 100 is K×K, the PE requires K×K calculations to achieve K×K×L weight accumulation. K is a positive integer greater than or equal to 1. The partial sum remains fixed in the register of the PE array 1202 until K×K×L weight accumulations are completed. The weight remains unchanged in the weight voltage cache 1211 until the calculation is completed in the weight direction and the high direction. The pulse signal is input to the input and output cache 1210. The input and output cache 1210 can slide upward to multiplex the superposition part of the input pulse signals of different rows.
[0074] The array controller 1201 can detect the number of pulse signals input to the output channel and dynamically reconstruct the addition tree between adjacent PEs. The array controller 1201 can reduce the number of adders inside the PE and alleviate the sparse imbalance problem of pulse signals of different PEs. When the array controller 1201 stores the feature map carried by the pulse signal in the input and output buffer 1210, it counts the number of pulse signals of the L output channels loaded each time to obtain the number of activated pulse signals at the corresponding position. The analysis module of the array controller 1201 can generate a control signal based on the number of activated pulse signals to complete the configuration of the PE to achieve the reconstruction of the addition tree. The PEs of different columns select weights based on the activated pulse signals. The adders of each row of PEs in the PE array 1202 are reconstructed according to the selected weights, and the corresponding weights are selected for accumulation to obtain the partial sum.
[0075] FIG3 is a circuit diagram of the adjacent PE addition tree reconstruction provided in an embodiment of the present application. As shown in FIG3 , the number of input pulse signals of the array controller 1201 is 5, 4, and 2, respectively. The process of the PE array 1202 performing calculations based on the addition tree is as follows: the first PE requires 5 input pulse signals for weight accumulation. Since a PE supports weight accumulation of up to 4 input pulse signals, an adder of the second PE is allocated to the first PE to enable the first PE to complete weight accumulation of 5 input pulse signals. The second PE requires 4 input pulse signals for accumulation. Since an adder of the second PE is given to the first PE, and an adder of the third PE is given to the second PE, the second PE can complete weight accumulation of 4 input pulse signals. The third PE requires 2 input pulse signals for weight accumulation, and the remaining adder of the third PE can be used to complete weight accumulation of 2 input pulse signals.
[0076] Figure 4 is a circuit diagram of a reconfigurable PE provided in an embodiment of the present application. As shown in Figure 4, the PE includes five adders and four selectors. The five adders are the first, second, third, fourth, and fifth adders. The four selectors are the first, second, third, and fourth selectors. The fifth, fourth, and third adders perform sum operations on corresponding weights. The second adder accumulates the partial sum of the current PE's adder with the partial sum of the adjacent PE's adder. The first adder accumulates partial sums at different clocks. The fourth selector selects the results of the fifth, fourth, and third adders. The third selector selects different partial sums from the left and right PEs. The second selector selects different partial sums. The first selector updates partial sums at different cycles. The adders can be adders that perform normal addition functions, which is not limited in this application. The selectors can be multiplexers, which is not limited in this application.
[0077] In an embodiment of the present application, based on the size variation of the feature map, array controller 1201 can restructure the N×M PE array 1202 into two (N / 2)×M PE arrays 1202, thereby increasing the input channels of PE array 1202 and improving the computational efficiency of PE array 1202. N and M are positive integers greater than 1. Furthermore, array controller 1201 can utilize a ping-pong cache of weights to increase the number of input channels per PE computation, thereby improving PE array utilization. Array controller 1201 can also utilize other caches, which are not limited in this application.
[0078] In one embodiment, the array controller 1201 may reconfigure an N×M PE array into two or more PE arrays.
[0079] In one embodiment, the array controller 1201 may reconfigure an N×M PE array into multiple PE arrays with different numbers of PEs.
[0080] The structure of the ping-pong cache is actually equivalent to a dual-port RAM, but it is different from ordinary dual-port RAM. Ordinary dual-port RAM is an integrated circuit (IC) composed of a single memory bank. The ping-pong RAM structure is composed of multiple ICs with two independent independent memory banks, which can have greater flexibility in structure, speed, capacity, etc. If the dual-port RAM accesses the same address, the ordinary dual-port RAM must point to the same memory cell in the memory bank. However, the ping-pong RAM structure points to two different memory cells belonging to static random access memory (SRAM) 1 and SRAM 2 respectively, which can be easier to operate. Based on this, the ping-pong cache structure can be composed of relatively cheap high-speed, large-capacity SRAM and peripheral logic devices to form a buffer memory required by the video processing system that is more suitable for dual-port RAM and high-speed FIFO. In the embodiment of the present application, when the PE array is not reconstructed, the ping-pong cache of the weights can pre-fetch the weights to reduce calculation delay. When an N×M PE array is reconstructed into two (N / 2)×M arrays, each ping-pong buffer provides the required weight for one array to improve the utilization of the PE array.
[0081] FIG5 is a schematic diagram of the architecture of the PE array reconstruction provided in an embodiment of the present application. As shown in FIG5 , when the array controller 1201 determines that the width of the feature map is less than a set threshold, the utilization rate of the PE array 1202 in the row direction is relatively low. The set threshold refers to the number of input channels of the PE array 1202 in the row direction. For example, the array controller 1201 can reconstruct the PE array and reconstruct a 16×16 PE array into two 8×16 PE arrays. The array controller 1201 corresponds the original weight ping-pong cache to an 8×16 PE array respectively. After the array controller 1201 reconstructs the PE array 1202, the original calculation of 16 input channels that can be completed at a time is increased to 32 input channels that can be completed at a time, so as to improve the computational efficiency of the PE array 1202.
[0082] The PE array 1202 and the membrane potential update module 1203 can reconstruct the convolution layer and the fully connected layer of the SNN into a single time step processing mode and a multi-time step processing mode, which can avoid the large difference in the utilization rate of the weights of the convolution layer and the fully connected layer of the SNN when the SNN accelerator 100 is calculating. The time step is a concept unique to the SNN network. From a hardware perspective, the time step can be understood as a clock processing cycle. In this application, the convolution layer will process information at each time step, and the fully connected layer will merge the information of multiple time steps together for processing.
[0083] As shown in Figure 6, the PE array 1202 can fully reuse weights when performing calculations in the convolution layer of the SNN. At this time, the SNN accelerator 100 uses a single time step processing mode in the convolution layer of the SNN. When the PE array 1202 performs calculations in the fully connected layer of the SNN, the PE array 1202 can take advantage of the low reuse rate of weights. At this time, the SNN accelerator 100 uses a multi-time step processing mode in the fully connected layer of the SNN. The PE array 1202 processes the partial sum accumulation of N time steps each time, which can increase the reuse rate of weights. The membrane potential update module 1203 needs to pass the membrane potential at different times forward in the column direction to activate the pulse signals at multiple times.
[0084] In an embodiment of the present application, PE array 1202 receives an input pulse signal and weight information, performs weighted accumulation on the pulse signal, and obtains a partial sum. Membrane potential update module 1203 receives the partial sum from PE array 1202 and the membrane potential of the previous time step, and accumulates the partial sum of the current time step with the partial sum of the previous time step to obtain the membrane potential of the current time step. Membrane potential update module 1203 compares the membrane potential of the current time step with a membrane potential threshold. If membrane potential update module 1203 determines that the membrane potential of the current time step exceeds the membrane potential threshold, it generates an output pulse signal. Simultaneously, membrane potential update module 1203 resets the membrane potential of the current time step. If membrane potential update module 1203 determines that the membrane potential of the current time step does not exceed the membrane potential threshold, it does not generate an output pulse signal, and the current membrane potential remains unchanged. In one embodiment, membrane potential update module 1203 includes first input first output (FIFO 0), FIFO 1, FIFO 2, and FIFO 3. FIFO 0 receives the partial sum signal from PE array 1202. FIFO 1 receives the membrane potential from the previous time step from weight voltage buffer 1211. Membrane potential update module 1203 adds the partial sum to the membrane potential from the previous time step, updates the membrane potential, and generates an output pulse signal. FIFO 2 outputs the output pulse signal to input / output buffer 1210. FIFO 3 transmits the updated membrane potential to weight voltage buffer 1211.
[0085] 7( a ) and 7 ( b ) are schematic diagrams of the circuit architecture of the PE array 1202 and the membrane potential update module 1203 provided in an embodiment of the present application to implement a single time step processing mode and a multi-time step processing mode.
[0086] As shown in Figure 7(a), when PE array 1202 performs calculations in the convolutional layer of the SNN, PEs in a row can share data from weight voltage buffer 1211 and calculate a partial sum for an output channel. Different rows correspond to different output channels, allowing PE array 1202 to process the partial sum for a time step. When membrane potential update module 1203 performs calculations in the convolutional layer of the SNN, each update unit in membrane potential update module 1203 receives the membrane potential for a time step and the partial sum of PE array 1202, thereby updating the membrane potential and activating the output pulse signal without the need to transmit the membrane potential horizontally.
[0087] As shown in Figure 7(b), when PE array 1202 performs calculations in the fully connected layer of the SNN, the input and output buffer 1210 loads input pulse signals for multiple time steps. The PEs in a row calculate the partial sums of multiple time steps, enabling weight reuse and allowing PE array 1202 to process the partial sums of N time steps. The membrane potential update module 1203 can be divided into multiple update units. The number of update units is the same as the number of PEs in PE array 1202, and the arrangement is the same as the arrangement of the multiple PEs in PE array 1202. When the membrane potential update module 1203 performs calculations in the fully connected layer of the SNN, the first column of update units receives the membrane potential of the previous time step, updates the partial sum of the PEs in the first column of PE array 1202, and updates the membrane potential and activates the output pulse signals. After updating the membrane potential, the update units in the first column do not store the updated membrane potential in the weight voltage buffer 1211, but instead pass it to the update units in the second column. After the update unit in the second column completes the corresponding membrane potential update operation, it is passed to the update unit in the next column, and so on, until the membrane potential update unit in the Nth time step completes the calculation and stores the membrane potential of the last time step into the weight voltage cache 1211 through FIFO 3.
[0088] In an embodiment of the present application, the SNN accelerator 100 adopts a multi-time step processing mode when performing operations in the fully connected layer of the SNN. Each column of PE units and the update unit of the membrane potential update module correspond to a neuron operation of one time step. After the update unit of the first column of the membrane potential update module completes the membrane potential update, it obtains the membrane potential of the T1 time step and passes the membrane potential of the T1 time step to the update unit of the second column of the membrane potential update module. The update unit of the second column of the update module completes the membrane potential update operation of the T2 time step based on the membrane potential of the T1 time step and the partial sum of the T2 time step from the second column of PE units.
[0089] FIG8 is a flow chart of the SNN accelerator provided in an embodiment of the present application performing SNN calculations. As shown in FIG8 , the SNN calculation method is executed by various modules of the SNN accelerator 100. The specific implementation process is as follows:
[0090] In step S801 , the microcontroller 110 receives pulse data, weight information, and membrane potential information, and loads the pulse data into the input / output buffer 1210 , and loads the weight information and membrane potential information into the weight voltage buffer 1211 .
[0091] The IO DMA interface 130 of the SNN accelerator 100 can establish a communication connection with the retinal-like sensor to realize data transmission between the SNN accelerator 100 and the retinal-like sensor. The retinal-like sensor is used to obtain image data and transmit it to the SNN accelerator 100 in the form of a pulse signal. The weight information is pre-configured. The membrane potential information is the result information obtained after stimulating the neuron several times with a pulse. In the embodiment of the present application, the microcontroller 110 receives external pulse signals, weight information and membrane potential information through the bus 140 and the IO DMA interface 130, and caches the pulse signal in the input and output cache 1210, waiting for the PE array 1202 to process it. The microcontroller 110 caches the weight information in the weight voltage cache 1211, waiting for the PE array 1202 to process it. The microcontroller 110 caches the membrane potential information in the weight voltage cache 1211, waiting for the membrane potential update module 1203 to process it.
[0092] In step S802 , the input pulse loading module 1204 loads the pulse signal from the input / output buffer 1210 into the PE array 1202 .
[0093] In step S803 , the weight loading module 1206 loads the weight information of the weight voltage buffer 1211 into the PE array 1202 .
[0094] In step S804 , the PE array 1202 performs weighted accumulation on the pulse signals to obtain a partial sum.
[0095] PE array 1202 is internally provided with a pulse register. An input pulse loading module 1204 can load pulse signals from input / output buffer 1210 into the pulse register. PE array 1202 is internally provided with a weight register. A weight loading module 1206 can load weight information from weight voltage buffer 1211 into the weight register. Based on the pulse signals from the pulse register and the weight information in the weight register, PE array 1202 performs weighted accumulation on the pulse signals to obtain a partial sum.
[0096] In the present application, the array controller 1201 detects the number of pulse signals input to the output channel and dynamically reconstructs the addition tree of adjacent PEs, which can reduce the number of adders inside the PE array 1202 and alleviate the sparse imbalance problem of pulse signals of different PEs. When the array controller 1201 stores the input feature map from the global cache in the input and output cache 1210, it counts the number of pulse signals of the L channels loaded each time to obtain the number of activated pulse signals at the corresponding positions. The parsing module of the array controller 1201 can generate a control signal based on the number of activated pulse signals to complete the configuration of the PE to achieve the reconstruction of the addition tree. PEs in different columns select weights based on the activated pulse signals. The adders of each row of PEs in the PE array 1202 are reconstructed according to the selected weights, and the corresponding weights are selected for accumulation to obtain a partial sum.
[0097] The array controller 1201 is generally connected to a control instruction memory 1209. The control instruction memory 1209 can store control instructions input by the user and send the control instructions to the array controller 1201, so that the array controller 1201 can control the array controller 1201, the PE array 1202, the membrane potential update module 1203, the input pulse loading module 1204, the output pulse storage module 1205, the weight loading module 1206, the intermediate value memory access module 1207, and the membrane potential memory access module 1208 to perform corresponding tasks.
[0098] The array controller 1201 can reconstruct the PE addition tree based on the control instructions of the control instruction memory 1209. In one embodiment, the number of input pulse signals of the array controller 1201 is 5, 4 and 2 respectively. The first PE of the PE array 1202 requires 5 input pulse signals for weight accumulation. Since a PE supports weight accumulation of 4 input pulse signals at most, one adder of the second PE is allocated to the first PE so that the first PE can complete the weight accumulation of 5 input pulse signals. The second PE requires 4 input pulse signals for weight accumulation. Since one adder of the second PE is given to the first PE and one adder of the third PE is given to the second PE so that the second PE can complete the weight accumulation of 4 input pulse signals. The third PE requires 2 input pulse signals for weight accumulation, and the remaining adders of the third PE can be used to complete the weight accumulation of 2 input pulse signals.
[0099] The array controller 1201 can reconstruct the PE array 1202 based on the control instructions of the control instruction memory 1209. In one embodiment, the PE array 1202 is an N×M PE array. When the array controller 1201 determines that the width of the feature map is relatively small, the utilization rate of the PE array 1202 in the row direction is relatively low. The array controller 1201 can reconstruct the PE array and reconstruct an N×M PE array into two (N / 2)×M PE arrays, which can increase the input channels of the PE array 1202 to improve the computational efficiency of the PE array 1202. The array controller 1201 corresponds the original weight ping-pong cache to a (N / 2)×M PE array respectively. After the array controller 1201 reconstructs the PE array 1202, the original calculation of N input channels that can be completed at one time is increased to the calculation of 2N input channels that can be completed at one time. In the embodiment of the present application, when the PE array is not reconstructed, the weight ping-pong cache can pre-fetch the weights to reduce computational delay. When an N×M PE array is reconstructed into two (N / 2)×M arrays, each ping-pong buffer provides the required weight for one array to improve the utilization of the PE array.
[0100] In one embodiment, the array controller 1201 may reconfigure an N×M PE array into two or more PE arrays.
[0101] In one embodiment, the array controller 1201 may reconfigure an N×M PE array into multiple PE arrays with different numbers of PEs.
[0102] In step S805 , the membrane potential updating module 1203 receives the membrane potential of the weight voltage buffer 1211 and the partial sum of the PE array 1202 , and accumulates the membrane potential and the partial sum to update the membrane potential and activate the output pulse signal.
[0103] In step S806 , the output pulse storage module 1205 stores the activated output pulse signal in the input / output buffer 1210 .
[0104] In the present application, the PE array 1202 and the membrane potential update module 1203 can reconstruct the convolution layer and the fully connected layer of the SNN into a single time step processing mode and a multi-time step processing mode, which can avoid the large difference in the utilization rate of the weights of the convolution layer and the fully connected layer of the SNN when the SNN accelerator 100 is calculating. The PE array 1202 can fully reuse the weights when performing calculations on the convolution layer of the SNN. At this time, the SNN accelerator 100 uses a single time step processing mode on the convolution layer of the SNN. When the fully connected layer of the SNN performs calculations, the PE array 1202 can utilize a low reuse rate of weights. At this time, the SNN accelerator 100 uses a multi-time step processing mode on the fully connected layer of the SNN. The PE array 1202 processes the partial sum accumulation of N time steps each time, which can increase the reuse rate of weights.
[0105] The membrane potential update module 1203 receives the partial sum from the PE array 1202 and the membrane potential of the previous time step, and accumulates the partial sum of the current time step with the partial sum of the previous time step to obtain the membrane potential of the current time step. The membrane potential update module 1203 compares the membrane potential of the current time step with the membrane potential threshold. If the membrane potential update module 1203 determines that the membrane potential of the current time step exceeds the membrane potential threshold, it generates an output pulse signal. At the same time, the membrane potential update module 1203 resets the membrane potential of the current time step. If the membrane potential update module 1203 determines that the membrane potential of the current time step does not exceed the membrane potential threshold, it does not generate an output pulse signal, and the current membrane potential remains unchanged. In the present application, the membrane potential update module 1203 includes FIFO 0, FIFO 1, FIFO 2, and FIFO 3. FIFO 0 receives the partial sum signal from the PE array 1202. FIFO 1 receives the membrane potential of the previous time step from the weight voltage buffer 1211. The membrane potential update module 1203 adds the partial sum to the membrane potential of the previous time step, updates the membrane potential, and generates an output pulse signal. FIFO 2 outputs the output pulse signal to the input and output buffer 1210. FIFO 3 transmits the updated membrane potential to the weight voltage buffer 1211.
[0106] In one embodiment, when PE array 1202 performs calculations in the convolutional layer of the SNN, PEs in a row can share data from weight voltage buffer 1211 and calculate a partial sum of an output channel. Different rows correspond to different output channels, allowing PE array 1202 to process the partial sum of a time step. When membrane potential update module 1203 performs calculations in the convolutional layer of the SNN, each update unit of membrane potential update module 1203 receives the membrane potential of a time step and the partial sum of PE array 1202, thereby updating the membrane potential and activating the output pulse signal without the need to transmit the membrane potential horizontally.
[0107] In one embodiment, when the PE array 1202 performs calculations in the fully connected layer of the SNN, the input and output buffer 1210 loads input pulse signals for multiple time steps. The PEs in a row calculate the partial sums of multiple time steps, multiplexing the weights and allowing the PE array 1202 to process the partial sums of multiple time steps. When the membrane potential update module 1203 performs calculations in the fully connected layer of the SNN, the first column of update units receives the membrane potential of the previous time step, updates the partial sums of the first column of PEs in the PE array 1202, and updates the membrane potential and activates the output pulse signal. After the update units in the first column update the membrane potential, they do not store the updated membrane potential in the weight voltage buffer 1211, but instead pass it to the update units in the second column. After the update units in the second column complete the corresponding membrane potential update calculation, they pass it to the update units in the next column, and so on, until the membrane potential update unit in the last time step completes the calculation and stores the membrane potential of the last time step in the weight voltage buffer 1211 via FIFO 3.
[0108] In step S807, the array controller 1201 detects whether the update unit of the current column is completed by the membrane potential update module 1203. If the array controller 1201 detects that the update unit of the current column is completed, step S808 is executed. If the array controller 1201 detects that the update unit of the current column is not completed, step S802 is executed.
[0109] In step S808 , the array controller 1201 outputs the output pulse signal of the input / output buffer 1210 and the updated membrane potential of the weight voltage buffer 1211 through the IO DMA interface 130 .
[0110] In step S809, the array controller 1201 detects whether the SNN has completed the calculation. If the array controller 1201 detects that the SNN has completed the calculation, the SNN accelerator 100 ends the calculation. If the array controller 1201 detects that the SNN has not completed the calculation, step S801 is executed.
[0111] In an embodiment of the present application, the array controller 1201 can reconfigure the PE array and membrane potential update module, allowing the convolutional layer and fully connected layer of the SNN to be reconfigured into single time step processing mode and multi-time step processing mode, thereby improving the utilization rate of the weights of the fully connected layer. The array controller 1201 can reconfigure the PEs of the PE array to form an adder tree between adjacent PEs, reducing the number of adders within each PE to alleviate the problem of sparse and unbalanced pulses of different PEs. The array controller 1201 can reconfigure the PE array to improve the utilization rate of arrays with different feature scales.
[0112] Compared with the existing technology, the convolutional layer and fully connected layer of the SNN are reconstructed into a single time step processing mode and a multi-time step processing mode, which can increase the utilization rate of the weights of the fully connected layer by 16 times. The SNN adder protected by this application is compared with the PE of 16 input pulse signals in the number of calculation cycles. When the sparsity is less than 15%, the resources of the SNN adder protected by this application are reduced by 75%. After the array controller 1201 reconstructs the PE array, the utilization rate of the PE array can be doubled when calculating small-scale feature maps.
[0113] An embodiment of the present application provides a computing device comprising at least one SNN adder. The SNN adder may be as shown in Figures 1-8 and described in the corresponding protection scheme. Since the computing device includes the SNN adder, the computing device package has all or at least some of the advantages of the SNN adder. The computing device may be an edge pulse signal device such as a digital video server (DVS).
[0114] Figure 9 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. As shown in Figure 9, computing device 900 includes: a bus 910, a processor 920, a memory 930, and a communication interface 940. Processor 920, memory 930, and communication interface 940 communicate with each other via bus 910. Computing device 900 can be an edge pulse signal device such as a DVS. It should be understood that this application does not limit the number of processors and memories in computing device 900.
[0115] Bus 910 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Bus 910 may be classified as an address bus, a data bus, a control bus, and the like. For ease of illustration, FIG9 shows a single bus line, but this does not imply a single bus or a single type of bus. Bus 910 may include a path for transmitting information between various components of computing device 900 (e.g., processor 920, memory 930, and communication interface 940).
[0116] The processor 920 may include any one or more processors such as a CPU, a GPU, an MP or a DSP.
[0117] The memory 930 may include a volatile memory such as a RAM. The processor 920 may also include a non-volatile memory such as a ROM, a flash memory, a HDD, or an SSD.
[0118] Memory 930 stores executable program code, which processor 920 executes to implement the functions of microcontroller 110 and pulse calculation core 120, thereby implementing the SNN calculation method. In other words, memory 930 stores instructions for executing the SNN calculation method.
[0119] Alternatively, the memory 930 stores executable code, and the processor 920 executes the executable code to respectively implement the functions of the aforementioned computing devices, thereby implementing the SNN calculation method. In other words, the memory 930 stores instructions for executing the SNN calculation method.
[0120] The communication interface 940 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 900 and other devices or a communication network.
[0121] Embodiments of the present application also provide a data center. The data center includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a desktop computer, a laptop computer, a smartphone, a switch, or other terminal device.
[0122] As shown in Figure 10, the data center includes at least one computing device 900. The memory 930 in one or more computing devices 900 in the data center may store the same instructions for executing the SNN calculation method.
[0123] In some possible implementations, the memory 930 of one or more computing devices 900 in the data center may also store some instructions for executing the SNN computing method. In other words, the combination of one or more computing devices 900 can jointly execute the instructions for executing the SNN computing method.
[0124] It should be noted that the memory 930 in different computing devices 900 in the data center can store different instructions, each used to perform a portion of the functions of the computing device. In other words, the instructions stored in the memory 930 in different computing devices 900 can implement the functions of one or more modules in the microcontroller 110 and the pulse computing core 120.
[0125] In some possible implementations, one or more computing devices 900 in a data center may be connected via a network. The network may be a wide area network or a local area network, etc. FIG11 shows a possible implementation. As shown in FIG11 , computing device 900A and computing device 900B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 930 in computing device 900A stores instructions for executing the functions of the microcontroller 110. At the same time, the memory 930 in network 1100B stores instructions for executing the functions of the microcontroller 110 and the pulse computing core 120.
[0126] The connection method between the data centers shown in Figure 11 can be considered to be that the SNN calculation method provided in this application requires a large amount of stored data, so it is considered to entrust the functions implemented by the microcontroller 110 and the pulse computing core 120 to be executed by the computing device 900B.
[0127] It should be understood that the functionality of the computing device 900A shown in FIG11 may also be implemented by multiple computing devices 900. Similarly, the functionality of the computing device 900B may also be implemented by multiple computing devices 900.
[0128] The present application also provides another data center. The connection relationship between the computing devices in the data center can be similar to the connection method of the data center described in FIG11 . However, the memory 930 in one or more computing devices 900 in the data center can store the same instructions for executing the SNN calculation method.
[0129] In some possible implementations, the memory 930 of one or more computing devices 900 in the data center may also store some instructions for executing the SNN computing method. In other words, the combination of one or more computing devices 900 can jointly execute the instructions for executing the SNN computing method.
[0130] It should be noted that the memory 930 in different computing devices 900 in the data center can store different instructions for executing part of the functions of the data center. In other words, the instructions stored in the memory 930 in different computing devices 900 can implement the functions of one or more devices in the computing devices.
[0131] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the computer program product causes the at least one computing device to perform an SNN calculation method.
[0132] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the SNN calculation method.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A pulse neural network accelerator, characterized in that: include: A processing unit array (1202) includes a plurality of processing units, wherein the plurality of processing units are configured to receive input pulse signals and weight information, perform weight accumulation on the input pulse signals of one time step to obtain a partial sum of one time step, and / or perform weight accumulation on the input pulse signals of multiple time steps to obtain a partial sum of multiple time steps; The membrane potential update module (1203) is connected to the processing unit array, and is used to receive the partial sum of the processing unit array and the membrane potential information of the previous time step, obtain the membrane potential information of the current time step or the membrane potential information of multiple time steps based on the partial sum of the processing unit array and the membrane potential information of the previous time step, and generate an output pulse signal.
2. The pulse neural network accelerator according to claim 1, characterized in that: The multiple processing units are specifically used to receive the input pulse signal of the one time step and the weight signal, and perform weighted accumulation on the input pulse signal of the one time step in the convolution layer of the pulse neural network to obtain a partial sum of the one time step; The membrane potential update module is specifically used to obtain the membrane potential information of the current time step based on the partial sum of the one time step and the membrane potential information of the previous time step in the convolutional layer of the pulse neural network, and to generate an output pulse signal.
3. The pulse neural network accelerator according to claim 1, characterized in that: The multiple processing units are specifically used to receive the input pulse signals of the multiple time steps and the weight signals, and perform weighted accumulation on the input pulse signals of the multiple time steps in the fully connected layer of the pulse neural network to obtain a partial sum of the multiple time steps; The membrane potential update module is specifically used to obtain the membrane potential information of the multiple time steps and generate an output pulse signal in the fully connected layer of the pulse neural network based on the partial sum of the multiple time steps and the membrane potential information of the previous time step.
4. The pulse neural network accelerator according to claim 3, characterized in that: The membrane potential update module includes a plurality of update units, which are arranged in an array and connected to each other, wherein the array refers to a model in which the processing units are arranged in an N×M format, where N and M are positive integers greater than 1; An update unit in one column of the multiple update units is used to update the membrane potential information of the first time step in the fully connected layer of the pulse neural network, obtain the updated membrane potential information, and transmit it to the update units in the next column, so that the update units in the next column update the membrane potential information of the next time step of the first time step.
5. The pulse neural network accelerator according to any one of claims 1 to 4, characterized in that: The multiple processing units are arranged in an array and connected to each other, the array refers to a model in which the processing units are arranged in an N×M format, N and M are positive integers greater than 1; the multiple processing units include a first processing unit and a second processing unit, the first processing unit is connected to the second processing unit, The plurality of processing units input part of the input pulse signals to the input channels of the second processing unit when the number of input channels of the first processing unit is less than the number of input pulse signals in one time step.
6. The pulse neural network accelerator according to any one of claims 1 to 5, characterized in that: The processing unit array determines that the width of the feature map carried by the input pulse signal is smaller than a set threshold, and the multiple processing units are formed into at least two PE arrays.
7. The pulse neural network accelerator according to claim 6, characterized in that: Also includes: At least one weight ping-pong cache is connected to the processing unit array and is used to store weight information of the PE array respectively.
8. A pulse neural network calculation method, characterized in that: The method is performed by a pulse neural network accelerator, comprising: Receiving input pulse signals and weight information; Performing weighted accumulation on the input pulse signal of one time step to obtain a partial sum of one time step, and / or performing weighted accumulation on the input pulse signals of multiple time steps to obtain a partial sum of multiple time steps; Based on the partial sum of the one time step and / or the partial sum of the multiple time steps and the membrane potential information of the previous time step, the membrane potential information of the current time step or the membrane potential information of multiple time steps is obtained, and an output pulse signal is generated.
9. The method according to claim 8, characterized in that The step of performing weighted accumulation on the input pulse signal of a time step to obtain a partial sum of a time step includes: Performing weighted accumulation on the input pulse signal of the one time step in the convolutional layer of the pulse neural network to obtain a partial sum of the one time step; The obtaining of the membrane potential information of the current time step based on the partial sum of the one time step and the membrane potential information of the previous time step, and the generation of the output pulse signal, comprises: In the convolutional layer of the spiking neural network, the membrane potential information of the current time step is obtained based on the partial sum of the one time step and the membrane potential information of the previous time step, and an output pulse signal is generated.
10. The method according to claim 8, characterized in that The step of performing weighted accumulation on the input pulse signals of multiple time steps to obtain the partial sum of multiple time steps includes: Performing weighted accumulation of the input pulse signals of the multiple time steps in the fully connected layer of the pulse neural network to obtain a partial sum of the multiple time steps; The obtaining of the membrane potential information of the current time step based on the partial sum of the multiple time steps and the membrane potential information of the previous time step, and the generation of the output pulse signal, comprises: In the fully connected layer of the spiking neural network, the membrane potential information of the multiple time steps is obtained based on the partial sum of the multiple time steps and the membrane potential information of the previous time step, and an output pulse signal is generated.
11. A computing device, characterized in that: include: at least one memory, At least one processor, the at least one processor is used to execute instructions stored in the at least one memory, so that the processor executes the method according to any one of claims 8 to 10.
Citation Information
Patent Citations
Image classification device and method based on FPGA and SCNN architecture
CN111062450A
Data processing method and device, and processing chip
CN113850370A
Pulse neural network acceleration method and event-driven accelerator of pulse neural network
CN114139695A
Timing analysis of an array circuit cross section
US20130185685A1
Cited By
Brain tumor classification method and system based on circuit bootstrap and SNN
CN120543907A
Spiking neural network reasoning device and method supporting elastic reasoning
CN122047470A
