Neural network retraining and gradient sparsification method based on memristor aging perception

Through neural network retraining and gradient sparse methods based on memristor aging perception, the problem of decreasing hardware inference accuracy and shortening service life caused by memristor aging is solved, and a higher hardware inference accuracy and longer service life is achieved.

CN114881218BActive Publication Date: 2025-04-18ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210427530.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2025-04-18
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

The prior art is difficult to effectively utilize the aging of memristors, resulting in a decrease in hardware inference accuracy and shortening of service life.

Method used

Through neural network retraining and gradient sparse methods based on memristor aging perception, aging information is used to calculate the programmable resistance range, retrain the neural network, and online hardware adjustment is used to use sparse gradient technology.

Benefits of technology

It improves the accuracy of hardware inference in aging, extends the service life of memristor cross-arrays, reduces the number of hardware online adjustments, and avoids further aging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114881218B_ABST
    Figure CN114881218B_ABST
Patent Text Reader

Abstract

The present invention discloses a neural network retraining and gradient sparsification method based on memristor aging perception, and relates to a design for extending the working life of memristors and improving the accuracy of cross array reasoning. For the problem of reduced accuracy of hardware online reasoning after cross array aging, by using known memristor aging information, the maximum value of programmable weights under the current aging condition is calculated, and the neural network model is retrained accordingly, thereby improving the accuracy of current hardware online reasoning; during the retraining process, the network weights exceeding the maximum value of programmable weights are automatically truncated; for the problem of limited memristor life, the sparsity of neural network derivatives is used, and derivatives with small absolute values ​​are discarded during the hardware adjustment process, thereby ensuring that the memristor corresponding to the small derivative is not applied with voltage, preventing the aging process of the memristor and extending its service life.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of storage and computing integration, and in particular to a neural network retraining and gradient sparsification method based on memristor aging perception, which is helpful for improving the hardware reasoning accuracy of an aged memristor cross array and extending its service life. Background Art

[0002] With the advent of the big data era, non-volatile devices, such as memristors, have made it possible to achieve efficient and low-power in-memory computing. Existing research has confirmed the great potential of memristor-based crossbar array circuits in neuromorphic accelerated computing. When mapping the trained neural network synaptic weights to the resistance of the crossbar array, high voltage pulses need to be applied to achieve programming. Since quantization during programming mapping will cause the hardware reasoning accuracy to decrease, it is also necessary to apply fine-tuning voltage to adjust the resistance stored in the memristor to obtain the reasoning accuracy that meets the requirements. Repeated application of voltage will cause irreversible changes in the filaments inside the memristor, a phenomenon called aging. The programmable range of the aged memristor is reduced, so the value of the target weight is very likely to fall outside the actual effective range of the memristor after programming mapping, causing a large programming error, further causing the accuracy of the neural network to decrease, and then more times of voltage application are required for hardware online adjustment, further exacerbating the aging of the memristor.

[0003] In response to the aging problem of memristors, there are studies that can improve the durability of memristors by adjusting the programming voltage or changing the cascade resistance at the device level. There are also studies that propose methods of exchanging rows and columns and skew training of neural networks to alleviate the aging phenomenon of crossbar arrays based on memristors, thereby increasing the service life of the entire device. However, the above methods fail to fully utilize the information of the current aging status of the device, and do not propose good improvements to the decline in hardware reasoning accuracy caused by memristor aging.

[0004] In summary, providing a neural network retraining and gradient sparsification method based on memristor aging perception, and using known aging information to improve the hardware reasoning accuracy of the aged memristor crossbar array and extend its service life has become an important technical issue at present. Summary of the invention

[0005] The purpose of the present invention is to provide a neural network retraining and gradient sparsification method based on memristor aging perception in response to the aging situation of the current memristor crossbar array. By utilizing the aging information of the memristors, the neural network is retrained, and the gradient sparsification technology is used to perform online hardware adjustment, thereby improving the hardware reasoning accuracy of the crossbar array under aging conditions and the service life of the memristor crossbar array.

[0006] The objective of the present invention is achieved through the following technical solutions:

[0007] A neural network retraining and gradient sparsification method based on memristor aging perception, the method comprises the following steps:

[0008] S1 collects the aging information of the memristor and calculates the effective programmable resistance range of the aged memristor:

[0009]

[0010]

[0011] in, and are the maximum and minimum values ​​of the programmable resistance of the crossbar array memristor after aging, and are the maximum and minimum programmable resistance that the new memristor can store, respectively. G(T, t) and H(T, t) are Arrhenius aging equations, whose parameters can be extracted from measured data.

[0012] S2 is based on the programmable resistance range obtained by S1, and the reciprocal is used to obtain the programmable conductance range of the aged memristor, with the maximum and minimum values ​​being and The maximum and minimum values ​​of the programmable weight parameters in the neural network task to be performed are calculated according to the following formula:

[0013]

[0014]

[0015] in, and are the maximum and minimum conductances that can be stored by the new memristor in the crossbar array, and are the maximum and minimum values ​​of the programmable weights corresponding to the crossbar array, W max and W min are the maximum and minimum values ​​of synaptic weights in the initial model of the neural network;

[0016] S3 retrains the existing neural network model based on the maximum values ​​of the neural network programmable weight parameters;

[0017] S4 maps the adjusted neural network synaptic weight parameters to a crossbar array based on a memristor, mapped to the resistance value of a basic memory unit;

[0018] S5 divides the derivatives into two groups according to the positive and negative signs of the derivatives calculated by the neural network back-propagation method, calculates the average values ​​of the positive and negative groups of derivatives respectively, and ignores the derivatives whose absolute values ​​are lower than the average values, i.e., sets them to 0; then, hardware online fine-tuning is performed on the resistance stored in the corresponding memristor according to the current derivative value, i.e., a positive and negative voltage corresponding to the sign of the derivative is applied to the memristor:

[0019]

[0020] Among them, grad ij is the loss function value of the neural network Loss to the weight w ij The derivative obtained by derivation, Loss is the difference between the hardware inference result and the actual loss function value, V0 is the standard voltage applied to the memristor memory unit during online adjustment, V ij is the applied voltage corresponding to the memristor memory cell in the i-th row and j-th column of the crossbar array;

[0021] This process is repeated until the accuracy of its online hardware inference meets the requirements, which are manually specified.

[0022] Furthermore, the S3 specific process includes:

[0023] The weights that exceed the programmable parameter range are truncated and directly assigned to the maximum weight value or minimum weight value closest to the current value. The neural network is back-propagated and derived based on the current truncated parameters, and the parameters are continued to be adjusted. The above operations are repeated until the parameters meet the programmable weight range and the simulation reasoning accuracy is not significantly reduced.

[0024] Furthermore, S4 specifically includes:

[0025] S4.1 According to the mapping relationship between weight and conductance, the conductance value G that should be stored in all memristors of the crossbar array corresponding to all synaptic weights W of the neural network is calculated. The mapping relationship is:

[0026]

[0027] Among them, W max and W min are the maximum and minimum values ​​of the synaptic weights in the neural network model, G max and G min are the maximum and minimum values ​​of the programmable effective conductance of the memristor, respectively;

[0028] S4.2 According to the inverse relationship between conductance and resistance, the calculated conductance is reciprocated to obtain the resistance value that all memristors in the crossbar array should store: R = 1 / G, and R max =1 / G min and R min=1 / G max , R max and R min are the maximum and minimum values ​​of the programmable resistance of the memristor, respectively;

[0029] S4.3 applies a voltage to the memristor storage unit corresponding to the synaptic position of the neural network, so that it stores the most recent quantized resistance corresponding to the calculated resistance R;

[0030] Furthermore, in S2, when calculating the programmable maximum and minimum values ​​of the neural network weights, the maximum and minimum values ​​of each layer are found according to the weights of the current neural network layers, as well as the maximum value of the current programmable conductance of the memristor corresponding to each layer of the neural network, and the calculation is performed.

[0031] The beneficial effects of the present invention are as follows:

[0032] 1) Improve the hardware reasoning accuracy of the memristor-based crossbar array under aging conditions. By using known aging information, the programmable resistance range of the current crossbar array is calculated, and the neural network is retrained accordingly. The network weight parameters obtained in this way can better match the hardware under current aging conditions, reducing some errors caused by weights exceeding the programmable range during mapping, thereby improving the hardware reasoning accuracy.

[0033] 2) Extend the service life of the memristor-based crossbar array. The retrained parameters obtained using the aging information can best match the current hardware status. Therefore, there is no need to perform too many iterations of online hardware adjustment to improve the accuracy of hardware reasoning, thus avoiding further aging of the memristor. In addition, the online adjustment method of gradient sparsification avoids the problem of applying voltage to the memristor during redundant gradient adjustment, which further causes aging. It reduces the number of times voltage is applied to the memristor, and also plays a role in extending the service life of the memristor crossbar array. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is the overall flow chart of the implementation of the present invention;

[0035] Figure 2 is a schematic diagram of mapping the synaptic weight parameters of the neural network of the present invention to a crossbar array based on a memristor;

[0036] Figure 3 is a schematic diagram of the gradient sparsification technique of the present invention;

[0037] Figure 4 It is a comparison chart of the accuracy of the method of the present invention and other methods;

[0038] Figure 5 This is a comparison chart of the service life of the memristor cross array of the method of the present invention and other methods. DETAILED DESCRIPTION

[0039] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] like Figure 1 As shown, the neural network retraining and gradient sparse method based on memristor aging perception provided by the present invention comprises the following steps:

[0041] S1 uses non-patent literature 1 (S. Balatti et al., "Voltage-controlled cycling endurance of hfo x The aging process of the memristor is modeled by the Arrhenius aging model in the aging model of the memristor, and the aging information of the memristor is collected. The effective programmable resistance range of the memristor after aging is calculated by the following formula:

[0042]

[0043]

[0044] in, and They are the maximum and minimum values ​​of the effective programmable resistance of the cross-array memristor after repeated execution of tasks and multiple voltages are applied, resulting in aging. and They are the maximum and minimum programmable resistances that can be stored in a new memristor crossbar array that has not yet performed a task. G(T, t) and H(T, t) are Arrhenius aging equations, and their parameters can be extracted from measured data.

[0045] S2 is based on the programmable resistance range of S1, and the reciprocal is used to obtain the programmable conductance range of the aged memristor, with the maximum and minimum values ​​being and The maximum and minimum values ​​of the programmable weight parameters in the neural network task to be performed are calculated according to the following formula:

[0046]

[0047]

[0048] in, and are the maximum and minimum conductances that can be stored by the new memristor in the crossbar array, and are the maximum and minimum values ​​of the programmable weights corresponding to the crossbar array, W max and W min are the maximum and minimum values ​​of the synaptic weights in the initial model of the neural network. The range allowed by the weight parameters in the neural network model corresponds one-to-one to the conductance range that can be stored in each memory unit in the memristor crossbar array.

[0049] S3 retrains the existing neural network model based on the maximum value of the neural network programmable weight parameters in S2. The specific process is: truncate each weight that exceeds the programmable parameter range and directly assign it to the maximum or minimum value closest to the current weight value:

[0050]

[0051] w ij is the weight value of the i-th row and j-th column of a layer of the neural network, and They are the minimum and maximum weight values ​​of the i-th row and j-th column of a neural network layer that can be successfully mapped to the memristor, and correspond to the minimum and maximum conductance values ​​that can be stored by the aged memristor in the i-th row and j-th column of the crossbar array. The loss function value of the neural network is calculated based on the current truncation parameters, and the neural network is back-propagated and derived, and the parameters are adjusted continuously; the above operations are repeated until the parameters meet the programmable weight range and the accuracy of software simulation reasoning is not significantly reduced.

[0052] S4 takes the synaptic weight parameters of the neural network retrained by S3 and Figure 2 The position correspondence shown is mapped hierarchically one by one to the storage units of the memristor cross array, mapped to the resistance value of the basic memory unit.

[0053] S4.1 According to the mapping relationship between weight and conductance in the following formula, calculate the conductance value G that should be programmed and stored in all memristors of the crossbar array corresponding to the synaptic weight W of the neural network:

[0054]

[0055] Among them, W max and W min are the maximum and minimum values ​​of the synaptic weights in the current neural network model, G max and G min are the maximum and minimum values ​​of the programmable effective conductance of each memory cell in the crossbar array.

[0056] S4.2 According to the inverse relationship between conductance and resistance, the conductance calculated in S4.1 is reciprocated to obtain the resistance value that all memristors in the crossbar array should store after programming: R = 1 / G, and R max =1 / G min and R min =1 / G max , R max and R min are the maximum and minimum values ​​of the programmable resistance of the memristor, respectively.

[0057] S4.3 applies voltage to the memristor storage unit corresponding to the synaptic position of the neural network, so that it stores the most recent quantized resistance corresponding to the resistance R calculated by S4.2.

[0058] The S5 performs neural network tasks in a crossbar array.

[0059] S5.1 verifies the accuracy of cross-array online hardware inference.

[0060] S5.2 If the accuracy does not meet the requirement, the resistance value stored in the memristor cross array is adjusted online. Figure 3 The sparse gradient technology shown in the figure: according to the positive and negative derivatives calculated by the neural network back propagation method, the derivatives are divided into two groups, the average values ​​of the positive and negative groups of derivatives are calculated respectively, and the derivatives with absolute values ​​lower than the average value are ignored, that is, set to 0. Then, according to the current derivative value, the resistance stored in the corresponding memristor is fine-tuned online by hardware. The voltage applied to the memristor during the fine-tuning process corresponds to the sign of the derivative obtained by the sparse gradient technology mentioned above:

[0061]

[0062] Among them, grad ij is the loss function value of the neural network Loss to the weight w ij The derivative obtained by backpropagation, Loss is the loss function value between the hardware inference result and the actual result, V0 is the standard voltage value applied to the memristor memory unit during online adjustment, V ij is the applied voltage corresponding to the memristor memory cell in the i-th row and j-th column of the crossbar array.

[0063] S5.3 repeats the process of S5.2 until the cross-array online hardware reasoning accuracy meets the requirements. The required accuracy is manually specified according to the actual situation and task.

[0064] The functions and effects of the present invention are further illustrated by the following simulation experiments:

[0065] Simulation Tasks

[0066] In the specific case of applying the system of this embodiment, two classic networks, LeNet-5 and ResNet-18, were selected to perform classification tasks of two data sets, Fashion-MNIST and CIFAR-10, respectively. The models of the above two networks were executed in a crossbar array based on memristors, and the method of neural network retraining and gradient sparsification method based on memristor aging perception provided by the present invention was used multiple times to check the effect of each use and the impact of cumulative use on the crossbar array.

[0067] In addition to experimental verification of the method mentioned in the present invention, the results are also compared with the common basic process without using this method and the method proposed in non-patent document 2 (S. Zhang et al., "Aging-aware Lifetime Enhancement for Memristor-based Neuromorphic Computing," 2019 Design, Automation & Test in Europe Conference & Exhibition (DATE), 2019, pp. 1751-1756.). The comparison indicators are mainly the hardware inference accuracy after weight parameter mapping under the same conditions, and the number of hardware online adjustments required to obtain the required accuracy.

[0068] Simulation Results

[0069] (1) Comparison of hardware inference accuracy after weight parameter mapping under the same conditions

[0070] Figure 4 The change of the inference accuracy when the neural network is repeatedly executed in the memristor cross array is given. Through vertical comparison, after repeated execution, the aging degree of the memristor is aggravated and the accuracy is seriously attenuated; horizontally, compared with the basic method without using the present invention, the hardware inference accuracy of the method using the present invention can be better maintained under the same number of executions.

[0071] The following table shows the comparison of the accuracy of reasoning performed by the method of the present invention and other methods in a memristor crossbar array with the same degree of aging.

[0072]

[0073] *Reaching the maximum adjustment limit still does not achieve the required accuracy.

[0074] As can be seen from the above table, under a certain degree of aging of the memristor cross array, when executing the LeNet-5 task, the initial mapping accuracy of the method of the present invention is 16% and 28% higher than that of the basic method and the method of non-patent document 1, respectively; when executing the ResNet-18 task, it is 4% and 7% higher, respectively. The current aging situation is not too bad, so after online adjustment, the hardware inference accuracy can be achieved. The number of online adjustments required to achieve this accuracy is significantly reduced by the method of the present invention, and compared with the basic method and the method of non-patent document 1, the number of adjustments can be saved by up to 13.8 times and 9 times.

[0075] (2) Comparison of the number of hardware online adjustments

[0076] Figure 5 The change of the number of online adjustments required for the memristor crossbar array to achieve the required accuracy in the process of repeatedly executing network tasks is given. Comparing the method of the present invention with the basic method and the method of the present invention using only part of it (retraining part), it is found that the method of the present invention can execute the network tasks for the maximum number of times before more hardware online adjustment iterations are required to achieve the required accuracy, indicating that the service life of the memristor crossbar array is extended. Compared with the basic method, the execution of LeNet-5 and ResNet-18 extended the service life by 2.7 and 2.5 times, respectively.

[0077] From the above results, it can be seen that the present invention can achieve better reasoning accuracy in a memristor cross array with a certain degree of aging by retraining the network, and the number of hardware online adjustments required to achieve the target accuracy is small, thereby extending the service life of the memristor-based cross array.

[0078] This patent is not limited to the above network tasks. The above embodiments are used to explain the present invention, not to limit the present invention. Under the inspiration of this patent, anyone can use this method with various other network tasks under the aging memristor cross array to improve the reasoning accuracy and extend the service life of the memristor cross array. Within the spirit of the present invention and the scope of protection of the claims, all equal changes and modifications made in accordance with the scope of the patent application of the present invention should be covered by the present invention.

Claims

1. A neural network retraining and gradient sparsification method based on memristor aging perception, characterized in that: The method comprises the following steps: S1 collects the aging information of the memristor and calculates the effective programmable resistance range of the aged memristor: in, and are the maximum and minimum values ​​of the programmable resistance of the crossbar array memristor after aging, and are the maximum and minimum programmable resistance that the new memristor can store, respectively. G(T, t) and H(T, t) are Arrhenius aging equations, whose parameters can be extracted from measured data. S2 is based on the programmable resistance range obtained by S1, and the reciprocal is used to obtain the programmable conductance range of the aged memristor, with the maximum and minimum values ​​being and The maximum and minimum values ​​of the programmable weight parameters in the neural network task to be performed are calculated according to the following formula: in, and are the maximum and minimum conductances that can be stored by the new memristor in the crossbar array, and are the maximum and minimum values ​​of the programmable weights corresponding to the crossbar array, W max and W min are the maximum and minimum values ​​of synaptic weights in the initial model of the neural network; S3 retrains the existing neural network model based on the maximum values ​​of the neural network programmable weight parameters; S4 maps the adjusted neural network synaptic weight parameters to a crossbar array based on a memristor, mapped to the resistance value of a basic memory unit; S5 divides the derivatives into two groups according to the positive and negative signs of the derivatives calculated by the neural network back-propagation method, calculates the average values ​​of the positive and negative groups of derivatives respectively, and ignores the derivatives whose absolute values ​​are lower than the average values, i.e., sets them to 0; then, hardware online fine-tuning is performed on the resistance stored in the corresponding memristor according to the current derivative value, i.e., a positive and negative voltage corresponding to the sign of the derivative is applied to the memristor: Among them, grad ij is the loss function value of the neural network Loss to the weight w ij The derivative obtained by derivation, Loss is the difference between the hardware inference result and the actual loss function value, V0 is the standard voltage applied to the memristor memory unit during online adjustment, V ij is the applied voltage corresponding to the memristor memory cell in the i-th row and j-th column of the crossbar array; This process is repeated until the accuracy of its online hardware inference meets the requirements, which are manually specified.

2. The neural network retraining and gradient sparsification method based on memristor aging perception according to claim 1 is characterized in that: The S3 specific process includes: The weights that exceed the programmable parameter range are truncated and directly assigned to the maximum weight value or minimum weight value closest to the current value. The neural network is back-propagated and derived based on the current truncated parameters, and the parameters are continued to be adjusted. The above operations are repeated until the parameters meet the programmable weight range and the simulation reasoning accuracy is not significantly reduced.

3. The neural network retraining and gradient sparsification method based on memristor aging perception according to claim 2, characterized in that: S4 specifically includes: S4.1 According to the mapping relationship between weight and conductance, the conductance value G that should be stored in all memristors of the crossbar array corresponding to all synaptic weights W of the neural network is calculated. The mapping relationship is: Among them, W max and W min are the maximum and minimum values ​​of the synaptic weights in the neural network model, G max and G min are the maximum and minimum values ​​of the programmable effective conductance of the memristor, respectively; S4.2 According to the inverse relationship between conductance and resistance, the calculated conductance is reciprocated to obtain the resistance value that all memristors in the crossbar array should store: R = 1 / G, and R max =1 / G min and R min =1 / G max , R max and R min are the maximum and minimum values ​​of the programmable resistance of the memristor, respectively; S4.3 applies voltage to the memristor storage unit corresponding to the synaptic position of the neural network, so that it stores the most recent quantized resistance corresponding to the calculated resistance R.

4. The neural network retraining and gradient sparsification method based on memristor aging perception according to any one of claims 1 to 3, characterized in that: In S2, when calculating the programmable maximum and minimum values ​​of the neural network weights, the maximum and minimum values ​​of each layer are found according to the current weights of each layer of the neural network, as well as the maximum value of the current programmable conductance of the memristor corresponding to each layer of the neural network, and the calculation is performed.

Citation Information

Patent Citations

  • Resource management method and system for large-scale distributed deep learning

    CN111858072A

  • Memristor neural network chip architecture compensation method based on online migration training

    CN111931924A