Highly energy-efficient NEST brain-like simulator based on PYNQ cluster

Through software and hardware co-design on the PYNQ cluster, the data transmission and calculation methods of the NEST emulator are optimized, the performance and power consumption issues of the brain-inspired computing system during large-scale SNN simulation are solved, and a highly energy-efficient brain-inspired simulation platform is realized. .

CN112784975BActive Publication Date: 2024-09-06HIGHWAY IND INTELLIGENCE TECH (WUXI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011495737.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-17
Publication Date
2024-09-06
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

Existing brain-inspired computing systems are difficult to maintain high performance and low power consumption during large-scale spiking neural network (SNN) simulations, and dedicated brain-inspired chips perform poorly in energy efficiency when applications do not match. Software-based brain-inspired emulators exist. Problems include high computational complexity, slow simulation speed, and high running power consumption.

Method used

Through software and hardware co-design on the PYNQ cluster, the NEST emulator is transplanted to the PYNQ cluster, and MPI distributed computing, FPGA parallel and pipeline design are used to optimize the data transmission between the Arm side and the FPGA part, and the weight value and dual Precision floating-point data types are quantified and converted to establish a high-energy-efficient NEST brain-like emulator based on PYNQ cluster.

Benefits of technology

It improves the calculation speed of SNN and reduces the power consumption, while maintaining the advantages of strong adaptability and scalability of NEST, providing a suitable computing platform for brain-like simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112784975B
    Figure CN112784975B
Patent Text Reader

Abstract

The present invention discloses a high-energy-efficiency NEST brain-like simulator based on a PYNQ cluster, S1: a single-node structural framework is established based on the NEST simulator to realize data transmission between the Arm end and the FPGA part; S2: a universal data transmission interface between the Arm end and the FPGA is designed; S3: the transmission data is classified, and different interfaces are designed for transmission to realize data transmission optimization; S4: the weight value and double-precision floating-point data type in the NEST simulator are subjected to data quantization conversion design; S5: the PYNQ cluster is connected by Ethernet, and the calculation data is evenly distributed to each node in the PYNQ cluster through MPI, and a brain-like simulator of the PYNQ cluster is established. The present invention maintains the advantages of NEST's strong adaptability and scalability while improving the SNN calculation speed and reducing power consumption, thereby providing a suitable computing platform for brain-like simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of brain-like simulators, and in particular to a high-energy-efficiency NEST brain-like simulator based on a PYNQ cluster. Background Art

[0002] At present, intelligent computing systems represented by deep learning still have two major bottlenecks: high system energy consumption and weak general intelligence level, making it difficult to become the ultimate means to solve artificial intelligence problems. The human brain is a complex organism composed of about 1011 neurons and 1015 synapses. It not only has a high level of intelligence but also consumes only about 20 watts of power. Its computing model is very worthy of study and reference. Current brain-like computing is mainly based on spiking neural networks (SNNs), whose working mechanism is closer to that of biological brains. Since SNNs that reach a certain scale can show a strong level of intelligence, one of the most challenging problems of brain-like computing is to maintain high performance and low power consumption of the system when simulating large-scale SNNs.

[0003] In response to the high energy efficiency requirements of brain-like computing, industry and academia have tried to use dedicated brain-like chips and systems to implement pulse neural networks. In 2018, the University of Manchester launched the SpiNNaker2 neural chip. Compared with the first generation, the chip has specially built hardware accelerators for exponential and logarithmic operations. Through fixed-point design, the chip energy efficiency ratio is improved with a certain loss of precision. In 2020, Intel launched the neuromorphic system Pohoiki Springs, which consists of 768 Loihi neuromorphic chips. The system can use up to 100 million neurons to perform tasks at a power consumption of less than 500W. "Tianji Core" is a new type of artificial intelligence chip developed by Shi Luping's team at the Brain-like Computing Research Center of Tsinghua University. The entire chip consists of 156 computing units (Fcore), containing about 40,000 neurons and 10 million synapses, supporting machine learning algorithms and existing brain-like computing algorithms. In 2020, Zhejiang University launched the brain-like chip "Darwin 2", which consists of 576 cores, each core supports 256 neurons, and has more than 10 million synapses. Through system-level expansion, it can build a brain-like computing system with tens of millions of neurons.

[0004] Dedicated brain-like chips and systems can achieve better performance and power consumption indicators, but they also have the defect of poor adaptability when facing different applications. When they do not match the application load, the energy efficiency performance will be greatly reduced. For example, when running a full-scale cortical microcircuit model on SpiNNaker, because the number of synapses connecting neurons in the model exceeds the optimal value set by SpiNNaker, the platform cannot run in the optimal state, making the computing energy efficiency worse than the NEST software simulation method based on a high-performance cluster or a single GPU method.

[0005] Therefore, if the energy efficiency of software-based brain-like simulators can be optimized through software-hardware co-design, it is expected to improve the system computing energy efficiency while maintaining good practicality. Currently, several software-based brain-like simulators such as Brain, NEST, and BindsNET have been widely used. They have the advantages of strong flexibility and high precision, but they have problems such as high computational complexity, slow simulation speed, and high operating power consumption. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide a high-energy-efficiency NEST brain-like simulator based on a PYNQ cluster, transplant the NEST simulator to the PYNQ cluster in a software-hardware collaborative design, and achieve high energy efficiency of the system through MPI distributed computing, FPGA parallel and pipeline design, and fixed-point computing design. While improving the SNN computing speed and reducing power consumption, the present invention maintains the advantages of NEST's strong adaptability and scalability, thereby providing a suitable computing platform for brain-like simulation.

[0007] In order to solve the above technical problems, the present invention provides a high-energy-efficiency NEST brain-like simulator based on a PYNQ cluster, comprising the following steps:

[0008] S1: Establish a single-node structure framework based on the NEST simulator to realize data transmission between the Arm side and the FPGA part;

[0009] S2: Design the general data transmission interface between the Arm side and the FPGA;

[0010] S3: Classify the transmitted data and design different interfaces for transmission to optimize data transmission;

[0011] S4: Design data quantization conversion for weight values ​​and double-precision floating-point data types in the NEST simulator;

[0012] S5: Use Ethernet to connect the PYNQ cluster, and use MPI to evenly distribute the computing data to each node in the PYNQ cluster. Run a single-node structure framework on each node to realize data transmission between the Arm side and the FPGA part, and establish a brain-like simulator for the PYNQ cluster.

[0013] In a preferred embodiment of the present invention, the process of building a single-node structure framework in step S1 is further included: designing the SNN calculation model through Python and running it on Jupyter Notebook, calling the PyNN library in Jupyter Notebook, and PyNN runs the NEST simulator through the PyNEST interface or SLI interpreter to realize the corresponding function construction.

[0014] In a preferred embodiment of the present invention, the NEST simulator further includes an AXI interface, and the AXI interface realizes data transmission with the FPGA part.

[0015] In a preferred embodiment of the present invention, it further includes step S2, when the NEST simulator on the Arm side starts running, first a section of shared memory is mapped to store data that needs to be calculated by FPGA, when the simulation starts, the data required for calculation is stored in the shared memory, when the data preparation is completed, the memory mapped address data_address is sent to FPGA through the AXI control bus through the software driver, and the FPGA reads the corresponding data in the shared memory according to data_address for calculation. After the calculation is completed, the FPGA will send a completion signal to the Arm side through the AXI control bus, and the Arm side will receive the completion signal, read the required data from the specified location of the shared memory, continue to run and release the mapping.

[0016] In a preferred embodiment of the present invention, the transmission data is further divided into the attenuation factor of the IAF neuron, the current value and voltage value of the IAF neuron, the threshold value and reset voltage of the IAF neuron, and the weight value; the attenuation factor of the IAF neuron is initialized after the model is run, and is not updated during the running stage. The overall data volume of the attenuation factor does not exceed 56 bytes, and the attenuation factor is transmitted through the AXI_LITE interface; the current value and voltage value of the IAF neuron are only assigned in the initialization stage of the model operation, but due to the huge number of neurons, data is transmitted through the AXI_Master_0 interface with better performance; the threshold value and reset voltage of the IAF neuron will be updated when the training image is updated, and the update frequency is low, but the amount of data each time is updated is large, and these parameters are transmitted through the same group of AXI_Master_1 interfaces; the weight value update frequency is not fixed, and the neurons are independent, so the number of weight value updates each time is not a fixed value, and data is transmitted through the AXI_Master_2 interface.

[0017] In a preferred embodiment of the present invention, it further includes that when designing the AXI_Master_2 interface to transmit the weight value, a neuron ID is issued.

[0018] In a preferred embodiment of the present invention, the weight value is further converted into fixed-point 16-bit data in step S4, and the fixed-point calculation formula is:

[0019] int16(y)=double(x)*2 Q ;

[0020] double(x)=int16(y)*2 -Q ;

[0021] Where x is a double-precision floating point number, y is a fixed-point 16-bit integer, and Q is the calibration value;

[0022] For the part where the weight value is converted into fixed-point 16-bit data, the default double-precision floating-point data type is converted into a half-precision floating-point number for calculation.

[0023] In a preferred embodiment of the present invention, step S5 is further included, wherein each node in the PYNQ cluster includes a PYNQ heterogeneous computing unit, a receive buffer unit and a send buffer unit. When the NEST simulator is run on multiple nodes through MPI, the simulator first records the overall connection relationship between neurons and synapses, and then distributes the neurons and synapses to each node evenly for calculation according to the node distribution; when a neuron on one of the nodes needs to send a pulse, the node puts the neuron information in the send buffer and sends it to the target node via Ethernet. The target node receives the pulse information through the receiver buffer and performs subsequent calculations. After the calculation is completed, the neuron calculation results of each node are collected through MPI.

[0024] In a preferred embodiment of the present invention, when running the same computing model, the amount of computing allocated to each node is inversely proportional to the number of nodes. The more nodes there are, the smaller the amount of computing for a single node, and the faster the overall computing speed. However, due to the increasing number of nodes, the communication between nodes becomes more complicated. When the amount of communication between nodes is large, the communication between nodes will become a new computing bottleneck, and the overall computing performance may even decline due to too many computing nodes. The factors that affect the cluster communication time include the number of communication processes and the network bandwidth. The calculation formula for MPI communication time is as follows:

[0025] time mpi =t mpi (sendbuffer, P)*Td+t bandwidth

[0026] where t mpi (sendbuffer, P) is the time required to send data of sendbuffer size each time under the scale of P, Td is the number of times the entire calculation is required, t bandwidth The time required to limit bandwidth.

[0027] In a preferred embodiment of the present invention, when implementing data transmission between the Arm side and the FPGA part, the memory space is divided, and a part of the memory space is separated and used alone for data interaction between the Arm and the FPGA. The size of the independent memory space is determined by the amount of data transmitted, and the calculation formula is:

[0028] ddr_size=neuron_num*data_type*para_num

[0029] Where ddr_size is the total size of the memory, neuron_num is the number of neurons, data_type is the data type, and para_num is the number of parameters of the neuron.

[0030] Beneficial effects of the present invention:

[0031] The present invention transplants NEST to the PYNQ cluster in a software-hardware collaborative design manner. By designing a universal data transmission interface between the Arm end and the FPGA, and classifying and quantizing the data transmitted by the interface, each node in the PYNQ cluster runs a single-node structure framework through MPI, realizing data transmission between the Arm end and the FPGA part in each node, and establishing a brain-like simulator for the PYNQ cluster, the high energy efficiency of the system is achieved. While improving the SNN computing speed and reducing power consumption, the present invention maintains the advantages of NEST's strong adaptability and scalability, thereby providing a suitable computing platform for brain-like simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a step diagram of building a high-energy-efficiency NEST brain-like simulator based on a PYNQ cluster of the present invention;

[0033] Figure 2 It is a single-node structural framework of the present invention;

[0034] Figure 3 It is the memory space partition diagram of the present invention;

[0035] Figure 4 It is a design diagram of the universal data transmission interface of the present invention;

[0036] Figure 5 It is the transmission data classification input design diagram of the present invention;

[0037] Figure 6 is a weight value distribution diagram of the present invention;

[0038] Figure 7 is a distribution diagram of membrane potential and attenuation factor of the present invention;

[0039] Figure 8 It is a comparison chart of resource consumption between the present invention and the NEST simulator;

[0040] Fig. 9 Data transmission design diagram for each node in the PYNQ cluster;

[0041] Fig.10 Diagram of the operation process of the PYNQ cluster. DETAILED DESCRIPTION

[0042] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0043] Reference Figure 1 As shown, an embodiment of the high energy efficiency NEST brain simulator based on the PYNQ cluster of the present invention includes the following steps:

[0044] S1: Establish a single-node structure framework based on the NEST simulator to realize data transmission between the Arm side and the FPGA part;

[0045] S2: Design the general data transmission interface between the Arm side and the FPGA;

[0046] S3: Classify the transmitted data and design different interfaces for transmission to optimize data transmission;

[0047] S4: Design data quantization conversion for weight values ​​and double-precision floating-point data types in the NEST simulator;

[0048] S5: Use Ethernet to connect the PYNQ cluster, and use MPI to evenly distribute the computing data to each node in the PYNQ cluster. Run a single-node structure framework on each node to realize data transmission between the Arm side and the FPGA part, and establish a brain-like simulator for the PYNQ cluster.

[0049] Reference Figure 2 As shown, in step S1, the user can design the SNN computing model through Python and run it on Jupyter Notebook, call the PyNN library in Jupyter Notebook, and PyNN runs NEST through the PyNEST interface or SLI interpreter to implement the corresponding functions. The NEST simulator on the Arm side includes an AXI interface to realize data transmission with the FPGA part. Due to the flexible design of FPGA and the characteristics of parallel computing, the steps suitable for parallel computing on the NEST simulator (neuron update, synapse update, etc.) can be transplanted to the FPGA for calculation according to the use requirements, thereby improving the overall calculation speed of the NEST simulator.

[0050] Reference Figure 3 As shown, in order to achieve Arm and FPGA hardware and software co-design, the memory DDR space is divided during the design, and a part of the memory DDR space is separated and used solely for data interaction between Arm and FPGA.

[0051] In PYNQ, the memory size of the memory DDR is 512MB. The size of the shared memory is determined by the amount of data transmitted. The calculation formula is:

[0052] ddr_size=neuron_num*data_type*para_num

[0053] Where ddr_size is the total size of the memory, neuron_num is the number of neurons, data_type is the data type, and para_num is the number of parameters of the neuron.

[0054] According to the formula, this embodiment sets the shared memory size of each node to 64MB. This shared memory size can ensure that each neuron of a single node stores 119 4-byte parameters when the number of neurons is the maximum, meeting the usage requirements of NEST calculation.

[0055] Specifically, the type and number of neurons and synapses during NEST runtime are related to the requirements of the computing model. The NEST computing bottleneck will vary greatly when running different computing models. Users can place the computing modules that need to be accelerated on the FPGA for parallel and pipeline design according to different computing requirements. Therefore, it is very necessary to design a universal data transmission interface.

[0056] The interface design for data transmission between the Arm side and the FPGA is as follows Figure 4 As shown in the figure, the accelerated part is the computing bottleneck, so it is removed from the Arm side and redesigned in the FPGA side. When the NEST simulator on the Arm side starts running, it first maps a section of shared memory to store the data that needs to be calculated by the FPGA. When the simulation starts, the data required for the calculation is stored in the shared memory.

[0057] When the data preparation is completed, the memory-mapped address data_address is sent to the FPGA through the AXI control bus through the software driver. The FPGA reads the corresponding data in the shared memory according to data_address for calculation. The pseudo code of this part is as follows:

[0058]

[0059] Where mem_size is the memory size required for each segment of data, fpga_address is the base address of the FPGA control bus, and offset is the address offset of the control bus.

[0060] After the calculation is completed, the FPGA will send a completion signal to the Arm side through the AXI control bus. After receiving the completion signal, the Arm side reads the required data from the specified location of the shared memory to continue running and unmap it. The pseudo code of this part is as follows:

[0061]

[0062]

[0063] In the NEST simulator, when the membrane potential of a neuron is greater than the threshold value, the neuron emits a pulse and updates the calculation parameters and weights. When performing neuron calculations through FPGA, the calculation formula for the amount of data that needs to be transmitted each time is as follows:

[0064] update_size=spike_num*data_type*para_num

[0065] spike_num represents the number of neurons that emit spikes, data_type is the data type, and para_num is the number of parameters that need to be updated for each neuron. IAF neurons have many calculation parameters, and most of the data in the NEST simulator uses double-precision floating point numbers. If all parameters are updated after each calculation, the data updated for each neuron is 80 bytes.

[0066] By analyzing the parameters and calculation results of IAF neurons, it is found that the calculation parameters of neurons do not need to be updated after each calculation. All calculation parameters are classified according to different update requirements. Only necessary data is updated each time to reduce the amount of data transmission and the time of data transmission. The design of input data is as follows: Figure 4 shown.

[0067] The attenuation factor of the IAF neuron is initialized after the model runs and is not updated during the running phase. The total data volume of the attenuation factor does not exceed 56 bytes. Transmitting the attenuation factor through the AXI_LITE interface can reduce the use of high-speed interfaces and save resources.

[0068] The current and voltage values ​​of IAF neurons are also assigned only during the initialization phase of the model. However, due to the huge number of neurons, data transmission through the AXI_Master_0 interface with better performance can reduce data transmission time. The formula for calculating transmission time is as follows:

[0069]

[0070] Where ex_time is the transmission time, bus_width is the bus width, and clock_frequency is the clock frequency. Since the maximum data width of the AXI_Master_0 bus is 64 bits, when the clock frequency is 100MHz, the bus bandwidth is as high as 800MB / s, which is sufficient to meet the data transmission requirements of a large number of neurons.

[0071] Parameters such as the threshold value and reset voltage of the IAF neuron will be updated when the training image is updated. The update frequency is low, but the amount of data for each update is large. These parameters are transmitted through the same set of AXI_Master_1 interfaces.

[0072] A separate AXI_Master_2 interface is designed to update the weight value and send out the neuron ID. The weight is updated when the neuron emits a pulse. The weight update frequency is not fixed, and each neuron is independent. Therefore, the number of weight updates each time is not a fixed value. The pulse emission rate is calculated using the formula:

[0073]

[0074] It is concluded that the pulse firing rate of the cortical visual model is not high and the amount of data transmitted each time is limited. Therefore, after a round of calculation is completed, the neuron ID that emits the pulse is also sent back to the shared memory through this port.

[0075] The default data type in the NEST simulator is double-precision floating point. If double-precision floating point data is used for multiplication or addition in FPGA, a large amount of DSP resources on the FPGA will be consumed, seriously affecting the parallelism of neuron calculations. Through statistical analysis, when running the cortical visual model, the distribution of weight values, membrane potentials, and attenuation factors is as follows: Figure 5-6 shown.

[0076] like Figure 5 As shown in the figure, the weight values ​​are mainly distributed between 0 and 1400. Their numerical range is large and most of them are integers. Converting the weight values ​​into fixed-point 16-bit data can reduce the data bit width and resource consumption while ensuring the calculation accuracy. The fixed-point calculation formula is shown below, where x is a double-precision floating point number, y is a fixed-point 16-bit integer, and Q is the calibration value.

[0077] int16(y)=double(x)*2 Q ;

[0078] double(x)=int16(y)*2 -Q ;

[0079] The membrane potential and attenuation factor are mainly distributed between 0-15, and a large part of them are non-zero decimals. The accuracy requirements for calculating these data are relatively high. Since the membrane potential and attenuation factor data range is 0-15, the integer part requires at least 4 bits of data. If fixed-point 16 bits are used for calculation, the data accuracy is at most Q12, which will result in a large loss of accuracy. In order to ensure better data accuracy, this part of the data is converted into half-precision floating point numbers for calculation. The use of half-precision floating point numbers can reduce the data bit width and reduce the overhead of hardware resources. The Xilinx high-level synthesis language includes the function of half-precision floating point numbers (half), and half can be used directly for hardware design during hardware design. Half consists of 16 bits of data and can represent 6.10*10 -5 For values ​​in the range of 65504 to 65504, the decimal places can reach the precision of fixed-point numbers Q14 while meeting the integer range.

[0080] Comparison of resource consumption of fixed-point 16-bit, half, float and double types Figure 7 As shown, using fixed-point 16-bit and half type data can greatly save hardware resources.

[0081] The NEST simulator itself supports the distributed memory multi-process technology of MPI (Message Passing Interface). The above-mentioned IAF neuron update is implemented through the heterogeneous design of Arm+FPGA. This part of the design mainly improves the overall computing speed by increasing the computational parallelism during neuron updates. The overall computing process has not changed, and the change to the NEST computing architecture is very small. Therefore, the method of connecting large-scale clusters through Ethernet is also applicable to the heterogeneous design of Arm+FPGA.

[0082] Reference Figure 8 As shown in the figure, the entire cluster is connected via Ethernet. In addition to the PYNQ heterogeneous computing unit, each node in the cluster also contains a set of receive buffers and send buffers. The function of the receive buffer is to receive pulse information sent by other nodes for calculation by the node; the send buffer is the opposite of the receive buffer and is used to send the pulses generated in the node to other nodes.

[0083] Reference Fig. 9As shown in the figure, when the NEST simulator is run on multiple nodes through MPI, the simulator will first record the overall connection relationship between neurons and synapses, and then evenly distribute neurons and synapses to each node for calculation according to the node distribution. When a neuron on one of the nodes needs to send a pulse, the node will put the neuron information into the send buffer and send it to the target node via Ethernet. The target node receives the pulse information through the receiver buffer and performs subsequent calculations. After the calculation is completed, the neuron calculation results of each node are collected through MPI.

[0084] When running the same computing model, the amount of computing allocated to each node is inversely proportional to the number of nodes. The more nodes there are, the smaller the amount of computing for each node, and the faster the overall computing speed. However, due to the increasing number of nodes, the communication between nodes becomes more complicated. When the amount of communication between nodes is large, the communication between nodes will become a new computing bottleneck, and the overall computing performance may even decline due to too many computing nodes.

[0085] There are many factors that affect cluster communication time. The most influential factors are the amount of communication information, the number of communication processes, and the network bandwidth. The calculation formula for MPI communication time is as follows:

[0086] time mpi =t mpi (sendbuffer, P)*Td+t bandwidth

[0087] where t mpi (sendbuffer, P) is the time required to send data of sendbuffer size each time under the scale of P, Td is the number of times the entire calculation is required, t bandwidth The time required for bandwidth limitation is affected. Since the amount of data transmitted when the cortical visual model is running is not large, it is difficult to use up the bandwidth. bandwidth Can be ignored, the more computing nodes there are, the mpi (sendbuffer, P) also requires more time.

[0088] Specifically, when the brain-like simulator of this embodiment runs a 128*128 data set of a cortical layer vision model, the cluster has the best computing performance when it has 8 nodes, and the neuron update time is 23.8 times faster than that of Xeon 2620; when running a 300*300 data set of a cortical layer vision model, the cluster has the best computing performance when it has 24 nodes, and the neuron update time is 73.6 times faster than that of Xeon 2620.

[0089] When the cluster performance of this embodiment is optimal, the power consumption increases with the increase of nodes. When running the cortical layer visual model, the cluster of this embodiment has high energy efficiency when the number of nodes is small. As the number of nodes increases, the communication time increases, and the update energy efficiency ratio decreases slightly, while the update energy efficiency ratio of Xeon 2620 has little change compared with the overall. When running a 128*128 data set, the best performance 8-node cluster is 49 times higher than that of Xeon 2620. When running a 300*300 data set, the best performance 24-node cluster is 50 times higher than that of Xeon 2620.

[0090] Specifically, in order to improve the versatility of the overall design and reduce the complexity of use, this solution implements the overall acceleration solution on the PYNQ platform. PYNQ is a platform based on the Xilinx ZYNQ 7000FPGA. In addition to inheriting the powerful processing performance of the traditional ZYNQ platform, it is also compatible with the Arduino interface and the standard Raspberry Pi interface, and has great scalability and open source. Its most important feature is that it uses Python for programming and provides a Jupyter Notebook online editing tool based on Web access. Implementing a pulse neural network accelerator based on the PYNQ framework can simplify the complexity of using pulse neural networks and simplify the operational process of the driver development part.

[0091] In this embodiment, the PYNQ API library is used for driver development, the Python language is used to design the driver, and the accelerator unit on the FPGA side is accessed through Python. The PS / PL communication method uses AXI4 or AXI-stream for data interaction, and the shared memory method is used to avoid the problem of insufficient storage resources on the FPGA chip.

[0092] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.

Claims

1. A high-energy-efficiency NEST brain-like simulator based on a PYNQ cluster, characterized in that: The following steps are involved: S1: Establish a single-node structure framework based on the NEST simulator to realize data transmission between the Arm side and the FPGA part; S2: Design the general data transmission interface between the Arm side and the FPGA; S3: Classify the transmission data and design different interfaces for transmission to achieve data transmission optimization. The transmission data is divided into the attenuation factor of the IAF neuron, the current value and voltage value of the IAF neuron, the threshold value and reset voltage of the IAF neuron, and the weight value; the attenuation factor of the IAF neuron is initialized after the model is run, and is not updated during the running stage. The overall data volume of the attenuation factor does not exceed 56Byte, and the attenuation factor is transmitted through the AXI_LITE interface; the current value and voltage value of the IAF neuron are only assigned in the initialization stage of the model operation. Due to the huge number of neurons, data is transmitted through the AXI_Master_0 interface with better performance; the threshold value and reset voltage of the IAF neuron will be updated when the training image is updated, and the update frequency is low. The amount of data for each update is large, and these parameters are transmitted through the same group of AXI_Master_1 interfaces; the weight value update frequency is not fixed, and the neurons are independent. The number of weight value updates each time is not a fixed value, and data is transmitted through the AXI_Master_2 interface; S4: Design data quantization conversion of weight values ​​and double-precision floating-point data types in the NEST simulator; S5: Use Ethernet to connect the PYNQ cluster, and use MPI to evenly distribute the computing data to each node in the PYNQ cluster. Run a single-node structure framework on each node to realize data transmission between the Arm side and the FPGA part, and establish a brain-like simulator for the PYNQ cluster.

2. The high-energy-efficiency NEST brain-like simulator based on the PYNQ cluster as claimed in claim 1, characterized in that: The construction process of the single-node structure framework in step S1 is: design the SNN calculation model through Python and run it on Jupyter Notebook, call the PyNN library in Jupyter Notebook, and PyNN runs the NEST simulator through the PyNEST interface or SLI interpreter to implement the corresponding function construction.

3. The high-energy-efficiency NEST brain-like simulator based on PYNQ cluster as claimed in claim 2, characterized in that: The NEST simulator includes an AXI interface, which realizes data transmission with the FPGA part.

4. The high-energy-efficiency NEST brain-like simulator based on PYNQ cluster as claimed in claim 1, characterized in that: In step S2, when the NEST simulator on the Arm side starts running, it first maps a section of shared memory to store the data that needs to be calculated by the FPGA. When the simulation starts, the data required for the calculation is stored in the shared memory. When the data preparation is completed, the memory mapping address data_address is sent to the FPGA through the AXI control bus through the software driver. The FPGA reads the corresponding data in the shared memory according to data_address for calculation. After the calculation is completed, the FPGA will send a completion signal to the Arm side through the AXI control bus. After receiving the completion signal, the Arm side reads the required data from the specified location of the shared memory to continue running and release the mapping.

5. The high-energy-efficiency NEST brain-like simulator based on PYNQ cluster as claimed in claim 1, characterized in that: When designing the AXI_Master_2 interface to transmit weight values, the neuron ID is also issued.

6. The energy-efficient NEST brain-like simulator based on a PYNQ cluster as claimed in claim 1, characterized in that: In step S4, the weight value is converted into fixed-point 16-bit data, and the fixed-point calculation formula is: int16(y)=double(x)*2 Q ; double(x)=int16(y)*2 -Q ; Where x is a double-precision floating point number, y is a fixed-point 16-bit integer, and Q is the calibration value; For the part where the weight value is converted into fixed-point 16-bit data, the default double-precision floating-point data type is converted into a half-precision floating-point number for calculation.

7. The high-energy-efficiency NEST brain-like simulator based on PYNQ cluster as claimed in claim 1, characterized in that: In step S5, each node in the PYNQ cluster includes a PYNQ heterogeneous computing unit, a receive buffer unit and a send buffer unit. When the NEST simulator is run on multiple nodes through MPI, the simulator will first record the overall connection relationship between neurons and synapses, and then evenly distribute neurons and synapses to each node for calculation according to the node distribution; when a neuron on one of the nodes needs to send a pulse, the node will put the neuron information in the send buffer and send it to the target node via Ethernet. The target node receives the pulse information through the receiver buffer and performs subsequent calculations. After the calculation is completed, the neuron calculation results of each node are collected through MPI.

8. The high-energy-efficiency NEST brain-like simulator based on PYNQ cluster as claimed in claim 7, characterized in that: When running the same computing model, the amount of computing allocated to each node is inversely proportional to the number of nodes. The more nodes there are, the smaller the amount of computing for each node, and the faster the overall computing speed. However, due to the increase in nodes, the communication between nodes becomes more complex. When the amount of communication between nodes is large, the communication between nodes will become a new computing bottleneck. The overall computing performance may even decline due to too many computing nodes. Factors that affect cluster communication time include the number of communication processes and network bandwidth. The calculation formula for MPI communication time is as follows: time mpi =t mpi (sendbuffer,P)*Td+t bandwidth where t mpi (sendbuffer, P) is the time required to send data of sendbuffer size each time under the scale of P, Td is the number of times the entire calculation is required, t bandwidth The time required to limit bandwidth.

9. The high-energy-efficiency NEST brain-like simulator based on PYNQ cluster as claimed in claim 1, characterized in that: When implementing data transmission between the Arm side and the FPGA part, the memory space is divided and a part of the memory space is separated and used solely for data interaction between the Arm and the FPGA. The size of the independent memory space is determined by the amount of data transmitted, and the calculation formula is: ddr_size=neuron_num*data_type*para_num Where ddr_size is the overall size of the memory, neuron_num is the number of neurons, data_type is the data type, and para_num is the number of parameters of the neuron.