Iterative solution method and automatic preconditioner selection method for distributed platforms

By extracting the numerical and grid features of sparse matrices on a distributed platform and using the Transformer and Wide models to train preset classifiers, the problems of inefficient iterative solution and preconditioner selection in traditional methods are solved, and the automatic selection and efficient calculation of the optimal combination are achieved.

CN119397149BActive Publication Date: 2025-09-23HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional iterative solutions and preconditioners are difficult to adapt to sparse matrices with different characteristics when selected and optimized on distributed platforms, resulting in low computational efficiency. Existing methods rely on expert experience and trial-and-error processes, making it difficult to obtain the optimal solution.

Method used

By importing training sparse matrix data, extracting numerical features and grid features, using Transformer and Wide models for deep feature extraction and processing, combined with preset classifier training, the optimal iterative solution method and preconditioner combination are automatically selected, and the combination selection is performed on the main node and sent to the corresponding node for iterative solution.

Benefits of technology

It realizes the automatic selection of the optimal iterative solution method and preconditioner on the distributed platform, improves the computational efficiency and convergence speed of sparse matrix linear equations, and reduces the computational time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119397149B_ABST
    Figure CN119397149B_ABST
Patent Text Reader

Abstract

The present application relates to a method for automatic selection of iterative solution and preconditioner for distributed platform, which imports training sparse matrix data and extracts numerical features and grid features from the training sparse matrix data; trains a 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 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 right-end vector, performs data processing and feature extraction on the input sparse matrix data and right-end vector on the selected node, and aggregates the data processing and feature extraction results to the master node; uses the determined trained model to select the solution combination on the master node, and sends the selected combination result to the corresponding node for iterative solution of the linear equation group.
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 solver and preconditioner is a key issue in improving computational efficiency.

[0003] Traditional selection methods often rely on expert experience and trial-and-error processes, making it difficult to achieve optimal solutions in complex real-world applications. With the development of large-scale computing and high-performance computing, distributed platforms have shown great potential for solving large sparse matrix problems. However, the selection and optimization of traditional iterative solvers and preconditioners on distributed platforms still face many challenges.

[0004] When processing large sparse matrices, the efficiency of existing solvers such as the conjugate gradient method (CG) and the generalized minimum residual method (GMRES) is often limited by the selected preconditioner. The choice of preconditioner significantly impacts convergence speed and computation time. However, when faced with sparse matrices of varying characteristics, automatically selecting the optimal iterative solver and preconditioner combination remains a pressing challenge. 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 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 from the training sparse matrix data;

[0008] Training a preset classifier based on the numerical features and the grid features, using a fixed solution combination as a label, wherein different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0009] Based on the labels and the trained classifier, 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 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 master 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] Inputting the training sparse matrix data into the transformer model for deep feature extraction, and inputting the extracted numerical features and grid features into the wide model for processing;

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

[0015] The splicing 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 the 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, 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] Using the load balancing mechanism, the input sparse matrix data and the right-hand vector as well as the selected number of nodes and processes are partitioned to distribute 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, before 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 method 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 a determined trained model on the master node to solve a combination selection, and sending the selected combination result to a corresponding node for iteratively solving a linear equation system includes:

[0030] Selecting a solution combination using the determined trained model on the master node 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 equation group for the divided data.

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

[0034] A feature extraction module is used to import training sparse matrix data and extract numerical features and grid features from the training sparse matrix data;

[0035] A classifier training module is used to train a preset classifier based on the 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;

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

[0037] The first computing module is used to 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 master 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, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:

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

[0041] Training a preset classifier based on the numerical features and the grid features, using a fixed solution combination as a label, wherein different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0042] Based on the labels and the trained classifier, 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 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 master 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 having a computer program stored thereon, which, when executed by a processor, implements the following steps:

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

[0047] Training a preset classifier based on the numerical features and the grid features, using a fixed solution combination as a label, wherein different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0048] Based on the labels and the trained classifier, 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 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 master 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 that, when executed by a processor, implements the following steps:

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

[0053] Training a preset classifier based on the numerical features and the grid features, using a fixed solution combination as a label, wherein different solution combinations correspond to different iterative solution methods and preconditioner combinations;

[0054] Based on the labels and the trained classifier, 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 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 master 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 and extract numerical features and grid features in the training sparse matrix data; train the preset classifier based on the numerical features and grid features, use fixed solution combination as label, and different solution combination corresponds to different iterative solution method and preconditioner combination; based on the label and the trained classifier, 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 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; 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 entire process, multiple models are first trained based on the training sparse matrix data. During actual calculations, the master node uses the trained model to select the solution combination, and can automatically select the optimal iterative solution method and preconditioner to calculate the linear equation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 FIG2 is 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 flowchart of an iterative solution method and a method for automatic selection of preconditioners for a distributed platform in one embodiment;

[0060] Figure 3 A flowchart of an iterative solution method and a method for automatic selection of preconditioners for a distributed platform in another embodiment is shown;

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

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

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

[0064] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0065] The iterative solution method and the automatic selection method 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 via 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. Terminal 102 sends an iterative solution method and preconditioner selection request to server 104. Server 104 imports training sparse matrix data and extracts numerical features and grid features from the training sparse matrix data. A preset classifier is trained based on the numerical features and grid features, with a fixed solution combination as a label. Different solution combinations correspond to different iterative solution method and preconditioner combinations. Based on the labels and the trained classifier, multiple models are trained for different numbers of nodes and processes, and the trained model is determined based on the currently selected number of nodes and processes. Input sparse matrix data and right-hand side vectors are obtained, and data processing and feature extraction are performed on the input sparse matrix data and right-hand side vectors at the selected node. The data processing and feature extraction results are aggregated to the master node. The determined trained model is used at the master node to select a solution combination, and the selected combination result is sent to the corresponding node for iterative solution of the linear equation system. Terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices, and portable wearable devices. 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 preconditioner automatic selection method 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 from the training sparse matrix data.

[0068] Training sparse matrix data refers to the sparse matrix data used for model training, which can specifically be sparse matrix data obtained from historical collection. The numerical features in a sparse matrix usually refer to the values ​​of non-zero elements and their distribution. 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 of the matrix, the number of rows, the number of columns, the distribution of non-zero elements, the spectral radius, and the condition number. 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, where different solution combinations correspond to different iterative solution methods and preconditioner combinations.

[0070] Based on the obtained numerical and grid features, a pre-set classifier is trained. This classifier will be used in the subsequent training model. During the training process, fixed solution combinations are used as labels. Different solution combinations correspond to different iterative solutions and preconditioners. In other words, different iterative solutions and preconditioners can be combined to generate different solution combinations. These solution combinations are then 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] Based on the obtained labels and trained classifiers, multiple models are trained for different numbers of nodes and processes. A trained model is then selected from these models based on the number of nodes and processes corresponding to the current task. For example, based on the number of labels and the number of trained stages, A1, A2, ..., AN models are trained for different numbers of nodes and processes. Then, based on the currently selected number of nodes a and number of processes b, the trained model is determined to be A3.

[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 master node.

[0074] When actually performing the iterative solution method and automatic selection of preconditioners, the user inputs sparse matrix data and right-hand vectors, and then divides these data into different nodes for data processing and feature extraction. After completing data processing and feature extraction, these selected nodes aggregate 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 required. The right-hand side vector is a one-dimensional array corresponding to the rows or columns of the sparse matrix. The sparse matrix and 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. Local processing is performed on the matrix blocks and right-hand side vectors as required. This may include steps such as normalization, dimensionality reduction, and feature engineering. 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 the determined trained model to perform solution combination selection on the master node, and sending the selected combination result to the corresponding node for iterative solution of the linear equation group.

[0077] The master node uses the trained model determined by S300 for inference, recommends the optimal iterative solution and preconditioner combination, and then sends the optimal iterative solution and preconditioner combination to the corresponding nodes. These nodes then perform the iterative solution of the linear equations, using the recommended optimal iterative solution and preconditioner combination for calculation. Furthermore, the master node can aggregate and verify the solution results of each node, evaluating the performance of the solution combination, including metrics such as computation 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 appropriate iterative solver library, setting preconditioner parameters, and so on. Once 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 solver and preconditioner until convergence criteria are 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 automatically selecting iterative solvers and preconditioners for distributed platforms imports training sparse matrix data and extracts numerical and grid features from the training sparse matrix data. A preset classifier is trained based on the numerical and grid features, using fixed solution combinations as labels. Different solution combinations correspond to different iterative solver 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 based on the currently selected number of nodes and processes. The input sparse matrix data and right-hand side vector are obtained, and data processing and feature extraction are performed on the input sparse matrix data and right-hand side vector on the selected node. The data processing and feature extraction results are aggregated to the master node. The master node uses the determined trained model to select a solution combination, and the selected combination result is sent to the corresponding node for iterative solution of the linear equation system. Throughout the entire process, multiple models are first trained based on the training sparse matrix data. During the actual calculation, the master node uses the trained model to select the solution combination, which can automatically select the optimal iterative solver and preconditioner for the linear equation system 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 corresponding right-hand side vectors are available and can be partitioned 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, and connectivity. Extract numerical features from the sparse matrix data, such as statistics and distribution patterns of non-zero elements. Grid features may need to be encoded or converted to a form suitable for processing by machine learning models. Perform necessary scaling, normalization, or transformations on numerical features.

[0083] Transformer Model: Use the Transformer model to perform deep feature extraction on sparse matrix data. Transformer models are particularly adept at processing sequence data, but can be applied here by appropriately treating the rows or columns of sparse matrices as sequences. Wide Model: Build the Wide component, which typically includes linear or embedding layers 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 splicing features into a preset classifier for training, using a fixed solution combination as a label.

[0087] Using the concatenated features as input, a pre-defined classifier (such as logistic regression, decision tree, random forest, or deep learning model) is trained. The classifier's 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: Sparse matrix input: Input the sparse matrix into the Transformer model. Multi-layer attention mechanism: Extract deep features from the sparse matrix through a multi-layer attention mechanism. Feature representation generation: Generate a deep feature representation of the sparse matrix, capturing its high-level characteristics and obtaining a feature vector representation corresponding to the number of label dimensions.

[0091] Wide model processing: Input numerical features and grid features: The extracted numerical features and grid features are input into the wide model. Preliminary feature processing: Preliminary processing is performed through the two-layer neural network in the wide model, and a preliminary feature vector representation corresponding to the number of label dimensions is obtained.

[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 selected nodes, and aggregating the data processing and feature extraction results to a master node includes:

[0093] Obtain the input sparse matrix data and right-hand vector; use the load balancing mechanism to partition the input sparse matrix data and right-hand vector as well as the selected number of nodes and processes to divide the data into 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 dividing large datasets into smaller parts for parallel processing on multiple nodes. Load balancing ensures 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 allocated data block, it performs data processing and feature extraction. The specific 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] Specifically, for distributed feature extraction, a master process reads the matrix mtx file, reads the matrix data, and starts n processes, each responsible for a corresponding matrix row. The data is then distributed to each process for matrix feature extraction calculations. After the calculations are complete, all features are aggregated back to the master process, where model inference is performed. The optimal solution combination is then distributed to each process for iterative solution. For distributed matrix data in real-world scenarios, each process contains a portion of the matrix data. For both scenarios, the developed distributed feature extraction tool can effectively calculate sparse matrix features, including the number of rows, columns, number of nonzero elements, nonzero element ratio, number of nonzero elements in the upper triangle, number of nonzero elements in the lower triangle, number of diagonal nonzero elements, mean nonzero elements in a row, maximum nonzero elements in a row, variance of nonzero elements in a row, maximum element value, diagonal maximum element value, diagonal maximum element value, and diagonal dominance ratio. Leveraging parallel acceleration, distributed feature extraction significantly accelerates feature extraction compared to single-machine, single-process feature extraction, effectively reducing the overall process time. After all processes have calculated all features, the data is aggregated to the master node.

[0096] In one embodiment, a preset classifier is trained 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, and the following is also included:

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

[0098] Outlier removal: Detect and remove outliers in features to ensure data quality. Normalization: Normalize features so that their values ​​are within the same range to prevent magnitude differences between features from affecting model training.

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

[0100] On the master 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 is historical data), extract numerical features and grid features, and perform data cleaning and normalization.

[0103] 2. Feature extraction and modeling.

[0104] 3. The output features of the wide model and the transformer model are concatenated and input into the classifier for training, with 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 is aggregated into 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 of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0110] Based on the same inventive concept, an embodiment of the present application also provides an iterative solution method for distributed platforms and an apparatus 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 solution provided by the apparatus for solving the problem is similar to the implementation solution described in the above-mentioned method. Therefore, the specific limitations of one or more embodiments of the apparatus for automatic selection of iterative solution methods for distributed platforms and preconditioners provided below can be found in the above-mentioned limitations on the iterative solution method for distributed platforms and the method for automatic selection of preconditioners, which will not be repeated here.

[0111] In one embodiment, Figure 5 As shown, an iterative solution method and a device for automatic selection of preconditioners for a distributed platform 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, using fixed solution combinations as labels, where 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 the labels and the trained classifiers, and to determine the trained model based on the currently selected number of nodes and processes;

[0115] The first computing module 400 is configured to 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 master 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 divide the input sparse matrix data and right-end vectors and the selected number of nodes and processes to divide the data into corresponding nodes; perform data processing and feature extraction on each node that has carried the data; and summarize 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, where the optimal solution combination includes an optimal iterative solution method and a preconditioner combination; the optimal solution combination is sent to the corresponding node; and the optimal solution combination is used on each node to iteratively solve the linear equation group for the divided data.

[0122] Each module in the above-mentioned iterative solution method and automatic preconditioner selection apparatus for distributed platforms can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above 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 the computer device in the form of software, so that the processor can call and execute the corresponding operations of 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 via a system bus. 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 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 via a network connection. When the computer program is executed by the processor, it implements an iterative solution method for a distributed platform and a method for automatic selection of preconditioners.

[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 shown in the figure, or combine certain components, or have a different component arrangement.

[0125] 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 above-mentioned iterative solution method for distributed platforms and the method for automatic selection of preconditioners when executing the computer program.

[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, comprising 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 skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. 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 memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of 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 the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to these.

[0129] The technical features of the above embodiments can 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.

[0130] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. An iterative solution method and automatic preconditioner selection method for distributed platforms, characterized in that: The method comprises: Importing training sparse matrix data, and extracting numerical features and grid features from the training sparse matrix data; Training a preset classifier based on the numerical features and the grid features, using a fixed solution combination as a label, wherein different solution combinations correspond to different iterative solution methods and preconditioner combinations; Based on the labels and the trained classifier, 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 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 master 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, with a fixed solution combination as a label, and different solution combinations correspond to different iterative solution methods and preconditioner combinations, including: Inputting the training sparse matrix data into the transformer model for deep feature extraction, and inputting the extracted numerical features and grid features into the wide model for processing; Concatenate the output features of the transformer model and the wide model; The splicing 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 the 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, wherein 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: Get the input sparse matrix data and right-hand vector; Using the load balancing mechanism, the input sparse matrix data and the right-hand vector as well as the selected number of nodes and processes are partitioned to distribute 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, wherein 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 system includes: Selecting a solution combination using the determined trained model on the master node 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 equation group for the divided data.

7. An iterative solution method and automatic preconditioner selection device for distributed platforms, characterized in that: The device comprises: A feature extraction module is used to import training sparse matrix data and extract numerical features and grid features from the training sparse matrix data; A classifier training module is used to train a preset classifier based on the 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; A model training module is configured to train multiple models for different numbers of nodes and processes based on the labels and the trained classifiers, and determine the trained model based on the currently selected number of nodes and processes; The first computing module is used to 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 master 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