Low latency and low energy consumption pulse neural network processor

By using the FS neuron model and fixed-point data representation in the spiking neural network processor, converting membrane potential to pulses and processing pulses to membrane potential in parallel, the problem of insufficient data reuse is solved, and a low-latency and low-energy consumption processor is achieved. Make full use of the spatiotemporal sparse characteristics of SNN to reduce computational complexity and energy consumption.

CN118095381BActive Publication Date: 2024-10-15UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410197981.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-22
Publication Date
2024-10-15
Estimated Expiration
2044-02-22

AI Technical Summary

Technical Problem

Existing spiking neural network processors cannot fully utilize the spatiotemporal sparse characteristics of SNN, resulting in insufficient data reuse, increased energy consumption and prolongation of calculation time, making it difficult to implement low-latency and low-energy hardware deployment.

Method used

It adopts a processor structure including a storage unit, weight transformation unit, pulse decoding unit, pulse calculation array, pulse conversion unit, pulse coding compression unit and main controller, and uses the FS neuron model and fixed-point data representation to convert membrane potential to pulse. The process extracts specific data bits and transforms pulse-to-membrane potential updates into parallel-processed shift additions, taking full advantage of the sparse nature of space and time.

Benefits of technology

It greatly reduces computational complexity and delay, achieves high parallel processing and data reuse, reduces hardware energy consumption, ensures the accuracy of the algorithm, and does not rely on high input sparsity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118095381B_ABST
    Figure CN118095381B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of artificial intelligence hardware, and in particular to a low-latency and low-energy consumption pulse neural network processor, including a storage unit, a weight conversion unit, a pulse decoding unit, a pulse calculation array, a pulse conversion unit, a pulse coding compression unit and a main controller. In the weight conversion unit, the FS neuron model and the fixed-point quantization principle are combined, the conversion of membrane potential to pulse is converted into data bit extraction at a specific position, and the update of pulse to membrane potential is converted into a shift addition that can be processed in parallel, so that the spatiotemporal sparse characteristics of SNN are more fully utilized in hardware. The entire calculation process only has shifts and additions, which can greatly reduce the calculation complexity. Parallel processing of batch neurons is realized, which can greatly reduce calculation delays. In the case where the algorithm has no special requirements for input sparsity, a low-latency and low-energy consumption pulse neural network processor is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence hardware, and in particular relates to a low-latency and low-energy consumption pulse neural network processor. Background Art

[0002] Compared with general artificial neural networks (ANN), spiking neural networks (SNN) use a neuron model closer to the brain to simulate the pulse emission mechanism in the brain. The hardware based on this algorithm shows great development potential in reducing energy consumption. However, it is difficult for SNN to adopt data streams with high data reuse and parallel processing on hardware. This is because SNN transmits information between neurons in irregular pulse sequences, and there is a time dependency in a single sequence, that is, the spatiotemporal sparsity. This makes it difficult for the hardware to efficiently deploy network parameters in time and space when executing the SNN algorithm, which ultimately leads to a large number of repeated data accesses in the calculation process, greatly increasing the hardware energy consumption. In addition, the state of a single neuron in SNN needs to be updated after a specific number of calculation cycles, which prolongs the hardware execution time.

[0003] At present, some researchers shorten the neuron state update time through parallel computing, and realize parallel computing of multiple neurons on this basis to accelerate the hardware execution process, but such methods are limited in data reuse and require complex control mechanisms. Some researchers have proposed a method combining data indexing with specific data streams, which to a certain extent improves the reuse of membrane potential and the parallelism of multiple neuron calculations, but when faced with the problem of data reuse of a large number of inputs, weights, and partial sums in convolution operations, its optimization method is still insufficient. The inability to fully utilize the spatiotemporal sparse characteristics of SNNs requires current SNN processors to rely on extremely high input sparsity to highlight their low energy consumption advantages. However, this will greatly reduce the accuracy of the algorithm and make it difficult to achieve the accuracy target of the given task. Summary of the invention

[0004] In view of this, the present invention provides a low-latency and low-energy pulse neural network processor to solve the technical problem that existing processors do not fully utilize the sparsity of SNN, resulting in the inability to effectively reduce data reuse and thereby accelerate the computing process and achieve low-latency and low-energy hardware deployment.

[0005] To solve the above problems, the present invention adopts the following technical solutions:

[0006] A low-latency and low-energy consumption pulse neural network processor, comprising a storage unit, a weight conversion unit, a pulse decoding unit, a pulse calculation array, a pulse conversion unit, a pulse coding compression unit and a main controller;

[0007] The storage unit is used to store the external input and locally generated data of the low-latency, low-energy consumption pulse neural network processor. The external input includes the initial weights and coded pulses of the network model. The initial weights are weight data stored in a fixed-point format, and the coded pulses are compressed pulse sequences; the locally generated data include the intermediate results of the membrane potential generated during the calculation of the pulse calculation array, and the final results obtained by the calculation of the entire network model, all of which are stored in a fixed-point format.

[0008] The weight transformation unit receives the weight data sent by the storage unit, and performs shift and expansion transformation on the initial weight according to the fixed-point method of the weight data and the pulse emission threshold of the neuron; the transformed result will subsequently enter the pulse calculation array and the decoded pulse sequence to complete the calculation and update of the membrane potential.

[0009] The pulse decoding unit is used to receive the coded pulse sent by the storage unit, and decompress it to obtain index information and a pulse sequence; send the index information to the main controller, and send the pulse sequence to the pulse calculation array under the scheduling of the main controller;

[0010] The pulse calculation array is used to receive the pulse sequence sent by the pulse decoding unit and the weight after the shift expansion transformation of the weight transformation unit, and complete the calculation of batch pulses and transformed weights in combination with the preset pulse sequence time width; the time width refers to the time window length. Each pulse calculation unit processes all pulses in a single pulse sequence in parallel, and the membrane potential update calculation of all time steps of a single neuron can be completed within a single clock cycle. If the pulse calculation array has calculated the final membrane potential of the single-layer network, the calculation result is sent to the pulse conversion unit; if the pulse calculation array calculates only the intermediate process value, and the current pulse calculation array storage capacity is insufficient to support further updates locally, the calculation result is sent to the storage unit for storage, and will be taken out and sent directly to the pulse calculation array to complete the final calculation result; if the pulse calculation array has calculated the final result of the entire network, it will be sent directly to the storage unit, and finally sent to the outside for processing.

[0011] The pulse conversion unit converts the received membrane potential into a pulse sequence by parallel processing and sends it to the pulse coding compression unit; wherein the membrane potential is data represented by a fixed-point number, and the pulse sequence is a string of data represented by multiple binary values.

[0012] The pulse coding compression unit compresses the received pulse sequence and sends it to the storage unit for storage; the pulse coding compression unit removes the pulse sequence that is no longer involved in the calculation during the data compression of the received pulse sequence to reduce data storage; the pulse sequence that is no longer involved in the calculation includes two types of sequences: insufficient to reach the minimum pulse emission threshold of the neuron and no pulse emission at all; the remaining pulse sequence is attached with index information, and the processed data will be sent to the storage unit for storage, and subsequently retrieved to complete the calculation of the remaining network layers.

[0013] The main controller is interconnected with the above-mentioned modules and is used to obtain the status of the above-mentioned modules, and generate corresponding control instructions according to the acquired status of each module to control each module to complete data scheduling and calculation; specifically: by controlling the storage unit, the initial fixed-point weight data is sent to the weight conversion unit to complete the weight conversion, and the compressed encoded pulse data is sent to the pulse decoding unit to complete the extraction of pulse index information and pulse sequence; according to the index information, the scheduling of input pulse sequence, weight and calculation process value in the calculation array is controlled to coordinate the pulse calculation array, pulse conversion unit and pulse coding compression unit to complete the calculation task of the entire network model.

[0014] Furthermore, when performing the shift and expansion transformation, the weight conversion unit performs processing according to the weight fixed-point method and neuron pulse threshold adopted by the current layer network, that is, the weight fixed-point method and neuron threshold adopted by each layer network are different.

[0015] Furthermore, the pulse conversion unit adopts the FS neuron model, and the combination of thresholds adopted in each time step is a geometric progression with a first term being a power of 2, a common ratio being 1 / 2, and a length equal to the length of the pulse time window.

[0016] Furthermore, the pulse calculation array completes the calculation according to the pulse time window length adopted by the current layer network. The time window length adopted by each layer network may be different, and for a single pulse sequence, only the pulses from time 0 to the time window length are involved in the calculation, and the pulses generated outside this period are not processed.

[0017] Furthermore, a multiplexer is provided between the pulse calculation array and the pulse conversion unit. Under the control of the main controller, the multiplexer selects data on one or several buses of the array according to index information and sends the data to the pulse conversion unit for processing.

[0018] The present invention is based on the FS neuron model and uses the principle of fixed-point data representation in hardware to convert the conversion of membrane potential to pulse into data bit extraction at a specific position, and convert the update of pulse to membrane potential into shift addition that can be processed in parallel, so that the spatiotemporal sparsity characteristics of SNN can be more fully utilized in hardware. The entire calculation process only involves shifting and addition, which greatly reduces the computational complexity, realizes parallel processing of batch neurons, and can greatly reduce computational delay. When the algorithm accuracy is guaranteed, that is, when the algorithm has no special requirements for input sparsity, a pulse neural network processor with low latency and low energy consumption is realized.

[0019] Compared with the existing technology, the present invention has the following beneficial effects:

[0020] 1) Combining the FS neuron model and the fixed-point quantization principle, the subtraction and comparison calculations in the membrane potential to pulse conversion are transformed into the extraction of specific data bits, which greatly reduces the amount of calculation and improves the conversion speed. It also reduces the hardware computing energy consumption and delay.

[0021] 2) By setting the neuron pulse emission threshold to a power of 2, the conversion of pulses to membrane potential is transformed into parallel shift addition, which can reduce the number of data reads, reduce the computational complexity, and ultimately improve the computing speed and reduce the hardware memory access energy consumption and computing energy consumption.

[0022] 3) Make full use of the spatiotemporal sparse characteristics of SNN to compress the time-dependent pulse sequence into data that can be processed in parallel, reduce the number of data readings in the calculation process, improve data scheduling efficiency, and achieve high data reuse and parallel processing data flow. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a schematic diagram of the overall structure of the pulse neural network processor of the embodiment;

[0024] Figure 2 This is a schematic diagram of encoding based on the FS neuron model of the embodiment;

[0025] Figure 3 For the embodiment pulse coding circuit;

[0026] Figure 4 Schematic diagram of extended shift operation of weight transformation unit in the embodiment;

[0027] Figure 5 Schematic diagram of the pulse code compression structure of the embodiment;

[0028] Figure 6 A coded pulse decompression circuit for an embodiment;

[0029] Figure 7 Schematic diagram of the structure of the pulse calculation unit of the embodiment. DETAILED DESCRIPTION

[0030] In order to better understand the purpose, structure and function of the present invention, the technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and embodiments.

[0031] like Figure 1 As shown, this embodiment provides a low-latency and low-energy consumption pulse neural network processor, including a storage unit, a weight transformation unit, a pulse decoding unit, a pulse calculation array, a pulse conversion unit, a pulse coding compression unit and a main controller.

[0032] The storage unit is composed of three parts: weight, activation value and coded pulse, which are used to store the initial weight of the neural network model provided by the external module, the pulse data after compression coding, and the data generated locally. The data generated locally include the intermediate results of the membrane potential generated during the calculation of the pulse calculation array and the final results obtained by the calculation of the entire network, all of which are stored in the format of fixed-point numbers. This part of the data is also called the activation value of the unfinished calculation. When processing some large network models, the processor sometimes cannot keep all the activation values ​​and pulse data of the single-layer network in the internal storage. At this time, it is necessary to temporarily store some data externally and move it back to the processor for calculation when the conditions are met. When performing model reasoning, the main controller controls the storage unit to receive the temporary external data. After the data is received, the main controller takes out the weight data and sends it to the weight conversion unit for expansion transformation, and takes out the coded pulse and sends it to the pulse decoding unit for decompression. After that, the main controller will assign the corresponding weights and pulse sequences to the pulse calculation array according to the index information obtained by pulse decoding to complete the calculation. The computing array of this embodiment is composed of 12 rows and 14 columns of single computing cores. The computing cores in each column can exchange data through the data channel, and the computing cores in each row can exchange data with the storage and multiplexer through the row data bus and the column data bus. The calculation result of the computing array is the activation value. If it is only the intermediate process value of a certain layer of the network and the final update cannot be completed inside the processor, the data will be sent to the activation value storage unit for storage. If it is the final activation value of the intermediate network layer, the main controller will control the multiplexer to select the corresponding data bus, and send the activation values ​​in the array in batches to four pulse conversion units, which complete the extraction of activation values ​​to pulse sequences. After that, the extracted pulses are sent to the corresponding four pulse coding compression units for compression to reduce the amount of data. The compressed coded pulses finally obtained will be sent to the coded pulse storage unit for storage to complete the calculation of the subsequent network layer. If it is the final calculation result of the last layer of the network, the data will be returned to the activation value storage unit and finally sent to the processor for the next step of processing.

[0033] Figure 2 This is a schematic diagram of encoding the activation value v based on the FS neuron model, using 2 as the maximum threshold and 3 as the time window length. Figure 2It can be seen that if the general encoding method is used, the entire encoding process will perform at most 2 subtractions and 3 comparisons, which will increase the amount of calculation, calculation delay and energy consumption. From the encoding results and the encoding process, it can be seen that when the threshold is a power of 2, the pulse sequence of the final encoding result is similar to the representation of fixed-point data. For this reason, a Figure 3 The encoding circuit shown. Where Vth is the threshold of the 0th time step, and V is the activation value. M is a 4-bit all-1 binary number, and Log is the logarithm with base 2. The circuit can extract 6 pulses from a 12-bit fixed-point (1.4.7 fixed-point) activation value with 1 sign bit, 4 integer bits, and 7 decimal bits. The processing logic is: if the sign bit is 1, it means that the activation value is negative and no pulse is sent, so the pulse sequence is all 0; if the sign bit is 0, 6 bits are taken from the remaining 10 bits of data as the pulse sequence according to the neuron threshold. Taking the maximum threshold 2 as an example, at this time, M[0] = 0, M[1], M[2], and M[3] are all 1. If any bit of the 8-10th bit of the activation value is 1, it means that the activation value is not less than 2. At this time, all 6 pulses are 1, and its meaning is also expressed as the maximum unsigned number represented by 1 integer bit and 5 decimal bits (0.1.5 fixed point); if all bits of the 8-10th bit of the activation value are 0, then the activation value V[7:2] is the pulse sequence corresponding to the activation value, and its meaning is also expressed as a 0.1.5 fixed-point unsigned number.

[0034] The weight transformation unit completes the expansion and shift operation of the initial weight. The transformation principle is as follows: Figure 4 As shown. MSB and LSB represent the highest bit and the lowest bit respectively, Ns and Nz represent the number of extended sign bits and the number of extended zero bits respectively. The initial weight is represented by 8 bits, and the new weight is 12 bits. The decimal places of the initial weight and the extended shifted weight are F8 and F12 respectively, and F8≤F12. Let K=Log(Vth), Vth is the maximum threshold, according to the coding principle:

[0035] Nz=F12-F8+K-1 (1)

[0036] Ns=12-8-Nz=5+F8-F12-K (2)

[0037] Take Vth=2, F12=7, F8=5 as an example, that is, the initial weight adopts 1.2.5 fixed point, and the new weight adopts 1.4.7 fixed point. At this time, K=1, Nz=2, Ns=2, which is equivalent to the original weight being transformed into 12 bits without changing its size. If Vth=4, then K=2, Ns=3, Nz=1, which is equivalent to shifting the original weight left by 2 bits, that is, the new weight is twice the original weight. According to Ns≥0, Nz≥0, the range of Vth can be obtained:

[0038] 2 4+F8-F2≤Vth≤2 5+F8-F2 (3)

[0039] The pulse code compression unit compresses the pulse data, reduces the amount of data to be transported, stored and accessed, and implements a structure such as Figure 5 As shown, the pulse sequence is 8-bit data. When the data is all 0, the counter will count and count the number of 0s. When the number of 0s is 1 and the next data is not all 0s, 0 and the data are encoded with the high 2 bits "01" to represent "0+pulse sequence"; when the number of 0s is greater than 1 and the next data is not all 0s, the counter count value and the highest bit "1" are encoded to represent "the number of 0s"; when the continuous data is not 0, it is encoded as "00+pulse sequence" in sequence.

[0040] The pulse decoding unit implementation structure is as follows Figure 6 As shown. For 8-bit compressed pulses, according to its encoding principle, the data index information and pulse signal are extracted. When the upper 2 bits of the data are "01", it means that the data contains a 0 and a pulse sequence. At this time, the adder is enabled, the data index will be added by 1 on the basis of the original, and the pulse in it will be taken out; when the upper 2 bits of the data are "00", it means that it only contains a pulse. At this time, the adder is not enabled, and the new data index is equal to the original index; when the highest bit of the data is "1", it represents the number of 0s, and the new data index will be based on the original plus the number of jumped 0s.

[0041] The pulse computing array consists of 168 pulse computing units, divided into 12 rows and 14 columns, and data communication is achieved through a data bus. Figure 7 is the implementation structure of the pulse calculation unit. Figure 7 As shown in the figure, for the pulse data of 6 time steps, two pulse calculation cores are used to complete the calculation, and each calculation core is implemented by combinational logic. The cache is implemented by registers. Among them, the membrane potential cache is to reduce the back and forth movement of repeated data, so that some data can be updated locally. Each calculation unit can also accept external activation values ​​to calculate the final output of the network layer.

[0042] In summary, the low-latency and low-energy pulse neural network processor provided by this implementation can effectively reduce data access and calculation, reduce calculation complexity, reduce calculation delay, adapt to large network structures, and realize high parallel and high data reuse data flow. Back-end simulation verification based on 28nm process, the average power consumption is 333.6mW, the area is 0.768mm 2 , throughput 201.6GOPS.

[0043] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.

Claims

1. A low-latency and low-energy consumption pulse neural network processor, comprising a storage unit, a weight conversion unit, a pulse decoding unit, a pulse calculation array unit, a pulse conversion unit, a pulse coding compression unit, and a main controller, Features: The storage unit is used to store the external input and locally generated data of the pulse neural network processor; the external input includes the initial weight and coded pulse of the network model, the initial weight is the weight data stored in the format of fixed-point numbers, and the coded pulse is a compressed pulse sequence; The locally generated data, including the intermediate results of membrane potential generated during the calculation process of the pulse calculation array unit and the final results obtained by the entire network calculation, are stored in the fixed-point format; The weight transformation unit receives the weight data sent by the storage unit, and performs shift expansion transformation according to the fixed-point mode of the weight data and the pulse emission threshold of the neuron; The pulse decoding unit receives the coded pulse sent by the storage unit and decompresses it to obtain index information and pulse sequence; The index information is sent to the main controller, and the pulse sequence is sent to the pulse calculation array unit under the scheduling of the main controller; The pulse calculation array unit receives the pulse sequence sent by the pulse decoding unit and the weight after the shift expansion transformation of the weight transformation unit, and completes the calculation of batch pulses and transformed weights in combination with the preset pulse sequence time window length; each pulse calculation unit processes all pulses in a single pulse sequence in parallel, and can complete the membrane potential update calculation of all time steps of a single neuron within a single clock cycle; If the pulse calculation array unit has calculated the final membrane potential of the single-layer network, the calculation result is sent to the pulse conversion unit; if the pulse calculation array unit calculates only an intermediate process value, and the current array storage capacity is insufficient to support further updates locally, the calculation result is sent to the storage unit for storage; If the pulse calculation array unit has calculated the final result of the entire network, it will be sent directly to the storage unit and finally sent to the outside for processing; The pulse conversion unit converts the received membrane potential into a pulse sequence by parallel processing and sends it to the pulse coding compression unit; The pulse coding compression unit compresses the received pulse sequence and sends it to the storage unit for storage; The main controller is interconnected with the above-mentioned units and is used to obtain the status of the above-mentioned units, generate corresponding control instructions according to the acquired status of each unit, so as to control each unit to complete data scheduling and calculation; by controlling the storage unit, send the initial fixed-point weight data to the weight conversion unit to complete the weight conversion, send the compressed encoded pulse data to the pulse decoding unit to complete the extraction of pulse index information and pulse sequence; control the scheduling of pulse sequences, weights and calculation process values ​​in the calculation array according to the index information, so as to coordinate the pulse calculation array unit, the pulse conversion unit and the pulse coding compression unit to complete the calculation task of the entire network model.

2. A low-latency, low-energy consumption pulse neural network processor according to claim 1, Features: The process of data compression of the received pulse sequence by the pulse coding compression unit also includes: eliminating the pulse sequence that no longer participates in the calculation to reduce data storage; the pulse sequence that no longer participates in the calculation includes two types of sequences that are not enough to reach the minimum pulse emission threshold of the neuron and the sequence that does not emit pulses at all.

3. A low-latency and low-energy consumption pulse neural network processor according to claim 1, Features: When performing the shift and expansion transformation, the weight transformation unit performs processing according to the weight fixed-point method and neuron pulse threshold adopted by the current layer network, that is, the weight fixed-point method and neuron threshold adopted by each layer network are different.

4. A low-latency and low-energy consumption pulse neural network processor according to claim 1, Features: The pulse conversion unit adopts the FS neuron model, and the combination of thresholds adopted in each time step is a geometric progression with a first term of 2, a common ratio of 1 / 2, and a length equal to the pulse time window length.

5. A low-latency and low-energy consumption pulse neural network processor according to claim 1, Features: The pulse calculation array unit completes the calculation according to the pulse time window length adopted by the current layer network, that is, the time window length adopted by each layer network is different, and for a single pulse sequence, only the pulses from time 0 to the time window length are calculated.

6. A low-latency, low-energy consumption pulse neural network processor according to any one of claims 1 to 5, Features: A multiplexer is also provided between the pulse calculation array unit and the pulse conversion unit. Under the control of the main controller, the multiplexer selects data on one or several array buses according to index information and sends the data to the pulse conversion unit for processing.