Data mapping method from pulse convolutional neural network to brain-like computing chip
By performing computational graph segmentation and inter-core communication modeling, automatic parallel deployment on brain-like computing chips is realized, and the problems of high algorithm complexity and low solution efficiency in the existing methods are solved, and efficient communication and computing are achieved.
Patent Information
- Application Number
- CN202510378277.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-28
AI Technical Summary
The existing methods of mapping pulse convolutional neural networks (SCNNs) to brain-like computing chips are difficult to make full use of the structural characteristics of CNNs, resulting in high algorithm complexity and low solution efficiency.
A data mapping method from pulse convolutional neural network to brain-like computing chip is proposed. Through computational graph segmentation and inter-core communication modeling, the automatic parallel deployment of pulse convolutional neural network based on brain-like computing chip is realized. Specific steps include computing the parallel segmentation of the graph, inter-core communication modeling, calculating cost function and optimizing cost function to minimize the maximum communication load.
This method can reduce communication delay, improve computing efficiency, and realize efficient parallel deployment of pulse convolutional neural networks on brain-like computing chips.
Smart Images

Figure CN119886235A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of neural network chips, and in particular relates to a data mapping method from a pulse convolutional neural network to a brain-like computing chip. Background Art
[0002] Spiking Neural Networks (SNN) are called the "third generation of neural networks". They simulate the pulse emission mechanism of biological neurons, which enables them to more accurately simulate the information processing method of the human brain. Compared with traditional artificial neural networks, spiking neural networks show higher low power consumption and flexibility in processing timing information and dynamic changes. By deploying on brain-like computing chips, they can achieve low power consumption and real-time performance. Convolutional Neural Networks (CNN) capture local features through convolution kernels, and through multi-layer convolution, they can gradually extract multi-scale features from low-level to high-level. Therefore, many researchers have combined spiking neural networks and convolutional neural networks to construct spiking convolutional neural networks (SCNN), which have achieved good results in tasks such as target detection.
[0003] Most of the brain-like computing chips that have been developed are built on a chip network (NoC), which efficiently connects the many neuron cores in the platform. Mapping SCNN to brain-like computing chips is a key step in realizing SCNN deployment. The general mapping solution is to divide SCNN into multiple sub-blocks and place them in the neuron core. It is necessary to ensure that the number of neurons in each sub-block cannot exceed the capacity of the neuron core, and the communication delay between cores is as low as possible. At present, some mapping methods have emerged to deploy SNN on brain-like platforms, but these methods are difficult to fully utilize the structural characteristics of CNN, which makes their algorithm complexity high and the solution efficiency low.
[0004] According to the structural characteristics of CNN, one method of parallelization is data parallelism. Data parallelism refers to the division of operator input data, thereby splitting operators, distributing data from multiple slices to each core of the same device, and achieving parallelism through multi-core computing. Through data parallelism, the input and output neuron clusters of the convolutional layer and pooling layer are divided into multiple slices and placed in multiple neuron cores, thereby distributing the communication load of a single neuron core to multiple neuron cores, improving the utilization of communication resources in NoC, and thus reducing communication delays. As a dedicated integrated circuit, brain-like chips lack a convenient and efficient parallel programming interface, making it difficult to efficiently implement SCNN parallelization. Summary of the invention
[0005] To solve the above problems, the present invention proposes a data mapping method from a pulse convolutional neural network to a brain-like computing chip. This method realizes automatic parallel deployment of a pulse convolutional neural network based on a brain-like computing chip, which can reduce communication delays and improve computing efficiency.
[0006] To achieve the above object, the present invention adopts the following technical solutions: A method for mapping data from a spiking convolutional neural network to a brain-like computing chip comprises the following steps: S1. Computation graph segmentation: The data of the computation graph is segmented in parallel to obtain various subgraphs; S2. Inter-core communication modeling: The inter-core communication is modeled as a three-dimensional box packing model, which includes mapping neuron cores and statistical communication loads; The specific process of step S2 is: S21, mapping neuron cores: placing the neuron clusters in the segmented subgraphs onto adjacent neuron cores in topological order, so as to make the segmented subgraphs satisfy the neuron core capacity constraints and maximize the communication efficiency between adjacent neuron clusters; S22. Statistical communication load: According to the mapping of neuron groups to neuron cores and the static routing algorithm, the communication load of each node on the on-chip network is counted; In a Mesh network structured network on chip, the communication load is located in the two-dimensional space of the network on chip. According to the static routing algorithm, the calculation formula for the communication load of each node is: = , , where Core To the core j The communication load; is the sending pulse core; j is the receiving pulse core; Core Send to core j The number of pulses; For Node The communication load; is the horizontal coordinate of the two-dimensional grid NoC, is the ordinate of the two-dimensional grid NoC, is the node communication load coordinate, Constitute a three-dimensional space; is the sum function; is the horizontal coordinate interval of the two-dimensional grid NoC; is the ordinate interval of the two-dimensional grid NoC; S3. Calculate the cost function: Using three-dimensional space, the communication optimization problem is modeled as a three-dimensional packing problem. The optimization goal is to minimize the maximum height. The calculation formula of the cost function is: , where is the maximum communication load of all nodes; To find the maximum value function; S4, optimize the cost function: select the optimal segmentation scheme based on the cost function using an enumeration algorithm or a heuristic algorithm, and then execute step S1 to obtain the final parallel data flow graph.
[0007] Preferably, the specific process of step S1 is: S11. Calculate the shape of neuron clusters: Model the neural network as a directed acyclic graph. The points in the directed acyclic graph are used to execute operators, and the edges represent the data dependencies between operators. According to the directed acyclic graph model, starting from the input and the first layer, the shapes of each neuron cluster are inferred layer by layer. Then, according to the input and parameters of each layer, the output size of the sub-operator is calculated to obtain the shape of the neuron cluster. S12, calculating input size: calculating input size is the inverse operation of calculating output size, and the input size of the sub-operator is calculated according to the output shape of the sub-operator; S13, perform segmentation: perform operator segmentation according to the output size and input size of the sub-operator, cut and distribute the input to each sub-operator, and analyze whether the output size of the previous sub-operator matches the input size of the current sub-operator; if the output size of the previous sub-operator does not match the input size of the current sub-operator, the current sub-operator requires part of the output of the previous sub-operator in the adjacent sub-graph as input, and introduces a connection between the two sub-graphs; if the output size of the previous sub-operator matches the input size of the current sub-operator, there is no need to obtain input from the adjacent sub-graph; wherein, when initializing the segmentation, the directed acyclic graph is segmented into n sub-graphs, and n is the minimum value that satisfies the neuron core capacity constraint.
[0008] Preferably, the specific process of step S4 is: according to the calculated shape of the neuron cluster, determine the total number of operator segmentation schemes; use the total number of operator segmentation schemes as the size of the solution space for single-objective optimization, and give a threshold of the solution space size as a hyperparameter; if the total number of operator segmentation schemes is less than or equal to the threshold, the solution time is acceptable, and an enumeration algorithm is used to traverse the solution space to find the optimal solution; if the total number of operator segmentation schemes is greater than the threshold, the solution time is unacceptable, and a heuristic algorithm is used to find a feasible solution.
[0009] Preferably, the threshold value ranges from 1000 to 10000.
[0010] Preferably, the specific calculation process of the enumeration algorithm is: traverse all partitioning schemes, and in each iteration, calculate the communication load under the current scheme according to the communication load calculation formula of the on-chip network in step S2 to find the minimum communication load and the corresponding partitioning scheme.
[0011] Preferably, the heuristic algorithm is implemented using an adaptive hill climbing algorithm, and the specific calculation process is: S41, selecting the best neighborhood solution: selecting the solution with the highest evaluation value from the neighborhood solutions as the best neighborhood solution; S42, updating the current solution: setting the best neighborhood solution as a new current solution; S43, adaptive adjustment: adjusting the search strategy according to the performance of the current solution and the neighborhood solution, the adjustment of the search strategy includes changing the step size and changing the neighborhood structure; S44, checking termination conditions: determining whether termination conditions are met, the termination conditions being that a maximum number of iterations is reached or the quality of the solution reaches a preset threshold; S45, output the optimal solution: if the termination condition is met, output the current optimal solution and end the process; if the termination condition is not met, return to step S1 to continue searching.
[0012] After adopting the above technical scheme, the present invention has the following beneficial effects: the present invention provides a data mapping method from a pulse convolutional neural network to a brain-like computing chip. The ultimate goal of data parallel mapping is to explore the parallel computing scheme of the pulse convolutional neural network operator during the compilation process, and select the optimal segmentation scheme with the lowest communication delay according to the proposed communication cost function, so as to map the pulse convolutional neural network to multi-core computing resources. All segmented sub-operators are executed in parallel in the brain-like computing chip according to the parallel data flow graph, which is used to increase the utilization rate of communication resources and improve the efficiency of inter-core communication, so as to realize the automatic parallel deployment of the pulse convolutional neural network based on the brain-like computing chip, which can reduce the communication delay and improve the computing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a flow chart of the present invention; Figure 2 It is a process framework diagram of the present invention; Figure 3 A process diagram for modeling inter-core communication of the present invention; Figure 4 A process diagram for selecting an optimal segmentation scheme of the present invention; Figure 5 It is a process diagram of the adaptive hill climbing algorithm of the present invention; Figure 6 This is a data parallel example diagram of the pulse convolutional neural network of the present invention. DETAILED DESCRIPTION
[0014] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0015] like Figures 1 to 6 As shown, a data mapping method from a pulse convolutional neural network to a brain-like computing chip includes the following steps: S1. Computation graph segmentation: The data of the computation graph is segmented in parallel to obtain various subgraphs; The specific process of step S1 is: S11. Calculate the shape of neuron clusters: Model the neural network as a directed acyclic graph. The points in the directed acyclic graph are used to execute operators, and the edges represent the data dependencies between operators. According to the directed acyclic graph model, starting from the input and the first layer, the shapes of each neuron cluster are inferred layer by layer. Then, according to the input and parameters of each layer, the output size of the sub-operator is calculated to obtain the shape of the neuron cluster. S12, calculating input size: calculating input size is the inverse operation of calculating output size, and the input size of the sub-operator is calculated according to the output shape of the sub-operator; S13, perform segmentation: perform operator segmentation according to the output size and input size of the sub-operator, cut and distribute the input to each sub-operator, and analyze whether the output size of the previous sub-operator matches the input size of the current sub-operator; if the output size of the previous sub-operator does not match the input size of the current sub-operator, the current sub-operator requires part of the output of the previous sub-operator in the adjacent sub-graph as input, and introduces a connection between the two sub-graphs; if the output size of the previous sub-operator matches the input size of the current sub-operator, there is no need to obtain input from the adjacent sub-graph; wherein, when initializing the segmentation, the directed acyclic graph is segmented into n sub-graphs, and n is the minimum value that satisfies the neuron core capacity constraint; S2. Inter-core communication modeling: The inter-core communication is modeled as a three-dimensional box packing model, which includes mapping neuron cores and statistical communication loads; The specific process of step S2 is: S21, mapping neuron cores: placing the neuron clusters in the segmented subgraphs onto adjacent neuron cores in topological order, so as to make the segmented subgraphs satisfy the neuron core capacity constraints and maximize the communication efficiency between adjacent neuron clusters; S22. Statistical communication load: According to the mapping of neuron groups to neuron cores and the static routing algorithm, the communication load of each node on the on-chip network is counted; In a Mesh network structured network on chip, the communication load is located in the two-dimensional space of the network on chip. According to the static routing algorithm, the calculation formula for the communication load of each node is: = , , where Core To the core j The communication load; is the sending pulse core; j is the receiving pulse core; Core Send to core j The number of pulses; For Node The communication load; is the horizontal coordinate of the two-dimensional grid NoC, is the ordinate of the two-dimensional grid NoC, is the node communication load coordinate, Constitute a three-dimensional space; is the sum function; is the horizontal coordinate interval of the two-dimensional grid NoC; is the ordinate interval of the two-dimensional grid NoC; S3. Calculate the cost function: Using three-dimensional space, the communication optimization problem is modeled as a three-dimensional packing problem. The optimization goal is to minimize the maximum height. The calculation formula of the cost function is: , where is the maximum communication load of all nodes; To find the maximum value function; S4, optimize the cost function: select the optimal segmentation scheme based on the cost function using an enumeration algorithm or a heuristic algorithm, and then execute step S1 to obtain the final parallel data flow graph; The specific process of step S4 is as follows: according to the calculated shape of the neuron cluster, the total number of operator partitioning schemes is determined; the total number of operator partitioning schemes is used as the size of the solution space for single-objective optimization, and a threshold of the size of the solution space is given as a hyperparameter; if the total number of operator partitioning schemes is less than or equal to the threshold, the solution time is acceptable, and an enumeration algorithm is used to traverse the solution space to find the optimal solution; if the total number of operator partitioning schemes is greater than the threshold, the solution time is unacceptable, and a heuristic algorithm is used to find a feasible solution; The threshold value ranges from 1000 to 10000; The specific calculation process of the enumeration algorithm is: traverse all partitioning schemes, and in each iteration, calculate the communication load under the current scheme according to the communication load calculation formula of the on-chip network in step S2 to find the minimum communication load and the corresponding partitioning scheme; The heuristic algorithm is implemented using an adaptive hill climbing algorithm, and the specific calculation process is: S41, selecting the best neighborhood solution: selecting the solution with the highest evaluation value from the neighborhood solutions as the best neighborhood solution; S42, updating the current solution: setting the best neighborhood solution as a new current solution; S43, adaptive adjustment: adjusting the search strategy according to the performance of the current solution and the neighborhood solution, the adjustment of the search strategy includes changing the step size and changing the neighborhood structure; S44, checking termination conditions: determining whether termination conditions are met, the termination conditions being that a maximum number of iterations is reached or the quality of the solution reaches a preset threshold; S45, output the optimal solution: if the termination condition is met, output the current optimal solution and end the process; if the termination condition is not met, return to step S1 to continue searching.
[0016] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data mapping method from a pulse convolutional neural network to a brain-like computing chip, characterized in that: The following steps are involved: S1. Computation graph segmentation: The data of the computation graph is segmented in parallel to obtain various subgraphs; S2. Inter-core communication modeling: The inter-core communication is modeled as a three-dimensional box packing model, which includes mapping neuron cores and statistical communication loads; The specific process of step S2 is: S21, mapping neuron cores: placing the neuron clusters in the segmented subgraphs onto adjacent neuron cores in topological order, so as to make the segmented subgraphs satisfy the neuron core capacity constraints and maximize the communication efficiency between adjacent neuron clusters; S22. Statistical communication load: According to the mapping of neuron groups to neuron cores and the static routing algorithm, the communication load of each node on the on-chip network is counted; In a mesh network structured network on chip, the communication load is located in the two-dimensional space of the network on chip. According to the static routing algorithm, the calculation formula for the communication load of each node is: = , , where Core To the core j The communication load; is the sending pulse core; j is the receiving pulse core; Core Send to core j The number of pulses; For Node The communication load; is the horizontal coordinate of the two-dimensional grid NoC, is the ordinate of the two-dimensional grid NoC, is the node communication load coordinate, Constitute a three-dimensional space; is the sum function; is the horizontal coordinate interval of the two-dimensional grid NoC; is the ordinate interval of the two-dimensional grid NoC; S3. Calculate the cost function: Using three-dimensional space, the communication optimization problem is modeled as a three-dimensional packing problem. The optimization goal is to minimize the maximum height. The calculation formula of the cost function is: , where is the maximum communication load of all nodes; To find the maximum value function; S4, optimize the cost function: select the optimal segmentation scheme based on the cost function using an enumeration algorithm or a heuristic algorithm, and then execute step S1 to obtain the final parallel data flow graph.
2. The method for mapping data from a pulse convolutional neural network to a brain-like computing chip according to claim 1, characterized in that: The specific process of step S1 is: S11. Calculate the shape of neuron clusters: Model the neural network as a directed acyclic graph. The points in the directed acyclic graph are used to execute operators, and the edges represent the data dependencies between operators. According to the directed acyclic graph model, starting from the input and the first layer, the shapes of each neuron cluster are inferred layer by layer. Then, according to the input and parameters of each layer, the output size of the sub-operator is calculated to obtain the shape of the neuron cluster. S12, calculating input size: calculating input size is the inverse operation of calculating output size, and the input size of the sub-operator is calculated according to the output shape of the sub-operator; S13, perform segmentation: perform operator segmentation according to the output size and input size of the sub-operator, cut and distribute the input to each sub-operator, and analyze whether the output size of the previous sub-operator matches the input size of the current sub-operator; if the output size of the previous sub-operator does not match the input size of the current sub-operator, the current sub-operator requires part of the output of the previous sub-operator in the adjacent sub-graph as input, and introduces a connection between the two sub-graphs; if the output size of the previous sub-operator matches the input size of the current sub-operator, there is no need to obtain input from the adjacent sub-graph; wherein, when initializing the segmentation, the directed acyclic graph is segmented into n sub-graphs, and n is the minimum value that satisfies the neuron core capacity constraint.
3. The data mapping method from a pulse convolutional neural network to a brain-like computing chip according to claim 1, characterized in that: The specific process of step S4 is as follows: according to the calculated shape of the neuron cluster, determine the total number of operator partitioning schemes; use the total number of operator partitioning schemes as the size of the solution space for single-objective optimization, and give a threshold of the solution space size as a hyperparameter; if the total number of operator partitioning schemes is less than or equal to the threshold, the solution time is acceptable, and an enumeration algorithm is used to traverse the solution space to find the optimal solution; if the total number of operator partitioning schemes is greater than the threshold, the solution time is unacceptable, and a heuristic algorithm is used to find a feasible solution.
4. The method for mapping data from a pulse convolutional neural network to a brain-like computing chip according to claim 3, characterized in that: The threshold value ranges from 1000 to 10000.
5. The method for mapping data from a pulse convolutional neural network to a brain-like computing chip as claimed in claim 3, characterized in that: The specific calculation process of the enumeration algorithm is: traverse all partitioning schemes, and in each iteration, calculate the communication load under the current scheme according to the communication load calculation formula of the on-chip network in step S2 to find the minimum communication load and the corresponding partitioning scheme.
6. The method for mapping data from a pulse convolutional neural network to a brain-like computing chip as claimed in claim 3, characterized in that: The heuristic algorithm is implemented using an adaptive hill climbing algorithm, and the specific calculation process is: S41, selecting the best neighborhood solution: selecting the solution with the highest evaluation value from the neighborhood solutions as the best neighborhood solution; S42, updating the current solution: setting the best neighborhood solution as a new current solution; S43, adaptive adjustment: adjusting the search strategy according to the performance of the current solution and the neighborhood solution, the adjustment of the search strategy includes changing the step size and changing the neighborhood structure; S44, checking termination conditions: determining whether termination conditions are met, the termination conditions being that a maximum number of iterations is reached or the quality of the solution reaches a preset threshold; S45, output the optimal solution: if the termination condition is met, output the current optimal solution and end the process; If the termination condition is not met, return to step S1 to continue searching.
Citation Information
Patent Citations
Network-on-chip resource mapping method based on dynamic characteristics of neural network
CN105469143A
Neural model mapping method of brain-like computer operating system
CN112561042A
On-chip core compiling and mapping method and device of neural network based on reinforcement learning
CN114492782A
Method for operating and deploying spiking neural network in brain-like computer on hardware
CN115081587A
Neural network on-chip mapping method and device based on tabu search algorithm
CN115168281A