A matrix inversion method and system based on iterative calculation of Cholesky decomposition

Through an iterative calculation method based on Cholesky decomposition, an upper triangular matrix is ​​generated and the storage form is converted, which solves the computational complexity and resource waste problems in high-order matrix inversion operations and realizes efficient matrix inversion operations.

CN119441699BActive Publication Date: 2025-09-30NANJING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411555384.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2025-09-30
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

The existing technology has high computational complexity and large resource consumption in high-order matrix inversion operations, and the single storage format cannot meet the requirements of general matrix multiplication, resulting in low computational efficiency and waste of resources.

Method used

An iterative calculation method based on Cholesky decomposition is adopted to generate the inverse matrix by generating the upper triangular matrix and performing iterative processing. Its storage form is converted into sequential storage to reuse the matrix multiplication module. At the same time, the storage form in SRAM is optimized to reduce the zero-padding time.

Benefits of technology

The computational efficiency and scalability of matrix inversion are improved, the computation time is shortened, computing resources are saved and performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441699B_ABST
    Figure CN119441699B_ABST
Patent Text Reader

Abstract

The present application discloses a matrix inversion method and system for iterative calculation based on Cholesky decomposition, which relates to the field of DSP system optimization technology. The method includes obtaining a target source matrix; performing a first iterative process on the target source matrix based on Cholesky decomposition to generate an upper triangular matrix; performing a second iterative process on the upper triangular matrix to generate an inverse matrix of the upper triangular matrix; performing a conjugate transpose process on the inverse matrix of the upper triangular matrix to generate a lower triangular matrix; wherein the lower triangular matrix is ​​stored in the form of whole column storage; the storage mode of the inverse matrix of the upper triangular matrix is ​​converted into a sequential storage form; performing matrix multiplication process on the inverse matrix of the upper triangular matrix and the lower triangular matrix to generate the inverse matrix of the target source matrix. The present application replaces cumulative summation with iteration, adopts complex multiplication and addition optimization calculation, supports multi-parallel operation, parallelizes zero-filling operation, can adapt to general matrix multiplication module, and reduces calculation time and area overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of DSP system optimization, and in particular to an iterative calculation matrix inversion method and system based on Cholesky decomposition. Background Art

[0002] With the rapid development of information technology, the demand for data processing capabilities is increasing. In hot areas such as big data processing and artificial intelligence, intensive computing tasks are becoming increasingly common. Matrix operations, as the core of intensive computing, fundamentally determine overall system performance. Matrix inversion, a typical matrix operation, is increasingly demanding support for high-performance and high-order matrix computations.

[0003] Matrix inversion is computationally and memory-intensive. As the matrix order increases, the time, space, and computational resource costs required to support the inversion operation increase exponentially, significantly restricting the inversion of high-order matrices. As a computationally intensive operation, the inversion of high-order matrices takes a significant amount of time to compute. Furthermore, since, in addition to storing the original matrix, additional space is required to store intermediate results and the final inverse matrix, this can be a problem when memory is limited. For these reasons, software-implemented matrix inversion performs poorly in real-time applications. Researchers have attempted to accelerate matrix inversion using FPGAs (field-programmable gate arrays). However, because FPGAs primarily perform computations using lookup tables, the granularity is relatively fine, and significant resources are dedicated to configurable on-chip routing and wiring, resulting in low computational resource utilization.

[0004] Since hardware has the inherent advantage of parallel computing, using ASIC (Application Specific Integrated Circuit) to accelerate matrix inversion can provide higher performance. In the traditional Cholesky decomposition, the elements of the matrix L can be obtained by the following recursive formula:

[0005]

[0006] The algorithm directly uses formulas for calculation, which requires multiplication and accumulation computing resources, and the calculation and addressing complexity are high. In addition, the subsequent triangular matrix inversion also has the disadvantages of high computing resource requirements and high computational complexity. Therefore, the algorithm is limited to calculating matrix inversion for low-order matrices or matrices of specific orders. Therefore, reducing the computational complexity of matrix inversion, reducing the required computing resources, and improving the efficiency of matrix inversion have become key means to break the bottleneck of matrix inversion calculation. In addition, since matrix inversion calculation inevitably uses matrix multiplication, and the two source data matrices used in matrix multiplication usually need to be stored in SRAM according to the entire row (row major order) and the entire column (column major order) respectively, the storage form of the two matrices to be calculated obtained by existing Cholesky inversion is single, which cannot meet the universal data storage form of matrix multiplication. Only a special triangular matrix multiplication module can be designed inside the Cholesky inversion system, which does not have versatility and cannot reuse a general matrix multiplication module. At the same time, the current iterative processing Cholesky inversion method requires additional allocation time for the two zero-padding operations in the Cholesky decomposition and triangular matrix inversion stages, which greatly reduces the performance of matrix inversion. Summary of the Invention

[0007] In view of the deficiencies in the prior art, the present application discloses an iterative matrix inversion method and system based on Cholesky decomposition.

[0008] In a first aspect, the present application provides an iterative matrix inversion method based on Cholesky decomposition, for use in a DSP system, comprising:

[0009] Obtaining a target source matrix; wherein the target source matrix includes: an N-order conjugate positive definite matrix;

[0010] Based on Cholesky decomposition, performing a first iterative process on the target source matrix to generate an upper triangular matrix;

[0011] Performing a second iterative process on the upper triangular matrix to generate an inverse matrix of the upper triangular matrix;

[0012] Performing conjugate transposition processing on the inverse matrix of the upper triangular matrix to generate a lower triangular matrix; wherein the lower triangular matrix is ​​stored in the form of whole column storage;

[0013] Converting the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage form to reuse the matrix multiplication module in the DSP system;

[0014] Matrix multiplication is performed on the inverse matrix of the upper triangular matrix and the lower triangular matrix to generate the inverse matrix of the target source matrix.

[0015] As an optional implementation, generating an upper triangular matrix includes:

[0016] Performing a square root operation on the diagonal elements of the target source matrix and calculating the reciprocal thereof to determine the diagonal elements of the upper triangular matrix;

[0017] Performing a complex multiplication operation on the off-diagonal elements following the diagonal elements in the Nth row of the target source matrix to update the off-diagonal elements of the upper triangular matrix;

[0018] Based on the upper triangular matrix elements, each element of the lower right rectangular area of ​​the target source matrix is ​​calculated and updated;

[0019] In response to completing N calculation updates, the first iterative process ends and the upper triangular matrix is ​​generated.

[0020] As an optional implementation manner, generating the inverse matrix of the upper triangular matrix includes:

[0021] Performing a reciprocal operation on the diagonal elements of the upper triangular matrix to determine the diagonal elements of the inverse matrix;

[0022] Performing a complex multiplication operation on the off-diagonal elements above the diagonal elements in the Nth column of the upper triangular matrix to update the off-diagonal elements of the inverse matrix;

[0023] Based on the updated off-diagonal elements of the inverse matrix, each element in the upper right rectangular area of ​​the upper triangular matrix is ​​calculated and updated;

[0024] In response to completing N calculation updates, the second iterative process ends and an inverse matrix of the upper triangular matrix is ​​generated.

[0025] As an optional implementation, generating a lower triangular matrix includes:

[0026] Based on a first preset order, extract each element in the inverse matrix of the upper triangular matrix one by one;

[0027] Performing conjugate complex number calculation on each of the extracted elements;

[0028] Based on the second preset order, the elements after the conjugate complex number calculation are sequentially placed into the storage area of ​​the lower triangular matrix.

[0029] As an optional implementation, the first preset order includes: taking out row by row; the second preset order includes: putting in column by column;

[0030] The row-by-row extraction includes: extracting each element from the first row of the inverse matrix of the upper triangular matrix from left to right in sequence; then extracting elements from the second row from left to right in sequence; and continuing to process in the same order until all elements of all rows have been extracted;

[0031] The column-by-column placing includes: storing the elements after the conjugate complex number calculation in the storage area of ​​the lower triangular matrix in order of columns;

[0032] The elements taken from the first row are stored in the first column of the lower triangular matrix in sequence;

[0033] The elements taken from the second row are stored in the second column of the lower triangular matrix;

[0034] Continue processing in the same order until all elements have been stored in their corresponding columns.

[0035] As an optional implementation, it also includes:

[0036] The area for storing matrix elements is SRAM, which consists of 64 banks. Each bank is composed of four SRAM IPs with a width of 64 bits and a depth of 1024 bits. The splicing includes depth splicing and width splicing.

[0037] The SRAM is divided into a plurality of partitions, including a source data 1 area, a source data 2 area, a result area, and an intermediate result area; wherein each of the partitions is composed of 16 banks.

[0038] As an optional implementation, the inverse matrix of the upper triangular matrix is ​​stored in a column-by-column manner; wherein, elements of each column of the inverse matrix of the upper triangular matrix are stored in the same bank, the elements of the 1st and 2nd columns are placed in bank1, the elements of the 3rd and 4th columns are placed in bank2, and so on, the elements of the 15th and 16th columns are placed in bank8, and then the elements of the 17th and 18th columns are again stored in bank1, forming a cycle;

[0039] Converting the storage mode of the inverse matrix of the upper triangular matrix to a sequential storage mode includes: for the inverse matrix of the upper triangular matrix stored in a column storage mode, taking data row by row and filling them into 8 banks in sequence, storing the first and second elements of the first row of the matrix into bank 1, the third and fourth elements into bank 2, and so on, until the 15th and 16th elements are stored into bank 8, and then the 17th and 18th elements are stored into bank 1 again, forming a cycle.

[0040] As an optional implementation, the method further includes: performing a piecewise zero-padding operation on row elements of the target source matrix; wherein when an element of a row is below a corresponding column, the corresponding off-diagonal element in the row is set to zero;

[0041] When an element of a row is located on or above the diagonal of the corresponding column, the off-diagonal elements of the row are calculated and updated to determine their values.

[0042] In a second aspect, the present application further provides an iterative matrix inversion system based on Cholesky decomposition, comprising: a matrix receiving module, a matrix decomposition module, a triangular matrix inversion module, a matrix transposition module, a storage conversion module, and a matrix multiplication module; wherein,

[0043] The matrix receiving module is used to obtain a target source matrix; wherein the target source matrix includes: an N-order conjugate positive definite matrix;

[0044] The matrix decomposition module is used to perform a first iterative process on the target source matrix based on Cholesky decomposition to generate an upper triangular matrix;

[0045] The triangular matrix inversion module is used to perform a second iterative process on the upper triangular matrix to generate an inverse matrix of the upper triangular matrix;

[0046] The matrix transposition module is used to perform conjugate transposition processing on the inverse matrix of the upper triangular matrix to generate a lower triangular matrix; wherein the lower triangular matrix is ​​stored in the form of whole column storage;

[0047] The storage conversion module is used to convert the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage form;

[0048] The matrix multiplication module is used to perform matrix multiplication processing on the inverse matrix of the upper triangular matrix and the lower triangular matrix to generate the inverse matrix of the target source matrix.

[0049] Compared with the prior art, the present invention has the following beneficial effects: in the calculation of matrix inversion based on Cholesky decomposition, the present invention deconstructs the original cumulative summation form in an iterative manner, replaces the complex multiplication and accumulation calculation with complex multiplication and complex addition, and saves calculation resources; at the same time, the present invention supports multi-parallel calculation operations, greatly shortens the calculation time, and improves the calculation efficiency; in addition, the present invention changes the storage form of the calculated triangular matrix in SRAM to meet the storage form requirement of general matrix multiplication in SRAM, can reuse multiple matrix multiplication modules, improves the scalability of Cholesky matrix inversion, and when performing algorithm integration, due to the reusability of the present invention, can greatly save area overhead; finally, the present invention modifies the calculation process to process the zero-padding step in parallel with the remaining steps, avoids additional zero-padding time, greatly shortens the calculation time of the matrix inversion, and improves the performance of the matrix inversion. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A flowchart of a method for iteratively calculating a matrix inversion based on Cholesky decomposition provided in an embodiment of the present disclosure;

[0051] Figure 2 This is an overall architecture diagram of a matrix inversion hardware system provided by an embodiment of the present disclosure;

[0052] Figure 3 A flowchart of matrix inversion calculation based on Cholesky decomposition provided in an embodiment of the present disclosure;

[0053] Figure 4 A schematic diagram of a Cholesky decomposition using multi-parallel iteration provided in an embodiment of the present disclosure;

[0054] Figure 5 A schematic diagram of a triangular matrix inversion method using multi-parallel iteration provided by an embodiment of the present disclosure;

[0055] Figure 6 A schematic diagram of sequential storage of matrix elements in SRAM provided by an embodiment of the present disclosure;

[0056] Figure 7 A schematic diagram of storing matrix elements in SRAM in a column format according to an embodiment of the present disclosure;

[0057] Figure 8 A schematic diagram of an iterative matrix inversion system based on Cholesky decomposition provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0059] See Figure 2 , Figure 2 This is an overall architecture diagram of a matrix inversion hardware system provided in an embodiment of the present disclosure; the system can be regarded as a DSP system for executing an iterative matrix inversion method based on Cholesky decomposition according to the present disclosure.

[0060] cho_inv_fsm and tri_inv_fsm correspond to the control logic for Cholesky decomposition and triangular matrix inversion, respectively. The Finite State Machine (FSM) is the core component that controls the hardware execution sequence. In Cholesky decomposition, the FSM coordinates each step of the matrix decomposition; in triangular matrix inversion (Tri_inv), the FSM controls the computational steps of the matrix inversion.

[0061] top_fsm is the main control module of the entire system, which is used to coordinate the data flow and task scheduling between different modules to ensure that the hardware system executes in sequence.

[0062] The PE_MUX is used to select data flows between different processing units. These units can include multiplication (mul_send, mul_rec), addition / multiply-add (mul_add_send, mul_add_rec), and division (div_send, div_rec). A MUX can be thought of as a data selector, selecting the appropriate processing path based on the specific task.

[0063] The Cholesky decompose section is marked in the red box on the left, showing the computational units used for the Cholesky decomposition process, including:

[0064] div_send: responsible for sending the division operation data to the division calculation unit.

[0065] mul_send: responsible for sending the multiplication operation data to the multiplication calculation unit.

[0066] mul_add_send: responsible for sending the multiplication and addition operation data to the addition / multiplication and addition calculation unit.

[0067] data_gen: Used to generate the data required for the Cholesky decomposition process. During the data generation phase, the present invention implements a piecewise zero-padding operation. Data is selected based on a conditional judgment: all elements before the diagonal are zero, and the elements after the diagonal are data stored in SRAM. Zero-padding is performed as data is retrieved, avoiding the need to zero-paint the lower triangular area after the Cholesky decomposition calculation is completed.

[0068] The Tri_inv section, shown in the red box on the right, shows the computational units used to process the inversion of a triangular matrix, similar to the Cholesky decomposition section, including:

[0069] Modules such as div_rec, mul_rec, and mul_add_rec are used to receive and process the calculation results of division, multiplication, multiplication-addition, and other operations, and generate the storage address of the calculation results.

[0070] Pre_padding is a module used to preprocess input data. It involves aligning or zero-padding the input matrix to meet the hardware's computational requirements (for example, aligning the matrix to a certain bit width). Since the SRAM interval used for zero-padding is different from the SRAM interval used for Cholesky decomposition, the SRAM used to store the triangular matrix inversion can be zero-padding simultaneously with the Cholesky decomposition calculation. Since the Cholesky decomposition calculation takes longer than the zero-padding time, the zero-padding operation can be completed before the triangular matrix inversion stage, thus avoiding the need to allocate additional time for zero-padding.

[0071] reorder is a module responsible for reordering matrix data. Since matrix decomposition and inversion require accessing data by column or row, this module is used to ensure that the data storage order matches the calculation order.

[0072] The SRAM_MUX is the system's storage control module, responsible for managing SRAM access and data transfer. All data in the system, including input matrices, intermediate results, and the final inverse matrix, must be stored in SRAM and dispatched through the SRAM_MUX. The SRAM_MUX can switch between multiple data streams, such as reading data from the reorder or transpose modules or sending data to the compute engine (PE_MUX).

[0073] transpose is responsible for transposing matrix data. During the matrix inversion process, the inverse of an upper triangular matrix needs to be conjugate transposed to generate a lower triangular matrix. This module implements the data transposition function.

[0074] From input data generation (data_gen) to Cholesky decomposition and triangular matrix inversion, data passes through various computational modules and is ultimately stored and retrieved via SRAM_MUX. Cholesky decomposition and triangular matrix inversion are the two core steps in the matrix inversion process. Cholesky decomposition decomposes a matrix into upper and lower triangular matrices, while triangular matrix inversion calculates the inverse of the upper triangular matrix.

[0075] Reordering is used to sort data as necessary to meet the hardware's computational requirements. During matrix multiplication, the entire row elements of Source 1 and the entire column elements of Source 2 must be multiplied and accumulated. To increase the parallelism of matrix multiplication, multiple data points must be multiplied and accumulated at a time. This requires simultaneous access to multiple banks, and the storage format of the data within the banks must be specified. For Source 1, multiple elements in the same row must be retrieved each time, so the data is stored in SRAM as a column (column-major order). For Source 2, multiple elements in the same column must be retrieved each time, so the elements are stored in SRAM as a row (row-major order). The reordering module converts the storage format of the two calculated matrices from a single column to both a column and a row, meeting the general matrix multiplication requirements for source data storage in SRAM. Any matrix multiplication module can be reused, improving reuse and increasing the scalability of the Cholesky matrix inversion system.

[0076] This hardware system utilizes multiple modules working together to perform matrix inversion operations based on Cholesky decomposition. The primary computations include Cholesky decomposition and triangular matrix inversion, with data storage and management managed via SRAM. The MUX module controls the selection and switching of data flows, while the rearrangement and transposition modules ensure the correct order of data during computations. This system architecture is designed to efficiently handle large-scale matrix operations and is suitable for implementation in a hardware-accelerated environment.

[0077] See Figure 1 , is a flowchart of an iterative matrix inversion method based on Cholesky decomposition provided by an embodiment of the present disclosure, the method comprising steps S101 to S106, wherein:

[0078] S101: Acquire a target source matrix; wherein the target source matrix includes: an N-order conjugate positive definite matrix;

[0079] S102: performing a first iterative process on the target source matrix based on Cholesky decomposition to generate an upper triangular matrix;

[0080] S103: performing a second iterative process on the upper triangular matrix to generate an inverse matrix of the upper triangular matrix;

[0081] S104: performing conjugate transposition processing on the inverse matrix of the upper triangular matrix to generate a lower triangular matrix; wherein the lower triangular matrix is ​​stored in the form of whole column storage;

[0082] S105: Converting the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage mode to reuse the matrix multiplication module in the DSP system;

[0083] S106: Perform matrix multiplication processing on the inverse matrix of the upper triangular matrix and the lower triangular matrix to generate the inverse matrix of the target source matrix.

[0084] Cholesky decomposition is a matrix decomposition technique that decomposes a symmetric positive definite matrix into a lower triangular matrix and its conjugate transpose. This technique simplifies matrix operations and is particularly well-suited for solving linear equations and performing matrix inversion operations. This decomposition can reduce computational complexity and optimize numerical stability.

[0085] For example, see Figure 3 , Figure 3 A flowchart of a matrix inversion calculation based on Cholesky decomposition provided in an embodiment of the present disclosure is provided. The calculation process can be performed based on steps S101 to S106 above, wherein:

[0086] It is divided into two main stages: Cholesky decomposition stage and triangular matrix inversion stage, which finally generates the inverse matrix of the matrix.

[0087] In the Cholesky decomposition stage, the target matrix is ​​decomposed into an upper triangular matrix and a lower triangular matrix. The specific steps are as follows:

[0088] Step 1: Find the square roots of the diagonal elements: First, take the square root of the diagonal elements of the matrix to find the square roots of the diagonal elements. The diagonal elements are a very important part of the decomposition process and must be positive definite.

[0089] Step 2: Find the inverse square root: Next, calculate the inverse square root of these diagonal elements. This step provides the necessary intermediate values ​​for subsequent off-diagonal element updates.

[0090] Step 3: Update row elements at iteration N: Then, in each iteration, for each row of the matrix, update the corresponding off-diagonal elements, using the previously calculated diagonal elements to update these off-diagonal elements.

[0091] Step 4: Update the elements in the lower right rectangular area: After updating the diagonal elements and the corresponding off-diagonal elements, start updating the lower right rectangular area of ​​the matrix, which is the unprocessed area. This step gradually completes the decomposition process by gradually reducing the unprocessed area of ​​the matrix.

[0092] Step 5: Zero padding of triangular matrix: In order to ensure the accuracy of the decomposition results and optimize the efficiency of hardware operations, the unprocessed triangular matrix area needs to be padded with zeros to prevent unnecessary data interference.

[0093] The upper triangular matrix generated by the Cholesky decomposition needs to be inverted. The specific steps are as follows:

[0094] Step 6: Reciprocal of diagonal elements: Perform reciprocal operation on the diagonal elements of the upper triangular matrix to generate the diagonal elements of the inverse matrix.

[0095] Step 7: Update column elements at the Nth iteration: Similar to the operation of updating row elements during Cholesky decomposition, during the generation of the inverse matrix, the non-diagonal elements of each column are updated in turn.

[0096] Step 8: Update the elements in the upper right rectangular area: After the column elements are updated, the elements in the upper right rectangular area also need to be updated. This step ensures that the inverse matrix of the upper triangular matrix can be correctly generated.

[0097] Step 9: Conjugate transpose of the triangular matrix: After generating the inverse matrix of the upper triangular matrix, perform a conjugate transpose operation on it to generate a lower triangular matrix.

[0098] In the final stage of matrix inversion, data storage and conversion operations are performed:

[0099] Step 10: Convert the entire column storage to sequential storage: Convert the storage format of the inverse matrix of the upper triangular matrix from the entire column storage to sequential storage to facilitate subsequent matrix multiplication operations.

[0100] Step 11: Matrix multiplication: In the last step, the inverse matrix of the upper triangular matrix is ​​multiplied by the lower triangular matrix to generate the inverse matrix of the target matrix.

[0101] The entire process completes the matrix inversion operation through a step-by-step decomposition and inversion process. In hardware implementation, the efficiency of matrix operations can be significantly improved through parallel column- and row-first processing.

[0102] Regarding S101 above:

[0103] In a specific implementation, it is necessary to obtain an N-order conjugate positive definite matrix as the input source matrix of the matrix inversion method of the present invention. This matrix can be provided by an external input module or generated internally by the computer system. The target source matrix has the following characteristics:

[0104] It is an N-order matrix, that is, the matrix has N rows and N columns;

[0105] The matrix is ​​a conjugate positive definite matrix, which satisfies the condition that all eigenvalues ​​of the matrix are positive and the matrix is ​​symmetric.

[0106] For example, in a specific application scenario, the matrix may be a matrix generated by data processing in signal processing, scientific computing, or other engineering fields.

[0107] By obtaining an N-th-order conjugate positive definite matrix as the source matrix, the input matrix is ​​guaranteed to possess specific mathematical properties: its eigenvalues ​​are all positive and symmetric. This type of matrix is ​​widely used in applications such as scientific computing and signal processing. Using this matrix as input ensures the feasibility of the subsequent Cholesky decomposition and lays the foundation for efficient inversion calculations.

[0108] Regarding S102 above:

[0109] In a specific implementation, after obtaining the target source matrix, a Cholesky decomposition operation is first performed on it. The Cholesky decomposition method adopted by the present invention decomposes the matrix through recursive processing, decomposing the original conjugate positive definite matrix A into a lower triangular matrix L and its conjugate transposed matrix L T ,Right now:

[0110] A=L·L T

[0111] Among them, L is a lower triangular matrix, L T In the specific implementation of the present invention, the upper triangular matrix U is actually calculated and stored.

[0112] To generate this upper triangular matrix, the decomposition process is performed iteratively, and each iteration consists of the following steps:

[0113] Take the square root of the diagonal elements and find the reciprocal to get the diagonal elements of the upper triangular matrix;

[0114] performing a complex multiplication operation on the off-diagonal elements in the rows following the diagonal elements, and updating these off-diagonal elements in the matrix;

[0115] Update the elements of the lower right rectangular area of ​​the matrix through recursive processing.

[0116] After completing N iterations, the upper triangular matrix U is finally obtained.

[0117] In this way, the source matrix is ​​decomposed into an upper triangular matrix through an iterative process based on the Cholesky decomposition. Compared with traditional methods that directly solve the matrix inverse, the Cholesky decomposition gradually reduces the computational complexity by iteratively updating the diagonal and off-diagonal elements of the matrix. This decomposition can improve computational efficiency in hardware systems with limited computing resources, avoiding the computational overhead and complexity associated with direct inversion.

[0118] For example, Figure 4 A Cholesky decomposition diagram using multiple parallel iterations is shown. In this diagram, the elements of the matrix A i,j The decomposition is clearly distinguished between diagonal and off-diagonal elements. The diagram shows the demarcation of the different regions using dashed lines, with arrows indicating the direction of parallel processing. Overall, the decomposition process uses a column-first update approach, performing matrix processing and updates in parallel.

[0119] In this hardware system, matrix element updates are performed in a column-first manner. As indicated on the left side of the diagram, 16 columns are processed simultaneously in each iteration. This highly parallel processing significantly improves computational efficiency, particularly in a hardware-accelerated environment, where parallel processing can significantly reduce the time overhead of a single operation. Furthermore, the hardware system utilizes multiple computing units to execute each column update in parallel, ensuring high efficiency during data processing.

[0120] As the iterations progress, the number of columns updated gradually decreases. This can be seen in the annotation on the right side of the figure: when the number of iterations is a multiple of 16, the number of columns to be updated decreases by 16. In other words, with every 16 iterations, the size of the matrix to be processed decreases, and the complexity of the decomposition gradually decreases. This characteristic conforms to the mathematical properties of the Cholesky decomposition: as the diagonal elements are gradually decomposed and determined, the remaining unprocessed area gradually decreases, significantly reducing the workload of subsequent iterations.

[0121] For the specific operation of each iteration, the red dotted line in the figure indicates the area to be updated in the current iteration, while the black dotted line indicates the area that has been updated. 1,1 ,A 16,16 ,A 32,32 etc. are the core elements of Cholesky decomposition. Each iteration first processes these diagonal elements, ensures that they are positive and completes the corresponding square root operation. After the diagonal elements are processed, the elements in the off-diagonal area are gradually updated. For example, like A 1,16 and A 17,16Such non-diagonal elements are updated iteratively after the diagonal elements are processed.

[0122] The system's multi-degree-of-parallelism strategy ensures that, in each iteration, multiple columns are processed simultaneously, not just a single matrix column, accelerating the entire Cholesky decomposition process. The efficiency of parallel processing is primarily reflected in the fact that by processing matrix elements in 16 columns simultaneously, the system can maximize the use of the hardware's parallel computing resources. In hardware design, this parallel strategy can effectively speed up matrix solutions and reduce processing time, making it particularly suitable for solving large-scale matrices.

[0123] In summary, Figure 4 The diagram in the figure details the multi-degree-of-parallel iterative Cholesky decomposition process. The matrix is ​​gradually decomposed using column-first parallel updates. With each iteration, the area to be processed is gradually reduced as the diagonal elements are determined, until the entire matrix is ​​decomposed and solved. This approach not only improves computational efficiency but also fully utilizes hardware acceleration, making large-scale matrix inversion possible.

[0124] As an optional implementation, the generating of the upper triangular matrix includes: performing a square root operation on the diagonal elements of the target source matrix and calculating its reciprocal to determine the diagonal elements of the upper triangular matrix; performing a complex multiplication operation on the non-diagonal elements located after the diagonal elements in the Nth row of the target source matrix to update the non-diagonal elements of the upper triangular matrix; based on the upper triangular matrix elements, performing a calculation update on each element of the lower right rectangular area of ​​the target source matrix; in response to completing N calculation updates, ending the first iterative processing to generate the upper triangular matrix.

[0125] For each element a in row N kj , the present invention designs a zero-filling mechanism, when k>j, a kj =0; when k≤j, a kj =a kj , and then perform the operation This segmented zero-filling mechanism avoids the need for an additional separate zero-filling stage and reduces the Cholesky decomposition time.

[0126] Exemplarily, the Cholesky decomposition is expressed as follows:

[0127]

[0128] where u kk are the diagonal elements of the upper triangular matrix, a kk are the diagonal elements of the source matrix, and k is the current number of iterations.

[0129]

[0130] in is the multiplier to be multiplied by the elements following the diagonal elements in the kth row.

[0131]

[0132] where u kj is the element following the diagonal element of the k-th row of the upper triangular matrix.

[0133]

[0134] in is the result of iteration of the elements in the lower right rectangular area, a ij is the value before iteration of the lower right rectangular area, is the complex conjugate of the k-th row element of the upper triangular matrix.

[0135] Through the above steps, the system iteratively processes the diagonal elements and off-diagonal elements of the target source matrix until N iterations are completed to generate a complete upper triangular matrix U.

[0136] The upper triangular matrix is ​​generated step by step through multiple iterations. This iterative processing method ensures that each step is based on the processed matrix elements, reducing error propagation and improving the accuracy of the calculation results.

[0137] Regarding S103 above:

[0138] In the specific implementation, after generating the upper triangular matrix U, the inverse matrix of the upper triangular matrix is ​​generated. This process is also completed through iteration, and the specific steps are as follows:

[0139] First, find the inverse of the diagonal elements of the upper triangular matrix to determine the diagonal elements of the inverse matrix;

[0140] Perform complex multiplication on the off-diagonal elements of the upper triangular matrix and update the corresponding off-diagonal elements of the inverse matrix;

[0141] Finally, update the elements of the upper right rectangular area to ensure that all elements of the inverse matrix are calculated accurately.

[0142] After N iterative processes, the inverse matrix U of the upper triangular matrix U is finally obtained. -1 .

[0143] In a specific implementation, it is first necessary to process the diagonal elements of the upper triangular matrix, specifically to perform a reciprocal operation thereon, so as to determine the diagonal elements of the inverse matrix.

[0144] For example,

[0145] The inversion of the described triangular matrix is ​​expressed as follows:

[0146] s kk =1 / u kk

[0147] where s kk is the diagonal element of the inverse matrix, u kk are the diagonal elements of the upper triangular matrix, and k is the current number of iterations.

[0148]

[0149] in is the result of the elements above the diagonal elements of the kth column of the inverse matrix after iteration, s ik The value before the iteration.

[0150]

[0151] in is the result of the elements in the upper right rectangular area after iteration, s ij The value before the iteration.

[0152] Through the above steps, after N iterative processes, the inverse matrix U of the upper triangular matrix is ​​finally generated -1 The inverse matrix will be used in subsequent conjugate transpose operations and matrix multiplication operations.

[0153] This step generates the inverse matrix by iterating over the upper triangular matrix. Compared to directly inverting the entire matrix, iteratively updating the diagonal and off-diagonal elements can reduce numerical errors during the calculation process and is particularly suitable for inverting large matrices. This step ensures calculation accuracy and optimizes the overall matrix inversion process.

[0154] For example, Figure 5 A schematic diagram of a triangular matrix inversion using multi-parallel iteration provided in an embodiment of the present disclosure.

[0155] In the figure, U ij Represents the elements of the upper triangular matrix, distributed on different rows and columns. The diagonal elements of the matrix are the key parts, such as U 11 ,U kk ,U k+16k+16 These diagonal elements will be processed first during the inversion of the triangular matrix.

[0156] The entire diagram shows how to update a matrix incrementally through parallel processing. The arrows indicate the direction of parallel processing (PARALLEL), meaning that the matrix is ​​updated from the top left to the bottom right, updating both rows and columns simultaneously.

[0157] exist Figure 5 In the example, the matrix update process uses a parallel strategy, updating 16 columns at a time, one at a time. The label "16 columns at a time, updating downwards" on the right side of the figure indicates that the system can process multiple columns of data simultaneously in each iteration, thereby improving the efficiency of the inversion process.

[0158] The red and blue dashed boxes indicate the update areas at different stages:

[0159] The black dashed box represents the 16 columns of data being processed in the current iteration. This data is gradually updated as the iteration proceeds. The red dashed box indicates the area of ​​the matrix that has been processed or is being processed in the current processing phase. This area is part of the area to be updated. The blue dashed box represents the area of ​​the matrix that will be updated in the next iteration. This segmented processing strategy allows the system to parallelize computations and gradually reduce the problem size after each update. Specifically, as the number of iterations increases, the upper right rectangular area that requires updating gradually shrinks.

[0160] When solving the inverse matrix of an upper triangular matrix, it is mainly divided into the following steps:

[0161] Inverse the diagonal elements: For example, 11 ,U kk ,U k+16k+16 To process, these elements are first reciprocated to obtain their inverse elements. The diagonal elements are the basis of the solution process and can be used to update other off-diagonal elements after processing.

[0162] Updating Off-Diagonal Elements: During each 16-column update, in addition to the diagonal elements, the remaining off-diagonal elements must be updated through incremental iterations and multiplications. These off-diagonal element updates depend on the calculation results of the diagonal elements in the previous iteration. By parallelizing processing, the system can process all 16 columns of data simultaneously, significantly accelerating the inversion of triangular matrices.

[0163] as Figure 5 As shown in the lower right corner, the unprocessed matrix area gradually shrinks with each iteration. The update process starts at the upper left corner of the matrix and progresses diagonally toward the lower right corner, updating 16 columns at a time. As the number of iterations increases, the amount of data to be processed decreases, and the solution speed gradually increases.

[0164] By gradually reducing the update range, the system can ensure the accuracy and efficiency of matrix inversion while maintaining high parallelism.

[0165] Regarding S104 above:

[0166] After the inverse matrix of the upper triangular matrix is ​​generated, a conjugate transpose operation is performed on it to obtain a lower triangular matrix. Specifically, the following steps are followed: each element of the inverse matrix of the upper triangular matrix is ​​extracted one by one in row order; a conjugate complex operation is performed on each extracted element; and the conjugate complex elements are placed in the storage area of ​​the lower triangular matrix in column order. When storing, the elements of the first row are sequentially used as the first column of the lower triangular matrix, the elements of the second row are sequentially used as the second column of the lower triangular matrix, and so on. Finally, the conjugate transpose process of the entire inverse matrix of the upper triangular matrix is ​​completed to generate the lower triangular matrix.

[0167] In a specific implementation, each element in the inverse matrix of the upper triangular matrix is ​​first taken out one by one according to a first preset order. The first preset order is to take out the matrix elements row by row:

[0168] First, extract all elements from the first row of the inverse upper triangular matrix. Then extract the elements from the second row, and so on, until all rows have been extracted. This operation ensures that all matrix elements are extracted in order, facilitating subsequent conjugate complex number calculations.

[0169] Each extracted upper triangular matrix inverse matrix element is subjected to conjugate complex operation. The specific operation is as follows: if an element is a+bi, its conjugate complex number is a-bi; each extracted element is subjected to this operation in turn to generate the conjugate complex number element.

[0170] After the conjugate complex number calculation, the elements are stored in a storage area of ​​the lower triangular matrix in a second preset order. The second preset order is storage in column order: the elements generated in the first row are stored in the first column of the lower triangular matrix, the elements in the second row are stored in the second column, and so on, until all elements are stored.

[0171] Through the above operations, all elements of the upper triangular inverse matrix have been extracted one by one, their complex conjugates calculated, and stored in order in the lower triangular matrix. At this point, the complete lower triangular matrix is ​​generated and ready for subsequent matrix operations.

[0172] In this way, a lower triangular matrix is ​​generated by performing a conjugate transpose on the inverse of an upper triangular matrix. When processing complex matrices, directly performing conjugate operations on the matrix elements can effectively avoid error accumulation. The conjugate transpose process converts an upper triangular matrix into a lower triangular matrix, which facilitates the optimization of subsequent matrix multiplication.

[0173] Regarding S105 above:

[0174] The inverse matrix of the upper triangular matrix is ​​initially stored in the hardware storage area in the form of "whole column storage". In order to improve the efficiency of subsequent matrix multiplication operations, the present invention converts the storage mode of the matrix into "sequential storage" form. The specific steps are as follows: read each element row by row from the matrix stored in the whole column; store the elements in each row in sequence in row order to ensure that the matrix is ​​arranged in the form of "row by row" in the storage. In this way, by converting the inverse matrix of the upper triangular matrix from the whole column storage form to the sequential storage form, the present invention significantly optimizes the computational efficiency of the subsequent matrix multiplication. In the hardware environment, the whole column storage is suitable for parallel processing, but the efficiency is low when accessing row by row. The sequential storage method makes it more convenient to access the matrix elements, especially when performing matrix multiplication, which can reduce the random access operation of the memory and improve the overall performance of the hardware. In addition, one of the purposes of changing the data storage form to sequential storage is to adapt the matrix multiplication module, and any matrix multiplication module can be reused, thereby improving the reuse rate and increasing the scalability of the Cholesky matrix inversion system. As an optional embodiment, the first preset order includes: taking out row by row; the second preset order includes: putting in column by column;

[0175] The row-by-row extraction includes: extracting each element from the first row of the inverse matrix of the upper triangular matrix from left to right in sequence; then, extracting elements from the second row from left to right in sequence; and continuing to process in the same order until all elements of all rows have been extracted.

[0176] The column-by-column placing includes: storing the elements that have undergone conjugate complex number calculation in a storage area of ​​the lower triangular matrix in column order; storing the elements taken out from the first row in the first column of the lower triangular matrix; storing the elements taken out from the second row in the second column of the lower triangular matrix; and continuing to process in the same order until all elements have been stored in corresponding columns.

[0177] In practice, we first extract each element from the first row of the upper triangular inverse matrix, sequentially from left to right. Next, we extract each element from the second row, sequentially from left to right. This process repeats until all elements in all rows have been extracted, row by row, until the last row has been extracted. This process extracts all elements of the upper triangular inverse matrix in row-first order, facilitating subsequent conjugate complex number calculations and storage.

[0178] Regarding S106 above:

[0179] In the specific implementation, after completing the storage mode conversion, the upper triangular matrix U -1 The lower triangular matrix (U -1 ) T Perform matrix multiplication. According to the matrix multiplication formula:

[0180] A -1 =U -1 ·(U -1 ) T

[0181] Through this operation, the inverse matrix of the target source matrix A is finally generated.

[0182] Thus, by transforming the upper triangular matrix U -1 and the lower triangular matrix (U -1 ) T The multiplication operation is performed to generate the inverse matrix of the target matrix. Matrix multiplication is a key step in matrix inversion. By transforming the decomposition and storage methods previously described, the matrix multiplication module can be reused, increasing reuse. In a hardware-accelerated environment, this step-by-step processing and optimized storage significantly reduces the time complexity and resource usage of matrix operations. The resulting inverse matrix can meet the real-time requirements of large-scale computing applications while ensuring accuracy.

[0183] As an optional implementation, the area for storing matrix elements is SRAM, which consists of 64 banks. Each bank is composed of four SRAM IPs with a width of 64 bits and a depth of 1024 bits, and can be stitched together in depth and width. The entire SRAM is divided into source data area 1, source data area 2, result area, and intermediate result area. Each partition consists of 16 banks.

[0184] SRAM (static random access memory) is used to store matrix elements. To meet the storage requirements of large-scale matrix calculations, SRAM design uses multi-bank parallel storage, optimizing data access efficiency through appropriate memory partitioning and splicing strategies. The following describes the composition and partitioning of SRAM in detail.

[0185] For example, the SRAM in the present invention is composed of 64 banks, each of which is constructed through width stitching and depth stitching. Specifically, each bank is stitched together by four 64-bit wide and 1024-deep SRAM IPs; width stitching: four 64-bit wide SRAM IPs are stitched together to achieve a total bit width of 256 bits, which can increase the amount of data read or written at one time; depth stitching: 1024-deep SRAM IPs are stitched together to meet the storage capacity required for large-scale matrix operations. This stitching method not only increases the total storage capacity of the SRAM, but also improves the data access bandwidth, making it suitable for parallel processing of large-scale matrix data.

[0186] The entire SRAM storage space is divided into four functional areas, each consisting of 16 banks. The specific partitions are as follows: Source Data Area 1: used to store the input target source matrix 1, supporting high-speed access to matrix data; Source Data Area 2: used to store the input target source matrix 2, ensuring independent storage from matrix 1 to facilitate matrix parallel calculations; Result Area: used to store the final inverse matrix result generated by the calculation; Intermediate Result Area: used to store intermediate data during the iterative calculation process for use in subsequent calculations. This partitioning design ensures that data during matrix operations does not interfere with each other, and by storing source data and intermediate results separately, it can significantly improve data transmission efficiency during parallel processing.

[0187] The 64 SRAM banks are spliced ​​together by combining bit width and depth to form larger storage units. Width splicing expands parallel access capabilities, while depth splicing provides deeper storage for large amounts of data. The specific steps include splicing every four SRAM IP units by bit width, creating a 256-bit bit width. This splicing supports simultaneous read and write operations of large amounts of data, optimizing the efficiency of large-scale data processing during matrix inversion.

[0188] In practice, banks in each functional area are independently accessed, enabling parallel reading and writing of source data, results, and intermediate data. This high-bit-width data transmission allows the system to quickly access and process large amounts of matrix data during matrix inversion operations, significantly reducing data access latency and improving overall computational efficiency.

[0189] Thus, by adopting a multi-bank parallel SRAM structure and a rational partitioning strategy, the present invention achieves efficient storage and fast access to large-scale matrix data. Width-width splicing improves data transmission parallelism, depth-width splicing increases storage capacity, and functional area division prevents data from interfering with each other, ensuring independent storage of source data, computational results, and intermediate results. This design is particularly well-suited for performing large-scale matrix inversion operations in a hardware-accelerated environment, significantly improving the system's overall computing performance and data processing efficiency.

[0190] As an optional implementation, the storage method of the inverse matrix of the upper triangular matrix is ​​converted to a sequential storage method, including: the storage method of the inverse matrix of the upper triangular matrix is ​​whole column storage, that is, each column element of the matrix is ​​stored in the same bank, the 1st and 2nd column elements are placed in bank1, the 3rd and 4th column elements are placed in bank2, and so on, the 15th and 16th column elements are placed in bank8, and then the 17th and 18th column elements are stored in bank1 again, forming a loop. Step 4 requires changing the whole column storage method to a sequential storage method, that is, starting from row to row, filling in 8 banks in sequence, the 1st and 2nd elements of the first row of the matrix are stored in bank1, the 3rd and 4th elements are stored in bank2, and so on, until the 15th and 16th elements are stored in bank8, and then the 17th and 18th elements are stored in bank1 again, forming a loop. Step 4 requires taking out and putting in matrix elements one by one.

[0191] In practice, to optimize data access efficiency in matrix multiplication, this application converts element storage from column-by-column to sequential storage. Sequential storage stores matrix elements row by row, ensuring better continuity and consistency when accessing data.

[0192] For example, in the full column storage format, the inverse matrix of the upper triangular matrix is ​​stored in column order, that is, the elements of each column of the matrix are stored in the same bank. The specific storage method is as follows:

[0193] The elements of columns 1 and 2 are stored in bank1;

[0194] The elements in the 3rd and 4th columns are stored in bank2;

[0195] Similarly, the elements in columns 15 and 16 are stored in bank8;

[0196] Subsequently, the elements of the 17th and 18th columns are stored in bank1 again to form a circular storage.

[0197] This storage method allows two columns of matrix elements to be stored consecutively in each bank, which helps to read matrix data in its entirety.

[0198] In order to improve the access efficiency of data in matrix multiplication operations, this application converts the storage form of the inverse matrix of the upper triangular matrix from whole column storage to sequential storage. The specific conversion steps are as follows: take out the inverse matrix elements of the upper triangular matrix one by one in row order; for example, starting from the first row, take out each element in the first row. The taken elements are stored in the bank in sequence according to the following rules: the 1st and 2nd elements of the first row are stored in bank1; the 3rd and 4th elements are stored in bank2; the 15th and 16th elements are stored in bank8 in sequence; the 17th and 18th elements are stored in bank1 again, forming a circular storage. Repeat the above operation for the elements of subsequent rows until all elements are stored in the bank in sequence.

[0199] This sequential storage format ensures that the elements of each row of the matrix are distributed and stored in multiple banks, which is conducive to subsequent parallel reading and processing.

[0200] During the conversion process, the elements of each row are sequentially stored in the memory cells from bank 1 to bank 8. When the storage of the eight banks is completed, the next set of data is stored again starting from bank 1. This ensures the sequential consistency of data during storage and facilitates efficient subsequent access and processing.

[0201] Through this circular storage method, the system can effectively utilize storage bandwidth in subsequent operations and improve the parallelism of data transmission.

[0202] It should be noted that the inverse matrix generated at the beginning is not stored sequentially but stored as a whole column. This is to optimize the storage and access efficiency of specific calculation steps in matrix operations. For example, in matrix decomposition, especially in operations such as Cholesky decomposition, column-by-column updates or column-first operations are performed. The whole-column storage method allows for fast access and updates to column data during matrix calculations: operations such as Cholesky decomposition and matrix inversion usually involve column-by-column processing. For example, when updating matrix elements, all elements of a column need to be accessed at once. Whole-column storage allows the elements of each column to be concentrated in the same bank, thereby optimizing the access efficiency of such operations. When matrix operations are processed column by column, column-first storage can avoid frequent cross-bank accesses, thereby reducing memory access latency and increasing calculation speed.

[0203] In hardware implementation, whole-column storage enables parallel access to data in each column, fully leveraging the multi-bank structure and parallel computing resources in the hardware. Column-first access ensures that during matrix operations, data in each column can be read from the same bank at once, reducing cross-bank data access operations.

[0204] Multiple banks can effectively improve bandwidth utilization when accessing data in parallel. For example, a bank storing two columns of data can simultaneously process multiple data blocks using a higher bit width (such as 256 bits), thereby improving parallel computing efficiency.

[0205] When inverting an upper triangular matrix, matrix updates and solutions are typically performed in column-first order. Because inverting the matrix involves incrementally updating the elements of each column, column-based storage facilitates fast updates and storage of these elements during the computation. Column-by-column updates during matrix inversion reduce wasted memory bandwidth and hardware resources, ensuring that each column operation accesses data from only one bank.

[0206] If sequential storage, i.e., row-by-row storage, is initially used, matrix decomposition or inverse matrix generation may require accessing different columns of data in a row across multiple banks for each operation. This can lead to the following problems: Low cross-bank access efficiency: Due to the parallel computing characteristics of hardware, when accessing multiple banks each time, if each bank only stores a small portion of data, banks will be frequently switched during calculations, resulting in reduced memory access efficiency. Poor data locality: Row-by-row storage destroys data locality in column-first calculations, resulting in a loss of computing performance. This is especially true when processing large matrices, as this storage method may lead to frequent cache invalidations and data swapping.

[0207] In subsequent operations, especially when matrix multiplication is required, row-by-row access is more efficient. Therefore, after the initial matrix inversion, the entire column storage is converted to sequential storage to accommodate subsequent matrix multiplication and other row-first operations. Sequential storage distributes each row's data across multiple banks, significantly improving data access efficiency and computation speed when processing matrices row by row.

[0208] For example, see Figure 7 , Figure 7 This diagram illustrates an embodiment of the present disclosure, providing a schematic diagram of storing matrix elements in SRAM as columns. In this storage method, elements in each column of the matrix are stored sequentially in a different bank. This design optimizes column-priority operations, such as matrix decomposition or column-priority computation, and is suitable for hardware parallel processing.

[0209] Figure 7The SRAM in the FPGA is divided into eight banks (BANK0 through BANK7), each of which stores multiple columns of matrix elements. With whole-column storage, each matrix column is stored sequentially in the same bank. For example, BANK0 stores columns 1 and 2, columns 17 and 18, and so on. BANK1 stores columns 3 and 4, columns 19 and 20, and so on.

[0210] In each bank, multiple columns of matrix elements are stored continuously until all columns are fully stored. BANK0, BANK1, and so on, store multiple columns of elements in sequence until all columns (e.g., columns 16k+1 to 16k+16) are fully stored.

[0211] Each bank stores elements from multiple columns, organized as entire columns. For example, in BANK0, the elements of columns 1 and 2 are stored in corresponding banks. Adjacent columns (such as columns 17 and 18) are also stored in the same bank to facilitate column-first operations. This arrangement assigns all columns of the matrix to different banks, forming a cyclic structure. For example, after columns 1 through 16 are stored, columns 17 through 32 are stored in the same order.

[0212] This storage method is very efficient for column-first computations. In Cholesky factorization, matrix inversion, or other column-first computations, the processor needs to access all elements of a column at once. Storing the entire column of data in the same bank ensures that all required column data is in the same memory block each time it is accessed, reducing latency for cross-bank accesses and improving access speed.

[0213] from Figure 7 As can be seen from the storage diagram, each group of 16 columns of data is stored in 8 banks, forming a cycle. For example, the data of columns 1 and 2 are stored in BANK0; the data of columns 17 and 18 are also stored in BANK0.

[0214] This column-loop storage ensures that data can still be stored efficiently when the matrix size increases, and in column-first operations, the system can process data from multiple different columns in the same way.

[0215] For example, see Figure 6 , Figure 6A diagram illustrating the sequential storage of matrix elements in SRAM. As can be seen in the figure, each column of SRAM cells is divided into banks, each storing a different matrix element. The colored arrows in the figure indicate the order in which data is stored and read, demonstrating how the matrix elements are stored in row-major order in each bank.

[0216] exist Figure 6 In the SRAM, the storage structure is divided into multiple banks (BANK0 to BANK7), each of which stores a portion of matrix elements. These matrix elements are stored in different banks in row-first order: BANK0 stores the first and second elements of row 1, A. 11 ,A 12 , the first and second elements A in the second row 21 ,A 22 , and the first and second elements A in row N N1 ,A N2 BANK1 stores the 3rd and 4th elements A in row 1. 13 ,A 14 , the 3rd and 4th elements A in the 2nd row 23 ,A 24 , and the 3rd and 4th elements A in row N N3 ,A N4 By analogy, all matrix elements are stored in 8 different banks in this row-by-row order.

[0217] Figure 6 The sequential storage format is shown in Figure 1. The elements of the matrix are filled into each bank in a row-first manner. The specific operations of this sequential storage format are:

[0218] The first row element A 11 ,A 12 ,A 13 ,A 14 ,...are stored in BANK0 to BANK7 in sequence until all elements in the row are stored.

[0219] Then store the second row element A 21 ,A 22 ,A 23 ,A 24 ,..., and then store them in BANK0 to BANK7 in the same order, and continue in the same storage order until all the elements of the matrix rows are stored.

[0220] This storage method ensures that data can be quickly accessed and read in a row-first manner when performing matrix calculations, and is particularly suitable for row-first operations such as matrix multiplication.

[0221] The blue and red arrows in the diagram indicate the order in which matrix elements are stored and read. The blue arrows indicate that each row of elements is stored sequentially from BANK0 to BANK7, while the red arrows indicate that each row of the matrix is ​​read in the same order. This consistent storage and reading order ensures smooth and efficient data processing.

[0222] pass Figure 6 It can be seen that sequential storage means putting data into bank0-7 row by row, putting every 2 data into 1 bank, and putting the elements of a row into the next bank immediately after they are put in. Figure 6 After the elements in the first row represented by the blue line are placed, the next bank is bank2, and the elements in the second row represented by the red line are placed starting from bank2.

[0223] Based on the same inventive concept, the embodiment of the present disclosure also provides an iterative matrix inversion system based on Cholesky decomposition corresponding to an iterative matrix inversion method based on Cholesky decomposition. Since the principle of solving the problem by the system in the embodiment of the present disclosure is similar to the above-mentioned iterative matrix inversion method based on Cholesky decomposition, the implementation of the system can refer to the implementation of the method, and the repeated parts will not be repeated.

[0224] Reference Figure 8 As shown, an iterative matrix inversion system based on Cholesky decomposition provided by an embodiment of the present disclosure includes:

[0225] Matrix receiving module 10, matrix decomposition module 20, triangular matrix inversion module 30, matrix transposition module 40, storage conversion module 50 and matrix multiplication module 60; wherein,

[0226] The matrix receiving module 10 is used to obtain a target source matrix; wherein the target source matrix includes: an N-order conjugate positive definite matrix;

[0227] The matrix decomposition module 20 is used to perform a first iterative process on the target source matrix based on Cholesky decomposition to generate an upper triangular matrix;

[0228] The triangular matrix inversion module 30 is used to perform a second iterative process on the upper triangular matrix to generate an inverse matrix of the upper triangular matrix;

[0229] The matrix transposition module 40 is used to perform conjugate transposition processing on the inverse matrix of the upper triangular matrix to generate a lower triangular matrix; wherein the lower triangular matrix is ​​stored in the form of whole column storage;

[0230] The storage conversion module 50 is used to convert the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage form;

[0231] The matrix multiplication module 60 is configured to perform matrix multiplication processing on the inverse matrix of the upper triangular matrix and the lower triangular matrix to generate the inverse matrix of the target source matrix.

[0232] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.

[0233] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.

[0234] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0235] The preferred embodiments of the present invention disclosed above are intended only to help illustrate the present application. The preferred embodiments do not describe all details in detail, nor do they limit the present application to specific embodiments. Obviously, many modifications and variations can be made based on the contents of this specification. This specification selects and describes these embodiments in detail to better explain the principles and practical applications of the present application, so that those skilled in the art can better understand and utilize the present application. The present application is limited only by the claims and their full scope and equivalents.

Claims

1. An iterative matrix inversion method based on Cholesky decomposition for DSP system, characterized in that: include: Obtaining a target source matrix; wherein the target source matrix includes: an N-order conjugate positive definite matrix; Based on Cholesky decomposition, performing a first iterative process on the target source matrix to generate an upper triangular matrix; Performing a second iterative process on the upper triangular matrix to generate an inverse matrix of the upper triangular matrix; Performing conjugate transposition processing on the inverse matrix of the upper triangular matrix to generate a lower triangular matrix; wherein the lower triangular matrix is ​​stored in the form of whole column storage; Converting the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage form to reuse the matrix multiplication module in the DSP system; Performing matrix multiplication on the inverse matrix of the upper triangular matrix and the lower triangular matrix to generate the inverse matrix of the target source matrix; The inverse matrix of the upper triangular matrix is ​​stored in a column-by-column manner; wherein, each column element of the inverse matrix of the upper triangular matrix is ​​stored in the same bank, the elements of the 1st and 2nd columns are placed in bank1, the elements of the 3rd and 4th columns are placed in bank2, and so on, the elements of the 15th and 16th columns are placed in bank8, and then the elements of the 17th and 18th columns are stored in bank1 again, forming a cycle; Converting the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage form includes: For the inverse matrix of the upper triangular matrix stored in column format, start taking data row by row and fill them into 8 banks in sequence. The first and second elements of the first row of the matrix are stored in bank1, the third and fourth elements are stored in bank2, and so on, until the 15th and 16th elements are stored in bank8, and then the 17th and 18th elements are stored in bank1 again, forming a loop. Generating an upper triangular matrix further comprises: Perform a piecewise zero-padding operation on the row elements of the target source matrix; when the elements of the row are below the corresponding column, the corresponding off-diagonal elements in the row are set to zero; When an element of a row is located on or above the diagonal of the corresponding column, the off-diagonal elements of the row are calculated and updated to determine their values.

2. The method according to claim 1, characterized in that Generating an upper triangular matrix comprises: Performing a square root operation on the diagonal elements of the target source matrix and calculating the reciprocal thereof to determine the diagonal elements of the upper triangular matrix; Performing a complex multiplication operation on the off-diagonal elements following the diagonal elements in the Nth row of the target source matrix to update the off-diagonal elements of the upper triangular matrix; Based on the upper triangular matrix elements, each element of the lower right rectangular area of ​​the target source matrix is ​​calculated and updated; In response to completing N calculation updates, the first iterative process ends and the upper triangular matrix is ​​generated.

3. The method according to claim 1, characterized in that Generating the inverse matrix of the upper triangular matrix includes: Performing a reciprocal operation on the diagonal elements of the upper triangular matrix to determine the diagonal elements of the inverse matrix; Performing a complex multiplication operation on the off-diagonal elements above the diagonal elements in the Nth column of the upper triangular matrix to update the off-diagonal elements of the inverse matrix; Based on the updated off-diagonal elements of the inverse matrix, each element in the upper right rectangular area of ​​the upper triangular matrix is ​​calculated and updated; In response to completing N calculation updates, the second iterative process ends and an inverse matrix of the upper triangular matrix is ​​generated.

4. The method according to claim 1, wherein Generating a lower triangular matrix comprises: Based on a first preset order, extract each element in the inverse matrix of the upper triangular matrix one by one; Performing conjugate complex number calculation on each of the extracted elements; Based on the second preset order, the elements after the conjugate complex number calculation are sequentially placed into the storage area of ​​the lower triangular matrix.

5. The method according to claim 4, characterized in that The first preset order includes: taking out row by row; the second preset order includes: putting in column by column; The row-by-row extraction includes: extracting each element from the first row of the inverse matrix of the upper triangular matrix from left to right in sequence; then extracting elements from the second row from left to right in sequence; and continuing to process in the same order until all elements of all rows have been extracted; The column-by-column placing includes: storing the elements after the conjugate complex number calculation in the storage area of ​​the lower triangular matrix in order of columns; The elements taken from the first row are stored in the first column of the lower triangular matrix in sequence; The elements taken from the second row are stored in the second column of the lower triangular matrix; Continue processing in the same order until all elements have been stored in their corresponding columns.

6. The method according to claim 1, characterized in that Also includes: The area for storing matrix elements is SRAM, which consists of 64 banks. Each bank is composed of four SRAM IPs with a width of 64 bits and a depth of 1024 bits. The splicing includes depth splicing and width splicing. The SRAM is divided into a plurality of partitions, including a source data 1 area, a source data 2 area, a result area, and an intermediate result area; wherein each of the partitions is composed of 16 banks.

7. An iterative matrix inversion system based on Cholesky decomposition, characterized in that: The system includes: a matrix receiving module, a matrix decomposition module, a triangular matrix inversion module, a matrix transposition module, a storage conversion module and a matrix multiplication module; wherein, The matrix receiving module is used to obtain a target source matrix; wherein the target source matrix includes: an N-order conjugate positive definite matrix; The matrix decomposition module is used to perform a first iterative process on the target source matrix based on Cholesky decomposition to generate an upper triangular matrix; The triangular matrix inversion module is used to perform a second iterative process on the upper triangular matrix to generate an inverse matrix of the upper triangular matrix; The matrix transposition module is used to perform conjugate transposition processing on the inverse matrix of the upper triangular matrix to generate a lower triangular matrix; wherein the lower triangular matrix is ​​stored in the form of whole column storage; The storage conversion module is used to convert the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage form; The matrix multiplication module is used to perform matrix multiplication processing on the inverse matrix of the upper triangular matrix and the lower triangular matrix to generate the inverse matrix of the target source matrix; The inverse matrix of the upper triangular matrix is ​​stored in a column-by-column manner; wherein, each column element of the inverse matrix of the upper triangular matrix is ​​stored in the same bank, the elements of the 1st and 2nd columns are placed in bank1, the elements of the 3rd and 4th columns are placed in bank2, and so on, the elements of the 15th and 16th columns are placed in bank8, and then the elements of the 17th and 18th columns are stored in bank1 again, forming a cycle; Converting the storage mode of the inverse matrix of the upper triangular matrix into a sequential storage form includes: For the inverse matrix of the upper triangular matrix stored in column format, start taking data row by row and fill them into 8 banks in sequence. The first and second elements of the first row of the matrix are stored in bank1, the third and fourth elements are stored in bank2, and so on, until the 15th and 16th elements are stored in bank8, and then the 17th and 18th elements are stored in bank1 again, forming a loop. Generating an upper triangular matrix further comprises: Perform a piecewise zero-padding operation on the row elements of the target source matrix; when the elements of the row are below the corresponding column, the corresponding off-diagonal elements in the row are set to zero; When an element of a row is located on or above the diagonal of the corresponding column, the off-diagonal elements of the row are calculated and updated to determine their values.

Citation Information

Patent Citations

  • Inverse operation method for lower triangle complex matrix with any order

    CN103927290A

  • Arbitrary-order matrix inversion hardware acceleration system based on cholesky decomposition, which adopts loop iteration mode

    CN111723336A