Linear equation solver and computing chip

By designing a linear equation system solver based on FPGA, using the three-stage pipeline operation method performed in parallel, the traditional solution method is solved in the performance bottleneck of large-scale computing tasks, and efficient hardware resource utilization and calculation speed improvement are achieved.

CN119759421APending Publication Date: 2025-04-04SHENGSI MICROELECTRONICS (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411824125.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Traditional linear system of equation solving methods show performance bottlenecks when dealing with large-scale computing tasks, and existing hardware accelerators lack special designs for linear system of equations, resulting in low computational efficiency and resource utilization.

Method used

A linear equation system solver based on FPGA is designed, including an initialization circuit module and a Krylov subspace construction module. This module is executed in parallel through Arnoldi orthogonalization, Givens rotation and residual inspection circuit units, forming a three-stage pipeline operation method to improve hardware execution efficiency and resource utilization.

Benefits of technology

It significantly improves the execution efficiency and resource utilization of hardware, improves the computing speed, and is especially suitable for scenarios such as scientific computing and engineering simulation where large-scale sparse linear equations need to be solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759421A_ABST
    Figure CN119759421A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a linear equations solver and a computing chip. Each circuit module in the solver is implemented based on FPGA. The solver includes: an initialization circuit module, which is used to determine the initial basis vector of the Krylov subspace and determine the first basis vector; a Krylov subspace construction module, which includes: an Arnoldi orthogonalization circuit unit for performing an orthogonalization operation and forming a Hessenberg matrix by column, a Givens rotation circuit unit for performing upper triangularization on the Hessenberg matrix to obtain an upper triangular Hessenberg matrix and determine the size of the residual after rotation; a residual check circuit unit for evaluating the convergence of the Krylov subspace according to the size of the residual after rotation; and a solution circuit unit for updating the solution vector. The embodiments of the present disclosure can improve the execution efficiency of hardware, and improve the utilization rate of hardware resources and the calculation speed.
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 linear equation solver and a computing chip. Background Art

[0002] Solving linear equations plays an important role in scientific computing, engineering simulation, and artificial intelligence, and is the core link in modeling and solving many complex problems. With the continuous expansion of computing scale and the continuous increase in problem complexity, the requirements for solving linear equations are also increasing. However, traditional solution methods and tools often show obvious performance bottlenecks when facing large-scale computing tasks.

[0003] Although existing software solving methods have certain advantages in versatility, their computing speed and resource efficiency are difficult to meet actual needs when dealing with large-scale linear equations. At the same time, their hardware utilization is low, and they fail to fully tap the high-performance computing potential of modern hardware devices. In terms of hardware acceleration, the design of general-purpose hardware often gives priority to broad adaptability, lacks specialized designs for optimizing the solution of linear equations, and is difficult to significantly improve overall computing efficiency. Therefore, developing a hardware accelerator specifically for solving linear equations to provide efficient solutions for large-scale computing tasks has important practical significance and broad application prospects. Summary of the invention

[0004] According to one aspect of the present disclosure, a linear equations solver is provided, wherein each circuit module in the solver is implemented based on FPGA, and the solver comprises:

[0005] An initialization circuit module is used to determine the initial basis vector of the Krylov subspace using the received initial solution vector of the linear equation group to be operated, the preset constant constant, and the coefficient matrix, and determine the first basis vector based on the initial basis vector;

[0006] The Krylov subspace construction module includes an Arnoldi orthogonalization circuit unit, a Givens rotation circuit unit, a residual check circuit unit and a solution circuit unit. The Arnoldi orthogonalization circuit unit, the Givens rotation circuit unit and the residual check circuit unit are configured as a three-stage pipeline operation mode of interleaved parallel execution, wherein in each round of hardware circuit operation:

[0007] The Arnoldi orthogonalization circuit unit is used to perform an orthogonalization operation based on the coefficient matrix and the basis vectors in the Krylov subspace to form a Hessenberg matrix by column.

[0008] The Givens rotation circuit unit is used to perform upper triangular processing on the Hessenberg matrix to obtain an upper triangular Hessenberg matrix and determine the size of the residual after rotation;

[0009] The residual checking circuit unit is used to evaluate the convergence of the Krylov subspace according to the residual size after the rotation;

[0010] The solution circuit unit is used for updating the solution vector by using the upper triangular Hessenberg matrix and the initial solution vector when the Krylov subspace reaches convergence.

[0011] In a possible implementation, the method of determining the basis vectors of the Krylov subspace using the received initial solution vector of the linear equation group to be operated, the preset constants, and the coefficient matrix, and determining the first basis vector based on the initial basis vectors includes:

[0012] Determine a residual vector and a modulus of the residual vector according to the initial solution vector, the preset constant, and the coefficient matrix;

[0013] Determining the initial basis vector according to the ratio of the residual vector and the modulus of the residual vector;

[0014] The first basis vector is determined by using the ratio of the initial basis vector and the bi-norm of the initial basis vector.

[0015] In one possible implementation, the three-stage pipeline operation mode of interleaved parallel execution includes: in the current round of hardware circuit operation, if any one of the Arnoldi orthogonalization circuit unit, the Givens rotation circuit unit and the residual check circuit unit completes the corresponding calculation task, the calculation result is passed to the next-level circuit unit, and the current circuit unit executes the corresponding calculation task of the next round of hardware circuit in parallel.

[0016] In a possible implementation, the Arnoldi orthogonalization circuit unit includes a projection coefficient calculation unit, a projection vector generation unit, a vector update unit, a basis vector normalization unit, a Hessenberg matrix unit, and a circular register, wherein the circular register is used to store the updated spatial basis vectors.

[0017] The projection coefficient calculation unit is used to determine the projection coefficient according to the coefficient matrix and the basis vectors in the Krylov subspace, and the projection coefficient is used to represent the correlation between the current residual vector and the generated basis vectors;

[0018] The projection vector generating unit is used to determine the projection vector according to the coefficient matrix, the basis vectors in the Krylov subspace, and the projection coefficient;

[0019] The basis vector normalization unit is used to obtain a new basis vector according to the projection vector and its norm;

[0020] The vector update unit is used to update in the loop register and load the Hessenberg matrix in the Hessenberg matrix unit.

[0021] In a possible implementation, the projection coefficient calculation unit calculates the projection coefficient based on the following formula: Where A represents the coefficient matrix, v k represents the kth basis vector in the currently generated Krylov subspace, v j represents the jth basis vector in all Krylov subspaces, α k represents the projection coefficient;

[0022] In a possible implementation, the projection vector generation unit calculates the projection vector and the new basis vector based on the following formula: Among them, q k represents the orthogonalized projection vector, represents the sum of the projections of the k+1th basis vector on all previously obtained basis vectors;

[0023] In a possible implementation, the basis vector normalization unit is used to obtain the new basis vector according to the following formula: Among them, ||q k || represents the norm of the projection vector, v k+1 represents the k+1th basis vector of the Krylov subspace, i.e., the new basis vector.

[0024] In a possible implementation manner, the Givens rotation circuit unit is used to:

[0025] Determine a rotation matrix according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix;

[0026] The rotation matrix is ​​multiplied by the Hessenberg matrix to obtain the upper triangular Hessenberg matrix.

[0027] In a possible implementation, determining the rotation matrix according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix includes:

[0028] Determining a rotation radius according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix;

[0029] Determining a first rotation parameter according to a ratio of the main diagonal element to the rotation radius;

[0030] Determining a second rotation parameter according to a ratio of the sub-diagonal element to the rotation radius;

[0031] The rotation matrix is ​​determined according to the first rotation parameter and the second rotation parameter as follows:

[0032] Among them, c k represents the first rotation parameter, s k Represents the second rotation parameter.

[0033] In a possible implementation manner, determining the size of the residual after rotation includes:

[0034] The size of the residual after rotation is determined by the following formula:

[0035] H represents the Hessenberg matrix, β represents the residual size before rotation, β′ represents the residual size after rotation update, G k represents the rotation matrix.

[0036] In a possible implementation, the evaluating the convergence of the Krylov subspace includes:

[0037] The residual of the current solution is calculated and compared with a preset threshold. When the residual of the current solution is less than the preset threshold, it is determined that the Krylov subspace has reached convergence; otherwise, it is determined that the Krylov subspace has not reached convergence.

[0038] In a possible implementation, when the Krylov subspace does not converge, the Krylov subspace construction module is configured to continue or re-update the Hessenberg matrix until the Krylov subspace converges or the number of iterations reaches a target number of iterations.

[0039] The solver further includes a recycling module, which is configured as follows: when the number of iterations reaches the target number of iterations and the Krylov subspace has not reached convergence, the recycling module is used to extract the most recently generated M basis vectors from the Krylov subspace, and clear the remaining basis vectors in the circular register except the M basis vectors, and the M basis vectors are used as new initial vectors, where M is an integer greater than or equal to 1.

[0040] According to one aspect of the present disclosure, a computing chip is provided, wherein the chip includes the linear equation solver.

[0041] The linear equation solver of the disclosed embodiment constructs a hardware initialization circuit module and a Krylov subspace construction module through FPGA, and configures the Arnoldi orthogonalization circuit unit, the Givens rotation circuit unit and the residual check circuit unit as a three-stage pipeline operation mode of staggered parallel execution, which can improve the execution efficiency of the hardware, improve the hardware resource utilization and calculation speed, and is particularly suitable for scenarios such as scientific computing and engineering simulation that require solving large-scale sparse linear equations.

[0042] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0044] Figure 1 A schematic diagram of a linear equations solver according to an embodiment of the present disclosure is shown.

[0045] Figure 2 A schematic diagram is shown of a pipeline operation mode of an Arnoldi orthogonalization circuit unit, a Givens rotation circuit unit, and a residual check circuit unit in a Krylov subspace construction module according to an embodiment of the present disclosure.

[0046] Figure 3 A block diagram of the Arnoldi orthogonalization circuit unit according to an embodiment of the present disclosure is shown.

[0047] Figure 4 A schematic diagram of the operation flow of the linear equation solver according to an embodiment of the present disclosure is shown.

[0048] Figure 5 A schematic diagram of the operating state of a linear equations solver according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0049] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0050] In the description of the present disclosure, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present disclosure.

[0051] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0052] In the present disclosure, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.

[0053] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0054] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0055] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0056] See also Figure 1, Figure 1 A schematic diagram of a linear equations solver according to an embodiment of the present disclosure is shown.

[0057] Each circuit module in the solver is implemented based on FPGA (Field Programmable Gate Array), such as Figure 1 As shown, the solver comprises:

[0058] The initialization circuit module 10 is used to determine the initial basis vector of the Krylov subspace using the received initial solution vector of the linear equation group to be calculated, the preset constant constant, and the coefficient matrix, and determine the first basis vector based on the initial basis vector;

[0059] The Krylov subspace construction module 20 includes an Arnoldi orthogonalization circuit unit 210, a Givens rotation circuit unit 220, a residual check circuit unit 230 and a solution circuit unit 240. The Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220 and the residual check circuit unit 230 are configured as a three-stage pipeline operation mode of interleaved parallel execution, wherein in each round of hardware circuit operation:

[0060] The Arnoldi orthogonalization circuit unit 210 is used to perform an orthogonalization operation based on the coefficient matrix and the basis vectors in the Krylov subspace to form a Hessenberg matrix by column.

[0061] The Givens rotation circuit unit 220 is used to perform upper triangular processing on the Hessenberg matrix to obtain an upper triangular Hessenberg matrix and determine the size of the residual after rotation;

[0062] The residual checking circuit unit 230 is used to evaluate the convergence of the Krylov subspace according to the size of the residual after rotation;

[0063] The solution circuit unit 240 is used for updating the solution vector by using the upper triangular Hessenberg matrix and the initial solution vector when the Krylov subspace reaches convergence.

[0064] The linear equation solver of the disclosed embodiment constructs a hardware initialization circuit module 10 and a Krylov subspace construction module 20 through FPGA, and configures the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220 and the residual check circuit unit 230 as a three-stage pipeline operation mode of staggered parallel execution, which can improve the execution efficiency of the hardware, improve the hardware resource utilization and the calculation speed, and is particularly suitable for scenarios such as scientific computing and engineering simulation that require solving large-scale sparse linear equations.

[0065] The disclosed embodiment does not limit the specific implementation methods of the initialization circuit module 10, the Krylov subspace construction module 20, the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220, the residual check circuit unit 230 and the solution circuit unit 240. Those skilled in the art can use FPGA to perform hardware programming according to actual conditions and needs and refer to relevant technologies to obtain corresponding hardware circuits.

[0066] It should be noted that the solver of the disclosed embodiment may also include a control module (not shown), which may also be implemented by an FPGA, and the operation control of other modules and units may be implemented by a hardware state machine (not shown). Of course, the implementation of the control module and the hardware state machine in the disclosed embodiment is not limited, and those skilled in the art may refer to the relevant technical implementation according to actual conditions and needs. The disclosed embodiment uses a pipeline method to control the operation of each circuit unit of the Krylov subspace construction module 20. The pipeline is divided into three stages, which respectively perform Arnoldi orthogonalization, Givens rotation and residual check. The modules are coordinated through a hardware state machine to ensure efficient operation of the pipeline. The overall design of the disclosed embodiment significantly improves resource utilization and computing speed, and is particularly suitable for scenarios such as scientific computing and engineering simulation that require solving large-scale sparse linear equations.

[0067] The following is an exemplary introduction to possible implementations of each module and unit.

[0068] Exemplarily, the initialization circuit module 10 can receive the initial solution vector, preset constants, and coefficient matrix of the linear equation group to be calculated from the control module or external input, and perform corresponding initialization operations, wherein the control module can also configure the target number of iterations of the iterative operation of the Krylov subspace construction module 20, and specify its maximum number of iterations MAX through the target number of iterations to set the operation boundary.

[0069] In a possible implementation, the step of determining the basis vectors of the Krylov subspace using the received initial solution vector of the linear equation group to be operated, the preset constants, and the coefficient matrix, and determining the first basis vector based on the initial basis vectors may include:

[0070] Determine a residual vector and a modulus of the residual vector according to the initial solution vector, the preset constant, and the coefficient matrix;

[0071] Determining the initial basis vector according to the ratio of the residual vector and the modulus of the residual vector;

[0072] The first basis vector is determined by using the ratio of the initial basis vector and the bi-norm of the initial basis vector.

[0073] Exemplarily, determining the residual vector and the modulus of the residual vector according to the initial solution vector, the preset constant, and the coefficient matrix can be implemented by the following formula:

[0074] r0=b-Ax0, where r0 represents the residual vector, A represents the coefficient matrix, b represents the preset constant vector, and x0 represents the initial solution.

[0075] Exemplarily, determining the initial basis vector according to the ratio of the residual vector and the modulus of the residual vector can be implemented by the following formula:

[0076] q0=r0 / ||r0||, where q0 represents the initial basis vector and ||r0|| represents the modulus of the residual vector.

[0077] For example, since the initial solution vector x0 is usually set to a zero vector, the initial residual vector is the constant term vector b, that is, the first basis vector is determined by using the ratio of the initial basis vector and the bi-norm of the initial basis vector to obtain: the first basis vector Where b represents the constant term vector of the linear equation system; ‖b‖ represents the bi-norm of the constant term vector, which is used for normalization calculation; v1 represents the first Krylov subspace basis vector after normalization; b i represents the i-th component of the preset constant vector b; n represents the dimension of the preset constant vector b, and n is a positive integer.

[0078] The following is an exemplary introduction to the pipeline operation of the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220, and the residual check circuit unit 230 in the embodiment of the present disclosure.

[0079] See also Figure 2 , Figure 2A schematic diagram is shown of a pipeline operation of the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220, and the residual check circuit unit 230 in the Krylov subspace construction module 20 according to an embodiment of the present disclosure.

[0080] In one possible implementation, the three-stage pipeline operation method of interleaved parallel execution may include, in the current round of hardware circuit operation, if any one of the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220 and the residual check circuit unit 230 completes the corresponding calculation task, then the calculation result is passed to the next level circuit unit, and the current circuit unit executes the corresponding calculation task of the next round of hardware circuit in parallel.

[0081] For example, Figure 2 As shown, if the Arnoldi orthogonalization circuit unit 210 forms a column of Hessenberg matrices, the column of Hessenberg matrices is transferred to the Givens rotation circuit unit 220, and the Arnoldi orthogonalization circuit unit 210 performs the orthogonalization operation of the next round of hardware circuit operations to form the next column of Hessenberg matrices, that is, when the Givens rotation circuit unit 220 performs the Givens rotation of the current round of hardware circuit operations (upper triangularization of the Hessenberg matrix of the current round is performed to obtain an upper triangular Hessenberg matrix, and the size of the residual after rotation is determined), the Arnoldi orthogonalization circuit unit 210 performs the Arnoldi orthogonalization of the next round of hardware circuits in parallel (performs an orthogonalization operation based on the coefficient matrix and the basis vectors in the Krylov subspace to form the next column of Hessenberg matrices).

[0082] For example, Figure 2 As shown, before the residual check circuit unit 230 determines that the Krylov subspace has reached convergence, the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220 and the residual check circuit unit 230 perform corresponding tasks in parallel in an alternating manner until the Krylov subspace has reached convergence, and the control module controls each circuit unit to stop running through the hardware state machine, or the number of iterations (the cumulative number of cycles of the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220 and the residual check circuit unit 230) reaches the target number of iterations, and the control module controls the above modules to restart the calculation process through the hardware state machine.

[0083] like Figure 2As shown, the technical solution before the pipeline (existing technology) cannot achieve a more efficient use of hardware resources and can only perform a job once. The embodiment of the present disclosure adopts a three-stage pipeline operation method of staggered parallel execution to improve the operating efficiency of the Arnoldi orthogonalization circuit unit 210, the Givens rotation circuit unit 220 and the residual check circuit unit 230, and improve the utilization rate of hardware resources.

[0084] Exemplarily, when the work of the initialization circuit module 10 is completed, the hardware state machine can control the Krylov subspace construction module 20 to perform corresponding work, for example, the hardware state machine controls the entry of the Krylov subspace construction module 20 pipeline operation. The system first enters the Arnoldi iteration phase (implemented by the Arnoldi orthogonalization circuit unit 210), which gradually expands the Krylov subspace through the Arnoldi algorithm, constructs the Hessenberg matrix by column, and adds the newly generated basis vectors to the Krylov subspace in each iteration and stores them in the loop register. When the Hessenberg matrix is ​​updated, the system enters the next stage of the pipeline, namely the Givens rotation phase executed by the Givens rotation circuit unit 220. The Givens rotation circuit unit 220 performs a Givens rotation on a column of the Hessenberg matrix generated in the previous stage. The system generates rotation parameters c and s, and gradually eliminates the sub-diagonal elements of the Hessenberg matrix. After completing the Givens rotation, the system enters the last stage of the pipeline, namely the residual check stage performed by the residual check circuit unit 230. In the residual check stage, the residual check circuit unit 230 determines whether the current residual meets the convergence condition. If the residual is less than the preset tolerance error, the solution circuit unit 240 uses the upper triangular Hessenberg matrix and the projection vector to solve the least squares problem and generate the final solution vector. If the residual does not converge, it is determined whether the maximum number of iterations (target number of iterations) is met. If not, it returns to the Arnoldi iteration stage and continues to expand the Krylov subspace for iteration. If the maximum number of iterations is reached, the restart module is started, the latest basis vectors of the loop register are retained, and the rest are cleared. Re-enter the Arnoldi subspace to iteratively expand the Krylov subspace.

[0085] The disclosed embodiment saves and manages the Krylov subspace basis vectors of the previous linear system through a circular register, and accelerates the generation of the Krylov subspace of the related linear system by reusing this information. For example, a register is used to save the currently generated Krylov subspace basis vector. When calculating the next basis vector, the projection of the current vector on the previously generated basis vector is first calculated, and the current vector is subtracted from its projection on each previous vector to ensure that the calculated vector is orthogonal to the previous basis vector. By saving the previously generated basis vectors, they can be retrieved and reused at any time, which accelerates the generation of new basis vectors, thereby accelerating the generation of Krylov subspaces.

[0086] The following is an exemplary introduction to possible implementations of the Arnoldi orthogonalization circuit unit 210.

[0087] See also Figure 3 , Figure 3 FIG. 2 shows a block diagram of the Arnoldi orthogonalization circuit unit 210 according to an embodiment of the present disclosure.

[0088] In a possible implementation, Figure 3 As shown, the Arnoldi orthogonalization circuit unit 210 may include a projection coefficient calculation unit 2210, a projection vector generation unit 2220, a vector update unit 2240, a basis vector normalization unit 2230, a Hessenberg matrix unit 2250, and a circular register 2260, wherein the circular register 2260 is used to store the updated spatial basis vectors.

[0089] The projection coefficient calculation unit 2210 is used to determine the projection coefficient according to the coefficient matrix and the basis vectors in the Krylov subspace, wherein the projection coefficient is used to represent the correlation between the current residual vector and the generated basis vectors;

[0090] The projection vector generating unit 2220 is used to determine the projection vector according to the coefficient matrix, the basis vectors in the Krylov subspace, and the projection coefficients;

[0091] The basis vector normalization unit 2230 is used to obtain a new basis vector according to the projection vector and its norm;

[0092] The vector update unit 2240 is used to update in the loop register 2260 and load the Hessenberg matrix in the Hessenberg matrix unit 2250 .

[0093] The embodiments of the present disclosure do not limit the specific implementation of the projection coefficient calculation unit 2210, the projection vector generation unit 2220, the vector update unit 2240, the basis vector normalization unit 2230, the Hessenberg matrix unit 2250, and the circulation register 2260. Those skilled in the art may use FPGA to implement them according to actual conditions and needs. It is worth noting that the projection coefficient calculation unit 2210, the projection vector generation unit 2220, the vector update unit 2240, the basis vector normalization unit 2230, the Hessenberg matrix unit 2250, and the circulation register 2260 can all be implemented by hardware circuits.

[0094] The disclosed embodiment implements the orthogonalization process of the current residual vector and the basis vector through hardware, and gradually generates new Krylov subspace basis vectors for iterative solution of the subsequent linear equations. The module significantly improves the efficiency of generating Krylov subspace basis vectors by accelerating the calculation through matrix block row-level parallelization, and supports dynamic adjustment of computing resources to adapt to the expansion requirements of different Krylov subspace dimensions.

[0095] In a possible implementation, the projection coefficient calculation unit 2210 may calculate the projection coefficient based on the following formula: Where A represents the coefficient matrix, v k represents the kth basis vector in the currently generated Krylov subspace, v j represents the jth basis vector in all Krylov subspaces, α k represents the projection coefficient.

[0096] Each iteration generates a new basis vector vk, where k represents the number of iterations or the index of the basis vector. j represents the basis vector index of the previous Krylov subspace, and j=1, 2, 3…k represents the inner product relationship between the current basis vector vk and all previously generated basis vectors v1, v2, v3…vk.

[0097] In a possible implementation, the projection vector generating unit 2220 may calculate the projection vector and the new basis vector based on the following formula: Among them, q k represents the orthogonalized projection vector, Represents the sum of the projections of the k+1th basis vector on all previously obtained basis vectors.

[0098] In a possible implementation, the basis vector normalization unit 2230 is configured to obtain the new basis vector according to the following formula: Among them, ||q k || represents the norm of the projection vector, vk+1 Denotes the (k + 1)-th basis vector of the Krylov subspace, i.e., the new basis vector.

[0099] It should be noted that q k is the orthogonalized projection vector, used to generate the new residual, representing the new vector obtained by subtracting the projections of all previous basis vectors from A·v k from A·v k is the way to solve the basis vectors of the Krylov subspace. For example, if there are already k basis vectors and the convergence condition is still not reached, then the (k + 1)-th basis vector needs to be solved at this time. First, multiply the coefficient matrix A by the k-th basis vector v k , and at this time this A·v k is temporarily regarded as the non-orthogonalized v k+1 . If you want to orthogonalize it, you need to make A·v k orthogonal to all previous basis vectors, so it needs to subtract its projections on all previous basis vectors. At this time, normalization has not been performed yet. Divide q k by its own modulus value, and the normalization is completed. It is a new basis vector, and at this time the basis vector is the new basis vector of the Krylov subspace. It is orthogonal to all previous vectors in the Krylov subspace.

[0100] Store the calculated orthogonal basis vector (v k+1 ) in the loop register 2260 and assemble the Hessenberg matrix in a separate unit through parallelization using the already generated data. Among them, the main diagonal element h k,k of the Hessenberg matrix is the coefficient of the projection of the vector w = Aq k onto the current basis vector q k , defined as:

[0101] The upper triangular region h j,k (j < k) of the Hessenberg matrix is the projection coefficient of the vector w = Av k onto the previous j-th basis vector v j , defined as:

[0102] The sub-diagonal element h k+1,k of the Hessenberg matrix is the normalization factor obtained through orthogonalization during the orthogonal process, used to generate the new orthogonal basis vector q k+1 , defined as:

[0103] Exemplarily, the main diagonal elements refer to the elements located on the diagonal from the upper left corner to the lower right corner in a multi-order matrix, and the positions of these elements satisfy that the row index m and the column index p are equal, that is, m=p. For example, in matrix A, elements a11, a22, a33, etc. are all main diagonal elements. Sub-diagonal elements refer to the elements located on the diagonal from the upper right corner to the lower left corner in an n-order matrix, and the positions of these elements satisfy that the row index and the column index differ by 1, that is, m=p+1 or m=p-1. For example, in matrix A, elements a12, a23, a34, etc. are all sub-diagonal elements. Non-diagonal elements refer to all elements in the matrix except the main diagonal elements and the sub-diagonal elements, and the positions of these elements do not satisfy the conditions of m=p or m=p±1. For example, in matrix A, elements a13, a24, a32, etc. are all non-diagonal elements.

[0104] After the first stage Arnoldi orthogonalization, the disclosed embodiment can gradually generate a column of Hessenberg matrix data. After the column of Hessenberg matrix is ​​generated, the column is immediately sent to the next stage of the pipeline for Givens rotation, while the first stage continues to run and assemble the remaining Hessenberg matrix column data. In this way, each stage of the pipeline can work in parallel and staggered to achieve real-time processing and transmission of data.

[0105] In a possible implementation, the Givens rotation circuit unit 220 may be used to:

[0106] Determine a rotation matrix according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix;

[0107] The rotation matrix is ​​multiplied by the Hessenberg matrix to obtain the upper triangular Hessenberg matrix.

[0108] The embodiments of the present disclosure do not limit the specific implementation method of determining the rotation matrix according to the main diagonal elements and sub-diagonal elements in the Hessenberg matrix, and determining the rotation matrix according to the main diagonal elements and sub-diagonal elements in the Hessenberg matrix. Those skilled in the art can adopt relevant technologies to implement according to actual conditions and needs, which is exemplarily introduced below.

[0109] For example, the rotation matrix can be described as:

[0110]

[0111] The rotation matrix acts on the Hessenberg matrix H k The kth and k+1th rows of can be briefly expressed as:

[0112] Among them, c k represents the first rotation parameter, s k Represents the second rotation parameter.

[0113] In a possible implementation, determining the rotation matrix according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix may include:

[0114] Determining a rotation radius according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix;

[0115] Determining a first rotation parameter according to a ratio of the main diagonal element to the rotation radius;

[0116] Determining a second rotation parameter according to a ratio of the sub-diagonal element to the rotation radius;

[0117] The rotation matrix is ​​determined according to the first rotation parameter and the second rotation parameter as follows:

[0118] Among them, c k represents the first rotation parameter, s k Represents the second rotation parameter.

[0119] Exemplarily, the rotation radius is determined according to the main diagonal elements and the secondary diagonal elements in the Hessenberg matrix, which can be implemented by the following formula:

[0120] Among them, r k Indicates the radius of rotation.

[0121] Exemplarily, multiplying the rotation matrix by the Hessenberg matrix to obtain the upper triangular Hessenberg matrix can be implemented by the following formula:

[0122]

[0123] The disclosed embodiment sets the last data in a column of data obtained by Hessenberg in the previous stage to zero through matrix multiplication.

[0124] In the Givens rotation stage, the disclosed embodiment can eliminate the sub-diagonal elements of the current column of the Hessenberg matrix, and realize the gradual upper triangularization of the Hessenberg matrix by constructing a local orthogonal rotation matrix. During the rotation process, each operation only affects two rows of elements, while maintaining the sparsity and numerical stability of the matrix. Among them, the residual vector is also updated synchronously. As each rotation eliminates the sub-diagonal elements, the components of the right-hand vector are also adjusted. The residual after rotation is directly determined by the new right-hand component. For example, in the Givens rotation process, the right-hand component refers to the component related to the right-hand vector in the linear system or matrix equation. Specifically, if a matrix equation is considered: Ax=b, in the Givens rotation process, the right-hand component is the relevant part of the vector b.

[0125] Illustratively, in the Givens rotation stage, the disclosed embodiment can independently assign hardware units (including those responsible for performing matrix multiplication operations and adders and subtractors) to each row of the Hessenberg matrix to parallelly process the upper triangularization operation of the Hessenberg matrix, and achieve row-level parallel updates by assigning independent computing units to each row, thereby improving hardware work efficiency.

[0126] In a possible implementation, determining the size of the residual after rotation may include:

[0127] The size of the residual after rotation is determined by the following formula, where the formula indicates that the residual rotates with the H matrix:

[0128] H represents the Hessenberg matrix, β represents the residual size before rotation, β′ represents the residual size after rotation update, G k represents the rotation matrix.

[0129] For example, during the k-th rotation process, the rotation matrix G k Not only does it eliminate the current Hessenberg matrix H k The sub-diagonal elements h k+1,k , and acts on the residual vector βe1 at the same time, thereby updating the residual size. k The orthogonal property of can get the update formula of the residual vector as shown above, which can easily implement residual update.

[0130] The embodiments of the present disclosure do not limit the specific implementation method of evaluating the convergence of the Krylov subspace. Those skilled in the art can set the corresponding preset threshold according to actual conditions and needs, and use the size of the updated residual and the preset threshold to judge the convergence status, which is exemplarily introduced below.

[0131] In a possible implementation, evaluating the convergence of the Krylov subspace may include:

[0132] Calculating the residual of the current solution and comparing it with a preset threshold. When the residual of the current solution is less than the preset threshold, it is determined that the Krylov subspace has converged; otherwise, it is determined that the Krylov subspace has not converged.

[0133] In a possible implementation, when the Krylov subspace has not converged, the Krylov subspace construction module 20 is configured to continue or re-update the Hessenberg matrix until the Krylov subspace converges or the number of iterations reaches the target number of iterations.

[0134] Wherein, the solver further includes a recycling module (not shown), and the recycling module is configured to: when the number of iterations reaches the target number of iterations and the Krylov subspace has not converged, the recycling module is used to extract the most recently generated M basis vectors from the Krylov subspace, and clear the remaining basis vectors in the cyclic register 2260 except for these M basis vectors. These M basis vectors are used as new initial vectors, and M is an integer greater than or equal to 1.

[0135] Of course, the recycling module can also be implemented through the hardware programming language of the FPGA, and the embodiments of the present disclosure do not limit this.

[0136] In the residual check stage, the control module monitors the magnitude β′ of the rotated residual and compares it with a preset threshold tolerance. When β′ < tolerance (tolerance is the preset residual threshold), the control module issues a signal to stop further Krylov subspace expansion and Givens rotation operations and directly enters the solution update stage. Otherwise, the control module triggers a new round of iteration. At the same time, the control module can dynamically adjust the hardware resource allocation, such as the management of the basis vectors in the cyclic register 2260, to ensure the efficient progress of the calculation process.

[0137] The embodiments of the present disclosure do not limit the specific implementation manner of updating the solution vector by the solution circuit unit 240 through the upper triangular Hessenberg matrix and the initial solution vector. Those skilled in the art can adopt relevant technologies according to the actual situation and needs. An exemplary introduction is given below.

[0138] Exemplarily, assume that the linear equation system to be solved is Ax = b. At this time, an orthogonal basis matrix Q m (Krylov subspace) has been obtained. At this time, let x = x0 + Q my, so the residual r=bA(x0+Q m y)=r0-AQ m y, where x0 is the initial guess value and r0 is the initial residual value. Based on Hessenberg's property, we can deduce the formula r=r0-Q m+ 1H m y, because Q m It is an orthogonal unit matrix, and we can multiply both sides of the equation by Q T Simplified derivation: ∥r∥=∥βe1-H m y∥. Where β=∥r0∥, e1 is a unit vector. That is, the minimum residual value is min∥βe1-H m y∥. When convergence is reached, x needs to be solved, that is, the coefficient y is solved first, and then the value of x is solved by back substitution. For example, the coefficient y can be obtained by the least squares method, and then the coefficient y is substituted into the following formula to complete the current solution vector x k Specifically:

[0139] x k =x0+Q k y k

[0140] Among them, x0 is the initial solution, Q k is the orthogonal basis matrix of the Krylov subspace (including the aforementioned V k ), y k is the coefficient obtained by the least squares method. The updated solution x k The orthogonal basis vectors in this iteration are stored in the loop register 2260 and can be used for the next approximate calculation.

[0141] Of course, when the solution circuit unit 240 updates the solution vector through the upper triangular Hessenberg matrix and the initial solution vector, the solution update efficiency can be improved by matrix segmentation and row-level parallel calculation, wherein the matrix segmentation is to divide the large matrix into multiple small blocks by row, and each small block is handed over to different computing units for processing. Row-level parallelism is that the calculation task of each row is completed independently, and each row can be calculated in parallel in different units at the same time. This method makes full use of hardware resources, significantly accelerates matrix operations, and improves solution update efficiency. Exemplarily, the Krylov subspace basis vector matrix can be segmented by row, each row is assigned to an independent hardware unit (including responsible for matrix multiplication and adder-subtractor), and the calculation results of each row are accumulated row by row to generate a complete solution vector to improve parallelization efficiency.

[0142] Through the above-mentioned hardware design, the disclosed embodiment realizes an efficient method for solving a system of linear equations based on hardware parallelization. This pipeline design parallelizes the computing tasks in stages, so that while the Arnoldi orthogonalization generates the basis vectors and Hessenberg matrix data of the subsequent columns, the Givens rotation module can process the sub-diagonal elements of the previous column, without waiting for the entire Hessenberg matrix to be completely generated before starting the rotation operation. This column-by-column processing mechanism significantly reduces the data dependency and synchronization waiting time during the calculation process, and maximizes the parallel working efficiency of the hardware module. In addition, this design can closely connect the expansion of the Krylov subspace with the upper triangulation of the matrix, avoiding the phenomenon of single module waiting or being idle, thereby making full use of hardware resources and improving the overall throughput and computing efficiency of the pipeline, which is particularly suitable for iterative solution scenarios of large-scale sparse matrices.

[0143] The overall operation of the linear equation solver is exemplarily introduced below.

[0144] See also Figure 4 , Figure 4 A schematic diagram of the operation flow of the linear equation solver according to an embodiment of the present disclosure is shown.

[0145] See also Figure 5 , Figure 5 A schematic diagram of the operating state of a linear equations solver according to an embodiment of the present disclosure is shown.

[0146] For example, Figure 4 As shown in the figure, a complete settlement process includes:

[0147] The control module inputs the coefficient matrix A, constant vector b, initial solution x0, tolerance (preset threshold of residual) into the initialization module, and specifies the maximum number of iterations max;

[0148] The residual r0=b-Ax0 is calculated through the initialization module, the residual modulus ||r0|| is determined, and a basis vector q0=r0 / ||r0|| of the Krylov subspace is generated;

[0149] The system enters the pipeline operation of the Krylov subspace construction module 20. The system first enters the Arnoldi iteration phase, in which the Krylov subspace is gradually expanded by the Arnoldi algorithm, the Hessenberg matrix is ​​constructed column by column, and the newly generated basis vectors are added to the Krylov subspace in each iteration and stored in the loop register 2260.

[0150] After the Hessenberg matrix is ​​updated, the system enters the next stage of the pipeline, performs Givens rotation on a column of the Hessenberg matrix generated in the previous stage, and generates rotation factors c and s (i.e., the first rotation parameter and the second rotation parameter), and gradually eliminates the sub-diagonal elements of the Hessenberg matrix;

[0151] After completing the Givens rotation, the system enters the final stage of the pipeline, the residual check stage, to determine whether the current residual meets the convergence condition. If the residual is less than the preset threshold tolerance, it enters the solution module, using the upper triangular Hessenberg matrix and the projection vector to solve the least squares problem and generate the final solution vector;

[0152] If the residual does not converge, it is determined whether the maximum number of iterations has been reached. If not, it returns to the Arnoldi iteration stage and continues to expand the Krylov subspace for iteration. If the maximum number of iterations has been reached, the restart module is started, the latest basis vectors of the loop register 2260 are retained, and the rest are cleared. Re-enter the Arnoldi subspace to iteratively expand the Krylov subspace.

[0153] Exemplarily, the disclosed embodiment coordinates and controls each module through a hardware state machine, and different states correspond to different stages of the pipeline to ensure the orderly flow of data and calculation logic. The state machine is clock-driven, and dynamically determines the next state according to the current state of the system, the completion signals of each module (such as valid and done), the iteration count, and the residual check results through the state transfer logic, and sends a control signal to start or pause the relevant module. In the initialization stage, the state machine starts the initialization module, loads the matrix and vector data of the linear equation group, and sets the initial basis vector of the Krylov subspace. After the initialization is completed, the state machine enters the Arnoldi orthogonalization stage, starts the Krylov subspace construction module, triggers the matrix-vector multiplication and orthogonalization process through the control signal, and monitors the completion signal of the module to ensure that the orthogonalized result is correctly stored in the register.

[0154] Exemplarily, when the Arnoldi orthogonalization is completed, the state machine enters the Givens rotation stage, and controls the Givens rotation module to perform QR decomposition on the Hessenberg matrix. At this time, the state machine manages the generation and transmission of parameters, and updates the rotation results to the register for use by subsequent modules. After completing the Givens rotation, the state machine enters the residual check stage, controls the residual check module to calculate the residual of the current solution and compare it with the target accuracy. If the residual meets the convergence condition, the state machine immediately notifies the solution module to use the current Krylov subspace and the least squares method result to generate the final solution vector, and enters the completion state; if the residual does not meet the convergence condition, the state machine decides whether to return to the Arnoldi stage to continue to expand the Krylov subspace, or start the restart module according to the iteration count. When the number of iterations reaches the upper limit but the residual has not converged, the state machine activates the restart module, controls it to save some of the latest basis vectors in the current Krylov subspace, clears the loop register 2260 and the intermediate results, and resets the initial basis vector to start a new round of Krylov subspace generation.

[0155] Throughout the process, the state machine precisely controls the start and stop of each module, the order of data flow, and the update of registers to ensure that the system can efficiently complete the task of solving the linear equations while avoiding resource conflicts or data errors. Through this state-driven fine control, the system can achieve seamless connection between modules and maximize the efficiency of the pipeline and the utilization of hardware resources.

[0156] For example, Figure 5 As shown, in the entire calculation or processing process, after each state is completed, the control module can send a completion signal to indicate that the current state has been successfully completed. Subsequently, the system will switch to the next state according to the predetermined logic. Such a process is executed sequentially through multi-state iterations until all steps are completed. At the end of the entire iterative process, the system will output the solution vector of the calculation result and auxiliary information related to the solution vector. This design ensures the close connection between the states, improves the automation and operation efficiency of the process, and ensures the accuracy and completeness of the results.

[0157] In summary, the disclosed embodiment proposes a linear equation solver based on hardware parallelization, which realizes fast and efficient solution of linear equations through the design of hardware modules. The Arnoldi algorithm is used to expand the Krylov subspace and construct the Hessenberg matrix, combined with the least squares solution of the Recyled GMRES algorithm to ensure efficient convergence of complex linear equations. The modular hardware design further enhances the performance of the solver, among which the Arnoldi iteration, Givens rotation and residual update are highly parallelized through pipeline design to significantly improve the computing speed of the system; the three-level optimization design of the hardware pipeline ensures the data fluency and task continuity between each step, while improving the solution efficiency and throughput.

[0158] In addition, it is worth mentioning that the hardware of the disclosed embodiment is mainly implemented by FPGA, and does not require the use of processors such as CPU, and all operations are implemented in hardware programming. Arnoldi orthogonalization, Givens rotation, and residual check are implemented as independent hardware units, each of which has its own operation logic and control circuit. Data transfer is achieved between each module through hardware registers or FIFO queues to ensure that the modules can work independently and are not affected by the status of other modules. In the pipeline, each level of modules runs in an independent hardware unit, and data is transferred in stages. For example: The Hessenberg matrix column generated by the Arnoldi module will be immediately passed to the Givens rotation module, and the Arnoldi module continues to process the next column. After the Givens module completes the rotation operation, it passes the result to the residual check module and processes the next column of data at the same time. This design avoids the sequential execution of the traditional CPU single-thread reliance and greatly improves the parallelism of the task. In this way, the embodiments of the present disclosure solve the shortcomings of existing methods in terms of computing speed, parallelization capability and hardware resource utilization, especially when facing large-scale computing tasks (such as large-scale sparse linear equations). It can overcome the performance bottlenecks of traditional methods and provide efficient and reliable solutions for scenarios such as scientific computing, engineering simulation and real-time data processing. Through hardware optimization and modular design, it significantly improves solution efficiency and resource utilization.

[0159] According to one aspect of the present disclosure, a computing chip is provided, wherein the chip includes the linear equation solver.

[0160] It can be understood that the above-mentioned embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned embodiments of the specific implementation methods, the specific execution order of the corresponding functions of each module should be determined according to its function and possible internal logic.

[0161] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A linear equation solver, characterized in that: Each circuit module in the solver is implemented based on FPGA, and the solver includes: An initialization circuit module is used to determine the initial basis vector of the Krylov subspace using the received initial solution vector of the linear equation group to be operated, the preset constant constant, and the coefficient matrix, and determine the first basis vector based on the initial basis vector; The Krylov subspace construction module includes an Arnoldi orthogonalization circuit unit, a Givens rotation circuit unit, a residual check circuit unit and a solution circuit unit. The Arnoldi orthogonalization circuit unit, the Givens rotation circuit unit and the residual check circuit unit are configured as a three-stage pipeline operation mode of interleaved parallel execution, wherein in each round of hardware circuit operation: The Arnoldi orthogonalization circuit unit is used to perform an orthogonalization operation based on the coefficient matrix and the basis vectors in the Krylov subspace to form a Hessenberg matrix by column. The Givens rotation circuit unit is used to perform upper triangular processing on the Hessenberg matrix to obtain an upper triangular Hessenberg matrix and determine the size of the residual after rotation; The residual checking circuit unit is used to evaluate the convergence of the Krylov subspace according to the residual size after the rotation; The solution circuit unit is used for updating the solution vector by using the upper triangular Hessenberg matrix and the initial solution vector when the Krylov subspace reaches convergence.

2. The solver according to claim 1, characterized in that The method of determining the basis vector of the Krylov subspace by using the received initial solution vector of the linear equation group to be operated, the preset constant, and the coefficient matrix, and determining the first basis vector based on the initial basis vector, includes: Determine a residual vector and a modulus of the residual vector according to the initial solution vector, the preset constant, and the coefficient matrix; Determining the initial basis vector according to the ratio of the residual vector and the modulus of the residual vector; The first basis vector is determined by using the ratio of the initial basis vector and the bi-norm of the initial basis vector.

3. The solver according to claim 1, characterized in that: The three-level pipeline operation method of interleaved parallel execution includes: in the current round of hardware circuit operation, if any one of the Arnoldi orthogonalization circuit unit, the Givens rotation circuit unit and the residual check circuit unit completes the corresponding calculation task, the calculation result is passed to the next level circuit unit, and the current circuit unit executes the corresponding calculation task of the next round of hardware circuit in parallel.

4. The solver according to claim 1, characterized in that: The Arnoldi orthogonalization circuit unit includes a projection coefficient calculation unit, a projection vector generation unit, a vector update unit, a basis vector normalization unit, a Hessenberg matrix unit, and a circular register, wherein the circular register is used to store the updated space basis vectors. The projection coefficient calculation unit is used to determine the projection coefficient according to the coefficient matrix and the basis vectors in the Krylov subspace, and the projection coefficient is used to represent the correlation between the current residual vector and the generated basis vectors; The projection vector generating unit is used to determine the projection vector according to the coefficient matrix, the basis vectors in the Krylov subspace, and the projection coefficient; The basis vector normalization unit is used to obtain a new basis vector according to the projection vector and its norm; The vector update unit is used to update in the loop register and load the Hessenberg matrix in the Hessenberg matrix unit.

5. The solver according to claim 4, characterized in that: The projection coefficient calculation unit calculates the projection coefficient based on the following formula: Where A represents the coefficient matrix, v k represents the kth basis vector in the currently generated Krylov subspace, v j represents the jth basis vector in all Krylov subspaces, α k represents the projection coefficient; The projection vector generation unit calculates the projection vector and the new basis vector based on the following formula: Among them, q k represents the orthogonalized projection vector, represents the sum of the projections of the k+1th basis vector on all previously obtained basis vectors; The basis vector normalization unit is used to obtain the new basis vector according to the following formula: Among them, ||q k || represents the norm of the projection vector, v k+1 represents the k+1th basis vector of the Krylov subspace, i.e., the new basis vector.

6. The solver according to claim 1, characterized in that: The Givens Rotary Circuit Unit is used to: Determine a rotation matrix according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix; The rotation matrix is ​​multiplied by the Hessenberg matrix to obtain the upper triangular Hessenberg matrix.

7. The solver according to claim 6, characterized in that: The step of determining the rotation matrix according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix includes: Determining a rotation radius according to the main diagonal elements and the sub-diagonal elements in the Hessenberg matrix; Determining a first rotation parameter according to a ratio of the main diagonal element to the rotation radius; Determining a second rotation parameter according to a ratio of the sub-diagonal element to the rotation radius; The rotation matrix is ​​determined according to the first rotation parameter and the second rotation parameter as follows: Among them, c k represents the first rotation parameter, s k Represents the second rotation parameter.

8. The solver according to claim 7, characterized in that: The determining of the residual size after rotation includes: The size of the residual after rotation is determined by the following formula: H represents the Hessenberg matrix, β represents the residual size before rotation, β ′ represents the residual size after rotation update, G k represents the rotation matrix.

9. The solver according to claim 1, characterized in that: The step of evaluating the convergence of the Krylov subspace includes: The residual of the current solution is calculated and compared with a preset threshold. When the residual of the current solution is less than the preset threshold, it is determined that the Krylov subspace has reached convergence; otherwise, it is determined that the Krylov subspace has not reached convergence.

10. The solver according to claim 4, characterized in that: In the case that the Krylov subspace does not reach convergence, the Krylov subspace construction module is configured to continue or re-update the Hessenberg matrix until the Krylov subspace reaches convergence or the number of iterations reaches a target number of iterations. The solver further includes a recycling module, which is configured as follows: when the number of iterations reaches the target number of iterations and the Krylov subspace has not reached convergence, the recycling module is used to extract the most recently generated M basis vectors from the Krylov subspace, and clear the remaining basis vectors in the circular register except the M basis vectors, and the M basis vectors are used as new initial vectors, where M is an integer greater than or equal to 1.

11. A computing chip, characterized in that: The chip comprises a linear equation solver as described in any one of claims 1-10.