Data processing method, processing core, many-core system, and computer-readable medium
By adopting the weight data format in the pulsed neural network, including the index part and the weight part, the storage of the weight value between the neurons is optimized, the problem of weight value occupying too much storage resources is solved, and the computing rate of the processor is improved.
Patent Information
- Application Number
- CN202210468773.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-04-29
AI Technical Summary
In pulsed neural networks, the connection weight value of neurons occupies too much on-chip storage resources, especially when neurons are sparsely distributed, resulting in a decrease in on-chip storage utilization.
The weight data format is adopted, including the index part and the weight part. The index part represents the neurons corresponding to the non-zero connection weight value. The weight part contains the non-zero connection weight value, and optimizes the storage method to improve on-chip storage efficiency.
By optimizing the storage format, the utilization efficiency of on-chip storage is improved and the computing speed of the processor is improved.
Smart Images

Figure CN114861894B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, a processing core, a many-core system, and a computer-readable medium. Background Art
[0002] Spiking neural networks (SNNs) are considered the third generation of neural networks, aiming to bridge the gap between neuroscience and machine learning. They use a model that best reflects the mechanisms of biological neurons to perform computations. In a spiking neural network, weights are used to represent the strength of the connection between two neurons. The neuron's membrane potential is calculated based on these weights to determine whether to fire a spike.
[0003] In some related technologies, a large number of weights will occupy too many resources. Summary of the Invention
[0004] The present disclosure provides a data processing method, a processing core, a many-core system, and a computer-readable medium.
[0005] In a first aspect, the present disclosure provides a data processing method, comprising:
[0006] determining, based on at least one weight data, a connection weight value between at least one target neuron and at least one first neuron, wherein the target neuron is one of at least one second neuron, and the first neuron is a predecessor neuron of the second neuron; the weight data of any neuron includes an index portion and a weight portion, wherein the weight portion includes non-zero connection weight values between the neuron and at least one predecessor neuron or at least one successor neuron of the neuron, and the index portion represents the predecessor neuron or successor neuron of the neuron corresponding to each non-zero connection weight value in the weight portion;
[0007] The membrane potential of each target neuron is calculated according to the connection weight value between the at least one target neuron and the at least one first neuron.
[0008] In some embodiments, the weight data is weight data of the first neuron, the weight portion of the weight data includes non-zero connection weight values between the first neuron and each of the second neurons; the index portion includes an identification sequence composed of identification information of each of the second neurons in a first predetermined order, the identification information indicating whether the connection weight value between the corresponding second neuron and the first neuron is a non-zero weight value; the non-zero connection weight values in the weight portion of the weight data correspond one-to-one to the identification information indicating the non-zero connection weight values in the identification sequence of the weight data; and the step of determining the connection weight value between at least one target neuron and at least one first neuron based on at least one weight data includes:
[0009] determining, according to an identification sequence in the weight data of at least one of the first neurons, a second neuron having a connection weight value with at least one of the first neurons that is non-zero, as the target neuron;
[0010] The connection weight value between the target neuron and the first neuron is determined according to the correspondence between the non-zero connection weight value in the weight part of the weight data and the identification information representing the non-zero connection weight value in the identification sequence of the weight data.
[0011] In some embodiments, the step of determining, based on an identification sequence in weight data of at least one of the first neurons, a second neuron having a non-zero connection weight value with the at least one of the first neurons as the target neuron comprises:
[0012] determining a target predecessor neuron corresponding to a target time interval based on first firing information of each of the first neurons in each time interval, wherein the first firing information indicates whether each of the first neurons fired in each time interval, and the target predecessor neuron is the first neuron that fired in the target time interval;
[0013] According to the identification sequence in the weight data of at least one of the target predecessor neurons, a second neuron having a non-zero connection weight value with at least one of the target predecessor neurons is determined as the target neuron.
[0014] In some embodiments, the step of calculating the membrane potential of each target neuron according to the connection weight value between the at least one target neuron and the at least one first neuron includes:
[0015] Determining target weight data for the target neuron based on the connection weight values between the target neuron and each of the fired first neurons, wherein the target weight data includes a target index portion and a target weight portion, the target weight portion including a non-zero connection weight value between the target neuron and each of the fired first neurons; the target index portion includes a target identification sequence composed of target identification information of each of the first neurons in a second predetermined order, the target identification information indicating whether the corresponding first neuron is fired and whether the connection weight value between the corresponding first neuron and the target neuron is a non-zero weight value;
[0016] The membrane potential of the target neuron is calculated according to the target weight data.
[0017] In some embodiments, the second neuron is a neuron corresponding to a current processing core, wherein the many-core system includes multiple processing cores, and each processing core corresponds to at least one neuron of a neural network; the weight data is weight data of the first neuron, and the weight portion of the weight data includes non-zero connection weight values between the first neuron and each of the second neurons; before the step of determining the connection weight value between at least one target neuron and at least one first neuron based on the at least one weight data, the data processing method further includes:
[0018] Weight data of the at least one first neuron is received.
[0019] In some embodiments, after the step of calculating the membrane potential of each target neuron based on the connection weight value between the at least one target neuron and the at least one first neuron, the data processing method further includes:
[0020] When the membrane potential of any one of the target neurons is greater than the emission threshold, the weight data of the target neuron is emitted.
[0021] In some embodiments, the second neuron is a neuron corresponding to a current processing core, wherein the many-core system includes multiple processing cores, and each processing core corresponds to at least one neuron of a neural network; the weight data is weight data of the second neuron, and a weight portion of the weight data includes non-zero connection weight values between the second neuron and each of the first neurons; before determining the connection weight value between at least one target neuron and at least one first neuron based on the at least one weight data, the data processing method further includes:
[0022] In response to the at least one first neuron firing, weight data of the at least one target neuron is obtained from off-chip storage of the many-core system.
[0023] In some embodiments, the on-chip storage of the current processing core stores index information of the weight data of each second neuron in the off-chip storage; and the step of obtaining the weight data of the at least one target neuron from the off-chip storage of the many-core system includes:
[0024] The weight data of the at least one target neuron is obtained from the off-chip storage of the many-core system according to the index information.
[0025] In some embodiments, after the step of calculating the membrane potential of each target neuron based on the connection weight value between the at least one target neuron and the at least one first neuron, the data processing method further includes:
[0026] When the membrane potential of at least one of the target neurons is greater than the firing threshold, second firing information is emitted, where the second firing information represents information of at least one of the target neurons whose membrane potential is greater than the firing threshold.
[0027] In some embodiments, for any one of the target neurons, the step of calculating the membrane potential of each of the target neurons based on the connection weight value between the at least one target neuron and the at least one first neuron includes:
[0028] The membrane potential of the target neuron is calculated according to the historical membrane potential of the target neuron and the connection weight value between the target neuron and the at least one first neuron.
[0029] In a second aspect, an embodiment of the present disclosure provides a processing core, including a computing unit and a cache;
[0030] The computing unit can implement any one of the data processing methods described in the first aspect of the embodiments of this disclosure.
[0031] In a third aspect, an embodiment of the present disclosure provides a many-core system, including:
[0032] multiple processing cores; and
[0033] an on-chip network configured to exchange data between the plurality of processing cores and external data;
[0034] One or more instructions are stored in one or more of the processing cores, and one or more of the instructions are executed by one or more of the processing cores, so that one or more of the processing cores can implement any one of the data processing methods described in the first aspect of the embodiment of the present disclosure.
[0035] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processing core, implements any one of the data processing methods described in the first aspect of the embodiment of the present disclosure.
[0036] The data processing method provided by the embodiment of the present disclosure is capable of processing the weight data of neurons in a neural network. The format of the weight data satisfies the following requirements: it includes an index part and a weight part. The weight part includes the non-zero connection weight value between the neuron and at least one predecessor neuron or at least one successor neuron of the neuron. The index part represents the predecessor neuron or successor neuron of the neuron corresponding to each non-zero connection weight value in the weight part. This helps to realize the storage of the connection weight values between neurons in the neural network based on the format of the above-mentioned weight data, and is conducive to optimizing the storage of the connection weight values. In particular, in a processor that distinguishes between on-chip storage and off-chip storage, it is conducive to improving the utilization efficiency of on-chip storage and increasing the computing speed of the processor.
[0037] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings. In the accompanying drawings:
[0039] Figure 1 is a flow chart of a data processing method according to an embodiment of the present disclosure;
[0040] Figure 2 is a schematic diagram of the connection relationship of some neurons in an embodiment of the present disclosure;
[0041] Figure 3 is a schematic diagram of a neuromorphic chip according to an embodiment of the present disclosure;
[0042] Figure 4 is a schematic diagram of a correspondence between neurons and processing cores in an embodiment of the present disclosure;
[0043] Figure 5 is a schematic diagram of a processing core of a neuromorphic chip according to an embodiment of the present disclosure;
[0044] Figure 6 This is a schematic diagram of a format of weight data in an embodiment of the present disclosure;
[0045] Figure 7 is a flowchart of some steps in another data processing method in an embodiment of the present disclosure;
[0046] Figure 8This is another format diagram of weight data in an embodiment of the present disclosure;
[0047] Figure 9 is a flowchart of some steps in another data processing method in an embodiment of the present disclosure;
[0048] Figure 10 A schematic diagram of performing neural network operations according to a time axis in an embodiment of the present disclosure;
[0049] Figure 11 A schematic diagram of performing neural network operations according to a time axis in an embodiment of the present disclosure;
[0050] Figure 12 is a flowchart of some steps in another data processing method in an embodiment of the present disclosure;
[0051] Figure 13 is a schematic diagram of an implementation method for determining target weight data in an embodiment of the present disclosure;
[0052] Figure 14 is a flowchart of some steps in another data processing method in an embodiment of the present disclosure;
[0053] Figure 15 is a flowchart of some steps in another data processing method in an embodiment of the present disclosure;
[0054] Figure 16 is a block diagram of a processing core in an embodiment of the present disclosure;
[0055] Figure 17 This is a block diagram of a many-core system in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0056] To enable those skilled in the art to better understand the technical solutions of the present disclosure, exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0057] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0058] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0059] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. Similar words such as "connected" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0060] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.
[0061] The inventors of the present disclosure have discovered that in some related technologies, when a spiking neural network is run using a processor with on-chip storage, the connection weight values of all neurons are usually stored in the on-chip storage. The connection weight values are usually integer (int) 8 or half-precision floating-point (fp, floating-point) 16, which are usually of high precision and will occupy too many on-chip storage resources. In particular, when the neurons of the spiking neural network are sparsely emitted, the utilization rate of the on-chip storage will drop sharply. Among them, sparse neuron emission means that the frequency of neuron emission is low.
[0062] In view of this, the embodiment of the present disclosure proposes a format for storing weight data of connection weight values between neurons, and, as a first aspect of the embodiment of the present disclosure, referring to Figure 1 , a data processing method capable of processing weight data in this format is proposed, including:
[0063] In step S100, a connection weight value between at least one target neuron and at least one first neuron is determined based on at least one weight data, wherein the target neuron is one of at least one second neuron, and the first neuron is a predecessor neuron of the second neuron; the weight data of any neuron includes an index part and a weight part, wherein the weight part includes a non-zero connection weight value between the neuron and at least one predecessor neuron or at least one successor neuron of the neuron, and the index part represents the predecessor neuron or successor neuron of the neuron corresponding to each non-zero connection weight value in the weight part;
[0064] In step S200 , the membrane potential of each target neuron is calculated based on the connection weight value between the at least one target neuron and the at least one first neuron.
[0065] Figure 2 Schematic diagram of the connection relationship of some neurons in the embodiment of the present disclosure. Figure 2 As shown, neurons A1, A2, and A3 are the first neurons, and neurons C1, C2, C3, and C4 are the second neurons. Neurons A1, A2, and A3 are fully connected to neurons C1, C2, C3, and C4. For neuron C1, neurons A1, A2, and A3 are its predecessors; for neuron A1, neurons C1, C2, C3, and C4 are its successors. The predecessor and successor relationships of other neurons can be derived similarly.
[0066] In some embodiments, a neural network is run on a neuromorphic chip. In some embodiments, the neuromorphic chip is a many-core system. Figure 3 As shown, the neuromorphic chip includes a plurality of processing cores 10. Each processing core has independent computing power and on-chip storage. In the embodiment of the present disclosure, each processing core corresponds to at least one neuron. In addition, the many-core system also includes off-chip storage, and the weight data of the neuron can be stored in the on-chip storage of the corresponding processing core, or in the off-chip storage of the many-core system. Weight data can be transferred between the on-chip storage and off-chip storage of the processing core. For example, the processing core can read the weight data in its on-chip storage and write it to the off-chip storage, or read the weight data in the off-chip storage and write it to its off-chip storage; the processing core can also read the weight data from its on-chip storage or off-chip storage and transfer it to other processing cores.
[0067] like Figure 4 As shown, neurons A1, A2, A3, and A4 correspond to processing core 1, neurons C1, C2, C3, and C4 correspond to processing core 2, and neurons B1, B2, and B3 correspond to processing core 3.
[0068] To further illustrate the correspondence between neurons and neuropsychology chips in the embodiments of the present disclosure, Figure 5 for Figure 3 A schematic diagram of the structure of a processing core. Figure 5As shown, each processing core typically includes a group (or multiple) of neurons, a group of axons, a group of dendrites, and a synaptic array, which can simulate the behavior of a biological neuron cluster. Each processing core in a neuromorphic chip can complete the dendrite integral calculation process and cell body operation process for the corresponding group of neurons. Among them, dendrites are structures used to receive external stimuli and generate input current, axons are structures used to transmit impulses to the synapses of subsequent neurons, and synapses are structures used to connect neurons. The synaptic array is an array of synapses that connects a group of axons and a group of dendrites.
[0069] For each neuron in the processing core, the dendrite integral calculation process is used to describe the process of integrating the pulse data of all input axons connected to the dendrites of the neuron. The dendrite integral calculation process is also referred to as the membrane potential integral operation in the embodiment of the present disclosure. The cell body operation process is responsible for updating the membrane potential of the neuron and judging the release of pulses. The cell body operation process is also referred to as the release operation in the embodiment of the present disclosure. If the membrane potential of any neuron meets the release condition, the axon of the neuron will release a pulse represented by 1 to the successor neuron connected to the neuron; otherwise, the axon of the neuron will release a pulse represented by 0 to the successor neuron connected to the neuron. This enables the neuromorphic chip, as a very large-scale integrated system of electronic analog circuits, to more accurately simulate the neural biological structure in the nervous system.
[0070] In related technologies, synaptic arrays are typically used to simulate the connection relationship between a group of neurons in one processing core and a group of neurons in another processing core, serving as an array-type storage structure for storing the connection topology and connection weights (also called synaptic weights) between a group of neurons in one processing core and a group of neurons in another processing core.
[0071] The format of the weight data in the embodiment of the present disclosure is as follows Figure 6 As shown, the weight data of each neuron includes an index part and a weight part.
[0072] In an embodiment of the present disclosure, weight data can be used to store connection weight values between a neuron and all or part of its successor neurons; in this case, one weight data corresponds to one first neuron, and the weight portion of the weight data includes the non-zero connection weight values among the connection weight values between the corresponding first neuron and each second neuron. Weight data can also be used to store connection weight values between a neuron and all or part of its predecessor neurons; in this case, one weight data corresponds to one second neuron, and the weight portion of the weight data includes the non-zero connection weight values among the connection weight values between the corresponding second neuron and each first neuron.
[0073] In some embodiments, the target neuron is the second neuron requiring firing determination. In the disclosed embodiments, the target neuron fires when its membrane potential is greater than a firing threshold; the need for firing determination on a target neuron means calculating the target neuron's membrane potential and determining whether the target neuron fires by determining whether the membrane potential is greater than the firing threshold. In some embodiments, the target neuron performs firing determination in response to the firing of its predecessor neuron.
[0074] In some embodiments, the target neuron may be a second neuron emitted by its predecessor. In some embodiments, the target neuron may be a second neuron emitted by its predecessor and having a non-zero connection weight value with the predecessor. In some embodiments, each second neuron may be a target neuron. This disclosure does not specifically limit this.
[0075] In the embodiment of the present disclosure, the firing determination may be performed on all second neurons or on some second neurons through steps S100 to S200, which is not particularly limited in the embodiment of the present disclosure.
[0076] The data processing method provided by the embodiment of the present disclosure is capable of processing the weight data of neurons in a neural network. The format of the weight data satisfies the following requirements: it includes an index part and a weight part. The weight part includes the non-zero connection weight value between the neuron and at least one predecessor neuron or at least one successor neuron of the neuron. The index part represents the predecessor neuron or successor neuron of the neuron corresponding to each non-zero connection weight value in the weight part. This helps to realize the storage of the connection weight values between neurons in the neural network based on the format of the above-mentioned weight data, and is conducive to optimizing the storage of the connection weight values. In particular, in a processor that distinguishes between on-chip storage and off-chip storage, it is conducive to improving the utilization efficiency of on-chip storage and increasing the computing speed of the processor.
[0077] The embodiment of the present disclosure does not impose any special restrictions on the specific formats of the weight data index part and the weight part.
[0078] In the embodiment of the present disclosure, the weight data may include a non-zero connection weight value between a neuron and at least one subsequent neuron.
[0079] Accordingly, in some embodiments, the weight data is the weight data of the first neuron, the weight part of the weight data includes the non-zero connection weight value between the first neuron and each of the second neurons; the index part includes an identification sequence composed of identification information of each of the second neurons in a first predetermined order, and the identification information indicates whether the connection weight value between the corresponding second neuron and the first neuron is a non-zero weight value; the non-zero connection weight value in the weight part of the weight data corresponds to the identification information indicating the non-zero connection weight value in the identification sequence of the weight data one by one; Figure 7 , step S100 includes:
[0080] In step S110, according to the identification sequence in the weight data of at least one of the first neurons, a second neuron having a connection weight value with at least one of the first neurons that is non-zero is determined as the target neuron;
[0081] In step S120, the connection weight value between the target neuron and the first neuron is determined based on the correspondence between the non-zero connection weight value in the weight part of the weight data and the identification information representing the non-zero connection weight value in the identification sequence of the weight data.
[0082] In some embodiments, the identification information includes 1 and 0, wherein 1 indicates that the connection weight value between the first neuron and the second neuron is a non-zero connection weight value; and 0 indicates that the connection weight value between the first neuron and the second neuron is zero. Accordingly, the identification sequence is a sequence consisting of 1 and 0, wherein each identification bit corresponds to a second neuron. In step S110, the target neuron can be determined based on whether it is 0 or 1 in the identification sequence. In some embodiments, the non-zero connection weight values in the weight part of the weight data are arranged in a first predetermined order, and the non-zero connection weight values correspond one-to-one to the identification bits with a value of 1 in the identification sequence. In step S120, the connection weight value between the target neuron and the first neuron can be determined based on the above one-to-one correspondence.
[0083] For example, refer to Figure 2 and Figure 8, neurons A1, A2, and A3 are the first neurons, and neurons C1, C2, C3, and C4 are the second neurons. The index part of the weight data for neuron A1 has an identifier sequence of 1001, indicating that the connection weights between neurons C1 and C4 and neuron A1 are non-zero connection weights, and the connection weights between neurons C2 and C3 and neuron A1 are zero; the weight part includes sequentially arranged connection weights a and b, indicating that the connection weight between neuron C1 and neuron A1 is a, and the weight between neuron C4 and neuron A1 is b. The index part of the weight data for neuron A2 has an identifier sequence of 1000, indicating that the connection weight between neuron C1 and neuron A2 is non-zero connection weight, and the connection weights between neurons C2, C3, and C4 and neuron A2 are zero; the weight part includes a connection weight c, indicating that the connection weight between neuron C1 and neuron A1 is c. When only neuron A1 fires, in step S110, neurons C1 and C4 are determined as target neurons. In step S120, the connection weight between neuron C1 and neuron A1 is determined to be a, and the connection weight between neuron C4 and neuron A1 is determined to be b. When neurons A1 and A2 fire, in step S110, neurons C1 and C4 are determined as target neurons. In step S120, the connection weight between neuron C1 and neuron A1 is determined to be a, the connection weight between neuron C1 and neuron A2 is determined to be c, and the connection weight between neuron C4 and neuron A1 is determined to be b.
[0084] In the embodiments of the present disclosure, in the same time interval, multiple first neurons may all fire, partially fire, or not fire at all. The embodiments of the present disclosure do not specifically limit this. In some embodiments, for any second neuron, the firing judgment of the second neuron is made only based on the weight data of the first neurons that fired in the same time interval. In the embodiments of the present disclosure, a time interval can be a period of time, a moment, or an operating cycle. The embodiments of the present disclosure do not specifically limit this.
[0085] Accordingly, in some embodiments, reference Figure 9 , step S110 includes:
[0086] In step S111, a target predecessor neuron corresponding to a target time interval is determined based on the first firing information of each of the first neurons in each time interval, wherein the first firing information indicates whether each of the first neurons in each time interval fires, and the target predecessor neuron is the first neuron that fires in the target time interval;
[0087] In step S112, based on the identification sequence in the weight data of at least one of the target predecessor neurons, a second neuron having a non-zero connection weight value with at least one of the target predecessor neurons is determined as the target neuron.
[0088] Figure 10 and Figure 11 This is a schematic diagram of performing neural network operations according to the time axis in the embodiment of the present disclosure. In the time interval t1 to t6, the pulses emitted by neurons A1, A2, and A3 and the weight data of neurons A1, A2, and A3 are as follows: Figure 10 As shown. In the time interval t1 to t6, the corresponding connection weight values when neurons C1, C2, C3, and C4 calculate the membrane potential are as follows. Figure 11 As shown. Taking neuron C1 as an example, during time interval t1, neurons A1 and A2 fire, while A3 does not. The connection weight between neurons A1 and C1 is a non-zero connection weight a, and the connection weight between neurons A2 and C1 is a non-zero connection weight c. During time interval t1, the membrane potential of neuron C1 is equal to the historical membrane potential during time interval t1 plus the connection weights a and c. During time interval t2, neurons A1, A2, and A3 do not fire, and no firing judgment is required. During time interval t3, neurons A1 and A3 fire, while A2 does not fire. The connection weight between neurons A1 and C1 is a non-zero connection weight a, and the connection weight between neurons A3 and C1 is zero. During time interval t3, the membrane potential of neuron C1 is equal to the historical membrane potential during time interval t3 plus the connection weight a.
[0089] The embodiments of the present disclosure do not impose any special restrictions on how to calculate the membrane potential of the target neuron and determine the firing of the target neuron.
[0090] In some embodiments, reference Figure 12 , step S200 includes:
[0091] In step S210, target weight data of the target neuron is determined based on the connection weight values between the target neuron and each of the first neurons that are fired, wherein the target weight data includes a target index portion and a target weight portion, the target weight portion including a non-zero connection weight value between the target neuron and each of the first neurons that are fired; the target index portion includes a target identification sequence composed of target identification information of each of the first neurons in a second predetermined order, the target identification information indicating whether the corresponding first neuron is fired and whether the connection weight value between the corresponding first neuron and the target neuron is a non-zero weight value;
[0092] In step S220 , the membrane potential of the target neuron is calculated according to the target weight data.
[0093] It should be noted that when executing steps S210 to S220, the target neuron can be a second neuron emitted by its predecessor neuron; the target neuron can also be a second neuron emitted by its predecessor neuron and having a non-zero connection weight value with the predecessor neuron; or all second neurons can be used as target neurons. This embodiment of the present disclosure does not specifically limit this.
[0094] It should also be noted that, when executing steps S210 to S220, the weight data used to determine the connection weight value between the target neuron and the first neuron is the weight data of the first neuron. The weight portion of the weight data of the first neuron includes the non-zero connection weight values between the first neuron and each second neuron; the index portion includes an identification sequence composed of identification information of each second neuron in a first predetermined order, the identification information indicating whether the connection weight value between the corresponding second neuron and the first neuron is a non-zero weight value; and the non-zero connection weight values in the weight portion of the weight data correspond one-to-one to the identification information indicating the non-zero connection weight values in the identification sequence of the weight data.
[0095] by Figure 13 For example, neurons A1, A2, and A3 are the first neurons, and neurons C1, C2, C3, and C4 are the second neurons. The index sequence in the weight data of neuron A1 is 1001, indicating that the connection weights between neurons C1 and C4 and neuron A1 are non-zero connection weights, and the connection weight between neurons C2 and C3 and neuron A1 is zero. The weight portion includes sequentially arranged connection weights a and b, indicating that the connection weight between neuron C1 and neuron A1 is a, and the connection weight between neuron C4 and neuron A1 is b. The identification sequence of the index part in the weight data of neuron A2 is 1000, indicating that the connection weight value between neuron C1 and neuron A2 is a non-zero connection weight value, and the connection weight value between neurons C2, C3, C4 and neuron A2 is zero; the weight part includes the connection weight value c, indicating that the connection weight value between neuron C1 and neuron A1 is c; the identification sequence of the index part in the weight data of neuron A3 is 0110, indicating that the connection weight values between neurons C2, C3 and neuron A3 are non-zero connection weight values, and the connection weight value between neurons C1, C4 and neuron A3 is zero; the weight part includes the connection weight value d and the connection weight value e arranged in sequence, indicating that the connection weight value between neuron C2 and neuron A3 is d, and the weight value between neuron C3 and neuron A3 is e.
[0096] exist Figure 13In the example, it is assumed that neurons A1 and A2 emit, but neuron A3 does not emit. Since neuron A3 does not emit, the connection weight value between neuron C1 and neuron A3 defaults to 0. By executing step S210, the target identification sequence in the target index part of the target weight data of neuron C1 is determined to be 110, and the target weight part of the target weight data of neuron C1 includes the connection weight value a and the connection weight value c arranged in sequence; since neuron A3 does not emit, the connection weight value between neuron C2 and neuron A3 defaults to 0, and the connection weights between neuron C2 and neurons A1 and A2 are all 0. By executing step S210, the target identification sequence in the target index part of the target weight data of neuron C2 is determined to be 000, and the target weight value of the target weight data of neuron C2 is 000. The weight part is empty; since neuron A3 does not emit, the connection weight value between neuron C3 and neuron A3 defaults to 0, and the connection weights between neuron C3 and neurons A1 and neuron A2 are all 0. By executing step S210, the target identification sequence in the target index part of the target weight data of neuron C3 is determined to be 000, and the target weight part of the target weight data of neuron C3 is empty; since neuron A3 does not emit, the connection weight value between neuron C4 and neuron A3 defaults to 0. By executing step S210, the target identification sequence in the target index part of the target weight data of neuron C4 is determined to be 100, and the target weight part of the target weight data of neuron C1 includes the connection weight value b.
[0097] It should be noted that Figure 13 This is an exemplary description of determining the target weight data of the target neuron when all second neurons are used as target neurons. In the embodiment of the present disclosure, it is also possible to determine only the target weight data of the second neurons that have a non-zero connection weight value with at least one predecessor neuron, that is, Figure 13 Only the target weight data of neuron C1 and neuron C4 are determined to save computing resources and improve computing efficiency. This embodiment of the present disclosure does not make any special limitation on this.
[0098] In some embodiments, the format of the weight data provided by the embodiments of the present disclosure is used in a many-core system to store the connection weight values between neurons in a neural network. Wherein, one processing core of the many-core system corresponds to at least one neuron of the neural network. In some embodiments, one weight data corresponds to a first neuron, and the weight part of the weight data includes the non-zero connection weight value in the connection weight value between the corresponding first neuron and each second neuron, and the weight data of the first neuron is stored in the off-chip storage of the many-core system. When any first neuron is emitted, the weight data of the neuron is obtained from the off-chip storage, and the weight data of the neuron is emitted to the second neuron together.
[0099] Accordingly, in some embodiments, the second neuron is a neuron corresponding to the current processing core, wherein the many-core system includes multiple processing cores, and one of the processing cores corresponds to at least one neuron of the neural network; the weight data is the weight data of the first neuron, and the weight part of the weight data includes the non-zero connection weight value between the first neuron and each of the second neurons; Figure 14 Before step S100, the data processing method further includes:
[0100] In step S300 , weight data of the at least one first neuron is received.
[0101] In the embodiment of the present disclosure, when a first neuron fires, the processing core corresponding to the firing first neuron may read the weight data of the firing first neuron from off-chip storage, transmit the data to the processing core corresponding to the target neuron, and store the data in the on-chip storage corresponding to the target neuron; or the scheduler may read the weight data of the firing first neuron from off-chip storage, transmit the data to the processing core corresponding to the target neuron, and store the data in the on-chip storage of the processing core corresponding to the target neuron. The embodiment of the present disclosure does not specifically limit this.
[0102] Accordingly, in some embodiments, reference Figure 14 After step S200, the data processing method further includes:
[0103] In step S400, when the membrane potential of any one of the target neurons is greater than the emission threshold, the weight data of the target neuron is emitted.
[0104] In some embodiments, issuing the weight data of the target neuron means that the current processing core reads the weight data of the target neuron from the off-chip storage, transmits it to the processing core corresponding to the successor neuron of the target neuron, and stores it in the on-chip storage of the processing core corresponding to the successor neuron of the target neuron.
[0105] In the embodiment of the present disclosure, the weight data may further include a non-zero connection weight value between a neuron and at least one preceding neuron.
[0106] Accordingly, in some embodiments, a piece of weight data corresponds to a second neuron, and the weight portion of the weight data includes the non-zero connection weight values among the connection weight values of the corresponding second neuron and each first neuron, and the weight data of the second neuron is stored in the off-chip storage of the many-core system. When any first neuron fires, the current processing core retrieves the corresponding second neuron weight data from the off-chip storage.
[0107] Correspondingly, the second neuron is a neuron corresponding to the current processing core, wherein the many-core system includes multiple processing cores, and one processing core corresponds to at least one neuron of the neural network; the weight data is the weight data of the second neuron, and the weight part of the weight data includes the non-zero connection weight value between the second neuron and each of the first neurons; Figure 15 Before step S100, the data processing method further includes:
[0108] In step S500 , in response to the firing of the at least one first neuron, weight data of the at least one target neuron is obtained from off-chip storage of the many-core system.
[0109] In some embodiments, the weight data of the target neuron obtained by the current processing core from the off-chip storage includes the connection weight values between the target neuron and all of its predecessor neurons.
[0110] In some embodiments, the on-chip storage of the current processing core stores index information of the weight data of each second neuron in the off-chip storage; the step of obtaining the weight data of the at least one target neuron from the off-chip storage of the many-core system includes: obtaining the weight data of the at least one target neuron from the off-chip storage of the many-core system according to the index information.
[0111] Accordingly, in some embodiments, reference Figure 15 After step S200, the data processing method further includes:
[0112] In step S600, when the membrane potential of at least one of the target neurons is greater than the firing threshold, second firing information is emitted, where the second firing information represents information of at least one of the target neurons whose membrane potential is greater than the firing threshold.
[0113] The disclosed embodiments do not specifically limit the format of the second emission information. In some embodiments, the second emission information is identification information of each target neuron whose membrane potential is greater than the emission threshold. In some embodiments, the second emission information is a sequence of 0s and 1s, with each target neuron corresponding to a bit in the sequence, where 0 indicates that the corresponding target neuron does not emit, and 1 indicates that the corresponding neuron emits.
[0114] In the embodiment of the present disclosure, the many-core system may be composed of a single chip, and the chip has multiple processing cores. The processing core is the smallest computing unit in the many-core system that can be independently scheduled and has complete computing capabilities; the many-core system may also be composed of multiple chips, and each chip may have multiple processing cores. The embodiment of the present disclosure does not specifically limit this. In the embodiment of the present disclosure, the many-core system also includes off-chip storage. The embodiment of the present disclosure does not specifically limit the off-chip storage of the many-core system. For example, the off-chip storage can be any one of double data rate synchronous dynamic random access memory (DDR), non-volatile memory (NVM), flash memory, etc.
[0115] In the disclosed embodiments, multiple processing cores in a many-core system can independently execute program instructions or work together, leveraging parallel computing to accelerate program execution and provide multitasking capabilities. Each processing core in the many-core system has independent on-chip storage capable of storing data such as computational results from the core's execution.
[0116] In some embodiments, for any one of the target neurons, the step of calculating the membrane potential of each of the target neurons based on the connection weight value between the at least one target neuron and the at least one first neuron includes: calculating the membrane potential of the target neuron based on the historical membrane potential of the target neuron and the connection weight value between the target neuron and the at least one first neuron.
[0117] It should be noted that the data processing method provided in the embodiment of the present disclosure may be used in the process of executing one or more of image processing tasks, speech processing tasks, text processing tasks, etc. The embodiment of the present disclosure does not specifically limit this.
[0118] Secondly, refer to Figure 16 , an embodiment of the present disclosure provides a processing core, including a computing unit 101 and a cache 102;
[0119] The computing unit 101 can implement any one of the data processing methods described in the first aspect of the embodiments of this disclosure.
[0120] Thirdly, refer to Figure 17 The embodiment of the present disclosure provides a many-core system, including: multiple processing cores 201 and an on-chip network 202, wherein the multiple processing cores 201 are connected to the on-chip network 202, and the on-chip network 202 is used to exchange data between the multiple processing cores and external data.
[0121] Among them, one or more instructions are stored in one or more processing cores 201, and one or more instructions are executed by one or more processing cores 201, so that one or more processing cores 201 can implement any data processing method described in the first aspect of the embodiment of this disclosure.
[0122] In addition, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, wherein the computer program, when executed by a processing core, can implement any one of the data processing methods described in the first aspect of the embodiment of the present disclosure.
[0123] It will be understood by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium).
[0124] As is well known to those skilled in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically contains computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0125] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A data processing method, comprising: determining, based on at least one weight data, a connection weight value between at least one target neuron and at least one first neuron, wherein the target neuron is one of at least one second neuron, and the first neuron is a predecessor neuron of the second neuron; the weight data of any neuron includes an index portion and a weight portion, wherein the weight portion includes non-zero connection weight values between the neuron and at least one predecessor neuron or at least one successor neuron of the neuron, and the index portion represents the predecessor neuron or successor neuron of the neuron corresponding to each non-zero connection weight value in the weight portion; Calculating the membrane potential of each target neuron according to the connection weight value between the at least one target neuron and the at least one first neuron and the historical membrane potential of each target neuron, The step of calculating the membrane potential of each target neuron according to the connection weight value between the at least one target neuron and the at least one first neuron and the historical membrane potential of each target neuron includes: Determining target weight data for the target neuron based on the connection weight values between the target neuron and each of the fired first neurons, wherein the target weight data includes a target index portion and a target weight portion, the target weight portion including a non-zero connection weight value between the target neuron and each of the fired first neurons; the target index portion includes a target identification sequence composed of target identification information of each of the first neurons in a second predetermined order, the target identification information indicating whether the corresponding first neuron is fired and whether the connection weight value between the corresponding first neuron and the target neuron is a non-zero weight value; The membrane potential of the target neuron is calculated according to the target weight data and the historical membrane potential of the target neuron.
2. The data processing method according to claim 1, wherein: The weight data is weight data of the first neuron, the weight portion of the weight data includes a non-zero connection weight value between the first neuron and each of the second neurons; the index portion includes an identification sequence composed of identification information of each of the second neurons in a first predetermined order, the identification information indicating whether the connection weight value between the corresponding second neuron and the first neuron is a non-zero weight value; The non-zero connection weight values in the weight part of the weight data correspond one-to-one to the identification information representing the non-zero connection weight values in the identification sequence of the weight data; The step of determining a connection weight value between at least one target neuron and at least one first neuron according to at least one weight data includes: determining, according to an identification sequence in the weight data of at least one of the first neurons, a second neuron having a connection weight value with at least one of the first neurons that is non-zero, as the target neuron; The connection weight value between the target neuron and the first neuron is determined according to the correspondence between the non-zero connection weight value in the weight part of the weight data and the identification information representing the non-zero connection weight value in the identification sequence of the weight data.
3. The data processing method according to claim 2, wherein: The step of determining, based on an identification sequence in weight data of at least one of the first neurons, a second neuron having a non-zero connection weight value with the at least one of the first neurons as the target neuron comprises: determining a target predecessor neuron corresponding to a target time interval based on first firing information of each of the first neurons in each time interval, wherein the first firing information indicates whether each of the first neurons fired in each time interval, and the target predecessor neuron is the first neuron that fired in the target time interval; According to the identification sequence in the weight data of at least one of the target predecessor neurons, a second neuron having a non-zero connection weight value with at least one of the target predecessor neurons is determined as the target neuron.
4. The data processing method according to any one of claims 1 to 3, wherein: The second neuron is a neuron corresponding to the current processing core, wherein the many-core system includes multiple processing cores, and each processing core corresponds to at least one neuron of the neural network; the weight data is weight data of the first neuron, and the weight portion of the weight data includes a non-zero connection weight value between the first neuron and each of the second neurons; before the step of determining the connection weight value between at least one target neuron and at least one first neuron based on the at least one weight data, the data processing method further includes: Weight data of the at least one first neuron is received.
5. The data processing method according to claim 4, wherein: After the step of calculating the membrane potential of each target neuron based on the connection weight value between the at least one target neuron and the at least one first neuron, the data processing method further includes: When the membrane potential of any one of the target neurons is greater than the emission threshold, the weight data of the target neuron is emitted. The data processing method according to claim 1 , wherein: The second neuron is a neuron corresponding to the current processing core, wherein the many-core system includes multiple processing cores, and each processing core corresponds to at least one neuron of the neural network; the weight data is weight data of the second neuron, and the weight portion of the weight data includes non-zero connection weight values between the second neuron and each of the first neurons; before the step of determining the connection weight value between at least one target neuron and at least one first neuron based on the at least one weight data, the data processing method further includes: In response to the at least one first neuron firing, weight data of the at least one target neuron is obtained from off-chip storage of the many-core system.
7. The data processing method according to claim 6, wherein: The on-chip storage of the current processing core stores index information of the weight data of each second neuron in the off-chip storage; The step of obtaining weight data of the at least one target neuron from the off-chip storage of the many-core system includes: The weight data of the at least one target neuron is obtained from the off-chip storage of the many-core system according to the index information.
8. The data processing method according to claim 6 or 7, wherein: After the step of calculating the membrane potential of each target neuron based on the connection weight value between the at least one target neuron and the at least one first neuron, the data processing method further includes: When the membrane potential of at least one of the target neurons is greater than the firing threshold, second firing information is emitted, where the second firing information represents information of at least one of the target neurons whose membrane potential is greater than the firing threshold.
9. A processing core comprising a computing unit and a cache; The computing unit can implement the data processing method according to any one of claims 1 to 8.
10. A many-core system comprising: Multiple processing cores; as well as an on-chip network configured to exchange data between the plurality of processing cores and external data; One or more instructions are stored in one or more of the processing cores, and one or more of the instructions are executed by one or more of the processing cores, so that one or more of the processing cores can implement the data processing method according to any one of claims 1 to 8.
11. A computer-readable medium having a computer program stored thereon, wherein: When the computer program is executed by the processing core, the computer program implements the data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
System and method for compact and efficient sparse neural networks
CN111247537A
Technologies for memory management of neural networks with sparse connectivity
US20170277628A1