Weight storage method, device, electronic device and computer readable medium

By dividing the weight values ​​between neurons into target weights and judging storage accuracy based on intervals, the problem of neuromorphic chip storage space occupation is solved, the storage demand is reduced, and the chip expansion application is promoted.

CN114792129BActive Publication Date: 2025-01-17LYNXI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210468928.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2025-01-17
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

In the prior art, neuromorphic chips will cause invalid occupancy of storage space when storing smaller weight values, thereby increasing storage demand and limiting the expansion application of chips.

Method used

By dividing the weight values ​​between neurons into target weight groups, and judging the storage accuracy of each group based on the target weight numerical interval, storage is lower than the current accuracy, reducing storage space usage.

Benefits of technology

It effectively reduces the storage needs of neuromorphic chips, reduces the ineffective space consumption, and promotes the expansion of chips.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114792129B_ABST
    Figure CN114792129B_ABST
Patent Text Reader

Abstract

The present disclosure provides a weight storage method, the method comprising: dividing all weight values ​​between neurons of a current processing core and neurons of a target processing core into a plurality of target weight groups, the target weight groups comprising a plurality of target weight values; for each target weight group, determining whether each of the target weight values ​​in the target weight group is within a target weight numerical interval; if it is determined that each of the target weight values ​​is within the target weight numerical interval, storing each of the target weight values ​​according to the target storage precision, the target storage precision being lower than the current storage precision of the target weight value. The present disclosure also provides a weight storage device, an electronic device, and a computer-readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a weight storage method, device, electronic device and computer-readable medium. Background Art

[0002] In the related art, in neuromorphic chips, the weight values ​​corresponding to the processing cores are usually stored with a unified storage precision, and the storage precision is generally high to meet the storage of maximum and minimum values. At present, this weight storage method inevitably has the following problems: when all the weight values ​​corresponding to the neurons are small, the current weight storage method will cause the storage space of the neuromorphic chip to be occupied too much and invalidly, resulting in a large storage demand for the neuromorphic chip, which is not conducive to the expansion and application of the neuromorphic chip. Summary of the invention

[0003] The present disclosure provides a weight storage method, device, electronic device and computer-readable medium.

[0004] In a first aspect, the present disclosure provides a weight storage method, the weight storage method comprising:

[0005] Dividing all weight values ​​between neurons of the current processing core and neurons of the target processing core into a plurality of target weight groups, wherein the target weight groups include a plurality of target weight values;

[0006] For each target weight group, determining whether all target weight values ​​in the target weight group are within the target weight value interval;

[0007] If it is determined that each of the target weight values ​​is within the target weight value interval, each of the target weight values ​​is stored according to the target storage precision, and the target storage precision is lower than the current storage precision of the target weight value.

[0008] In a second aspect, the present disclosure provides a weight storage device, the weight storage device comprising:

[0009] A partitioning module, configured to partition all weight values ​​between neurons of a current processing core and neurons of a target processing core into a plurality of target weight groups, wherein the target weight groups include a plurality of target weight values;

[0010] A judgment module is used to judge, for each target weight group, whether all the target weight values ​​in the target weight group are within the target weight value interval;

[0011] A storage module is used to store each target weight value according to the target storage precision when the judgment module determines that each target weight value is within the target weight value range, and the target storage precision is lower than the current storage precision of the target weight value.

[0012] In a third aspect, the present disclosure provides an electronic device comprising: multiple processing cores; and an on-chip network configured to exchange data between the multiple processing cores and external data; wherein 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 execute the above-mentioned weight storage method.

[0013] In a fifth aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program implements the above-mentioned weight storage method when executed by a processing core.

[0014] The weight storage method, weight storage device, electronic device and computer-readable medium provided by the present disclosure divide the weight values ​​between neurons into target weight groups when storing the weight values ​​corresponding to neurons, and judge for each target weight group whether the weight values ​​contained therein are all within a preset target weight value interval belonging to a smaller category. If so, the weight values ​​contained in the target weight group are stored with a target storage precision lower than the current storage precision, thereby reducing the storage space occupied by the weight storage of neurons, thereby reducing the ineffective occupation of the storage space of the neuromorphic chip, reducing the storage demand of the neuromorphic chip, and thus facilitating the expanded application of the neuromorphic chip.

[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] 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 which:

[0017] Figure 1 A flowchart of a weight storage method provided in an embodiment of the present disclosure;

[0018] Figure 2 A schematic diagram of a target weight group division method provided in an embodiment of the present disclosure;

[0019] Figure 3 A schematic diagram of another method for dividing target weight groups provided in an embodiment of the present disclosure;

[0020] Figure 4 A schematic diagram of another method of dividing target weight groups provided in an embodiment of the present disclosure;

[0021] Figure 5 A flowchart of another weight storage method provided by an embodiment of the present disclosure;

[0022] Figure 6 This is a flowchart of a specific implementation of step S100 in the embodiment of the present disclosure;

[0023] Figure 7 A block diagram of a weight storage device provided in an embodiment of the present disclosure;

[0024] Figure 8 A block diagram of another weight storage device provided in an embodiment of the present disclosure;

[0025] Fig. 9 A block diagram of a composition of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the 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, which should be considered as merely exemplary. Therefore, those of ordinary skill 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, the description of well-known functions and structures is omitted in the following description.

[0027] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0028] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0029] 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 plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" 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. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.

[0030] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those 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 explicitly defined as such herein.

[0031] The weight storage method provided by the embodiment of the present disclosure can be implemented based on a weight storage device, which can be embedded in a neuromorphic chip or independently set outside the neuromorphic chip. The weight storage method provided by the present disclosure adjusts the storage accuracy of the weight value based on the numerical interval to which the weight value belongs, so that the storage space occupied by the weight storage is greatly reduced, thereby avoiding excessive and invalid occupation of the storage space of the neuromorphic chip, thereby reducing the storage demand of the neuromorphic chip and promoting the expanded application of the neuromorphic chip.

[0032] Figure 1 A flowchart of a weight storage method provided in an embodiment of the present disclosure.

[0033] Reference Figure 1 , the present disclosure provides a weight storage method, the weight storage method comprising:

[0034] Step S101: Divide all weight values ​​between neurons of a current processing core and neurons of a target processing core into a plurality of target weight groups, wherein the target weight groups include a plurality of target weight values.

[0035] In a multi-core system based on a neuromorphic chip, multiple processing cores are included, each of which includes multiple neurons. The weight values ​​corresponding to the connection relationship between each neuron of the current processing core and other neurons of other processing cores are usually pre-stored. When a neuron emits a pulse, the preceding neuron or the succeeding neuron obtains the weight data and performs relevant calculations based on the weight data.

[0036] In the embodiment of the present disclosure, when storing weights, the target weight group is stored, and the target weight group is obtained by dividing all weight values ​​between the neurons of the current processing core and the neurons of the target processing core according to the target weight division method, and the target weight group includes multiple target weight values. Specifically, the target weight group can be divided based on multiple target weight division methods.

[0037] Figure 2 A schematic diagram of a method for dividing target weight groups provided in an embodiment of the present disclosure, Figure 2 An exemplary division method of the weight value between the current processing core and the target processing core is shown, such as Figure 2 As shown, in this embodiment, the target weight group is divided as follows: for each neuron in the current processing core, the weight value of the neuron and each neuron in the target processing core is obtained, and the weight value corresponding to a neuron in the current processing core is used as a target weight group, that is, a neuron in the current processing core is used as an index, and all weight values ​​connected to the neuron in the target processing core are used as a target weight group. For example, Figure 2 As shown, taking neuron A1 in the current processing core as an index, the weight values ​​of all neurons connected to neuron A1 in the target processing core are divided into a target weight group, and the storage precision of the weight values ​​of the target weight group is stored as precision 1. Alternatively, in some embodiments, the weight values ​​corresponding to multiple neurons in the current processing core can also be used as a target weight group, for example, Figure 2 As shown, taking neurons A3, A4 and A5 in the current processing core as indexes, the weight values ​​of all neurons connected to neurons A3 to A5 in the target processing core are divided into a target weight group, so that the storage precision of the weight values ​​of the target weight group is stored as precision 3.

[0038] Figure 3 A schematic diagram of another method for dividing target weight groups provided in an embodiment of the present disclosure, Figure 3 Another way of dividing the weight values ​​stored in the current processing core and the target processing core is shown as an example. Figure 3 As shown, in this embodiment, the target weight group is divided in the following manner: the weight values ​​between each neuron in the current processing core and at least one neuron in the target processing core are obtained, and the weight values ​​between each neuron in the current processing core and a neuron in the target processing core are used as a target weight group, that is, with a neuron in the target processing core as an index, the weight values ​​of each neuron in the current processing core connected to a neuron in the target processing core are used as a target weight group. For example, Figure 3As shown, taking neuron B1 in the target processing core as an index, the weight values ​​of all neurons connected to neuron B1 in the current processing core are divided into a target weight group, and the storage precision of the weight values ​​of the target weight group is stored as precision 1. Alternatively, in some embodiments, the weight values ​​corresponding to multiple neurons in the target processing core can also be used as a target weight group, such as Figure 3 As shown, taking neurons B5, B6 and B7 in the target processing core as indexes, the weight values ​​of all neurons connected to neurons B5 to B7 in the current processing core are divided into a target weight group, so that the storage precision of the weight values ​​of the target weight group is stored as precision 3.

[0039] Above Figure 3 The embodiments and Figure 2 The difference of the embodiments is that Figure 2 The target weight set is determined by taking the source neuron (the neuron in the current processing core) as the index, Figure 3 The target neuron (the neuron in the target processing core) is used as the index to determine the target weight group. The two are two different weight group division forms based on the same division principle. In addition, it should be noted that Figure 2 and Figure 3 In the target weight group division manner shown, the target processing core may be a predecessor core of the current processing core, or the target processing core may be a successor processing core of the current processing core.

[0040] Figure 4 A schematic diagram of another method of dividing target weight groups is provided for an embodiment of the present disclosure. Figure 4 Another way of dividing the weight values ​​stored in the current processing core and the target processing core is shown as an example. Figure 4 As shown, in this embodiment, the target weight group can be a target weight group with the weight values ​​between some neurons in the current processing core and some neurons in the target processing core. Figure 4 For example, the weight values ​​between neurons A1-A3 in the current processing core and neurons B1-B3 in the target processing core are divided into a target weight group, so that the weight storage precision of the target weight group is stored as precision 1. Similarly, the weight values ​​between neurons A1-A3 in the current processing core and neurons B4-B7 in the target processing core are divided into a target weight group, so that the weight storage precision of the target weight group is stored as precision 2. It should be noted that in this embodiment, there is no intersection between any two target weight groups among the multiple target weight groups.

[0041] Specifically, in step S101, the weight value corresponding to the current neuron of the current processing core and the target neuron of the target processing core can be obtained by querying the pre-stored weight value, for example, by querying the synaptic array used to store the weight values ​​corresponding to the neurons in the current processing core.

[0042] Step S102: for each target weight group, determine whether each target weight value is within the target weight value range.

[0043] The target weight value interval is a preset value interval for determining the storage precision of the target weight value. The determination condition of the target weight value interval is: at least a preset proportion of weight values ​​in the many-core system belongs to the target weight value interval. Preferably, the preset proportion is 90%.

[0044] In addition, it should be noted that, based on the distribution characteristics of weight values ​​in a many-core system in the art, the target weight numerical range determined in the embodiments of the present disclosure is usually smaller than the numerical range to which all weight values ​​in the many-core system belong. For example, the numerical range to which all weight values ​​in the many-core system belong is [-50, 50], while the target weight numerical range may be [-10, 10], wherein the target weight numerical range indicates that most (e.g., 90%) of the weight values ​​in the many-core system belong to the numerical range [-10, 10].

[0045] In some embodiments, the target weight value range may be determined by those skilled in the art based on experience; in other embodiments, the target weight value range may also be determined based on statistical calculations of all weight values ​​included in the many-core system.

[0046] In step S102, for each target weight group, if it is determined that each target weight value is within the target weight numerical range, it means that each target weight value in the target weight group belongs to a smaller numerical range, and there is no need to use a higher storage precision for storage. Therefore, the following step S103 is executed at this time to store each target weight value with a storage precision lower than the current storage precision, thereby reducing the storage space occupied; and when it is determined that at least one target weight value among the target weight values ​​is outside the target weight numerical range, it means that there is a maximum value or a minimum value in each target weight value, and it is still necessary to use a higher storage precision for storage in order to completely store all the target weight values. At this time, the current storage precision of each target weight value is kept unchanged, that is, each target weight value continues to be stored with the current storage precision.

[0047] Step S103: Store each target weight value according to a target storage precision, where the target storage precision is lower than the current storage precision of the target weight value.

[0048] The target storage precision can be determined based on the target weight numerical range. The target storage precision should at least meet the storage byte requirements of the values ​​contained in the target weight numerical range. For example, when the maximum value contained in the target weight numerical range does not exceed 127 and the minimum value is not less than -128, the target storage precision can be set to 8-bit integer (int8).

[0049] In addition, it should be noted that in the embodiment of the present disclosure, the target storage precision is lower than the current storage precision of the target weight value. This is because the target weight value range is smaller than the value range to which all weight values ​​in the many-core system belong. Therefore, the target storage precision must be lower than the current storage precision of the target weight value.

[0050] In some embodiments, in order to prevent the weight value from being affected by the storage precision in the subsequent change process, preferably, the type of the target storage precision remains the same as the type of the current storage precision. For example, if the current storage precision is a floating point type, the type of the target storage precision is still a floating point type. In the embodiment of the present disclosure, the current storage precision can be a floating point storage precision or an integer storage precision.

[0051] The weight storage method provided by the embodiment of the present disclosure divides the weight values ​​between neurons into target weight groups when storing the weight values ​​corresponding to neurons, and determines for each target weight group whether its weight values ​​are all within a preset target weight value interval belonging to a smaller category. If so, the weight values ​​are stored with a storage accuracy lower than the current storage, thereby reducing the storage space occupied by the neuron weight storage, thereby reducing the ineffective occupation of the storage space of the neuromorphic chip, reducing the storage demand of the neuromorphic chip, and thus facilitating the expanded application of the neuromorphic chip.

[0052] In some embodiments, the target weight value may be stored in a form of a data packet.

[0053] In some embodiments, the target weight groups may be stored in data packets.

[0054] In some embodiments, the format of the data packet is as follows:

[0055] cid startaddr len acc weight

[0056] Among them, cid represents the identification information of the target processing core; startaddr represents the address of the starting target neuron in the target processing core that is connected to a neuron in the current processing core; len represents the number of target neurons that are continuously connected in the target processing core starting from the address of the connected starting target neuron; acc represents the target storage accuracy; weight represents each target weight value, and each target weight value corresponds one-to-one to the target neuron determined based on the fields startaddr and len. It should be noted that in other embodiments, when the address of the target neuron in the target processing core is non-continuous, the weight value of the neuron between each target neuron can be set to zero and stored accordingly in the parameter weight.

[0057] In some other embodiments, if a neuron in the current processing core is connected to only one target neuron in the target processing core, the format of the data packet may be:

[0058] cid addr acc weight

[0059] Among them, cid represents the identification information of the target processing core; addr represents the address of the target neuron, acc represents the target storage accuracy; weight represents the target weight value.

[0060] In this embodiment, one neuron corresponds to at least one data packet, each data packet corresponds to a target processing core connected to the neuron, and each data packet has its own storage precision. In some embodiments, in order to further reduce the storage space occupied by the neuromorphic chip, multiple data packets corresponding to a neuron in the current processing core can be classified and stored according to the target storage precision, and the storage precision is no longer marked in each data packet, that is, data packets with the same target storage precision are stored as a large data packet, as shown below, the format of the large data packet can be:

[0061] acc addr weight …… addr weight

[0062] Among them, acc represents the target storage accuracy, and each set of addr and weight represents a data packet corresponding to a target processing core connected to a neuron in the current processing core as described above, wherein addr represents the address of the target neuron and weight represents the target weight value.

[0063] For example, if all the data packets corresponding to a neuron contain 1000 32-bit floating point (fp32) data packets and 10 16-bit floating point (fp16) data packets, the 1000 32-bit floating point data packets are stored together and uniformly marked with the storage precision of fp32, and the 10 16-bit floating point data packets are stored together and uniformly marked with the storage precision of fp16. This storage method can further reduce the storage space occupied by the neuromorphic chip.

[0064] It should be noted that in the embodiment of the present disclosure, if the target weight group is divided using the target neuron in the target processing core as the index, then the information related to the target processing core address in the above-mentioned data packet should be represented as the corresponding address-related information in the current processing core, for example, cid represents the identification information of the current processing core, addr represents the address of the neuron in the current processing core, startaddr represents the address of the starting neuron in the current processing core that is connected to a neuron in the target processing core, and so on.

[0065] In the embodiments of the present disclosure, in addition to storing the target weight values ​​in the form of data packets as described above, in some other embodiments, the target weight values ​​involved in the weight storage method provided in the embodiments of the present disclosure may also be stored in the form of an array.

[0066] Figure 5 A flowchart of another weight storage method provided in an embodiment of the present disclosure.

[0067] Reference Figure 5 , compared with the embodiment of the present disclosure Figure 1 The illustrated embodiment, before step S101, further includes:

[0068] Step S100: Determine a target weight value range.

[0069] In the embodiments of the present disclosure, the target weight value range can be determined based on different methods. In some embodiments, the target weight value range is determined by those skilled in the art based on experience. In other embodiments, the target weight value range can be determined by performing statistical calculations on all weight values ​​included in the many-core system.

[0070] Figure 6 It is a flowchart of a specific implementation of step S100 in the embodiment of the present disclosure.

[0071] Reference Figure 6 In this embodiment, the target weight value range is determined by statistically calculating all weight values ​​included in the many-core system. Specifically, step S100 includes:

[0072] Step S1001: Obtain all weight values ​​included in the many-core system.

[0073] Step S1002: Perform normal distribution statistics on all acquired weight values ​​to determine the normal distribution law of the weight values.

[0074] Step S1003: determine the weight range in which the distribution probability in the normal distribution law meets the preset probability value as the target weight value interval.

[0075] In this embodiment, the distribution of all weight values ​​in the many-core system satisfies the normal distribution law. Therefore, the normal distribution law of all weight values ​​in the many-core system can be determined by performing normal distribution statistics on all weight values ​​contained in the many-core system, and then the target weight value range can be determined based on the obtained normal distribution law.

[0076] Specifically, in step S1002, all weight values ​​in the acquired many-core system are subjected to normal distribution statistics to obtain the normal distribution law of the weight values, which includes the expected value and standard deviation of the normal distribution; in step S1003, based on the determined expected value and standard deviation, the distribution probability of the weight value is determined by querying the standard normal distribution table to satisfy the weight range corresponding to the preset probability value, and the weight range is determined as the target weight value interval, wherein the distribution probability of the weight value satisfies the weight range corresponding to the preset probability value means that each weight value will be within the weight range with a probability not lower than the preset probability value.

[0077] For example, by performing statistical calculations on all weight values ​​in the many-core system, it is determined that the expected value of the normal distribution law that satisfies the normal distribution is μ=12, the standard deviation is σ=2, and the preset probability value is set to 90%. By querying the standard normal distribution table, it is determined that when the distribution probability of the weight value meets 90%, the corresponding weight range is (μ-2σ,μ+2σ). Therefore, the target weight value interval can be determined to be (8,16).

[0078] Figure 7 A block diagram of a weight storage device provided in an embodiment of the present disclosure.

[0079] Reference Figure 7 The weight storage device provided in the embodiment of the present disclosure includes: a division module 11, a judgment module 12 and a storage module 13.

[0080] Among them, the division module 11 is used to divide all connection weights between the neurons of the current processing core and the neurons of the target processing core into multiple target weight groups, and the target weight groups include multiple target weight values; the judgment module 12 is used to judge for each target weight group whether the target weight values ​​in the target weight group are all within the target weight value range; the storage module 13 is used to store each target weight value according to the target storage precision when the judgment module 12 judges that each target weight value is within the target weight value range, and the target storage precision is lower than the current storage precision of the target weight value.

[0081] Figure 8 A block diagram of another weight storage device provided in an embodiment of the present disclosure.

[0082] Reference Figure 8 In some embodiments, the weight storage device further includes: a determination module 10; the determination module 10 is used to determine a preset weight value range before the division module divides all weight values ​​between the neurons of the current processing core and the neurons of the target processing core into multiple target weight groups.

[0083] In the embodiments of the present disclosure, the target weight value range can be determined based on different methods. In some embodiments, the target weight value range is determined by those skilled in the art based on experience. In other embodiments, the target weight value range can be determined by performing statistical calculations on all weight values ​​included in the many-core system.

[0084] For details, please refer to Figure 8 In some embodiments, the determination module includes: an acquisition unit 101 , a statistics unit 102 and a determination unit 103 .

[0085] Among them, the acquisition unit 101 is used to obtain all weight values ​​contained in the many-core system; the statistical unit 102 is used to perform normal distribution statistics on all the acquired weight values ​​to determine the normal distribution law of the weight values; the determination unit 103 is used to determine the weight range in which the distribution probability in the normal distribution law meets the preset probability value as the target weight value range.

[0086] The weight storage device provided in the embodiment of the present disclosure is used to implement the weight storage method provided in the embodiment of the present disclosure. For the specific functional modules of the weight storage device and the interaction process between the functional modules, please refer to the description of the corresponding method steps in the above-mentioned weight storage method, which will not be repeated here.

[0087] Fig. 9 A block diagram of a composition of an electronic device provided in an embodiment of the present disclosure.

[0088] Reference Fig. 9An embodiment of the present disclosure provides an electronic device, which includes multiple processing cores 601 and an on-chip network 602, wherein the multiple processing cores 601 are connected to the on-chip network 602, and the on-chip network 602 is used to exchange data between the multiple processing cores and external data.

[0089] Among them, one or more instructions are stored in one or more processing cores 601, and the one or more instructions are executed by one or more processing cores 601, so that one or more processing cores 601 can execute the above-mentioned weight storage method.

[0090] 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 implements the above-mentioned weight storage method when executed by a processing core.

[0091] It will be appreciated 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 hardware implementations, 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). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are 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 tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain 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.

[0092] 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 limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, 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, those skilled in the art will appreciate 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 weight storage method, comprising: Dividing all weight values ​​between neurons of the current processing core and neurons of the target processing core into a plurality of target weight groups, wherein the target weight groups include a plurality of target weight values; For each target weight group, determining whether all target weight values ​​in the target weight group are within the target weight value interval; If it is determined that each of the target weight values ​​is within the target weight value interval, each of the target weight values ​​is stored according to a target storage precision, and the target storage precision is lower than a current storage precision of the target weight value.

2. The weight storage method according to claim 1, wherein: The storing of each target weight value according to the target storage precision specifically includes: The target weight value is stored in the form of a data packet, wherein the data packet includes the target weight value and the target storage accuracy.

3. The weight storage method according to claim 1, wherein: If it is determined that at least one of all the target weight values ​​is outside the target weight value interval, the current storage precision of the target weight value is kept unchanged.

4. The weight storage method according to claim 1, wherein: The current storage precision is a floating point storage precision or an integer storage precision, and the type of the target storage precision is the same as the type of the current storage precision.

5. The weight storage method according to claim 1, wherein: Before the step of dividing all weight values ​​between neurons of the current processing core and neurons of the target processing core into a plurality of target weight groups, the method further includes: Determine the target weight value range.

6. The weight storage method according to claim 5, wherein: Determining the target weight value interval includes: Get all weight values ​​contained in the many-core system; Perform normal distribution statistics on all the weight values ​​obtained to determine the normal distribution law of the weight values; The weight range in which the distribution probability in the normal distribution law satisfies the preset probability value is determined as the target weight value interval.

7. The weight storage method according to claim 1, wherein: The step of dividing all weight values ​​between neurons of the current processing core and neurons of the target processing core into a plurality of target weight groups includes: For each neuron in the current processing core, obtain a weight value between the neuron and each neuron in the target processing core; The weight value corresponding to at least one neuron in the current processing core is used as a target weight group.

8. The weight storage method according to claim 1, wherein: The step of dividing all weight values ​​between neurons of the current processing core and neurons of the target processing core into a plurality of target weight groups includes: Obtaining a weight value between each neuron in the current processing core and at least one neuron in the target processing core; The weight values ​​between each neuron in the current processing core and at least one neuron in the target processing core are taken as a target weight group.

9. The weight storage method according to claim 1, wherein: There is no intersection between any two target weight groups among the plurality of target weight groups.

10. A weight storage device, comprising: A partitioning module, configured to partition all weight values ​​between neurons of a current processing core and neurons of a target processing core into a plurality of target weight groups, wherein the target weight groups include a plurality of target weight values; A judgment module is used to judge, for each target weight group, whether all the target weight values ​​in the target weight group are within the target weight value interval; A storage module is used to store each target weight value according to a target storage precision when the judgment module determines that each target weight value is within the target weight value range, and the target storage precision is lower than the current storage precision of the target weight value.

11. The weight storage device according to claim 10, wherein: The device also includes: The determination module is used to determine a preset weight value interval before the division module divides all weight values ​​between the neurons of the current processing core and the neurons of the target processing core into a plurality of target weight groups.

12. The weight storage device according to claim 11, wherein: The determination module specifically includes: An acquisition unit, used for acquiring all weight values ​​contained in the many-core system; A statistical unit, used for performing normal distribution statistics on all acquired weight values ​​to determine the normal distribution law of the weight values; A determination unit is used to determine the weight range in which the distribution probability in the normal distribution law meets the preset probability value as the target weight value interval.

13. An electronic device 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 execute the weight storage method described in any one of claims 1-9.

14. 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 weight storage method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Weight precision configuration method, weight precision configuration device, weight precision configuration equipment and storage medium

    CN111831359A

  • Optimization system, retraining system and method thereof, processor and readable medium

    CN113177627A