Method and device for recommending parameters of solver and computer equipment

By obtaining the target feature data of the sparse matrix and inputting the trained recommendation model, the parameter values ​​of the recommended solver are personalized, solving the problems of low solver parameter setting efficiency and poor performance in the existing technology, and realizing efficient linear equations. Group solving and performance improvements.

CN119322909APending Publication Date: 2025-01-17HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411306667.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

In scientific and engineering calculations, when solving large sparse linear equations, it is difficult for the existing technology to effectively set solver parameters, resulting in low resolution efficiency and poor performance, especially when facing unknown fields, it takes a lot of time to learn and adjust parameters.

Method used

By obtaining the target feature data of the sparse matrix of the linear equation to be solved, inputting the name of the solver and these feature data into the trained recommended models corresponding to different processes, the recommended parameter values ​​of the solver under each process are obtained.

Benefits of technology

This method can personalize the recommended parameter values ​​of the solver based on the target feature data of the sparse matrix, improve the performance of the solver and the efficiency of solving linear equations, and at the same time save the cost of learning matrix properties in different fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322909A_ABST
    Figure CN119322909A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for recommending parameters of a solver, computer equipment, a storage medium and a computer program product. The method comprises the steps of obtaining a sparse matrix of a to-be-solved linear equation and a solver; obtaining target feature data of the sparse matrix; and inputting the name of the solver and the target feature data into trained recommendation models corresponding to different processes to obtain recommendation parameter values of the solver under each process. According to the method, the parameter values of the solver can be recommended in a personalized manner according to the target feature data of the sparse matrix, on one hand, the performance of the solver can be improved, on the other hand, the solving efficiency of the linear equation set is greatly improved, and meanwhile, the matrix property learning cost of solving personnel in different fields is also saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence, computational mathematics and scientific data technology, and in particular to a method, apparatus, computer device, storage medium and computer program product for recommending solver parameters. Background Art

[0002] Many numerical simulations in scientific and engineering computing require solving large sparse linear equations Ax = b. Solving this equation efficiently and accurately is one of the core issues in the field of scientific computing.

[0003] In the process of solving, experts in this field are required to give specific parameter values ​​based on past experience. When faced with an unfamiliar field, it often takes a lot of time to learn and give parameter values ​​or use default parameter values. This is not only time-consuming, but also usually fails to achieve the maximum performance of the solver. Summary of the invention

[0004] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium and computer program product for recommending solver parameters to improve solution efficiency and solver performance in order to address the above technical problems.

[0005] In a first aspect, the present application provides a method for recommending solver parameters. The method comprises:

[0006] Get the sparse matrix of the linear equation to be solved and the solver;

[0007] Obtaining target feature data of the sparse matrix;

[0008] The name of the solver and the target feature data are input into the trained recommendation models corresponding to different processes to obtain the recommended parameter values ​​of the solver in each process.

[0009] In one embodiment, obtaining target feature data of the sparse matrix includes:

[0010] Calculate the characteristic data of the sparse matrix, and screen the characteristic data to obtain target characteristic data, wherein the target characteristic data includes at least one of the number of columns, the number of non-zero elements, the ratio of non-zero elements, the number of non-zero elements in the upper triangle, the number of non-zero elements in the lower triangle, the number of non-zero elements on the diagonal, the average number of non-zero elements per row, the maximum number of non-zero elements per row, the maximum non-zero element, diagonal dominance, the maximum non-zero element on the diagonal, whether it is symmetrical, the ratio of graph symmetry, the ratio of value symmetry, the row variance, and the column variance.

[0011] In one embodiment, the screening of the feature data to obtain target feature data includes:

[0012] Dividing the feature data into numerical features and categorical features;

[0013] Calculating the variance of each of the numerical features, deleting the numerical features whose variance is less than a first threshold, and obtaining valid numerical features;

[0014] Calculating the correlation coefficient of the classification features, and obtaining the classification features whose correlation coefficient is greater than a second threshold as valid classification features;

[0015] Target feature data is obtained according to the valid numerical features and the valid categorical features.

[0016] In one embodiment, obtaining target feature data according to the valid numerical feature and the valid categorical feature includes:

[0017] Obtaining valid feature data according to the valid numerical features and the valid categorical features;

[0018] Based on the ant colony algorithm, target feature data is screened out from the valid feature data.

[0019] In one embodiment, the method for training the recommendation model includes:

[0020] Acquire a training data set, wherein the training data set includes characteristic data of a sparse matrix of a thread equation and optimal parameters of a solver of a linear equation under different processes;

[0021] Using the training data set and the decision tree model, the solver is trained in different processes to obtain a corresponding recommendation model.

[0022] In one embodiment, obtaining a training data set includes:

[0023] Obtaining a training set matrix and characteristic data of each matrix in the training set matrix;

[0024] Obtain the optimal parameters of the solver under different processes corresponding to solving linear equations using all possible solution combinations of different parameters in single-process and multi-process environments;

[0025] The training data set is obtained according to the characteristic data, the solver and the optimal parameters under different processes.

[0026] In a second aspect, the present application also provides a device for recommending solver parameters. The device comprises:

[0027] A recommended information acquisition module is used to obtain a sparse matrix of a linear equation to be solved and a solver;

[0028] A feature extraction module, used to obtain target feature data of the sparse matrix;

[0029] The recommendation module is used to input the name of the solver and the target feature data into the trained recommendation model corresponding to different processes to obtain the recommended parameter value of the solver under each process.

[0030] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for recommending solver parameters in the above-mentioned embodiments are implemented.

[0031] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for recommending solver parameters in each of the above embodiments.

[0032] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method for recommending solver parameters in the above-mentioned embodiments are implemented.

[0033] The method, device, computer equipment, storage medium and computer program product for recommending solver parameters obtain a sparse matrix of a linear equation to be solved, and a solver; obtain target feature data of the sparse matrix; input the name of the solver and the feature data into a trained recommendation model corresponding to different processes, and obtain the recommended parameter values ​​of the solver under each process. The method can recommend solver parameter values ​​in a personalized manner based on the target feature data of the sparse matrix. On the one hand, it can improve the performance of the solver, and on the other hand, it greatly improves the efficiency of solving linear equations, while also saving the solver's learning cost of matrix properties in different fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic flow chart of a method for recommending solver parameters in one embodiment;

[0035] Figure 2 A structural block diagram of a device for recommending solver parameters in an embodiment;

[0036] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0038] The transportation route planning method for large-scale transportation vehicles provided in the embodiment of the present application can be applied to terminal devices. Through the terminal device, the user inputs the sparse matrix of the linear equation to be solved and the solver, and the terminal device obtains the sparse matrix of the linear equation to be solved and the solver; obtains the target feature data of the sparse matrix; inputs the name of the solver and the feature data into the recommended model corresponding to the trained different processes, and obtains the recommended parameter values ​​of the solver under each process. This method greatly improves the efficiency of solving the linear equation system, and also saves the cost of learning the matrix properties in different fields for the solvers.

[0039] The terminal equipment includes but is not limited to computer equipment.

[0040] In one embodiment, Figure 1 As shown, a method for recommending solver parameters is provided. Taking the method applied to a smart terminal as an example, the method includes the following steps:

[0041] Step 102, obtaining a sparse matrix of the linear equation to be solved and a solver.

[0042] Specifically, a sparse matrix of a linear equation to be solved input by a user and the name of a solver to be recommended are obtained.

[0043] Step 104, obtaining target feature data of the sparse matrix.

[0044] Specifically, a sparse matrix file input by a user is obtained, and the eigenvalues ​​of the matrix are calculated by anamod software and a custom program to obtain target feature data, wherein the target feature data include: number of columns, number of non-zero elements, ratio of non-zero elements, number of non-zero elements in the upper triangle, number of non-zero elements in the lower triangle, number of non-zero elements on the diagonal, average number of non-zero elements per row, maximum number of non-zero elements per row, maximum non-zero element, diagonal dominance, maximum non-zero element on the diagonal, whether it is symmetrical, graph symmetry ratio, value symmetry ratio, row variance, and column variance.

[0045] Step 106: Input the name of the solver and the target feature data into the trained recommendation model corresponding to different processes to obtain the recommended parameter value of the solver in each process.

[0046] The performance of the solver will change greatly under different numbers of processes, and there are few studies on linear equation solving under multiple processes. In this embodiment, a recommendation model of the parameters of the solver corresponding to different processes is pre-trained, and the sentence and target feature data of the solver are input into the trained recommendation model corresponding to different processes to obtain the recommended parameter values ​​of the solver under each process. In this way, the optimal parameter value corresponding to the solver under each process can be obtained.

[0047] In one embodiment, the process number input by the user may also be obtained to determine whether there is a pre-trained recommendation model corresponding to the process number. If not, the recommendation model is not called for recommendation.

[0048] In one embodiment, the prediction process can set the number of processes to 1, 64, 96, or 108 according to the needs of the actual project, and the model uses a decision tree. Specifically, the parameters of the decision tree model are selected as follows: criterion = gini, splitter = best, and max_depth = none. In a single-process environment, the effective combination of solvers cg, icc, and ilu is tested, and in a multi-process environment, MPI is used to test solvers asm, dgmres, fcg, fgmres, gamg, gmres, Jacobi, and sor. During runtime, the number of processes is specified by the instruction mpirun-np num, the solution accuracy is specified by -rtol, and the maximum number of iterations is specified by -num_iters. The name of the solver and the target feature data are input into the recommended model corresponding to the trained different processes to obtain the recommended parameter values ​​of the solver under each process.

[0049] The above method for recommending solver parameters obtains a sparse matrix of a linear equation to be solved and a solver; obtains target feature data of the sparse matrix; inputs the name of the solver and the feature data into a trained recommendation model corresponding to different processes to obtain the recommended parameter values ​​of the solver under each process. This method can recommend solver parameter values ​​in a personalized manner based on the target feature data of the sparse matrix. On the one hand, it can improve the performance of the solver. On the other hand, it greatly improves the efficiency of solving linear equations, while also saving the solver's learning cost of matrix properties in different fields.

[0050] In another embodiment, obtaining target feature data of the sparse matrix includes: calculating feature data of the sparse matrix, and screening the feature data to obtain target feature data, wherein the target feature data includes at least one of the number of columns, non-zero element number, non-zero element ratio, upper triangular non-zero element number, lower triangular non-zero element number, diagonal non-zero element number, average non-zero element number per row, maximum non-zero element number per row, maximum non-zero element, diagonal dominance, maximum non-zero element on the diagonal, symmetry, graph symmetry ratio, value symmetry ratio, row variance, and column variance.

[0051] Among them, the feature data is screened to remove features that have little impact on model prediction to reduce the time complexity of calculation.

[0052] In another embodiment, the screening of the feature data to obtain target feature data includes: dividing the feature data into numerical features and categorical features; calculating the variance of each of the numerical features, deleting the numerical features whose variance is less than a first threshold, and obtaining valid numerical features; calculating the correlation coefficient of the categorical features, and obtaining valid categorical features from the categorical features whose correlation coefficient is greater than a second threshold; and obtaining target feature data based on the valid numerical features and the valid categorical features.

[0053] Specifically, feature data can be divided into numerical features and categorical features. The variance of each numerical feature can be calculated. If the variance is small, it means that the feature value does not change much. These features with small variances are removed to obtain valid numerical features. For categorical features, the correlation coefficient can be used to reflect the relationship between two features. The larger the coefficient value, the stronger the correlation between the two features. Among the features with a larger correlation coefficient, a feature with the smallest time complexity can be selected to train the model. Specifically, the threshold of the correlation coefficient is set to 0.7, and features with coefficient values ​​higher than the threshold will be screened to obtain valid categorical features.

[0054] Valid feature data is obtained according to the valid numerical features and the valid categorical features.

[0055] In one embodiment, for the effective feature data, target feature data can be further screened out according to the ant colony algorithm. This step includes:

[0056] Step 1: Initialize the ant colony size, pheromone factor, pheromone, maximum number of iterations, etc.

[0057] Step 2: Randomly place ants at different points, where each point represents a specific feature.

[0058] Step 3: Calculate the next access feature for each ant until all features in the pheromone table have been visited by ants.

[0059] Step 4: Calculate the access features of each ant and record the optimal set of the current iteration number.

[0060] Step 5: Train the decision tree model based on the current feature set and use the model's prediction accuracy to update the pheromone concentration.

[0061] Step 6: Determine whether the maximum number of iterations has been reached. If not, return to step 2; if reached, proceed to step 7.

[0062] Step 7: Output target feature data.

[0063] In another embodiment, a method for training the recommendation model includes: obtaining a training data set, wherein the training data set includes characteristic data of a sparse matrix of a linear equation and optimal parameters of a solver of a linear equation under different processes; using the training data set and a decision tree model, training the solver under different processes to obtain a corresponding recommendation model.

[0064] Specifically, a training data set is obtained by pre-training, and the training data set includes characteristic data of the sparse matrix of the thread equation and optimal parameters of the solver of the linear equation under different processes. The characteristic data of the sparse matrix of the thread equation is the training data, and the optimal parameters of the solver under different processes are the label set. Then, a decision tree model is used for training based on the training data set, and a model is trained for each solvable solver under different processes.

[0065] Specifically, the method of obtaining a training data set includes: obtaining a training set matrix and characteristic data of each matrix in the training set matrix; obtaining solution combinations of all different solvable parameters in a single-process and multi-process environment to solve the optimal parameters of the solver under different processes corresponding to the linear equation; and obtaining the training data set based on the characteristic data, the solver and the optimal parameters under different processes.

[0066] Specifically, the finite element software FreeFem is used to solve partial differential equations to generate training set matrices, and the anamod software is used to customize the program and solve the characteristic data of the matrix. The petsc software is used to solve a large number of linear equations in a single-process and multi-process environment using all solvable different parameter solution combinations to obtain the optimal solver parameters under different processes corresponding to each linear equation group.

[0067] In one embodiment, obtaining a training data set may include the following steps:

[0068] Step 1, use the finite element-based software FreeFem to solve partial differential equations and derive the temporary matrix generated during the solution process. Specifically, in different fields such as fluid mechanics, structural mechanics, shallow water equations, Poisson's equations, Laplace equations in three-dimensional space, circuit theory, quantum mechanics, etc. And download some public data sets such as suitesparse matrix sets as original matrix sets.

[0069] Step 2: For the matrix obtained in step 1, solvers asm, dgmres, fcg, fgmres, gamg, gmres, Jacobi, sor and their corresponding valid combinations with different parameter values ​​are used in the software petsc in a multi-process environment with 64, 96, and 108 processes. Solvers cg, ilu, and icc are used in a single process.

[0070] Step 3, select the solver parameters. For the solver asm, select the parameter pc_asm_overlap, and the parameter values ​​are 0, 1, and 2. For cg, select the parameter ksp_cg_single_reduction, and the parameter values ​​are true and false. For dgmres, select the parameter ksp_gmres_restart, and the parameter values ​​are 5, 30, and 60. For Jacobi, select the parameters pc_jacobi_type and pc_jacobi_abs, and the parameter values ​​are diagonal, rowmax, rowsum, true, and false respectively. For sor, select the parameter pc_sor_omega, and the parameter values ​​are 0.5, 1, and 1.5.

[0071] Step 4: For the selected solver parameter values, select a valid solution combination to solve the matrix. First, solve all valid combinations of all matrices to obtain all valid combinations, and then select the solver combination containing the parameters to be predicted from the valid combinations. The specific solution combinations are cr_eisenstat, minres_gamg, fbcgs_ilu, fbcgs_jacobi, dgmres_none, fgmres_gamg, bcgsl_none, cg_eisenstat, gmres_gamg, cgs_gamg, cg_ilu, symmlq_icc, cr_ilu, cr_jacobi, fcg_gamg, symmlq_sor, symmlq_jacobi, cg_bjacobi, bcgsl_asm.

[0072] Step 5: According to the effective solver combination, solver parameters and multi-process environment parameters, the matrix is ​​solved using petsc, and the solution accuracy is set to 1e-6 and the maximum number of iterations is 1000. The solution result can obtain the matrix solution time, number of iterations, etc.

[0073] Step 6: Create a label set based on the solution results. For the converged solution combination, select the parameter value with the shortest solution time as the optimal parameter and use onehot encoding to create a label. Collect the parameter solution time within the fluctuation range of 10% of the shortest solution time, and use the parameter value corresponding to this time as the validation set for verification.

[0074] The method of recommending solver parameters in this application has the following effects:

[0075] 1. It can recommend the solver parameter values ​​in a personalized way according to the target feature data of the sparse matrix, thus improving the accuracy of the solver parameter setting and thus improving the solver performance.

[0076] 2. Which parameters of the matrix should be considered to accurately predict the solver parameters.

[0077] 3. Predict the parameters of the solver under different conditions.

[0078] Traditional technology requires experts in this field to give specific parameter values ​​based on past experience. When faced with an unknown field, it often takes a lot of time to learn and give parameter values ​​or use default parameter values. This is not only time-consuming, but also usually cannot achieve the maximum performance of the solver. The method of the present application can achieve accurate setting of solver parameters. This can greatly improve the efficiency of solving linear equations, and also save the cost of learning matrix properties in different fields for solvers. Furthermore, it is also possible to make recommendations on the choice of solver for linear equations based on the data generated during the solution process, thereby minimizing the time it takes to solve the equation.

[0079] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0080] Based on the same inventive concept, the embodiment of the present application also provides a device for implementing the method for recommending solver parameters involved in the above-mentioned method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations of the device embodiments for recommending solver parameters provided below can refer to the limitations of the method for recommending solver parameters above, and will not be repeated here.

[0081] In one embodiment, Figure 2 As shown, a device for recommending parameters of a solver is provided, comprising:

[0082] The recommended information acquisition module 702 is used to obtain a sparse matrix of a linear equation to be solved and a solver;

[0083] A feature extraction module 704 is used to obtain target feature data of the sparse matrix;

[0084] The recommendation module 706 is used to input the name of the solver and the characteristic data into the trained recommendation model corresponding to different processes to obtain the recommended parameter value of the solver in each process.

[0085] In another embodiment, a feature extraction module is used to calculate the feature data of the sparse matrix and screen the feature data to obtain target feature data, wherein the target feature data includes at least one of the number of columns, non-zero element number, non-zero element ratio, upper triangular non-zero element number, lower triangular non-zero element number, diagonal non-zero element number, average non-zero element number per row, maximum non-zero element number per row, maximum non-zero element, diagonal dominance, maximum non-zero element on the diagonal, symmetry, graph symmetry ratio, value symmetry ratio, row variance and column variance.

[0086] In another embodiment, the feature extraction module is further used to divide the feature data into numerical features and categorical features;

[0087] The variance of each of the numerical features is calculated, and the numerical features whose variance is less than a first threshold are deleted to obtain valid numerical features; the correlation coefficient of the categorical features is calculated, and the categorical features whose correlation coefficient is greater than a second threshold are obtained to obtain valid categorical features; and the target feature data is obtained according to the valid numerical features and the valid categorical features.

[0088] In another embodiment, the feature extraction module is further used to obtain valid feature data according to the valid numerical features and the valid categorical features; and to filter out target feature data from the valid feature data based on an ant colony algorithm.

[0089] In another embodiment, a training module is also included for obtaining a training data set, wherein the training data set includes characteristic data of a sparse matrix of a thread equation and optimal parameters of a solver of a linear equation under different processes; using the training data set and a decision tree model, the solver is trained under different processes to obtain a corresponding recommendation model.

[0090] In another embodiment, a training module is used to obtain a training set matrix and characteristic data of each matrix in the training set matrix; obtain solution combinations using all solvable different parameters in a single-process and multi-process environment to solve the optimal parameters of the solver under different processes corresponding to the linear equation; and obtain the training data set based on the characteristic data, the solver and the optimal parameters under different processes.

[0091] Each module in the apparatus for recommending solver parameters can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0092] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, the steps of a method for recommending parameters of a solver are implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0093] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0094] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the method for recommending solver parameters in the above embodiments when executing the computer program.

[0095] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for recommending solver parameters in the above embodiments are implemented.

[0096] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the method for recommending solver parameters of the above embodiments.

[0097] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processors involved in each embodiment provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., but are not limited thereto.

[0098] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0099] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for recommending solver parameters, characterized in that: The method comprises: Get the sparse matrix of the linear equation to be solved and the solver; Obtaining target feature data of the sparse matrix; The name of the solver and the target feature data are input into the trained recommendation models corresponding to different processes to obtain the recommended parameter values ​​of the solver in each process.

2. The method according to claim 1, characterized in that Obtaining target feature data of the sparse matrix includes: Calculate the characteristic data of the sparse matrix, and screen the characteristic data to obtain target characteristic data, wherein the target characteristic data includes at least one of the number of columns, the number of non-zero elements, the ratio of non-zero elements, the number of non-zero elements in the upper triangle, the number of non-zero elements in the lower triangle, the number of non-zero elements on the diagonal, the average number of non-zero elements per row, the maximum number of non-zero elements per row, the maximum non-zero element, diagonal dominance, the maximum non-zero element on the diagonal, whether it is symmetrical, the ratio of graph symmetry, the ratio of value symmetry, the row variance, and the column variance.

3. The method according to claim 2, characterized in that The step of screening the characteristic data to obtain target characteristic data includes: Dividing the feature data into numerical features and categorical features; Calculating the variance of each of the numerical features, deleting the numerical features whose variance is less than a first threshold, and obtaining valid numerical features; Calculating the correlation coefficient of the classification features, and obtaining the classification features whose correlation coefficient is greater than a second threshold as valid classification features; Target feature data is obtained according to the valid numerical features and the valid categorical features.

4. The method according to claim 3, characterized in that The obtaining target feature data according to the valid numerical feature and the valid categorical feature includes: Obtaining valid feature data according to the valid numerical features and the valid categorical features; Based on the ant colony algorithm, target feature data is screened out from the valid feature data.

5. The method according to claim 1, characterized in that The method for training the recommendation model comprises: Acquire a training data set, wherein the training data set includes characteristic data of a sparse matrix of a thread equation and optimal parameters of a solver of a linear equation under different processes; Using the training data set and the decision tree model, the solver is trained in different processes to obtain a corresponding recommendation model.

6. The method according to claim 5, characterized in that The step of obtaining a training data set includes: Obtaining a training set matrix and characteristic data of each matrix in the training set matrix; Obtain the optimal parameters of the solver under different processes corresponding to solving linear equations using all possible solution combinations of different parameters in single-process and multi-process environments; The training data set is obtained according to the characteristic data, the solver and the optimal parameters under different processes.

7. A device for recommending solver parameters, characterized in that: The device comprises: A recommended information acquisition module is used to obtain a sparse matrix of a linear equation to be solved and a solver; A feature extraction module, used to obtain target feature data of the sparse matrix; The recommendation module is used to input the name of the solver and the target feature data into the trained recommendation model corresponding to different processes to obtain the recommended parameter value of the solver under each process.

8. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for recommending solver parameters according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for recommending solver parameters according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method for recommending solver parameters according to any one of claims 1 to 6.