WO2022183921A1 - Neural model mapping method of brain-like computer operating system - Google Patents

Neural model mapping method of brain-like computer operating system Download PDF

Info

Publication number
WO2022183921A1
WO2022183921A1 PCT/CN2022/077079 CN2022077079W WO2022183921A1 WO 2022183921 A1 WO2022183921 A1 WO 2022183921A1 CN 2022077079 W CN2022077079 W CN 2022077079W WO 2022183921 A1 WO2022183921 A1 WO 2022183921A1
Authority
WO
WIPO (PCT)
Prior art keywords
neuron
cluster
logical
mapping
physical
Prior art date
Application number
PCT/CN2022/077079
Other languages
French (fr)
Chinese (zh)
Inventor
吕攀
张本浩
杨国青
李红
邓水光
潘纲
吴朝晖
Original Assignee
浙江大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 浙江大学 filed Critical 浙江大学
Publication of WO2022183921A1 publication Critical patent/WO2022183921A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/061Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using biological neurons, e.g. biological neurons connected to an integrated circuit
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the invention belongs to the technical field of brain-like computers, and in particular relates to a method for mapping an impulse neural network model of a brain-like computer operating system.
  • Neuron clusters are borrowed from the concept of neuron clusters in the human brain and represent a collection of neurons.
  • a physical neuron is the smallest computing unit in a brain-like chip, and a physical neuron cluster is composed of several physical neurons.
  • the logical neuron cluster refers to the logical neuron cluster represented in the brain-like computing model, and this part of the neuron cluster has not been assigned to the physical neuron cluster.
  • the model deployment system in the brain-like computing software is responsible for deploying the compiled computing model to the brain-like computing chip.
  • the model deployment system determines the usability and convenience of the brain-like computing hardware platform.
  • BrainScaleS OS developed by Heidelberg University in Germany uses PyNN to build a neural network model and provides two ways to map neurons to hardware neuron circuits. One is that the developer directly specifies the hardware neuron coordinates, that is, manual binding. The other is that BrainScaleS OS uses a greedy algorithm for mapping, that is, automatic binding. Mapping core process: (1) Neurons are sorted in descending order according to in-degree. Map neurons in descending order of in-degree. (2) Sort the HICANN chips according to the coordinates. The coordinates represent the actual physical communication distance, and the chip closest to the wafer center will be used first.
  • the SpiNNaker software system architecture of the University of Manchester in the United Kingdom provides the software operating environment for the system host and the PCB board-level system containing 48 SpiNNaker chips.
  • the work of Jonathan Heathcote et al. abstracted the mapping problem in the SpiNNaker system into a circuit layout design to meet the hardware constraints of ARM processor resources and memory resources, with the goal of reducing the data traffic within and between boards, using a simulated annealing algorithm. Implement model mapping.
  • Intel provides the Loihi development toolchain, which provides a Python-based API, compiler, runtime, software simulator, and FPGA emulator.
  • Loihi's compiler first splits the spiking neural network. The goal of splitting is to use as few neuron computing cores as possible, and map neurons to neuron computing cores in a greedy way. The compiler then generates the final binary, which in addition to being deployed on the Loihi chip, can also be used for simulation testing.
  • the Chinese invention patent with publication number CN105469143A proposes an on-chip network resource mapping method based on the dynamic characteristics of neural network.
  • the communication volume of each core is calculated. If the ratio of the communication volume between any two cores does not meet the preset value, half of the neurons of the two cores are exchanged and remapped.
  • This method can effectively balance the load and reduce the congestion of the on-chip network, but its final effect depends too much on the quality of the initialization rules and needs to run the SNN network multiple times for optimization.
  • the Darwin brain-like computer consists of 66 brain-like computing nodes, each brain-like computing node consists of 3 Darwinian brain-like computing chipsets, and each Darwinian brain-like computing chipset consists of 4 Darwinian brain-like chips through chip expansion technology.
  • the chip set realizes impulse communication by forwarding logic neuron clusters.
  • the four brain-like computing chips in the chipset are addressed uniformly, and the address spaces between the chipsets are independent of each other.
  • the present invention proposes a neural model mapping method for a brain-like computer operating system, which performs mapping according to the hardware constraints of the Darwinian brain-like computer. After the mapping, the original model performance can be maintained, and no SNN network needs to be performed. re-optimization.
  • the neural model mapping method of a brain-like computer operating system proposed by the present invention includes the following steps:
  • mapping from the logical neuron cluster to the physical neuron cluster of the brain-like computer is obtained.
  • step (3) the mappable area is calculated according to the cross-chipset impulse communication constraints of the brain-like computer and the routing relationship between the chip sets.
  • step (4) for the logical neuron cluster transmitted in the chipset, select the physical neuron cluster to do the mapping according to the following method: According to the topology sequence O(G), for the logical neuron cluster v1, Calculate the communication power consumption of each physical neuron cluster in the corresponding mappable region R, and select the physical neuron cluster with the lowest power consumption for mapping; for the logical neuron cluster whose topology sequence is after v1, repeat the previous steps and select the mappable neuron cluster physical neuron clusters for mapping.
  • a logical neuron cluster v in the topological sequence cannot find the corresponding physical neuron cluster for mapping, the mapping fails.
  • remapping starts from v1.
  • the specific method is as follows: For logical neuron In the mappable area R of the cluster v1, find the value with the smallest abscissa in all physical neuron clusters from the mappable area R, and select the physical neuron with the smallest ordinate from the set of physical neuron clusters whose abscissa is equal to the minimum value.
  • Cluster mapping for logical neuron clusters whose topological sequence is after v1, repeat the above steps to select a mappable physical neuron cluster until all logical neuron clusters find the corresponding physical neuron cluster for mapping.
  • step (4) for the logical neuron cluster transmitted in the chipset, select the physical neuron cluster for mapping according to the following method: for the mappable area R of the logical neuron cluster v1, from the mappable area R Find the value with the smallest abscissa in all physical neuron clusters, and select the physical neuron cluster with the smallest ordinate from the set of physical neuron clusters whose abscissa is equal to the minimum value for mapping; for the logical neuron cluster whose topological sequence is after v1 , repeat the above steps to select a mappable physical neuron cluster until all logical neuron clusters find the corresponding physical neuron cluster for mapping.
  • the upper left in the mappable region R is used as the initial point, and the layers are expanded outward in turn.
  • the mappable physical neuron cluster is selected in the direction from the upper right to the lower left. .
  • mapping from logical neuron clusters to Darwinian brain-like computer physical neuron clusters is obtained.
  • the spiking neural network can be reliably mapped to the Darwinian brain-like computer, which can reasonably deal with various models of different scales, effectively reduce network congestion, and can be extended to multiple computing nodes.
  • FIG. 1 is a schematic flowchart of a neural model mapping process of a brain-like computer operating system according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram of region division of a Darwinian brain-like chipset according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a Darwinian brain-like computing node model mapping according to an embodiment of the present invention.
  • FIG. 4 is an effect diagram of a model mapping in a Darwinian brain-like chipset according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of the mapping sequence of the output area of the Darwinian brain-like chip according to an embodiment of the present invention.
  • FIG. 6 is a rendering effect diagram of the output model of the Darwinian brain-like chip according to the embodiment of the present invention.
  • a neural model mapping method for a brain-like computer operating system of the present embodiment includes the following steps:
  • the pulse routing distance mapping is used for the transmission neuron clusters within the chipset
  • the hierarchical spiral mapping method is used for the transmission neuron clusters between the chipsets.
  • Embodiments of the present invention relate to Darwinian brain-like computers and spiking neural network models.
  • the neural model splitting method used in the embodiments of the present invention needs to meet the hardware constraints of the Darwinian brain-like computer.
  • two models are used in the specific implementation of the embodiments of the present invention, namely, a handwritten digit recognition model (MNIST) and a voice recognition model (VOICE). in and running normally.
  • MNIST handwritten digit recognition model
  • VOICE voice recognition model
  • the chipset is divided into seven regions, as shown in Figure 2.
  • the upper left corner is the origin of coordinates
  • the dotted box is the area where the output neuron cluster is located and the area where the forwarding neuron cluster is located
  • the solid line box is the area where the common neuron cluster is located.
  • the functions of the output neuron cluster and the forwarding neuron cluster are mainly to send pulses to the inter-chip network outside the brain-like computing chip or other chipsets.
  • the main function of the common neuron cluster node is to simulate neurons by time division multiplexing, process pulses according to the spiking neuron model, and dynamically update data such as membrane voltage.
  • R 1 corresponds to the area where the output neuron cluster is located
  • R 2 R 3 corresponds to the area where the forwarding neuron cluster is located
  • R 4 R 5 R 6 R 7 corresponds to the area where the common neuron cluster is located.
  • the connection relationship between the chipsets is shown in Figure 3.
  • the constraints that the spiking neural network model mapping needs to satisfy include the chipset impulse output constraint, the cross-chipset impulse communication constraint and the synaptic connection constraint.
  • Chipset pulse output constraint means that only the common neuron cluster in the region R 4 ⁇ R 5 ⁇ R 6 can establish a connection relationship with the neuron cluster in the region R 1 ⁇ R 2 ⁇ R 3 . Since the pulses sent to the region R1 ⁇ R2 ⁇ R3 will pass through the chipset boundary to the external virtual forwarding neuron node implemented by the FPGA, this connection constraint is called the chipset pulse output constraint.
  • the cross-chipset impulse communication constraint means that within the same brain-like computing node, for a logical neuron cluster v, its corresponding logical neuron cluster set V in (v) ⁇ v cannot be distributed on three different chipsets , where Vin (v) represents the set of logical neuron clusters pointing to the logical neuron cluster v.
  • the synaptic connection constraint means that, for the Darwin brain-like chip, the neuron data packet in the synaptic memory uses 8 bits to represent the relative coordinates of the destination logical neuron cluster node, the first 4 bits are used to represent the abscissa, and the last 4 bits are used to represent Y-axis. Therefore, it is assumed that the coordinates represented by the dynamic reference origin register of the logical neuron cluster v are (x o , y o ), and the logical neuron cluster area that the neurons in the logical neuron cluster v can connect to is Region(x o , y o ) , x o +15, y o +15). That is, the logical neuron cluster set V out (v) pointed to by the logical neuron cluster v must be in this area.
  • the structure of the MNIST model is 7 ⁇ 4 ⁇ 1, that is, it is divided into 3 layers, and the total number of logical neurons is 12.
  • the structure of the VOICE model is 43x140x150x55x63x18x8x1x1, that is, it is divided into 9 layers, and the total number of logical neuron clusters is 479.
  • the input of the model mapping is the connection relationship between the logical neuron clusters, that is, the model directed graph G.
  • V in (v) and V out (v) of each logical neuron cluster v where V in (v) represents the set of logical neuron clusters pointing to v, and V out (v) represents the logical neuron pointed to by v A collection of metaclusters.
  • n is the number of logical neuron clusters.
  • the region R that can be mapped by the logical neuron cluster v is calculated.
  • the mappable area of the logical neuron cluster v is the area where the common neuron cluster is located, that is, R 4 ⁇ R 5 ⁇ R 6 ⁇ R 7 .
  • this embodiment provides six situations: 1) if v is mapped to chipset 1, and V in (v) is mapped to chipset 2, then the mappable area of logical neuron cluster v is R 5 ; 2) If v maps to Chipset 1 and Vin (v) maps to Chipset 3, then the mappable region for logical neuron cluster v is R4; 3 ) If v maps to Chipset 2, Vin (v) maps to Chipset 1, the mappable area of logical neuron cluster v is R 4 ; 4) If v is mapped to chipset 2, and V in (v) is mapped to chipset 3, then the mappable area of logical neuron cluster v is R 5 ; 5) If v maps to Chipset 3 and Vin (v) maps to Chipset 1, then the mappable area for logical neuron cluster
  • the RM matrix can be defined as follows,
  • the mappable area is empty, and the mappable area of v cannot be found at this time, and the subsequent mapping steps cannot be performed, and the mapping fails to exit.
  • the synaptic connection constraints calculate the area that the logical neuron cluster v can map.
  • the specific method is to traverse the logical neuron clusters in the logical neuron cluster set V in (v).
  • the connection relationship between u and v is that u points to v.
  • x min max(x min -(16-(x max -x min )), 0)
  • x max min(x max +(16-(x max -x min )), 47)
  • y min max(y min -(16-(y max -y min )), 0)
  • x min , x max , y min , and y max are intermediate variables for calculation, and represent the minimum abscissa, maximum abscissa, minimum ordinate, and maximum ordinate of the currently calculated minimum region R(u), respectively.
  • Region(x min , y min , x max , y max ) represents the smallest region R(u) with (x min , y min ) as the lower left vertex and (x max , y max ) as the upper right vertex.
  • V in (v) represents the set of logical neuron clusters pointing to the logical neuron cluster v;
  • V out (v) represents the set of logical neuron clusters pointed to by the logical neuron cluster v;
  • v n represents the number of the brain-like computing node to which the logical neuron cluster v is mapped
  • v c represents the chipset number to which the logical neuron cluster v is mapped
  • v x represents the abscissa of the logical neuron cluster v
  • v y represents the ordinate of the logical neuron cluster v
  • Step 1 Calculate the area that can be mapped by the logical neuron cluster v according to the cross-chipset impulse communication constraints
  • RM represents the pulse routing relationship between chipsets, let i and j represent the chipset numbers of the logical neuron cluster mapping in v and V in (v), respectively, then the element corresponding to the i-th row and the j-th column in RM is the available value of v. map area.
  • Step 2 Calculate the area that can be mapped by the logical neuron cluster v according to the synaptic connection constraints
  • Extend Region(x min , y min , x max , y max ) to the surrounding area based on a 16x16 rectangular area R ⁇ R ⁇ Region(x min , y min , x max , y max )
  • the logical neuron clusters are divided into logical neuron clusters transmitted within the chipset and logical neuron clusters across the chipset through model splitting.
  • the selection scheme based on the pulse routing distance there are two selection schemes: one is the selection scheme based on the pulse routing distance, and the other is the sequential selection scheme.
  • the two schemes have their own advantages, and the selection scheme based on the pulse routing distance can make the pulse routing distance the shortest.
  • the sequential selection scheme can make the area occupied by the logical neuron cluster more regular and suitable for larger models.
  • the scale is small, and the schemes using pulse routing and sequential selection can be successfully mapped; for the VOICE model in this embodiment, the scale is large, and the mapping scheme using pulse routing may There is a situation where the mapping fails, so a sequential mapping scheme can be used.
  • the mapping method based on pulse routing distance is selected, and the physical neuron cluster with the least power consumption is selected from the mappable area according to the distance of pulse routing for mapping.
  • a basic basis for the selection of physical neuron clusters is the distance of pulse routing. Since the on-chip network of the brain-like computing chip adopts the XY routing algorithm, the distance of the pulse routing can be represented by the Manhattan distance. Denote the Manhattan distance between the physical neuron cluster mapped by v and the physical neuron cluster mapped by V in (v) as L, and the power consumption is linearly related to L.
  • the logical neuron cluster node u and the logical neuron cluster node v are mapped in the same brain-like computing node, but in different chipsets.
  • the logical neuron cluster node u and the logical neuron cluster node v are mapped to different brain-like computing nodes.
  • the power consumption of pulse routing is a linear function of Manhattan distance. If two connected logical neuron clusters are distributed on different chips, there will be a large power consumption when the pulse passes the chip boundary.
  • use e to represent the connection relationship of the logical neuron cluster use n on to indicate that the two physical logical neuron clusters are on the same brain-like computing chipset, and use n off to indicate that the two physical neuron clusters are not in the same brain-like computing chip. In a chip set, that is, the pulse will cross the chip boundary.
  • x i and y i are the x-axis coordinates and y-axis coordinates of the logical neuron cluster vi
  • E represents the pulse communication constant between adjacent chips
  • cx i and cy i represent the coordinates of the chip
  • the coordinates of the chip can be Calculate the number of times the pulse has to cross the boundary.
  • the matrix represents the adjacent brain-like computing chips, and the number of pulses crossing the chip boundary is 2, and for two diagonal chips, the number of pulses crossing the chip boundary is 4.
  • the value 2 corresponds to the first row and the second column of the above matrix, that is, the number of times the pulse has to cross the boundary is 2;
  • the value 4 corresponds to the second row and third column of the above matrix, that is, the number of times the pulse crosses the boundary is 4.
  • the corresponding physical neuron cluster is selected for mapping from the first logical neuron cluster v1 of the topological sequence.
  • the mappable area R of the logical neuron cluster v1 has been calculated.
  • the communication power consumption of each physical neuron cluster in R and the physical neuron cluster mapped in V in (v1) is calculated respectively.
  • the physical neuron cluster with the lowest power consumption is selected as the map of v1. Since v1 is the first logical neuron cluster in the topological sequence, and there is no pre-neuron cluster, V in (v1) is empty. At this time, v1 can select any physical neuron cluster in R for mapping.
  • Pulse routing distance based selection schemes work well for small models, but may fail to map for larger models.
  • the mapping may fail. Since the second layer of logical neuron clusters always greedily selects the shortest pulse routing distance, a spike is formed, so that there is not enough 16x16 area for the third layer of logical neuron clusters, that is, the synaptic connection cannot be satisfied. constraint.
  • the mapping method based on pulse routing distance is used for mapping, for a logical neuron cluster v in the topological sequence, the corresponding physical neuron cluster cannot be found for mapping, and the mapping fails, starting from v1 in the topological sequence O(G).
  • the sequential mapping method is selected. For the logical neuron cluster v in the topological sequence, firstly find all physical neuron clusters with the smallest abscissa x in the mappable region R, and select the physical neuron cluster with the smallest ordinate y as map. Then select the logical neuron cluster after the topological sequence v according to the method analogy, until all logical neuron clusters can find the corresponding physical neuron cluster for mapping.
  • the sequential mapping method can make the area occupied by physical neuron clusters more regular and avoid mapping failures.
  • the specific implementation method of the sequence selection scheme proposed by the embodiment of the present invention is as follows: according to the mapping order O(G) of the logical neuron cluster determined by topological sorting, map sequentially, and for the mappable area R of the logical neuron cluster node v, firstly from the possible Find the value x' with the smallest abscissa in all physical neuron clusters in the mapping area R, and then select all the nodes in the mappable area R whose abscissa x is equal to the fixed x', from which the physical neuron with the smallest ordinate y is selected cluster. If no such node exists, add one to the value of x' and recalculate the physical neuron clusters that can be mapped.
  • the following is an example enumerated for the VOICE model.
  • the corresponding physical neuron cluster cannot be found when the third-layer logical neuron cluster is mapped, so the mapping fails. At this time, the method of sequential mapping needs to be used.
  • v1 in O(G) find the smallest value of the abscissa from the mappable region R corresponding to v1, and the R corresponding to v1 is Region(0,0,16,16) , which is the upper left area of the chipset.
  • the smallest abscissa value is 0, so find the physical neuron cluster with the smallest ordinate from the set of physical neuron clusters whose abscissa is 0 in R, that is, the physical neuron cluster corresponding to the coordinate (0, 0) for mapping .
  • the mapping of v2 is performed. Also determine the minimum abscissa value of 0. Since the physical neuron cluster corresponding to the coordinate (0, 0) has been mapped by v1, the physical neuron cluster corresponding to the coordinate (0, 1) is selected for mapping. .
  • map v3, and so on For the VOICE model, the sequential selection scheme mapping results are shown in Figure 4. This scheme can make each layer map in a rectangular area as much as possible. The model can be successfully mapped on the chipset.
  • the output logic neuron cluster is in one corner, making the area coincident with the chip larger (16x16 rectangular area).
  • the final mapping result is shown in Figure 6, which can map the logical neuron cluster of the second layer into a 16x16 rectangular area.
  • the hierarchical spiral mapping method is used to avoid the situation that the mapping fails due to too many adjacent layer nodes in the directed graph of the spiking neural network model.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Theoretical Computer Science (AREA)
  • Molecular Biology (AREA)
  • Neurology (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention provides a neural model mapping method of a brain-like computer operating system, comprising the following steps: obtaining a directed graph G of a spiking neural network model, and taking a node of the directed graph G as a logic neuron cluster v; calculating a topological sequence O(G) of the directed graph, and calculating a mappable region R of the logic neuron cluster v according to hardware constraints of the brain-like computer; and according to the topological sequence O(G), for the logic neuron cluster v, selecting a physical neuron cluster in the mappable region R for mapping. The mapping method provided by the present invention is used, such that the spiking neural network can be reliably mapped into the brain-like computer, the deployment and operation of the spiking neural network on a larger scale can be met, and the network congestion is effectively reduced.

Description

一种类脑计算机操作系统的神经模型映射方法A neural model mapping method for brain-like computer operating system 技术领域technical field
本发明属于类脑计算机技术领域,具体地说涉及一种类脑计算机操作系统的脉冲神经网络模型映射的方法。The invention belongs to the technical field of brain-like computers, and in particular relates to a method for mapping an impulse neural network model of a brain-like computer operating system.
背景技术Background technique
神经元簇是从人脑的神经元簇概念借鉴过来的,表示神经元的集合。物理神经元是类脑芯片里面的最小计算单元,物理神经元簇是由若干物理神经元组成。逻辑神经元簇是指类脑计算模型中表示的逻辑上的神经元簇,这部分神经元簇还没有分配到物理神经元簇中。Neuron clusters are borrowed from the concept of neuron clusters in the human brain and represent a collection of neurons. A physical neuron is the smallest computing unit in a brain-like chip, and a physical neuron cluster is composed of several physical neurons. The logical neuron cluster refers to the logical neuron cluster represented in the brain-like computing model, and this part of the neuron cluster has not been assigned to the physical neuron cluster.
随着类脑计算模型和新型类脑体系架构硬件的发展,类脑计算软件系统的研究也已经有了初步的成果。类脑计算软件中的模型部署系统负责将编译后的计算模型部署到类脑计算芯片。模型部署系统决定着类脑计算硬件平台的易用性和便捷性。With the development of brain-like computing models and new brain-like architecture hardware, the research on brain-like computing software systems has also achieved preliminary results. The model deployment system in the brain-like computing software is responsible for deploying the compiled computing model to the brain-like computing chip. The model deployment system determines the usability and convenience of the brain-like computing hardware platform.
德国海德堡大学研发的BrainScaleS OS采用PyNN建立神经网络模型,提供两种方式将神经元映射到硬件神经元电路中。一种是开发者直接指定硬件神经元坐标,即手动绑定。另外一种是BrainScaleS OS采用贪心算法进行映射,即自动绑定。映射核心流程:(1)神经元根据入度进行降序排序。按照入度由大至小顺序映射神经元。(2)将HICANN芯片根据坐标进行排序,坐标代表了实际物理通信距离,距离晶圆中心最近的芯片会最先被使用。BrainScaleS OS developed by Heidelberg University in Germany uses PyNN to build a neural network model and provides two ways to map neurons to hardware neuron circuits. One is that the developer directly specifies the hardware neuron coordinates, that is, manual binding. The other is that BrainScaleS OS uses a greedy algorithm for mapping, that is, automatic binding. Mapping core process: (1) Neurons are sorted in descending order according to in-degree. Map neurons in descending order of in-degree. (2) Sort the HICANN chips according to the coordinates. The coordinates represent the actual physical communication distance, and the chip closest to the wafer center will be used first.
英国曼彻斯特大学的SpiNNaker软件系统架构,分别为系统主机和含有48颗SpiNNaker芯片PCB板级系统提供软件运行环境。Jonathan Heathcote等人的工作将SpiNNaker系统中映射问题抽象成电路布局设计,以满足ARM处理器资源和内存资源硬件约束为前提,以降低PCB板内及板间数据通信量为目标,采用模拟退火算法实现模型映射。The SpiNNaker software system architecture of the University of Manchester in the United Kingdom provides the software operating environment for the system host and the PCB board-level system containing 48 SpiNNaker chips. The work of Jonathan Heathcote et al. abstracted the mapping problem in the SpiNNaker system into a circuit layout design to meet the hardware constraints of ARM processor resources and memory resources, with the goal of reducing the data traffic within and between boards, using a simulated annealing algorithm. Implement model mapping.
IBM以TrueNorth芯片为核心,建立了完整的软硬件生态系统。针对模型映射部分,TrueNorth先后分别提出两种映射方案。一种方案是以最小化脉冲通信距离为目标,将逻辑神经元计算核映射到物理神经元计算核。采用了四种算法分别计算出四种结果,选择其中脉冲通信距离最短的方案。四种算法分别是Multilevel Partitioning-driven算法、Analytical Constraint Generation算法、Hierarchical Quadratic Placement算法和Quadric-based Force-directed Analytical算法。另外一种方案以最小化芯片间脉冲通信量、最小化芯片内脉冲通信距离和最大化输入输出为目标,采用启发式的算法将逻辑神经元计算核映射到物理神经元计算核。With the TrueNorth chip as the core, IBM has established a complete software and hardware ecosystem. For the model mapping part, TrueNorth proposed two mapping schemes successively. One solution is to map the logical neuron computing core to the physical neuron computing core with the goal of minimizing the distance of impulse communication. Four kinds of algorithms are used to calculate four kinds of results respectively, and the scheme with the shortest pulse communication distance is selected. The four algorithms are Multilevel Partitioning-driven algorithm, Analytical Constraint Generation algorithm, Hierarchical Quadratic Placement algorithm and Quadric-based Force-directed Analytical algorithm. Another scheme aims at minimizing the inter-chip pulse communication traffic, minimizing the intra-chip pulse communication distance and maximizing the input and output, and uses a heuristic algorithm to map the logical neuron computing core to the physical neuron computing core.
英特尔提供了Loihi开发工具链,该工具链提供了基于Python的API、编译器、运行库、软件模拟器和FPGA仿真器。Loihi的编译器首先将脉冲神经网络进行拆分,拆分目标是尽可能地使用最少的神经元计算核,贪心的方式将神经元映射到神经元计算核上。然后由编译器生成最终的二进制文件,该二进制文件除了部署到Loihi芯片上,也可以用来进行仿真测试。Intel provides the Loihi development toolchain, which provides a Python-based API, compiler, runtime, software simulator, and FPGA emulator. Loihi's compiler first splits the spiking neural network. The goal of splitting is to use as few neuron computing cores as possible, and map neurons to neuron computing cores in a greedy way. The compiler then generates the final binary, which in addition to being deployed on the Loihi chip, can also be used for simulation testing.
公开号为CN105469143A的中国发明专利,提出了一种基于神经网络动态特征的片上网络资源映射方法,该方法为首先根据一定的初始化规则放入片上网络的N个核中,然后运行SNN网络,计算出每个核的通信量,如果任意两个核间通信量的比值不满足预设值,则交换该两个核的一半神经元重新映射。该方法可以有效均衡负载,减少片上网络的拥塞,但其最终效果过于依赖于初始化规则的优劣且需要多次运行SNN网络来进行优化。The Chinese invention patent with publication number CN105469143A proposes an on-chip network resource mapping method based on the dynamic characteristics of neural network. The communication volume of each core is calculated. If the ratio of the communication volume between any two cores does not meet the preset value, half of the neurons of the two cores are exchanged and remapped. This method can effectively balance the load and reduce the congestion of the on-chip network, but its final effect depends too much on the quality of the initialization rules and needs to run the SNN network multiple times for optimization.
达尔文类脑计算机由66个类脑计算节点组成,每个类脑计算节点由3个达尔文类脑计算芯片组构成,每个达尔文类脑计算芯片组由4个达尔文类脑芯片通过芯片扩展技术组成,芯片组间通过转发逻辑神经元簇实现脉冲通信。芯片组内四个类脑计算芯片统一编址,芯片组间地址空间相互独立。The Darwin brain-like computer consists of 66 brain-like computing nodes, each brain-like computing node consists of 3 Darwinian brain-like computing chipsets, and each Darwinian brain-like computing chipset consists of 4 Darwinian brain-like chips through chip expansion technology. , the chip set realizes impulse communication by forwarding logic neuron clusters. The four brain-like computing chips in the chipset are addressed uniformly, and the address spaces between the chipsets are independent of each other.
随着脉冲神经网络模型的规模增大,其对类脑计算资源的需求也随之扩大,原有的面向单芯片的模型映射方式已经无法适应需求。研究基于类脑计算机操作系统的神经模型映射方法,可以更好地支持类脑计算机硬件发展,满足更大规模的脉冲神经网络的部署和运行,是类脑计算机技术发展的必要条件。As the size of the spiking neural network model increases, its demand for brain-like computing resources also expands, and the original single-chip-oriented model mapping method can no longer meet the demand. Research on the neural model mapping method based on the brain-like computer operating system can better support the development of brain-like computer hardware and meet the deployment and operation of larger-scale spiking neural networks, which is a necessary condition for the development of brain-like computer technology.
发明内容SUMMARY OF THE INVENTION
为解决现有技术上述问题,本发明提出一种类脑计算机操作系统的神经模型映射方法,其根据达尔文类脑计算机的硬件约束进行映射,映射后可以保持原有的模型性能,不需要进行SNN网络的重优化。In order to solve the above-mentioned problems of the prior art, the present invention proposes a neural model mapping method for a brain-like computer operating system, which performs mapping according to the hardware constraints of the Darwinian brain-like computer. After the mapping, the original model performance can be maintained, and no SNN network needs to be performed. re-optimization.
本发明提出的一种类脑计算机操作系统的神经模型映射方法,其步骤包括:The neural model mapping method of a brain-like computer operating system proposed by the present invention includes the following steps:
(1)获取脉冲神经网络模型的有向图G,其节点为逻辑神经元簇v;(1) Obtain the directed graph G of the spiking neural network model, whose nodes are logical neuron clusters v;
(2)计算有向图的拓扑序列O(G)=v1,v2,v3…vn,n为逻辑神经元簇的个数,并确定每个逻辑神经元簇v的V in(v)和V out(v),其中V in(v)表示指向v的逻辑神经元簇集合,V out(v)表示v指向的逻辑神经元簇集合; (2) Calculate the topological sequence of the directed graph O(G)=v1, v2, v3...vn, where n is the number of logical neuron clusters, and determine V in (v) and V of each logical neuron cluster v out (v), where V in (v) represents the set of logical neuron clusters pointing to v, and V out (v) represents the set of logical neuron clusters pointed to by v;
(3)根据类脑计算机的硬件约束,计算逻辑神经元簇v的可映射区域R,R是可映射的物理神经元簇的集合U={u 0,0,u 0,1,...,u x,y},其中下标x、y表示物理神经元簇的坐标; (3) According to the hardware constraints of the brain-like computer, calculate the mappable region R of the logical neuron cluster v, where R is the set of mappable physical neuron clusters U={u 0,0 ,u 0,1 ,... , u x, y }, where the subscripts x and y represent the coordinates of the physical neuron cluster;
(4)依照拓扑序列O(G),对于其中的逻辑神经元簇v,在可映射区域R中选择物理神经元簇做映射;(4) According to the topological sequence O(G), for the logical neuron cluster v in it, select the physical neuron cluster in the mappable region R for mapping;
(5)根据以上映射方案,得到逻辑神经元簇到类脑计算机物理神经元簇的映射。(5) According to the above mapping scheme, the mapping from the logical neuron cluster to the physical neuron cluster of the brain-like computer is obtained.
进一步的,在步骤(3)中,根据类脑计算机的跨芯片组脉冲通信约束和芯片组间路由关系计算可映射区域。Further, in step (3), the mappable area is calculated according to the cross-chipset impulse communication constraints of the brain-like computer and the routing relationship between the chip sets.
进一步的,以上在步骤(4)中,对于芯片组内传输的逻辑神经元簇,按照以下方法选择物理神经元簇做映射:依照拓扑序列O(G),对于其中的逻辑神经元簇v1,计算对应的可映射区域R中每个物理神经元簇的通信功耗,选择功耗最低的物理神经元簇作映射;对于拓扑序列在v1之后的逻辑神经元簇,重复前面步骤,选择可映射的物理神经元簇进行映射。Further, in the above step (4), for the logical neuron cluster transmitted in the chipset, select the physical neuron cluster to do the mapping according to the following method: According to the topology sequence O(G), for the logical neuron cluster v1, Calculate the communication power consumption of each physical neuron cluster in the corresponding mappable region R, and select the physical neuron cluster with the lowest power consumption for mapping; for the logical neuron cluster whose topology sequence is after v1, repeat the previous steps and select the mappable neuron cluster physical neuron clusters for mapping.
如果对于拓扑序列中一个逻辑神经元簇v,找不到对应的物理神经元簇作映射的,则映射失败,根据拓扑序列O(G),从v1开始重新映射,具体方法如下:对于逻辑神经元簇v1的可映射区域R,从可映射区域R中找到所有物理神经元簇中横坐标最小的值,从横坐标等于该最小值的物理神经元簇集合中选择纵坐标最小的物理神经元簇做映射;对于拓扑序列在v1之后的逻辑神经元簇,重复以上步骤,选择可映射的物理神经元簇,直到所有的逻辑神经元簇都找到对应的物理神经元簇作映射。If a logical neuron cluster v in the topological sequence cannot find the corresponding physical neuron cluster for mapping, the mapping fails. According to the topological sequence O(G), remapping starts from v1. The specific method is as follows: For logical neuron In the mappable area R of the cluster v1, find the value with the smallest abscissa in all physical neuron clusters from the mappable area R, and select the physical neuron with the smallest ordinate from the set of physical neuron clusters whose abscissa is equal to the minimum value. Cluster mapping; for logical neuron clusters whose topological sequence is after v1, repeat the above steps to select a mappable physical neuron cluster until all logical neuron clusters find the corresponding physical neuron cluster for mapping.
进一步的,在步骤(4)中,对于芯片组内传输的逻辑神经元簇,按照以下方法选择物理神经元簇做映射:对于逻辑神经元簇v1的可映射区域R,从可映射区域R中找到所有物理神经元簇中横坐标最小的值,从横坐标等于该最小值的物理神经元簇集合中选择纵坐标最小的物理神经元簇做映射;对于拓扑序列在v1之后的逻辑神经元簇,重复以上步骤,选择可映射的物理神经元簇,直到所有的逻辑神经元簇都找到对应的物理神经元簇作映射。Further, in step (4), for the logical neuron cluster transmitted in the chipset, select the physical neuron cluster for mapping according to the following method: for the mappable area R of the logical neuron cluster v1, from the mappable area R Find the value with the smallest abscissa in all physical neuron clusters, and select the physical neuron cluster with the smallest ordinate from the set of physical neuron clusters whose abscissa is equal to the minimum value for mapping; for the logical neuron cluster whose topological sequence is after v1 , repeat the above steps to select a mappable physical neuron cluster until all logical neuron clusters find the corresponding physical neuron cluster for mapping.
进一步的,对于芯片组间传输的逻辑神经元簇,以可映射区域R中的左上为初始点,依次向外扩展层级,每一层中按照从右上到左下为方向选择可映射物理神经元簇。Further, for the logical neuron cluster transmitted between the chipsets, the upper left in the mappable region R is used as the initial point, and the layers are expanded outward in turn. In each layer, the mappable physical neuron cluster is selected in the direction from the upper right to the lower left. .
根据以上映射方案,得到逻辑神经元簇到达尔文类脑计算机物理神经元簇的映射。使用该方法可以可靠的将脉冲神经网络映射到达尔文类脑计算机中,合理应对各种不同规模的模型,有效的减少网络拥塞,并可以扩展到多个计算节点。According to the above mapping scheme, the mapping from logical neuron clusters to Darwinian brain-like computer physical neuron clusters is obtained. Using this method, the spiking neural network can be reliably mapped to the Darwinian brain-like computer, which can reasonably deal with various models of different scales, effectively reduce network congestion, and can be extended to multiple computing nodes.
附图说明Description of drawings
为了更清楚地说明本发明的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, which are of great significance to the art For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1为本发明实施例类脑计算机操作系统神经模型映射流程示意图。FIG. 1 is a schematic flowchart of a neural model mapping process of a brain-like computer operating system according to an embodiment of the present invention.
图2为本发明实施例达尔文类脑芯片组区域划分示意图。FIG. 2 is a schematic diagram of region division of a Darwinian brain-like chipset according to an embodiment of the present invention.
图3为本发明实施例达尔文类脑计算节点模型映射的示意图。FIG. 3 is a schematic diagram of a Darwinian brain-like computing node model mapping according to an embodiment of the present invention.
图4为本发明实施例达尔文类脑芯片组内模型映射效果图。FIG. 4 is an effect diagram of a model mapping in a Darwinian brain-like chipset according to an embodiment of the present invention.
图5为本发明实施例达尔文类脑芯片输出区域映射顺序示意图。FIG. 5 is a schematic diagram of the mapping sequence of the output area of the Darwinian brain-like chip according to an embodiment of the present invention.
图6为本发明实施例达尔文类脑芯片输出模型映射效果图。FIG. 6 is a rendering effect diagram of the output model of the Darwinian brain-like chip according to the embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更为清楚,下面将结合附图对本发明实施例中的技术方案进行详细描述。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
如图1所示,本实施例的一种类脑计算机操作系统的神经模型映射方法,包括以下步骤:As shown in FIG. 1 , a neural model mapping method for a brain-like computer operating system of the present embodiment includes the following steps:
首先,获取脉冲神经网络模型的有向图G,其节点为逻辑神经元簇v。First, obtain the directed graph G of the spiking neural network model, whose nodes are logical neuron clusters v.
然后,计算有向图的拓扑序列O(G)=v1,v2,v3…vn,n为逻辑神经元簇的个数,并确定每个逻辑神经元簇v的V in(v)和V out(v),其中V in(v)表示指向v的逻辑神经元簇集合,V out(v)表示v指向的逻辑神经元簇集合。并根据类脑计算机的硬件约束,计算逻辑神经元簇v的可映射区域R,R是可映射的物理神经元簇的集合U={u 0,0,u 0,1,...,u x,y},其中下标x、y表示物理神经元簇的坐标。 Then, calculate the topological sequence of the directed graph O(G)=v1, v2, v3...vn, where n is the number of logical neuron clusters, and determine V in (v) and V out of each logical neuron cluster v (v), where V in (v) represents the set of logical neuron clusters pointing to v, and V out (v) represents the set of logical neuron clusters pointed to by v. And according to the hardware constraints of the brain-like computer, calculate the mappable region R of the logical neuron cluster v, where R is the set of mappable physical neuron clusters U={u 0,0 ,u 0,1 ,...,u x, y }, where the subscripts x, y represent the coordinates of the physical neuron cluster.
最后,根据拓扑序列O(G),对于逻辑神经元簇v,在可映射区域R中选择物理神经元簇做映射。本实施例中,对于芯片组内传输神经元簇,采用脉冲路由距离映射,对于芯片组间传输神经元簇,采用层级螺旋式映射方法。根据以上映射方案,得到逻辑神经元簇到类脑计算机物理神经元簇的映射。Finally, according to the topological sequence O(G), for the logical neuron cluster v, select the physical neuron cluster in the mappable region R for mapping. In this embodiment, the pulse routing distance mapping is used for the transmission neuron clusters within the chipset, and the hierarchical spiral mapping method is used for the transmission neuron clusters between the chipsets. According to the above mapping scheme, the mapping from logical neuron clusters to brain-like computer physical neuron clusters is obtained.
本发明的实施例涉及达尔文类脑计算机和脉冲神经网络模型。具体的说,本发明实施例使用神经模型拆分方法需要符合达尔文类脑计算机的硬件约束。同时,本发明实施例具体实施中采用了2个模型,分别是手写数字识别模型(MNIST)和语音识别模型(VOICE),根据如下所示的实施方式,可以将上述模型映射到达尔文类脑计算机中并正常运行。Embodiments of the present invention relate to Darwinian brain-like computers and spiking neural network models. Specifically, the neural model splitting method used in the embodiments of the present invention needs to meet the hardware constraints of the Darwinian brain-like computer. At the same time, two models are used in the specific implementation of the embodiments of the present invention, namely, a handwritten digit recognition model (MNIST) and a voice recognition model (VOICE). in and running normally.
根据物理神经元簇的功能不同,将芯片组划分成七个区域,具体如图2所示。图2中左上角为坐标原点,虚线框为输出神经元簇所在区域和转发神经元簇所在区域,实线框为 普通神经元簇所在区域。输出神经元簇和转发神经元簇功能主要是向类脑计算芯片外部的片间网络或者其它芯片组发送脉冲。普通神经元簇节点的主要功能是时分复用的方式模拟神经元,根据脉冲神经元模型处理脉冲,动态地更新膜电压等数据。其中,R 1对应的是输出神经元簇所在区域;R 2R 3对应的是转发神经元簇所在区域;R 4R 5R 6R 7对应的是普通神经元簇所在区域。芯片组之间的连接关系如图3所示。 According to the different functions of physical neuron clusters, the chipset is divided into seven regions, as shown in Figure 2. In Figure 2, the upper left corner is the origin of coordinates, the dotted box is the area where the output neuron cluster is located and the area where the forwarding neuron cluster is located, and the solid line box is the area where the common neuron cluster is located. The functions of the output neuron cluster and the forwarding neuron cluster are mainly to send pulses to the inter-chip network outside the brain-like computing chip or other chipsets. The main function of the common neuron cluster node is to simulate neurons by time division multiplexing, process pulses according to the spiking neuron model, and dynamically update data such as membrane voltage. Among them, R 1 corresponds to the area where the output neuron cluster is located; R 2 R 3 corresponds to the area where the forwarding neuron cluster is located; R 4 R 5 R 6 R 7 corresponds to the area where the common neuron cluster is located. The connection relationship between the chipsets is shown in Figure 3.
达尔文类脑节点存在多种硬件约束,其中脉冲神经网络模型映射需要满足的约束有芯片组脉冲输出约束、跨芯片组脉冲通信约束和突触连接约束。Darwinian brain-like nodes have various hardware constraints, among which the constraints that the spiking neural network model mapping needs to satisfy include the chipset impulse output constraint, the cross-chipset impulse communication constraint and the synaptic connection constraint.
芯片组脉冲输出约束是指,只有区域R 4∪R 5∪R 6的普通神经元簇能和区域R 1∪R 2∪R 3的神经元簇建立连接关系。因为发送到区域R1∪R2∪R3的脉冲会通过芯片组边界到达FPGA实现的外部虚拟转发神经元节点,所以称该连接约束为芯片组脉冲输出约束。 Chipset pulse output constraint means that only the common neuron cluster in the region R 4 ∪ R 5 ∪ R 6 can establish a connection relationship with the neuron cluster in the region R 1 ∪ R 2 ∪ R 3 . Since the pulses sent to the region R1∪R2∪R3 will pass through the chipset boundary to the external virtual forwarding neuron node implemented by the FPGA, this connection constraint is called the chipset pulse output constraint.
跨芯片组脉冲通讯约束是指,在同一个类脑计算节点内,对于逻辑神经元簇v,其对应的逻辑神经元簇集合V in(v)∪v不能分布在三个不同的芯片组上,其中V in(v)表示指向逻辑神经元簇v的逻辑神经元簇集合。 The cross-chipset impulse communication constraint means that within the same brain-like computing node, for a logical neuron cluster v, its corresponding logical neuron cluster set V in (v)∪v cannot be distributed on three different chipsets , where Vin (v) represents the set of logical neuron clusters pointing to the logical neuron cluster v.
突触连接约束是指,对于达尔文类脑芯片,突触存储器中神经元数据包用8比特表示目的逻辑神经元簇节点的相对坐标,前4比特用来表示横坐标,后4比特用来表示纵坐标。因此,假设逻辑神经元簇v的动态参考原点寄存器表示的坐标是(x o,y o),逻辑神经元簇v中神经元所能连接的逻辑神经元簇区域是Region(x o,y o,x o+15,y o+15)。即逻辑神经元簇v指向的逻辑神经元簇集合V out(v)必须在该区域内。 The synaptic connection constraint means that, for the Darwin brain-like chip, the neuron data packet in the synaptic memory uses 8 bits to represent the relative coordinates of the destination logical neuron cluster node, the first 4 bits are used to represent the abscissa, and the last 4 bits are used to represent Y-axis. Therefore, it is assumed that the coordinates represented by the dynamic reference origin register of the logical neuron cluster v are (x o , y o ), and the logical neuron cluster area that the neurons in the logical neuron cluster v can connect to is Region(x o , y o ) , x o +15, y o +15). That is, the logical neuron cluster set V out (v) pointed to by the logical neuron cluster v must be in this area.
本实施例所采用的脉冲神经网络模型中,MNIST模型的结构是7x4x1,即分3层,总逻辑神经元数为12个。VOICE模型的结构是43x140x150x55x63x18x8x1x1,即分为9层,总逻辑神经元簇个数为479个。In the spiking neural network model used in this embodiment, the structure of the MNIST model is 7×4×1, that is, it is divided into 3 layers, and the total number of logical neurons is 12. The structure of the VOICE model is 43x140x150x55x63x18x8x1x1, that is, it is divided into 9 layers, and the total number of logical neuron clusters is 479.
模型映射的输入为逻辑神经元簇之间的连接关系,即模型有向图G。The input of the model mapping is the connection relationship between the logical neuron clusters, that is, the model directed graph G.
首先,获取脉冲神经网络模型的有向图G,其节点为逻辑神经元簇v。First, obtain the directed graph G of the spiking neural network model, whose nodes are logical neuron clusters v.
然后,计算每个逻辑神经元簇v的V in(v)和V out(v),其中V in(v)表示指向v的逻辑神经元簇集合,V out(v)表示v指向的逻辑神经元簇集合。 Then, calculate V in (v) and V out (v) of each logical neuron cluster v, where V in (v) represents the set of logical neuron clusters pointing to v, and V out (v) represents the logical neuron pointed to by v A collection of metaclusters.
根据逻辑神经元簇之间的连接关系,计算有向图的拓扑序列O(G)=v1,v2,v3…vn,n为逻辑神经元簇的个数。逻辑神经元簇的拓扑序列可能有多个,具体而言,每次选择入度为0的节点时可能有多个选择,此时从层级最低的节点中选择一个,这样可以尽可能地首先将低层级的节点映射到计算节点中。According to the connection relationship between the logical neuron clusters, the topological sequence of the directed graph is calculated O(G)=v1, v2, v3...vn, where n is the number of logical neuron clusters. There may be multiple topological sequences of logical neuron clusters. Specifically, there may be multiple choices each time a node with an in-degree of 0 is selected. At this time, one of the nodes with the lowest level is selected. Lower-level nodes map to compute nodes.
根据跨芯片组脉冲通信约束,计算逻辑神经元簇v所能映射的区域R。本实施例中, 当v和V in(v)中的逻辑神经元簇均映射在同一个芯片组时,则逻辑神经元簇v的可映射区域为普通神经元簇所在区域,即R 4∪R 5∪R 6∪R 7According to the cross-chipset impulse communication constraints, the region R that can be mapped by the logical neuron cluster v is calculated. In this embodiment, when the logical neuron clusters in v and V in (v) are mapped to the same chipset, the mappable area of the logical neuron cluster v is the area where the common neuron cluster is located, that is, R 4 ∪ R 5 ∪R 6 ∪R 7 .
当v和V in(v)中的逻辑神经元簇映射在不同的芯片组时,根据芯片组脉冲转发关系RM来选择相应的区域。具体来说,本实施例给出6种情形:1)如果v映射到芯片组1,V in(v)映射到芯片组2,则逻辑神经元簇v的可映射区域为R 5;2)如果v映射到芯片组1,V in(v)映射到芯片组3,则逻辑神经元簇v的可映射区域为R 4;3)如果v映射到芯片组2,V in(v)映射到芯片组1,则逻辑神经元簇v的可映射区域为R 4;4)如果v映射到芯片组2,V in(v)映射到芯片组3,则逻辑神经元簇v的可映射区域为R 5;5)如果v映射到芯片组3,V in(v)映射到芯片组1,则逻辑神经元簇v的可映射区域为R 5;6)如果v映射到芯片组3,V in(v)映射到芯片组2,则逻辑神经元簇v的可映射区域为R 4When the logical neuron clusters in v and V in (v) are mapped in different chipsets, the corresponding regions are selected according to the chipset pulse forwarding relation RM. Specifically, this embodiment provides six situations: 1) if v is mapped to chipset 1, and V in (v) is mapped to chipset 2, then the mappable area of logical neuron cluster v is R 5 ; 2) If v maps to Chipset 1 and Vin (v) maps to Chipset 3, then the mappable region for logical neuron cluster v is R4; 3 ) If v maps to Chipset 2, Vin (v) maps to Chipset 1, the mappable area of logical neuron cluster v is R 4 ; 4) If v is mapped to chipset 2, and V in (v) is mapped to chipset 3, then the mappable area of logical neuron cluster v is R 5 ; 5) If v maps to Chipset 3 and Vin (v) maps to Chipset 1, then the mappable area for logical neuron cluster v is R 5 ; 6) If v maps to Chipset 3, Vin (v) maps to Chipset 1 (v) mapping to chipset 2, then the mappable area of logical neuron cluster v is R 4 ;
为方便确定可映射区域,可以定义RM矩阵如下,In order to easily determine the mappable region, the RM matrix can be defined as follows,
Figure PCTCN2022077079-appb-000001
Figure PCTCN2022077079-appb-000001
表示芯片组间脉冲路由关系,令i、j分别表示v和V in(v)中的逻辑神经元簇映射的芯片组编号,则RM中第i行第j列对应的元素就是v的可映射区域R(v)。举例来说,如果i=1,j=2,即v映射到芯片组1,V in(v)映射到芯片组2,则逻辑神经元簇v的可映射区域为RM(1,2)=R 5;如果i=2,j=2,即v映射到芯片组2,V in(v)映射到芯片组2,则逻辑神经元簇v的可映射区域为RM(2,2)=R 4∪R 5∪R 6∪R 7。当v∪V in(v)不满足跨芯片组脉冲通信约束时,得到可映射区域为空,此时找不到v的可映射区域,无法进行后面的映射步骤,映射失败退出。 Represents the pulse routing relationship between chipsets, let i and j denote the chipset number of the logical neuron cluster mapping in v and V in (v), respectively, then the element corresponding to the i-th row and the j-th column in the RM is the mappable of v Region R(v). For example, if i=1, j=2, i.e. v maps to chipset 1 and Vin (v) maps to chipset 2, then the mappable area of logical neuron cluster v is RM(1,2)= R 5 ; if i=2, j=2, that is, v maps to chipset 2 and V in (v) maps to chipset 2, then the mappable area of logical neuron cluster v is RM(2,2)=R 4 ∪R 5 ∪R 6 ∪R 7 . When v∪V in (v) does not satisfy the cross-chipset pulse communication constraint, the mappable area is empty, and the mappable area of v cannot be found at this time, and the subsequent mapping steps cannot be performed, and the mapping fails to exit.
根据突触连接约束,计算逻辑神经元簇v所能映射的区域。具体方法是遍历逻辑神经元簇集合V in(v)中的逻辑神经元簇,此时对于V in(v)中的逻辑神经元簇u,u和v的连接关系是u指向v。计算u对应的V out(v)形成的最小区域R(u),结合跨芯片组脉冲通信约束产生的映射的区域R(v),取二者交集,可以得到v的可映射区域R。 According to the synaptic connection constraints, calculate the area that the logical neuron cluster v can map. The specific method is to traverse the logical neuron clusters in the logical neuron cluster set V in (v). At this time, for the logical neuron cluster u in V in (v), the connection relationship between u and v is that u points to v. Calculate the minimum area R(u) formed by V out (v) corresponding to u, combine with the mapped area R(v) generated by the cross-chip pulse communication constraints, and take the intersection of the two to obtain the mappable area R of v.
如果最小区域R(u)小于16x16,那么将其进行扩充,使得扩充后的新的最小区域 R(u)矩形中任意一点都能和原最小区域R(u)形成16x16的矩阵,具体区域扩充方法如下:If the minimum area R(u) is less than 16x16, then expand it so that any point in the rectangle of the new minimum area R(u) after expansion can form a 16x16 matrix with the original minimum area R(u), and the specific area is expanded. Methods as below:
x min=max(x min-(16-(x max-x min)),0) x min = max(x min -(16-(x max -x min )), 0)
x max=min(x max+(16-(x max-x min)),47) x max = min(x max +(16-(x max -x min )), 47)
y min=max(y min-(16-(y max-y min)),0) y min =max(y min -(16-(y max -y min )), 0)
y max=min(x max+(16-(y max-y min)),48) y max =min(x max +(16-(y max -y min )), 48)
Region(x min,y min,x max,y max) Region(x min , y min , x max , y max )
其中x min、x max、y min、y max为计算中间变量,分别表示当前计算的最小区域R(u)的最小横坐标、最大横坐标、最小纵坐标、最大纵坐标。Region(x min,y min,x max,y max)表示以(x min,y min)为左下顶点,以(x max,y max)为右上顶点的最小区域R(u)。 Among them, x min , x max , y min , and y max are intermediate variables for calculation, and represent the minimum abscissa, maximum abscissa, minimum ordinate, and maximum ordinate of the currently calculated minimum region R(u), respectively. Region(x min , y min , x max , y max ) represents the smallest region R(u) with (x min , y min ) as the lower left vertex and (x max , y max ) as the upper right vertex.
计算可映射区域的算法伪代码:Algorithm pseudocode for computing mappable regions:
输入:逻辑神经元簇v,V in(v)和V out(v) Input: Logical neuron cluster v, V in (v) and V out (v)
V in(v)表示指向逻辑神经元簇v的逻辑神经元簇集合; V in (v) represents the set of logical neuron clusters pointing to the logical neuron cluster v;
V out(v)表示逻辑神经元簇v指向的逻辑神经元簇集合; V out (v) represents the set of logical neuron clusters pointed to by the logical neuron cluster v;
v n表示逻辑神经元簇v映射到的类脑计算节点编号; v n represents the number of the brain-like computing node to which the logical neuron cluster v is mapped;
v c表示逻辑神经元簇v映射到的芯片组编号; v c represents the chipset number to which the logical neuron cluster v is mapped;
v x表示逻辑神经元簇v的横坐标; v x represents the abscissa of the logical neuron cluster v;
v y表示逻辑神经元簇v的纵坐标; v y represents the ordinate of the logical neuron cluster v;
输出:可映射区域Routput: mappable region R
步骤1:根据跨芯片组脉冲通信约束,计算逻辑神经元簇v所能映射的区域Step 1: Calculate the area that can be mapped by the logical neuron cluster v according to the cross-chipset impulse communication constraints
Figure PCTCN2022077079-appb-000002
Figure PCTCN2022077079-appb-000002
RM表示芯片组间脉冲路由关系,令i、j分别表示v和V in(v)中的逻辑神经元簇映射的芯片组编号,则RM中第i行第j列对应的元素就是v的可映射区域。 RM represents the pulse routing relationship between chipsets, let i and j represent the chipset numbers of the logical neuron cluster mapping in v and V in (v), respectively, then the element corresponding to the i-th row and the j-th column in RM is the available value of v. map area.
for u∈V in(v)do for u∈V in (v)do
如果u n等于v n,则R←R∩RM(u n,v n) If u n is equal to v n , then R←R∩RM(u n , v n )
步骤2:根据突触连接约束,计算逻辑神经元簇v所能映射的区域Step 2: Calculate the area that can be mapped by the logical neuron cluster v according to the synaptic connection constraints
for u∈V in(v)do for u∈V in (v)do
for w∈V out(u)do for w∈Vout (u)do
x min←min(x min,w x) x min ←min(x min , w x )
y min←min(y min,w y) y min ←min(y min , w y )
x max←max(x max,w x) x max ←max(x max , w x )
y max←max(y max,w y) y max ←max(y max , w y )
将Region(x min,y min,x max,y max)向四周以16x16的矩形区域为基准进行扩展R←R∩Region(x min,y min,x max,y max) Extend Region(x min , y min , x max , y max ) to the surrounding area based on a 16x16 rectangular area R←R∩Region(x min , y min , x max , y max )
end doend do
end doend do
计算出逻辑神经元簇v的可映射区域R后,在可映射区域R中选择合适的物理神经元簇做映射。逻辑神经元簇经过模型拆分分为芯片组内传输的逻辑神经元簇和跨芯片组的逻辑神经元簇。After calculating the mappable region R of the logical neuron cluster v, select the appropriate physical neuron cluster in the mappable region R for mapping. The logical neuron clusters are divided into logical neuron clusters transmitted within the chipset and logical neuron clusters across the chipset through model splitting.
对于芯片组内传输的逻辑神经元簇,选择方案有两种:一种是基于脉冲路由距离的选择方案,另外一种是顺序选择方案。两种方案各有优势,基于脉冲路由距离的选择方案可以使得脉冲路由距离最短。顺序选择方案则可以使得逻辑神经元簇占用区域更规则,适合较大模型。对于本实施例的MINIST模型来说,规模较小,采用脉冲路由和顺序选择的方案都可以映射成功;对于本实施例中的VOICE模型来说,规模较大,采用脉冲路由的映射方案可能会出现映射失败的情况,因此可以采用顺序映射的方案。For the logical neuron clusters transmitted in the chipset, there are two selection schemes: one is the selection scheme based on the pulse routing distance, and the other is the sequential selection scheme. The two schemes have their own advantages, and the selection scheme based on the pulse routing distance can make the pulse routing distance the shortest. The sequential selection scheme can make the area occupied by the logical neuron cluster more regular and suitable for larger models. For the MINIST model in this embodiment, the scale is small, and the schemes using pulse routing and sequential selection can be successfully mapped; for the VOICE model in this embodiment, the scale is large, and the mapping scheme using pulse routing may There is a situation where the mapping fails, so a sequential mapping scheme can be used.
对于芯片组内传输的逻辑神经元簇,首先选择基于脉冲路由距离的映射方法,根据脉冲路由的距离从可映射区域中选择功耗最小的物理神经元簇做映射。基于脉冲路由距离的选择方案中,物理神经元簇选择的一个基本依据是脉冲路由的距离。由于类脑计算芯片片上网络采用XY路由算法,脉冲路由的距离可用曼哈顿距离表示。记v映射的物理神经元簇和V in(v)映射的物理神经元簇的曼哈顿距离为L,功耗与L线性相关,计算可映射区域中所有的物理神经元簇的功耗后,选择功耗最小的那个物理神经元簇做映射。接着再选择拓扑序列在v之后的逻辑神经元簇进行上述步骤,直到所有的逻辑神经元簇都能找到对应的物理神经 元簇作映射。 For the logical neuron cluster transmitted in the chipset, firstly, the mapping method based on pulse routing distance is selected, and the physical neuron cluster with the least power consumption is selected from the mappable area according to the distance of pulse routing for mapping. In the selection scheme based on pulse routing distance, a basic basis for the selection of physical neuron clusters is the distance of pulse routing. Since the on-chip network of the brain-like computing chip adopts the XY routing algorithm, the distance of the pulse routing can be represented by the Manhattan distance. Denote the Manhattan distance between the physical neuron cluster mapped by v and the physical neuron cluster mapped by V in (v) as L, and the power consumption is linearly related to L. After calculating the power consumption of all physical neuron clusters in the mappable area, select The physical neuron cluster with the least power consumption is mapped. Then select the logical neuron cluster after the topological sequence v to perform the above steps, until all logical neuron clusters can find the corresponding physical neuron cluster for mapping.
计算逻辑神经元簇节点v到V in(v)得到的曼哈顿距离需要考虑4种情况: Calculating the Manhattan distance obtained from the logical neuron cluster node v to V in (v) needs to consider 4 cases:
(1)逻辑神经元簇u和逻辑神经元簇v被映射在同一个芯片。(1) The logical neuron cluster u and the logical neuron cluster v are mapped on the same chip.
(2)逻辑神经元簇u和逻辑神经元簇v被映射在同一个芯片组上,但在不同的芯片上。虽然芯片组是统一编址,但是内部的4颗芯片仍然存在边界。脉冲穿过芯片边界时会经过并行转串行,会有极大的功耗,采用常数C表示这种损耗关系。(2) The logical neuron cluster u and the logical neuron cluster v are mapped on the same chip set, but on different chips. Although the chipset is uniformly addressed, there are still boundaries between the four chips inside. When the pulse crosses the chip boundary, it will go through parallel to serial, and there will be great power consumption. The constant C is used to represent this loss relationship.
(3)逻辑神经元簇节点u和逻辑神经元簇节点v被映射在同一个类脑计算节点,但在不同的芯片组。(3) The logical neuron cluster node u and the logical neuron cluster node v are mapped in the same brain-like computing node, but in different chipsets.
(4)逻辑神经元簇节点u和逻辑神经元簇节点v被映射到不同的类脑计算节点。(4) The logical neuron cluster node u and the logical neuron cluster node v are mapped to different brain-like computing nodes.
由于(3)和(4)不在同一个地址空间内,因此不做考虑。主要考虑(1)和(2)所在的地址空间的逻辑神经元簇选择。由于达尔文类脑计算芯片同采用XY路由算法,建立的脉冲路由距离和功耗的关系,具体的公式如下:Since (3) and (4) are not in the same address space, they are not considered. Mainly consider the logical neuron cluster selection of the address space where (1) and (2) are located. Due to the relationship between the pulse routing distance and power consumption established by the Darwinian brain-like computing chip using the XY routing algorithm, the specific formula is as follows:
Figure PCTCN2022077079-appb-000003
Figure PCTCN2022077079-appb-000003
如果两个相连的逻辑神经元簇在同一个类脑计算芯片上,脉冲路由的功耗和曼哈顿距离是线性函数关系。如果两个相连的逻辑神经元簇分布在不同的芯片上,脉冲经过芯片边界时会有较大的功耗。为此,使用e表示逻辑神经元簇的连接关系,用n on表示两个物理逻辑神经元簇在同一类脑计算芯片组上,用n off表示两个物理神经元簇不在同一个类脑计算芯片组中,即脉冲会穿过芯片边界。公式中x i和y i是逻辑神经元簇v i的x轴坐标和y轴坐标,E表示相邻芯片之间的脉冲通信常数,cx i和cy i表示芯片的坐标,由芯片的坐标可以计算出脉冲要穿越边界的次数。对于达尔文类脑计算芯片来说,有如下矩阵关系: If two connected logical neuron clusters are on the same brain-like computing chip, the power consumption of pulse routing is a linear function of Manhattan distance. If two connected logical neuron clusters are distributed on different chips, there will be a large power consumption when the pulse passes the chip boundary. To this end, use e to represent the connection relationship of the logical neuron cluster, use n on to indicate that the two physical logical neuron clusters are on the same brain-like computing chipset, and use n off to indicate that the two physical neuron clusters are not in the same brain-like computing chip. In a chip set, that is, the pulse will cross the chip boundary. In the formula, x i and y i are the x-axis coordinates and y-axis coordinates of the logical neuron cluster vi, E represents the pulse communication constant between adjacent chips, cx i and cy i represent the coordinates of the chip, and the coordinates of the chip can be Calculate the number of times the pulse has to cross the boundary. For the Darwinian brain-like computing chip, there is the following matrix relationship:
Figure PCTCN2022077079-appb-000004
Figure PCTCN2022077079-appb-000004
该矩阵表示的是相邻的类脑计算芯片,脉冲穿越芯片边界次数是2,而对于对角两个芯片,脉冲穿越芯片边界次数是4。举例而言,如果两个物理神经元簇分别在第1个芯片和第2个芯片中,则对应于上述矩阵的第1行第2列的数值2,即脉冲要穿越边界的次数为2;又例,如果两个物理神经元簇分别在第2个芯片和第3个芯片中,则对应于上述矩阵的第2行第3列的数值4,即脉冲要穿越边界的次数为4。The matrix represents the adjacent brain-like computing chips, and the number of pulses crossing the chip boundary is 2, and for two diagonal chips, the number of pulses crossing the chip boundary is 4. For example, if two physical neuron clusters are in the 1st chip and the 2nd chip, respectively, the value 2 corresponds to the first row and the second column of the above matrix, that is, the number of times the pulse has to cross the boundary is 2; For another example, if two physical neuron clusters are in the second chip and the third chip, respectively, the value 4 corresponds to the second row and third column of the above matrix, that is, the number of times the pulse crosses the boundary is 4.
具体映射时,从拓扑序列的第一个逻辑神经元簇v1开始选择对应的物理神经元簇做 映射。已经计算出逻辑神经元簇v1的可映射区域R,根据功耗计算公式,分别计算出R中每一个物理神经元簇和V in(v1)中映射的物理神经元簇的通信功耗,从中选择功耗最低的那个物理神经元簇作为v1的映射。由于v1是拓扑序列中的第一个逻辑神经元簇,没有前置神经元簇,因此V in(v1)为空,此时v1可以选择R中的任意一个物理神经元簇做映射。计算好v1可映射的物理神经元簇之后,再计算v2可映射的物理神经元簇,计算方法同v1的计算方法相同。此时,若v1指向v2,也就是说V in(v2)中包含v1,那么需要分别计算出v2对应的可映射区域R中所有未映射的物理神经元簇与v1映射的物理神经元簇的通信功耗,并从中选择出通信功耗最低的那个做映射。计算好v2可映射的物理神经元簇之后,再计算v3可映射的物理神经元簇,以此类推,直到拓扑序列中的所有逻辑神经元簇都能找到对应的物理神经元簇做映射。 During the specific mapping, the corresponding physical neuron cluster is selected for mapping from the first logical neuron cluster v1 of the topological sequence. The mappable area R of the logical neuron cluster v1 has been calculated. According to the power consumption calculation formula, the communication power consumption of each physical neuron cluster in R and the physical neuron cluster mapped in V in (v1) is calculated respectively. The physical neuron cluster with the lowest power consumption is selected as the map of v1. Since v1 is the first logical neuron cluster in the topological sequence, and there is no pre-neuron cluster, V in (v1) is empty. At this time, v1 can select any physical neuron cluster in R for mapping. After calculating the physical neuron clusters that can be mapped by v1, calculate the physical neuron clusters that can be mapped by v2. The calculation method is the same as that of v1. At this time, if v1 points to v2, that is to say, V in (v2) contains v1, then it is necessary to calculate the difference between all the unmapped physical neuron clusters in the mappable region R corresponding to v2 and the physical neuron clusters mapped by v1. Communication power consumption, and select the one with the lowest communication power consumption for mapping. After calculating the v2 mappable physical neuron clusters, calculate the v3 mappable physical neuron clusters, and so on, until all logical neuron clusters in the topology sequence can find the corresponding physical neuron clusters for mapping.
基于脉冲路由距离的选择方案能够很好地应付小型模型,而对于较大模型可能会映射失败。VOICE模型在映射到第三层时,可能会出现映射失败。由于第二层逻辑神经元簇映射时总是贪心地选择脉冲路由距离最短的情况,导致形成了尖峰,使得第三层逻辑神经元簇映射时没有足够的16x16的区域,即无法满足突触连接约束。Pulse routing distance based selection schemes work well for small models, but may fail to map for larger models. When the VOICE model is mapped to the third layer, the mapping may fail. Since the second layer of logical neuron clusters always greedily selects the shortest pulse routing distance, a spike is formed, so that there is not enough 16x16 area for the third layer of logical neuron clusters, that is, the synaptic connection cannot be satisfied. constraint.
如果采用基于脉冲路由距离的映射方法映射时,对于拓扑序列中一个逻辑神经元簇v,找不到对应的物理神经元簇作映射,则映射失败,从拓扑序列O(G)中的v1开始重新映射。本实施例选择顺序映射方法,对于拓扑序列中的逻辑神经元簇v,首先找到可映射区域R中所有横坐标x最小的物理神经元簇集合,从中选择纵坐标y最小的物理神经元簇做映射。接着再选择拓扑序列在v之后的逻辑神经元簇按照以方法类推,直到所有的逻辑神经元簇都能找到对应的物理神经元簇作映射。采用顺序映射的方法,可以使得物理神经元簇占用区域更规则,避免映射失败。If the mapping method based on pulse routing distance is used for mapping, for a logical neuron cluster v in the topological sequence, the corresponding physical neuron cluster cannot be found for mapping, and the mapping fails, starting from v1 in the topological sequence O(G). Remap. In this embodiment, the sequential mapping method is selected. For the logical neuron cluster v in the topological sequence, firstly find all physical neuron clusters with the smallest abscissa x in the mappable region R, and select the physical neuron cluster with the smallest ordinate y as map. Then select the logical neuron cluster after the topological sequence v according to the method analogy, until all logical neuron clusters can find the corresponding physical neuron cluster for mapping. The sequential mapping method can make the area occupied by physical neuron clusters more regular and avoid mapping failures.
本发明实施例提出的顺序选择方案,具体实施方法是:根据拓扑排序确定的逻辑神经元簇的映射顺序O(G)依次映射,对于逻辑神经元簇节点v的可映射区域R,首先从可映射区域R中找到所有物理神经元簇中横坐标最小的值x′,然后在可映射区域R中所有横坐标x等于该固定的x′的节点集合,从中选择纵坐标y最小的物理神经元簇。如果不存在这样的节点,则令x′的值加一,重新计算可以映射的物理神经元簇。The specific implementation method of the sequence selection scheme proposed by the embodiment of the present invention is as follows: according to the mapping order O(G) of the logical neuron cluster determined by topological sorting, map sequentially, and for the mappable area R of the logical neuron cluster node v, firstly from the possible Find the value x' with the smallest abscissa in all physical neuron clusters in the mapping area R, and then select all the nodes in the mappable area R whose abscissa x is equal to the fixed x', from which the physical neuron with the smallest ordinate y is selected cluster. If no such node exists, add one to the value of x' and recalculate the physical neuron clusters that can be mapped.
以下是针对VOICE模型列举的一个实施例。第三层逻辑神经元簇映射时找不到对应的物理神经元簇,因此映射失败。此时需要使用顺序映射的方法,从O(G)中的v1开始,从v1对应的可映射区域R中找到横坐标最小的值,v1对应的R是Region(0,0,16,16),即为芯 片组的左上角区域。最小的横坐标值为0,所以从R中横坐标为0的物理神经元簇集合中找到纵坐标最小的物理神经元簇,也就是坐标为(0,0)对应的物理神经元簇做映射。确定好v1映射的物理神经元簇之后,再进行v2的映射。同样确定最小的横坐标值为0,由于坐标为(0,0)对应的物理神经元簇做映射已经被v1映射,所以选择坐标为坐标为(0,1)对应的物理神经元簇做映射。确定好v2映射的物理神经元簇之后,再进行v3的映射,以此类推。对于VOICE模型,顺序选择方案映射结果如图4所示。该方案能够使得每一层尽量地映射在一个矩形区域。可成功地将模型映射芯片组上。The following is an example enumerated for the VOICE model. The corresponding physical neuron cluster cannot be found when the third-layer logical neuron cluster is mapped, so the mapping fails. At this time, the method of sequential mapping needs to be used. Starting from v1 in O(G), find the smallest value of the abscissa from the mappable region R corresponding to v1, and the R corresponding to v1 is Region(0,0,16,16) , which is the upper left area of the chipset. The smallest abscissa value is 0, so find the physical neuron cluster with the smallest ordinate from the set of physical neuron clusters whose abscissa is 0 in R, that is, the physical neuron cluster corresponding to the coordinate (0, 0) for mapping . After the physical neuron cluster mapped by v1 is determined, the mapping of v2 is performed. Also determine the minimum abscissa value of 0. Since the physical neuron cluster corresponding to the coordinate (0, 0) has been mapped by v1, the physical neuron cluster corresponding to the coordinate (0, 1) is selected for mapping. . After determining the physical neuron cluster mapped by v2, map v3, and so on. For the VOICE model, the sequential selection scheme mapping results are shown in Figure 4. This scheme can make each layer map in a rectangular area as much as possible. The model can be successfully mapped on the chipset.
对于芯片组间传输的逻辑神经元簇,对应着输出区域物理神经元簇选择,采用层级螺旋式方法,从右上到左下方式映射,该方法能够有效地应用输出节点过多的情况。采用如图5所示的物理神经元簇选择顺序进行映射,具体选择方式如下:For the logical neuron cluster transmitted between chipsets, corresponding to the selection of the physical neuron cluster in the output area, a hierarchical spiral method is used to map from the upper right to the lower left. This method can effectively apply to the situation where there are too many output nodes. Use the physical neuron cluster selection sequence shown in Figure 5 for mapping, and the specific selection methods are as follows:
1)首先初始令层级L=1;1) First, let the level L=1 initially;
2)从可映射区域中所有横坐标x=L的物理神经元簇中选择纵坐标y最小的物理神经元簇;2) Select the physical neuron cluster with the smallest ordinate y from all the physical neuron clusters with abscissa x=L in the mappable area;
3)如果选择出的物理神经元簇纵坐标y>L,则进入4),否则进入6);3) If the selected physical neuron cluster ordinate y>L, enter 4), otherwise enter 6);
4)从可映射区域中所有纵坐标y=L的物理神经元簇中选择横坐标x最大的物理神经元簇;4) Select the physical neuron cluster with the largest abscissa x from all the physical neuron clusters with the ordinate y=L in the mappable area;
5)如果选择出的物理神经元簇横坐标x>L,则令L=L+1,进入2);否则进入6);5) If the selected physical neuron cluster abscissa x>L, then let L=L+1, enter 2); otherwise, enter 6);
6)选择该物理神经元簇作映射;6) Select the physical neuron cluster for mapping;
根据该种方法,输出逻辑神经元簇在一个角落,使得和芯片重合的区域更大(16x16的矩形区域)。最终映射的结果如图6所示,能够将第二层的逻辑神经元簇映射到一个16x16的矩形区域内。使用层级螺旋式映射的方法,避免了由于脉冲神经网络模型的有向图中邻层节点过多导致映射失败的情况。According to this method, the output logic neuron cluster is in one corner, making the area coincident with the chip larger (16x16 rectangular area). The final mapping result is shown in Figure 6, which can map the logical neuron cluster of the second layer into a 16x16 rectangular area. The hierarchical spiral mapping method is used to avoid the situation that the mapping fails due to too many adjacent layer nodes in the directed graph of the spiking neural network model.

Claims (8)

  1. 一种类脑计算机操作系统的神经模型映射方法,其特征在于,包括以下步骤:A neural model mapping method for a brain-like computer operating system, comprising the following steps:
    (1)获取脉冲神经网络模型的有向图G,其节点为逻辑神经元簇v;(1) Obtain the directed graph G of the spiking neural network model, whose nodes are logical neuron clusters v;
    (2)计算有向图的拓扑序列O(G)=v1,v2,v3…vn,n为逻辑神经元簇的个数,并确定每个逻辑神经元簇v的V in(v)和V out(v),其中V in(v)表示指向v的逻辑神经元簇集合,V out(v)表示v指向的逻辑神经元簇集合; (2) Calculate the topological sequence of the directed graph O(G)=v1, v2, v3...vn, where n is the number of logical neuron clusters, and determine V in (v) and V of each logical neuron cluster v out (v), where V in (v) represents the set of logical neuron clusters pointing to v, and V out (v) represents the set of logical neuron clusters pointed to by v;
    (3)根据类脑计算机的硬件约束,计算逻辑神经元簇v的可映射区域R,R是可映射的物理神经元簇的集合U={u 0,0,u 0,1,...,u x,y},其中下标x、y表示物理神经元簇的坐标; (3) According to the hardware constraints of the brain-like computer, calculate the mappable region R of the logical neuron cluster v, where R is the set of mappable physical neuron clusters U={u 0,0 ,u 0,1 ,... , u x, y }, where the subscripts x and y represent the coordinates of the physical neuron cluster;
    (4)依照拓扑序列O(G),对于其中的逻辑神经元簇v,在可映射区域R中选择物理神经元簇做映射;(4) According to the topological sequence O(G), for the logical neuron cluster v in it, select the physical neuron cluster in the mappable region R for mapping;
    (5)根据以上映射方案,得到逻辑神经元簇到类脑计算机物理神经元簇的映射。(5) According to the above mapping scheme, the mapping from the logical neuron cluster to the physical neuron cluster of the brain-like computer is obtained.
  2. 根据权利要求1所述的映射方法,其特征在于,在步骤(4)中,对于芯片组内传输的逻辑神经元簇,按照以下方法选择物理神经元簇做映射:The mapping method according to claim 1, wherein, in step (4), for the logical neuron cluster transmitted in the chipset, select the physical neuron cluster to do the mapping according to the following method:
    (1)依照拓扑序列O(G),对于其中的逻辑神经元簇v1,计算对应的可映射区域R中每个物理神经元簇的通信功耗,选择功耗最低的物理神经元簇作映射;(1) According to the topological sequence O(G), for the logical neuron cluster v1, calculate the communication power consumption of each physical neuron cluster in the corresponding mappable region R, and select the physical neuron cluster with the lowest power consumption for mapping ;
    (2)对于拓扑序列在v1之后的逻辑神经元簇,重复以上步骤,选择可映射的物理神经元簇进行映射。(2) For the logical neuron cluster whose topological sequence is after v1, repeat the above steps, and select a mappable physical neuron cluster for mapping.
  3. 根据权利要求2所述的映射方法,其特征在于,如果对于拓扑序列中一个逻辑神经元簇v,找不到对应的物理神经元簇作映射的,则映射失败,根据拓扑序列O(G),从v1开始重新映射,具体方法如下:The mapping method according to claim 2, wherein, if a logical neuron cluster v in the topological sequence cannot find a corresponding physical neuron cluster for mapping, the mapping fails, and according to the topological sequence O(G) , remapping from v1, the specific method is as follows:
    (1)对于逻辑神经元簇v1的可映射区域R,从可映射区域R中找到所有物理神经元簇中横坐标最小的值,从横坐标等于该最小值的物理神经元簇集合中选择纵坐标最小的物理神经元簇做映射;(1) For the mappable region R of the logical neuron cluster v1, find the value with the smallest abscissa in all physical neuron clusters from the mappable region R, and select the vertical axis from the set of physical neuron clusters whose abscissa is equal to the minimum value. The physical neuron cluster with the smallest coordinates is mapped;
    (2)对于拓扑序列在v1之后的逻辑神经元簇,重复以上步骤,选择可映射的物理神经元簇,直到所有的逻辑神经元簇都找到对应的物理神经元簇作映射。(2) For the logical neuron cluster after the topological sequence v1, repeat the above steps to select a mappable physical neuron cluster, until all logical neuron clusters find the corresponding physical neuron cluster for mapping.
  4. 根据权利要求1所述的映射方法,其特征在于,在步骤(4)中,对于芯片组内传输的逻辑神经元簇,按照以下方法选择物理神经元簇做映射:The mapping method according to claim 1, wherein, in step (4), for the logical neuron cluster transmitted in the chipset, select the physical neuron cluster to do the mapping according to the following method:
    (1)对于逻辑神经元簇v1的可映射区域R,从可映射区域R中找到所有物理神经元簇中横坐标最小的值,从横坐标等于该最小值的物理神经元簇集合中选择纵坐标最小的物理神经元 簇做映射;(1) For the mappable region R of the logical neuron cluster v1, find the value with the smallest abscissa in all physical neuron clusters from the mappable region R, and select the vertical axis from the set of physical neuron clusters whose abscissa is equal to the minimum value. The physical neuron cluster with the smallest coordinates is mapped;
    (2)对于拓扑序列在v1之后的逻辑神经元簇,重复以上步骤,选择可映射的物理神经元簇,直到所有的逻辑神经元簇都找到对应的物理神经元簇作映射。(2) For the logical neuron cluster after the topological sequence v1, repeat the above steps to select a mappable physical neuron cluster, until all logical neuron clusters find the corresponding physical neuron cluster for mapping.
  5. 根据权利要求1所述的映射方法,其特征在于,对于芯片组间传输的逻辑神经元簇,以可映射区域R中的左上为初始点,依次向外扩展层级,每一层中按照从右上到左下为方向选择可映射物理神经元簇。The mapping method according to claim 1, wherein, for the logical neuron cluster transmitted between the chipsets, the upper left in the mappable region R is used as the initial point, and the levels are expanded outward in turn, and each layer is arranged according to the order from the upper right. Go to the bottom left to select the mappable physical neuron cluster for the direction.
  6. 根据权利要求1所述的映射方法,其特征在于,步骤(3)中,根据类脑计算机的跨芯片组脉冲通信约束和芯片组间路由关系计算可映射区域。The mapping method according to claim 1, characterized in that, in step (3), the mappable area is calculated according to the cross-chip set impulse communication constraints of the brain-like computer and the routing relationship between the chip sets.
  7. 根据权利要求6所述的映射方法,其特征在于,根据类脑计算机的突触连接约束,遍历逻辑神经元簇集合V in(v)中的逻辑神经元簇;对于V in(v)中的逻辑神经元簇u,u和v的连接关系是u指向v,计算u对应的V out(u)形成的最小区域R(u),结合跨芯片组脉冲通信约束产生的映射的区域R(v),R(u)∩R(v),得到v的可映射区域R。 The mapping method according to claim 6, wherein, according to the synaptic connection constraints of the brain-like computer, traverse the logical neuron clusters in the logical neuron cluster set V in (v); for the logical neuron clusters in V in (v) The connection relationship between logical neuron clusters u, u and v is that u points to v, calculate the minimum area R(u) formed by V out (u) corresponding to u, and combine the mapped area R(v) generated by the cross-chipset pulse communication constraints ), R(u)∩R(v), get the mappable region R of v.
  8. 根据权利要求7所述的映射方法,其特征在于,对于最小区域R(u)小于16x16的,对其进行扩充得到新的最小区域R(u),扩充后的新的最小区域R(u)任意一点都能和原最小区域R(u)形成16x16的矩阵。The mapping method according to claim 7, wherein, for the minimum area R(u) smaller than 16×16, it is expanded to obtain a new minimum area R(u), and the expanded new minimum area R(u) Any point can form a 16x16 matrix with the original minimum region R(u).
PCT/CN2022/077079 2021-03-01 2022-02-21 Neural model mapping method of brain-like computer operating system WO2022183921A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110222647.9A CN112561042B (en) 2021-03-01 2021-03-01 Neural model mapping method of brain-like computer operating system
CN202110222647.9 2021-03-01

Publications (1)

Publication Number Publication Date
WO2022183921A1 true WO2022183921A1 (en) 2022-09-09

Family

ID=75034880

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/077079 WO2022183921A1 (en) 2021-03-01 2022-02-21 Neural model mapping method of brain-like computer operating system

Country Status (2)

Country Link
CN (1) CN112561042B (en)
WO (1) WO2022183921A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115577353A (en) * 2022-12-08 2023-01-06 深圳市永达电子信息股份有限公司 Network security protection method and system based on brain computer system
CN115879544A (en) * 2023-02-28 2023-03-31 中国电子科技南湖研究院 Neuron coding method and system for distributed brain-like simulation
CN117311516A (en) * 2023-11-28 2023-12-29 北京师范大学 Motor imagery electroencephalogram channel selection method and system
CN117648956A (en) * 2024-01-29 2024-03-05 之江实验室 Resource mapping method, device and storage medium for impulse neural network model
CN117688992A (en) * 2024-02-01 2024-03-12 之江实验室 Resource mapping method and device for neuron computer operating system

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112561042B (en) * 2021-03-01 2021-06-29 浙江大学 Neural model mapping method of brain-like computer operating system
CN114338506B (en) * 2022-03-15 2022-08-05 之江实验室 Neural task on-chip routing method and device of brain-like computer operating system
CN114330698B (en) * 2022-03-15 2022-08-05 之江实验室 Neural model storage system and method of brain-like computer operating system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650922A (en) * 2016-09-29 2017-05-10 清华大学 Hardware neural network conversion method, computing device, compiling method and neural network software and hardware collaboration system
US20180075345A1 (en) * 2016-09-13 2018-03-15 Sap Se Spatio-temporal spiking neural networks in neuromorphic hardware systems
EP3343465A1 (en) * 2016-12-30 2018-07-04 Intel Corporation Neuromorphic computer with reconfigurable memory mapping for various neural network topologies
CN111882065A (en) * 2020-08-03 2020-11-03 中国人民解放军国防科技大学 Method, system, and medium for mapping a spiking neural network to a brain-like computing platform
CN112149815A (en) * 2020-09-28 2020-12-29 复旦大学 Population clustering and population routing method for large-scale brain-like computing network
CN112260866A (en) * 2020-10-20 2021-01-22 广东工业大学 Method and device for designing network topology structure special for brain-like computer
CN112561042A (en) * 2021-03-01 2021-03-26 浙江大学 Neural model mapping method of brain-like computer operating system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109376843B (en) * 2018-10-12 2021-01-08 山东师范大学 FPGA-based electroencephalogram signal rapid classification method, implementation method and device
CN110909869B (en) * 2019-11-21 2022-08-23 浙江大学 Brain-like computing chip based on impulse neural network
CN112270406B (en) * 2020-11-11 2023-05-23 浙江大学 Nerve information visualization method of brain-like computer operating system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180075345A1 (en) * 2016-09-13 2018-03-15 Sap Se Spatio-temporal spiking neural networks in neuromorphic hardware systems
CN106650922A (en) * 2016-09-29 2017-05-10 清华大学 Hardware neural network conversion method, computing device, compiling method and neural network software and hardware collaboration system
EP3343465A1 (en) * 2016-12-30 2018-07-04 Intel Corporation Neuromorphic computer with reconfigurable memory mapping for various neural network topologies
CN111882065A (en) * 2020-08-03 2020-11-03 中国人民解放军国防科技大学 Method, system, and medium for mapping a spiking neural network to a brain-like computing platform
CN112149815A (en) * 2020-09-28 2020-12-29 复旦大学 Population clustering and population routing method for large-scale brain-like computing network
CN112260866A (en) * 2020-10-20 2021-01-22 广东工业大学 Method and device for designing network topology structure special for brain-like computer
CN112561042A (en) * 2021-03-01 2021-03-26 浙江大学 Neural model mapping method of brain-like computer operating system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115577353A (en) * 2022-12-08 2023-01-06 深圳市永达电子信息股份有限公司 Network security protection method and system based on brain computer system
CN115879544A (en) * 2023-02-28 2023-03-31 中国电子科技南湖研究院 Neuron coding method and system for distributed brain-like simulation
CN115879544B (en) * 2023-02-28 2023-06-16 中国电子科技南湖研究院 Neuron coding method and system for distributed brain-like simulation
CN117311516A (en) * 2023-11-28 2023-12-29 北京师范大学 Motor imagery electroencephalogram channel selection method and system
CN117311516B (en) * 2023-11-28 2024-02-20 北京师范大学 Motor imagery electroencephalogram channel selection method and system
CN117648956A (en) * 2024-01-29 2024-03-05 之江实验室 Resource mapping method, device and storage medium for impulse neural network model
CN117688992A (en) * 2024-02-01 2024-03-12 之江实验室 Resource mapping method and device for neuron computer operating system

Also Published As

Publication number Publication date
CN112561042B (en) 2021-06-29
CN112561042A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
WO2022183921A1 (en) Neural model mapping method of brain-like computer operating system
CN106919769B (en) Hierarchical FPGA (field programmable Gate array) layout and wiring method based on multi-level method and empowerment hypergraph
JP3548070B2 (en) Method and apparatus for automatically generating a multi-terminal net and program storage medium storing a program for executing the method for automatically generating a multi-terminal net
CN111291525B (en) Layer allocation method considering bus and non-bus net
JPH0766718A (en) Wafer scale structure for programmable logic
US11050672B2 (en) Network-on-chip link size generation
WO1995020197A1 (en) Apparatus and method for partitioning resources for interconnections
Abdallah et al. Basic network-on-chip interconnection for future gigascale MCSoCs applications: Communication and computation orthogonalization
CN111814420B (en) Overall wiring method based on topological optimization and heuristic search
CN116070682B (en) SNN model dynamic mapping method and device of neuron computer operating system
Chan et al. NoCOUT: NoC topology generation with mixed packet-switched and point-to-point networks
CN111630505A (en) Deep learning accelerator system and method thereof
CN114492782A (en) On-chip core compiling and mapping method and device of neural network based on reinforcement learning
US11283729B2 (en) Network-on-chip element placement
CN115168281A (en) Neural network on-chip mapping method and device based on tabu search algorithm
Balaji et al. NeuSB: A scalable interconnect architecture for spiking neuromorphic hardware
CN114564434A (en) Universal multi-core brain processor, accelerator card and computer equipment
CN112861466B (en) Wiring track distribution method, electronic equipment and computer readable storage medium
WO2020124488A1 (en) Application process mapping method, electronic device, and computer-readable storage medium
Russo et al. LAMBDA: An open framework for deep neural network accelerators simulation
CN113343632A (en) Heterogeneous layout legalization method considering carry chain and position constraint
JP2001338006A (en) Method for supporting logic automatic design and device for the same
US7516059B2 (en) Logical simulation device
CN113822008B (en) Ultra-large-scale integrated circuit wiring method based on multi-pin simultaneous diffusion search
US6598207B1 (en) Software for converting power delivery interconnect modeling connectivity maps to simulation ready input

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22762387

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22762387

Country of ref document: EP

Kind code of ref document: A1