Distributed platform-oriented iterative solution method and precondition automatic selection method

By extracting the numerical features and grid features of sparse matrix data, and training the classifier, automatically selecting iterative solutions and precondition subs, the problem that traditional methods are difficult to obtain optimal solutions on distributed platforms is solved, and the calculation is improved Efficiency and convergence speed.

CN119397149AActive Publication Date: 2025-02-07HUNAN UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411224654.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-02-07
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

When dealing with large-scale sparse matrices, traditional iterative solutions and preconditional sub-selecting methods are difficult to obtain optimal solutions in complex practical applications, especially on distributed platforms.

Method used

By importing training sparse matrix data, numerical features and grid features are extracted, and preset classifiers are trained based on these features. Using fixed solution combinations as labels, the optimal iterative solution method and preconditional subcombination are automatically selected.

Benefits of technology

It realizes the automatic selection of the optimal iterative solution and precondition sub on the distributed platform, and improves the computing efficiency and convergence speed of processing large-scale sparse matrices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119397149A_ABST
    Figure CN119397149A_ABST
Patent Text Reader

Abstract

The invention relates to a distributed platform-oriented iterative solution method and an automatic precondition sub-selection method, and the method comprises the steps: importing training sparse matrix data, and extracting numerical features and grid features in the training sparse matrix data; a preset classifier is trained based on the numerical value features and the grid features, fixed solution combinations serve as labels, and different solution combinations correspond to different iterative solution methods and precondition sub-combinations; based on the label and the trained classifier, training a plurality of models for different node numbers and process numbers, and determining a trained model according to the currently selected node number and process number; acquiring input sparse matrix data and a right-end vector, performing data processing and feature extraction on the input sparse matrix data and the right-end vector on the selected node, and summarizing data processing and feature extraction results to a main node; and carrying out solution combination selection on the main node by adopting the determined trained model, and sending a selected combination result to the corresponding node to carry out iterative solution of the linear equation set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for an iterative solution method and automatic selection of a preconditioner for a distributed platform. Background Art

[0002] When dealing with linear equations with sparse matrices, choosing the optimal iterative solution method and preconditioner is a key issue in improving computational efficiency.

[0003] Traditional selection methods usually rely on expert experience and trial and error, which makes it difficult to obtain the optimal solution in complex practical applications. With the development of large-scale computing and high-performance computing, distributed platforms have shown great potential in solving large sparse matrix problems. However, there are still many challenges in the selection and optimization of traditional iterative solvers and preconditioners on distributed platforms.

[0004] The efficiency of existing solvers such as CG (conjugate gradient method) and GMRES (generalized minimum residual method) is often restricted by the selected preconditioner when processing large-scale sparse matrices. The choice of preconditioner has a significant impact on the convergence speed and calculation time. However, when faced with sparse matrices with different characteristics, how to automatically select the optimal combination of iterative solver and preconditioner is a difficult problem that needs to be solved urgently. Summary of the invention

[0005] Based on this, it is necessary to provide an iterative solution method and a method, apparatus, computer equipment, computer-readable storage medium and computer program product for automatic selection of preconditioners for distributed platforms in order to address the above technical problems.

[0006] In a first aspect, the present application provides an iterative solution method and a method for automatic selection of preconditioners for a distributed platform. The method comprises:

[0007] Importing training sparse matrix data, and extracting numerical features and grid features in the training sparse matrix data;

[0008] Based on the numerical features and the grid features, a preset classifier is trained, with a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0009] Based on the labels and the trained classifiers, multiple models are trained for different numbers of nodes and processes, and the trained model is determined according to the currently selected number of nodes and number of processes;

[0010] Obtain the input sparse matrix data and right-end vector, perform data processing and feature extraction on the input sparse matrix data and right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node;

[0011] The determined trained model is used on the master node to perform solution combination selection, and the selected combination result is sent to the corresponding node for iterative solution of the linear equation group.

[0012] In one embodiment, the preset classifier is trained based on the numerical features and the grid features, with a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations, including:

[0013] Input the training sparse matrix data into the transformer model for deep feature extraction, and input the extracted numerical features and grid features into the wide model for processing;

[0014] Concatenating the output features of the transformer model and the wide model;

[0015] The concatenated features are input into the preset classifier for training, with fixed solution combinations as labels.

[0016] In one embodiment, inputting the training sparse matrix data into a transformer model for deep feature extraction includes:

[0017] Inputting the training sparse matrix data into a transformer model;

[0018] In the transformer model, a multi-layer attention mechanism is used to extract deep features of the training sparse matrix;

[0019] Inputting the extracted numerical features and grid features into the wide model for processing includes:

[0020] Inputting the extracted numerical features and grid features into the wide model;

[0021] Preliminary processing is performed through the two-layer neural network in the wide model, and a preliminary feature vector representation corresponding to the dimension of the number of labels is obtained.

[0022] In one embodiment, the step of obtaining the input sparse matrix data and the right-end vector, performing data processing and feature extraction on the input sparse matrix data and the right-end vector on the selected node, and aggregating the data processing and feature extraction results to the master node includes:

[0023] Get the input sparse matrix data and right-hand vector;

[0024] The load balancing mechanism is used to partition the input sparse matrix data and the right-hand vector as well as the selected number of nodes and processes to divide the data to the corresponding nodes;

[0025] Perform data processing and feature extraction on each node that carries data;

[0026] Aggregate data processing and feature extraction results to the master node.

[0027] In one embodiment, the training of the preset classifier based on the numerical features and the grid features, using a fixed solution combination as a label, and different solution combinations corresponding to different iterative solution methods and preconditioner combinations, further includes:

[0028] The extracted numerical features and grid features are cleaned and normalized to remove outliers and perform normalization.

[0029] In one embodiment, the step of using the determined trained model to solve the combination selection on the master node and sending the selected combination result to the corresponding node for iterative solution of the linear equation system includes:

[0030] Using the determined trained model on the master node to select a solution combination to obtain an optimal solution combination, wherein the optimal solution combination includes an optimal iterative solution method and a preconditioner combination;

[0031] Sending the optimal solution combination to the corresponding node;

[0032] The optimal solution combination is used at each node to iteratively solve the linear equations for the divided data.

[0033] In a second aspect, the present application also provides an iterative solution method for a distributed platform and a device for automatic selection of preconditioners. The device comprises:

[0034] A feature extraction module, used for importing training sparse matrix data and extracting numerical features and grid features from the training sparse matrix data;

[0035] A classifier training module, used for training a preset classifier based on the numerical features and the grid features, with a fixed solution combination as a label, and different solution combinations corresponding to different iterative solution methods and preconditioner combinations;

[0036] A model training module, for training multiple models for different numbers of nodes and processes based on the labels and the trained classifiers, and determining the trained model according to the currently selected number of nodes and processes;

[0037] The first computing module is used to obtain the input sparse matrix data and the right-end vector, perform data processing and feature extraction on the input sparse matrix data and the right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node;

[0038] The second computing module is used to use the determined trained model to solve the combination selection on the main node, and send the selected combination result to the corresponding node to iteratively solve the linear equation group.

[0039] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0040] Importing training sparse matrix data, and extracting numerical features and grid features in the training sparse matrix data;

[0041] Based on the numerical features and the grid features, a preset classifier is trained, with a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0042] Based on the labels and the trained classifiers, multiple models are trained for different numbers of nodes and processes, and the trained model is determined according to the currently selected number of nodes and number of processes;

[0043] Obtain the input sparse matrix data and right-end vector, perform data processing and feature extraction on the input sparse matrix data and right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node;

[0044] The determined trained model is used on the master node to perform solution combination selection, and the selected combination result is sent to the corresponding node for iterative solution of the linear equation group.

[0045] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0046] Importing training sparse matrix data, and extracting numerical features and grid features in the training sparse matrix data;

[0047] Based on the numerical features and the grid features, a preset classifier is trained, with a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0048] Based on the labels and the trained classifiers, multiple models are trained for different numbers of nodes and processes, and the trained model is determined according to the currently selected number of nodes and number of processes;

[0049] Obtain the input sparse matrix data and right-end vector, perform data processing and feature extraction on the input sparse matrix data and right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node;

[0050] The determined trained model is used on the master node to perform solution combination selection, and the selected combination result is sent to the corresponding node for iterative solution of the linear equation group.

[0051] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0052] Importing training sparse matrix data, and extracting numerical features and grid features in the training sparse matrix data;

[0053] Based on the numerical features and the grid features, a preset classifier is trained, with a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0054] Based on the labels and the trained classifiers, multiple models are trained for different numbers of nodes and processes, and the trained model is determined according to the currently selected number of nodes and number of processes;

[0055] Obtain the input sparse matrix data and right-end vector, perform data processing and feature extraction on the input sparse matrix data and right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node;

[0056] The determined trained model is used on the master node to perform solution combination selection, and the selected combination result is sent to the corresponding node for iterative solution of the linear equation group.

[0057] The above-mentioned method, device, computer equipment, storage medium and computer program product for iterative solution method and automatic selection of preconditioner for distributed platform import training sparse matrix data, extract numerical features and grid features in the training sparse matrix data; train preset classifiers based on numerical features and grid features, use fixed solution combinations as labels, and different solution combinations correspond to different iterative solution method and preconditioner combinations; based on labels and trained classifiers, train multiple models for different numbers of nodes and processes, and determine the trained model according to the currently selected number of nodes and processes; obtain input sparse matrix data and right-hand vector, perform data processing and feature extraction on the input sparse matrix data and right-hand vector on the selected node, and summarize the data processing and feature extraction results to the main node; use the determined trained model to select the solution combination on the main node, and send the selected combination result to the corresponding node for iterative solution of the linear equation group. During the whole process, multiple models are first trained based on the training sparse matrix data. When the actual calculation is performed, the trained model adopted by the main node is used to select the solution combination, and the optimal iterative solution method and preconditioner can be automatically selected to calculate the linear equation group. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 An application environment diagram of an iterative solution method and a method for automatic selection of preconditioners for a distributed platform in one embodiment;

[0059] Figure 2 A schematic flow chart of an iterative solution method and a method for automatic selection of preconditioners for a distributed platform in one embodiment;

[0060] Figure 3 A schematic flow chart of an iterative solution method and a method for automatic selection of preconditioners for a distributed platform in another embodiment;

[0061] Figure 4 A flowchart of an iterative solution method and a method for automatic selection of preconditioners for a distributed platform in an application example;

[0062] Figure 5 A structural block diagram of an iterative solution method for a distributed platform and an automatic selection device for a preconditioner in one embodiment;

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

[0064] 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.

[0065] The iterative solution method and the method for automatic selection of preconditioners for distributed platforms provided in the embodiments of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The terminal 102 sends an iterative solution method and a preconditioner selection request to the server 104, and the server 104 imports the training sparse matrix data, extracts the numerical features and grid features in the training sparse matrix data; trains the preset classifier based on the numerical features and grid features, uses a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations; based on the label and the trained classifier, trains multiple models for different numbers of nodes and processes, and determines the trained model according to the currently selected number of nodes and processes; obtains the input sparse matrix data and the right-hand vector, performs data processing and feature extraction on the input sparse matrix data and the right-hand vector on the selected node, and summarizes the data processing and feature extraction results to the main node; uses the determined trained model to select the solution combination on the main node, and sends the selected combination result to the corresponding node for iterative solution of the linear equation group. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0066] In one embodiment, Figure 2 As shown in the figure, an iterative solution method and a method for automatic selection of preconditioners for distributed platforms are provided. Figure 1 Taking the server 104 in the example as an example, the following steps are included:

[0067] S100: importing training sparse matrix data, and extracting numerical features and grid features in the training sparse matrix data.

[0068] Training sparse matrix data refers to sparse matrix data used for model training, which can be sparse matrix data obtained from historical collection. Numerical features in sparse matrices usually refer to the values ​​and distribution of non-zero elements. Extracting these features helps to understand the structure and pattern of the data. Grid features are usually related to specific applications of sparse matrices. Specifically, there are 19 features such as the sparsity, number of rows, number of columns, distribution of non-zero elements, spectral radius, and condition number of the matrix. Grid features such as the structure and topological properties of the matrix: Matrix structural features: Analyze the structural features of the matrix, such as diagonal dominance, symmetry, etc. Topological features: Extract the topological properties of the matrix, such as the connectivity and degree distribution of the graph.

[0069] S200: training a preset classifier based on numerical features and grid features, using a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations.

[0070] The classifier pre-set based on the obtained numerical features and grid features is trained. This classifier is the classifier in the subsequent training model. During the training process, a fixed solution combination is used as a label. Different solution combinations correspond to different iterative solutions and preconditioners, that is, different iterative solutions + different preconditioners can be combined to generate different solution combinations, and then these solution combinations are assigned identifiers as labels.

[0071] S300: Based on the labels and the trained classifiers, multiple models are trained for different numbers of nodes and processes, and the trained model is determined according to the currently selected number of nodes and number of processes.

[0072] According to the obtained labels and trained classifiers, multiple models are trained for different numbers of nodes and processes. Then, the trained model is selected from multiple models based on the number of nodes and processes corresponding to the current task. For example, based on the number of labels and the trained phases, A1, A2, ..., AN models are trained for different numbers of nodes and processes, and then the trained model is determined to be A3 based on the currently selected number of nodes a and number of processes b.

[0073] S400: Obtain input sparse matrix data and right-end vectors, perform data processing and feature extraction on the input sparse matrix data and right-end vectors on the selected nodes, and aggregate the data processing and feature extraction results to the main node.

[0074] When actually performing the iterative solution method and automatic selection of preconditioners, the user inputs the sparse matrix data and the right-hand vector, and then divides these data into different nodes for data processing and feature extraction. After completing the data processing and feature extraction, these selected nodes summarize the data processing and feature extraction results to the main node.

[0075] Specifically, sparse matrices are usually stored in some compressed format, such as CSR (Compressed Sparse Row), CSC (Compressed Sparse Column) or COO (Coordinate List) format. These formats reduce the storage space requirements. The right-hand side vector is a one-dimensional array corresponding to the rows or columns of the sparse matrix. The sparse matrix and the right-hand side vector are divided into multiple parts by rows or columns (depending on the nature of the problem and the format of the sparse matrix), and these parts are distributed to different computing nodes. The matrix blocks and right-hand side vectors are processed locally as required. This may include steps such as normalization, dimensionality reduction, feature engineering, etc. Feature extraction may be based on the characteristics of the matrix (such as the distribution of non-zero elements, pattern recognition, etc.).

[0076] S500: Using a determined trained model to perform solution combination selection on the master node, and sending the selected combination result to a corresponding node for iterative solution of the linear equation group.

[0077] The master node uses the trained model determined by S300 for reasoning, recommends the optimal iterative solution method and preconditioner combination, and then sends the optimal iterative solution method and preconditioner combination to the corresponding nodes, which perform iterative solutions to the linear equations, that is, these nodes use the recommended optimal iterative solution method and preconditioner combination for calculation. Furthermore, the master node can also collect the solution results of each node for summary and verification, and evaluate the performance of the solution combination, including indicators such as calculation time and convergence.

[0078] Specifically, each node that receives a solution combination will configure its solver based on this information. This may include loading the corresponding iterative solution algorithm library, setting preconditioner parameters, etc. After the solver is configured, each node will iteratively solve using its assigned sparse matrix block and right-hand vector fragment. The iteration process will proceed according to the selected solution method and preconditioner until the convergence condition is met (such as the residual is less than a certain threshold) or the maximum number of iterations is reached.

[0079] The above-mentioned method for iterative solution and automatic selection of preconditioner for distributed platform imports training sparse matrix data, extracts numerical features and grid features in the training sparse matrix data; trains the preset classifier based on numerical features and grid features, uses fixed solution combinations as labels, and different solution combinations correspond to different iterative solution and preconditioner combinations; trains multiple models for different numbers of nodes and processes based on labels and trained classifiers, and determines the trained model according to the currently selected number of nodes and processes; obtains the input sparse matrix data and right-hand vector, performs data processing and feature extraction on the input sparse matrix data and right-hand vector on the selected node, and summarizes the data processing and feature extraction results to the master node; uses the determined trained model on the master node to select the solution combination, and sends the selected combination result to the corresponding node for iterative solution of the linear equation group. In the whole process, multiple models are first trained based on the training sparse matrix data, and when actually calculating, the trained model used by the master node selects the solution combination, which can automatically select the optimal iterative solution and preconditioner for linear equation group calculation.

[0080] like Figure 3 As shown, in one embodiment, S200 includes:

[0081] S220: Input the training sparse matrix data into the transformer model for deep feature extraction, and input the extracted numerical features and grid features into the wide model for processing.

[0082] Ensure that the sparse matrix data and the corresponding right-hand side vectors are ready and can be divided into different parts as needed for processing in a distributed environment. Extract grid features related to the sparse matrix data, such as grid size, shape, connectivity, etc. Extract numerical features from the sparse matrix data, such as statistics of non-zero elements, distribution patterns, etc. The grid features may need to be encoded or converted to a form suitable for processing by machine learning models. Perform necessary scaling, normalization, or conversion on the numerical features.

[0083] Transformer model: Use the Transformer model to perform deep feature extraction on sparse matrix data. The Transformer model is particularly good at processing sequence data, but it can be applied here in an appropriate way (such as treating the rows or columns of the sparse matrix as sequences). Wide model: Build the Wide part, which usually includes a linear layer or an embedding layer to process sparse grid features and numerical features.

[0084] S240: Concatenates the output features of the transformer model and the wide model.

[0085] The deep features output by the Transformer model are concatenated with the sparse features processed by the Wide model to form a richer feature representation.

[0086] S260: Input the concatenated features into a preset classifier for training, using a fixed solution combination as a label.

[0087] Use the concatenated features as input to train a pre-set classifier (such as logistic regression, decision tree, random forest, or deep learning model). The classifier label is a fixed solution combination, that is, different combinations of iterative solutions and preconditioners.

[0088] In one embodiment, inputting the training sparse matrix data into the transformer model for deep feature extraction includes: inputting the training sparse matrix data into the transformer model; extracting deep features of the training sparse matrix through a multi-layer attention mechanism in the transformer model;

[0089] Inputting the extracted numerical features and grid features into the wide model for processing includes: inputting the extracted numerical features and grid features into the wide model; performing preliminary processing through a two-layer neural network in the wide model, and obtaining a preliminary feature vector representation corresponding to the label quantity dimension.

[0090] Transformer model processing: Input sparse matrix: Input the sparse matrix into the transformer model. Multi-layer attention mechanism: Through the multi-layer attention mechanism, the deep features of the sparse matrix are extracted. Feature representation generation: Generate the deep feature representation of the sparse matrix, capture its high-level characteristics, and obtain the feature vector representation corresponding to the dimension of the number of labels.

[0091] Wide model processing: Input numerical features and grid features: Input the extracted numerical features and grid features into the wide model. Preliminary feature processing: Perform preliminary processing through the two-layer neural network in the wide model, and obtain a preliminary feature vector representation corresponding to the label quantity dimension.

[0092] In one embodiment, obtaining input sparse matrix data and right-end vectors, performing data processing and feature extraction on the input sparse matrix data and right-end vectors on the selected nodes, and aggregating the data processing and feature extraction results to the master node includes:

[0093] Obtain input sparse matrix data and right-hand vector; use load balancing mechanism to partition the input sparse matrix data and right-hand vector as well as the selected number of nodes and number of processes to divide the data to the corresponding nodes; perform data processing and feature extraction on each node that has carried the data; and aggregate the data processing and feature extraction results to the master node.

[0094] Data is received from files, databases, or the network. In a distributed environment, the data may already be stored in a shared storage system such as HDFS (Hadoop Distributed File System). Data partitioning is the process of splitting a large data set into smaller parts so that they can be processed in parallel on multiple nodes. Load balancing mechanisms ensure that each node or process receives a roughly equal amount of data to optimize resource utilization and reduce processing time. After each node receives its assigned data block, it will perform data processing and feature extraction. The specific content of the processing depends on the requirements of the problem and may include normalization, dimensionality reduction, feature engineering, etc. After each node processes its data block, it sends the results back to the master node for aggregation. The master node is responsible for collecting the processing results of all nodes and performing further global processing or analysis.

[0095] Furthermore, for distributed feature extraction, the main process reads the matrix mtx file, reads the matrix data, starts n processes, each process is responsible for the corresponding matrix row, and distributes the data to each process for matrix feature extraction calculation. After the calculation is completed, all features are gathered to the main process, and then the model is inferred. The best solution combination result is distributed to each process for iterative solution. For distributed matrix data in real scenarios, each process contains a part of the matrix data. For both cases, the written distributed feature extraction tools can effectively calculate sparse matrix features including the number of rows, the number of columns, the number of non-zero elements, the proportion of non-zero elements, the number of non-zero elements in the upper triangle of the matrix, the number of non-zero elements in the lower triangle of the matrix, the number of non-zero elements on the diagonal, the average value of non-zero elements in the row, the maximum value of non-zero elements in the row, the variance of non-zero elements in the row, the maximum element value, the maximum diagonal element value, the maximum diagonal element value, and the diagonal dominant ratio. Using parallel acceleration, distributed feature extraction has a very significant acceleration effect compared with single-machine single-process feature extraction, which can effectively reduce the time spent on the entire process. Wait for all processes to calculate all features and then aggregate the data to the master node.

[0096] In one embodiment, a preset classifier is trained based on numerical features and grid features, a fixed solution combination is used as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations, and the method further includes:

[0097] The extracted numerical features and grid features are cleaned and normalized to remove outliers and perform normalization.

[0098] Remove outliers: Detect and remove outliers in features to ensure data quality. Normalization: Normalize features to keep their values ​​within the same range to avoid the magnitude differences between features affecting model training.

[0099] In one embodiment, using a determined trained model to solve a combination selection on a master node, sending the selected combination result to a corresponding node to iteratively solve a linear equation system includes:

[0100] On the main node, a determined trained model is used to select a solution combination to obtain the optimal solution combination, which includes the optimal iterative solution method and preconditioner combination; the optimal solution combination is sent to the corresponding node; on each node, the optimal solution combination is used to iteratively solve the linear equation group for the divided data.

[0101] like Figure 4 As shown, in a specific application example, the iterative solution method and the method for automatic selection of preconditioners for distributed platforms of the present application include the following steps:

[0102] 1. Import sparse matrix data (the sparse matrix data is used for training and belongs to historical data), extract numerical features and grid features, and perform data cleaning and normalization.

[0103] 2. Feature extraction and modeling.

[0104] 3. Concatenate the output features of the wide model and the transformer model and input them into the classifier for training, using a fixed set of solution combinations as labels.

[0105] 4. Train multiple models for different numbers of nodes and processes.

[0106] 5. The user selects the number of nodes and processes based on their existing resources, and thus selects the trained model.

[0107] 6. Distributed data partitioning is performed based on the matrix, right-hand vector, number of nodes, and number of processes provided by the user. The data is divided into corresponding nodes, and data processing and feature extraction are performed, and the data are aggregated to one node.

[0108] 7. Use the trained model to solve the combination selection, distribute the inferred combination results to the corresponding nodes and perform iterative solution of the linear equations.

[0109] It should be understood that, although the steps in the flowcharts involved in the above 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 is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may 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 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.

[0110] Based on the same inventive concept, the embodiment of the present application also provides an iterative solution method for distributed platforms and a device for automatic selection of preconditioners for implementing the above-mentioned iterative solution method for distributed platforms and the method for automatic selection of preconditioners. 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 in one or more embodiments of the device for automatic selection of iterative solution methods for distributed platforms and preconditioners provided below can be referred to the limitations of the iterative solution method for distributed platforms and the method for automatic selection of preconditioners in the above text, and will not be repeated here.

[0111] In one embodiment, Figure 5 As shown, an iterative solution method for a distributed platform and a device for automatic selection of a preconditioner are provided, including:

[0112] The feature extraction module 100 is used to import the training sparse matrix data and extract the numerical features and grid features in the training sparse matrix data;

[0113] A classifier training module 200 is used to train a preset classifier based on numerical features and grid features, with fixed solution combinations as labels, and different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0114] A model training module 300 is used to train multiple models for different numbers of nodes and processes based on labels and trained classifiers, and determine the trained model according to the currently selected number of nodes and number of processes;

[0115] The first computing module 400 is used to obtain the input sparse matrix data and the right-end vector, perform data processing and feature extraction on the input sparse matrix data and the right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node;

[0116] The second computing module 500 is used to use the determined trained model to solve the combination selection on the main node, and send the selected combination result to the corresponding node to iteratively solve the linear equation group.

[0117] In one embodiment, the classifier training module 200 is also used to input the training sparse matrix data into the transformer model for deep feature extraction, and input the extracted numerical features and grid features into the wide model for processing; splicing the output features of the transformer model and the wide model; and input the spliced ​​features into a preset classifier for training, with a fixed solution combination as a label.

[0118] In one embodiment, the classifier training module 200 is also used to input the training sparse matrix data into the transformer model; extract the deep features of the training sparse matrix through the multi-layer attention mechanism in the transformer model; input the extracted numerical features and grid features into the wide model; perform preliminary processing through the two-layer neural network in the wide model, and obtain a preliminary feature vector representation corresponding to the label quantity dimension.

[0119] In one embodiment, the first computing module 400 is also used to obtain input sparse matrix data and right-end vectors; use a load balancing mechanism to partition the input sparse matrix data and right-end vectors and the selected number of nodes and number of processes to divide the data into corresponding nodes; perform data processing and feature extraction on each node that carries the data; and aggregate the data processing and feature extraction results to the master node.

[0120] In one embodiment, the classifier training module 200 is further used to perform data cleaning and normalization processing on the extracted numerical features and grid features, remove outliers and perform normalization processing.

[0121] In one embodiment, the second computing module 500 is also used to use a determined trained model on the main node to select a solution combination to obtain an optimal solution combination, the optimal solution combination including an optimal iterative solution method and a preconditioner combination; send the optimal solution combination to the corresponding node; and use the optimal solution combination on each node to iteratively solve the linear equation group for the divided data.

[0122] Each module in the above-mentioned iterative solution method for distributed platforms and the device for automatic selection of preconditioners can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules 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 the operations corresponding to each of the above modules.

[0123] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory and a network interface 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an iterative solution method for a distributed platform and a method for automatic selection of preconditioners are implemented.

[0124] Those skilled in the art will understand that Figure 6 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.

[0125] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the iterative solution method for distributed platforms and the method for automatic selection of preconditioners are implemented.

[0126] 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 distributed platform-oriented iterative solution method and the method for automatic selection of preconditioners are implemented.

[0127] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the above-mentioned iterative solution method for distributed platforms and the method for automatic selection of preconditioners.

[0128] 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.

[0129] The technical features of the above embodiments may be arbitrarily combined. 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.

[0130] 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. An iterative solution method and a method for automatic selection of preconditioners for distributed platforms, characterized in that: The method comprises: Importing training sparse matrix data, and extracting numerical features and grid features in the training sparse matrix data; Based on the numerical features and the grid features, a preset classifier is trained, with a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations; Based on the labels and the trained classifiers, multiple models are trained for different numbers of nodes and processes, and the trained model is determined according to the currently selected number of nodes and number of processes; Obtain the input sparse matrix data and right-end vector, perform data processing and feature extraction on the input sparse matrix data and right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node; The determined trained model is used on the master node to perform solution combination selection, and the selected combination result is sent to the corresponding node for iterative solution of the linear equation group.

2. The method according to claim 1, characterized in that The preset classifier is trained based on the numerical features and the grid features, and a fixed solution combination is used as a label. Different solution combinations correspond to different iterative solution methods and preconditioner combinations, including: Input the training sparse matrix data into the transformer model for deep feature extraction, and input the extracted numerical features and grid features into the wide model for processing; Concatenating the output features of the transformer model and the wide model; The concatenated features are input into the preset classifier for training, with fixed solution combinations as labels.

3. The method according to claim 2, characterized in that Inputting the training sparse matrix data into the transformer model for deep feature extraction includes: Inputting the training sparse matrix data into a transformer model; In the transformer model, a multi-layer attention mechanism is used to extract deep features of the training sparse matrix; Inputting the extracted numerical features and grid features into the wide model for processing includes: Inputting the extracted numerical features and grid features into the wide model; Preliminary processing is performed through the two-layer neural network in the wide model, and a preliminary feature vector representation corresponding to the dimension of the number of labels is obtained.

4. The method according to claim 1, characterized in that: The step of obtaining the input sparse matrix data and the right end vector, performing data processing and feature extraction on the input sparse matrix data and the right end vector on the selected node, and aggregating the data processing and feature extraction results to the main node includes: Get the input sparse matrix data and right-hand vector; The load balancing mechanism is used to partition the input sparse matrix data and the right-hand vector as well as the selected number of nodes and processes to divide the data to the corresponding nodes; Perform data processing and feature extraction on each node that carries data; Aggregate data processing and feature extraction results to the master node.

5. The method according to claim 1, characterized in that The method further includes: training a preset classifier based on the numerical features and the grid features, using a fixed solution combination as a label, and different solution combinations corresponding to different iterative solution methods and preconditioner combinations. The extracted numerical features and grid features are cleaned and normalized to remove outliers and perform normalization.

6. The method according to claim 4, characterized in that The method of using the determined trained model to solve the combination selection on the master node and sending the selected combination result to the corresponding node for iterative solution of the linear equation group includes: Using the determined trained model on the master node to select a solution combination to obtain an optimal solution combination, wherein the optimal solution combination includes an optimal iterative solution method and a preconditioner combination; Sending the optimal solution combination to the corresponding node; The optimal solution combination is used at each node to iteratively solve the linear equations for the divided data.

7. An iterative solution method and a device for automatic selection of preconditioners for distributed platforms, characterized in that: The device comprises: A feature extraction module, used for importing training sparse matrix data and extracting numerical features and grid features from the training sparse matrix data; A classifier training module, used for training a preset classifier based on the numerical features and the grid features, with a fixed solution combination as a label, and different solution combinations corresponding to different iterative solution methods and preconditioner combinations; A model training module, for training multiple models for different numbers of nodes and processes based on the labels and the trained classifiers, and determining the trained model according to the currently selected number of nodes and processes; The first computing module is used to obtain the input sparse matrix data and the right-end vector, perform data processing and feature extraction on the input sparse matrix data and the right-end vector on the selected node, and summarize the data processing and feature extraction results to the main node; The second computing module is used to use the determined trained model to solve the combination selection on the main node, and send the selected combination result to the corresponding node to iteratively solve the linear equation group.

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 according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Concurrent multilevel method for accelerating large-scale sparse matrix calculation

    CN107193783A

  • Sparse triangular matrix solving method and device based on distributed platform

    CN118069315A

  • Adaptive method and device for sparse matrix vector multiplication in graph calculation

    CN118132911A

  • Optimization method of linear equation set solving algorithm

    CN118193909A

  • Method and system for scheduling sorting algorithm in sparse matrix solving process

    CN118378074A