Matrix striping method using double-block ZY representation in symmetric matrix eigenvalue decomposition
The matrix striping method represented by double block ZY solves the problem of binding the accumulation block size and striping Bandwidth in the existing technology, improves the calculation efficiency of symmetric matrix eigenvalue decomposition, and realizes efficient striping transformation. and Bump Chase.
Patent Information
- Application Number
- CN202410885260.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing symmetric matrix eigenvalue decomposition, the striping algorithm represented by WY or ZY has low computational efficiency due to the strict binding between the accumulation block size and the striping Bandwidth size. Especially when the accumulation block size is small, the improvement efficiency is low. , but if the accumulation block is too large, it will affect the efficiency of subsequent bump chasing.
The matrix striping method represented by double block ZY is adopted, and the accumulation block size and striping Bandwidth are separated through two-level accumulation. The striping transformation is performed on the n*n symmetric matrix. QR decomposition and update operations are performed each time, and the symmetry is used. Copy the lower triangle part to the upper triangle part to form a striped form.
It improves the computational efficiency of symmetric matrix eigenvalue decomposition, avoids the size binding problem of accumulation block size and striping Bandwidth, improves the overall algorithm efficiency, and does not affect the subsequent bump chasing process.
Smart Images

Figure CN118747260A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of high performance computing, and in particular to a matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition. Background Art
[0002] The eigenvalue decomposition of a matrix is generally divided into three steps: 1. Use Householder transformation or its variant (WY representation or ZY representation) to strip the symmetric matrix and eliminate the upper and lower triangular parts of the matrix (such as Figure 7 ); 2. Use bugle chasing to further transform the striped form obtained in step 1 into a tridiagonal form (such as Figure 8 ) ; 3. Use QR iteration or divide-and-conquer method to obtain the eigenvalues of the matrix on the tridiagonalized form obtained in step 2.
[0003] The existing symmetric matrix eigenvalue decomposition striping algorithms can be roughly divided into three types: (1) directly using the Householder transform for striping; (2) using a single block WY representation for striping; (3) using a single block ZY representation for striping.
[0004] Algorithm (1) directly uses Householder transformation for striping. The principle of the algorithm is to directly find the Householder vector corresponding to the Householder transformation of the first column of the original matrix A. Then use the obtained Householder vector to perform a bilateral Householder transformation on the original matrix. Since the Householder transformation is an orthogonal transformation, it does not affect the eigenvalues of the original matrix; at the same time, it can also make the high-dimensional elements of the first column and the first row of the original matrix become 0, thereby reducing the amount of calculation for subsequent transformations. After completing the Householder transformation of the first column and the first row to obtain the new matrix A', the Householder transformation is performed on the second column and the second row of A', so that the high-dimensional elements of the second column and the second row become 0; and so on, until the matrix is transformed into a striped form. This algorithm is simple and intuitive, but because the direct use of Householder vectors to perform Householder transformation on the matrix involves a large number of BLAS2 (Basic Linear Algebra Subprograms level 2) operations of vector-matrix multiplication, the computational efficiency is low.
[0005] Algorithm (2) uses a single block WY representation for striping. The core algorithm principle is to accumulate multiple Householder vectors (referred to as diagonal QR decomposition) to form matrices W and Y, and use the accumulated WY to update matrix A. Although this introduces additional calculations in the process of calculating W (matrix Y is directly the accumulation of Householder vectors and does not introduce additional calculations), since using WY to update matrix A is a BLAS3 (Basic Linear Algebra Subprograms level 3) operation, the computational efficiency is higher than BLAS2. Algorithm 2 can improve the computational efficiency of striping.
[0006] Algorithm (3) uses a single-block ZY representation for striping. Its core algorithm principle is to accumulate multiple Householder vectors to form matrices Z and Y, and use the accumulated ZY to update matrix A. Although the ZY representation and WY representation have the same principle, the ZY representation introduces less computational effort when calculating Z, so it can further improve efficiency compared to the WY representation.
[0007] Although Algorithm (2) and Algorithm (3) can greatly improve the computational efficiency of striping transformation of symmetric matrix eigenvalue decomposition, the size of the accumulation block is strictly bound to the size of the striping bandwidth. When the accumulation block (that is, the bandwidth after striping transformation) is small, the improved efficiency is low, but if the accumulated single block is too large, it will affect the efficiency of subsequent convex block chasing. Summary of the invention
[0008] The present invention aims to overcome the problem of low efficiency of striping algorithm improvement using WY or ZY representation caused by the strict binding of the accumulation block size and the striping Bandwidth in the aforementioned prior art, and provide a matrix striping method using double-block ZY representation in symmetric matrix eigenvalue decomposition, which separates the accumulation block size and the striping Bandwidth size, and performs two-level accumulation on the ZY representation striping algorithm, which can greatly improve the computational efficiency of the symmetric matrix striping transformation, and will not affect the efficiency of subsequent convex block chasing, thereby improving the algorithm efficiency of the overall symmetric matrix eigenvalue decomposition.
[0009] The present invention is achieved through the following technical solutions:
[0010] A matrix striping method using double-block ZY representation in symmetric matrix eigenvalue decomposition is provided, wherein striping transformation is performed on an n*n symmetric matrix A, wherein the symmetric matrix A is composed of g*g square blocks, each of which is composed of b*b numbers, and n is the number of rows and columns of the symmetric matrix A, and n=b*g. Let k be the number of strip blocks accumulated each time, wherein the strip block is composed of a column of square blocks, and all the strip blocks accumulated each time are called a group of accumulated strip blocks, and for the total number of accumulations T in the striping decomposition of the symmetric matrix A, T=g / k. P=[(t-1)*k*b+1], Q=[t*k*b], t∈[1, T], P is the starting column number of each ZY accumulation in the symmetric matrix A, i.e., the starting column number of the accumulation block, and Q is the ending column number of each ZY accumulation in the symmetric matrix A, i.e., the ending column number of the accumulation block. In each internal process of ZY accumulation, each QR decomposition is performed on b columns of data, p = [(t-1)*k*b+(j-1)*b+1], q = [(t-1)*k*b+j*b], j∈[1, k], p is the starting column number of each internal QR decomposition when ZY accumulation is performed, q is the ending column number of each QR decomposition, and t = 1, j = 1 in the initial situation; the specific process is:
[0011] Step A, performing QR decomposition and accumulation on the t-th accumulation block in the symmetric matrix A to obtain a matrix group Z and a matrix group Y;
[0012] Step B: Use the accumulated matrix group Z and matrix group Y to update the tail matrix of matrix A, wherein the tail matrix is a square block from the (Q+1)th row to the nth row and from the (Q+1)th column to the nth column in the matrix A;
[0013] Step C, determine whether t is greater than T, if so, jump to step D, otherwise, set the matrix group Z and the matrix group Y to be empty, set t=t+1, j=1, and finally return to step A;
[0014] Step D: using symmetry, copy the lower triangular part of the symmetric matrix A to the upper triangular part of the symmetric matrix A to obtain a striped transformation form of the symmetric matrix A.
[0015] The present invention relates to the field of high-performance computing, and discloses a matrix striping method using a double block ZY representation in symmetric matrix eigenvalue decomposition, comprising: step A, QR decomposition and accumulation of the t-th accumulation block in the symmetric matrix A to obtain a matrix group Z and a matrix group Y; step B, using the accumulated matrix group Z and matrix group Y to update the tail matrix of the matrix A, the tail matrix is a square block from the (Q+1)th row to the nth row and from the (Q+1)th column to the nth column in the matrix A; step C, judging whether t is greater than T, if so, jumping to step D, otherwise, setting the matrix group Z and the matrix group Y to be empty, setting t=t+1, j=1, and finally returning to step A; step D, using symmetry, copying the lower triangular part of the symmetric matrix A to the upper triangular part of the symmetric matrix A to obtain a striping transformation form of the symmetric matrix A. The present invention improves efficiency.
[0016] As an optimization, the specific process of step A is:
[0017] A.1. Perform QR decomposition on the j-th strip block in the t-th accumulation block, wherein the j-th strip block is composed of a matrix from the (q+1)th row (q=[(t-1)*k*b+j*b])th row to the n-th row and from the p=[(t-1)*k*b+(j-1)*b+1]th column to the q-th column, keep the square block composed of data from p to q rows and p to q columns in the t-th accumulation block unchanged, perform QR decomposition on the strip block from (q+1) to n rows and p to q columns, and obtain a new z submatrix z j and the new y submatrix y j ;
[0018] A.2. Determine whether j is not greater than k. If so, let the new z submatrix z j and the new y submatrix y j Combine the intermediate z matrix group and the intermediate y matrix group as matrix group Z and matrix group Y respectively, that is, let Z = [Z|z j ], let Y = [Y|y j ], then jump to A.3, otherwise, jump to step B;
[0019] A.3. Update the bar blocks corresponding to the matrix data with rows from (q+1) to n and columns from (q+1) to (q+b) through the matrix group Z and the matrix group Y, and then let the matrix group Z and the matrix group Y be the intermediate z matrix group and the intermediate y matrix group respectively; let j=j+1, and jump to A.1.
[0020] As an optimization, when t=1 and j=1, the intermediate z matrix group and the intermediate y matrix group are 0 respectively.
[0021] As an optimization, the specific process of A.1 is:
[0022] The specific process of A.1 is as follows:
[0023] A.1.1. Perform Householder transformation on the strip block consisting of data from the (q+1)th row to the nth row in the pth column to the qth column to obtain the orthogonal matrix Q j , upper triangular matrix R j And the Householder vector corresponding to the strip block consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column;
[0024] A.1.2. Based on the Householder vectors corresponding to the strip blocks consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column, a new y submatrix y is assembled. j ;
[0025] A.1.3. Using the upper triangular matrix R j Replace the content of the bar block consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column;
[0026] A.1.4. The new z submatrix z j The specific formula is:
[0027]
[0028] A2=A2-ZY′-YZ′; A2 is a square block from the (q+1)th row to the nth row and from the (q+1)th column to the nth column in the symmetric matrix A; I is the identity matrix, w j is the first intermediate matrix, w j ′ is the transposed matrix of the first intermediate matrix, y j ′ is the new y submatrix y j The transpose of .
[0029] As an optimization, in A.3,
[0030] The specific process of updating the strip blocks with rows from (q+1) to n and columns from (q+1) to (q+b) through the matrix group Z and the matrix group Y is as follows:
[0031] Use the following formula to update the bars with rows (q+1) to n and columns (q+1) to (q+b):
[0032] GA (q+1)→n,(q+1)→(q+b) =A2-Y p *Z′ p -Z P *Y P (1:b,)′;
[0033] Among them, GA (q+1)→n,(q+1)→(q+b)represents a matrix consisting of strip blocks with rows ranging from (q+1) to n and columns ranging from (q+1) to (q+b); Y(1:b,)′ represents the transposed matrix of the first b rows of the matrix group Y.
[0034] As an optimization, the specific process of step B is:
[0035] The tail matrix is updated using the following formula:
[0036] BL (Q+1)→n,(Q+1)→n =A2-Y*Z′-Z*Y′;
[0037] Among them, BL (Q+1)→n,(Q+1)→n represents a matrix from the (Q+1)th row to the nth row and from the (Q+1)th column to the nth column.
[0038] As an optimization, g is a positive integer.
[0039] As an optimization, the total number of columns of the matrix accumulated for QR decomposition in each round is k*b, and the total number of columns increases as the symmetric matrix A increases.
[0040] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0041] In the present invention, b is the bandwidth size after the symmetric matrix striping transformation, which usually determines the column width of each QR decomposition. If the matrix group Z and the matrix group Y obtained by QR decomposition of the b column are directly used to update the tail matrix A2 using *2=A2-ZY′-YZ′, when b is small, there are a large number of products of thin and tall matrices, which is inefficient; but when b is large, although A2 is updated faster, the bandwidth after the bandwidth update is too large, which will greatly affect the subsequent three striping transformations and seriously affect the symmetric matrix characteristics. In order to improve the performance of eigenvalue decomposition, the method of the present invention introduces the intermediate variable kb. When performing striping, QR decomposition is performed on b columns each time. However, when updating the tail matrix A2, the present invention does not directly use Z and Y obtained by decomposing 1 column of square blocks to update the tail matrix, but uses Z and Y accumulated from k columns of square blocks to update the tail matrix. This reduces the product of tall and thin matrices and improves efficiency. At the same time, since the bandwidth of the last striping transformation is b, it will not affect the subsequent three striping transformations, that is, it will not affect but improve the performance of eigenvalue decomposition. At the same time, this algorithm does not use WY representation for accumulation, but uses ZY representation for accumulation. Since the overall amount of calculation of ZY representation is smaller than that of WY representation, the performance is further improved, so that the present invention overcomes the problem of low efficiency of using WY or ZY representation for striping algorithm improvement due to the strict binding of the accumulation block size and the striping Bandwidth size in the aforementioned prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0043] Figure 1 It is a flow chart of a matrix striping method using double-block ZY representation in symmetric matrix eigenvalue decomposition according to the present invention;
[0044] Figure 2 Schematic diagram of QR decomposition of the first column of square blocks;
[0045] Figure 3 This is a schematic diagram of updating the second column of square blocks;
[0046] Figure 4 A schematic diagram of performing QR decomposition on the second column of square blocks and updating the third column of square blocks;
[0047] Figure 5 Schematic diagram of the symmetric matrix A after the first round of QR decomposition;
[0048] Figure 6 A schematic diagram of performing step D;
[0049] Figure 7 , Figure 8 A schematic diagram of striping performed using prior art methods. DETAILED DESCRIPTION
[0050] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.
[0051] This embodiment 1 provides a matrix striping method using a double-block ZY representation in symmetric matrix eigenvalue decomposition, such as Figure 1 As shown,
[0052] A striping transformation is performed on an n*n symmetric matrix A, wherein the symmetric matrix A is composed of g*g square blocks, each of which is composed of b*b numbers, n is the number of rows and columns of the symmetric matrix A, and n=b*g, k is the number of strip blocks accumulated each time, the strip block is composed of a column of square blocks, and all the strip blocks accumulated each time are called a group of accumulated strip blocks, for the total number of accumulations T in the striping decomposition of the symmetric matrix A, T=g / k, P=[(t-1)*k*b+1], Q=[t*k*b], t∈[1, T], P is The starting number of columns for each ZY accumulation in the symmetric matrix A is the starting number of columns of the accumulation block. Q is the ending number of columns for each ZY accumulation in the symmetric matrix A, that is, the ending number of columns of the accumulation block. In the internal process of each ZY accumulation, each QR decomposition is performed on b columns of data. p = [(t-1)*k*b+(j-1)*b+1], q = [(t-1)*k*b+j*b], j∈[1, k], p is the starting number of columns for each internal QR decomposition when each ZY accumulation is performed, q is the ending number of columns for each QR decomposition, and t = 1, j = 1 in the initial case. .
[0053] In this embodiment, g is a positive integer.
[0054] The general process of the present invention is: in each round of accumulation, a QR operation is performed on the k*b column matrix that forms the k-column strip block, and after the operation, a matrix group Z and a matrix group Y are obtained. If the symmetric matrix A has not been decomposed, then the tail matrix in the symmetric matrix A that has not been subjected to the QR operation is updated through the matrix group Z and the matrix group Y. After the update, the QR operation is performed on the k-column strip block again, and the matrix group Z and the matrix group Y are accumulated again. Then, it is judged whether the symmetric matrix A is decomposed. If so, the strip transformation of the symmetric matrix is completed. By using the symmetry, the lower triangular part of the symmetric matrix A is copied to the upper triangular part of the symmetric matrix A to obtain the strip transformation form of the symmetric matrix A. Otherwise, the aforementioned loop content is continued.
[0055] Next, combine Figure 2-Figure 7 The process of the present invention is described with reference to an example.
[0056] exist Figure 2-Figure 7 In the example, n=256, b=32, g=8, k=4, and T=2. That is, each round performs QR operations on 4 columns of strip blocks, that is, a set of accumulation blocks has 4 columns of strip blocks. When t=1, P=1, Q=128, that is, when the first round of accumulation is performed, it starts from the 1st column of the symmetric matrix A and ends at the 128th column; when t=2, P=129, Q=256, that is, when the second round of accumulation is performed, it starts from the 129th column of the symmetric matrix A and ends at the 256th column.
[0057] After the operation, the matrix group Z and the matrix group Y are obtained. At this time, since the symmetric matrix A has only decomposed the first 4 columns and the last 4 columns have not been decomposed, the tail matrix of the last 4 columns is updated by the matrix group Z and the matrix group Y. After the update, the QR operation is performed again on the square blocks of the last 4 columns. Next, the steps of the present invention are specifically introduced.
[0058] Step A, performing QR decomposition and accumulation on the t-th accumulation block in the symmetric matrix A to obtain a matrix group Z and a matrix group Y;
[0059] Taking the above data as an example, at each accumulation, since k is 4, the 4 columns of bar blocks will be decomposed, and each column of bar blocks has b columns of data.
[0060] When t=1, j=1, p=1, q=32, that is, the first QR decomposition is performed from the 1st to the 32nd column during the first accumulation to obtain a z submatrix and a y submatrix; j can be understood as the number of times QU decomposition is performed during each accumulation, and the matrix to be QR decomposition is updated through the z submatrix and the y submatrix, that is, the data from the 33rd to the 64th column is updated.
[0061] When t=1, j=2, p=33, q=64, that is, the data from the 33rd column to the 64th column is performed during the second QR decomposition during the first accumulation, and a z sub-matrix and a y sub-matrix are obtained again, and then combined with the previously obtained z sub-matrix and y sub-matrix to form a new z sub-matrix and y sub-matrix, and then the matrix to be QR decomposition is updated, and so on. In this embodiment, the specific process of step A is:
[0062] A.1. Perform QR decomposition on the j-th strip block in the t-th accumulation block, where the j-th strip block is composed of matrices from the (q+1)-th row to the n-th row and from the p-th column to the q-th column. Keep the square block composed of data with rows p=[(t-1)*k*b+(j-1)*b+1] to q=[(t-1)*k*b+j*b] and columns p=[(t-1)*k*b+(j-1)*b+1] to q=[(t-1)*k*b+j*b] in the t-th accumulation block unchanged, perform QR decomposition on the strip block with rows (q+1) to n and columns p to q, and obtain a new z submatrix z j and the new y submatrix y j ;
[0063] like Figure 2 As shown, at this time j=1, t=1, k=4, then p=1, q=32, P=1, Q=128, that is, the strip blocks accumulated in the first round are from the 1st column to the 4th column, and the corresponding data of the symmetric matrix A are from the 1st column to the 128th column. In the first round of accumulation, the data from the 1st column to the 32nd column are first decomposed by QR.
[0064] Keep the square block composed of data with rows p = [(t-1)*k*b+(j-1)*b+1] to q = [(t-1)*k*b+j*b] and columns p to q in the t-th accumulation block unchanged, that is, in the first QR decomposition in the first accumulation block, keep the data from the 1st row to the 32nd row and the 1st column to the 32nd column unchanged, that is, keep Figure 2 The corresponding grey square blocks shown remain unchanged, and the light brown bar blocks from the 2nd to the 8th rows of the 1st column (corresponding to the matrix data from the 1st to the 32nd columns and the 33rd to the 256th rows) are subjected to QR operation (QR decomposition) to obtain z1 and y1.
[0065] The specific process of A.1 is as follows:
[0066] A.1.1. Perform Householder transformation on the strip block consisting of data from the (q+1)th row to the nth row in the pth column to the qth column to obtain the orthogonal matrix Q j , upper triangular matrix R j And the Householder vector corresponding to the strip block consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column;
[0067] A.1.2. Based on the Householder vectors corresponding to the strip blocks consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column, a new y submatrix y is assembled. j ;
[0068] A.1.3. Using the upper triangular matrix R j Replace the content of the bar block consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column;
[0069] A.1.4. The new z submatrix z j The specific formula is:
[0070]
[0071] A2=A2-ZY′-YZ′; A2 is a square block from the (q+1)th row to the nth row and from the (q+1)th column to the nth column in the symmetric matrix A; I is the identity matrix, w j is the first intermediate matrix, w j ′ is the transposed matrix of the first intermediate matrix, y j ′ is the new y submatrix y j The transpose of .
[0072] QR decomposition is a common operation in matrix decomposition. Assume Figure 2The light brown part is A1, and the blue part is A2. Then QR decomposition is performed on A1, that is, Householder transformation is performed on each column of A1 to obtain the orthogonal matrix Q1, the upper triangular matrix R1, and the Householder vector of each row is used to piece together the matrix y j . Use R1 (light brown part) to replace A1 part, and consider the symmetry of matrix A, and replace A1' (transposed part of A1) with R1', thus completing the strip-swap transformation of A1 and A1'. j *y j ′=Q j ,Q j is the orthogonal matrix of the jth QR decomposition, and w can be obtained j , and because A2=A2-ZY′-YZ′, so we can find z j .
[0073] A.2. Determine whether j is not greater than k. If so, let the new z submatrix z j and the new y submatrix y j Combine the intermediate z matrix group and the intermediate y matrix group as matrix group Z and matrix group Y respectively, that is, let Z = [Z|z j ], let Y = [Y|y j ], then jump to A.3, otherwise, jump to step B;
[0074] like Figure 3 As shown, since j was 1 before and is less than 4, z1 and y1 are respectively combined with the intermediate z matrix group and the intermediate y matrix group as the matrix group Z and the matrix group Y. Since when t=1 and j=1, the intermediate z matrix group and the intermediate y matrix group are 0 respectively, therefore, at this time Z=[z1],=[y1].
[0075] A.3. Update the strip blocks corresponding to the matrix data with rows (q+1) to n and columns (q+1) to (q+b) through the matrix group Z and the matrix group Y, and then let the matrix group Z and the matrix group Y be the intermediate z matrix group and the intermediate y matrix group respectively; let j=j+1, and jump to A.1.
[0076] like Figure 3 As shown, the square blocks ( Figure 3 ) to update.
[0077] The specific process of updating the strip blocks with rows from (q+1) to n and columns from (q+1) to (q+b) through the matrix group Z and the matrix group Y is as follows:
[0078] Use the following formula to update the bars with rows (q+1) to n and columns (q+1) to (q+b):
[0079] GA (q+1)→n,(q+1)→(q+b) =A2-Y p *Z′ p -Z P *Y P (1:b,)′;
[0080] Among them, GA (q+1)→n,(q+1)→(q+b) represents a matrix consisting of strip blocks with rows ranging from (q+1) to n and columns ranging from (q+1) to (q+b); Y(1:b,)′ represents the transposed matrix of the first b rows of the matrix group Y.
[0081] Note that although the tail matrix A2 is also updated, since only a small part of A2 is updated, the amount of calculation is very small and the impact on performance is limited.
[0082] After the update, [z1] and [y1] become the intermediate z matrix group and the intermediate y matrix group respectively.
[0083] Then j=2, t=1, k=4, p=33, q=64, that is, QR decomposition is performed on the strip blocks in the second column.
[0084] Next, if Figure 4 shown.
[0085] Then execute the process of A.1. Keep the square block composed of data from 33 to 64 rows and 33 to 64 columns in the t-th accumulation block unchanged, that is, in the second QR decomposition in the first accumulation block, keep the data from 33 to 64 rows and 33 to 64 columns unchanged, that is, keep Figure 4 Perform QR operation (QR decomposition) on the data corresponding to the gray square block in the second row and second column of , and the light brown bar blocks from the third row to the eighth row of the second column (corresponding to the matrix data from the 33rd to the 64th column and the 65th to the 256th row) to obtain z2 and y2.
[0086] Then execute the process of A.2. Since j is 2 before, which is less than 4, z2 and y2 are used as the matrix group Z and the sub-matrix group Y respectively combined with the intermediate z matrix group [z1] and the intermediate y matrix group [y1]. Therefore, Z = [z1|z2], Y2 = [y1|y2].
[0087] Then execute the process of A.3. Figure 4 As shown, the square blocks ( Figure 4 ) to update.
[0088] After the update, [z1|z2] and [y1|y2] become the intermediate z matrix group and the intermediate y matrix group respectively.
[0089] Then j=3, t=1, k=4, p=65, q=96.
[0090] The QR decomposition process of the bars in the third and fourth columns can refer to the second column, and z3 / y3 and z4 / y4 are obtained respectively. This process will not be repeated here.
[0091] Finally, QR decomposition is performed on the first four columns of strip blocks, and accumulation is performed to obtain Z = [z1|z2|z3|z4], Y = [y1|y2|y3|y4].
[0092] After the first round of accumulation, you can see Figure 5 , the blue part is the tail matrix.
[0093] Step B: Use the accumulated matrix group Z and matrix group Y to update the tail matrix of matrix A, wherein the tail matrix is a square block from the (Q+1)th row to the nth row and from the (Q+1)th column to the nth column in the matrix A;
[0094] The specific process of step B is:
[0095] BL (Q+1)→n,(Q+1)→n =A2-Y*Z′-Z*Y′;
[0096] Among them, BL (Q+1)→n,(Q+1)→n represents the matrix from the (Q+1)th row to the nth row and from the (Q+1)th column to the nth column. Z' is the transpose of the matrix group Z, and Y' is the transpose of the matrix group Y.
[0097] Even if the above formula is used Figure 5 , 6 The medium blue part (A2) is updated.
[0098] Step C, determine whether t is greater than T, if so, jump to step D, otherwise, set the matrix group Z and the matrix group Y to be empty, set t=t+1, j=1, and finally return to step A;
[0099] When accumulating for the second round, t=2, j=1, then p=129, q=160, P=129, Q=256.
[0100] That is, the process of QR decomposition of the bar block in the 5th column (corresponding to the matrix data in the 129th to 160th columns) is as follows:
[0101] Execute the process of A.1. Keep the square block composed of data with rows p = [(t-1)*k*b+(j-1)*b+1] to q = [(t-1)*k*b+j*b] and columns p to q in the t-th accumulation block unchanged, that is, keep the data from rows 129 to 160 and columns 129 to 160 unchanged in the first QR decomposition in the second accumulation block, perform QR operation (QR decomposition) on the strip block from rows 6 to 8 of the 5th column (corresponding to the matrix data from rows 161 to 256 and columns 129 to 160), and obtain z1 and y1.
[0102] Then execute the process of A.2. Since j is 1 before and less than 4, z1 and y1 are used as the matrix group Z and the matrix group Y respectively in combination with the intermediate z matrix group and the intermediate y matrix group. Since when t=1 and j=1, the intermediate z matrix group and the intermediate y matrix group are 0 respectively, at this time, the matrix group Z=[z1] and the matrix group Y=[y1].
[0103] Then execute the process of A.3. Update the square blocks from the 6th row to the 8th row in the 6th column by [z1] and [y1].
[0104] After the update, [z1] and [y1] become the intermediate z matrix group and the intermediate y matrix group respectively.
[0105] The process of QR decomposition of the square blocks in the 6th, 7th and 8th columns can refer to the 5th column, and z2 / y2, z3 / y3 and z4 / y4 are obtained respectively. This process will not be repeated here.
[0106] Finally, QR decomposition is performed on the last 4 columns of square blocks and accumulated to obtain Z = [z1|z2|z3|z4], Y = [y1|y2|y3|y4].
[0107] Step D: Using symmetry, copy the lower triangular part (light brown) of the symmetric matrix A to the upper triangular part (gray) of the symmetric matrix A to obtain a striped transformation form of the symmetric matrix A.
[0108] Step A uses two column blocks, b and kb, and performs two-level ZY accumulation, which not only ensures the efficiency of the striping transformation represented by ZY, but also ensures that after the striping is completed, its b can still be very small and does not affect the efficiency of the subsequent convex block chasing, thereby improving the overall efficiency of the symmetric matrix eigenvalue decomposition algorithm.
[0109] b is the bandwidth size after the symmetric matrix striping transformation. In each small step, QR decomposition is performed on the b column to obtain a z and y. After k b column decompositions are performed, these z and y can be pieced together to obtain Z and Y. Z and Y are then used to update the tail matrix A2, which greatly improves the efficiency of the tail matrix update.
[0110] The total number of columns of the square blocks for each round of QR decomposition is k*b, and the total number of columns increases as the symmetric matrix A increases.
[0111] The b and kb parameters of the present invention can be flexibly configured according to the size of the matrix. When the dimension of the symmetric matrix to be decomposed is very large, the efficiency of the striping transformation can be greatly improved. The striping step of the symmetric matrix alone can improve the efficiency by about 3x. The specific implementation methods described above further explain the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition, characterized in that: Striping transformation is performed for the n*n symmetric matrix A, wherein the symmetric matrix A is composed of g*g square blocks, each of which is composed of b*b numbers, n is the number of rows and columns of the symmetric matrix A, and n=b*g, k is the number of strip blocks accumulated each time, the strip block is composed of a column of square blocks, and all the strip blocks accumulated each time are called a group of accumulation blocks, and the total number of accumulations in the striping decomposition of the symmetric matrix A is T, T=g / k. P=[(t-1)*k*b+1], Q=[t*k*b], t∈[1, T], P is the starting column number of each ZY accumulation in the symmetric matrix A, that is, the starting column number of the accumulation block, and Q is the ending column number of each ZY accumulation in the symmetric matrix A, that is, the ending column number of the accumulation block. In each internal process of ZY accumulation, each QR decomposition is performed on b columns of data, p = [(t-1)*k*b+(j-1)*b+1], q = [(t-1)*k*b+j*b], j∈[1, k], p is the starting column number of each internal QR decomposition when ZY accumulation is performed, q is the ending column number of each QR decomposition, and t = 1, j = 1 in the initial situation; the specific process is: Step A, performing QR decomposition and accumulation on the t-th accumulation block in the symmetric matrix A to obtain a matrix group Z and a matrix group Y; Step B: Use the accumulated matrix group Z and matrix group Y to update the tail matrix of matrix A, wherein the tail matrix is a square block from the (Q+1)th row to the nth row and from the (Q+1)th column to the nth column in the matrix A; Step C, determine whether t is greater than T, if so, jump to step D, otherwise, set the matrix group Z and the matrix group Y to be empty, set t=t+1, j=1, and finally return to step A; Step D: using symmetry, copy the lower triangular part of the symmetric matrix A to the upper triangular part of the symmetric matrix A to obtain a striped transformation form of the symmetric matrix A.
2. The matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition according to claim 1, characterized in that: The specific process of step A is: A.
1. Perform QR decomposition on the j-th strip block in the t-th accumulation block, where the j-th strip block is composed of matrices from the (q+1)-th row to the n-th row and from the p-th column to the q-th column. Keep the square block composed of data from p to q in the t-th accumulation block and p to q in the column, and perform QR decomposition on the strip block from (q+1) to n in the row and p to q in the column, and obtain a new z submatrix z j and the new y submatrix y j ; A.
2. Determine whether j is not greater than k. If so, let the new z submatrix z j and the new y submatrix y j Combine the intermediate z matrix group and the intermediate y matrix group as matrix group Z and matrix group Y respectively, that is, let Z = [Z|z j ], let Y = [Y|y j ], then jump to A.3, otherwise, jump to step B; A.
3. Update the strip blocks corresponding to the matrix data with rows from (q+1) to n and columns from (q+1) to (q+b) through the matrix group Z and the matrix group Y, and then let the matrix group Z and the matrix group Y be the intermediate z matrix group and the intermediate y matrix group respectively; Let j=j+1 and jump to A.
1.
3. The matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition according to claim 2, characterized in that: When t=1 and j=1, the intermediate z matrix group and the intermediate y matrix group are 0 respectively.
4. The matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition according to claim 2, characterized in that: The specific process of A.1 is as follows: A.1.
1. Perform Householder transformation on the strip block consisting of data from the (q+1)th row to the nth row in the pth column to the qth column to obtain the orthogonal matrix Q j , upper triangular matrix R j And the Householder vector corresponding to the strip block consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column; A.1.
2. Based on the Householder vectors corresponding to the strip blocks consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column, a new y submatrix y is assembled. j ; A.1.
3. Using the upper triangular matrix R j Replace the content of the strip block consisting of the data from the (q+1)th row to the nth row in the pth column to the qth column in the matrix A; A.1.
4. The new z submatrix z j The specific formula is: A2=A2-ZY′-YZ′; A2 is a square block from the (q+1)th row to the nth row and from the (q+1)th column to the nth column in the symmetric matrix A; I is the identity matrix, w j is the first intermediate matrix, w′ j is the transposed matrix of the first intermediate matrix, y′ j is the new y submatrix y j The transpose of .
5. The matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition according to claim 4, characterized in that: In A.3, the specific process of updating the strip blocks with rows from (q+1) to n and columns from (q+1) to (q+b) through the matrix group Z and the matrix group Y is as follows: Use the following formula to update the bars with rows (q+1) to n and columns (q+1) to (q+b): <h2 style=";text-align:left;direction:ltr">GA<h2 style=";text-align:left;direction:ltr"> (q+1)→n,(q+1)→(q+b) <h2 style=";text-align:left;direction:ltr"> =A2-Y<h2 style=";text-align:left;direction:ltr"> p <h2 style=";text-align:left;direction:ltr"> *Z′<h2 style=";text-align:left;direction:ltr"> p <h2 style=";text-align:left;direction:ltr"> -Z<h2 style=";text-align:left;direction:ltr"> P <h2 style=";text-align:left;direction:ltr"> *Y<h2 style=";text-align:left;direction:ltr"> P <h2 style=";text-align:left;direction:ltr"> (1:b,)′; Among them, GA (q+1)→n,(q+1)→(q+b) represents a matrix consisting of strip blocks with rows ranging from (q+1) to n and columns ranging from (q+1) to (q+b); Y(1:b,)′ represents the transposed matrix of the first b rows of the matrix group Y.
6. The matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition according to claim 1, characterized in that: The specific process of step B is: The tail matrix is updated using the following formula: <h2 style=";text-align:left;direction:ltr">BL<h2 style=";text-align:left;direction:ltr"> (Q+1)→n,(Q+1)→n <h2 style=";text-align:left;direction:ltr"> (A2-Y*Z′-Z*Y′) Among them, BL (Q+1)→n,(Q+1)→n represents a matrix from the (Q+1)th row to the nth row and from the (Q+1)th column to the nth column.
7. The matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition according to claim 1, characterized in that: g is a positive integer.
8. The matrix striping method using dual-block ZY representation in symmetric matrix eigenvalue decomposition according to claim 1, characterized in that: The total number of columns of the matrix accumulated for QR decomposition in each round is k*b, and the total number of columns increases as the symmetric matrix A increases.
Citation Information
Cited By
Symmetric stripe matrix three-diagonalization transformation method based on GPU parallel acceleration
CN118917994A
A tridiagonal transformation method of symmetric strip matrix based on GPU parallel acceleration
CN118917994B
Heterogeneous symmetric matrix eigenvalue decomposition method, system and equipment based on GPU parallel acceleration
CN120561440A
A method, system and device for eigenvalue decomposition of heterogeneous symmetric matrices based on GPU parallel acceleration
CN120561440B
