Data stream mapping search method, system, electronic device and storage medium

By forming multiple data flow mapping sets in the spiking neural network, parallel computing and energy consumption screening, the problem of low efficiency of data flow mapping search is solved, and fast, accurate and comprehensive data flow mapping search is achieved.

CN117291237BActive Publication Date: 2025-09-09PENG CHENG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311173877.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-11
Publication Date
2025-09-09
Estimated Expiration
2043-09-11

AI Technical Summary

Technical Problem

During the convolution process of pulse neural networks, existing technologies require a lot of time and resources to search for data stream mappings, resulting in low efficiency.

Method used

By obtaining data types and dimension data, multiple data flow mapping sets are formed. The number of parallel threads is determined according to the number of cluster nodes and the number of processor cores. Parallel computing is performed, and energy calculation is performed on each candidate data flow mapping to screen out the target data flow mapping with the lowest energy consumption.

Benefits of technology

It improves the efficiency of data flow mapping search, saves time and resources, and ensures the accuracy and comprehensiveness of search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117291237B_ABST
    Figure CN117291237B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a data flow mapping search method, system, electronic device and storage medium, which obtain data types and corresponding divided dimensional data from the pulse neural network convolution process, and form multiple data flow mapping sets; obtain the number of cluster nodes and the number of processor cores, determine the total number of parallel threads of the data cluster, and create parallel threads; obtain the data flow mapping search number of each parallel thread based on the data flow mapping set and the total number of parallel threads, assign a data flow mapping to each parallel thread, and screen the data flow mapping according to the preset storage rules of each storage level to obtain multiple candidate data flow mappings; in each parallel thread, perform energy calculation on each candidate data flow mapping, and compare the energy calculation result with the historical energy calculation result. If the energy calculation result is lower than the historical energy calculation result, the candidate data flow mapping corresponding to the energy calculation result is used as the target data flow mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer application technology, and in particular to a data stream mapping search method, system, electronic device and storage medium. Background Art

[0002] A spiking neural network (SNN) is an artificial neural network model that simulates the working principles of the nervous system. It is a pulse-based (1-bit) neural network that can process information by simulating the transmission of pulses between neurons. Compared to artificial neural networks (ANNs), which rely on multi-bit data transmission and numerical calculations, SNNs have better biological interpretability and energy efficiency.

[0003] When selecting the optimal data stream mapping for the SNN convolution process, it is necessary to comprehensively consider various influencing factors and verify each candidate data stream mapping one by one. When the amount of data is very large, it takes a lot of time and search resources to search for the data stream mapping, which reduces the efficiency of the data stream mapping search. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a data stream mapping search method, system, electronic device and storage medium, which can improve the efficiency of data stream mapping search while saving data stream mapping search time and search resources.

[0005] To achieve the above-mentioned purpose, the first aspect of an embodiment of the present application proposes a data flow mapping search method, the method comprising: obtaining a data type and a plurality of dimensional data divided according to the data type from a pulse neural network convolution process, and forming a plurality of data flow mapping sets according to the data type and the dimensional data; wherein each of the data flow mapping sets includes a plurality of data flow mappings; obtaining the number of cluster nodes used for simulation in a data cluster and the number of processor cores of each of the cluster nodes, determining the total number of parallel threads of the data cluster according to the product of the number of cluster nodes and the number of processor cores, and creating parallel threads according to the total number of parallel threads; according to the data flow The mapping set and the total number of parallel threads are calculated to obtain the data flow mapping search number of each parallel thread; according to the data flow mapping search number, a corresponding number of the data flow mappings are allocated to each parallel thread, and the data flow mappings are screened according to the preset storage rules of each storage level to obtain multiple candidate data flow mappings; in each parallel thread, energy calculation is performed on each candidate data flow mapping to obtain an energy calculation result, and each energy calculation result is compared with a historical energy calculation result. If the energy calculation result is lower than the historical energy calculation result, the candidate data flow mapping corresponding to the energy calculation result is used as the target data flow mapping.

[0006] According to some embodiments of the present application, after the data stream mapping corresponding to the energy calculation result is used as the target data stream mapping, it also includes: obtaining a preset synchronization cycle; executing a periodic data stream mapping search process, the periodic data stream mapping search process including: in each of the synchronization cycles, taking each of the parallel threads as the main thread in turn, and taking the parallel threads other than the main thread as the secondary threads, broadcasting the target data stream mapping of the main thread; based on the energy calculation result corresponding to the main thread as the first energy calculation result, the energy calculation result corresponding to each of the secondary threads as the second energy calculation result, comparing the first energy calculation result with the second energy calculation result to obtain a comparison result; determining the secondary thread to be updated based on the comparison result; updating the target data stream mapping corresponding to the first energy calculation result in the secondary thread to be updated, and obtaining the data stream mapping update result of the secondary thread; repeating the periodic data stream mapping search process until the number of repetitions exceeds the total number of parallel threads, and obtaining the data stream mapping update result of each parallel thread.

[0007] According to some embodiments of the present application, the data flow mapping set includes a first data flow mapping set, a second data flow mapping set, a third data flow mapping set and a fourth data flow mapping set; the data flow mapping set is formed based on the data type and the dimensional data, including: calculating the number of factorizable pairs based on the dimensional values ​​of each dimensional data, and obtaining the first data flow mapping set based on the dimensional data and the number of factorizable pairs; in each storage level, summarizing the arrangement of the dimensional data within the data type to obtain the second data flow mapping set corresponding to each storage level; wherein the storage level is used to store data of the data type; summarizing the division method of the dimensional data on the spatial coordinate axis to obtain the third data flow mapping set; wherein the spatial coordinate axis is generated according to the data array formed by the arithmetic logic unit; summarizing the storage method of the data type and the divided dimensional data in each storage level to obtain the fourth data flow mapping set.

[0008] According to some embodiments of the present application, the number of factorizable pairs is calculated based on the dimensional values ​​of each dimensional data, including: calculating the square root of the dimensional value of each dimensional data to obtain the dimensional square number; dividing the dimensional value by the number of decompositions in sequence to obtain a first dimensional decomposition result; wherein the number of decompositions is obtained based on the dimensional square number; selecting the first dimensional decomposition result and the number of decompositions that are positive integers as the number of dimensional factors; wherein each of the dimensional factor numbers is different; obtaining a second dimensional decomposition result by dividing the dimensional value by the number of dimensional factors, and forming factorizable pairs based on the dimensional factor number and the second dimensional decomposition result; wherein each pair of the factorizable pairs is different.

[0009] According to some embodiments of the present application, in each storage level, the dimensional data is summarized according to the arrangement of the dimensional data within the data type to obtain a second data flow mapping set corresponding to each storage level, including: in each storage level, the dimensional data is interactively arranged within each data type to obtain multiple arrangements; and the multiple arrangements are summarized to obtain a second data flow mapping set corresponding to each storage level.

[0010] According to some embodiments of the present application, the division methods of the dimensional data on the spatial coordinate axis are summarized to obtain a third data stream mapping set, including: generating a spatial coordinate axis based on a data array formed by an arithmetic logic unit; wherein the spatial coordinate axis is used to perform parallel calculations based on the dimensional data; the spatial coordinate axis includes at least a horizontal coordinate axis and a vertical coordinate axis; on the spatial coordinate axis, the dimensional data is divided by multiple division methods to obtain multiple division methods; and the division methods that can realize parallel search are screened and summarized to form a third data stream mapping set.

[0011] According to some embodiments of the present application, the storage methods of the data types and the divided dimensional data in each of the storage levels are summarized to obtain a fourth data flow mapping set, including: obtaining a preset storage rule preset for each of the storage levels; wherein the preset storage rule records the data types and the divided dimensional data that can be stored in each of the storage levels; based on the preset storage rules, the data types and the divided dimensional data are stored in each of the storage levels to obtain multiple hierarchical storage methods; and summarizing the multiple storage methods to form a fourth data flow mapping set.

[0012] According to some embodiments of the present application, the data flow mapping type includes input pulses and membrane potentials, and the input pulses and the membrane potentials have an associated relationship; the method also includes: determining the dimensional data corresponding to the input pulses and the membrane potentials based on the associated relationship; wherein the dimensional data includes the input data channel dimension or the data weight channel dimension, the weight kernel length dimension, and the weight kernel width dimension; traversing each of the data flow mapping sets, and determining the first data flow mapping from the data flow mapping set that does not include the input data channel dimension or the data weight channel dimension, the weight kernel length dimension, and the weight kernel width dimension; in each of the data flow mapping sets, eliminating the first data flow mapping.

[0013] According to some embodiments of the present application, the data stream mapping search number includes a first data stream mapping search number and a second data stream mapping search number; the calculation based on the data stream mapping set and the total number of parallel threads to obtain the data stream mapping search number for each parallel thread includes: numbering each parallel thread to obtain a thread number; obtaining the number of data stream mappings in each data stream mapping set, multiplying the number of data stream mappings in each data stream mapping set to obtain an overall data stream mapping number, and taking the remainder after dividing the overall data stream mapping number by the total number of parallel threads as a reference remainder; if the thread number is greater than or equal to a first threshold and less than the reference remainder, dividing the overall data stream mapping number by the total number of parallel threads to obtain a first calculation result; taking an integer of the first calculation result and adding a first numerical value to obtain a first data stream mapping search number; if the thread number is greater than or equal to the reference remainder, dividing the overall data stream mapping number by the total number of parallel threads to obtain a second calculation result; taking an integer of the second calculation result to obtain a second data stream mapping search number.

[0014] According to some embodiments of the present application, the data flow mapping is screened according to the preset storage rules of each storage level to obtain multiple candidate data flow mappings, including: obtaining the data type stored corresponding to each storage level according to the data flow mapping; obtaining the preset storage rules corresponding to each storage level, and if the preset storage rules indicate that the storage level prohibits the storage of the data type corresponding to the data flow mapping, screening the data flow mapping; if the preset storage rules indicate that the storage level allows the storage of the data type corresponding to the data flow mapping, retaining the data flow mapping as a first candidate data flow mapping; calculating the first data volume of the first candidate data flow mapping according to the dimensional data of the first candidate data flow mapping; comparing the first data volume with the preset data volume threshold of each storage level, and if the first data volume is greater than the preset data volume threshold, screening the first candidate data flow mapping; and retaining the first candidate data flow mapping if the first data volume is less than the preset data volume threshold, thereby obtaining multiple candidate data flow mappings.

[0015] According to some embodiments of the present application, in each of the parallel threads, energy calculation is performed on each of the candidate data flow mappings to obtain an energy calculation result, including: obtaining the unit calculation energy of the arithmetic logic unit and the unit access energy of each of the storage levels; for each of the candidate data flow mappings, calculating the number of calculations of the arithmetic logic unit and the number of accesses of the candidate data flow mapping at each of the storage levels; obtaining a first energy value by multiplying the unit calculation energy by the number of calculations, obtaining a second energy value by multiplying the unit access energy by the number of accesses, and obtaining an energy calculation result by adding the first energy value to the second energy value.

[0016] To achieve the above-mentioned purpose, the second aspect of the embodiment of the present application proposes a data flow mapping search system, which includes: a data flow mapping set acquisition module, which is used to obtain data types and multiple dimensional data divided according to the data types from the pulse neural network convolution process, and form multiple data flow mapping sets according to the data types and the dimensional data; wherein each of the data flow mapping sets includes multiple data flow mappings; a parallel thread creation module, which is used to obtain the number of cluster nodes used for simulation in the data cluster and the number of processor cores of each of the cluster nodes, determine the total number of parallel threads of the data cluster according to the product of the number of cluster nodes and the number of processor cores, and create parallel threads according to the total number of parallel threads; a data flow mapping search number acquisition module, which is used to generate a parallel thread based on the total number of parallel threads; Calculation is performed based on the data flow mapping set and the total number of parallel threads to obtain the data flow mapping search number for each parallel thread; a candidate data flow mapping acquisition module is used to allocate a corresponding number of data flow mappings to each parallel thread based on the data flow mapping search number, and screen the data flow mappings according to the preset storage rules of each storage level to obtain multiple candidate data flow mappings; a target data flow mapping acquisition module is used to perform energy calculation on each candidate data flow mapping in each parallel thread to obtain an energy calculation result, and compare each energy calculation result with a historical energy calculation result. If the energy calculation result is lower than the historical energy calculation result, the candidate data flow mapping corresponding to the energy calculation result is used as the target data flow mapping.

[0017] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the data stream mapping search method described in any one of the embodiments of the first aspect of the present application when executing the computer program.

[0018] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the data flow mapping search method described in any one of the embodiments of the first aspect of the present application.

[0019] The data flow mapping search method, system, electronic device and storage medium proposed in this application can obtain different data flow mapping sets from multiple aspects based on the data type and the corresponding divided multiple dimensional data, and determine the total number of parallel threads based on the product of the number of cluster nodes and the number of processor cores, and create multiple parallel threads; start parallel calculation based on the calculated data flow mapping search number, perform parallel search in the data flow mapping set, and compare the energy calculation result of each data flow mapping with the historical flow result. If the energy calculation result is lower than the historical energy calculation result, the data flow mapping corresponding to the energy calculation result is used as the target data flow mapping. This application comprehensively summarizes the data flow mapping to form a data flow mapping set and assigns a data flow mapping to each parallel thread, so that the final target data flow mapping is faster, more accurate and more comprehensive. At the same time, since the data flow mapping with the lowest energy consumption is selected, this application can save data flow mapping search time and search resources while improving the efficiency of data flow mapping search. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of the structure of the data flow mapping search system provided in an embodiment of the present application;

[0021] Figure 2 This is a flow chart of the data stream mapping search method provided by an embodiment of the present application;

[0022] Figure 3 Schematic diagram of the convolution process of the SNN provided in the embodiment of the present application;

[0023] Figure 4 This is a flowchart after step S105 provided in an embodiment of the present application;

[0024] Figure 5 This is a diagram of the formation process of the data flow mapping set provided in an embodiment of the present application;

[0025] Figure 6 is a schematic diagram of different data flow mappings provided in an embodiment of the present application;

[0026] Figure 7 This is a schematic diagram of the storage hierarchy provided in an embodiment of the present application;

[0027] Figure 8 It is a diagram of the calculation steps of factoring a quantity provided by an embodiment of the present application;

[0028] Figure 9 yes Figure 5 The step flow chart of step S302 is shown;

[0029] Figure 10 yes Figure 5 The step flow chart of step S303 is shown;

[0030] Figure 11 yes Figure 5 The step flow chart of step S304 is shown;

[0031] Figure 12 This is a flowchart of another data stream mapping search method provided by an embodiment of the present application;

[0032] Figure 13 yes Figure 2 The step flow chart of step S103 is shown;

[0033] Figure 14 yes Figure 2 The step flow chart of step S104 is shown;

[0034] Figure 15 is a calculation flow chart of the energy calculation results provided in the embodiment of the present application;

[0035] Figure 16 This is a functional module diagram of the data flow mapping search system provided by an embodiment of the present application;

[0036] Figure 17 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0038] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0040] SNNs transfer information between neurons through pulses, making them more biologically plausible compared to ANNs, which rely on multi-bit data transmission and numerical computation. With the introduction of more and more SNN models and the high computational efficiency of deep SNNs, deep SNNs are widely used in power-sensitive computing fields such as wearable devices and automotive equipment. This has made research on efficient data flow mapping search methods for deep SNNs more urgent.

[0041] In related technologies, computational optimization of SNNs is often based on the experience gained with ANNs. However, SNNs differ significantly from traditional ANNs because they involve four data types: multi-time-step 1-bit input, multi-bit weights, multi-time-step multi-bit membrane potentials, and multi-time-step 1-bit output. Furthermore, the basic computational instructions of SNNs differ significantly from those of ANNs. Therefore, computational optimization methods for ANNs are not fully applicable to SNNs.

[0042] Based on this, the embodiments of the present application provide a data stream mapping search method, system, electronic device and storage medium, which can improve the efficiency of data stream mapping search while saving data stream mapping search time and search resources.

[0043] The data stream mapping search method, system, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the data stream mapping search system in the embodiments of the present application is described.

[0044] For example, Figure 1 As shown, Figure 1This is a schematic diagram of an application scenario of the data flow mapping search system provided in an embodiment of the present application. In a data flow mapping search system, a server 101, a controller 102, and a terminal 103 are included. The server 101 can simultaneously create multiple parallel threads and execute multiple parallel threads through the controller 102, initiating a parallel search of the data flow to obtain a data flow mapping. It is understood that the controller 102 can be the nerve center and command center of the data flow mapping search system. The controller 102 can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. The controller 102 can receive requests from the terminal 103 and generate operation instructions based on the requests. Based on the instructions, the server 101 calculates energy for multiple data flow mappings, compares the calculated energy with the historical data flow mapping search energy consumption, selects the data flow mapping with the lowest energy consumption, and synchronizes the data flow mapping results with the terminal 103. It should be noted that in the data flow mapping search system, the hardware devices may not be limited to these and can be configured according to actual needs. The embodiments of the present application do not impose specific limitations on this.

[0045] The data stream mapping search method in the embodiment of the present application can be illustrated by the following embodiment.

[0046] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0047] Figure 2 This is an optional flowchart of the data stream mapping search method provided in an embodiment of the present application. Figure 2 The method may include but is not limited to steps S101 to S105.

[0048] Step S101, obtain the data type and multiple dimensional data divided according to the data type from the pulse neural network convolution process, and form multiple data flow mapping sets based on the data type and dimensional data; wherein each data flow mapping set includes multiple data flow mappings.

[0049] Please refer to Figure 3 , Figure 3 Schematic diagram of the SNN convolution process, Figure 3 It can be seen that the data types obtained during the SNN convolution process include input spikes, weights, membrane potentials, and output spikes.

[0050] Specifically, an SNN (Spiking Neural Network) is a neural network model that simulates biological neural systems. In an SNN, information is transmitted and processed in the form of pulses. An input pulse refers to an electrical signal input from the outside to a neuron, usually represented by the pulse time. An input pulse can be an input signal from a sensor or a pulse transmitted from another neuron. Weights represent the strength of the connection between neurons. In an SNN, each connection has a weight value that is used to adjust the degree of influence of the input pulse on the neuron. Weights can be positive or negative. Positive weights enhance the influence of input pulses, while negative weights inhibit the influence of input pulses. Membrane potential refers to the potential difference between the inside and outside of a neuron's cell membrane. When a neuron receives an input pulse, the membrane potential changes based on the time and weight of the input pulse. If the membrane potential exceeds the neuron's threshold, the neuron generates an output pulse. An output pulse is an electrical signal generated by a neuron that is used to transmit information to other neurons. The frequency of the output pulse usually indicates the degree of response of the neuron to the input pulse.

[0051] During the convolution process of an SNN, input pulses are weighted and summed according to their weights. These pulses then act on the neuron's membrane potential. If the membrane potential exceeds a threshold, the neuron generates an output pulse. This process involves convolving the convolution kernel with the input signal to produce the output signal. Specifically, for a neuron's input, each input pulse is multiplied by its corresponding weight, and then all weighted input pulses are summed to obtain the neuron's input current. This input current changes the neuron's membrane potential. If the membrane potential exceeds a threshold, the neuron generates an output pulse. This process is repeated for every neuron in the entire neural network, enabling information transmission and processing.

[0052] In some embodiments, the dimensional data is divided according to the data type, and the data type can be divided into 10 dimensional data, specifically Figure 3In Chinese, C represents the input data channel dimension or the data weight channel dimension; H represents the height of the input pulse feature map and W represents the width of the input pulse feature map; T represents the number of input pulses, output pulses, and membrane potentials in each time step; N represents the number of input pulses and output pulses; S represents the weight kernel length dimension and R represents the weight kernel width dimension; M represents the number of weights or the number of output channels; Q represents the length of the output pulse feature map and P represents the width of the output pulse feature map. It is understandable that the above dimensional data can be adjusted and changed according to the specific neural network model and task to adapt to different application scenarios.

[0053] It can be understood that data flow mapping is a way of dividing and combining data based on the hardware architecture resources and SNN convolution computing objectives. Each data flow mapping represents a way of dividing and combining data to meet the requirements of the hardware architecture and computing objectives. Different data flow mappings consume different amounts of energy during the computing process.

[0054] In some embodiments, different data flow mappings can be formed according to the division method and arrangement order of different data types and dimensional data, and a data flow mapping set can be formed according to different data flow mappings, so as to obtain different and more comprehensive data flow mappings and improve the efficiency and accuracy of data processing.

[0055] Step S102: Obtain the number of cluster nodes used for simulation in the data cluster and the number of processor cores of each cluster node, determine the total number of parallel threads in the data cluster based on the product of the number of cluster nodes and the number of processor cores, and create parallel threads based on the total number of parallel threads.

[0056] In some embodiments, a data cluster is a pool of computing resources that can be used for parallel search. Specifically, the data cluster includes multiple cluster nodes, each of which can have multiple CPU cores. The cluster nodes and CPU cores of the data cluster can be pre-configured, such as through deployment via a cloud computing service provider or a private cluster, or through simulation in a massively parallel computing cluster, and can also be adjusted based on actual conditions.

[0057] In some embodiments, each cluster node can execute multiple parallel threads, and each CPU core can execute one parallel thread. Therefore, the total number of parallel threads in the data cluster can be determined by multiplying the number of cluster nodes by the sum of the number of processor cores in the cluster nodes.

[0058] For example, the data cluster has 6 cluster nodes, each cluster node has 12 CPU cores. Since each CPU core can execute one parallel thread, the total number of parallel threads = 12*6 = 72.

[0059] In some embodiments, parallel threads may be created one by one on each CPU core according to the total number of parallel threads.

[0060] Step S103 , performing calculation based on the data stream mapping set and the total number of parallel threads to obtain the data stream mapping search number of each parallel thread.

[0061] In some embodiments, in order to distribute data stream mapping search tasks to each parallel thread as evenly as possible, it is necessary to determine the data stream mapping search number for each thread. The data stream mapping search number refers to the number of data stream mappings that each parallel thread needs to search during the search process.

[0062] In some embodiments, the total amount of each data stream mapping set can be multiplied to obtain the overall data stream mapping number of the data stream mapping set, and the total number of data stream mappings can be divided by the total number of parallel threads to obtain the data stream mapping search number of each parallel thread.

[0063] It is understood that the number of data stream mapping searches can also be allocated based on priority. For example, higher priority and a higher allocation ratio can be assigned to parallel threads with better performance to reduce the burden on parallel threads with poorer performance. Alternatively, different weight ratios can be set for each parallel thread, and the number of data stream mapping searches can be allocated based on the weights. This embodiment of the present application does not impose specific limitations on this.

[0064] Step S104 , allocating a corresponding number of data flow mappings to each parallel thread according to the number of data flow mapping searches, and screening the data flow mappings according to the preset storage rules of each storage level to obtain a plurality of candidate data flow mappings.

[0065] In some embodiments, each parallel thread can execute a parallel thread according to the data flow mapping search number, and divide the data flow mapping in the data flow mapping set according to the data flow mapping search number, and distribute the divided data flow mapping to the corresponding parallel thread according to the data flow mapping search number of each parallel thread. Exemplarily, for the division of the data flow mapping in each data flow mapping set, a corresponding number of data flow mappings can be randomly selected and then distributed to the parallel threads, or each data flow mapping set can be sequentially divided, with the number of divisions being the data flow mapping search number, or a fixed data flow mapping set can be allocated to a preset number of parallel threads, for example, setting the data flow mapping in data flow mapping set 1 to be divided into parallel threads 1 to parallel threads 10. The embodiments of the present application do not impose specific restrictions on this. It is understandable that for each data flow mapping, the parallel thread will check to ensure that it meets the SNN accelerator hardware architecture constraints or preset storage rule constraints. If the constraints are not met, the corresponding data flow mapping is discarded and the search for the next data flow mapping continues. If the constraints are met, the parallel threads will retain the data flow mappings that meet the constraints, thereby screening the data flow mappings that meet the conditions and discarding the data flow mappings that do not meet the conditions, thereby improving the data flow mapping search efficiency.

[0066] In step S105, in each parallel thread, energy calculation is performed on each candidate data flow mapping to obtain an energy calculation result, and each energy calculation result is compared with the historical energy calculation result. If the energy calculation result is lower than the historical energy calculation result, the candidate data flow mapping corresponding to the energy calculation result is used as the target data flow mapping.

[0067] In some embodiments, energy calculation can be performed on the candidate data flow mappings found by each parallel thread to obtain an energy calculation result. In some embodiments, the cumulative number of data accesses to specific storage blocks in each storage hierarchy and the number of calculations performed by each ALU can be calculated based on the order of the dimensional data, the numerical value of the dimensional data, the storage hierarchy, and the spatial partitioning of the candidate data flow mapping. These numbers are then multiplied by the unit energy consumption value to obtain an estimated energy consumption value for the current candidate data flow mapping.

[0068] It is understood that if each parallel thread saves multiple candidate data flow mappings found, the multiple candidate data flow mappings within each parallel thread are compared with the historical energy calculation results of candidate data flow mappings previously found by the parallel thread, and the one or more candidate data flow mappings with the lowest energy calculation results are selected as the target data flow mappings for the parallel thread. It is understood that the number of target data flow mappings ultimately selected can be set based on actual circumstances.

[0069] In some embodiments, if each parallel thread ultimately saves only one candidate data flow mapping, this candidate data flow mapping is compared with the historical energy calculation results of data flow mappings previously searched by the parallel thread, and the data flow mapping with the lowest energy calculation result is selected as the target data flow mapping. In other words, the final target data flow mapping can be either the candidate data flow mapping obtained in the current search or the data flow mapping obtained in the previous search.

[0070] It can be understood that retaining the data flow mapping with the lowest energy calculation result for each parallel thread can optimize the energy efficiency of SNN convolution calculation. In other words, it can reduce the energy consumption of data access and calculation, thereby improving the energy efficiency and performance of the system.

[0071] The data flow mapping search method, system, electronic device and storage medium proposed in this application can obtain different data flow mapping sets from multiple aspects based on the data type and the corresponding divided multiple dimensional data, and determine the total number of parallel threads based on the product of the number of cluster nodes and the number of processor cores, and create multiple parallel threads; start parallel calculation based on the calculated data flow mapping search number, perform parallel search in the data flow mapping set, and compare the energy calculation result of each data flow mapping with the historical flow result. If the energy calculation result is lower than the historical energy calculation result, the data flow mapping corresponding to the energy calculation result is used as the target data flow mapping. This application comprehensively summarizes the data flow mapping to form a data flow mapping set and assigns a data flow mapping to each parallel thread, so that the final target data flow mapping is faster, more accurate and more comprehensive. At the same time, since the data flow mapping with the lowest energy consumption is selected, this application can save data flow mapping search time and search resources while improving the efficiency of data flow mapping search.

[0072] Reference Figure 4 In some embodiments, after step S105, the following steps are also included but not limited to steps S201 to S202:

[0073] Step S201: Acquire a preset synchronization period.

[0074] In some embodiments, the total search cycle refers to the number of cycles in the entire data stream mapping search process, that is, the total number of search iterations. The synchronization cycle refers to the number of cycles in which each parallel thread performs synchronization during the search process.

[0075] In some embodiments, the total search period is calculated as follows:

[0076]

[0077] Here, Period represents the total search period, N1, N2, N3, and N4 represent the number of first, second, third, and fourth data stream mapping sets, respectively. N1 × N2 × N3 × N4 is the total number of data stream mappings, and C represents the total number of parallel threads. It should be understood that N1, N2, N3, and N4 are all sets of different data stream mappings generated by data types and dimensional data. In some application scenarios, there may be more or fewer data stream mapping sets, and the formula can be adjusted based on the specific scenario.

[0078] It is understood that the total search period can be obtained by dividing the total number of data flow mappings by the total number of parallel threads, rounding down, and adding 1. It is understood that the synchronization period can be represented by P, and the synchronization period can be greater than or equal to 0 and cannot be greater than the total search period.

[0079] Step S202, execute the periodic data stream mapping search process, the periodic data stream mapping search process includes: in each synchronization cycle, take each parallel thread as the main thread in turn, and take the parallel threads other than the main thread as the secondary threads, and broadcast the target data stream mapping of the main thread; use the energy calculation result corresponding to the main thread as the first energy calculation result, and the energy calculation result corresponding to each secondary thread as the second energy calculation result, compare the first energy calculation result with the second energy calculation result to obtain a comparison result; determine the secondary thread to be updated according to the comparison result; update the target data stream mapping corresponding to the first energy calculation result in the secondary thread to be updated, and obtain the data stream mapping update result of the secondary thread; repeat the periodic data stream mapping search process until the number of repetitions exceeds the total number of parallel threads, and obtain the data stream mapping update result of each parallel thread.

[0080] In some embodiments, within a set synchronization period, each parallel thread will sequentially serve as the main thread and broadcast the search results of its data stream mapping. Other parallel threads except the main thread serve as secondary threads. The secondary threads receive the broadcast from the main thread, obtain the target data stream mapping of the main thread and the first energy calculation result from the broadcast content. Then, compare the first energy calculation result of the main thread with its own energy calculation result, that is, the second energy calculation result, to obtain a comparison result. If the comparison result indicates that the first energy calculation result is greater than the second energy calculation result, it means that the target data stream mapping corresponding to the main thread requires lower energy consumption. Therefore, replace the original target data stream mapping of the corresponding secondary thread with the target data stream mapping of the main thread to improve the efficiency of parallel search. It can be understood that all parallel threads can be sequentially used as the main thread to broadcast their target data stream mappings, which can ensure that the energy calculation results with the lowest consumption of each parallel thread are broadcast to other parallel threads, and other parallel threads determine whether to update their data stream mappings according to the first energy calculation result and the second energy calculation result.

[0081] Exemplarily, if there are 4 parallel threads, namely parallel thread 1, corresponding to data stream mapping 1, with the corresponding energy calculation result A1, parallel thread 2, corresponding to data stream mapping 2, with the corresponding energy calculation result A2, parallel thread 3, corresponding to data stream mapping 3, with the corresponding energy calculation result A3, and parallel thread 4, corresponding to data stream mapping 4, with the corresponding energy calculation result A4, and assume that the energy calculation results are A1 < A2 < A3 < A4. Then, within the set synchronization period, first, parallel thread 1 can be used as the main thread, and parallel threads 2, 3, and 4 can be used as secondary threads. Parallel thread 1 broadcasts data stream mapping 1 and the corresponding energy calculation result A1. After receiving the broadcast content, parallel threads 2, 3, and 4 each compare A1 with A2, A3, and A4. Since the energy calculation results are A1 < A2 < A3 < A4, it can be determined that the threads to be updated are parallel threads 2, 3, and 4. After the update, the data stream mappings of parallel threads 2, 3, and 4 are all data stream mapping 1. It can be understood that after broadcasting parallel thread 1, parallel threads 2, 3, and 4 can be broadcast sequentially, or parallel threads can be randomly selected for broadcasting, as long as each parallel thread has a broadcast opportunity. The specific broadcast method has been exemplified above and will not be elaborated here.

[0082] It can be understood that when the number of synchronization times exceeds the total number of parallel threads, it means that each parallel thread has been synchronized, and at this time, the periodic data stream mapping search process can be stopped. Executing the periodic data stream mapping search process can select the data stream mapping with the best performance and the lowest energy consumption in the current period, thereby improving the performance of the system.

[0083] Reference Figure 5 and Figure 6 , Figure 6 The figure shows different data flow mappings within a data flow mapping set. As can be seen from the figure, different combinations of dimensional data or data types will form different data flow mappings. In some embodiments, the data flow mapping set includes a first data flow mapping set, a second data flow mapping set, a third data flow mapping set, and a fourth data flow mapping set. Based on the data type and dimensional data, a data flow mapping set corresponding to each data type is formed, including but not limited to steps S301 to S304:

[0084] Step S301 : obtaining the number of factorizable pairs according to the dimensional values ​​of each dimensional data, and obtaining a first data stream mapping set according to the dimensional data and the number of factorizable pairs.

[0085] In some embodiments, the first data stream mapping set is composed of different dimensional values ​​and the corresponding calculated number of factorizable pairs. Specifically, the partitioning method of the data stream mapping can be determined based on the numerical value of each dimensional data. If the dimensional value of a certain dimensional data is too large, resulting in the amount of data after partitioning exceeding the storage capacity limit, a secondary partitioning can be performed based on the factorization value of the dimensional data to reduce the amount of partitioned data, thereby obtaining factorization pairs. The different dimensional data and the corresponding factorization pairs are then combined to obtain the first data stream mapping set.

[0086] Step S302 , in each storage level, the dimension data is summarized according to the arrangement of the dimension data within the data type to obtain a second data flow mapping set corresponding to each storage level; wherein the storage level is used to store data of the data type.

[0087] Please refer to Figure 7 , Figure 7 The hardware hierarchy of the SNN accelerator is shown in the figure. The DRAM in the figure refers to the dynamic random access memory (DRAM) in the SNN accelerator hardware architecture; the global buffer is the global buffer in the SNN accelerator hardware architecture; spad refers to the local buffer unit in the SNN accelerator hardware architecture. The above three different storage hierarchies can be used to store data of different data types and dimensions; snn_alu refers to the Arithmetic Logic Unit of the Spiking Neural Network, which is the arithmetic logic unit of the pulse neural network, which is used to perform logical and arithmetic operations. Figure 7It can be seen that different storage levels can store different data types. It is understandable that dividing each data type into blocks according to its dimension can improve the efficiency of data processing.

[0088] In some embodiments, each dimension data may have a different block partitioning method, that is, the dimension data may be stored in the storage hierarchy in different arrangement methods. Different arrangement orders will lead to differences in data flow mapping. Therefore, the different arrangement methods of the dimension data are summarized to obtain a second data flow mapping set.

[0089] Step S303 , summarizing the dimensional data according to the division method on the spatial coordinate axis to obtain a third data stream mapping set; wherein the spatial coordinate axis is generated according to the data array formed by the arithmetic logic unit.

[0090] In some embodiments, the Arithmetic Logic Unit (ALU) is a component that performs arithmetic and logical operations. The ALU can access each data block of the four data types according to the input data type and dimensional order, and perform the calculation process in the order of data access. In order to achieve spatial parallel computing and improve computing performance, the dimensional data can be divided into different blocks, and different blocks can be assigned to different ALUs for calculation. The ALU can be expanded in the X and Y directions of the spatial coordinate axis to achieve parallel calculation of different parts of the data of the same SNN convolution. Different dimensions selected for spatial parallelism will form different data flow mappings. For example, the input feature map of the SNN convolution is a two-dimensional image. By expanding in the X and Y directions, the input feature map can be divided into multiple small blocks and assigned to different ALUs for calculation.

[0091] It is understandable that the same dimensional data may be divided in different ways. By summarizing the different division ways of different dimensional data, a third data stream mapping set may be obtained.

[0092] Step S304 , summarizing the data according to the data type and the storage mode of the divided dimensional data at each storage level to obtain a fourth data flow mapping set.

[0093] It is understood that each storage level has different preset storage rules, which can be system-configured or set by relevant technical personnel. The preset storage rules specify the data types and dimensional data that each storage level should store, as well as the size of the data that each storage level can store. Therefore, based on the data types and dimensional data that each storage level can store as specified by the preset storage rules, different data storage methods can be set, and these different data storage methods can be aggregated to obtain a fourth data flow mapping set.

[0094] Please refer to Figure 8 In some embodiments, the number of factorizable pairs is calculated based on the dimension values ​​of each dimension data, including but not limited to steps S401 to S404:

[0095] Step S401, calculate the square root of the dimension value of each dimension data to obtain the dimension square number.

[0096] In some embodiments, if the dimension data is the number of input pulses and output pulses, and the specific dimension value is 9, the square root of the dimension value of the dimension data is calculated as Then the square number of the dimension is 3. It can be understood that the calculation method of the square root of the dimension values ​​of other dimensional data is the same as that of this embodiment, and will not be described in detail here.

[0097] Step S402, dividing the dimension values ​​by the number of decompositions in sequence to obtain a first dimension decomposition result; wherein the number of decompositions is obtained according to the square number of the dimension.

[0098] In some embodiments, the decomposition times range from 1 to the square of the dimension. Using the above example, if the square of the dimension is 3, the decomposition times are 1, 2, and 3. In some embodiments, the dimension value is divided by the decomposition times, i.e., 9 is divided by 1, 2, and 3, respectively. The first dimensional decomposition results are 9, 4.5, and 3.

[0099] Step S403 : Selecting the first dimension decomposition result and the number of decompositions that are positive integers as the number of dimension factors; wherein the number of each dimension factor is different.

[0100] In some embodiments, the number of decompositions that can be divided evenly and the corresponding first dimension decomposition results are retained, namely 1, 9, 3, 3, and the repeated number of dimension factors, namely 3, is removed, and the number of dimension factors obtained is 1, 9, 3.

[0101] Step S404 , obtaining a second dimensional decomposition result by dividing the dimension value by the number of dimension factors, and forming factorable pairs according to the number of dimension factors and the second dimensional decomposition result; wherein each pair of factorable pairs is different.

[0102] In some embodiments, the second dimensional decomposition result is obtained by dividing the dimension value by the number of dimensional factors, that is, by dividing 9 by 1, 9, and 3 respectively. Factorable pairs are formed based on the number of dimensional factors and the second dimensional decomposition result, that is, the factorable pairs are: 1 and 9, 9 and 1, 3 and 3. Duplicate factorable pairs are removed, that is, one of 1 and 9 is removed, and finally two pairs of factorable pairs are obtained, specifically: 1 and 9, 3 and 3.

[0103] It is understandable that in SNN convolution calculations, the dimensionality of each dimension determines how the dimensional data is divided. When the dimensionality of a certain dimension is too large, causing the amount of data after division to exceed the storage capacity limit, the dimensional data can be divided twice using the number of factorizable pairs to reduce the amount of data to within the storage capacity limit. This adapts to different storage capacity limits, improves storage efficiency, reduces storage resource consumption, and contributes to the computing performance of the accelerator and improves the efficiency of data flow mapping.

[0104] Please refer to Figure 9 In some embodiments, step S302 includes but is not limited to steps S501 to S502:

[0105] Step S501 : In each storage level, the dimension data is interactively arranged within each data type to obtain multiple arrangement modes.

[0106] It is understandable that the dimensional data within the data type can be interactively arranged in each storage level to obtain a variety of arrangements. For example, if the data type includes 10 dimensional data, the original arrangement order is the number of input weight channels C, the length and width of the input feature map H and W, the input / output / membrane potential time step T, the number of input / output N, the length and width of the weight kernel S and R, the number of weights / number of output channels M, the length and width of the output feature map Q and P, then the arrangement order can be changed in the storage level, one of which is the input / output / membrane potential time step T, the length and width of the weight kernel S and R, the length and width of the input feature map H and W, the original arrangement order is the number of input weight channels C, the number of input / output N, the number of weights / number of output channels M, the length and width of the output feature map Q and P, it is understandable that other arrangements refer to the above examples and are not listed here one by one.

[0107] Step S502 : Summarize according to multiple arrangement modes to obtain a second data flow mapping set corresponding to each storage level.

[0108] It is understandable that all arrangement modes should be summarized in each storage level, and each arrangement mode should be used as a subset of the second data stream mapping set, so as to finally obtain the second data stream mapping set corresponding to each storage level.

[0109] It is understandable that different dimensional data orders will lead to differences in data flow mapping, which in turn affects the number of data flow mappings. By adjusting the dimensional data order, the data flow mapping can be optimized and the computing performance can be improved.

[0110] Please refer to Figure 10 In some embodiments, step S303 includes but is not limited to steps S601 to S603:

[0111] Step S601: Generate spatial coordinate axes according to the data array formed by the arithmetic logic unit; wherein the spatial coordinate axes are used to perform parallel calculations according to the dimensional data; the spatial coordinate axes include at least a horizontal coordinate axis and a vertical coordinate axis.

[0112] In some embodiments, the system pre-configures spatial coordinate axes or generates coordinate axes in real time to perform parallel calculations based on dimensional data. The data array is the result obtained after calculation and processing by the arithmetic logic unit. These results can be regarded as coordinate points in a multidimensional space. By connecting these coordinate points, one or more spatial coordinate axes can be formed. It is understandable that the spatial coordinate axis can include a horizontal coordinate axis and a vertical coordinate axis. It can further include multiple coordinate axes for expanding parallel calculations, thereby increasing the speed of calculation and improving the efficiency of data flow mapping search. The specific settings can be made according to actual conditions.

[0113] Step S602 : Divide the dimensional data on the spatial coordinate axis using a plurality of division methods to obtain a plurality of division methods.

[0114] In some embodiments, dimensional data can be divided along the spatial coordinate axis using different partitioning methods to obtain multiple dimensional data blocks, allowing the ALU to perform parallel computations based on the dimensional data blocks to improve computational efficiency. For example, if the number of inputs is 9, the inputs can be divided, such as 4 inputs to the horizontal coordinate axis and 5 inputs to the vertical coordinate axis, and the ALU can perform parallel computations, etc.

[0115] Step S603: Filter and aggregate the partitioning modes that can implement parallel search to form a third data stream mapping set.

[0116] In some embodiments, the partitioning methods that can achieve parallel search after partitioning can be summarized to increase the proportion of feasible data stream mappings and form a third data stream mapping set. Alternatively, without verifying whether parallel search can be achieved, the data after partitioning can be directly summarized to form a third data stream mapping set. For example, if the number of inputs is 9, the number of inputs can be divided, for example, 4 inputs can be divided into the horizontal coordinate axis and 5 inputs can be divided into the vertical coordinate axis, or 2 inputs can be divided into the horizontal coordinate axis and 7 inputs can be divided into the vertical coordinate axis, thereby obtaining two partitioning methods. All partitioning methods are summarized to finally form a third data stream mapping set.

[0117] It can be understood that by expanding in the horizontal and vertical directions of the spatial coordinate axis, parallel calculations can be carried out on different partial dimensional data of the same SNN convolution on multiple ALUs at the same time, thereby improving performance. By selecting different spatial division dimensions to form different data flow mappings, it is convenient to subsequently find the data flow mapping with the lowest energy consumption, thereby improving computing performance.

[0118] Please refer to Figure 11 In some embodiments, step S304 includes but is not limited to steps S701 to S703:

[0119] Step S701 , obtaining preset storage rules preset for each storage level; wherein the preset storage rules record the data types that can be stored in each storage level and the divided dimensional data.

[0120] It can be understood that the preset storage rules record the data types and dimensional data that can be stored in each storage level. The preset storage rules also stipulate the total capacity of data that can be stored in each storage level, thereby avoiding data storage errors to the greatest extent and improving the accuracy and storage speed of data stored in each storage level.

[0121] Step S702 : Based on preset storage rules, the data types and the divided dimension data are stored in each storage level to obtain multiple hierarchical storage methods.

[0122] In some embodiments, data types and divided dimensional data can be stored in each storage layer under the constraints of preset storage rules. It is understood that the different data storage methods, data volumes, and dimensional data types that can be divided into blocks in each storage layer will all affect the energy consumed when accessing data.

[0123] Step S703: Aggregate data according to multiple storage modes to form a fourth data stream mapping set.

[0124] For example, if there are two storage levels, and each storage level specifies the block rules for two data types and two dimension data types, then the number of F4 is 2*2*2 = 8. It is understandable that a fourth data flow mapping set can be formed by aggregating multiple storage methods.

[0125] It can be understood that by dividing the hardware storage into levels, different storage levels can store different data types and dimensional data. Each storage level has its own data flow mapping. By reasonably dividing the storage levels, the data flow mapping can be optimized and the storage and computing efficiency can be improved.

[0126] Please refer to Figure 12In some embodiments, the data stream mapping type includes input pulses and membrane potentials, and the input pulses and membrane potentials have an associated relationship. The method further includes but is not limited to steps S801 to S803:

[0127] Step S801, determining the dimensional data corresponding to the input pulse and the membrane potential based on the association relationship; wherein the dimensional data includes the input data channel dimension or the data weight channel dimension, the weight kernel length dimension and the weight kernel width dimension.

[0128] It can be understood that in the cyclic calculation of dimensional data in the SNN convolution, the calculation of the membrane potential (Membrane Voltage) and the input pulse (Input Spikes) in the N+1th round depends on the calculation results of the input pulse and membrane potential in the Nth round, where N is a positive integer. Therefore, the input pulse and the membrane potential have a correlation, and the complete dimensional data must be included in the cyclic calculation of the dimensional data, that is, the calculation loop of the input data channel dimension or the data weight channel dimension, the weight kernel length dimension and the weight kernel width dimension must be included. This ensures that when calculating the membrane potential and the input pulse in each round, all dimensional data have been calculated and are available. Therefore, it is necessary to remove the first data stream mapping that does not include the input data channel dimension or the data weight channel dimension, the weight kernel length dimension and the weight kernel width dimension from the corresponding data stream mapping set, so as to avoid redundant and non-compliant data stream mappings from continuing to consume computing resources and improve the efficiency of data stream mapping search.

[0129] Step S802, traverse each data stream mapping set, and determine the first data stream mapping from the data stream mapping set that does not include the input data channel dimension or the data weight channel dimension, the weight core length dimension, and the weight core width dimension.

[0130] In some embodiments, each data stream mapping set can be traversed. During the traversal process, it is necessary to determine whether the current data stream mapping meets the conditions, that is, the first data stream mapping that does not include the input data channel dimension or the data weight channel dimension, the weight core length dimension, and the weight core width dimension. This step can be implemented through conditional judgment and looping.

[0131] Step S803: In each data stream mapping set, remove the first data stream mapping.

[0132] It is understandable that in order to ensure that all dimensional data has been calculated and is available, it is necessary to remove the first data stream mapping that does not include the input data channel dimension or the data weight channel dimension, the weight core length dimension, and the weight core width dimension from the corresponding data stream mapping set, thereby reducing memory and computational consumption and improving the accuracy and efficiency of the data stream mapping. Specifically, a program can be written to identify and remove it, or it can be removed manually, and the embodiments of the present application do not impose specific restrictions on this.

[0133] Please refer to Figure 13 ,In some embodiments, the data stream mapping search number includes a first data stream mapping search number and a second data stream mapping search number;

[0134] Step S103 includes but is not limited to steps S901 to S904:

[0135] Step S901: number each parallel thread to obtain a thread number.

[0136] In some embodiments, in order to facilitate the distinction and management of data stream mappings, the data stream mappings in each data stream mapping set can be numbered, and the number is represented by Mid. Specifically, it can be controlled and changed according to different factors to form different data stream mapping sets.

[0137] Exemplarily, if the data stream mapping set includes a first data stream mapping set (F1), a second data stream mapping set (F2), a third data stream mapping set (F3) and a fourth data stream mapping set (F4), the corresponding data stream mapping sets are represented as S(F1), S(F2), S(F3) and S(F4)), the number of S(F1) is set to N1, the number of S(F2) is set to N2, the number of S(F3) is set to N3, and the number of S(F4) is set to N4.

[0138] In some embodiments, each data flow mapping within the data flow mapping set of the overall SNN accelerator hardware may be numbered, with the number being represented by M. id Indicates that M id ∈{M id ,0≤M id ≤N1×N2×N3×N4-1}. The above numbering rule ensures that each data stream mapping number in each data stream mapping set will not be repeated.

[0139] In some embodiments, each parallel thread can be numbered, specifically denoted by Ci, with the first parallel thread denoted as C1, the second parallel thread denoted as C2, and so on. It will be appreciated that numbering the data flow mappings and parallel threads can facilitate distinguishing each data flow mapping and parallel thread, and also facilitates subsequent assignment of a corresponding data flow mapping to each parallel thread for searching.

[0140] Step S902: Obtain the number of data stream mappings in each data stream mapping set, multiply the number of data stream mappings in each data stream mapping set to obtain the overall data stream mapping number, and divide the overall data stream mapping number by the total number of parallel threads to obtain the remainder as a reference remainder.

[0141] The number of data stream mappings for each data stream mapping set can be calculated. For example, if the number of data stream mappings for the first data stream mapping set is N1, the number of data stream mappings for the second data stream mapping set is N2, the number of data stream mappings for the third data stream mapping set is N3, and the number of data stream mappings for the fourth data stream mapping set is N4, then the total number of data stream mappings is N1×N2×N3×N4. The remainder obtained by dividing the total number of parallel threads (represented by C) is used as the reference remainder. The specific formula is:

[0142] Reference remainder = (N1×N2×N3×N4)%C

[0143] Step S903: If the thread number is greater than or equal to the first threshold and less than the reference remainder, divide the overall data stream mapping number by the total number of parallel threads to obtain a first calculation result; take the integer of the first calculation result and add the first value to obtain the first data stream mapping search number.

[0144] In some embodiments, the first threshold value may be 0 or other values. Specifically, the calculation formula of the first data stream mapping search number X1 is as follows:

[0145]

[0146] Wherein, N1 is the number of data stream mappings in the first data stream mapping set, N2 is the number of data stream mappings in the second data stream mapping set, N3 is the number of data stream mappings in the third data stream mapping set, N4 is the number of data stream mappings in the fourth data stream mapping set, C is the total number of parallel threads, and Ci is the specific parallel thread number. In some embodiments, if the thread number (Ci) is greater than or equal to 0 and less than a reference remainder, the total number of data stream mappings (N1×N2×N3×N4) is divided by the total number of parallel threads (C) to obtain a first calculation result; the first calculation result is rounded down to an integer (e.g., 4.52 is rounded to 4) and then added to the first value (e.g., 1) to obtain the first data stream mapping search number.

[0147] Step S904: If the thread number is greater than or equal to the reference remainder, the overall data stream mapping number is divided by the total number of parallel threads to obtain a second calculation result; after rounding the second calculation result to an integer, a second data stream mapping search number is obtained.

[0148] Specifically, the calculation formula of the second data stream mapping search number X2 is as follows:

[0149] Ci≥(N1×N2×N3×N4)%C

[0150] Where N1 is the number of data stream mappings in the first data stream mapping set, N2 is the number of data stream mappings in the second data stream mapping set, N3 is the number of data stream mappings in the third data stream mapping set, N4 is the number of data stream mappings in the fourth data stream mapping set, C is the total number of parallel threads, and Ci is the specific parallel thread number.

[0151] If the thread number Ci is greater than or equal to the reference remainder, divide the overall data stream mapping number (N1×N2×N3×N4) by the total number of parallel threads (C) to obtain the second calculation result; after rounding down the second calculation result, obtain the second data stream mapping search number.

[0152] As can be seen from the above formula, the first and second data stream mapping search numbers are primarily determined by the parallel thread number; different parallel numbers may correspond to different data stream mapping search numbers. After each parallel thread is assigned the first or second data stream mapping search number, the parallel search is initiated and the assigned data stream mappings are screened to improve data stream mapping search efficiency.

[0153] It is understandable that by dividing the overall data flow mapping number by the total number of parallel threads, the search number of each parallel thread can be divided as evenly as possible to ensure that the search task time loss of each thread does not differ too much, thereby reducing the overall search time.

[0154] It is understandable that in order to distribute the search tasks as evenly as possible and ensure that the time loss for each thread to complete the search task is not too different, this application adopts a rounding-down strategy so that the target data stream mapping search numbers of all threads differ by at most 1.

[0155] Please refer to Figure 14 In some embodiments, step S104 includes but is not limited to steps S1001 to S1004:

[0156] Step S1001: According to data flow mapping, the data type stored in each storage level is obtained.

[0157] In some embodiments, the data type stored in each storage level can be obtained from different data flow mappings. For example, storage level 1 only allows the storage of input pulses, membrane potentials, and weights, storage level 2 only allows the storage of weights, membrane potentials, and output pulses, and so on.

[0158] Step S1002, obtain the preset storage rules corresponding to each storage level. If the preset storage rules indicate that the storage level prohibits the storage of the data type corresponding to the data flow mapping, the data flow mapping is screened out; if the preset storage rules indicate that the storage level allows the storage of the data type corresponding to the data flow mapping, the data flow mapping is retained as the first candidate data flow mapping.

[0159] In some embodiments, the preset storage rules are rules that specify the data types that can be stored at each storage tier, or rules that set a preset data volume threshold for each storage tier. The preset storage rules can be rule instructions pre-set based on parameter configuration, or they can be manually written and adjusted constraints.

[0160] It is understood that if the preset storage rules indicate that a certain storage tier prohibits the storage of the data type corresponding to the data flow mapping, or if the data flow mapping includes a data type prohibited by the storage tier, then the data flow mapping needs to be screened out and not stored. If the preset storage rules indicate that a certain storage tier allows the storage of the data type corresponding to the data flow mapping, then these data flow mappings are retained as the first candidate data flow mappings, thereby ensuring that the data flow mappings meet the requirements of each storage tier, effectively optimizing the utilization of storage resources, and improving storage efficiency and performance.

[0161] For example, if the preset storage rule indicates that data type A is prohibited from being stored in storage level 1, data flow mapping A corresponding to data type A is discarded, and a new data flow mapping is obtained. If the preset storage rule indicates that candidate data flow mapping B can be stored in storage level 1, then data flow mapping B has passed the initial screening, and data flow mapping B is retained as the first candidate data flow mapping.

[0162] Step S1003: Calculate the first data volume of the first candidate data stream mapping according to the dimensional data of the first candidate data stream mapping.

[0163] In some embodiments, the dimensional data of each first candidate data stream mapping can be obtained, and the first data volume of each dimensional data can be calculated based on the dimensional data. For example, if the dimensional data of the first candidate data stream mapping is: input data channel dimension or data weight channel dimension C = 3, the height of the feature map of the input pulse H = 32, the width of the feature map of the input pulse W = 32, in each time step, the number of input pulses, output pulses and membrane potentials T = 10, and the number of input pulses and output pulses N = 64, then the first data volume is C×H×W×T×N, that is, 3x32x32x10x64.

[0164] In step S1004, the first data volume is compared with the preset data volume threshold of each storage layer. If the first data volume is greater than the preset data volume threshold, the first candidate data stream mapping is screened out; if the first data volume is less than the preset data volume threshold, the first candidate data stream mapping is retained, and multiple candidate data stream mappings are obtained.

[0165] In some embodiments, if the data volume of a candidate data stream mapping exceeds the preset data capacity of the storage hierarchy, the corresponding data stream mapping cannot be implemented during the actual SNN computation and training process, which may result in a storage overflow and, in turn, terminate the SNN computation and training process. Therefore, candidate data stream mappings with data volumes exceeding the preset data capacity are discarded. It is understood that each parallel thread can have multiple candidate data stream mappings or a single candidate data stream mapping.

[0166] If the amount of data is less than or equal to the preset data capacity of the storage hierarchy, it means that the storage capacity of the candidate data stream mapping will not burden the storage hierarchy. Therefore, the corresponding candidate data stream mapping can be stored as a data stream mapping in the corresponding storage hierarchy, thereby improving the processing efficiency of the system and ensuring the normal operation of the system.

[0167] Please refer to Figure 15 In some embodiments, in each parallel thread, energy calculation is performed on the multiple data flow mappings that are searched to obtain energy calculation results, including but not limited to steps S1101 to S1103:

[0168] Step S1101 , obtaining the unit computation energy of the arithmetic logic unit and the unit access energy of each storage level.

[0169] It is understandable that the unit computing energy of the arithmetic logic unit and the unit access energy of each storage level are pre-configured parameters, and can also be calculated through actual energy consumption measurement and statistical analysis, modeling and estimation based on energy consumption models, etc.

[0170] Step S1102 : For each candidate data flow mapping, the number of calculations of the arithmetic logic unit and the number of accesses of the candidate data flow mapping in each storage hierarchy are calculated.

[0171] In some embodiments, for each candidate data stream mapping, since the storage order of the dimensional data, the dimensional numerical size of the dimensional data, the storage hierarchy, the spatial partitioning, etc. are all different, the computational complexity is also different. The computational complexity of the corresponding candidate data stream mapping can be evaluated by accumulating the number of calculations of the arithmetic logic unit. At the same time, it is also necessary to count the number of times the candidate data stream mapping is stored in each storage hierarchy. By accumulating the number of calculations of the arithmetic logic unit and the number of accesses to the candidate data stream mapping in the storage hierarchy, the energy calculation results are calculated, and the energy consumption of each candidate data stream mapping can be comprehensively evaluated.

[0172] It is understandable that static analysis can be performed on the running code to analyze the transmission of data flow mapping in each storage level, count the number of accesses to each storage level, or insert monitoring code into the access process of data types to record the transmission of data flow mapping in each storage level, and then count the number of accesses to each storage level, etc. The embodiments of the present application do not impose specific restrictions on this.

[0173] Step S1103: obtain a first energy value by multiplying the unit calculation energy by the number of calculations, obtain a second energy value by multiplying the unit access energy by the number of accesses, and obtain an energy calculation result by adding the first energy value to the second energy value.

[0174] In some embodiments, a first energy value can be obtained by multiplying the unit computing energy of the cumulative arithmetic logic unit by the number of calculations, and a second energy value can be obtained by multiplying the number of accesses of the candidate data stream mapping in the storage hierarchy by the unit access energy. The first energy value and the second energy value are added together to comprehensively evaluate the energy consumed by each candidate data stream mapping, thereby increasing the accuracy of the screening results.

[0175] In some embodiments, other technical solutions can be used to calculate energy consumption estimates. For example, simulation tools can be used to model and simulate the hardware architecture, and based on specific computing operations and data access patterns, energy consumption estimates can be calculated through simulation. Furthermore, energy consumption estimates can be calculated based on reasoning and estimation based on energy consumption models, based on hardware architecture characteristics and data flow mapping.

[0176] It can be understood that by comparing the energy consumption estimates of different data flow mappings, the data flow mapping with the lowest energy consumption can be selected as the current optimal data flow mapping. That is to say, selecting a data flow mapping that can reduce energy consumption in SNN convolution calculations and improve energy efficiency and performance is of great significance for training large-scale data.

[0177] See also Figure 16The present application also provides a data flow mapping search system that can implement the above-mentioned data flow mapping search method. The data flow mapping search system includes:

[0178] The data flow mapping set acquisition module 1601 is configured to acquire data types and multiple dimensional data corresponding to the data types from the spiking neural network convolution process, and form multiple data flow mapping sets based on the data types and dimensional data; wherein each data flow mapping set includes multiple data flow mappings;

[0179] A parallel thread creation module 1602 is configured to obtain the number of cluster nodes used for simulation in the data cluster and the number of processor cores of each cluster node, determine the total number of parallel threads in the data cluster based on the product of the number of cluster nodes and the number of processor cores, and create parallel threads based on the total number of parallel threads;

[0180] The data flow mapping search number acquisition module 1603 is used to calculate the data flow mapping search number of each parallel thread according to the data flow mapping set and the total number of parallel threads;

[0181] The candidate data flow mapping acquisition module 1604 is configured to allocate a corresponding number of data flow mappings to each parallel thread according to the number of data flow mapping searches, and to screen the data flow mappings according to the preset storage rules of each storage layer to obtain multiple candidate data flow mappings;

[0182] The target data flow mapping acquisition module 1605 is used to perform energy calculation on each candidate data flow mapping in each parallel thread to obtain an energy calculation result, and compare each energy calculation result with the historical energy calculation result. If the energy calculation result is lower than the historical energy calculation result, the candidate data flow mapping corresponding to the energy calculation result is used as the target data flow mapping.

[0183] The specific implementation of the data flow mapping search system is basically the same as the specific embodiment of the data flow mapping search method described above, and will not be repeated here. Under the premise of meeting the requirements of the embodiment of this application, the data flow mapping search system can also be provided with other functional modules to implement the data flow mapping search method in the above embodiment.

[0184] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-described data stream mapping search method when executing the computer program. The electronic device can be any smart terminal, such as a tablet computer or an in-vehicle computer.

[0185] See also Figure 17 , Figure 17 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0186] The processor 1701 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0187] The memory 1702 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1702 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1702, and the processor 1701 calls and executes the data stream mapping search method of the embodiments of this application;

[0188] Input / output interface 1703, used to implement information input and output;

[0189] Communication interface 1704, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0190] Bus 1705 , which transmits information between various components of the device (e.g., processor 1701 , memory 1702 , input / output interface 1703 , and communication interface 1704 );

[0191] The processor 1701 , the memory 1702 , the input / output interface 1703 and the communication interface 1704 are connected to each other in communication within the device via a bus 1705 .

[0192] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned data stream mapping search method is implemented.

[0193] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0194] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0195] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0196] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0197] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0198] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0199] It should be understood that in this application, "at least one (item)" and "several" refer to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0200] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0201] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0202] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0203] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0204] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A data flow mapping search method, characterized in that: The method comprises: Acquire a data type and a plurality of dimensional data divided according to the data type from a spiking neural network convolution process, and form a plurality of data stream mapping sets based on the data type and the dimensional data; wherein each of the data stream mapping sets includes a plurality of data stream mappings; Obtaining the number of cluster nodes used for simulation in the data cluster and the number of processor cores of each cluster node, determining the total number of parallel threads of the data cluster according to the product of the number of cluster nodes and the number of processor cores, and creating parallel threads according to the total number of parallel threads; Calculating according to the data stream mapping set and the total number of parallel threads to obtain the data stream mapping search number of each parallel thread; Allocating a corresponding number of the data stream mappings to each of the parallel threads according to the data stream mapping search number, and screening the data stream mappings according to a preset storage rule of each storage level to obtain a plurality of candidate data stream mappings; In each of the parallel threads, energy calculation is performed on each of the candidate data flow mappings to obtain an energy calculation result, and each of the energy calculation results is compared with a historical energy calculation result. If the energy calculation result is lower than the historical energy calculation result, the candidate data flow mapping corresponding to the energy calculation result is used as the target data flow mapping.

2. The data flow mapping search method according to claim 1, characterized in that: After mapping the data stream corresponding to the energy calculation result as the target data stream mapping, the method further includes: Get the preset synchronization period; Execute a periodic data stream mapping search process, the periodic data stream mapping search process includes: in each of the synchronization cycles, take each of the parallel threads as the main thread in turn, and take the parallel threads other than the main thread as the secondary threads, and broadcast the target data stream mapping of the main thread; use the energy calculation result corresponding to the main thread as the first energy calculation result, and the energy calculation result corresponding to each of the secondary threads as the second energy calculation result, compare the first energy calculation result with the second energy calculation result to obtain a comparison result; determine the secondary thread to be updated according to the comparison result; update the target data stream mapping corresponding to the first energy calculation result in the secondary thread to be updated, and obtain the data stream mapping update result of the secondary thread; repeat the periodic data stream mapping search process until the number of repetitions exceeds the total number of parallel threads, and obtain the data stream mapping update result of each parallel thread.

3. The data flow mapping search method according to claim 1, characterized in that: The data stream mapping set includes a first data stream mapping set, a second data stream mapping set, a third data stream mapping set and a fourth data stream mapping set; The forming of multiple data stream mapping sets according to the data type and the dimensional data includes: Calculating the number of factorizable pairs according to the dimension values ​​of each of the dimensional data, and obtaining a first data stream mapping set according to the dimensional data and the number of factorizable pairs; In each storage level, the dimensional data is aggregated according to the arrangement of the dimensional data within the data type to obtain a second data flow mapping set corresponding to each storage level; wherein the storage level is used to store data of the data type; Summarizing the division of the dimensional data on the spatial coordinate axis to obtain a third data stream mapping set; wherein the spatial coordinate axis is generated according to the data array formed by the arithmetic logic unit; The fourth data stream mapping set is obtained by summarizing the data types and the storage manner of the divided dimensional data at each storage level.

4. The data flow mapping search method according to claim 3, characterized in that: The step of calculating the factorizable pairwise quantity based on the dimension values ​​of each dimension data includes: Calculating the square root of the dimension value of each dimension data to obtain the dimension square number; Dividing the dimension values ​​by the number of decompositions in sequence to obtain a first dimension decomposition result; wherein the number of decompositions is obtained according to the square number of the dimension; Selecting the first dimensional decomposition result and the decomposition times, which are positive integers, as the number of dimensional factors; wherein each of the dimensional factors is different; A second dimensional decomposition result is obtained by dividing the dimensional value by the number of dimensional factors, and factorizable pairs are formed according to the number of dimensional factors and the second dimensional decomposition result; wherein each pair of the factorizable pairs is different.

5. The data flow mapping search method according to claim 3, characterized in that: In each storage level, the second data flow mapping set corresponding to each storage level is obtained by aggregating the dimensional data according to the arrangement of the dimensional data within the data type, including: In each storage level, the dimension data is interactively arranged within each data type to obtain multiple arrangements; A second data stream mapping set corresponding to each storage level is obtained by summarizing the plurality of arrangement modes.

6. The data flow mapping search method according to claim 3, characterized in that: The third data stream mapping set is obtained by summarizing the division method of the dimensional data on the spatial coordinate axis, including: Generate spatial coordinate axes according to the data array formed by the arithmetic logic unit; wherein the spatial coordinate axes are used to perform parallel calculations according to the dimensional data; the spatial coordinate axes include at least a horizontal coordinate axis and a vertical coordinate axis; On the spatial coordinate axis, the dimensional data is divided by multiple division methods to obtain multiple division methods; The partitioning modes that can implement parallel search are screened and summarized to form a third data stream mapping set.

7. The data flow mapping search method according to claim 3, characterized in that: The fourth data flow mapping set is obtained by aggregating the storage modes of the data types and the divided dimensional data at each storage level, including: Obtaining a preset storage rule preset for each storage level; wherein the preset storage rule records the data type that can be stored in each storage level and the divided dimensional data; Based on the preset storage rules, the data type and the divided dimension data are stored in each storage level to obtain multiple hierarchical storage modes; A fourth data stream mapping set is formed by summarizing the plurality of storage modes.

8. The data flow mapping search method according to claim 1, characterized in that: The data stream mapping type includes input pulses and membrane potentials, and the input pulses and the membrane potentials have an associated relationship; the method further includes: Determining dimensional data corresponding to the input pulse and the membrane potential according to the association relationship; wherein the dimensional data includes an input data channel dimension or a data weight channel dimension, a weight kernel length dimension, and a weight kernel width dimension; Traversing each of the data stream mapping sets, and determining a first data stream mapping from the data stream mapping set that does not include an input data channel dimension or a data weight channel dimension, a weight core length dimension, and a weight core width dimension; In each of the data stream mapping sets, the first data stream mapping is eliminated.

9. The data flow mapping search method according to claim 1, characterized in that: The data stream mapping search number includes a first data stream mapping search number and a second data stream mapping search number; The calculating according to the data stream mapping set and the total number of parallel threads to obtain the data stream mapping search number of each parallel thread includes: Numbering each of the parallel threads to obtain a thread number; Obtaining the number of data stream mappings in each of the data stream mapping sets, multiplying the numbers of data stream mappings in each of the data stream mapping sets to obtain an overall number of data stream mappings, and dividing the overall number of data stream mappings by the total number of parallel threads to obtain a remainder as a reference remainder; If the thread number is greater than or equal to the first threshold and less than the reference remainder, dividing the overall data stream mapping number by the total number of parallel threads to obtain a first calculation result; taking an integer of the first calculation result and adding the first value to obtain a first data stream mapping search number; If the thread number is greater than or equal to the reference remainder, the overall data stream mapping number is divided by the total number of parallel threads to obtain a second calculation result; after taking an integer for the second calculation result, a second data stream mapping search number is obtained.

10. The data flow mapping search method according to claim 1, characterized in that: The data stream mapping is screened according to the preset storage rules of each storage level to obtain multiple candidate data stream mappings, including: According to the data flow mapping, the data type stored corresponding to each storage level is obtained; Obtaining a preset storage rule corresponding to each storage level, and if the preset storage rule indicates that the storage level prohibits storage of the data type corresponding to the data flow mapping, filtering out the data flow mapping; if the preset storage rule indicates that the storage level allows storage of the data type corresponding to the data flow mapping, retaining the data flow mapping as a first candidate data flow mapping; Calculating a first data volume of the first candidate data stream mapping according to the dimensional data of the first candidate data stream mapping; A comparison is performed based on the first data volume and the preset data volume threshold of each storage level. If the first data volume is greater than the preset data volume threshold, the first candidate data stream mapping is screened out; if the first data volume is less than the preset data volume threshold, the first candidate data stream mapping is retained, thereby obtaining multiple candidate data stream mappings.

11. The data flow mapping search method according to claim 1, characterized in that: The step of performing energy calculation on each candidate data flow mapping in each parallel thread to obtain an energy calculation result includes: Obtaining a unit computation energy of an arithmetic logic unit and a unit access energy of each of the storage levels; For each of the candidate data flow mappings, calculating the number of calculations of the arithmetic logic unit and the number of accesses of the candidate data flow mapping at each of the storage hierarchies; A first energy value is obtained by multiplying the unit calculation energy by the number of calculations, a second energy value is obtained by multiplying the unit access energy by the number of accesses, and an energy calculation result is obtained by adding the first energy value to the second energy value.

12. A data flow mapping search system, characterized in that: The system comprises: a data flow mapping set acquisition module, configured to acquire a data type and a plurality of dimensional data divided according to the data type from a spiking neural network convolution process, and form a plurality of data flow mapping sets based on the data type and the dimensional data; wherein each data flow mapping set includes a plurality of data flow mappings; A parallel thread creation module is used to obtain the number of cluster nodes used for simulation in the data cluster and the number of processor cores of each cluster node, determine the total number of parallel threads of the data cluster based on the product of the number of cluster nodes and the number of processor cores, and create parallel threads based on the total number of parallel threads; A data stream mapping search number acquisition module is used to calculate the data stream mapping search number of each parallel thread according to the data stream mapping set and the total number of parallel threads; a candidate data flow mapping acquisition module, configured to allocate a corresponding number of the data flow mappings to each of the parallel threads according to the data flow mapping search number, and screen the data flow mappings according to the preset storage rules of each storage level to obtain a plurality of candidate data flow mappings; The target data flow mapping acquisition module is used to perform energy calculation on each candidate data flow mapping in each parallel thread to obtain an energy calculation result, and compare each energy calculation result with a historical energy calculation result. If the energy calculation result is lower than the historical energy calculation result, the candidate data flow mapping corresponding to the energy calculation result is used as the target data flow mapping.

13. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the data flow mapping search method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data flow mapping search method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Data flow diagram mapping method and device

    CN107402745A

  • Method to Map Convolutional Layers of Deep Neural Network on a Plurality of Processing Elements with SIMD Execution Units, Private Memories, and Connected as a 2D Systolic Processor Array

    US20200134105A1