Computation processing device and computation processing method
By dividing the standard eigenvalue problem calculation into asynchronous units with dependency-aware task execution, the method addresses cache inefficiencies and parallelism issues, significantly improving computational efficiency.
Patent Information
- Application Number
- JP2023035942
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The standard eigenvalue problem for symmetric matrices faces performance bottlenecks due to cache inefficiencies and decreasing parallelism in tridiagonalization calculations, particularly with the DSYTRD function, which hinders computational efficiency when using the divide-and-conquer method.
The proposed method divides the calculation of standard eigenvalue problems into multiple asynchronous calculation units, allowing tasks with no dependency relationships to be executed in parallel, while tasks with dependencies are processed sequentially, utilizing thread and task parallelism to improve cache efficiency and overall performance.
This approach enhances the computational efficiency of standard eigenvalue problems by optimizing cache usage and maximizing parallel processing, reducing calculation time by up to 30% compared to traditional methods.
Smart Images

Figure 2024127077000001
Abstract
Description
[Technical field]
[0001] The present invention relates to a processor and a processing method. [Background technology]
[0002] The standard eigenvalue problem for a matrix is the problem of finding all the eigenvalues (λ) and eigenvectors (ν) for a particular square matrix, expressed as Aν=λν. When a particular square matrix has a size of n×n, there are generally n pairs of eigenvalues (λ) and eigenvectors (ν), which can be found by solving the standard eigenvalue problem. The standard eigenvalue problem is widely used in the fields of science and technology. In particular, the standard eigenvalue problem for symmetric matrices is used in new drug design and big data analysis, and is an important topic in modern society.
[0003] When solving the standard eigenvalue problem of a symmetric matrix on a computer, the calculation is generally carried out while transforming the matrix as follows. First, the computer tridiagonalizes the symmetric matrix. Next, the computer calculates the eigenvalues and eigenvectors for the tridiagonal matrix. Finally, the computer performs an inverse transform of the eigenvectors of the tridiagonal matrix to calculate the eigenvalues and eigenvectors of the original symmetric matrix.
[0004] Here, a tridiagonal matrix is a matrix in which only the diagonal elements and adjacent elements above and below the diagonal elements are nonzero. In tridiagonalization, a symmetric matrix is transformed into a tridiagonal matrix by a similarity transformation of the matrix. A Householder matrix using the Householder transformation is known as a matrix used for this transformation.
[0005] In tridiagonalization, one of the following three methods is generally used. The first method is called the QR method, which solves the standard eigenvalue problem using a similarity transformation with an orthogonal matrix. The QR method has the characteristic that it is easy to stably calculate eigenvalues and eigenvectors. The second method is called the MRRR (Multiple Relatively Robust Representations) method. The MRRR method has the characteristic that it is easy to solve the standard eigenvalue problem with high accuracy. The third method is called the divide-and-conquer method. The divide-and-conquer method divides a matrix into smaller matrices and calculates the eigenvalues and eigenvectors. The divide-and-conquer method has the characteristic that it is easy to calculate with a high degree of parallelism. In recent years, computers have become very large in scale, so the divide-and-conquer method is often used to solve the standard eigenvalue problem with a high degree of parallelism.
[0006] Matrix operations are often used in various mathematical problems, including the standard eigenvalue problem. For this reason, Basic Linear Algebra Subprograms (BLAS), which compiles basic operations in linear algebra, and Linear Algebra Package (LAPACK), which compiles functions for calculating standard eigenvalue problems and singular value problems, have been released as open source. In general, the standard eigenvalue problem of a symmetric matrix can be calculated by combining BLAS and LAPACK. Since BLAS and LAPACK are used frequently, various tuned libraries are provided by each vendor.
[0007] A recent trend in processors is to improve computational performance by incorporating more cores. For example, the number of cores in the processors for the supercomputers K and Fugaku, developed by Fujitsu, has increased from 8 to 48. In addition, the number of cores in flagship GPUs developed by Nvidia has increased, in order, to 5120 (V100), 6912 (A100), and 16896 (H100). When using such processors, it is preferable to use algorithms with a high degree of parallelism that use all cores in order to improve computational performance.
[0008] When solving a standard eigenvalue problem of a double-precision symmetric matrix using the divide and conquer method with LAPACK, a dedicated function for the standard eigenvalue problem of a double-precision symmetric matrix (a function called DSYEVD: Double to Symmetric Eigenvalue using Divide and Conquer algorithm) is used. In DSYEVD, processing is mainly composed of functions called DSYTRD, DSTEDC, and DORMTR. DSYTRD (Double to Symmetric tridiagonal form reduce) is a function that tridiagonalizes a symmetric matrix. DSTEDC (Double to Symmetric tridiagonal Eigenvalue using Divide and Conquer algorithm) is a function that solves the standard eigenvalue problem of a tridiagonal matrix using the divide and conquer method. DORMTR (Double Overwrite Real M-by-N matrix with Trans) is a function that performs the inverse transformation of the eigenvectors of a tridiagonal matrix by matrix multiplication.
[0009] Here, we will list the characteristics of each function. DSYTRD tends to have difficulty in achieving cache hits, and the degree of parallelism decreases as the calculation progresses. DSTEDC can be calculated with a high degree of parallelism and high computational efficiency. DORMTR can be calculated with high computational efficiency. Therefore, in general, in standard eigenvalue problems for symmetric matrices, DSYTRD accounts for a large portion of the total computation time. Given these characteristics of each function, it is believed that overall performance can be improved by improving the performance issues in DSYTRD.
[0010] As a parallel processing technique, a technique has been proposed in which a given computational model is divided to construct a number of non-interdependent sub-computations, and a number of processors process each of the sub-computations in parallel. [Prior art documents] [Patent documents]
[0011] [Patent Document 1] Special Publication No. 2022-500755 Summary of the Invention [Problem to be solved by the invention]
[0012] However, in the calculation of the standard eigenvalue problem of a symmetric matrix, DSYTRD has characteristics such as a tendency to have difficulty in cache hits and a decrease in parallelism as the calculation progresses, so the tridiagonalization calculation by DSYTRD becomes a bottleneck. Therefore, if the tendency to have difficulty in cache hits cannot be improved, it is difficult to improve the calculation efficiency as long as the standard eigenvalue problem of a double-precision symmetric matrix is solved by the divide-and-conquer method.
[0013] As an example, the actual calculation flow of DSYTRD for a symmetric matrix of size 16x16 is explained. To perform the first similarity transformation, the elements of the 0th column, 1st row to the 15th row are accessed to calculate the Householder matrix. Since the Householder matrix can be expressed using a vector, it is actually stored in the form of a vector. Then, the similarity transformation is performed using the Householder matrix. Here, the similarity transformation is performed by matrix-vector multiplication, which is inefficient in cache and causes a lot of waiting in the calculation. In the first similarity transformation, 225 (=15x15) elements are effectively updated. The second similarity transformation is also calculated in the same way as the 0th column. In the second similarity transformation, 196 (=14x14) elements are effectively updated. When such calculations are repeated, the number of elements updated by the similarity transformation is greatly reduced, and sufficient parallelism is lost. Therefore, even if multiple threads are available, it is difficult to fully utilize the calculation performance of the processor because calculations are performed by some of the threads.
[0014] Here, the problem of cache hits being difficult, which is one of the features of DSYTRD, can be avoided to some extent by changing the calculation algorithm. One possible method for this is to use an algorithm called dsytrd_2stage included in LAPACK. However, when dsytrd_2stage is used, the amount of calculations in the part corresponding to DORMTR in eigenvector calculations is about doubled, so it is preferable to use different algorithms depending on the calculation stage. However, even if dsytrd_2stage is used, it is difficult to avoid a decrease in parallelism in tridiagonalization.
[0015] The disclosed technology has been made in view of the above, and has an object to provide a processing device and a processing method that improve the efficiency of calculations of standard eigenvalue problems. [Means for solving the problem]
[0016] In one aspect of the arithmetic processing device and arithmetic processing method disclosed in the present application, a calculation execution unit, for a plurality of calculation units generated by dividing a calculation of a standard eigenvalue problem for a predetermined symmetric matrix and each performing a different calculation, calculates a first task and a second task asynchronously when there is no dependency between a first task and a second task among a plurality of tasks executed by each of the calculation units such that one performs a calculation based on the result of the other, and calculates the first task and the second task sequentially when there is a dependency between the first task and the second task. An output unit outputs the calculation result of the standard eigenvalue problem for the predetermined symmetric matrix calculated by the calculation execution unit. Effect of the Invention
[0017] In one aspect, the present invention can improve the computational efficiency of standard eigenvalue problems. [Brief description of the drawings]
[0018] [Figure 1] FIG. 1 is a block diagram of a computer according to an embodiment. [Diagram 2] FIG. 2 is a diagram illustrating an example of thread parallelism and task parallelism. [Diagram 3] FIG. 3 is a diagram showing a calculation flow of the standard eigenvalue problem. [Figure 4] FIG. 4 is a diagram showing the flow of tridiagonalization calculations by DSYTRD. [Diagram 5] FIG. 5 is a diagram illustrating an example of a dependency graph according to the first embodiment. [Figure 6] FIG. 6 is a flowchart of a calculation process of the standard eigenvalue problem by the processor according to the embodiment. [Figure 7] FIG. 7 is a flowchart of the asynchronous execution possibility determination process. [Figure 8] FIG. 8 is a flowchart of the dependency determination process. [Figure 9] FIG. 9 is a flowchart of the asynchronous execution determination process. [Figure 10] FIG. 10 is a diagram of an example of a timeline comparing the calculation of the standard eigenvalue problem when asynchronous execution of calculation units is performed and when not performed. [Figure 11] FIG. 11 is a diagram illustrating a comparison of calculation speed between the calculation of the standard eigenvalue problem by the processor according to the first embodiment and the calculation in the case where the asynchronous execution of the calculation unit is not performed. [Figure 12] FIG. 12 is a diagram illustrating an example of a dependency graph according to the second embodiment. [Figure 13] FIG. 13 is a diagram showing matrix division in DSTEDC. [Figure 14] FIG. 14 illustrates the recursive computation of eigenvalues and eigenvectors of a matrix in DSTEDC. [Figure 15] FIG. 15 is a diagram illustrating a comparison of calculation speed between the calculation of the standard eigenvalue problem by the processor according to the second embodiment and the calculation in the case where the asynchronous execution of the calculation unit is not performed. [Figure 16] FIG. 16 is a diagram illustrating an example of a dependency graph according to the third embodiment. [Figure 17] FIG. 17 is a diagram illustrating an outline of calculation by DORMTR according to the third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0019] Hereinafter, embodiments of the arithmetic processing device and the arithmetic processing method disclosed in the present application will be described in detail with reference to the drawings. Note that the arithmetic processing device and the arithmetic processing method disclosed in the present application are not limited to the following embodiments. EXAMPLES
[0020] 1 is a block diagram of a computer according to an embodiment. In this embodiment, a case will be described in which the computer 1 solves the standard eigenvalue problem using LAPACK or BLAS, which are libraries that compile basic operations of linear algebra. However, there is no particular limitation on the algorithm used by the computer 1 as long as it is an algorithm for calculating the standard eigenvalue problem.
[0021] The computer 1 includes a processor 10, a memory 11, and a storage device 12. The processor 10, the memory 11, and the storage device 12 are each connected to a bus and are capable of transmitting and receiving data to and from each other.
[0022] The processor 10 has multiple cores. Each core is capable of executing one thread at a time. That is, the processor 10 is capable of executing multiple threads. The processor 10 is also capable of executing multiple threads in parallel. The execution of multiple threads in parallel is called thread parallelism.
[0023] In this embodiment, the mathematical processing provided by LAPACK or BLAS, the function of a set of processing for the processor 10 to proceed with the calculation, or the mathematical processing defined by the user or the set of processing for the processor 10 to proceed with the calculation are called a calculation unit. The calculation unit can be freely defined as long as it is a calculation or processing that produces some kind of result. However, if the calculation unit is made small, it is possible that the result obtained by the calculation unit alone will be meaningless, such as a mere intermediate step of a larger calculation or processing that includes the calculation unit. Such a calculation unit is not preferable because it complicates the processing. In this embodiment, a calculation or processing that produces a mathematically meaningful result is called a calculation unit.
[0024] The following can be used as the computation unit according to this embodiment. For example, one of the computation units is a function that performs matrix multiplication of double-precision real numbers, such as dgemm in BLAS. Also, one of the computation units is a function that calculates eigenvalues and eigenvectors of a tridiagonal symmetric matrix of double-precision real numbers, such as dsteqr in LAPACK.
[0025] Also, one of the calculation units is a function that copies a double-precision matrix, for example, dlacpy in LAPACK. Here, LAPACK and BLAS also have functions that assume overwriting of matrices and vectors. Therefore, in this embodiment, the copying of matrices and vectors for performing calculations on the computer 1 is also considered as a calculation unit.
[0026] Also, one of the calculation units is a function that temporarily saves array elements in order to perform a calculation defined by the user. Arrays also include matrices. Here, the temporary saving of array elements has no mathematical meaning, but is a process necessary to proceed with the processing from the viewpoint of the program. Therefore, such functions are also treated as calculation units. In this way, in this embodiment, the processing defined by the user to solve the problem can also be used as a calculation unit.
[0027] On the other hand, in this embodiment, the examples shown below are not treated as computation units. One is a function for error processing, for example, xerbla called from dgemm in BLAS. Since error processing is not a mathematical process or a process for advancing calculations in Computer 1, xerbla is not treated as a computation unit. For example, xerbla is treated as a process included in the computation unit of dgemm, which is a computation unit. Another is a multiply-and-accumulate operation inside dgemm in BLAS. The multiply-and-accumulate operation that constitutes dgemm itself does not have a final mathematical meaning. The multiply-and-accumulate operation inside dgemm is treated as a process included in dgemm, which is a computation unit.
[0028] Another type is a function that obtains a constant in double-precision real numbers, such as dlamch inside dsteqr in LAPACK. dlamch is a function that obtains a constant needed to calculate dsteqr, and is not a calculation unit because it is not a mathematical process. dlamch is treated as a process included in dsteqr, which is a calculation unit. Another type is dgemm inside dstedc in LAPACK, which is treated as a calculation unit. dgemm, which is called inside dstedc, which is a calculation unit, is treated as a process included in dstedc.
[0029] One is a process that outputs the calculation result of dsteqr implemented by the user to the standard output. This process is not treated as a calculation unit because it is not a mathematical process or a process necessary for the calculation to proceed on Calculator 1. This process is treated as a process included in dsteqr, which is a calculation unit.
[0030] The processor 10 treats each computation unit included in the program that solves the standard specific problem as one task. A task includes one or more threads. The processor 10 is capable of executing multiple tasks in parallel. The asynchronous execution of multiple tasks is called asynchronous task execution. The computation unit processed by a task may also be called asynchronous execution of a computation unit. In asynchronous task execution, the processor 10 executes each task independently, unlike when the processor 10 executes each task in sequence according to the program description.
[0031] Here, the processor 10 of this embodiment uses a task parallel function of OpenMP (Multi Processing) when processing tasks asynchronously. However, in practice, it is preferable for the processor 10 to select an appropriate algorithm for each architecture. For example, in cases where performance is likely to improve when using the task parallel function of OpenMP to use high-speed synchronization by a hardware barrier function, it is preferable to use OpenMP. In addition, the processor 10 may use a stream function or a CUDA Graphs function.
[0032] 2 is a diagram showing an example of thread parallelism and task parallelism. For example, the processor 10 executes a calculation as shown in thread parallelism 201. That is, the processor 10 executes a calculation in multiple threads for a task 211 that executes one calculation unit.
[0033] Moreover, the processor 10 executes calculations as shown in task parallelism 202. In this case, the processor 10 executes tasks 221, 222, and 223 in parallel, i.e., asynchronously. In task parallelism 202, when a certain calculation unit is focused on, if multiple threads are assigned to the calculation unit, the processor 10 executes the processing of the calculation unit in thread parallelism. That is, the processor 10 executes processing of tasks 221 and 223 in thread parallelism. That is, the processor 10 calculates multiple calculation units in task parallelism with one or multiple threads at the same timing. Here, in the case of task parallelism, the processor 10 is only expected to process multiple calculation units at the same timing, but may actually process the multiple calculation units at different timings.
[0034] Continuing with the explanation, returning to Fig. 1, the processor 10 solves the standard eigenvalue problem using thread parallelism and task parallelism. Here, the processor 10 calculates the standard eigenvalue problem of a symmetric matrix.
[0035] Fig. 3 is a diagram showing a flow of calculation of the standard eigenvalue problem. Here, an outline of the flow of calculation of the standard eigenvalue problem by the processor 10 according to the present embodiment will be described with reference to Fig. 3. Here, a case where the symmetric matrix 231 is an n x n matrix will be described as an example.
[0036] The processor 10 performs tridiagonalization on the symmetric matrix 231 using DSYTRD to calculate the tridiagonal matrix 232 (step S1). When performing tridiagonalization, the processor 10 converts the Householder matrix Hi used in the i-th similarity transformation into an orthogonal matrix Q t After the tridiagonalization is completed, the processor 10 stores Q t =H n-2 ...Get H2H1.
[0037] FIG. 4 is a diagram showing the flow of tridiagonalization calculations using DSYTRD. By executing DSYTRD, the processor 10 converts a symmetric matrix into a tridiagonal matrix column by column from the left to the right as shown in FIG. 4. At this time, one column can be tridiagonalized with one similarity transformation. In FIG. 4, the determined diagonal elements are shown in black, the determined subdiagonal elements are shown with a diagonal line pattern, the other determined elements are shown in white, and the undetermined elements are shown in gray. In the case of an n×n symmetric matrix, tridiagonalization is completed with n-2 similarity transformations.
[0038] Continuing with the explanation, returning to FIG. 3, the processor 10 then calculates the eigenvalues (λ1, λ2, . . . , λ) of the tridiagonal matrix 232 shown as a solution 233. n ) and eigenvectors (x1,x2,...,x n ) is calculated (step S2).
[0039] Next, the processor 10 calculates the eigenvectors (x1, x2, . . . , x n ) and the eigenvectors (ν1,ν2, . . . ,ν n ) of the symmetric matrix 231 shown as a solution 234. n ) and the eigenvectors (ν1,ν2, ,ν n ) is obtained (step S3).
[0040] 1, the description will be continued. The memory 11 is a main storage device. The memory 11 is, for example, a dynamic random access memory (DRAM). The memory 11 is used by the processor 10 as a storage area for arithmetic processing, for example.
[0041] The storage device 12 is an auxiliary storage device, such as a hard disk or a solid state drive (SSD). The storage device 12 stores various programs for the processor 10 to execute arithmetic processing. The storage device 12 also stores data for the processor 10 to execute arithmetic processing. For example, the storage device 12 stores an eigenmatrix and a symmetric matrix for which eigenvalues are to be calculated by the standard eigenvalue problem.
[0042] Next, a description will be given of details of the calculation of the standard eigenvalue problem by the processor 10 according to the present embodiment. The processor 10 includes a calculation unit division unit 101, a dependency graph generation unit 102, a dependency determination unit 103, a calculation execution unit 104, and an output unit 105, as shown in FIG.
[0043] The computation unit division unit 101 has a generation rule for the computation unit designated in advance. The computation unit division unit 101 acquires a symmetric matrix to be used for calculating the standard eigenvalue problem from the storage device 12. Then, the computation unit division unit 101 divides the entire calculation of the standard eigenvalue problem into computation units based on the characteristics of the symmetric matrix, such as the number of rows and the number of columns, in accordance with the generation rule to generate the computation units. Thereafter, the computation unit division unit 101 outputs information on the generated computation units to the dependency graph generation unit 102.
[0044] Fig. 5 is a diagram illustrating an example of a dependency graph according to the embodiment 1. Fig. 5 illustrates an example of dependency relationships between tasks corresponding to computation units in the computation of the standard eigenvalue problem.
[0045] For example, the computation unit division unit 101 divides the Householder matrix H i The generation of is one computation unit. i represents the i-th column of the symmetric matrix, and H i represents the Householder matrix in the i-th column. Task #1-i in FIG. 4 represents the calculation unit for generating the Householder matrix Hi. Task #1-i is this calculation unit, and the Householder matrix H i Represents the process of generating
[0046] The computation unit division unit 101 divides the similarity transformation in the computation by DSYTRD among the computations of the standard eigenvalue problem into one computation unit. Task #2-i in FIG. 5 corresponds to this computation unit, and the Householder matrix H i This represents a process of performing a similarity transformation using
[0047] Furthermore, the computation unit division unit 101 sets the computation of eigenvalues and eigenvectors of a tridiagonal matrix by DSTEDC among the computations of the standard eigenvalue problem as one computation unit. Task #3 in FIG. 5 corresponds to this computation unit.
[0048] In addition, the calculation unit division unit 101 divides the Householder matrix H i The conversion of the Householder matrix H i represents the transformation of
[0049] Furthermore, the computation unit division unit 101 treats a matrix multiplication in a computation by DORMTR among the computations of the standard eigenvalue problem as one computation unit. Task #5 in FIG. 5 corresponds to this computation unit.
[0050] Returning to Fig. 1, the explanation will be continued. The dependency graph generating unit 102 receives an input of information on the computation units of the computation of the standard eigenvalue problem for a symmetric matrix from the computation unit dividing unit 101. Next, when a task executing a specific computation unit uses a result calculated by a task executing another computation unit as input information, the dependency graph generating unit 102 generates information indicating an input-output relationship of the computation results between tasks. For example, the dependency graph generating unit 102 places an arrow from the other computation unit that has output a result to the specific computation unit.
[0051] For example, in DSYTRD, the i-th column of the Householder matrix H i Once generated, the Householder matrix H i The similarity transformation is performed using the Householder matrix Hi is converted to a determinant by DORMTR. Therefore, the dependency graph generating unit 102 generates information indicating input-output relationships by arranging arrows from task #1-i to tasks #2-i and #4-i, as in dependency graph 240 in FIG.
[0052] The dependency graph generating unit 102 generates information indicating input-output relationships for all computation units. As a result, the dependency graph generating unit 102 generates, for example, dependency graph 240 shown in Fig. 5. Thereafter, the dependency graph generating unit 102 outputs the generated dependency graph to the dependency determining unit 103. Here, in this embodiment, the non-dependency relationship graph is expressed as a two-dimensional graph for ease of understanding, but the dependency graph may be information in another format as long as it is information from which information on input-output relationships between tasks can be obtained.
[0053] The dependency determination unit 103 receives an input of the dependency graph from the dependency graph generation unit 102. Next, a combination of tasks for which no dependency exists is extracted from the obtained dependency graph. Here, when a result output by a first task is directly or indirectly used in a calculation by another second task, or when a result output by a second task is directly or indirectly used in a calculation by a first task, it can be said that a dependency exists between the first task and the second task. After extracting a combination of tasks for which no dependency exists, the dependency determination unit 103 outputs information on each calculation unit and information on the combination of tasks for which no dependency exists to the calculation execution unit 104. Hereinafter, the details of the extraction of tasks for which no dependency exists will be described with reference to FIG. 5.
[0054] The dependency graph is a directed graph in which a direction exists for each input-output relationship, and will be described as an example with different tasks A and B existing in the dependency graph. If a path exists according to the direction of the input-output relationship from task A to task B, or from task B to task A, the dependency determination unit 103 determines that a dependency relationship exists between task A and task B. On the other hand, if a path exists according to the direction of the input-output relationship from task A to task B, or from task B to task A, the dependency determination unit 103 determines that a dependency relationship does not exist between task A and task B.
[0055] For example, between task #2-0 and task #4-0 in Fig. 5, there is no path from task #2-0 to task #4-0 and no path from task #4-0 to task #2-0 according to the direction of the input-output relationship. Therefore, the dependency determination unit 103 determines that there is no dependency relationship between task #2-0 and task #4-0. Similarly, between task #1-2 and task #4-1, there is no path that can be traced according to the direction of the input-output relationship, so the dependency determination unit 103 determines that there is no dependency relationship between task #1-2 and task #4-1.
[0056] On the other hand, between task #2-0 and task #4-2, there is no path from task #4-2 to task #2-0 according to the direction of the input-output relationship, but there is a path from task #2-0 to task #4-2. Therefore, the dependency relationship determination unit 103 determines that a dependency relationship exists between task #2-0 and task #4-2.
[0057] Returning to Fig. 1, the explanation will be continued. The calculation execution unit 104 has an asynchronous execution determination unit 140. The calculation execution unit 104 receives input of information on each calculation unit and information on a combination of tasks for which no dependency relationship exists from the dependency relationship determination unit 103. In addition, the calculation execution unit 104 obtains a symmetric matrix from the storage device 12.
[0058] Then, the calculation execution unit 104 starts executing the calculation of the standard eigenvalue problem, the outline of which is shown in Fig. 3, for the obtained symmetric matrix. In the calculation of the standard eigenvalue problem, the calculation execution unit 104 executes the calculation of each calculation unit asynchronously for tasks that do not have a dependency relationship. In contrast, for tasks that have a dependency relationship and do not support asynchronous calculation, the calculation execution unit 104 calls functions that sequentially calculate the calculation units of each task in a predetermined order, and processes them in order.
[0059] More specifically, after a certain task is completed, the asynchronous execution determination unit 140 of the calculation execution unit 104 extracts a task that has no dependency relationship from among the tasks that can be executed next after the task. Then, the asynchronous execution determination unit 140 determines whether the calculation speed increases when the specific task and the extracted task are executed asynchronously. If the calculation speed increases, the asynchronous execution determination unit 140 decides to execute the specific task and the extracted task asynchronously. Then, the calculation execution unit 104 executes each task according to the decision of the asynchronous execution determination unit 140.
[0060] 5, after the completion of task #1-i, there is no dependency between task #2-i and task #4-i, so the asynchronous execution determination unit 140 confirms that task #2-i and task #4-i can be executed asynchronously. Then, when the asynchronous execution determination unit 140 determines that task #2-i and task #4-i are executed asynchronously, the calculation execution unit 104 executes task #2-i and task #4-i asynchronously.
[0061] Here, the calculation execution unit 104 can use, for example, the task parallel function of OpenMP to calculate the calculation unit that can be calculated asynchronously. By using the task parallel function, the calculation execution unit 104 can assign tasked processing as threads and process them asynchronously. For example, since the processing of task #2-i and task #4-i is relatively heavy, it is preferable to perform them in thread parallel. Therefore, the calculation execution unit 104 processes the processing of task #2-i and task #4-i using #pragma omp taskloop. As a result, the thread assigned to task #2-i may be assigned to the processing of task #4-i after the calculation is completed, and vice versa. That is, the calculation execution unit 104 may be able to execute task #2-i and task #4-i asynchronously. This is expected to improve the efficiency of the processor 10.
[0062] When executing tasks asynchronously, various controls are performed according to the dependency relationships between the tasks. When the dependency relationships between tasks are defined, the execution of the tasks can be automated. For example, the computation execution unit 104 can automate the execution of tasks using the stream function or CUDA Graphs function in CUDA provided by NVIDIA. When using the stream function, the computation execution unit 104 prepares a queue called stream, and can execute tasks that do not have a dependency relationship asynchronously by putting tasks that do not have a dependency relationship into a different queue. In this case, tasks put into the same queue are considered to have a dependency relationship, and each task is executed in order. When using the CUDA Graphs function, the computation execution unit 104 executes the tasks after defining the dependency relationships between each task. At this time, tasks that do not have a dependency relationship are likely to be executed asynchronously, and tasks that have a dependency relationship are executed in an appropriate order.
[0063] Furthermore, for each task, if the amount of calculation of the calculation unit executed in that task is equal to or greater than a predetermined value, the calculation execution unit 104 executes the calculation of the calculation unit included in the task in multiple threads. Furthermore, for each task, if the amount of calculation of the calculation unit executed in that task is less than a predetermined value, the calculation execution unit 104 executes the calculation of the calculation unit included in the task in a single thread.
[0064] The calculation execution unit 104 completes the calculation of the eigenvalues and eigenvectors of the symmetric matrix by completing the execution of all tasks. Then, the calculation execution unit 104 notifies the output unit 105 of the calculated eigenvalues and eigenvectors of the symmetric matrix.
[0065] As described above, the calculation execution unit 104 according to this embodiment executes calculations for a plurality of calculation units, including a calculation unit obtained by dividing the calculation of the tridiagonalization of a symmetric matrix (DSYTRD), which is included in the calculation of the standard eigenvalue problem for a predetermined symmetric matrix, into a plurality of calculation units, based on the presence or absence of a dependency relationship between the first task and the second task.
[0066] The output unit 105 receives notification of the eigenvalues and eigenvectors of the symmetric matrix from the calculation execution unit 104. Then, the output unit 105 displays the notified eigenvalues and eigenvectors of the symmetric matrix on a display device or the like to present the calculation results to a user.
[0067] 6 is a flowchart of the calculation process of the standard eigenvalue problem by the processor according to the embodiment. Next, the flow of the calculation process of the standard eigenvalue problem by the processor 10 according to the embodiment will be described with reference to FIG.
[0068] The computation unit dividing unit 101 divides the computation of a standard eigenvalue problem for a symmetric matrix into computation units in accordance with a predetermined rule for generating computation units (step S101).
[0069] The dependency graph generating unit 102 generates information on input / output relationships between the computation units generated by the computation unit dividing unit 101, and generates a dependency graph (step S102).
[0070] The dependency determination unit 103 executes a dependency determination process for determining the dependency relationships between the tasks, using the dependency graph generated by the dependency graph generation unit 102 (step S103).
[0071] The calculation execution unit 104 executes the calculation of the standard eigenvalue problem for the symmetric matrix according to the decision by the asynchronous execution determination unit 140 as to whether or not to execute each task asynchronously in accordance with the dependency relationship between the tasks (step S104).
[0072] The output unit 105 outputs the eigenvalues and eigenvectors of the symmetric matrix calculated by the calculation execution unit 104 and provides them to the user (step S105).
[0073] Fig. 7 is a flowchart of the asynchronous execution possibility determination process. Each process shown in the flow of Fig. 7 is an example of the process executed in steps S103 and S104 of Fig. 6. However, in the flow of Fig. 7, each process is described by taking as an example a case where steps S103 and S104 are performed in parallel. Next, the flow of the asynchronous execution possibility determination process by the processor 10 according to this embodiment will be described with reference to Fig. 7. Here, the case will be described where the symmetric matrix is an n x n matrix and each task is numbered consecutively.
[0074] The dependency relationship determination unit 103 acquires the dependency relationship graph from the dependency relationship graph generation unit 102 (step S201).
[0075] Next, the dependency determination unit 103 sets i=0 and j=0 (step S202).
[0076] Next, the dependency relationship determination unit 103 determines whether or not a dependency relationship exists between task #i and task #j (step S203).
[0077] If a dependency exists between task #i and task #j (step S203: Yes), the asynchronous execution determination unit 140 determines that task #i and task #j are executable asynchronously (step S204).
[0078] On the other hand, if there is no dependency between task #i and task #j (step S203: No), the asynchronous execution determination unit 140 decides not to execute task #i and task #j asynchronously (step S205).
[0079] After that, the dependency determination unit 103 determines whether j=N-1 (step S206). If j≠N-1 (step S206: No), the dependency determination unit 103 increments j by 1 (step S207). After that, the asynchronous execution possibility determination process returns to step S203.
[0080] On the other hand, if j=N-1 (step S206: Yes), the dependency determination unit 103 determines whether i=N-1 (step S208). If i≠N-1 (step S208: No), the dependency determination unit 103 increments i by 1 (step S209). After that, the asynchronous execution possibility determination process returns to step S203.
[0081] On the other hand, if i=N-1 (step S208: Yes), the dependency determining unit 103 and the asynchronous execution determining unit 140 end the asynchronous execution possibility determining process.
[0082] Fig. 8 is a flowchart of the dependency relationship determination process. Each process shown in the flow of Fig. 8 corresponds to an example of the process executed in step S203 of Fig. 7. Next, the flow of the dependency relationship determination process by the processor 10 according to the present embodiment will be described with reference to Fig. 8.
[0083] The dependency relationship determination unit 103 uses the dependency relationship graph to determine whether or not a path exists that traces from task #i to task #j in accordance with the directions of the input-output relationships (step S301).
[0084] If a path from task #i to task #j does not exist (step S301: No), the dependency relationship determination unit 103 determines whether a path from task #j to task #i exists according to the directions of the input / output relationships (step S302).
[0085] If a path from task #i to task #j exists (step S301: Yes), the dependency determination unit 103 determines that a dependency relationship exists between task #i and task #j (step S303). If a path from task #j to task #i exists (step S302: Yes), the dependency determination unit 103 determines that a dependency relationship exists between task #i and task #j (step S303).
[0086] On the other hand, if there is no path from task #j to task #i (step S302: No), the dependency relationship determination unit 103 determines that there is no dependency relationship between task #i and task #j (step S304).
[0087] Fig. 9 is a flowchart of the asynchronous execution determination process. Each process shown in the flow of Fig. 9 corresponds to an example of the process executed in step S104 of Fig. 6. Next, the flow of the asynchronous execution determination process by the processor 10 according to this embodiment will be described with reference to Fig. 9. Here, the case will be described where the symmetric matrix is an n x n matrix and each task is numbered consecutively.
[0088] After the completion of the task set X, the asynchronous execution determination unit 140 acquires a task group that has no dependency relationship with the next executable task (step S401). Here, the number of next executable tasks is M, and the number of tasks included in the task group that has no dependency relationship with the next executable task is K.
[0089] Next, for task #i, which is the next executable task, the asynchronous execution determination unit 140 sets i = 0. In addition, for task #j, which is included in a task group that does not have a dependency relationship corresponding to task #i, the asynchronous execution determination unit 140 sets j = 0 (step S402).
[0090] Next, the asynchronous execution determination unit 140 determines whether or not the calculation speed increases when the task #i and the task #j are executed asynchronously (step S403).
[0091] If the calculation speed increases (step S403: Yes), the asynchronous execution determination unit 140 determines to execute task #i and task #j asynchronously (step S404).
[0092] On the other hand, if the calculation speed does not increase (step S403: No), the asynchronous execution determination unit 140 decides to execute task #i and task #j in sequence (step S405).
[0093] After that, the asynchronous execution determination unit 140 determines whether j=K-1 or not (step S406). If j≠K-1 (step S406: No), the asynchronous execution determination unit 140 increments j by 1 (step S407). After that, the asynchronous execution determination unit 140 returns to step S403.
[0094] On the other hand, if j=K-1 (step S406: Yes), the asynchronous execution determination unit 140 determines whether i=M-1 (step S408). If i≠M-1 (step S408: No), the asynchronous execution determination unit 140 increments i by 1 (step S409). After that, the asynchronous execution determination unit 140 returns to step S403.
[0095] On the other hand, if i=M-1 (step S408: Yes), the asynchronous execution determination unit 140 ends the asynchronous execution determination process.
[0096] FIG. 10 is a diagram of an example of a timeline comparing asynchronous execution of computation units and non-execution of computation units for the standard eigenvalue problem. In a normal case, as shown in graph 251, the processor 10 executes DSTEDC after completion of DSYTRD, and executes DORMTR after completion of DSTEDC. In contrast, when computation units are executed asynchronously, as shown in graph 252, for example, when a specific task of DSYTRD is completed, the processor 10 can process DSTEDC and DORMTR in parallel with DSYTRD. Comparing graphs 251 and 252, it is shown that the processing in graph 252 is completed earlier than the processing in graph 251. Here, in FIG. 6, it is described that each task is executed consecutively in the asynchronous execution of tasks, but for example, when each task has the dependency shown in FIG. 5, a synchronization wait may occur until a specific task is completed in DSYTRD, DSTEDC, and DORMTR.
[0097] 11 is a diagram illustrating a comparison of calculation speed between calculation of the standard eigenvalue problem by the processor according to the first embodiment and calculation without asynchronous execution of calculation units. In FIG. 11, the symmetric matrix is an n×n matrix, and cases where n=1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, and 12288 are described.
[0098] In this case, when the symmetric matrix becomes large enough to reach 12288 x 12288, the effect of asynchronous execution of computational units becomes apparent, and the processor 10 can speed up the calculation of the standard eigenvalue problem by about 30% compared to a computational method that does not perform asynchronous execution of computational units.
[0099] As described above, the processor, which is an arithmetic processing device according to this embodiment, divides the calculation of the standard eigenvalue problem for a symmetric matrix into calculation units according to a predetermined rule. Then, the processor treats each calculation unit as a task, and determines whether or not to execute the tasks asynchronously based on their dependency relationship, and calculates the standard eigenvalue problem for the symmetric matrix according to the decision. This allows tasks to be calculated individually in parallel during waiting times when the parallelism of the cores used is low, and allows the hiding of waiting times due to cache misses. Therefore, even when cache hits tend to be difficult, it is possible to improve and speed up calculation efficiency by the divide and conquer method, and it becomes possible to improve the calculation efficiency of the standard eigenvalue problem. EXAMPLES
[0100] Next, a second embodiment will be described. The processor according to the second embodiment divides DSTEDC, which is a function for solving a standard eigenvalue problem of a tridiagonal matrix in the calculation of the standard eigenvalue problem by a divide-and-conquer method, into a plurality of different types of calculation units, and performs the calculation asynchronously. The computer 1 according to the present embodiment is also shown in the block diagram of FIG. 1. In the following description, the description of the operation of each part similar to that of the first embodiment will be omitted.
[0101] Fig. 12 is a diagram illustrating an example of a dependency graph according to Example 2. Fig. 12 illustrates an example of dependency relationships between tasks corresponding to computation units in the computation of the standard eigenvalue problem.
[0102] The computation unit dividing unit 101 divides the computations in DSYTRD, DSTEDC and DORMTR into computation units as follows. In this embodiment, the dependency of the computation units is finally expressed by a dependency graph 301 shown in FIG. 12. Here, in this embodiment, the processor 10 divides a 16×16 tridiagonal matrix into a 2×2 matrix in the computation by DSYTRD. However, in reality, the processor 10 does not need to divide it into smaller pieces like 2×2, and it is preferable to change the matrix division size according to the architecture used.
[0103] For example, the computation unit division unit 101 sets the calculation of two-column tridiagonalization by DSYTRD among the calculations of the standard eigenvalue problem as one computation unit. Task #1-i in FIG. 12 represents a computation unit that performs two-column tridiagonalization for tridiagonalizing two columns from the i-th column. Task #1-i also includes similarity transformation. Here, since a matrix is divided into 2×2 units in DSTEDC, the computation unit division unit 101 sets tridiagonalization for every two columns in DSYTRD as a computation unit.
[0104] Furthermore, the computation unit division unit 101 regards each division step of the standard eigenvalue problem calculation up to division of the tridiagonal matrix by DSTEDC into a 2×2 matrix and the calculation of eigenvalues and eigenvectors as one computation unit. Task #2-i in Fig. 12 represents the computation unit for dividing the 2×2 matrix for two columns from the i-th column and calculating the eigenvalues and eigenvectors of the divided 2×2 matrix.
[0105] Furthermore, the computation unit division unit 101 groups together all of the computations of recursive integration of eigenvalues and eigenvectors repeated from the terminal 2×2 matrix by DSTEDC among the computations of the standard eigenvalue problem into one computation unit. Task #3 in Fig. 12 represents a computation unit that calculates the eigenvalues and eigenvectors of a tridiagonal matrix using the eigenvalues and eigenvectors of the eight divided 2×2 matrices.
[0106] Fig. 13 is a diagram showing the division of a matrix in DSTEDC. In this embodiment, the processor 10 repeatedly divides a tridiagonal matrix in half in DSTEDC as shown in the division state 302 in Fig. 13, and calculates the eigenvalues and eigenvectors of the sufficiently small matrix. The processor 10 can use a method with a low processing load other than the divide-and-conquer method such as the QR algorithm to calculate the eigenvalues and eigenvectors of the sufficiently small matrix. In addition, since the eigenvalues and eigenvectors of the sufficiently small matrix are not dependent on each other, the processor 10 can calculate the eigenvalues and eigenvectors of the matrix in parallel.
[0107] FIG. 14 is a diagram showing the recursive calculation of eigenvalues and eigenvectors of a matrix in DSTEDC. When the calculation of eigenvalues and eigenvectors of a matrix that has become sufficiently small is completed, the processor 10 calculates the eigenvalues and eigenvectors of the original matrix as shown in process 303 of FIG. 14. The processor 10 calculates the eigenvalues and eigenvectors of the original matrix by using the eigenvalues and eigenvectors of the two divided matrices. The processor 10 can calculate the eigenvalues and eigenvectors of the tridiagonal matrix before division by repeating this calculation in steps 311 to 313. In addition, since the calculation of the eigenvalues and eigenvectors of the original matrix is not dependent on another original matrix, the processor 10 can calculate the eigenvalues and eigenvectors of the original matrix in parallel. Furthermore, the calculation of the eigenvalues and eigenvectors of the original matrix can be performed using matrix multiplication, and the processor 10 can improve the calculation efficiency by using this calculation method.
[0108] The computation unit dividing unit 101 groups together all of the calculations of the recursive integration of eigenvalues and eigenvectors in stages 311 to 313 in Fig. 12 as one computation unit. It is known that the computation performance of the processor 10 is improved by batch processing the integration of eigenvalues and eigenvectors in each of stages 311 to 313. Therefore, the computation unit dividing unit 101 groups together the calculations of the recursive integration of eigenvalues and eigenvectors in each of stages 311 to 313 as one computation unit.
[0109] In addition, the computation unit division unit 101 divides the Householder matrix H i The conversion of the Householder matrix H i represents the computational unit for converting to matrix form.
[0110] Furthermore, the computation unit division unit 101 treats a matrix multiplication by DORMTR in the calculation of the standard eigenvalue problem as one computation unit. Task #5 in Fig. 12 represents this computation unit.
[0111] The dependency relationship determination unit 103 receives, for example, an input of a dependency relationship graph 301 in FIG.
[0112] In the dependency graph 301, between task #2-0 and task #4-0, there is neither a path that can be traced from task #2-0 to task #4-0 nor a path that can be traced from task #4-0 to task #2-0. Therefore, the dependency determination unit 103 determines that there is no dependency between task #2-0 and task #4-0. Similarly, there is also no path that can be traced in either direction between task #2-2 and task #4-2, so the dependency determination unit 103 determines that there is no dependency between task #2-2 and task #4-2.
[0113] On the other hand, between task #1-4 and task #4-8, there is no path from task #4-8 to task #1-4, but there is a path from task #1-4 to task #4-8. Therefore, the dependency determination unit 103 determines that a dependency relationship exists between task #1-4 and task #4-8.
[0114] The asynchronous execution determination unit 140 determines whether or not asynchronous calculation is possible using the dependency relationship notified by the dependency relationship determination unit 103. For example, in Fig. 12, after the completion of task #1-i, there is no dependency relationship between task #2-i and task #4-i, so the asynchronous execution determination unit 140 determines that task #2-i and task #4-i can be calculated asynchronously. Then, if the calculation efficiency is improved by performing the calculation asynchronously, the asynchronous execution determination unit 140 decides to execute task #2-i and task #4-i asynchronously.
[0115] The computation execution unit 104 computes the standard eigenvalue problem according to the presence or absence of dependency between tasks for a plurality of computation units including computation units into which the DSTEDC generated by the computation unit division unit 101 is divided. That is, the computation execution unit 104 executes computations based on the presence or absence of dependency between a first task and a second task for a plurality of computation units including computation units into which the calculation of eigenvalues and eigenvectors for a tridiagonal matrix obtained by tridiagonalizing a symmetric matrix is divided into a plurality of computation units.
[0116] The calculation execution unit 104 performs calculations for calculation units that can be executed asynchronously using the task parallel function of OpenMP. Here, since the processing of task #2-i is relatively light, the calculation execution unit 104 may process task #2-i with one thread. On the other hand, since the processing of task #4-i is relatively heavy, it is preferable that the calculation execution unit 104 processes task #4-i with multiple threads. Therefore, the calculation execution unit 104 executes the processing of task #2-i using #pragma omp task, and executes the processing of task #4-i using #pragma omp taskloop. Thereby, after the calculation of the thread assigned to task #2-i is completed, the calculation execution unit 104 may assign that thread to the processing of task #4-i, and the calculation efficiency of the processor 10 can be improved.
[0117] 15 is a diagram illustrating a comparison of the calculation speed between the calculation of the standard eigenvalue problem by the processor according to the embodiment 2 and the calculation in the case where the asynchronous execution of the calculation unit is not performed. In FIG. 11, the symmetric matrix is an n×n matrix, and the cases where n=1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, and 9216 are described.
[0118] In this case, when the matrix size becomes sufficiently large and the degree of parallelism becomes sufficiently large, a large number of cores can be fully used, and it can be seen that the effect of the calculation by the processor 10 according to this embodiment is exerted. As another example not shown in Fig. 15, in the calculation of the eigenvalues and eigenvectors of a 10240 x 10240 symmetric matrix, the processor 10 can speed up the calculation of the standard eigenvalue problem by about 20% compared to a calculation method that does not execute the calculation units asynchronously.
[0119] As described above, the processor, which is the arithmetic processing device according to this embodiment, regards the division of the tridiagonal matrix into 2×2 matrices by DSTEDC and the calculation of eigenvalues and eigenvectors as one calculation unit in the calculation of the standard eigenvalue problem. In addition, the processor regards the entire calculation of the recursive integration of eigenvalues and eigenvectors repeated from the terminal 2×2 matrix by DSTEDC as one calculation unit in the calculation of the standard eigenvalue problem. Then, the processor determines whether to execute each calculation unit asynchronously based on the dependency relationship between the tasks, and calculates the standard eigenvalue problem of the symmetric matrix according to the decision. As a result, in DSTEDC, when the matrix size becomes sufficiently large and the degree of parallelism becomes sufficiently large, a large number of cores can be fully used. Therefore, it is possible to improve the calculation efficiency of the standard eigenvalue problem. EXAMPLES
[0120] Next, a third embodiment will be described. The processor according to the second embodiment is different from the first and second embodiments in the calculation unit for dividing and generating DSTEDC and DORMTR in the calculation of the standard eigenvalue problem. The computer 1 according to the present embodiment is also shown in the block diagram of Fig. 1. In the following description, the operation of each part similar to that of the first embodiment will be omitted.
[0121] Fig. 16 is a diagram illustrating an example of a dependency graph according to Example 3. Fig. 16 illustrates an example of dependency relationships between tasks corresponding to computation units in the computation of the standard eigenvalue problem.
[0122] The computation unit dividing unit 101 divides the computations in DSYTRD, DSTEDC, and DORMTR into computation units as follows. In this embodiment, the dependency of the computation units is finally expressed by a dependency graph 401 shown in FIG. 16. Here, in this embodiment, the processor 10 divides a 16×16 tridiagonal matrix into a 2×2 matrix in the computation by DSYTRD. However, in reality, the processor 10 does not need to divide it into as small as 2×2, and it is preferable to change the matrix division size according to the architecture used.
[0123] For example, the computation unit division unit 101 sets the calculation of two-column tridiagonalization by DSYTRD among the calculations of the standard eigenvalue problem as one computation unit. Task #1-i in FIG. 16 represents a computation unit that performs two-column tridiagonalization for tridiagonalizing two columns from the i-th column. Task #1-i also includes similarity transformation. Here, since a matrix is divided into 2×2 units in DSTEDC, the computation unit division unit 101 sets tridiagonalization for every two columns in DSYTRD as a computation unit.
[0124] Furthermore, the computation unit division unit 101 regards each division step of the standard eigenvalue problem calculation up to division of the tridiagonal matrix by DSTEDC into a 2×2 matrix and the calculation of eigenvalues and eigenvectors as one computation unit. Task #2-i in Fig. 16 represents a computation unit for dividing the 2×2 matrix for two columns from the i-th column and calculating the eigenvalues and eigenvectors of the divided 2×2 matrix. Here, the tridiagonalization is performed by determining the values from the upper left element, but the 2×2 matrix to be divided can be obtained using only the determined elements.
[0125] Furthermore, the computation unit division unit 101 regards the calculation of integrating eigenvalues and eigenvectors of a 2×2 matrix by DSTEDC among the calculations of the standard eigenvalue problem as one computation unit. Task #3-i in Fig. 16 is the computation unit for integrating eigenvalues and eigenvectors of the i-th and (i+1)-th matrices when 2×2 matrices are arranged in correspondence with the original tridiagonal matrix and sequential numbers are assigned from the top row.
[0126] Furthermore, the computation unit division unit 101 regards the calculation of integrating eigenvalues and eigenvectors of a 4×4 matrix by DSTEDC among the calculations of the standard eigenvalue problem as one computation unit. Task #4-i in Fig. 16 is the computation unit for integrating eigenvalues and eigenvectors of the i-th and (i+1)-th matrices when 4×4 matrices are arranged in correspondence with the original tridiagonal matrix and sequential numbers are assigned from the top row.
[0127] Furthermore, the computation unit division unit 101 regards the computation of integrating eigenvalues and eigenvectors of an 8×8 matrix by DSTEDC among the computations of the standard eigenvalue problem as one computation unit. Task #5-i in Fig. 16 is the computation unit for integrating eigenvalues and eigenvectors of the i-th and (i+1)-th matrices when 8×8 matrices are arranged in correspondence with the original tridiagonal matrix and sequential numbers are assigned from the top row.
[0128] In addition, the computation unit division unit 101 regards the computation of the triangular matrix part of the transformation used in task #1-i by DORMTR among the computations of the standard eigenvalue problem as one computation unit. FIG. 17 is a diagram showing an outline of computation by DORMTR according to the third embodiment. The Householder matrix used in tridiagonalization has a format called compact WY representation, and a plurality of them may be applied together. In this embodiment, the processor 10 applies two Householder transformations together during tridiagonalization, as shown in computation 403 in FIG. 17. In the case of FIG. 17, the eigenvectors of the tridiagonal matrix are obtained by seven computations 403. In this computation 403, a triangular matrix 402 is used when applying two Householder transformations together. Therefore, when performing the inverse transformation of the eigenvector, the processor 10 calculates a 2×2 triangular matrix 402. Task #6-i in FIG. 16 is the computation unit for performing this computation, that is, the computation unit for performing the computation of the triangular matrix part of the transformation used in task #1-i.
[0129] Furthermore, the computation unit dividing section 101 regards the computation of the inverse transformation of the eigenvectors of a tridiagonal matrix by DORMTR, among the computations of the standard eigenvalue problem, as one computation unit. Task #7 in Fig. 17 represents this computation unit.
[0130] 17 notified by the dependency relationship determination unit 103, the asynchronous execution determination unit 140 determines whether or not asynchronous calculation between tasks is possible, and determines which tasks are to be processed asynchronously. Then, the calculation execution unit 104 executes the calculation of the standard eigenvalue problem according to the determination by the asynchronous execution determination unit 140.
[0131] In this way, the computation execution unit 104 calculates the standard eigenvalue problem according to the presence or absence of dependency between tasks for a plurality of computation units including the computation units into which DSTEDC and DORMTR generated by the computation unit division unit 101 are divided. That is, the computation execution unit 104 executes calculations based on the presence or absence of dependency between the first task and the second task for a number of computation units including a computation unit that calculates a triangular matrix used in the inverse transformation of an eigenvector of a tridiagonal matrix.
[0132] The processor according to the present embodiment can control tasks very flexibly, and in an environment where BLAS or LAPACK can be executed with high performance, it is possible to increase the number of tasks executed asynchronously and to increase the thread parallelism of each task, thereby enabling the processor to improve the calculation performance of the standard eigenvalue problem. [Explanation of symbols]
[0133] 1 calculator 10 Processors 11. Memory 12 Storage device 101 Computation unit division unit 102 Dependency graph generator 103 Dependency Determination Unit 104 Calculation Execution Unit 105 Output section 140 Asynchronous execution determination unit
Claims
1. a calculation execution unit for dividing a calculation of a standard eigenvalue problem for a predetermined symmetric matrix to generate a plurality of calculation units each performing a different calculation, and for a first task and a second task among a plurality of tasks executed by each of the calculation units, if there is no dependency between the first task and the second task in which one of the tasks performs a calculation based on the result of the other task, and for a first task and a second task being calculated asynchronously, if there is a dependency between the first task and the second task, the first task and the second task are calculated sequentially; an output unit that outputs a calculation result of a standard eigenvalue problem for the predetermined symmetric matrix calculated by the calculation execution unit; A processing device comprising:
2. 2. The processor according to claim 1, wherein the calculation execution unit executes the calculation of the calculation unit in multiple threads when the calculation amount of the calculation unit to be executed is equal to or greater than a predetermined value for each of the first task and the second task.
3. a dependency graph generating unit that generates a dependency graph showing an input / output relationship of a result of the calculation between the plurality of tasks, The computation execution unit includes a dependency determination unit that determines whether or not a dependency relationship exists between the first task and the second task based on the dependency graph generated by the dependency graph generation unit. The processor according to claim 1 .
4. 2. The processing device according to claim 1, wherein the calculation execution unit executes calculations for the plurality of calculation units including a calculation of tridiagonalization of a symmetric matrix included in the calculation of a standard eigenvalue problem for the predetermined symmetric matrix, based on the presence or absence of a dependency relationship between the first task and the second task.
5. 2. The processing device according to claim 1, wherein the calculation execution unit executes calculations based on the presence or absence of a dependency relationship between the first task and the second task for the plurality of calculation units including calculation units obtained by dividing into a plurality of calculations of eigenvalues and eigenvectors for a tridiagonal matrix obtained by tridiagonalizing a symmetric matrix included in a calculation of a standard eigenvalue problem for the predetermined symmetric matrix.
6. 6. The processing device according to claim 5, wherein the calculation execution unit executes calculations for the plurality of calculation units including a calculation unit that calculates a triangular matrix used in an inverse transformation of an eigenvector of the tridiagonal matrix, based on the presence or absence of a dependency relationship between the first task and the second task.
7. For a plurality of computational units each performing a different computation, the computation of a standard eigenvalue problem for a given symmetric matrix is divided, When there is no dependency between a first task and a second task among a plurality of tasks executed by each of the computation units such that one of the tasks performs a computation based on the result of the other task, the first task and the second task are computed asynchronously; If the dependency relationship exists between the first task and the second task, the first task and the second task are sequentially calculated. A computation method comprising: causing a processor to execute a process.
Citation Information
Patent Citations
Heterogeneous Scheduling for Sequential Computational DAGs
JP2022500755A
