A high-precision digital-analog hybrid computation matrix inversion method
Patent Information
- Application Number
- CN202311652630.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-12-05
AI Technical Summary
但是,单纯的模拟计算存在着精度上的限制
[0019] This invention provides a hybrid digital-analog matrix inversion method. Based on an analog matrix calculation circuit using a variable resistor array, it achieves high-precision calculation through iterative digital computation. Compared to other high-precision matrix inversion methods, this method fully utilizes the one-step matrix inversion capability of the analog calculation circuit, resulting in faster computation speed, higher energy efficiency, and lower computational complexity. This method only requires writing a finite number of the most significant bits of the matrix elements into the variable resistor array (the number of bits is much smaller than the precision bits of the calculated result), placing lower demands on storage device performance and making it more suitable for practical applications.
Smart Images

Figure CN117609676B_ABST
Abstract
Description
Technical Field
[0001] This invention provides a hybrid computing method based on analog matrix computing circuits and traditional digital computing hardware for high-precision matrix inversion problems. Specifically, it involves the design of iterative algorithms between digital and analog computing, and the design of analog matrix computing circuits based on arrays of variable resistor devices (such as resistive random access memory, phase-change memory, magnetic memory, ferroelectric memory, etc.). It belongs to the fields of computer science, semiconductors, and integrated circuits. Background Technology
[0002] Matrix inversion computation has applications in many scientific and engineering fields, such as signal processing in wireless communication. Compared to traditional digital computation methods, analog matrix computation based on variable resistor arrays has the advantages of extremely fast computation speed and extremely low computational complexity. By constructing a feedback loop, analog matrix computation realizes the one-step solution of matrix inversion problems in linear equation systems. However, purely analog computation has limitations in accuracy. On the one hand, due to the inherent randomness of the devices, the number of resolvable conductance states exhibited by variable resistor devices is limited, resulting in low accuracy of the matrix elements involved in the calculation. On the other hand, due to various non-ideal factors in analog circuits, such as the finite gain of operational amplifiers and truncation errors in analog-to-digital and digital-to-analog conversions, the computational accuracy is further limited. In order to make analog matrix computation applicable to practical applications, it is necessary to overcome the accuracy bottleneck of analog computation and meet the accuracy requirements of applications while accelerating matrix computation. Summary of the Invention
[0003] To achieve efficient and high-precision matrix inversion calculations, this invention provides a high-precision matrix inversion method based on a variable resistor array. This method employs a coupled, iterative approach combining high-precision digital computation with analog matrix inversion circuitry. While maintaining the advantages of rapid analog computation, it achieves matrix inversion with the same precision as all-digital computation.
[0004] The specific technical solution of this invention is as follows:
[0005] A high-precision matrix inversion calculation method based on simulated matrix computation includes the following steps:
[0006] 1) Construct an analog matrix inversion circuit based on a variable resistor array. Specifically, for solving the linear equation system of matrix A and input vector b, define l as the storage bit precision of a single variable resistor, and a low-precision analog matrix... (where the integer n is used to determine the decimal point position), the matrix elements of AL are scaled by a certain ratio α, and mapped to a variable resistor array according to a reference conductance value G0;
[0007] 2) The simulation and digital computation categories are iterated in a loop. In each iteration, a low-precision matrix inversion is performed first, followed by high-precision matrix-vector multiplication and vector addition / subtraction using digital computation. The specific steps are as follows:
[0008] 2-1) Analog matrix inversion circuit for residual r (k) Scaling by a certain ratio, i.e., d (k) =β (k) r (k) , obtain the output result
[0009]
[0010] 2-2) Supplementary solution Δx from the inversion result restored by the high-precision digital computing unit (k) =Δy (k) / β (k) According to r ( k+ 1) The range of values and formulas (1) and (2) are used to set a new scaling factor β. ( k+ 1) Scale it, i.e., d ( k+ 1) =β ( k+ 1) r ( k+ 1) Find the inverse of the (k+1)th iteration, x. ( k+ 1) With residual r ( k+ 1) ;
[0011] X ( k+ 1) =x (k) +Δx (k) (1)
[0012] r ( k+ 1) =r (k) -AΔx (k) (2)
[0013] 2-3) Steps 2-1) and 2-2) are iterated repeatedly. On the c-th calculation, the inverse result x is obtained. (c) With residual r (c) And complete -log2||r (c)The condition ||>t is used to determine the convergence of the iteration, where ||·| represents the l2 norm of the vector and t is the target precision. If the condition is met, the iteration converges, the target precision is achieved, and the iteration stops. A maximum number of iterations is set, and iteration stops when the maximum number of iterations is reached.
[0014] The analog matrix inversion circuit is based on a variable resistor array design and is used to complete matrix inversion calculations in one step. This circuit can be a generalized inverse circuit for arbitrary matrix inversion calculations. The variable resistors can be resistive random access memory (RRAM), phase-change memory (PCM), magnetic memory, ferroelectric memory, etc.
[0015] In the analog matrix inversion circuit, a variable resistor array stores several most significant bits of the original matrix, enabling low-precision inversion calculations. Correspondingly, the variable resistor device may be a multi-level memory.
[0016] The high-precision digital computing unit category can be implemented using traditional digital computing units such as central processing units (CPUs), graphics processing units (GPUs), field-programmable gate arrays (FPGAs), and application-specific integrated circuits (ASICs), or emerging in-memory computing units. The memory stores the original matrix in full precision.
[0017] The high-precision matrix inversion calculation method of the present invention is applicable to any real matrix.
[0018] The beneficial effects of this invention are as follows:
[0019] This invention provides a hybrid digital-analog matrix inversion method. Based on an analog matrix calculation circuit using a variable resistor array, it achieves high-precision calculation through iterative digital computation. Compared to other high-precision matrix inversion methods, this method fully utilizes the one-step matrix inversion capability of the analog calculation circuit, resulting in faster computation speed, higher energy efficiency, and lower computational complexity. This method only requires writing a finite number of the most significant bits of the matrix elements into the variable resistor array (the number of bits is much smaller than the precision bits of the calculated result), placing lower demands on storage device performance and making it more suitable for practical applications. Attached Figure Description
[0020] Figure 1 This is a flowchart of the high-precision digital-analog hybrid computation matrix inversion method of the present invention;
[0021] Figure 2 This is a specific embodiment of the present invention and its calculation process. Detailed Implementation
[0022] To more clearly illustrate the objectives, technical solutions, and advantages of the present invention, a further detailed description is provided below in conjunction with the accompanying drawings. The description herein is merely illustrative and not intended to limit the scope of the invention.
[0023] This invention provides a high-precision digital-analog hybrid computational matrix inversion method based on a variable resistor array. Figure 1 This is a schematic diagram of the calculation process of this method.
[0024] Consider solving a system of linear equations in matrix form Ax = b, where A is an invertible square matrix, b is a known vector, and x is the unknown vector to be solved. The solution to this system is x = A⁻¹b, where A⁻¹ is the inverse matrix of A. In practical problems, the elements of matrix A are generally of high precision. In simple analog matrix calculation circuits, when the high-precision A is mapped to the conductance values of variable resistors, it often suffers a severe loss of accuracy, making it difficult to obtain an accurate solution.
[0025] To achieve high-precision x-vector solving based on analog matrix computation circuits, we consider quantizing matrix A to achieve matrix mapping. In digital computers, each element of matrix A is stored as a high-precision numerical value, considered to be an m-bit fixed-point number. Common floating-point numbers can be converted to fixed-point numbers before quantization. After quantization, (Where the integer n is used to determine the decimal point position), it is used for full-precision calculations in high-precision digital computing units. Let l be the storage bit precision of a single variable resistor device; therefore, the variable resistor array in the analog matrix computing circuit stores a low-precision matrix. Then, the matrix elements of AL are scaled by a certain ratio α and mapped to the conductance of the variable resistor device according to a reference conductance value G0.
[0026] The steps for calculating and inverting a high-precision analog matrix are as follows:
[0027] 1. Initialize the inverse result x (0) Let r be the zero vector and r be the residual. (0) =b;
[0028] 2. Regarding r (0) Scaling by a certain ratio, i.e., d (0) =β (0) r (0) This allows it to be mapped to the input voltage of an analog matrix inversion circuit, yielding the output result.
[0029] 3. A high-precision digital computing unit constitutes a supplementary solution Δx for the inversion result. (0) =Δy (0) / β (0)The loop iteration begins, and the maximum number of iterations s is set. According to formulas (1) and (2), the inverse result x of the (k+1)th iteration is obtained by using a high-precision digital computing unit. ( k+ 1) With residual r ( k+ 1) According to r ( k+ 1) The range of values, setting a new scaling factor β ( k+ 1) Scale it, i.e., d ( k+ 1) =β ( k+ 1) r ( k+ 1) ;
[0030] 4. Proceed to the next iteration, k ← k+1, d (k) Provide the input for the analog matrix inversion circuit to obtain the output result. The supplementary solution Δx that constitutes the result of the inversion (k) =Δy (k) / β (k) .
[0031] Steps 3 and 4 are iterated repeatedly. In the c-th calculation, if -log2||r (c) ||>t, where ‖·‖ represents the l2 norm of the vector, t is the target precision (in bits), and represents the convergence of the iteration, reaching the target precision, stopping the iteration, and outputting the final high-precision calculation result x. (c) If the solution fails to converge after s iterations, the solution has failed.
[0032] <![CDATA[r ( k+ 1) =r (k) -AΔx (k) ,]]> (2)
[0033] Figure 2 The specific implementation circuit module of the method (containing specific computational data) is shown, and its specific computation process is demonstrated with an application example.
[0034] 1. Initialization (including vector initialization, scaling, and matrix mapping): Complete the initialization of the residual r. (0) =b and the inverse result x (0) and for r (0) Reduced by a factor of 4 to get d (0)The target precision is t = 16 bits. Consider solving a system of linear equations for a 4×4 matrix A and an input vector b, with a full precision of 20 bits, i.e., m = 20. Extract the highest 4 bits of each matrix element, i.e., the storage bit precision of a single variable resistor device, l = 4, to obtain a low-precision matrix AL. Scale the matrix elements of AL by a certain ratio α (here α = 1), and map them to a variable resistor array containing 16 conductance states based on a reference conductance value G0 = 5 μS.
[0035] 2. Perform the inversion calculation in the analog matrix inversion circuit, for r (0) Scaling by a certain ratio, i.e., d (0) =β (0) r (0) The output result is Δy (0) .
[0036] 3. Perform calculations in a high-precision digital computing unit: Reconstruct the supplementary solution Δx from the inversion result based on the scaling factor from step 2. (0) And calculate the supplementary residual Δr (0) That is, Δx (0) =Δy (0) / β (0) The loop iteration begins, with a maximum iteration count of 10. Based on formulas (1) and (2), the inverse result x of the (k+1)th iteration is calculated using a high-precision digital computing unit. ( k+ 1) With residual r ( k+ 1) According to r ( k+ 1) The range of values, setting a new scaling factor β ( k+ 1) Scale it, i.e., d ( k+ 1) =β ( k+ 1) r ( k+ 1) The cumulative result of the inversion and the residual are x, respectively. (1) and r (1) .
[0037] <![CDATA[r ( k+ 1) =r (k) -AΔx (k) ,]]> (2)
[0038] The condition does not satisfy -log2||r (1) ||>16, therefore, in completing r (1) After scaling, the next loop will begin.
[0039] 4. During the 7th iteration, the residual begins to satisfy -log2||r (7)Since || = 19 > 16, the target accuracy has been achieved. Stop the iteration and output the inversion result x that meets the high-precision requirement. (7) .
[0040] Finally, it should be noted that the purpose of disclosing the embodiments is to help further understand the present invention. However, those skilled in the art will understand that various substitutions and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the content disclosed in the embodiments, and the scope of protection of the present invention is defined by the claims.
Claims
1. A high-precision matrix inversion calculation method, characterized in that, 1) Construct an analog matrix inversion circuit based on a variable resistor array. Specifically, for solving the linear equation system of matrix A and input vector b, define l as the storage bit precision of a single variable resistor, and a low-precision analog matrix... For A L The matrix elements are scaled by a certain ratio α and mapped to a variable resistor array based on a reference conductance value G0. 2) The simulation and digital computation categories are iterated in a loop. In each iteration, a low-precision matrix inversion is performed first, followed by high-precision matrix-vector multiplication and vector addition / subtraction using digital computation. The specific steps are as follows: 2-1) Analog matrix inversion circuit for residual r (k) Scaling by a certain ratio, i.e., d (k) =β (k) r (k) This yields the low-precision matrix inversion result. 2-2) Supplementary solution Δx from the inversion result restored by the high-precision digital computing unit (k) =Δy (k) / β (k) According to r (k+1) The range of values and formulas (1) and (2) are used to set a new scaling factor β. (k+1) Scale it, i.e., d (k+1) =β (k+1) r (k+1) Find the inverse of the (k+1)th iteration, x. (k+1) With residual r (k+1) ; x (k+1) =x (k) +Δx (k) , (1) r (k+1) =r (k) -AΔx (k) (2) 2-3) Steps 2-1) and 2-2) are iterated repeatedly. On the c-th calculation, the inverse result x is obtained. (c) With residual r (c) And complete -log2||r (c) The condition ||>t is used to determine the l2 norm of the vector and t is the target precision. If the condition is met, it means that the iteration has converged, the target precision has been reached, and the iteration stops.
2. The high-precision matrix inversion calculation method based on analog matrix calculation as described in claim 1, characterized in that, Set a maximum number of iterations; stop iterating when the maximum number of iterations is reached.
3. The high-precision matrix inversion calculation method based on analog matrix calculation as described in claim 1, characterized in that, The variable resistor device is a resistive switching memory, a phase-change memory, a magnetic memory, or a ferroelectric memory.
4. The high-precision matrix inversion calculation method based on analog matrix calculation as described in claim 1, characterized in that, The variable resistor array is a multi-level memory that stores several most significant bits of the original matrix.
5. The high-precision matrix inversion calculation method based on analog matrix calculation as described in claim 1, characterized in that, The high-precision digital computing unit is a central processing unit, a graphics processing unit, a field-programmable gate array, an application-specific integrated circuit, or an emerging in-memory computing unit.