Multi-core computing method and device for fusing column block TSQR and tile update QR decomposition
By integrating column block TSQR and tile update QR decomposition methods, and combining horizontal partitioning and binary tree pipelines in multi-core processors, this method solves the problem of low efficiency in decomposing dense matrices in multi-core computing scenarios, and achieves efficient parallel decomposition of large-scale matrices, thereby improving computational efficiency and hardware resource utilization.
Patent Information
- Application Number
- CN202610237713.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-28
- Publication Date
- 2026-07-10
AI Technical Summary
Existing QR decomposition algorithms are difficult to adapt to both slender matrices and dense large-scale matrices in multi-core computing scenarios. The TSQR algorithm has good parallelism for slender matrices but low efficiency for dense matrices. The tile update algorithm has poor parallelism on multi-core processors and cannot make full use of hardware features, resulting in a narrow range of applicability.
The QR decomposition method, which integrates column block TSQR and tile update, achieves parallel triangular decomposition and matrix update of large-scale matrices through multi-core processor horizontal partitioning and binary tree structure pipeline. It utilizes implicit storage reflection vectors and memory sharing characteristics, combined with Householder transformation, to achieve efficient decomposition.
It significantly improves parallel computing efficiency, expands the applicability of algorithms, enhances hardware resource utilization and computational accuracy, adapts to the hardware characteristics of multi-core computing platforms, and is suitable for efficient decomposition of various large-scale matrices.
Smart Images

Figure CN122364620A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital signal processing technology, and in particular to a multi-core computing method and apparatus for QR decomposition that integrates column block TSQR and tile updates. Background Technology
[0002] Matrix factorization, as a core numerical computation method in the field of matrix analysis, is a fundamental technology supporting the implementation of various algorithms in traditional scientific and engineering computing and modern intelligent fields. Its stable and parallelizable numerical algorithms are widely used in digital signal processing, high-performance computing, scientific data analysis, artificial intelligence model training, solving linear equations, data dimensionality reduction, and feature extraction, becoming an indispensable key component in various complex computational scenarios. Among these, QR factorization, as an important type of matrix factorization, has become a core tool in digital signal processing due to its excellent numerical stability. In high-performance computing scenarios, how to achieve efficient parallel computation of QR factorization based on the hardware characteristics of multi-core processors, fully utilize the parallel performance of processors, and improve the decomposition efficiency of large-scale matrices is an important research direction in this field.
[0003] For slender matrices with a column count much greater than the row count, a dedicated TSQR decomposition algorithm has been developed in this field. This type of algorithm, based on a column-block divide-and-conquer approach, possesses good parallel characteristics and can leverage its parallel advantages on multi-core computing platforms, adapting to the need for rapid decomposition of slender matrices. However, in practical engineering calculations and scientific research, in addition to slender matrices, dense, large-scale matrices with a moderate row-to-column ratio are also common processing targets. When dealing with these non-slender, dense, large-scale matrices, the TSQR algorithm's parallel advantages are difficult to realize, resulting in a significant reduction in decomposition efficiency and a relatively narrow range of applicable matrices.
[0004] Meanwhile, while traditional tile update algorithms can process dense, large-scale matrices in blocks, they suffer from strong inter-tile dependencies, making it difficult to fully utilize the parallel computing capabilities of multi-core processors and adapt to the hardware characteristics of multi-core computing platforms. Furthermore, current technologies lack a solution that effectively combines the high parallelism of the TSQR algorithm with the tile update algorithm's ability to handle dense matrices. This results in a persistent contradiction between the current QR decomposition algorithm's superior parallelism in its narrow applicability and poor parallelism in its ability to handle dense matrices. Consequently, it fails to meet the demands for efficient and stable decomposition of various large-scale matrices in multi-core computing scenarios, limiting the application of QR decomposition in more complex and large-scale computing scenarios. Summary of the Invention
[0005] To address the aforementioned issues, this invention proposes a multi-core computational method and apparatus for QR decomposition that integrates column block TSQR and tile update. By combining TSQR and tile algorithms, QR decomposition of large-scale matrices is achieved on a multi-core DSP, thereby expanding the range of matrices to which the algorithm is applicable.
[0006] The technical solution adopted in this invention is as follows: A multi-core computational method for QR decomposition that integrates column block TSQR and tile update includes: For a large-scale matrix to be decomposed, it is horizontally divided according to the number of cores in a multi-core processor, and then the large-scale matrix is divided into multiple layers according to the tile update method. A multi-stage pipeline with a binary tree structure is constructed. Parallel triangular decomposition is performed on the initial blocks of the large-scale matrix using a multi-core processor to obtain the corresponding upper triangular matrix and orthogonal matrix. The upper triangular matrix replaces the original block matrix, and the orthogonal matrix is transposed by conjugate to obtain the update matrix. Parallel updates of the remaining blocks are then implemented using a multi-core processor. Based on the reflection vector implicitly stored during the parallel triangular decomposition process of the multi-core processor, the overall orthogonal matrix corresponding to the large-scale matrix is obtained by solving the problem. At the same time, the overall upper triangular matrix obtained after layer block update is output, thus completing the QR decomposition of the large-scale matrix.
[0007] Furthermore, for the large-scale matrix to be decomposed, horizontal blocks are formed based on the number of cores in the multi-core processor, and the large-scale matrix is divided into multiple layers according to the tile update method, including: dividing the large-scale matrix into sub-matrices with the same number of cores as the multi-core processor by columns, and defining the set of all matrix blocks in the same horizontal and vertical directions to the lower right of the matrix block as the base matrix block.
[0008] Furthermore, the multi-level pipeline for constructing a binary tree structure includes: each core of a multi-core processor as a computing node in the pipeline, the number of cores in the pipeline decreasing by a factor of two as the number of levels increases, and the computing nodes at the same level of the pipeline synchronously and in parallel perform triangular decomposition. After all computing nodes at the previous level have completed the calculation and output the results, the next level computing node starts the calculation.
[0009] Furthermore, the parallel triangular decomposition of the initial layer block of the large-scale matrix by the multi-core processor includes: firstly, all computing nodes of the first stage of the multi-stage pipeline independently perform triangular decomposition on each sub-matrix of the initial layer block; then, subsequent computing nodes at each stage sequentially merge the matrices output by two adjacent computing nodes of the previous stage, and perform triangular decomposition on the merged matrix, until a single computing node in the last stage of the pipeline completes the matrix merging and triangular decomposition to obtain the upper triangular matrix corresponding to the initial layer block.
[0010] Furthermore, the reflection vector implicitly stored by the multi-core processor during the parallel triangular decomposition process includes: the reflection vector generated during the parallel triangular decomposition process is directly stored in the storage area of the original matrix, and the reflection vector is retained in the processing memory of the corresponding computing node level by level as the multi-stage pipeline calculation process proceeds.
[0011] Furthermore, the step of solving for the overall orthogonal matrix corresponding to the large-scale matrix based on the reflection vector implicitly stored in the parallel triangular decomposition process of the multi-core processor includes: firstly, constructing a reflection matrix based on the reflection vector implicitly stored in each computing node, and then solving for the single-core orthogonal matrix corresponding to the triangular decomposition performed by each computing node from the reflection matrix; subsequently, multiplying the orthogonal matrices corresponding to each stage in the multi-stage pipeline in a cascaded manner to obtain the overall orthogonal matrix of the large-scale matrix.
[0012] Furthermore, the parallel update of the remaining blocks through a multi-core processor includes: utilizing the hardware characteristics of the multi-core processor where the cores are independent and share memory, each computing node directly accesses the update matrix in the shared memory and performs matrix multiplication update operations on different blocks to be updated simultaneously.
[0013] Furthermore, before performing parallel triangular decomposition on the merged matrix, the merged matrix is transposed to convert the row storage form of the matrix into the column storage form; after the triangular decomposition is completed and the decomposed matrix is obtained, the decomposed matrix is reverse transposed to restore it to an upper triangular matrix in row storage form.
[0014] Furthermore, the parallel triangular decomposition includes a QR decomposition algorithm based on Householder transformation, which obtains reflection vectors by solving the column vectors of the matrix, constructs a reflection matrix from the reflection vectors, and then updates each column vector of the matrix sequentially through the reflection matrix until the matrix is transformed into an upper triangular matrix.
[0015] A multi-core computing device for QR decomposition that integrates column block TSQR and tile update includes: The preprocessing module is configured to horizontally divide the large-scale matrix to be decomposed based on the number of cores in a multi-core processor, and divide the large-scale matrix into multiple layers according to the tile update method. The first computing module is configured to construct a multi-stage pipeline of a binary tree structure. It performs parallel triangular decomposition on the initial blocks of the large-scale matrix through a multi-core processor to obtain the corresponding upper triangular matrix and orthogonal matrix. The upper triangular matrix replaces the original block matrix, and the orthogonal matrix is transposed by conjugate to obtain the update matrix. The multi-core processor is then used to implement parallel updates for the remaining blocks. The second calculation module is configured to solve for the overall orthogonal matrix corresponding to the large-scale matrix based on the reflection vector implicitly stored in the parallel triangular decomposition process of the multi-core processor, and output the overall upper triangular matrix obtained after layer block update, thus completing the QR decomposition of the large-scale matrix.
[0016] The beneficial effects of this invention are as follows: The multi-core computing method and apparatus for QR decomposition proposed in this invention, which integrates column block TSQR and tile update, effectively combines the high parallelism of column block TSQR with the advantages of tile update in processing dense matrices. It achieves technological breakthroughs in many aspects, including parallel computing efficiency, algorithm applicability, hardware resource utilization, accuracy of calculation results, and engineering implementation adaptability. Compared with the prior art, it has significant technical advantages, which are described in detail below.
[0017] 1. Significantly Improved Parallel Computing Efficiency: This invention constructs a multi-level pipeline with a binary tree structure, using multi-core processor cores as nodes. Pipeline nodes at the same level execute triangular decomposition synchronously and in parallel. The number of cores decreases systematically with each level, and sequential computation is achieved through synchronous control, maximizing the parallel hardware characteristics of multi-core processors. Simultaneously, leveraging the independent cores and shared memory of multi-core processors, parallel updates of matrix blocks are achieved. Each computing node can directly access the updated matrix in shared memory, reducing the overhead of inter-core data interaction. The parallel design of block updates and pipeline triangular decomposition comprehensively improves the parallelism of the entire QR decomposition process. Furthermore, the transpose processing before matrix merging and decomposition solves the problem of discontinuous data in row-oriented storage, improving memory access and computation efficiency, and further optimizing the overall parallel computing effect.
[0018] 2. Significantly Expanded Applicability of the Algorithm: While retaining the high parallelism of the TSQR algorithm, this invention incorporates the block-based update approach of tile updates. By horizontally partitioning and layering large-scale matrices, it breaks through the limitation of the traditional TSQR algorithm being applicable only to slender matrices. It can efficiently decompose various dense large-scale matrices. Whether it is a slender matrix with a column count much greater than a row count, or a dense matrix with a moderate ratio of rows to columns, this algorithm can maintain good decomposition efficiency. It effectively expands the applicable matrix range of the QR decomposition algorithm in multi-core computing scenarios and can adapt to various large-scale matrix decomposition needs in fields such as scientific computing, digital signal processing, and artificial intelligence.
[0019] 3. Enhanced Algorithm and Hardware Flexibility and Adaptability: This invention decouples the TSQR decomposition and tile update stages, avoiding the strong dependency problem between tiles in traditional tile update algorithms. Each step of the algorithm can be independently optimized, and relevant parameters can be adjusted according to actual computing needs and hardware configuration. At the same time, the horizontal block partitioning method of the matrix is compatible with the number of cores in multi-core processors, and the block partitioning rules fit the core requirements of tile update. The design of the entire algorithm is highly compatible with the hardware characteristics of multi-core processors and can flexibly adapt to array platforms such as multi-core DSPs with different numbers of cores, exhibiting good hardware adaptability and algorithm flexibility.
[0020] 4. More efficient use of hardware resources: In the parallel triangular decomposition process, the present invention implicitly stores the generated reflection vector in the storage area of the original matrix, without the need to allocate additional independent storage space for the reflection vector. Moreover, the reflection vector is retained in the processing memory of the corresponding node at each stage of the pipeline calculation process. While ensuring data integrity, it greatly saves the memory resources of multi-core processors. At the same time, the upper triangular matrix obtained by decomposition directly replaces the original layer block matrix, reducing redundant data storage and allowing the storage and computing resources of multi-core processors to be used more fully.
[0021] 5. Higher computational accuracy and reliability of QR decomposition: The parallel triangular decomposition of this invention is implemented based on the Householder transformation QR decomposition algorithm. This algorithm has good numerical stability and can effectively avoid deviations caused by numerical calculations during the decomposition process, ensuring the computational accuracy of triangular decomposition. At the same time, the reflection matrix is constructed step by step by implicitly stored reflection vectors, the single-core orthogonal matrix is solved, and the orthogonal matrices of the multi-stage pipeline are multiplied sequentially in a cascade manner to obtain the overall orthogonal matrix. The step-by-step solution and cascade synthesis approach makes the solution process of the orthogonal matrix more rigorous. Combined with the layer-by-layer progressive matrix block update, the final output upper triangular matrix and the overall orthogonal matrix both have high solution accuracy, improving the reliability of QR decomposition results. Attached Figure Description
[0022] Figure 1 This is a diagram showing the multi-core DSP matrix block structure and hierarchical relationship of Embodiment 2 of the present invention.
[0023] Figure 2 This is a flowchart of the multi-core computation process for QR decomposition of fused column block TSQR and tile update in Embodiment 2 of the present invention.
[0024] Figure 3 This is a block diagram of the multi-core parallel computing system structure for column block TSQR decomposition in Embodiment 2 of the present invention.
[0025] Figure 4 This is a flowchart of the single-core QR calculation process and a schematic diagram of the matrix structure change for the column block TSQR decomposition in Embodiment 2 of the present invention.
[0026] Figure 5 This is a block diagram of single-core QR decomposition calculation in the parallel computing architecture of Embodiment 2 of the present invention. Detailed Implementation
[0027] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments are now described. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention; that is, the described embodiments are only a part of the embodiments of the invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0028] Example 1 This embodiment provides a multi-core computation method for QR decomposition that integrates column block TSQR and tile update, including: For a large-scale matrix to be decomposed, it is horizontally divided according to the number of cores in a multi-core processor, and then the large-scale matrix is divided into multiple layers according to the tile update method. A multi-stage pipeline with a binary tree structure is constructed. Parallel triangular decomposition is performed on the initial blocks of the large-scale matrix using a multi-core processor to obtain the corresponding upper triangular matrix and orthogonal matrix. The upper triangular matrix replaces the original block matrix, and the orthogonal matrix is transposed by conjugate to obtain the update matrix. Parallel updates of the remaining blocks are then implemented using a multi-core processor. Based on the reflection vector implicitly stored during the parallel triangular decomposition process of the multi-core processor, the overall orthogonal matrix corresponding to the large-scale matrix is obtained by solving the problem. At the same time, the overall upper triangular matrix obtained after layer block update is output, thus completing the QR decomposition of the large-scale matrix.
[0029] It should be noted that this method integrates the technical ideas of column-block triangular decomposition and tile update. It retains the high parallelism of column-block triangular decomposition, while effectively expanding the applicability of the algorithm through the block update approach of tile update. It can adapt to the QR decomposition requirements of various large-scale dense matrices. At the same time, it relies on the multi-stage pipeline of binary tree structure to realize multi-core parallel computing, which greatly improves the overall computational efficiency of large-scale matrix QR decomposition.
[0030] Preferably, for the large-scale matrix to be decomposed, it is horizontally divided according to the number of cores of the multi-core processor, and the large-scale matrix is divided into multiple layers according to the tile update method, including: dividing the large-scale matrix into sub-matrices with the same number of cores as the multi-core processor by columns, and taking the matrix block at the main diagonal position as the reference, the set of all matrix blocks in the same horizontal direction and the same vertical direction to the lower right is defined as the layer block of the corresponding reference matrix block.
[0031] Specifically, when horizontally partitioning a large-scale matrix, the column direction of the matrix is used as the partitioning direction. The entire large-scale matrix is equally divided into several sub-matrices according to the number of cores in a multi-core processor. The number of sub-matrices is consistent with the number of cores in a multi-core processor. When partitioning into layers, the matrix blocks at the main diagonal position of the large-scale matrix are first determined. Then, each matrix block at the main diagonal position is used as a reference. All matrix blocks at the lower right of the reference block in the horizontal and vertical directions are integrated into a set. This set is the layer block corresponding to the reference block. The multi-layer layer block partitioning of the entire large-scale matrix is completed according to this rule.
[0032] It should be noted that this block-based approach adapts the horizontal block results of the matrix to the number of cores in a multi-core processor, providing a regular basic data unit for subsequent multi-core parallel computing. The layer block division rules are in line with the core requirements of tile updates, clarifying the update range of each layer and laying a clear matrix data foundation for subsequent layer-by-layer progressive update operations.
[0033] Preferably, a multi-level pipeline with a binary tree structure is constructed, including: each core of a multi-core processor as a computing node of the pipeline, the number of cores in the pipeline decreasing by a factor of two as the level increases, and the computing nodes at the same level of the pipeline synchronously and in parallel perform triangular decomposition. After all computing nodes at the previous level have completed the calculation and output the results, the computing nodes at the next level start the calculation.
[0034] Specifically, when building a multi-stage pipeline with a binary tree structure, each core of the multi-core processor is treated as an independent computing node in the pipeline. The number of pipeline stages is set according to the total number of cores, so that the number of cores in the pipeline decreases by a factor of two as the number of stages increases. During pipeline operation, all computing nodes at the same stage are controlled to start synchronously and execute triangulation operations in parallel. At the same time, a synchronization flag signal is set. Only after all computing nodes at the previous stage have completed the calculation and output valid results will a start signal be sent to the next level computing node. The next level computing node will then start the calculation after receiving the signal.
[0035] It should be noted that this pipeline construction method uses multi-core processor cores as nodes, maximizing the utilization of multi-core hardware resources. The doubling distribution of the number of cores conforms to the structural characteristics of a binary tree, while the synchronous control method effectively ensures the timing synchronization of pipeline calculations, avoids data corruption problems, and significantly improves the parallel computing efficiency of triangular decomposition.
[0036] Preferably, the initial triangular decomposition of the large-scale matrix is performed on the initial layer block by a multi-core processor, including: first, all computing nodes of the first stage of the multi-stage pipeline independently perform triangular decomposition on each sub-matrix of the initial layer block; then, subsequent computing nodes at each stage merge the matrices output by two adjacent computing nodes of the previous stage in turn, and perform triangular decomposition on the merged matrix, until a single computing node in the last stage of the pipeline completes the matrix merging and triangular decomposition to obtain the upper triangular matrix corresponding to the initial layer block.
[0037] Specifically, when performing parallel triangular decomposition on the initial layer block, the first-level computing node of the pipeline is started first. Each node independently performs triangular decomposition operation on the corresponding submatrix in the initial layer block and outputs the decomposition result. Then, subsequent computing nodes of the pipeline are started. Each computing node in each level receives the matrix output by the two adjacent computing nodes of the previous level, merges the two matrices, performs triangular decomposition on the merged matrix, and outputs the result. This merging and decomposition operation is performed level by level until the single computing node of the last level of the pipeline completes the merging and triangular decomposition of the input matrix of the previous level. The upper triangular matrix output by this node is the upper triangular matrix corresponding to the initial layer block.
[0038] It should be noted that this parallel triangular decomposition method achieves ordered parallel processing of the initial block matrix through step-by-step merging and decomposition operations. Its computational logic is highly compatible with the structure of the binary tree multi-level pipeline, which not only ensures the accuracy of the triangular decomposition results, but also fully leverages the parallel computing advantages of the multi-core pipeline, thereby improving the efficiency of the initial block triangular decomposition.
[0039] Preferably, the reflection vector implicitly stored by the multi-core processor during the parallel triangulation process includes: the reflection vector generated during the parallel triangulation process is directly stored in the storage area of the original matrix, and the reflection vector is retained in the processing memory of the corresponding computing node level by level as the multi-stage pipeline calculation process proceeds.
[0040] Specifically, during the parallel triangulation process performed by the multi-core processor, the calculated reflection vectors are directly stored in the storage area of the original matrix, without the need to allocate additional independent storage space for the reflection vectors. During the stage-by-stage computation of the pipeline, the reflection vectors generated by each stage of the computation node are retained in the processing memory of that node and are retained stage by stage as the pipeline computation progresses. Even after the pipeline computation is completed, the processing memory of each node still retains the reflection vectors of the corresponding level.
[0041] It should be noted that this method of storing reflection vectors effectively saves memory resources of multi-core processors and avoids the resource consumption caused by opening up additional storage areas. The method of storing reflection vectors in the processing memory of the corresponding nodes at each level ensures the integrity and traceability of reflection vectors, providing reliable and complete data support for solving the overall orthogonal matrix.
[0042] Preferably, the overall orthogonal matrix corresponding to the large-scale matrix is obtained by solving the reflection vector implicitly stored by the multi-core processor during the parallel triangular decomposition process, including: firstly, constructing a reflection matrix based on the reflection vector implicitly stored by each computing node, and then solving the single-core orthogonal matrix corresponding to the triangular decomposition performed by each computing node from the reflection matrix; subsequently, multiplying the orthogonal matrices corresponding to each stage in the multi-stage pipeline in a cascaded manner to obtain the overall orthogonal matrix of the large-scale matrix.
[0043] Specifically, when solving for the global orthogonal matrix, the reflection vectors implicitly stored in the processing memory of each computing node are first extracted. The corresponding reflection matrix is constructed based on the numerical characteristics of the reflection vectors. Then, based on the matrix transformation properties of the reflection matrix, the single-core orthogonal matrix corresponding to the triangular decomposition operation performed by each computing node is solved. Then, according to the pipeline level order, the orthogonal matrices corresponding to each level of computation are concatenated, and matrix multiplication operations are performed sequentially. The final matrix product is the global orthogonal matrix corresponding to the large-scale matrix to be decomposed.
[0044] It should be noted that the solution method for the overall orthogonal matrix adopts a step-by-step solution and cascaded synthesis approach. Its calculation process is highly consistent with the parallel computing process of multi-core pipelines. The step-by-step solution ensures the accuracy of the orthogonal matrix solution at each stage, while the cascaded multiplication method realizes the orderly synthesis from the single-core orthogonal matrix to the overall orthogonal matrix, effectively ensuring the accuracy of the overall orthogonal matrix solution result.
[0045] Preferably, parallel updates of the remaining layers are achieved through a multi-core processor, including: utilizing the hardware characteristics of the multi-core processor where the cores are independent and share memory, each computing node directly accesses the update matrix in the shared memory and performs matrix multiplication update operations on different layers to be updated simultaneously.
[0046] Specifically, when performing parallel updates on the remaining blocks, relying on the hardware characteristics of the multi-core processor where cores are independent and memory is shared, the update matrix obtained after the conjugate transpose is stored in the shared memory area of the multi-core processor. Each computing node does not need to perform additional data interaction and can directly access the update matrix in the shared memory. At the same time, for different blocks to be updated, the multiplication operation between the update matrix and the block matrix is performed synchronously to complete the update processing of each block.
[0047] It should be noted that the independent nature of multi-core processors allows each computing node to perform update operations on different layers simultaneously, achieving synchronous parallel updates of layers. Meanwhile, the memory-sharing feature allows each computing node to directly access the update matrix, reducing the data interaction overhead between nodes and significantly improving the overall efficiency of large-scale matrix layer updates.
[0048] Preferably, before performing parallel triangular decomposition on the merged matrix, the merged matrix is transposed to convert the row storage form of the matrix into the column storage form; after the triangular decomposition is completed and the decomposed matrix is obtained, the decomposed matrix is reverse transposed to restore it to an upper triangular matrix in row storage form.
[0049] Specifically, before performing parallel triangular decomposition on the merged matrix, the merged matrix is transposed to convert its original row storage form into column storage form. Then, the parallel triangular decomposition is performed on the matrix in column storage form. After the triangular decomposition is completed and the corresponding decomposition matrix is obtained, the decomposition matrix is reverse transposed to restore the matrix from column storage form to its original row storage form, and finally, an upper triangular matrix in row storage form is obtained.
[0050] It should be noted that after converting row storage to column storage, matrix elements can be extracted continuously based on the address of the first element of the matrix. This effectively solves the problems of computational performance loss and algorithm design complexity caused by the discontinuous data in row storage, and significantly improves the computational performance of parallel triangular decomposition. The reverse transpose operation ensures that the upper triangular matrix of the output meets the requirements of subsequent matrix calculations, without the need for additional storage format adaptation.
[0051] Preferably, the parallel triangular decomposition includes a QR decomposition algorithm based on Householder transformation, which obtains reflection vectors by solving the column vectors of the matrix, constructs a reflection matrix from the reflection vectors, and then updates each column vector of the matrix sequentially through the reflection matrix until the matrix is transformed into an upper triangular matrix.
[0052] Specifically, when performing parallel triangular decomposition, a QR decomposition algorithm based on Householder transformation is adopted. First, the column vectors of the matrix to be decomposed are extracted, and the corresponding reflection vectors are obtained based on the numerical characteristics of the column vectors. Then, the corresponding reflection matrix is constructed based on the obtained reflection vectors, and the reflection matrix is applied to the matrix to be decomposed. Update operations are performed on each column vector of the matrix in turn. The column vector update operations are continuously performed until all elements of the lower triangular part of the matrix to be decomposed are zero, and the matrix is completely transformed into an upper triangular matrix.
[0053] It should be noted that the QR decomposition algorithm based on Householder transformation has good numerical stability, which can effectively improve the computational accuracy of parallel triangular decomposition, avoid deviations caused by numerical calculations during the decomposition process, and ensure the decomposition quality of the upper triangular matrix. At the same time, the computational steps of the algorithm are clear, adaptable to the parallel computing logic of multi-core processors, and easy to implement on multi-core pipelines.
[0054] Accordingly, this embodiment also provides a QR decomposition multi-core computing device that integrates column block TSQR and tile update, including: The preprocessing module is configured to horizontally divide the large-scale matrix to be decomposed based on the number of cores in a multi-core processor, and divide the large-scale matrix into multiple layers according to the tile update method. The first computing module is configured to construct a multi-stage pipeline of a binary tree structure. It performs parallel triangular decomposition on the initial blocks of the large-scale matrix through a multi-core processor to obtain the corresponding upper triangular matrix and orthogonal matrix. The upper triangular matrix replaces the original block matrix, and the orthogonal matrix is transposed by conjugate to obtain the update matrix. The multi-core processor is then used to implement parallel updates for the remaining blocks. The second calculation module is configured to solve for the overall orthogonal matrix corresponding to the large-scale matrix based on the reflection vector implicitly stored in the parallel triangular decomposition process of the multi-core processor, and output the overall upper triangular matrix obtained after layer block update, thus completing the QR decomposition of the large-scale matrix.
[0055] Specifically, when the device is working, the preprocessing module first starts working, performs preprocessing operations on the large-scale matrix to be decomposed, completes the horizontal block division of the matrix according to the number of cores of the multi-core processor, and completes the multi-layer block division of the matrix according to the tile update method. After the division is completed, the block division result is transmitted to the first computing module. After receiving the block division result, the first computing module first builds a multi-stage pipeline with the cores of the multi-core processor as nodes, and then performs parallel triangular decomposition on the initial block using the pipeline. After obtaining the upper triangular matrix and the orthogonal matrix, the upper triangular matrix replaces the original block matrix, and the orthogonal matrix is transposed by conjugate to obtain the update matrix. The remaining blocks are then updated in parallel by the multi-core processor. The reflection vector and block update result stored in the calculation process are then transmitted to the second computing module. After receiving the data, the second computing module solves for the overall orthogonal matrix of the large-scale matrix based on the reflection vector, and integrates the block update result and outputs the overall upper triangular matrix. Thus, the QR decomposition calculation of the entire large-scale matrix is completed.
[0056] It should be noted that the device adopts a modular architecture design, which breaks down the different calculation processes of QR decomposition into corresponding functional modules. Each module is independent in function but works together. Its calculation logic is highly compatible with the hardware characteristics of multi-core processors, making it easy to implement in hardware on multi-core processors. At the same time, the modular design makes the device's calculation process more organized, improves the maintainability and scalability of the device's calculation process, and can efficiently and stably complete the QR decomposition calculation of various large-scale matrices.
[0057] Example 2 This embodiment provides a multi-core computation method for QR decomposition that integrates column block TSQR and tile update. By combining TSQR and tile algorithms, QR decomposition of large-scale matrices is achieved on a multi-core DSP, thereby expanding the matrix range to which the algorithm is applicable.
[0058] In this embodiment, the matrix processed by each core is divided into blocks horizontally according to the number of DSP processor cores. The blocks are then processed using the TSQR algorithm. Leveraging the characteristics of multi-core processors, the matrix to be decomposed is divided into multiple data fragments, which are distributed to the parallel core nodes of the first-level pipeline through the interconnection network between multi-core processor nodes. After the parallel processing of the QR decomposition task, the processed matrix is sent to the parallel core nodes of the next-level pipeline through the network, and the corresponding reflection vector is implicitly stored. The core nodes of the second-level pipeline merge and decompose the received matrices, and then transmit the processed matrix to the core nodes of the next-level pipeline through the network, while implicitly storing the corresponding reflection vector. This process continues, with each level of core nodes forming a binary tree structure, running level by level, with nodes at the same level running in parallel, ultimately outputting an upper triangular matrix R and an orthogonal matrix Q.
[0059] Based on the characteristics of tile algorithm updates, this embodiment divides the original matrix into different layers. The matrix blocks inside a layer are called layer blocks. After performing TSQR decomposition on the layer blocks of the first layer, the calculated upper triangular matrix directly replaces the original layer block. The orthogonal matrix is sent to other cores for updating the layer blocks. After all cores have finished updating, TSQR is performed on the layer blocks of the second layer, and so on, until all layers have been updated. Finally, an upper triangular matrix R is output.
[0060] See Figure 1 On a DSP array platform with at least 8 cores, the input size is at least M rows and 8N columns, where The matrix B to be decomposed is divided into columns. In this embodiment, the DSP has 8 cores, so matrix B is divided into 8 long and thin matrices with M rows and N columns, i.e., blocks p (p = 1,2,…,8).
[0061] Let i be the horizontal direction to the right of the matrix, j be the vertical direction downwards, and k be the direction along the main diagonal. With k as the diagonal of the matrix, it's easy to find an N... N square matrix Since the size of block p is M N, after QR decomposition, yields an upper triangular matrix. On the one hand For storage On the other hand, through The loop structure is divided into blocks p sequentially. , ,…,in, All are N An N square matrix. The p-th layer is defined as containing... The set of all matrix blocks in the lower right direction, including those in the same i and j directions, is divided layer by layer. The size of the matrices contained in block p varies in different layers. The set of matrices contained in block p in the m-th layer is called a layer block. The process proceeds layer by layer, updating each layer sequentially, until the upper triangular matrix is finally calculated.
[0062] See Figure 2 The QR decomposition multi-core computation method that integrates column block TSQR and tile update in this embodiment includes the following steps: S100, initialize system parameters and partition the matrix. Let... , indicating that it starts from block 1.
[0063] S200, for layer blocks Perform parallel TSQR decomposition and output an upper triangular matrix. And an orthogonal matrix Q.
[0064] S400, perform conjugate transpose on Q, As the update matrix, the layer block along the i-direction To update, the specific steps are as follows: , i from Up to 8. Because each core is independent and data is stored in shared memory, different cores can access each other directly. To enable parallel updates of different blocks.
[0065] S500 checks if all blocks have been updated. Since updates are performed sequentially on block p, it checks if p is greater than the number of blocks. If... ,but Return to S200; if This indicates that all updates are complete and the system has entered S600.
[0066] S600, outputs the upper triangular matrix obtained by performing QR decomposition on the original matrix B. .
[0067] See Figure 3 Preferably, the selected parallel architecture is a typical binary tree structure to achieve inter-core parallel computation of TSQR decomposition. For a large-scale array platform with 8 cores, layers with a size of M rows and N columns are used. For example, based on the number of processor cores on the platform, the original matrix... Divide into 8 m rows by column ( ), N columns of submatrix The upper triangular matrix obtained after QR decomposition of each kernel is: For the matrix in the diagram or 'i' represents the i-th layer of the parallel structure, and 'j' indicates that the matrix is stored in the processing memory of core j. For an 8-core processor, it can be divided into a maximum of [number missing] layers. A matrix block. Based on the binary tree architecture, a 4-stage pipeline is constructed with the cores participating in the computation as nodes.
[0068] Preferably, the assembly line structure performs the following steps sequentially: The first-stage pipeline uses 8 cores for parallel computing to divide the matrix into blocks. Simultaneously, each core is input, and Core j processes the submatrix. For the matrix A single-core QR decomposition based on Householder transformation is performed, with the upper triangular matrix and reflection vector storing the original matrix respectively. The processed matrix is then input into the next-level kernel node.
[0069] The second-stage pipeline is a 4-core parallel computing system, where each core node is paired with two matrices of the same size input from the previous stage. The merged result is a size of 2m. The matrix N is subjected to QR decomposition. The upper triangular matrix and the reflection vector are used to store the original matrix and input to the next level kernel node.
[0070] The third-stage pipeline is a 2-core parallel computing process, taking the two inputs of the second-stage pipeline as 2m. The matrix of N Merge into a 4m size For a matrix N, the kernel node performs QR decomposition on it. The upper triangular matrix and reflection vector are stored in the original matrix and then input into the next level kernel node.
[0071] The fourth-stage pipeline is a single-core compute, taking the input from the third-stage pipeline and processing it into two 4m cores. The matrix N is merged, and the merged matrix is then subjected to QR decomposition. The final output is... ,in The desired upper triangular matrix has a size of N. N.
[0072] In a binary tree structure, nodes at the same level operate simultaneously. Since the input matrix structure is of uniform size, the processing time for each level is essentially the same, greatly improving parallel efficiency. To ensure the correct execution of the next pipeline step, all nodes must complete their computations before proceeding to the next stage.
[0073] Since the reflection vectors calculated in each pipeline cycle are stored implicitly, then according to Properties, through The orthogonal matrix of a single-core QR can be calculated. Taking the first-stage pipeline as an example, Core0 performs a Householder-based QR decomposition, and the resulting reflection matrix is implicitly stored in... The orthogonal matrix calculated by Core0 can be obtained. Similarly, the orthogonal matrices calculated by other kernels can be obtained. , ,…, ,So:
[0074] Since the pipeline is cascaded, if the orthogonal matrix calculated by the i-th stage pipeline... The final orthogonal matrix is then obtained. .
[0075] See Figure 4 This embodiment adopts a multi-stage pipeline structure. The number of cores participating in the calculation in each stage of the pipeline is different, but the execution steps of the pipeline are fixed and can be processed in parallel. Figure 4 The left side is a flowchart of the single-core QR calculation process for the column block TSQR decomposition in this embodiment, and the right side is a schematic diagram of the changes in the matrix structure involved in the calculation, including the following: S201 determines the pipeline stage and uses a flag signal to ensure system synchronization. Only after all the computational cores involved in the previous pipeline have completed processing can the flag signal be assigned a value indicating that entry into the next pipeline is permitted.
[0076] S202 obtains the ID number of each core by reading the value of the register, and specifies the processing core of each pipeline stage by the core ID number.
[0077] S203, for the first-stage pipeline, the input is only a single matrix, so proceed directly to the next step; for other stages of the pipeline... The input is an upper triangular matrix from the output of the previous pipeline k. Each core receives a row-stored matrix from the outputs of two processing cores, Core i and Core j, from pipeline k. and ,in, , Directly merge and splice into ,in .
[0078] S204, the merged matrix obtained in S203 Transpose to make the next step easier.
[0079] S205, perform QR decomposition on the matrix processed by S204, and finally obtain the matrix. .
[0080] S206 transposes the matrix after QR decomposition, and finally outputs a row storage matrix R containing an upper triangular matrix.
[0081] The single-core QR decomposition is the most crucial part. Taking the 8-core parallel architecture in the implementation example, the QR decomposition algorithm is reused 15 times. The algorithm for processing the matrix by the core nodes is based on Householder transformation-based QR decomposition. For the matrix to be processed... According to column vectors Find the Householder transformation H, and then update based on H. This continues until the upper triangular matrix is finally obtained, i.e. Matrix data is stored row-wise, with each row stored contiguously in memory, while the corresponding column data is not contiguous. This affects performance and also leads to complexity in algorithm design.
[0082] See Figure 5 This is a flowchart of the single-core QR decomposition calculation in the parallel computing architecture of this embodiment. Before performing QR decomposition, the merged matrix is transposed, converting row storage into column storage. This allows for the direct extraction of elements from each row based on the address of the first element. The calculation formula after transposition is... This is equivalent to the Householder transformation updating each row of the transposed matrix.
[0083] The matrix QR decomposition is processed layer by layer in stages I, II, III, and IV. Stage I first utilizes... Calculate the reflection vector for the current row, and then update it sequentially. , , , The current line; then process layer II, utilizing... The reflection vector is obtained for the current row, and then updated sequentially. , , The process continues in the same row until all layers IV are processed, ultimately resulting in a lower triangular matrix. .
[0084] Example 3 This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the QR decomposition multi-core computing method of Embodiment 1 or 2. The computer program can be in the form of source code, object code, executable file, or some intermediate form.
[0085] Example 4 This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the QR decomposition multi-core computing method of Embodiment 1 or 2. The computer program can be in the form of source code, object code, executable file, or some intermediate form. The storage medium includes any entity or device capable of carrying computer program code, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0086] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
[0087] It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
Claims
1. A multi-core computational method for QR decomposition that integrates column block TSQR and tile update, characterized in that, include: For a large-scale matrix to be decomposed, it is horizontally divided according to the number of cores in a multi-core processor, and then the large-scale matrix is divided into multiple layers according to the tile update method. A multi-stage pipeline with a binary tree structure is constructed, and a parallel triangular decomposition is performed on the initial blocks of the large-scale matrix by a multi-core processor to obtain the corresponding upper triangular matrix and orthogonal matrix; The original layer block matrix is replaced by the upper triangular matrix, and the orthogonal matrix is transposed by conjugate to obtain the update matrix. The remaining layers are then updated in parallel using a multi-core processor. Based on the reflection vector implicitly stored during the parallel triangular decomposition process of the multi-core processor, the overall orthogonal matrix corresponding to the large-scale matrix is obtained by solving the problem. At the same time, the overall upper triangular matrix obtained after layer block update is output, thus completing the QR decomposition of the large-scale matrix.
2. The QR decomposition multi-core computation method integrating column block TSQR and tile update as described in claim 1, characterized in that, The large-scale matrix to be decomposed is horizontally divided according to the number of cores in a multi-core processor, and the large-scale matrix is divided into multiple layers according to the tile update method. This includes: dividing the large-scale matrix into sub-matrices with the same number of cores as the multi-core processor by columns, and defining the set of all matrix blocks in the same horizontal and vertical directions to the lower right of the matrix block as the base matrix block.
3. The QR decomposition multi-core computation method integrating column block TSQR and tile update as described in claim 1, characterized in that, The multi-level pipeline for constructing a binary tree structure includes: each core of a multi-core processor as a computing node in the pipeline; the number of cores in the pipeline decreases by a factor of two as the level increases; and the computing nodes at the same level of the pipeline execute triangular decomposition synchronously and in parallel. After all computing nodes at the previous level have completed the calculation and output the results, the computing nodes at the next level start the calculation.
4. The QR decomposition multi-core computation method integrating column block TSQR and tile update as described in claim 1, characterized in that, The parallel triangular decomposition of the initial layer block of the large-scale matrix by a multi-core processor includes: first, all computing nodes of the first stage of the multi-stage pipeline independently perform triangular decomposition on each sub-matrix of the initial layer block; then, subsequent computing nodes at each stage merge the matrices output by two adjacent computing nodes of the previous stage in turn, and perform triangular decomposition on the merged matrix until a single computing node in the last stage of the pipeline completes the matrix merging and triangular decomposition to obtain the upper triangular matrix corresponding to the initial layer block.
5. The QR decomposition multi-core computation method for integrating column block TSQR and tile update according to claim 1, characterized in that, The reflection vector implicitly stored by the multi-core processor during the parallel triangulation process includes: the reflection vector generated during the parallel triangulation process is directly stored in the storage area of the original matrix, and the reflection vector is retained in the processing memory of the corresponding computing node level by level as the multi-stage pipeline calculation process proceeds.
6. The QR decomposition multi-core computation method for integrating column block TSQR and tile update according to claim 1, characterized in that, The method of obtaining the overall orthogonal matrix corresponding to the large-scale matrix based on the reflection vector implicitly stored in the parallel triangulation process of the multi-core processor includes: firstly, constructing a reflection matrix based on the reflection vector implicitly stored in each computing node, and then obtaining the single-core orthogonal matrix corresponding to the triangulation performed by each computing node from the reflection matrix; subsequently, multiplying the orthogonal matrices corresponding to each stage in the multi-stage pipeline in a cascaded manner to obtain the overall orthogonal matrix of the large-scale matrix.
7. The QR decomposition multi-core computation method for integrating column block TSQR and tile update according to claim 1, characterized in that, The method of implementing parallel updates of other layers using a multi-core processor includes: utilizing the hardware characteristics of multi-core processors where cores are independent and share memory, allowing each computing node to directly access the update matrix in shared memory and simultaneously perform matrix multiplication update operations on different layers to be updated.
8. The QR decomposition multi-core computation method for integrating column block TSQR and tile update according to claim 1, characterized in that, Before performing parallel triangular decomposition on the merged matrix, the merged matrix is transposed to convert the row storage form of the matrix into the column storage form. After the triangular decomposition is completed and the decomposition matrix is obtained, the decomposition matrix is reverse transposed to restore it to an upper triangular matrix in row storage form.
9. The QR decomposition multi-core computation method for integrating column block TSQR and tile update according to claim 1, characterized in that, The parallel triangular decomposition includes a QR decomposition algorithm based on Householder transformation. The reflection vector is obtained by solving the column vectors of the matrix. After constructing the reflection matrix from the reflection vectors, the column vectors of the matrix are updated sequentially through the reflection matrix until the matrix is transformed into an upper triangular matrix.
10. A multi-core computing device for QR decomposition that integrates column block TSQR and tile update, characterized in that, include: The preprocessing module is configured to horizontally divide the large-scale matrix to be decomposed based on the number of cores in a multi-core processor, and divide the large-scale matrix into multiple layers according to the tile update method. The first computing module is configured to construct a multi-stage pipeline of a binary tree structure. It performs parallel triangular decomposition on the initial blocks of the large-scale matrix through a multi-core processor to obtain the corresponding upper triangular matrix and orthogonal matrix. The original layer block matrix is replaced by the upper triangular matrix, and the orthogonal matrix is transposed by conjugate to obtain the update matrix. The remaining layers are then updated in parallel using a multi-core processor. The second calculation module is configured to solve for the overall orthogonal matrix corresponding to the large-scale matrix based on the reflection vector implicitly stored in the parallel triangular decomposition process of the multi-core processor, and output the overall upper triangular matrix obtained after layer block update, thus completing the QR decomposition of the large-scale matrix.
