Data processing method and device, computer readable storage medium and computer equipment

By iterating and caching the submatrices of a large matrix during the LU decomposition process, the number of global memory reads and writes is reduced, solving the problem of computation being limited by memory bandwidth and improving the computer's computing speed.

CN117093814BActive Publication Date: 2025-11-25PENG CHENG LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311054523.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-21
Publication Date
2025-11-25
Estimated Expiration
2043-08-21

AI Technical Summary

Technical Problem

When decomposing a large matrix using LU decomposition, the remaining submatrices in each pair of large matrices need to be read and written into the processor's global memory once, which limits the computation to the upper limit of memory bandwidth, wastes computing resources, and affects the computation speed.

Method used

By determining the input matrix and target submatrix within the current iteration region from multiple submatrices of the original matrix, the number of read/write operations to global memory is reduced. Panel decomposition and triangular matrix solving algorithms are used to iterate the submatrices, and a preset cache is used to store intermediate results.

Benefits of technology

This reduces the number of reads and writes to global memory, fully utilizes the performance of computer equipment, and improves computing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117093814B_ABST
    Figure CN117093814B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method and device, a computer readable storage medium and a computer device. The method comprises: determining a first input matrix and a second input matrix corresponding to a first sub-matrix in a current iteration area; determining a target second sub-matrix of a first sub-iteration area in a first iteration area adjacent to the current iteration area according to the first input matrix and the second input matrix; performing iteration on at least one sub-iteration area in the first iteration area according to the target second sub-matrix to obtain a third input matrix and a fourth input matrix; and determining a target selected sub-matrix of a target iteration area which is not adjacent to the current iteration area and the first iteration area according to the first input matrix, the second input matrix, the third input matrix and the fourth input matrix. Thus, reading and writing of the global memory is avoided in each iteration area, the number of reading and writing of the global memory of the processor is reduced, and the performance of the computer device is fully utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a data processing method, apparatus, computer-readable storage medium, and computer equipment. Background Technology

[0002] With the development of computer technology, various testing standards have been developed to test the peak performance of computers. Among them, the High Performance Linear System Package (HPL) is a widely used benchmark program for measuring the actual peak performance of computers.

[0003] The algorithm corresponding to the high-performance linear systems software package is LU decomposition, a method that decomposes a square matrix into the product of a lower triangular matrix and an upper triangular matrix. LU decomposition is used to decompose a large matrix in single iteration steps until the decomposition is complete.

[0004] However, when decomposing a large matrix using LU decomposition, each time the remaining submatrices in the large matrix are decomposed, the remaining submatrices need to be read and written into the processor's global memory once, which limits the computation to the upper limit of memory bandwidth, wastes computing resources, and affects the computation speed. Summary of the Invention

[0005] This application provides a data processing method, apparatus, computer-readable storage medium, and computer device. These improvements can enhance data read / write efficiency, thereby fully utilizing the performance of the computer device.

[0006] To address the aforementioned technical problems, this application provides the following technical solutions:

[0007] A data processing method, comprising:

[0008] Among the multiple sub-matrices corresponding to the original matrix, determine the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region;

[0009] The target second submatrix of the first sub-iteration region within the first iteration region is determined based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region and contains at least one sub-iteration region.

[0010] Based on the target second sub-matrix, iterate over at least one sub-iteration region within the first iteration region to obtain the third and fourth input matrices corresponding to at least one sub-iteration region;

[0011] The target selection sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third and fourth input matrices corresponding to at least one sub-iteration region. The target iteration region is not adjacent to either the current iteration region or the first iteration region.

[0012] A data processing apparatus, comprising:

[0013] The first determining module is used to determine the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region from among the multiple sub-matrixes corresponding to the original matrix.

[0014] The second determining module is used to determine the target second sub-matrix of the first sub-iteration region within the first iteration region based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region and contains at least one sub-iteration region.

[0015] The acquisition module is used to iterate over at least one sub-iteration region within the first iteration region based on the target second sub-matrix, and obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region;

[0016] The third determining module is used to determine the target selected sub-matrix of the target iteration region based on the first input matrix, the second input matrix, and the third and fourth input matrices corresponding to at least one sub-iteration region. The target iteration region is not adjacent to the current iteration region and the first iteration region.

[0017] In some implementations, the first determining module is used for:

[0018] The first submatrix in the current iteration region is decomposed to obtain the first upper triangular matrix and the first lower triangular matrix;

[0019] The first input matrix is ​​obtained based on the first upper triangular matrix;

[0020] The second input matrix is ​​obtained from the first lower triangular matrix.

[0021] In some implementations, the first determining module is used for:

[0022] Within the current iteration region, determine each submatrix in the same column as the first submatrix;

[0023] The first input matrix is ​​obtained by applying panel decomposition algorithm to the first upper triangular matrix and each submatrix in the same column.

[0024] In some implementations, the first determining module is used for:

[0025] Within the current iteration region, determine each submatrix in the same row as the first submatrix;

[0026] The second input matrix is ​​obtained by applying the triangular matrix solving algorithm to the first lower triangular matrix and each submatrix in the same row.

[0027] In some implementations, the second determining module is used for:

[0028] The second submatrix within the first sub-iteration region is determined in the first iteration region;

[0029] The second submatrix is ​​updated based on the second submatrix, the first input matrix, and the second input matrix to obtain the target second submatrix within the first sub-iteration region.

[0030] In some implementations, the acquisition module is used for:

[0031] Obtain the third and fourth input matrices corresponding to the second sub-matrix of the target within the first sub-iteration region;

[0032] If the first iteration region includes multiple sub-iteration regions, then the next sub-iteration region is iterated based on the third and fourth input matrices corresponding to the target second sub-matrix and the initial sub-matrix in the next sub-iteration region, so as to determine the target sub-matrix corresponding to the initial sub-matrix and the third and fourth input matrices corresponding to the target sub-matrix of the next sub-iteration region.

[0033] Based on the third and fourth input matrices corresponding to the previous sub-iteration region within the first iteration region and the initial sub-matrix of the next sub-iteration region within the first iteration region, the third and fourth input matrices corresponding to the next iteration region are obtained sequentially until the third and fourth input matrices corresponding to the last sub-iteration region of the first iteration region are obtained.

[0034] In some implementations, the third determining module is used for:

[0035] Identify the selected submatrix within the target iteration region;

[0036] The first target matrix corresponding to the selected submatrix is ​​determined from the first input matrix;

[0037] The second target matrix corresponding to the selected submatrix is ​​determined from the second input matrix;

[0038] Within the first iteration region, select the third target matrix corresponding to the sub-matrix from the third input matrix of each sub-iteration region;

[0039] Within the first iteration region, select the fourth target matrix corresponding to the sub-matrix from the fourth input matrix of each sub-iteration region;

[0040] Based on the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix, the target selected sub-matrix of the target iteration region is determined.

[0041] In some implementations, the third determining module is used for:

[0042] Multiply the first objective matrix by the second objective matrix to obtain the first calculation result;

[0043] Multiply the third objective matrix corresponding to each sub-iteration region in the first iteration region by the fourth objective matrix corresponding to each sub-iteration region in the first iteration region to obtain the second calculation result corresponding to each sub-iteration region in the first iteration region.

[0044] Subtract the first calculation result and the second calculation result corresponding to each sub-iteration region within the first iteration region from the selected submatrix to obtain the target selected submatrix.

[0045] In some implementations, the third determining module is used for:

[0046] The selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix are moved from global memory to a preset cache area;

[0047] In the preset buffer area, the target selected submatrix of the target iteration area is determined based on the selected submatrix, the first target matrix, the third target matrix corresponding to each sub-iteration area in the first iteration area, and the fourth target matrix.

[0048] Write the target selected submatrix into global memory and replace the selected submatrix in global memory.

[0049] In some implementations, after iterating over at least one sub-iteration region within the first iteration region according to the target second sub-matrix to obtain the third and fourth input matrices corresponding to at least one sub-iteration region, the third determining module is used to:

[0050] The target third submatrix in the second iteration region is determined based on the third and fourth input matrices corresponding to the last sub-iteration region in the first iteration region. The second iteration region is adjacent to the first iteration region.

[0051] In some implementations, before determining the first input matrix and the second input matrix corresponding to the first sub-matrix within the current iteration region among multiple sub-matrices corresponding to the original matrix, the first determining module is used to:

[0052] Obtain the set size of the matrix block corresponding to the original matrix;

[0053] The original matrix is ​​divided into blocks according to the set size of the matrix blocks to obtain multiple sub-matrices.

[0054] In some implementations, after determining the first input matrix and the second input matrix corresponding to the first submatrix in the current iteration region, the first determining module is further configured to move the first input matrix from global memory to a preset cache area;

[0055] After iterating over at least one sub-iteration region within the first iteration region based on the target second sub-matrix to obtain the third and fourth input matrices corresponding to at least one sub-iteration region, the acquisition module is further configured to: move the third input matrix corresponding to at least one sub-iteration region from global memory to a preset cache area.

[0056] A computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps in the data processing method described above.

[0057] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the data processing method described above.

[0058] In this embodiment, among the multiple sub-matrices corresponding to the original matrix, the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region are determined; the target second sub-matrix of the first sub-iteration region in the first iteration region is determined based on the first input matrix and the second input matrix, the first iteration region and the current iteration region are adjacent, and the first iteration region contains at least one sub-iteration region; the at least one sub-iteration region in the first iteration region is iterated based on the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to the at least one sub-iteration region; the target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third input matrix and the fourth input matrix corresponding to the at least one sub-iteration region, the target iteration region is not adjacent to either the current iteration region or the first iteration region. In this way, by determining the first and second input matrices of the current iteration region, the third and fourth input matrices of each sub-iteration region in the first iteration region, and then directly determining the target selected sub-matrix of the target iteration region through the first input matrix, the second input matrix, the third input matrix of each sub-iteration region, and the fourth input matrix, the solution provided by this application can achieve fewer read and write operations, thereby reducing the occupation of global memory and making full use of the performance of computer devices, compared to iterating sequentially in each iteration region until iterating to the target iteration region, where each iteration requires a read and write operation of global memory.

[0059] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is a flowchart illustrating the data processing method provided in an embodiment of this application;

[0062] Figure 2 This is a schematic diagram of matrix decomposition provided in an embodiment of this application;

[0063] Figure 3 This is another schematic diagram of matrix decomposition provided in the embodiments of this application;

[0064] Figure 4 This is an iterative diagram of the matrix provided in the embodiments of this application;

[0065] Figure 5 This is another iterative diagram of the matrix provided in the embodiments of this application;

[0066] Figure 6 This is another iterative diagram of the matrix provided in the embodiments of this application;

[0067] Figure 7 This is another iterative diagram of the matrix provided in the embodiments of this application;

[0068] Figure 8 This is a schematic diagram of a data processing scenario provided in an embodiment of this application;

[0069] Figure 9 This is another schematic flowchart of the data processing method provided in the embodiments of this application;

[0070] Figure 10 This is a schematic diagram of the structure of the data device provided in the embodiments of this application;

[0071] Figure 11 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0072] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0073] It should be noted that while some processes described in the specification, claims, and accompanying drawings contain multiple steps that appear in a specific order, it should be clearly understood that these steps may not be performed in the order they appear herein, or may be performed in parallel. The step numbers are merely used to distinguish different steps and do not represent any particular order of execution. Furthermore, descriptions such as "first," "second," or "objective" in this document are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0074] The algorithm corresponding to the high-performance linear systems software package is LU decomposition, a method that decomposes a square matrix into the product of a lower triangular matrix and an upper triangular matrix. LU decomposition is used to decompose a large matrix in single iteration steps until the decomposition is complete.

[0075] However, when decomposing a large matrix using LU decomposition, each time the remaining submatrices in the large matrix are decomposed, the remaining submatrices need to be read and written into the processor's global memory once, which limits the computation to the upper limit of memory bandwidth, wastes computing resources, and affects the computation speed.

[0076] For example, each time a matrix is ​​iterated, it needs to read data from global memory once, and then write the generated data back into global memory. With limited memory bandwidth, excessive memory bandwidth usage will affect the computer's computing speed.

[0077] To address the aforementioned technical problems, this application provides a data processing method, apparatus, computer-readable storage medium, and computer device. This data processing method iterates over a selected submatrix within a target iteration region by fusing multiple iteration steps. Compared to iterating sequentially to the target iteration region, this reduces the number of read / write operations on data in global memory, thereby fully utilizing the computer's performance.

[0078] Please see Figure 1 , Figure 1This is a flowchart illustrating the data processing method provided in an embodiment of this application. This data processing method can be applied to computer equipment and may include the following steps:

[0079] In step 110, among the multiple sub-matrices corresponding to the original matrix, the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region are determined.

[0080] In some implementations, the original matrix is ​​a large matrix. To facilitate calculations on the original matrix, it can be divided into multiple submatrices, each containing corresponding set elements.

[0081] Please refer to the following: Figure 2 , Figure 2 This is a schematic diagram of matrix decomposition provided in an embodiment of this application.

[0082] Among them, Figure 2 The matrix on the left is composed of multiple sub-matrices, each with corresponding set elements. For example, if the element corresponding to the first matrix in the upper left corner is A11, then the first matrix in the upper left corner can be called matrix block A11.

[0083] In some implementations, before determining the first input matrix and the second input matrix corresponding to the first submatrix within the current iteration region, the method further includes:

[0084] (1) Obtain the set size of the matrix block corresponding to the original matrix;

[0085] (2) Divide the original matrix into blocks according to the size of the matrix blocks to obtain multiple sub-matrices.

[0086] For example, the size of a matrix block needs to be set to NB, which can be 256*256 or an integer multiple of 256*256. In some application scenarios, the decomposition of matrix blocks by a computer device can be performed jointly by a central processing unit (CPU) and an AI processor, where the AI ​​processor can be a neural network processing unit (NPU), a tensor processing unit (TPU), a graphics processing unit (GPU), etc.

[0087] Given that the computing power of a central processing unit (CPU) is less than that of an AI processor, in order to ensure that the results processed by the CPU can keep up with the asynchronous execution time of the AI ​​processor, the matrix blocks often need to be set with appropriate sizes to achieve a balanced load between the CPU and the AI ​​processor. For example, the matrix block size can be 256*256, or an integer multiple of 256*256.

[0088] After determining the size of the matrix blocks, the original matrix can be divided according to the set size to obtain multiple submatrices. Each submatrix contains corresponding elements.

[0089] In some implementations, multiple submatrices can be divided into different iteration regions; please refer to the relevant documentation. Figure 4 , Figure 4 This is an iterative diagram of the matrix provided in the embodiments of this application.

[0090] The current iteration region can be the region corresponding to the row and column matrices of the submatrix currently undergoing LU decomposition. For example... Figure 4 As shown, the submatrices in the same row as the first submatrix and the submatrices in the same column as the first submatrix are all matrices within the current iteration region. Adjacent to the current iteration region is the first iteration region. After the current iteration region completes its iteration, the first iteration region can be iterated upon.

[0091] The second iteration region is adjacent to the first iteration region. The second iteration region is not adjacent to the current iteration region. The second iteration region is adjacent to the target iteration region. The edge of the second iteration region is adjacent to the edge of the target iteration region.

[0092] The target iteration region is not adjacent to either the current iteration region or the first iteration region.

[0093] In some implementations, the submatrices within each iteration region can be iteratively computed, for example, by performing LU decomposition. LU decomposition is a method of decomposing a square matrix into the product of a lower triangular matrix and an upper triangular matrix. LU decomposition is mainly used in numerical analysis to solve linear equations, find inverse matrices, or calculate determinants.

[0094] In some implementations, among multiple sub-matrices corresponding to the original matrix, determining the first input matrix and the second input matrix corresponding to the first sub-matrix within the current iteration region includes:

[0095] (1) Decompose the first submatrix in the current iteration region to obtain the first upper triangular matrix and the first lower triangular matrix;

[0096] (2) Obtain the first input matrix based on the first upper triangular matrix;

[0097] (3) Obtain the second input matrix based on the first lower triangular matrix.

[0098] Please combine Figure 2 If matrix block A11 is taken as the first submatrix, then the first submatrix needs to be decomposed into LU decomposition to obtain the first upper triangular matrix and the first lower triangular matrix. The elements of the first upper triangular matrix can be represented by U11, and the first upper triangular matrix can be called the first upper triangular matrix U11. The elements of the first lower triangular matrix can be represented by L11, and the first lower triangular matrix can be called the first lower triangular matrix L11.

[0099] Specifically, for the submatrices in the same column as the first upper triangular matrix and the first submatrix, panel factorization can be performed to obtain the corresponding output result, which is the first input matrix. Since there are multiple submatrices in the same column as the first submatrix, there are also multiple corresponding first input matrices.

[0100] For the first lower triangular matrix and the submatrices in the same row as the first submatrix, a triangular matrix solution (trsmupdate) can be performed to obtain the corresponding output, which is the second input matrix. Since there are multiple submatrices in the same row as the first submatrix, there are also multiple corresponding second input matrices.

[0101] In some implementations, obtaining the first input matrix based on the first upper triangular matrix includes:

[0102] (1.1) Determine each submatrix in the same column as the first submatrix within the current iteration region;

[0103] (1.2) Apply panel decomposition algorithm to the first upper triangular matrix and each submatrix in the same column to obtain the first input matrix.

[0104] The submatrices in the same column as the first submatrix can be determined within the current iteration region, such as... Figure 2 As shown, if the first submatrix is ​​matrix block A11, the submatrixes in the same column as the first submatrix include matrix blocks A21, A31, A41, A51, A61, A71, and A81.

[0105] Applying panel decomposition to the first upper triangular matrix U11 and matrix block A21 yields the corresponding output matrix L21, which is one of the first input matrices. For example, A21 = L21 * U11 + L22 * 0 = L21 * U11. Since matrix block A21 and the first upper triangular matrix U11 are known results, the output matrix L21 can be calculated using this formula.

[0106] Similarly, applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A31 yields the corresponding output matrix L31. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A41 yields the corresponding output matrix L41. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A51 yields the corresponding output matrix L51. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A61 yields the corresponding output matrix L61. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A71 yields the corresponding output matrix L71. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A81 yields the corresponding output matrix L81.

[0107] After obtaining the output matrices corresponding to each submatrix in the same column as the first submatrix, these output matrices are determined as the first input matrix.

[0108] In some implementations, the second input matrix is ​​obtained based on the first lower triangular matrix, including:

[0109] (2.1) Determine each submatrix in the same row as the first submatrix within the current iteration region;

[0110] (2.2) Apply the triangular matrix solving algorithm to the first lower triangular matrix and each submatrix in the same row to obtain the second input matrix.

[0111] The submatrices in the same row as the first submatrix can be determined within the current iteration region, such as... Figure 2 As shown, if the first submatrix is ​​matrix block A11, the submatrixes in the same row as the first submatrix include matrix blocks A12, A13, A14, A15, A16, A17, and A18.

[0112] Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A12 yields the corresponding output matrix U12, which is one of the second input matrices. For example, A12 = L11 * U12 + 0 * U22 = L11 * U12. Since matrix block A12 and the first lower triangular matrix L11 are known results, the output matrix U21 can be calculated using this formula.

[0113] Similarly, applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A13 yields the corresponding output matrix U13. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A14 yields the corresponding output matrix U14. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A15 yields the corresponding output matrix U15. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A16 yields the corresponding output matrix U16. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A17 yields the corresponding output matrix U17. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A18 yields the corresponding output matrix U18.

[0114] After obtaining the output matrices corresponding to each submatrix in the same row as the first submatrix, these output matrices are determined as the second input matrix.

[0115] In some application scenarios, after obtaining the first input matrix and the second input matrix, the first input matrix and the second input matrix are stored in global memory. This global memory can be the global memory of the AI ​​processor mentioned above. In the subsequent calculation and iteration of other matrix blocks, the first input matrix and the second input matrix need to be used. Therefore, it is necessary to read the first input matrix and the second input matrix from the global memory each time.

[0116] To alleviate the pressure of reading global memory, the first or second input matrix can be moved to a preset buffer. This reduces the number of reads from global memory when performing calculations and iterations on other matrix blocks, thereby reducing the waste of computer memory resources and making full use of the computer's performance.

[0117] In step 120, the target second submatrix of the first sub-iteration region within the first iteration region is determined based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region and contains at least one sub-iteration region.

[0118] After obtaining the first input matrix and the second input matrix, it is necessary to iteratively update the submatrices in the next iteration region based on the first input matrix and the second input matrix.

[0119] In some implementations, determining the target second sub-matrix within the first iteration region based on the first input matrix and the second input matrix includes:

[0120] (1) Determine the second sub-matrix within the first sub-iteration region in the first iteration region;

[0121] (2) Update the second submatrix according to the second submatrix, the first input matrix and the second input matrix to obtain the target second submatrix in the first sub-iteration region.

[0122] like Figure 4 As shown, after the current iteration zone is completed, the submatrices of the sub-iteration zone of the first iteration zone need to be updated by general matrix to matrix multiplication (Gemm) so as to realize the iteration of the submatrices of the sub-iteration zone within the first iteration zone. Figure 4 In this process, the first iteration region contains only one sub-iteration region.

[0123] In some implementations, the first iteration region includes multiple sub-iteration regions, such as... Figure 6 As shown, the first iteration region includes a first sub-iteration region, a second sub-iteration region, and a third sub-iteration region. The first sub-iteration region within the first iteration region is... Figure 6 The first sub-iteration region in.

[0124] Specifically, the second sub-matrix of the first sub-iteration region can be determined within the first iteration region, combined with... Figure 2 The second submatrix can be matrix block A22. Then, matrix block A22 is updated according to the first input matrix and the second input matrix to obtain the target second submatrix.

[0125] For example, the output matrix L21 can be determined from the first input matrix, and the output matrix U12 can be determined from the second input matrix. Then, the matrix block A22 is updated based on the output matrix L21, the output matrix U12, and the matrix block A22. For example, A22new = A22 - L21 * U12, where A22new is the target second submatrix.

[0126] In other words, the second submatrix is ​​updated by general matrix multiplication in the above way, thereby obtaining the target second submatrix, which can be applied to the matrix multiplication operator in subsequent iterations.

[0127] In step 130, at least one sub-iteration region within the first iteration region is iterated according to the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region.

[0128] In some implementations, after obtaining the target second submatrix, LU decomposition can be performed on it to obtain a second upper triangular matrix and a second lower triangular matrix. Then, within the first iteration region, the submatrices in the same row as the target second submatrix and the submatrices in the same column are determined. A panel decomposition algorithm is applied to the second upper triangular matrix and the submatrices in the same column as the target second submatrix to obtain a third input matrix corresponding to the target second submatrix. A triangular matrix solving algorithm is applied to the second lower triangular matrix and the submatrices in the same row as the target second submatrix to obtain a fourth input matrix corresponding to the target second submatrix.

[0129] Please refer to the following: Figure 3 , Figure 3 This is another schematic diagram of matrix decomposition provided in the embodiments of this application.

[0130] In the figure, matrix block A22 can be understood as the second sub-matrix of the target. The second sub-matrix of the target is decomposed into the second upper triangular matrix U22 and the second lower triangular matrix L22.

[0131] The submatrices in the same column as the target's second submatrix can be identified, such as matrix block A32, matrix block A42, matrix block A52, matrix block A62, matrix block A72, and matrix block A82.

[0132] Then, the third input matrix is ​​obtained by applying panel decomposition algorithm to each submatrix in the same column as the second upper triangular matrix U22 and the target second submatrix. For example, applying panel decomposition algorithm to the second upper triangular matrix U22 and matrix block A32 yields the corresponding output matrix L32; applying panel decomposition algorithm to the second upper triangular matrix U22 and matrix block A42 yields the corresponding output matrix L42; applying panel decomposition algorithm to the second upper triangular matrix U22 and matrix block A52 yields the corresponding output matrix L52; applying panel decomposition algorithm to the second upper triangular matrix U22 and matrix block A62 yields the corresponding output matrix L62; applying panel decomposition algorithm to the second upper triangular matrix U22 and matrix block A72 yields the corresponding output matrix L72; and applying panel decomposition algorithm to the second upper triangular matrix U22 and matrix block A82 yields the corresponding output matrix L82.

[0133] After obtaining the output matrices corresponding to each submatrix in the same column as the target second submatrix, these output matrices are determined as the third input matrices corresponding to the target second submatrix.

[0134] The individual submatrices in the same row as the target second submatrix can be determined, such as matrix block A23, matrix block A24, matrix block A25, matrix block A26, matrix block A27, and matrix block A28.

[0135] Applying the triangular matrix solving algorithm to the second lower triangular matrix L22 and matrix block A23 yields the corresponding output matrix U23. Applying the triangular matrix solving algorithm to the second lower triangular matrix L22 and matrix block A24 yields the corresponding output matrix U24. Applying the triangular matrix solving algorithm to the second lower triangular matrix L22 and matrix block A25 yields the corresponding output matrix U25. Applying the triangular matrix solving algorithm to the second lower triangular matrix L22 and matrix block A26 yields the corresponding output matrix U26. Applying the triangular matrix solving algorithm to the second lower triangular matrix L22 and matrix block A27 yields the corresponding output matrix U27. Applying the triangular matrix solving algorithm to the second lower triangular matrix L22 and matrix block A28 yields the corresponding output matrix U28.

[0136] After obtaining the output matrices corresponding to each submatrix in the same row as the target second submatrix, these output matrices are determined as the fourth input matrix corresponding to the target second submatrix.

[0137] In some application scenarios, after obtaining the third and fourth input matrices, the third and fourth input matrices are stored in global memory. This global memory can be the global memory of the AI ​​processor mentioned above. In the subsequent calculation and iteration of other matrix blocks, the third and fourth input matrices need to be used, so the third and fourth input matrices need to be read from the global memory each time.

[0138] To alleviate the pressure of reading global memory, the third and fourth input matrices can be moved to a preset cache. This reduces the number of reads from global memory when iterating over other matrix blocks, thereby reducing the waste of computer memory resources and fully utilizing the computer's performance.

[0139] In some implementations, if there is only one sub-iteration region within the first iteration region, specifically as follows: Figure 4 As shown, after obtaining the third and fourth input matrices corresponding to the target second sub-matrix within the first iteration region, the target third sub-matrix within the second iteration region is determined based on the third and fourth input matrices. The second iteration region is adjacent to the first iteration region, and the second iteration region is adjacent to the target iteration region. This completes the iterative update of the sub-matrices within the second iteration region.

[0140] In some implementations, if the first iteration region contains multiple sub-iteration regions, specifically as follows: Figure 6 As shown, the next sub-iteration region is iterated based on the third and fourth input matrices corresponding to the second sub-matrix of the target and the initial sub-matrix in the next sub-iteration region, in order to determine the target sub-matrix corresponding to the initial sub-matrix and the third and fourth input matrices corresponding to the target sub-matrix of the next sub-iteration region.

[0141] Based on the third and fourth input matrices corresponding to the previous sub-iteration region within the first iteration region and the initial sub-matrix of the next sub-iteration region within the first iteration region, the third and fourth input matrices corresponding to the next iteration region are obtained sequentially until the third and fourth input matrices corresponding to the last sub-iteration region of the first iteration region are obtained.

[0142] For example, such as Figure 6 As shown, after obtaining the third and fourth input matrices for the first sub-iteration region, the target submatrix (e.g., the updated A33new) corresponding to the initial submatrix of the second sub-iteration region can be calculated using the third and fourth input matrices corresponding to the first sub-iteration region and the initial submatrix within the second sub-iteration region (e.g., matrix block A33). Then, LU decomposition is performed on the target submatrix, and panel decomposition is applied to each submatrix in the same column as the target submatrix to obtain the third input matrix corresponding to the second sub-iteration region. Triangular matrix decomposition is then applied to each submatrix in the same row as the target submatrix to obtain the fourth input matrix corresponding to the second sub-iteration region. The specific calculation process is similar to the method used to calculate the first and second input matrices mentioned above, and will not be repeated here.

[0143] After obtaining the third and fourth input matrices corresponding to the second sub-iteration region, the same method is used to obtain the third and fourth input matrices corresponding to the next third sub-iteration region of the second sub-iteration region, until the third and fourth input matrices corresponding to the last sub-iteration region in the first iteration region are determined.

[0144] In step 140, the target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third and fourth input matrices corresponding to at least one sub-iteration region. The target iteration region is not adjacent to the current iteration region and the first iteration region.

[0145] In related technologies, for iteration of the target iteration region, iteration of the target iteration region can only begin after the previous iteration region has completed its iteration update. For example... Figure 2 and Figure 3 As shown, after the current iteration area completes its iteration update, the first iteration area is iterated and updated again, and so on. Each time an iteration is completed in multiple submatrices, data needs to be read from the global memory once, and then the updated data is written back to the global memory. This results in a relatively frequent number of read and write operations to the global memory, which affects the performance of the computer device.

[0146] For example, such as Figure 2 and Figure 3As shown, the current iteration region corresponding to the first submatrix A11 is first iterated to obtain the first input matrix and the second input matrix. When calculating the target second submatrix corresponding to the second submatrix A22, the first and second input matrices need to be read from global memory, and then the generated target second submatrix is ​​input back into global memory. This requires one read / write operation per iteration. If multiple submatrices need to be iterated multiple times, multiple read / write operations are required, thus consuming global memory and impacting the performance of the computer.

[0147] In this embodiment, the target iteration region is not adjacent to the current iteration region or the first iteration region. After obtaining the first and second input matrices corresponding to the current iteration region, and then obtaining the third and fourth input matrices corresponding to each sub-iteration region within the first iteration region, the sub-matrices within the target iteration region can be iteratively updated using the first and second input matrices, and the third and fourth input matrices corresponding to each sub-iteration region within the first iteration region. When iteratively updating the sub-matrices within the target iteration region, it is only necessary to retrieve the first, second, third, and fourth input matrices from global memory, and then write the updated result back into global memory. In other words, iteratively updating the sub-matrices within the target iteration region does not require multiple iterations of reading and writing to global memory, thereby reducing the number of read / write operations on global memory, improving data read / write efficiency, and fully utilizing the performance of the computer device.

[0148] In some implementations, the target selection sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third and fourth input matrices corresponding to at least one sub-iteration region, including:

[0149] (1) Determine the selected submatrix in the target iteration region;

[0150] (2) Determine the first target matrix corresponding to the selected submatrix in the first input matrix;

[0151] The second target matrix corresponding to the selected submatrix is ​​determined from the second input matrix;

[0152] Within the first iteration region, select the third target matrix corresponding to the sub-matrix from the third input matrix of each sub-iteration region;

[0153] Within the first iteration region, select the fourth target matrix corresponding to the sub-matrix from the fourth input matrix of each sub-iteration region;

[0154] (3) Based on the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region in the first iteration region, and the fourth target matrix, determine the target selected sub-matrix of the target iteration region.

[0155] Understandably, after determining the selected submatrix in the target iteration region, the target selected submatrix of the target iteration region needs to be determined by the first input matrix, the second input matrix, the selected submatrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region in the first iteration region, and the fourth target matrix, in order to determine the corresponding output matrix and complete the update of the selected submatrix.

[0156] The first and third input matrices mentioned above can be understood as follows: Figure 3 The corresponding L matrix, the second input matrix, and the fourth input matrix can be understood as... Figure 3 The U matrix in the diagram.

[0157] Please refer to the following: Figure 5 , Figure 5 This is another iterative schematic diagram of the matrix provided in the embodiments of this application.

[0158] In this context, the target iteration region is not adjacent to either the current iteration region or the first iteration region. Figure 5 and Figure 3 ,like Figure 5 As shown, the first iteration region contains only one sub-iteration region. If the selected sub-matrix in the target iteration region is determined to be matrix block A44, then the first target matrix corresponding to the selected sub-matrix is ​​determined to be matrix block L41 in the first input matrix, the second target matrix corresponding to the selected sub-matrix is ​​determined to be matrix block U14 in the second input matrix, the third target matrix corresponding to the selected sub-matrix is ​​determined to be matrix block L42 in the third input matrix, and the fourth target matrix corresponding to the selected sub-matrix is ​​determined to be matrix block U24 in the fourth input matrix.

[0159] In some implementations, the target selection submatrix of the target iteration region is determined based on the selected submatrix, the first target matrix, the second target matrix, the third target matrix, and the fourth target matrix, including:

[0160] (1.1) Multiply the first objective matrix by the second objective matrix to obtain the first calculation result;

[0161] (1.2) Multiply the third objective matrix corresponding to each sub-iteration region in the first iteration region by the fourth objective matrix corresponding to each sub-iteration region in the first iteration region to obtain the second calculation result corresponding to each sub-iteration region in the first iteration region;

[0162] (1.3) Subtract the first calculation result and the second calculation result from the selected submatrix to obtain the target selected submatrix.

[0163] For example, such as Figure 5As shown, if the first iteration region has only one sub-iteration region. If the selected submatrix within the target iteration region is determined to be matrix block A44, the first target matrix is ​​matrix block L41, the second target matrix is ​​matrix block U14, the third target matrix is ​​matrix block L42, and the fourth target matrix is ​​matrix block U24, then the target selected submatrix after updating the selected submatrix is: A44new = A44 - L41 * U14 - L42 * U24.

[0164] If the first iteration region contains multiple sub-iteration regions, such as Figure 7 As shown, combined with Figure 3 and Figure 7 Let A66 be the selected submatrix, and A66new be the target submatrix. Then, the first target matrix needs to be multiplied by the second target matrix to obtain the first calculation result. For example, if the first target matrix is ​​matrix block L61 and the second target matrix is ​​matrix block U16, the first calculation result is L61*U16. The third target matrix corresponding to the first sub-iteration region is matrix block L62, and the fourth target matrix is ​​matrix block U26, so the calculation result is L62*U26. The third target matrix corresponding to the second sub-iteration region is matrix block L63, and the fourth target matrix is ​​matrix block U36, so the calculation result is L63*U36. The third target matrix corresponding to the third sub-iteration region is matrix block L64, and the fourth target matrix is ​​matrix block U46, so the calculation result is L64*U46. Therefore, A66new = A66 - L61*U16 - L62*U26 - L63*U36 - L64*U46.

[0165] Specifically, the data corresponding to the target matrix that needs to be calculated can be moved from global memory to a preset cache all at once. For example, if the first iteration region has only one sub-iteration region, A44, L41, U14, L42, and U24 can be moved from global memory to the preset cache all at once, thereby reducing the number of times global memory needs to be read in each iteration and only requiring a single read of global memory.

[0166] For example, if the first iteration area contains multiple sub-iteration areas, A66, L61, U16, L62, U26, L63, U36, L64, and U46 can be moved from global memory to the preset cache area at once, thereby reducing and avoiding the number of times global memory needs to be read in successive iterations, and only one read of global memory is required.

[0167] In other words, compared to existing technologies, this application reduces the number of global memory reads when calculating matrix blocks within the target iteration region across multiple iteration steps, avoiding frequent reads and writes to global memory during sequential iterations. This reduces global memory usage and improves computer performance.

[0168] In some implementations, the target selected sub-matrix of the target iteration region is determined based on the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix, including:

[0169] The selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix are moved from global memory to a preset cache area;

[0170] In the preset buffer area, the target selected submatrix of the target iteration area is determined based on the selected submatrix, the first target matrix, the third target matrix corresponding to each sub-iteration area in the first iteration area, and the fourth target matrix.

[0171] Write the target selected submatrix into global memory and replace the selected submatrix in global memory.

[0172] Please refer to the following: Figure 8 , Figure 8 This is a schematic diagram of a data processing scenario provided in an embodiment of this application.

[0173] In the process of calculating the target selected submatrix, multiple submatrices are stored in global memory. When updating each submatrix, the corresponding data needs to be moved to a preset cache area. After the iterative update result of the submatrix is ​​calculated in the preset cache area, it is then written to the matrix block position corresponding to the submatrix.

[0174] Similarly, if the selected submatrix is ​​A44, the first target matrix is ​​matrix block L41, the second target matrix is ​​matrix block U14, the third target matrix is ​​matrix block L42, and the fourth target matrix is ​​matrix block U24. When calculating the target selected submatrix within the target iteration region, matrix blocks A44, L41, U14, L42, and U24 need to be moved from global memory to a preset cache area. Then, the calculated target selected submatrix is ​​moved from the preset cache area to global memory.

[0175] It should be noted that the above description uses an 8x8 matrix block, but in practice, it can be applied to matrices with different partitioning methods. Furthermore, the above description iterates over the submatrix of the target iteration region, with a distance of two or four iteration steps from the first iteration region. In practical applications, the target iteration region can be multiple iteration steps away from the first iteration region. The above content does not limit this application.

[0176] As described above, in this embodiment, among the multiple sub-matrices corresponding to the original matrix, the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region are determined; the target second sub-matrix of the first sub-iteration region in the first iteration region is determined based on the first input matrix and the second input matrix, the first iteration region and the current iteration region are adjacent, and the first iteration region contains at least one sub-iteration region; the at least one sub-iteration region in the first iteration region is iterated based on the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region; the target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region, the target iteration region is not adjacent to either the current iteration region or the first iteration region. In this way, by determining the first and second input matrices of the current iteration region, the third and fourth input matrices of each sub-iteration region in the first iteration region, and then directly determining the target selected sub-matrix of the target iteration region through the first input matrix, the second input matrix, the third input matrix of each sub-iteration region, and the fourth input matrix, the solution provided by this application can achieve fewer read and write operations, thereby reducing the occupation of global memory and making full use of the performance of computer devices, compared to iterating sequentially in each iteration region until iterating to the target iteration region, where each iteration requires a read and write operation of global memory.

[0177] Please see Figure 9 , Figure 9 This is another flowchart illustrating the data processing method provided in an embodiment of this application. It may include the following steps:

[0178] In step 201, the first submatrix in the current iteration region is decomposed to obtain the first upper triangular matrix and the first lower triangular matrix.

[0179] Please combine Figure 2 If matrix block A11 is taken as the first submatrix, then the first submatrix needs to be decomposed into LU decomposition to obtain the first upper triangular matrix and the first lower triangular matrix. The elements of the first upper triangular matrix can be represented by U11, and the first upper triangular matrix can be called the first upper triangular matrix U11. The elements of the first lower triangular matrix can be represented by L11, and the first lower triangular matrix can be called the first lower triangular matrix L11.

[0180] In step 202, each submatrix in the same column as the first submatrix is ​​determined within the current iteration region, and the panel decomposition algorithm is applied to the first upper triangular matrix and each submatrix in the same column to obtain the first input matrix.

[0181] The submatrices in the same column as the first submatrix can be determined within the current iteration region, such as... Figure 2As shown, if the first submatrix is ​​matrix block A11, the submatrixes in the same column as the first submatrix include matrix blocks A21, A31, A41, A51, A61, A71, and A81.

[0182] Applying panel decomposition to the first upper triangular matrix U11 and matrix block A21 yields the corresponding output matrix L21, which is one of the first input matrices. For example, A21 = L21 * U11 + L22 * 0 = L21 * U11. Since matrix block A21 and the first upper triangular matrix U11 are known results, the output matrix L21 can be calculated using this formula.

[0183] Similarly, applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A31 yields the corresponding output matrix L31. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A41 yields the corresponding output matrix L41. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A51 yields the corresponding output matrix L51. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A61 yields the corresponding output matrix L61. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A71 yields the corresponding output matrix L71. Applying the panel decomposition algorithm to the first upper triangular matrix U11 and matrix block A81 yields the corresponding output matrix L81.

[0184] After obtaining the output matrices corresponding to each submatrix in the same column as the first submatrix, these output matrices are determined as the first input matrix.

[0185] In step 203, each submatrix in the same row as the first submatrix is ​​determined within the current iteration region. The triangular matrix solving algorithm is applied to the first lower triangular matrix and each submatrix in the same row to obtain the second input matrix.

[0186] The submatrices in the same row as the first submatrix can be determined within the current iteration region, such as... Figure 2 As shown, if the first submatrix is ​​matrix block A11, the submatrixes in the same row as the first submatrix include matrix blocks A12, A13, A14, A15, A16, A17, and A18.

[0187] Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A12 yields the corresponding output matrix U12, which is one of the second input matrices. For example, A12 = L11 * U12 + 0 * U22 = L11 * U12. Since matrix block A12 and the first lower triangular matrix L11 are known results, the output matrix U21 can be calculated using this formula.

[0188] Similarly, applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A13 yields the corresponding output matrix U13. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A14 yields the corresponding output matrix U14. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A15 yields the corresponding output matrix U15. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A16 yields the corresponding output matrix U16. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A17 yields the corresponding output matrix U17. Applying the triangular matrix solving algorithm to the first lower triangular matrix L11 and matrix block A18 yields the corresponding output matrix U18.

[0189] After obtaining the output matrices corresponding to each submatrix in the same row as the first submatrix, these output matrices are determined as the second input matrix.

[0190] In step 204, the second sub-matrix within the first sub-iteration region is determined in the first iteration region. The second sub-matrix is ​​then updated based on the second sub-matrix, the first input matrix, and the second input matrix to obtain the target second sub-matrix within the first sub-iteration region.

[0191] The first iteration region can contain one or more sub-iteration regions.

[0192] The second submatrix can be determined within the first iteration region, combined with... Figure 2 The second submatrix can be matrix block A22. Then, matrix block A22 is updated according to the first input matrix and the second input matrix to obtain the target second submatrix.

[0193] For example, the output matrix L21 can be determined from the first input matrix, and the output matrix U12 can be determined from the second input matrix. Then, the matrix block A22 is updated based on the output matrix L21, the output matrix U12, and the matrix block A22. For example, A22new = A22 - L21 * U12, where A22new is the target second submatrix.

[0194] In step 205, at least one sub-iteration region within the first iteration region is iterated according to the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region.

[0195] In some implementations, after obtaining the target second submatrix, LU decomposition can be performed on it to obtain a second upper triangular matrix and a second lower triangular matrix. Then, within the first iteration region, the submatrices in the same row as the target second submatrix and the submatrices in the same column as the target second submatrix are determined. A panel decomposition algorithm is applied to the second upper triangular matrix and the submatrices in the same column as the target second submatrix to obtain a third input matrix, and a triangular matrix solving algorithm is applied to the second lower triangular matrix and the submatrices in the same row as the target second submatrix to obtain a fourth input matrix.

[0196] If the first iteration region includes multiple sub-iteration regions, then the next sub-iteration region is iterated based on the third and fourth input matrices corresponding to the target second sub-matrix and the initial sub-matrix in the next sub-iteration region, so as to determine the target sub-matrix corresponding to the initial sub-matrix and the third and fourth input matrices corresponding to the target sub-matrix of the next sub-iteration region.

[0197] Based on the third and fourth input matrices corresponding to the previous sub-iteration region within the first iteration region and the initial sub-matrix of the next sub-iteration region within the first iteration region, the third and fourth input matrices corresponding to the next iteration region are obtained sequentially until the third and fourth input matrices corresponding to the last sub-iteration region of the first iteration region are obtained.

[0198] In step 206, the selected sub-matrix in the target iteration region is determined, the first target matrix corresponding to the selected sub-matrix is ​​determined in the first input matrix, the second target matrix corresponding to the selected sub-matrix is ​​determined in the second input matrix, the third target matrix corresponding to the selected sub-matrix in the third input matrix of each sub-iteration region in the first iteration region is determined, and the fourth target matrix corresponding to the selected sub-matrix in the fourth input matrix of each sub-iteration region in the first iteration region is determined.

[0199] In this context, the target iteration region is not adjacent to either the current iteration region or the first iteration region. Figure 5 and Figure 3 If the selected submatrix within the target iteration region is determined to be matrix block A44, then the first target matrix corresponding to the selected submatrix is ​​determined to be matrix block L41 in the first input matrix, and the second target matrix corresponding to the selected submatrix is ​​determined to be matrix block U14 in the second input matrix. If the first iteration region contains only one sub-iteration region, then the third target matrix corresponding to the selected submatrix is ​​determined to be matrix block L42 in the third input matrix within the first sub-iteration region, and the fourth target matrix corresponding to the selected submatrix is ​​determined to be matrix block U24 in the fourth input matrix within the first sub-iteration region.

[0200] If the first iteration region contains multiple sub-iteration regions, such as Figure 7 As shown, combined with Figure 3and Figure 7 Let A66 be the selected submatrix, and A66new be the target submatrix. Then, the first target matrix needs to be multiplied by the second target matrix to obtain the first calculation result. For example, the first target matrix is ​​matrix block L61, and the second target matrix is ​​matrix block U16. The third target matrix corresponding to the first sub-iteration region is matrix block L62, and the fourth target matrix is ​​matrix block U26. The third target matrix corresponding to the second sub-iteration region is matrix block L63, and the fourth target matrix is ​​matrix block U36.

[0201] In step 207, the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region in the first iteration region, and the fourth target matrix are moved from global memory to a preset cache area.

[0202] If the selected submatrix is ​​A44, the first target matrix is ​​matrix block L41, the second target matrix is ​​matrix block U14, the third target matrix is ​​matrix block L42, and the fourth target matrix is ​​matrix block U24. When calculating the selected target submatrix within the target iteration region, matrix blocks A44, L41, U14, L42, and U24 need to be moved from global memory to a preset cache area.

[0203] In step 208, the target selected submatrix of the target iteration area is determined in the preset buffer area based on the selected submatrix, the first target matrix, the third target matrix corresponding to each sub-iteration area in the first iteration area, and the fourth target matrix.

[0204] For example, if the first iteration area has only one sub-iteration area, A44, L41, U14, L42, and U24 can be moved from global memory to the preset cache area at once, thereby reducing and avoiding the number of times global memory needs to be read in successive iterations, and only one read of global memory is required.

[0205] For example, if the first iteration area contains multiple sub-iteration areas, A66, L61, U16, L62, U26, L63, U36, L64, and U46 can be moved from global memory to the preset cache area at once, thereby reducing and avoiding the number of times global memory needs to be read in successive iterations, and only one read of global memory is required.

[0206] In step 209, the target selected submatrix is ​​written into global memory and replaces the selected submatrix in global memory.

[0207] In this embodiment, for updating the target iteration area, multiple iteration steps can be merged to update the target iteration area, thereby reducing the number of read and write operations on global memory, thus improving data read and write efficiency, and ultimately giving full play to the performance of the computer device.

[0208] As described above, in this embodiment, among the multiple sub-matrices corresponding to the original matrix, the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region are determined; the target second sub-matrix of the first sub-iteration region in the first iteration region is determined based on the first input matrix and the second input matrix, the first iteration region and the current iteration region are adjacent, and the first iteration region contains at least one sub-iteration region; the at least one sub-iteration region in the first iteration region is iterated based on the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region; the target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region, the target iteration region is not adjacent to either the current iteration region or the first iteration region. In this way, by determining the first and second input matrices of the current iteration region, the third and fourth input matrices of each sub-iteration region in the first iteration region, and then directly determining the target selected sub-matrix of the target iteration region through the first input matrix, the second input matrix, the third input matrix of each sub-iteration region, and the fourth input matrix, the solution provided by this application can achieve fewer read and write operations, thereby reducing the occupation of global memory and making full use of the performance of computer devices, compared to iterating sequentially in each iteration region until iterating to the target iteration region, where each iteration requires a read and write operation of global memory.

[0209] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application. This data processing apparatus is applied to a computer device. The meanings of the terms are the same as those in the data processing method described above, and specific implementation details can be found in the description of the method embodiment.

[0210] The data processing device 300 may include: a first determining module 310, a second determining module 320, an acquisition module 330, and a third determining module 340.

[0211] The first determining module 310 is used to determine the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region from among the multiple sub-matrixes corresponding to the original matrix.

[0212] The second determining module 320 is used to determine the target second sub-matrix of the first sub-iteration region within the first iteration region based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region and contains at least one sub-iteration region.

[0213] The acquisition module 330 is used to iterate at least one sub-iteration region within the first iteration region according to the target second sub-matrix, and obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region;

[0214] The third determining module 340 is used to determine the target selected sub-matrix of the target iteration region based on the first input matrix, the second input matrix, and the third and fourth input matrices corresponding to at least one sub-iteration region. The target iteration region is not adjacent to the current iteration region and the first iteration region.

[0215] In some implementations, the first determining module 310 is configured to:

[0216] The first submatrix in the current iteration region is decomposed to obtain the first upper triangular matrix and the first lower triangular matrix;

[0217] The first input matrix is ​​obtained based on the first upper triangular matrix;

[0218] The second input matrix is ​​obtained from the first lower triangular matrix.

[0219] In some implementations, the first determining module 310 is configured to:

[0220] Within the current iteration region, determine each submatrix in the same column as the first submatrix;

[0221] The first input matrix is ​​obtained by applying panel decomposition algorithm to the first upper triangular matrix and each submatrix in the same column.

[0222] In some implementations, the first determining module 310 is configured to:

[0223] Within the current iteration region, determine each submatrix in the same row as the first submatrix;

[0224] The second input matrix is ​​obtained by applying the triangular matrix solving algorithm to the first lower triangular matrix and each submatrix in the same row.

[0225] In some implementations, the second determining module 320 is used for:

[0226] The second submatrix within the first sub-iteration region is determined in the first iteration region;

[0227] The second submatrix is ​​updated based on the second submatrix, the first input matrix, and the second input matrix to obtain the target second submatrix within the first sub-iteration region.

[0228] In some implementations, the acquisition module 330 is used for:

[0229] Obtain the third and fourth input matrices corresponding to the second sub-matrix of the target within the first sub-iteration region;

[0230] If the first iteration region includes multiple sub-iteration regions, then the next sub-iteration region is iterated based on the third and fourth input matrices corresponding to the target second sub-matrix and the initial sub-matrix in the next sub-iteration region, so as to determine the target sub-matrix corresponding to the initial sub-matrix and the third and fourth input matrices corresponding to the target sub-matrix of the next sub-iteration region.

[0231] Based on the third and fourth input matrices corresponding to the previous sub-iteration region within the first iteration region and the initial sub-matrix of the next sub-iteration region within the first iteration region, the third and fourth input matrices corresponding to the next iteration region are obtained sequentially until the third and fourth input matrices corresponding to the last sub-iteration region of the first iteration region are obtained.

[0232] In some implementations, the third determining module 340 is used for:

[0233] Identify the selected submatrix within the target iteration region;

[0234] The first target matrix corresponding to the selected submatrix is ​​determined from the first input matrix;

[0235] The second target matrix corresponding to the selected submatrix is ​​determined from the second input matrix;

[0236] Within the first iteration region, select the third target matrix corresponding to the sub-matrix from the third input matrix of each sub-iteration region;

[0237] Within the first iteration region, select the fourth target matrix corresponding to the sub-matrix from the fourth input matrix of each sub-iteration region;

[0238] Based on the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix, the target selected sub-matrix of the target iteration region is determined.

[0239] In some implementations, the third determining module 340 is used for:

[0240] Multiply the first objective matrix by the second objective matrix to obtain the first calculation result;

[0241] Multiply the third objective matrix corresponding to each sub-iteration region in the first iteration region by the fourth objective matrix corresponding to each sub-iteration region in the first iteration region to obtain the second calculation result corresponding to each sub-iteration region in the first iteration region.

[0242] Subtract the first calculation result and the second calculation result corresponding to each sub-iteration region within the first iteration region from the selected submatrix to obtain the target selected submatrix.

[0243] In some implementations, the third determining module 340 is used for:

[0244] The selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix are moved from global memory to a preset cache area;

[0245] In the preset buffer area, the target selected submatrix of the target iteration area is determined based on the selected submatrix, the first target matrix, the third target matrix corresponding to each sub-iteration area in the first iteration area, and the fourth target matrix.

[0246] Write the target selected submatrix into global memory and replace the selected submatrix in global memory.

[0247] In some implementations, after iterating over at least one sub-iteration region within the first iteration region according to the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to the at least one sub-iteration region, the third determining module 340 is used to:

[0248] The target third submatrix in the second iteration region is determined based on the third and fourth input matrices corresponding to the last sub-iteration region in the first iteration region. The second iteration region is adjacent to the first iteration region.

[0249] In some implementations, before determining the first input matrix and the second input matrix corresponding to the first sub-matrix within the current iteration region among multiple sub-matrices corresponding to the original matrix, the first determining module 310 is used to:

[0250] Obtain the set size of the matrix block corresponding to the original matrix;

[0251] The original matrix is ​​divided into blocks according to the set size of the matrix blocks to obtain multiple sub-matrices.

[0252] In some implementations, after determining the first input matrix and the second input matrix corresponding to the first submatrix in the current iteration area, the first determining module 310 is further configured to move the first input matrix from global memory to a preset cache area;

[0253] After iterating over at least one sub-iteration region within the first iteration region according to the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region, the acquisition module 330 is further configured to: move the third input matrix corresponding to at least one sub-iteration region from global memory to a preset cache area.

[0254] As described above, in this embodiment, among the multiple sub-matrices corresponding to the original matrix, the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region are determined; the target second sub-matrix of the first sub-iteration region in the first iteration region is determined based on the first input matrix and the second input matrix, the first iteration region and the current iteration region are adjacent, and the first iteration region contains at least one sub-iteration region; the at least one sub-iteration region in the first iteration region is iterated based on the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region; the target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third input matrix and the fourth input matrix corresponding to at least one sub-iteration region, the target iteration region is not adjacent to either the current iteration region or the first iteration region. In this way, by determining the first and second input matrices of the current iteration region, the third and fourth input matrices of each sub-iteration region in the first iteration region, and then directly determining the target selected sub-matrix of the target iteration region through the first input matrix, the second input matrix, the third input matrix of each sub-iteration region, and the fourth input matrix, the solution provided by this application can achieve fewer read and write operations, thereby reducing the occupation of global memory and making full use of the performance of computer devices, compared to iterating sequentially in each iteration region until iterating to the target iteration region, where each iteration requires a read and write operation of global memory.

[0255] For details on the implementation of each of the above modules, please refer to the previous examples, which will not be repeated here.

[0256] This application also provides a computer device, which can be a terminal, such as... Figure 11 As shown, it illustrates the structural diagram of the terminal involved in the embodiments of this application, specifically:

[0257] The computer device may include radio frequency (RF) circuitry 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display unit 404, a sensor 405, audio circuitry 406, a wireless fidelity (WiFi) module 407, a processor 408 including one or more processing cores, and a power supply 409, among other components. Those skilled in the art will understand that... Figure 11 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0258] RF circuit 401 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 408 for processing; additionally, it transmits uplink data to the base station. Typically, RF circuit 401 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 401 can also communicate wirelessly with networks and other devices. Wireless communication can use any communication standard or protocol, including but not limited to GSM, GPRS, CDMA, WCDMA, LTE, email, and SMS.

[0259] The memory 402 can be used to store software programs and modules. The processor 408 executes various functional applications and information retrieval by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal (such as audio data, phone book, etc.). In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide access to the memory 402 for the processor 408 and the input unit 403.

[0260] Input unit 403 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to object settings and function control. Specifically, in one embodiment, input unit 403 may include a touch-sensitive surface and other input devices. A touch-sensitive surface, also known as a touch display or touchpad, can collect touch operations on or near the surface (e.g., operations performed by the object using a finger, stylus, or any suitable object or accessory on or near the touch-sensitive surface) and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. The touch detection device detects the touch orientation of the object and the signal generated by the touch operation, transmitting the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 408, and can receive and execute commands from the processor 408. Furthermore, various types of touch-sensitive surfaces, such as resistive, capacitive, infrared, and surface acoustic wave, can be used. In addition to the touch-sensitive surface, input unit 403 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0261] The display unit 404 can be used to display information input by an object or information provided to an object, as well as various graphical object interfaces of the terminal. These graphical object interfaces can be composed of graphics, text, icons, video, and any combination thereof. The display unit 404 may include a display panel, optionally configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar form. Furthermore, a touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it transmits the information to the processor 408 to determine the type of touch event. Subsequently, the processor 408 provides corresponding visual output on the display panel according to the type of touch event. Although in Figure 11 In this context, the touch-sensitive surface and the display panel are two separate components for implementing input and output functions. However, in some embodiments, the touch-sensitive surface and the display panel can be integrated to achieve both input and output functions.

[0262] The terminal may also include at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel according to the ambient light level, and the proximity sensor can turn off the display panel and / or backlight when the terminal is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that the terminal may also be equipped with, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0263] Audio circuitry 406, a speaker, and a microphone provide an audio interface between the device and the terminal. Audio circuitry 406 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 406, converted back into audio data, and processed by processor 408. The processed data is then transmitted via RF circuitry 401 to, for example, another terminal, or output to memory 402 for further processing. Audio circuitry 406 may also include an earphone jack to facilitate communication between a peripheral headset and the terminal.

[0264] WiFi is a short-range wireless transmission technology. A terminal using the WiFi module 407 can help the user send and receive emails, browse web pages, and access streaming media, providing wireless broadband internet access. Although Figure 11 WiFi module 407 is shown, but it is understood that it is not a necessary component of the terminal and can be omitted as needed without changing the essence of the invention.

[0265] The processor 408 is the control center of the terminal, connecting various parts of the phone via various interfaces and lines. It executes software programs and / or modules stored in the memory 402, and calls data stored in the memory 402 to perform various functions and process data, thereby providing overall monitoring of the phone. Optionally, the processor 408 may include one or more processing cores; preferably, the processor 408 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 408.

[0266] The terminal also includes a power supply 409 (such as a battery) to power various components. Preferably, the power supply can be logically connected to the processor 408 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 409 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0267] Although not shown, the terminal may also include a camera, Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 408 in the terminal will load the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 408 will run the applications stored in the memory 402 to realize various functions:

[0268] Among the multiple sub-matrices corresponding to the original matrix, determine the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region;

[0269] The target second submatrix of the first sub-iteration region within the first iteration region is determined based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region and contains at least one sub-iteration region.

[0270] Based on the target second sub-matrix, iterate over at least one sub-iteration region within the first iteration region to obtain the third and fourth input matrices corresponding to at least one sub-iteration region;

[0271] The target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third and fourth input matrices corresponding to at least one sub-iteration region. The target iteration region is not adjacent to the current iteration region or the first iteration region.

[0272] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed description of the data processing method above, which will not be repeated here.

[0273] In this embodiment, among the multiple sub-matrices corresponding to the original matrix, the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region are determined; the target second sub-matrix of the first sub-iteration region in the first iteration region is determined based on the first input matrix and the second input matrix, the first iteration region and the current iteration region are adjacent, and the first iteration region contains at least one sub-iteration region; the at least one sub-iteration region in the first iteration region is iterated based on the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to the at least one sub-iteration region; the target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third input matrix and the fourth input matrix corresponding to the at least one sub-iteration region, the target iteration region is not adjacent to either the current iteration region or the first iteration region. In this way, by determining the first and second input matrices of the current iteration region, the third and fourth input matrices of each sub-iteration region in the first iteration region, and then directly determining the target selected sub-matrix of the target iteration region through the first input matrix, the second input matrix, the third input matrix of each sub-iteration region, and the fourth input matrix, the solution provided by this application can achieve fewer read and write operations, thereby reducing the occupation of global memory and making full use of the performance of computer devices, compared to iterating sequentially in each iteration region until iterating to the target iteration region, where each iteration requires a read and write operation of global memory.

[0274] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0275] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the data processing methods provided in embodiments of this application. For example, the instructions can execute the following steps:

[0276] Among the multiple sub-matrices corresponding to the original matrix, determine the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region;

[0277] The target second submatrix of the first sub-iteration region within the first iteration region is determined based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region and contains at least one sub-iteration region.

[0278] Based on the target second sub-matrix, iterate over at least one sub-iteration region within the first iteration region to obtain the third and fourth input matrices corresponding to at least one sub-iteration region;

[0279] The target selected sub-matrix of the target iteration region is determined based on the first input matrix, the second input matrix, and the third and fourth input matrices corresponding to at least one sub-iteration region. The target iteration region is not adjacent to the current iteration region or the first iteration region.

[0280] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0281] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0282] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the data processing methods provided in the embodiments of this application, the beneficial effects that any of the data processing methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0283] The data processing method, apparatus, computer-readable storage medium, and computer device provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data processing method, characterized in that, include: Among the multiple sub-matrices corresponding to the original matrix, determine the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration region; Move the first input matrix from global memory to a preset cache area; The target second submatrix of the first sub-iteration region within the first iteration region is determined based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region, and the first iteration region contains at least one sub-iteration region. Based on the target second sub-matrix, iterate over at least one sub-iteration region within the first iteration region to obtain a third input matrix and a fourth input matrix corresponding to the at least one sub-iteration region; The third input matrix corresponding to the at least one sub-iteration region is moved from global memory to a preset cache area; Identify the selected submatrix within the target iteration region; The first target matrix corresponding to the selected sub-matrix is ​​determined from the first input matrix; The second target matrix corresponding to the selected sub-matrix is ​​determined from the second input matrix; Within the first iteration region, determine the third target matrix corresponding to the selected sub-matrix in the third input matrix of each sub-iteration region; Within the first iteration region, determine the fourth target matrix corresponding to the selected sub-matrix in the fourth input matrix of each sub-iteration region; The selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix are moved from global memory to a preset cache area; In the preset buffer area, the target selected sub-matrix of the target iteration area is determined based on the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration area in the first iteration area, and the fourth target matrix. The target selected submatrix is ​​written into the global memory and replaces the selected submatrix in the global memory. The target iteration region is not adjacent to the current iteration region and the first iteration region.

2. The data processing method according to claim 1, characterized in that, Determining the first input matrix and the second input matrix corresponding to the first sub-matrix within the current iteration region includes: The first submatrix in the current iteration region is decomposed to obtain the first upper triangular matrix and the first lower triangular matrix; The first input matrix is ​​obtained based on the first upper triangular matrix; The second input matrix is ​​obtained based on the first lower triangular matrix.

3. The data processing method according to claim 2, characterized in that, The step of obtaining the first input matrix based on the first upper triangular matrix includes: Within the current iteration region, determine each submatrix in the same column as the first submatrix; The first input matrix is ​​obtained by applying panel decomposition algorithm to the first upper triangular matrix and each submatrix in the same column.

4. The data processing method according to claim 2, characterized in that, The step of obtaining the second input matrix based on the first lower triangular matrix includes: Within the current iteration region, determine each submatrix in the same row as the first submatrix; The second input matrix is ​​obtained by applying a triangular matrix solving algorithm to the first lower triangular matrix and each submatrix in the same row.

5. The data processing method according to claim 1, characterized in that, The step of determining the target second sub-matrix of the first sub-iteration region within the first iteration region based on the first input matrix and the second input matrix includes: In the first iteration region, determine the second sub-matrix within the first sub-iteration region; The second submatrix is ​​updated based on the second submatrix, the first input matrix, and the second input matrix to obtain the target second submatrix within the first sub-iteration region.

6. The data processing method according to claim 5, characterized in that, The step of iterating over at least one sub-iteration region within the first iteration region based on the target second sub-matrix to obtain a third input matrix and a fourth input matrix corresponding to the at least one sub-iteration region includes: Obtain the third and fourth input matrices corresponding to the target second sub-matrix within the first sub-iteration region; If the first iteration region includes multiple sub-iteration regions, then the next sub-iteration region is iterated according to the third and fourth input matrices corresponding to the target second sub-matrix and the initial sub-matrix in the next sub-iteration region, so as to determine the target sub-matrix corresponding to the initial sub-matrix and determine the third and fourth input matrices corresponding to the target sub-matrix in the next sub-iteration region. Based on the third and fourth input matrices corresponding to the previous sub-iteration region within the first iteration region and the initial sub-matrix of the next sub-iteration region within the first iteration region, the third and fourth input matrices corresponding to the next sub-iteration region are obtained sequentially until the third and fourth input matrices corresponding to the last sub-iteration region of the first iteration region are obtained.

7. The data processing method according to claim 1, characterized in that, The step of determining the target selected sub-matrix of the target iteration region based on the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix includes: Multiply the first target matrix by the second target matrix to obtain the first calculation result; Multiply the third objective matrix corresponding to each sub-iteration region in the first iteration region by the fourth objective matrix corresponding to each sub-iteration region in the first iteration region to obtain the second calculation result corresponding to each sub-iteration region in the first iteration region. The target selected submatrix is ​​obtained by subtracting the first calculation result and the second calculation result corresponding to each sub-iteration region within the first iteration region from the selected submatrix.

8. The data processing method according to claim 1, characterized in that, After iterating over at least one sub-iteration region within the first iteration region according to the target second sub-matrix to obtain the third input matrix and the fourth input matrix corresponding to the at least one sub-iteration region, the method further includes: The target third sub-matrix in the second iteration region is determined based on the third input matrix corresponding to the last sub-iteration region in the first iteration region and the fourth input matrix. The second iteration region is adjacent to the first iteration region.

9. The data processing method according to claim 1, characterized in that, Before determining the first input matrix and the second input matrix corresponding to the first sub-matrix within the current iteration region from among the multiple sub-matrices corresponding to the original matrix, the method further includes: Obtain the set size of the matrix block corresponding to the original matrix; The original matrix is ​​divided into blocks according to the set size of the matrix blocks to obtain the multiple sub-matrices.

10. A data processing apparatus, characterized in that, include: The first determining module is used to determine the first input matrix and the second input matrix corresponding to the first sub-matrix in the current iteration area among multiple sub-matrixes corresponding to the original matrix, and to move the first input matrix from global memory to a preset cache area; The second determining module is used to determine the target second sub-matrix of the first sub-iteration region within the first iteration region based on the first input matrix and the second input matrix. The first iteration region is adjacent to the current iteration region, and the first iteration region contains at least one sub-iteration region. The acquisition module is used to iterate the at least one sub-iteration region in the first iteration region according to the target second sub-matrix, to obtain the third input matrix and the fourth input matrix corresponding to the at least one sub-iteration region, and to move the third input matrix corresponding to the at least one sub-iteration region from global memory to a preset cache area; The third determining module is used to determine the selected submatrix in the target iteration region; The first target matrix corresponding to the selected sub-matrix is ​​determined from the first input matrix; The second target matrix corresponding to the selected sub-matrix is ​​determined from the second input matrix; Within the first iteration region, determine the third target matrix corresponding to the selected sub-matrix in the third input matrix of each sub-iteration region; Within the first iteration region, determine the fourth target matrix corresponding to the selected sub-matrix in the fourth input matrix of each sub-iteration region; The selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration region within the first iteration region, and the fourth target matrix are moved from global memory to a preset cache area; In the preset buffer area, the target selected sub-matrix of the target iteration area is determined based on the selected sub-matrix, the first target matrix, the second target matrix, the third target matrix corresponding to each sub-iteration area in the first iteration area, and the fourth target matrix. The target selected submatrix is ​​written into the global memory and replaces the selected submatrix in the global memory. The target iteration region is not adjacent to the current iteration region and the first iteration region.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the data processing method according to any one of claims 1 to 9.

12. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • GPDSP-oriented matrix LU decomposition vectorization calculation method

    CN104636315A

  • Method and device for accelerating training of distributed matrix factorization system

    CN111125621A