A data processing method, system and related devices

CN122045576BActive Publication Date: 2026-08-21HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511951397.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2026-08-21
Estimated Expiration
2043-02-20

AI Technical Summary

Technical Problem

但是,由于各个进程负责的矩阵分解计算任务中涉及的分块的数量不同,粒度较大的分块会导致出现进程负载不均衡的问题,进而降低矩阵分解的整体的计算效率

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122045576B_ABST
    Figure CN122045576B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device and related equipment, which can perform LU decomposition on the R column sub-matrix of the to-be-decomposed matrix needed to be decomposed in each iteration process in the LU decomposition calculation process of the to-be-processed data of an application, that is, a dense matrix, and calculate the matrix multiplication with the product of R and the dimension of the sub-matrix as the dimension. The dimension of the matrix multiplication calculation is large, and the efficient calculation of the matrix multiplication can be realized. In this way, the dense matrix can be divided into sub-matrices with small granularity, the calculation efficiency of the matrix multiplication is ensured to be high on the premise that the process load is relatively balanced, and then the overall efficiency of the matrix decomposition calculation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202310183425.X and the original application date is February 20, 2023. The entire contents of the original application are incorporated herein by reference. Technical Field

[0002] This application relates to the field of data processing technology, and in particular to a data processing method, system and related equipment. Background Technology

[0003] Matrix solving is involved in numerous scientific and engineering fields, such as meteorology, electromagnetism, fluid mechanics, astronomical simulations, and computer performance testing. Based on their storage format, matrices can be categorized into dense matrices and sparse matrices. Dense matrices store all elements in a logical two-dimensional orientation. Sparse matrices store only the non-zero elements. Dense matrices can be solved using matrix decomposition.

[0004] Currently, dense matrices are divided into blocks, and each block is assigned to a different process for matrix decomposition calculation. Matrix multiplication is computationally intensive during matrix decomposition. To improve the efficiency of matrix multiplication, larger-granularity matrix blocks are typically used to increase the amount of data involved in the calculation. However, because the number of blocks involved in the matrix decomposition tasks handled by each process varies, larger-granularity blocks can lead to uneven process load, thus reducing the overall computational efficiency of matrix decomposition. Summary of the Invention

[0005] This application provides a data processing method, system, and related equipment that, during the matrix decomposition of the data to be processed (i.e., a dense matrix), performs merged LU decomposition and merged row swapping operations, and performs matrix multiplication calculations with the sum of the dimensions of the R submatrices as the dimension. The matrix multiplication calculation has a large dimension, enabling efficient matrix multiplication computation. This allows the dense matrix to be divided into smaller-granularity blocks, ensuring high computational efficiency of matrix multiplication while achieving a relatively balanced process load, thereby improving the overall computational efficiency of matrix decomposition.

[0006] In a first aspect, this application provides a data processing method applied to a computing device or computing cluster running multiple processes. The method involves acquiring the application's data to be processed. The data to be processed is a dense matrix comprising M×M submatrices. The dense matrix is ​​used as the matrix to be decomposed. The matrix to be decomposed is divided into a first matrix, a second matrix, a third matrix, and a fourth matrix. The first matrix consists of R×R submatrices located at the top left corner of the matrix to be decomposed. The second matrix consists of R×(MR) submatrices located directly below and adjacent to the first matrix. The third matrix consists of (MR)×R submatrices located to the right of the first matrix and adjacent to it. The fourth matrix consists of (MR)×(MR) submatrices formed by the remaining submatrices of the matrix to be decomposed. LU decomposition is performed on the first and second matrices to obtain updated first and second matrices. Row swapping is then performed on the third matrix, and triangulation is performed using the updated first matrix and the third matrix obtained after the row swapping to obtain an updated third matrix. The GEMM operator is used to calculate the fourth matrix, and the difference between this product and the product of the matrix multiplications of the updated second and third matrices is used to obtain the updated fourth matrix. This updated fourth matrix is ​​then used as the matrix to be decomposed, and the same decomposition operation is performed iteratively until all M×M submatrices have been calculated. The dimension of the matrix multiplication calculated by the GEMM operator is the product of R and the dimensions of the submatrices, which is the sum of the dimensions of the R submatrices. Compared to matrix multiplication where the dimension is the dimension of a single submatrix, the matrix multiplication calculated using the data processing method of this application has a larger dimension, which meets the requirements for high-efficiency matrix multiplication. While ensuring high efficiency in matrix multiplication, the dimensions of each submatrix included in the dense matrix can be slightly smaller. This reduces the load imbalance that occurs when using multiple processes to process each submatrix separately, thereby improving the efficiency of the overall decomposition calculation of the dense matrix.

[0007] In some possible implementations, the size of R is determined by the computing power of the chip performing the matrix multiplication.

[0008] In some possible implementations, the matrix to be decomposed in the last iteration, which is the updated fourth matrix generated in the previous iteration, consists of N×N submatrices. When N is less than or equal to R, the last iteration directly performs LU decomposition on the N×N submatrices to complete the decomposition of the dense matrix and obtain the decomposition result.

[0009] In some possible implementations, line break information is generated during the LU decomposition of the first and second matrices. As an example, row swapping of the third matrix can be performed row-by-row based on the line break information. Alternatively, the line break information can be preprocessed to obtain processed line break information, and then the row swapping operation on the third matrix can be performed based on this processed information. Preprocessing can merge or filter the line break information, reducing the number of steps involved in performing the row swapping operation and improving the efficiency of the row swapping operation on the third matrix.

[0010] Secondly, this application provides a data processing system, the system comprising:

[0011] The acquisition module is used to acquire the application's data to be processed, wherein the data to be processed is a dense matrix, and the dense matrix includes M×M submatrices;

[0012] The partitioning module is used to take the dense matrix as the matrix to be decomposed and divide it into a first matrix, a second matrix, a third matrix, and a fourth matrix. The first matrix consists of R×R submatrices and is located at the upper left corner of the matrix to be decomposed. The second matrix consists of R×(MR) submatrices and is located directly below and adjacent to the first matrix. The third matrix consists of (MR)×R submatrices and is located to the right of the first matrix and adjacent to the first matrix. The fourth matrix consists of (MR)×(MR) submatrices formed by the remaining submatrices.

[0013] The calculation module is used to perform LU decomposition on the first matrix and the second matrix to obtain the updated first matrix and the updated second matrix, perform row swap operation on the third matrix, and use the updated first matrix and the third matrix obtained after the row swap operation to perform trigonometric solving to obtain the updated third matrix, call the GEMM operator to calculate the matrix multiplication of the updated second matrix and the updated third matrix to obtain the product, and calculate the difference between the fourth matrix and the product to obtain the updated fourth matrix.

[0014] The calculation module is also used to take the updated fourth matrix as the matrix to be decomposed, and perform the same decomposition operation as the dense matrix, and iterate until all the M×M submatrices are calculated.

[0015] In some possible implementations, the size of R is determined by the computing power of the chip in the computing device that performs the matrix multiplication, as well as the size of the dense matrix and the size of the computing device cluster to which it belongs.

[0016] In some possible implementations, the computation module is further configured to perform LU decomposition on the N×N submatrices when the updated fourth matrix consists of N×N submatrices and N is less than or equal to R.

[0017] In some possible implementations, the computation module is used to perform row swapping operations on the third matrix, including:

[0018] The calculation module is used to perform row swapping operations on the third matrix line by line based on the line break information, wherein the line break information is generated by performing LU decomposition on the first matrix and the second matrix.

[0019] In some possible implementations, the computation module is used to perform row swapping operations on the third matrix, including:

[0020] The calculation module is used to preprocess the line break information to obtain processed line break information, which is generated by performing LU decomposition on the first matrix and the second matrix; and to perform row swapping operation on the third matrix based on the processed line break information.

[0021] Thirdly, this application provides a computer code product containing instructions that, when run on a computing device, cause the computing device to perform the method described in the first aspect or any implementation thereof.

[0022] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0023] Figure 1 This is a schematic diagram illustrating the allocation of dense matrix blocks to various processes.

[0024] Figure 2 This is a schematic diagram of a dense matrix decomposition.

[0025] Figure 3 This is a schematic diagram of another dense matrix decomposition.

[0026] Figure 4 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0027] Figure 5 A schematic diagram of a matrix to be decomposed, comprising a first matrix, a second matrix, a third matrix, and a fourth matrix, provided in an embodiment of this application;

[0028] Figure 6 This is a schematic diagram of the structure of a data processing system provided in an embodiment of this application;

[0029] Figure 7This is a schematic diagram of the structure of a computing device provided in an embodiment of this application;

[0030] Figure 8 This is a schematic diagram of the structure of a computing device cluster provided in an embodiment of this application. Detailed Implementation

[0031] The solutions in the embodiments provided in this application will now be described with reference to the accompanying drawings.

[0032] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application.

[0033] Dense matrix decomposition methods can be implemented based on block decomposition and recursive strategies. Taking LU decomposition, which is applicable to general matrix decomposition, as an example, the following section introduces the LU decomposition process for dense matrices with shape AxA, where A is a positive integer.

[0034] First, partition the dense matrix such that the resulting dense matrix comprises blocks of size NB x NB, where NB is a positive integer. See also... Figure 1 As shown. Each square represents a block. A block can also be called a submatrix. The dense matrix is ​​divided into 81 blocks of size NBxNB. In a distributed computing program, these blocks are allocated to multiple running processes. Taking 9 processes as an example, a two-dimensional loop is used to allocate the 9×9 blocks to the 9 processes. See also Figure 1 As shown, the numbers in the squares represent (process row number, process column number), used to identify the process responsible for the computation of that block.

[0035] LU decomposition employs an iterative approach. Each iteration processes one NB row and one NB column, updating the tail matrix. After multiple iterations, the entire matrix can be decomposed. Specifically, in the first iteration, the first NB column is decomposed first. See [link to related documentation]. Figure 2As shown, this diagram illustrates a dense matrix decomposition. First, the first NB column is decomposed, yielding L11, U11, and L21 of the diagonal blocks. L11 is the lower triangular portion of the diagonal block, and U11 is the upper triangular portion. L21 is the portion of the first NB column excluding the diagonal blocks. It should be noted that the decomposition uses Gaussian elimination with column pivoting. The column pivot is the largest element in the column. After selecting the column pivot, the row containing the pivot needs to be swapped with the current row before elimination. During the decomposition of the first NB column, newline information is generated based on the selected pivot. This newline information indicates the NB row that needs to be swapped with the current NB row, i.e., the first NB row. Swapping the NB row indicated by the newline information with the first NB row yields the swapped U12. U12 is the portion of the first NB row excluding the diagonal blocks. Then, the trigonometric equation U12 = L11 is solved. -1 U12 is used to obtain the updated U12. Finally, the tail matrix A22 is updated. The tail matrix A22 is the dense matrix excluding the first NB column and U12. Calculate A22 = A22 - L21U12. Use the calculated A22 to update A22 in the matrix. The tail matrix update involves matrix multiplication, which can be performed using algorithms for calculating matrix multiplication. After the first iteration, A22 is iterated through with the same steps for the next iteration. See also... Figure 3 As shown in the figure, this is a schematic diagram of another dense matrix decomposition. The solid lines represent the NB columns and NB rows processed in each iteration. After many iterations, the dense matrix can be decomposed.

[0036] In the LU decomposition process, the tail matrix update in each iteration accounts for the majority of the computational load. Currently, the General Matrix to Matrix Multiplication (GEMM) operator is used to perform matrix multiplication calculations during the tail matrix update process. However, for memory-constrained computing chips, memory bandwidth is limited, and the dimension of the input matrix needs to be controlled when running the GEMM operator. Given sufficient memory bandwidth, a larger dimension of the input matrix can improve the computational efficiency of the GEMM operator. In the current LU decomposition process, the second dimension K of the matrix input to the GEMM operator is equal to the dimension NB of the matrix partition, i.e., K = NB. Therefore, to achieve higher computational efficiency for the GEMM operator, a dense matrix partitioning with a larger NB value is required. However, partitioning with a larger NB value results in a larger granularity of the partitions. In the process of implementing matrix decomposition using various processes, this larger granularity leads to an unbalanced computational load across processes, thus affecting the overall computational efficiency of matrix decomposition and preventing the achievement of high-efficiency overall matrix decomposition computation.

[0037] To address the aforementioned problems, this application provides a data processing method capable of performing LU decomposition on the application's data to be processed, i.e., a dense matrix. First, the dense matrix is ​​divided into M×M sub-matrices. Then, the dense matrix is ​​used as the matrix to be decomposed, and this matrix is ​​further divided into a first matrix, a second matrix, a third matrix, and a fourth matrix. The first matrix consists of R×R sub-matrices located in the upper left corner of the matrix to be decomposed. The second matrix consists of R×(MR) sub-matrices located directly below and adjacent to the first matrix. The third matrix consists of (MR)×R sub-matrices adjacent to and to the right of the first matrix. The fourth matrix is ​​the matrix to be decomposed excluding the first, second, and third matrices. LU decomposition is performed on the first and second matrices (the first and second matrices, i.e., the matrix to be decomposed), yielding updated first and second matrices. Row swapping and triangulation are then performed on the third matrix to obtain an updated third matrix. The difference between the fourth matrix and the product of the updated third and second matrices is calculated to obtain the updated fourth matrix. This process completes one iteration. The updated fourth matrix is ​​used as the matrix to be decomposed, and the same decomposition operation is performed. This process is repeated multiple times until the dense matrix is ​​completely decomposed. The matrix multiplication of the updated second and third matrices is calculated with the dimension R being the product of the dimensions of the submatrices. The relatively large dimension of matrix multiplication allows for efficient computation. This method divides the dense matrix into smaller, more granular blocks, ensuring high computational efficiency for matrix multiplication while maintaining a relatively balanced process load, thereby improving the overall efficiency of matrix decomposition.

[0038] In one possible implementation, the data processing method provided in this application embodiment can be applied to a standalone computing device configured with a memory-limited computing chip. The standalone computing device is, for example, a supercomputer. The standalone computing device runs in a multi-process manner.

[0039] The following describes the data processing method provided in this application embodiment using the High Performance Linpack (HPL) software package to test the computing performance of a computing device as an example. The HPL testing process mainly includes matrix generation, matrix decomposition, back-substitution solution, result verification, and performance evaluation. Among these, matrix decomposition is the most time-consuming stage in the entire HPL process and is also a crucial stage that determines computer performance.

[0040] HPL's benchmark program uses a Linear Congruential Algorithm (LCA) to generate a pseudo-random dense matrix. The computing device acquires the application's data to be processed, which is the dense matrix generated by HPL's benchmark program. The dense matrix is ​​divided into M×M submatrices, where M is a positive integer. These submatrices are distributed to the various processes running on the computing device using a two-dimensional cyclic approach. The dense matrix is ​​used as the matrix to be decomposed, and this matrix is ​​further divided into a first matrix, a second matrix, a third matrix, and a fourth matrix. The first matrix consists of R×R submatrices located at the top left corner of the matrix to be decomposed. The second matrix consists of R×(MR) submatrices located directly below and adjacent to the first matrix. The third matrix consists of (MR)×R submatrices located to the right of the first matrix and adjacent to it. The fourth matrix consists of (MR)×(MR) submatrices formed by the remaining submatrices. The first and second matrices of the matrix to be decomposed are subjected to merged LU decomposition. The third matrix is ​​then subjected to merged row swapping and triangulation. Finally, matrix multiplication is performed using the updated second and third matrices, and the resulting matrix is ​​used to update the fourth matrix. The updated fourth matrix is ​​then used as the matrix to be decomposed again, and the decomposition operation is performed according to the above method. This process is repeated multiple times until all M×M submatrices have been calculated, yielding the LU decomposition result of the dense matrix. Based on the decomposition result, subsequent back-substitution solutions and result verification can be performed.

[0041] In another possible implementation, the data processing method provided in this application embodiment can be applied to a computing cluster of memory-constrained computing chips. This computing cluster operates in a multi-process manner, such as using a MultiPoint Interface (MPI). The computing nodes in the computing cluster are connected via a network and communicate using a communication protocol such as MPI.

[0042] As an example, the computing cluster can utilize the data processing methods provided in this application to realize high-performance computing (HPC) applications in the field of scientific computing based on the boundary element method or the method of moments. In the boundary element method, the physical region to be solved is meshed. An analytical expression within the region and on the boundary is established using Green's function, transforming the original partial differential equations into boundary integral equations. The boundary integral equations are then discretized on the surface mesh to establish a system of linear equations. A dense matrix is ​​established based on the system of linear equations, transforming the physical modeling problem into a problem of solving the dense matrix. The established dense matrix is ​​the data to be processed in the application. The computing cluster divides the data to be processed, i.e., the dense matrix, into M×M sub-matrices. The dense matrix is ​​used as the matrix to be decomposed. The matrix to be decomposed is divided into a first matrix, a second matrix, a third matrix, and a fourth matrix. The first matrix consists of R×R sub-matrices located in the upper left corner of the matrix to be decomposed. The second matrix consists of R×(MR) sub-matrices located directly below and adjacent to the first matrix. The third matrix consists of (MR) × R submatrices located to the right of the first matrix and adjacent to it. The fourth matrix consists of (MR) × (MR) submatrices formed by the remaining submatrices. The first and second matrices to be decomposed are subjected to a merged LU decomposition. The third matrix is ​​then subjected to a merged row swap operation and triangulation. Finally, matrix multiplication is performed using the updated second and third matrices, and the resulting matrix is ​​used to update the fourth matrix. The updated fourth matrix is ​​then used as the matrix to be decomposed, and the decomposition operation is performed according to the above method. This process is repeated multiple times until all M × M submatrices have been calculated, yielding the LU decomposition result of the dense matrix. Based on the LU decomposition result, the solution to the linear equation system, i.e., the physical field results on the boundary surface, can be calculated.

[0043] It should be noted that the two application scenarios described above are only implementation examples. In actual applications, the data processing method provided in this application embodiment can also be applied to other applicable data processing scenarios.

[0044] For ease of understanding, the data processing method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings. See also Figure 4 As shown, this figure is a flowchart illustrating a data processing method provided in an embodiment of this application. This method can be applied to computing devices or computing clusters running multiple processes. Figure 4 As shown, the method may specifically include the following steps.

[0045] S401: Obtain the application's data to be processed, wherein the data to be processed is a dense matrix, and the dense matrix includes M×M submatrices.

[0046] The data to be processed in the application is data generated during application operation that needs to be processed or data required for application operation. The data to be processed is a dense matrix. A dense matrix is ​​a matrix in which all elements are stored in a logical two-dimensional direction. The obtained dense matrix is ​​a matrix that needs to be decomposed. As an example, the application is used to test the performance of computing devices. The data to be processed in the application is a randomly generated dense matrix used to test the performance of computing devices. As another example, the application is used to implement physical or mathematical calculations. The dense matrix calculates physical or mathematical equations. The embodiments of this application do not limit the data type of the elements included in the dense matrix. For example, the elements included in the dense matrix can be one or more of single-precision real numbers, double-precision real numbers, single-precision complex numbers, and double-precision complex numbers. The dense matrix includes M×M submatrices. Where M is a positive integer less than the dimension of the dense matrix. In one possible implementation, the dimension NB of the submatrices can be preset, and the ratio of the dimension of the dense matrix to the dimension of the submatrices can be calculated to obtain the value of M. The embodiments of this application do not limit the specific value of M. The value of M can be determined based on the number of processes and the load of each process. As an example, if there are 100 processes, the value of M is 20. The resulting dense matrix consists of 20×20 submatrices.

[0047] S402: The dense matrix is ​​taken as the matrix to be decomposed and divided into a first matrix, a second matrix, a third matrix, and a fourth matrix.

[0048] The dense matrix is ​​decomposed into four matrices: matrix 1, matrix 2, matrix 3, and matrix 4. (See also...) Figure 5 As shown in the figure, this is a schematic diagram of a first matrix, a second matrix, a third matrix, and a fourth matrix included in a matrix to be decomposed according to an embodiment of this application. The first matrix is ​​an R×R submatrix located at the upper left corner of the matrix to be decomposed. The second matrix is ​​an R×(MR) submatrix located below and adjacent to the first matrix in the matrix to be decomposed. The third matrix is ​​a (MR)×R submatrix located to the left of and adjacent to the first matrix in the matrix to be decomposed. The fourth matrix is ​​a (MR)×(MR) submatrix excluding the first, second, and third matrices in the matrix to be decomposed.

[0049] R is a positive integer greater than 1 and less than M. The size of R is determined by the computing power of the chip performing matrix multiplication. The chip performing matrix multiplication is a chip in a computing device or computing cluster.

[0050] S403: Perform LU decomposition on the first and second matrices to obtain the updated first and second matrices. Perform row swapping on the third matrix and solve for the updated third matrix using the updated first matrix. Call the GEMM operator to calculate the fourth matrix. The difference between the fourth matrix and the matrix product of the updated second and third matrices is used to obtain the updated fourth matrix.

[0051] After partitioning the matrix to be decomposed into four matrices, LU decomposition is performed. First, the first and second matrices are LU decomposed, specifically the first R columns, yielding updated first and second matrices. The updated first matrix includes the upper triangular matrix U11 and the lower triangular matrix L11 obtained after LU decomposition. The updated second matrix is ​​L21.

[0052] As an example, this application provides a specific implementation of LU decomposition of a first matrix and a second matrix. It includes the following steps:

[0053] A1: Perform a block decomposition on the i-th column of the first and second matrices to obtain the i-th decomposition result and the line break information of the i-th row.

[0054] Here, the initial value of i is 1. Performing Panel decomposition (LU decomposition) on the i-th column yields the i-th decomposition result. The i-th decomposition result includes the lower triangular matrix L11 generated from the decomposition of the i-th column. i Upper triangular matrix U11 i The i-th column of the second matrix, which is L21 i The lower triangular matrix is ​​the lower triangular portion of the submatrix in the i-th row of the i-th column after decomposition. The upper triangular matrix is ​​the upper triangular portion of the submatrix in the i-th row of the i-th column after decomposition. The i-th column of the second matrix is ​​the submatrix of the i-th column after decomposition, excluding the submatrix in the first R rows. Panel decomposition of the i-th column generates line break information for the i-th row. The line break information of the i-th row is used to indicate row swapping from column (i+1) to column M in the i-th row.

[0055] A2: Broadcast the i-th decomposition result and the line break information of the i-th row to the processes assigned to process the submatrices from the 1st to the Rth columns via a panel.

[0056] The i-th decomposition result obtained after decomposing the i-th column needs to be sent to the process responsible for calculating each submatrix in columns 1 to R. The process transmits the i-th decomposition result and the newline information of the i-th row through Panel broadcast.

[0057] A3: Based on the line break information of the i-th row, perform row swapping from column i+1 to column R of the i-th row.

[0058] During the LU decomposition of the first and second matrices (columns 1 to R), only the submatrices of columns 1 to R are processed. Based on the newline information of row i, a row swap operation is performed between columns i+1 to R of row i and columns i+1 to R of the row containing the pivot element of column i. The resulting columns i+1 to R of column i after the row swap operation are represented by U12. i .

[0059] A4: Utilizing L21 i U12 i And update the local tail matrix.

[0060] Local tail matrix A22 i Let [Ri] be the matrix of the [Ri]×[Ri] part. Calculate the local tail matrix, and, L21 i and U12 i The difference between the products of matrix multiplications is used to obtain the updated local tail matrix.

[0061] In one possible implementation, a matrix multiplication operator is invoked to compute the matrix multiplications during the update of the local tail matrix. During the LU decomposition of the first and second matrices, the dimension of the matrices passed to the matrix multiplication operator is the dimension of a single submatrix. As an example, the matrix multiplication operator can be one of the following: General Matrix to Matrix Multiplication (GEMM), Double Precision GEneric Matrix Multiplication (DGEMM), Single Precision GEneric Matrix Multiplication (SGEMM), Complex Precision GEneric Matrix Multiplication (CGEMM), or Double Complex Precision GEneric Matrix Multiplication (ZGEMM).

[0062] A5: Increment the value of i by 1.

[0063] A6: If the value of i is less than R, then return to execute steps A1 to A5.

[0064] A7: If the value of i is equal to R, perform LU decomposition on the i-th column of the matrix to be decomposed to obtain the i-th decomposition result and the newline information of the i-th row, thus completing the LU decomposition of the first and second matrices.

[0065] Column R is the last column in the LU decomposition of columns 1 through R. Performing LU decomposition on column R yields L11. R L21 R And the newline information in row R. The newline information in row R is used to indicate the row swapping from column R+1 to column M in row R, which does not need to be performed during the LU decomposition of the first and second matrices. The L211 to L21 values ​​obtained after decomposing the first and second matrices. R This forms the updated second matrix. (U111 to U11) R-1 The upper triangular matrix that forms the updated first matrix. L111 to L11 R This forms the lower triangular matrix of the updated first matrix.

[0066] After performing LU decomposition on the first and second matrices, we can obtain the line break information for row swapping operations on the third matrix. We then use this line break information to perform row swapping operations on the third matrix.

[0067] As examples, embodiments of this application provide two specific implementation methods for performing row swapping operations on a third matrix using line break information.

[0068] In one possible implementation, row swapping operations are performed sequentially on rows 1 through R of the third matrix, in the order from row 1 to row R.

[0069] In another possible implementation, the line break information is first preprocessed to obtain processed line break information. This application does not limit the specific implementation of the preprocessing. In one possible implementation, preprocessing involves merging multiple swap operations on submatrices within the same row, or deleting line break information that does not require a newline operation. This preprocessing reduces the number of steps required for row swapping, thus improving the efficiency of row swapping.

[0070] After performing the row swap operation, the first matrix and the third matrix after the row swap operation are used to perform triangulation. Specifically, the formula for triangulation is U12 = L11. -1 U120. Where U12 is the updated third matrix obtained after trigonometric solving. L11 is the lower triangular matrix in the first matrix. U120 is the third matrix obtained after row swapping.

[0071] Calculate the matrix multiplication of the updated second and third matrices to obtain the product. Then calculate the difference between the fourth matrix and the product to obtain the updated fourth matrix.

[0072] The matrix multiplication of the updated second and third matrices is performed using matrix multiplication with R as the dimension of the product of the submatrices. A large value for R satisfies the requirements for efficient matrix multiplication and also ensures data continuity in memory, meeting the data storage requirements of the GEMM operator.

[0073] S404: Take the updated fourth matrix as the matrix to be decomposed, and perform the same decomposition operation as the dense matrix, and iterate until all M×M submatrices have been calculated.

[0074] The updated fourth matrix is ​​used as the matrix to be decomposed in the next iteration. This matrix is ​​then divided into four submatrices in the same way, along with the LU decomposition of the first and second matrices, and the row swapping operation of the third matrix. Trigonometric solving is then performed using the first matrix and the row-swapped third matrix to obtain the updated third matrix. Finally, the difference between the fourth matrix and the product of the updated second and third matrices is calculated to obtain the updated fourth matrix. This process is repeated multiple times until the dense matrix is ​​completely decomposed, meaning all M×M submatrices have been calculated.

[0075] In one possible implementation, the updated fourth matrix consists of N×N submatrices, where N is less than or equal to R. It is not possible to partition the updated fourth matrix directly. Therefore, LU decomposition is performed directly on the N×N submatrices to complete the decomposition of the dense matrix.

[0076] Based on the data processing method provided in the above embodiments, this application also provides a data processing system. See also... Figure 6 As shown in the figure, this is a schematic diagram of the structure of a data processing system provided in an embodiment of this application. The data processing system 600 can be configured in a separate computing device or in a computing cluster. This system can be applied to the above-mentioned... Figure 4 The application scenarios shown can also be applied to other applicable scenarios. As an example, taking the computing performance of the aforementioned HPL test computing device as an implementation scenario, the data processing system 600 can be deployed on a supercomputer. As another example, taking the aforementioned scientific computing implementation scenario as an example, the data processing system 600 can be deployed on a computing cluster.

[0077] The data processing system 600 includes an acquisition module 601, a partitioning module 602, and a computing module 603. The acquisition module 601 is used to support one or more computing devices or computing clusters to perform the above-mentioned tasks. Figure 4 S401 in the illustrated embodiment; partitioning module 602, used to support one or more computing devices or computing clusters to perform the above-described... Figure 4 S402 in the illustrated embodiment; computing module 603, used to support one of the computing devices or computing clusters, or the computing device performing the above-described... Figure 4 S403 and S404 in the illustrated embodiment. Please refer to the above for the specific execution process. Figure 4 The detailed descriptions of the corresponding steps in the illustrated embodiments will not be repeated here.

[0078] The above Figure 4 The data processing system shown (including the aforementioned acquisition module 601, partitioning module 602, and calculation module 603) can be software configured on a computing device or computing cluster. Furthermore, by running this software on the computing device or computing device cluster, the computing device or computing device cluster can achieve the functions of the aforementioned data processing system. Below, from the perspective of hardware implementation, a detailed description of the data processing system involved in the data processing process will be provided.

[0079] Figure 7 A schematic diagram of a computing device is shown. The aforementioned data processing system can be deployed on this computing device. The computing device can be a computing device in a cloud environment (such as a server), a computing device in an edge environment, or a terminal device, etc. Specifically, it can be used to implement the functions of the aforementioned acquisition module 601, partitioning module 602, and computing module 603.

[0080] like Figure 7 As shown, the computing device 700 includes a processor 710, a memory 720, a communication interface 730, and a bus 740. The processor 710, memory 720, and communication interface 730 communicate via the bus 740. The bus 740 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 7 The symbol is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. The communication interface 730 is used for communication with external systems, such as receiving data processing tasks.

[0081] The processor 710 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), or one or more integrated circuits. The processor 710 can also be an integrated circuit chip with signal processing capabilities. In implementation, the functions of each module in the data processing system can be accomplished through the integrated logic circuits in the hardware of the processor 710 or through software instructions. The processor 710 can also be a general-purpose processor, a digital signal processor (DSP), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The methods disclosed in the embodiments of this application can be directly embodied as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 720. The processor 710 reads the information in the memory 720 and, in conjunction with its hardware, completes some or all of the functions of the data processing system.

[0082] The memory 720 may include volatile memory, such as random access memory (RAM). The memory 720 may also include non-volatile memory, such as read-only memory (ROM), flash memory, HDD, or SSD.

[0083] The memory 720 stores executable code, and the processor 710 executes the executable code to perform the method performed by the aforementioned data processing system.

[0084] Specifically, based on Figure 6 The acquisition module 601, partitioning module 602, and calculation module 603 described in the illustrated embodiment are implemented as follows: Figure 4 In the case of the illustrated embodiment, and Figure 6In the illustrated embodiment, when the acquisition module 601, partitioning module 602, and calculation module 603 are implemented in software, the acquisition module 601, partitioning module 602, and calculation module 603 execute... Figure 4 The software or program code required for the functions of each step in the illustrated embodiment is stored in the memory 720. The interaction between the acquisition module 601 and other devices is achieved through the communication interface 730. The processor is used to execute the instructions in the memory 720 to implement the methods executed by the data processing system.

[0085] Figure 8 The diagram illustrates the structure of a computing device cluster. Figure 8 The computing device cluster 80 shown includes multiple computing devices, and the aforementioned data processing system can be distributed and deployed across multiple computing devices within this computing device cluster 80. For example... Figure 8 As shown, the computing device cluster 80 includes multiple computing devices 800. Each computing device 800 includes a memory 820, a processor 810, a communication interface 830, and a bus 840. The memory 820, the processor 810, and the communication interface 830 communicate with each other through the bus 840.

[0086] The processor 810 can be a CPU, GPU, ASIC, or one or more integrated circuits. The processor 810 can also be an integrated circuit chip with signal processing capabilities. During implementation, some functions of the data processing system can be completed through integrated logic circuits in the hardware of the processor 810 or through software instructions. The processor 810 can also be a DSP, FPGA, general-purpose processor, other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components, capable of implementing or executing some of the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 820. In each computing device 800, the processor 810 reads information from memory 820 and, in conjunction with its hardware, can complete some functions of the data processing system.

[0087] The memory 820 may include ROM, RAM, static storage devices, dynamic storage devices, hard disks (e.g., SSDs, HDDs), etc. The memory 820 can store program code, such as part or all of the program code for implementing the acquisition module 601, part or all of the program code for implementing the partitioning module 602, and part or all of the program code for implementing the calculation module 603. For each computing device 800, when the program code stored in the memory 820 is executed by the processor 810, the processor 810 executes a portion of the methods executed by the data processing system based on the communication interface 830. For example, one part of the computing device 800 can be used to execute the methods executed by the acquisition module 601, and another part of the computing device 800 can be used to execute the methods executed by the partitioning module 602 and the calculation module 603. The memory 820 can also store data, such as intermediate data or result data generated by the processor 810 during execution, such as the acquired data to be processed and the results obtained from decomposition.

[0088] The communication interface 803 in each computing device 800 is used to communicate with the outside world, such as interacting with other computing devices 800.

[0089] Bus 840 can be a standard bus for interconnecting peripheral components or an extended industry standard architecture bus, etc. For ease of representation, Figure 8 The bus 840 within each computing device 800 is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0090] The aforementioned computing devices 800 establish communication channels through a communication network to realize the functions of the data processing system. Any computing device can be a computing device in a cloud environment (e.g., a server), a computing device in an edge environment, or a terminal device.

[0091] Furthermore, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on one or more computing devices, cause the one or more computing devices to perform the methods executed by the various modules of the data processing system described above.

[0092] Furthermore, this application also provides a computer program product, which, when executed by one or more computing devices, allows the computing devices to perform any of the aforementioned data processing methods. The computer program product can be a software installation package; when any of the aforementioned data processing methods needs to be used, the computer program product can be downloaded and executed on a computer.

[0093] It should also be noted that the system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the system embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0095] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0096] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A data processing method, characterized in that, include: Obtain the application's data to be processed, wherein the data to be processed is a dense matrix, and the dense matrix includes M×M submatrices; The dense matrix is ​​used as the matrix to be decomposed and divided into a first matrix, a second matrix, a third matrix, and a fourth matrix. The first matrix consists of R×R submatrices and is located at the top left corner of the matrix to be decomposed. The second matrix consists of (MR)×R submatrices and is located directly below and adjacent to the first matrix. The third matrix consists of R×(MR) submatrices and is located to the right of the first matrix and adjacent to it. The fourth matrix consists of (MR)×(MR) submatrices formed by the remaining submatrices. The size of R is determined by the computing power of the chip performing matrix multiplication in the computing device. R is a positive integer greater than 1 and less than M. Perform LU decomposition on the first matrix and the second matrix to obtain the updated first matrix and the updated second matrix; Perform a row swap operation on the third matrix, and then use the updated first matrix and the third matrix obtained after the row swap operation to perform triangulation to obtain the updated third matrix. The GEMM operator is invoked to calculate the matrix multiplication of the updated second matrix and the updated third matrix to obtain the product, and the difference between the fourth matrix and the product is calculated to obtain the updated fourth matrix; The updated fourth matrix is ​​used as the matrix to be decomposed, and the same decomposition operation as the dense matrix is ​​performed, and the process is iterated until all M×M submatrices have been calculated.

2. The data processing method according to claim 1, characterized in that, When the updated fourth matrix consists of N×N submatrices, and N is less than or equal to R, then LU decomposition is performed on the N×N submatrices.

3. The data processing method according to claim 1 or 2, characterized in that, The row swapping operation on the third matrix includes: Based on the line break information, row swapping is performed on the third matrix row by row. The line break information is generated by performing LU decomposition on the first matrix and the second matrix.

4. The data processing method according to claim 1 or 2, characterized in that, The row swapping operation on the third matrix includes: The line break information is preprocessed to obtain the processed line break information, which is generated by performing LU decomposition on the first matrix and the second matrix; Based on the processed line break information, a row swapping operation is performed on the third matrix.

5. A data processing system, characterized in that, The system includes: The acquisition module is used to acquire the application's data to be processed, wherein the data to be processed is a dense matrix, and the dense matrix includes M×M submatrices; A partitioning module is used to divide the dense matrix into a first matrix, a second matrix, a third matrix, and a fourth matrix. The first matrix consists of R×R submatrices located at the top left corner of the matrix to be decomposed. The second matrix consists of (MR)×R submatrices located directly below and adjacent to the first matrix. The third matrix consists of R×(MR) submatrices located to the right of the first matrix and adjacent to it. The fourth matrix consists of (MR)×(MR) submatrices formed by the remaining submatrices. The size of R is determined by the computing power of the chip performing matrix multiplication in the computing device. R is a positive integer greater than 1 and less than M. The calculation module is used to perform LU decomposition on the first matrix and the second matrix to obtain the updated first matrix and the updated second matrix, perform row swap operation on the third matrix, and use the updated first matrix and the third matrix obtained after the row swap operation to perform trigonometric solving to obtain the updated third matrix, call the GEMM operator to calculate the matrix multiplication of the updated second matrix and the updated third matrix to obtain the product, and calculate the difference between the fourth matrix and the product to obtain the updated fourth matrix. The calculation module is also used to take the updated fourth matrix as the matrix to be decomposed, and perform the same decomposition operation as the dense matrix, and iterate until all the M×M submatrices are calculated.

6. The data processing system according to claim 5, characterized in that, The calculation module is also used to perform LU decomposition on the N×N submatrices when the updated fourth matrix consists of N×N submatrices and N is less than or equal to R.

7. The data processing system according to claim 5 or 6, characterized in that, The calculation module is used to perform row swapping operations on the third matrix, including: The calculation module is used to perform row swapping operations on the third matrix line by line based on the line break information, wherein the line break information is generated by performing LU decomposition on the first matrix and the second matrix.

8. The data processing system according to claim 5 or 6, characterized in that, The calculation module is used to perform row swapping operations on the third matrix, including: The calculation module is used to preprocess the line break information to obtain processed line break information, which is generated by performing LU decomposition on the first matrix and the second matrix; and to perform row swapping operation on the third matrix based on the processed line break information.

9. A computing device, characterized in that, include: Memory, used to store executable code; A processor for executing executable code stored in the memory to cause the computing device to perform the method as described in any one of claims 1 to 4.

10. A computer code product comprising instructions that, when run on a computing device, cause the computing device to perform the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Matrix inversion method, device and apparatus and computer readable storage medium

    CN110377875A

  • Solution program recording media for simultaneous linear equations having band coefficient matrix

    US20060064452A1