Feature and knowledge driven optimal parallelism prediction method and system and medium

By employing a feature- and knowledge-driven approach, and utilizing neural network prediction models and multi-window sample expansion, the problems of insufficient feature representation and scarce training samples in the optimal parallelism prediction of parallel programs are solved. This enables efficient and accurate parallelism prediction of parallel programs, improving computational efficiency and resource utilization.

CN121597376AActive Publication Date: 2026-03-03NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610123402.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-29
Publication Date
2026-03-03
Estimated Expiration
2046-01-29

Smart Images

  • Figure CN121597376A_ABST
    Figure CN121597376A_ABST
Patent Text Reader

Abstract

The invention discloses a feature and knowledge driven optimal parallelism degree prediction method and system and a medium. The method comprises the steps that multivariate runtime features of a target parallel program are obtained, and codes are embedded to obtain multivariate fusion features; inputting the multivariate fusion features into a pre-trained speed-up ratio prediction model to predict the speed-up ratio of the target parallel program under a plurality of given parallelism degrees, the speed-up ratio prediction model being a neural network prediction model, a mapping relation between the multivariate fusion features of the parallel program and the speed-up ratios under a plurality of given parallelism degrees is trained and established by a training sample which is constructed by utilizing the multivariate fusion features of a parallel program sample and the speed-up ratio priori knowledge under different parallelism degrees in advance; and selecting the parallelism degree with the maximum speed-up ratio as the optimal parallelism degree obtained by prediction. According to the method, efficient, accurate and credible prediction of the optimal parallelism degree of the program is achieved, the calculation efficiency is improved, system resource consumption is reduced, and the execution time of the program is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to scheduling optimization techniques for parallel programs, specifically to a feature- and knowledge-driven method, system, and medium for predicting optimal parallelism. Background Technology

[0002] With the continuous growth in computing power demands, the scale of parallel programs is increasing dramatically, leading to a surge in parallel computing capabilities. Numerous parallel applications are applied in cutting-edge fields such as climate simulation, fluid dynamics analysis, and deep learning training. Optimal parallelism, a key indicator determining the performance and scalability of a parallel program, refers to the parallel scale required for the program to complete its target task in the shortest possible time. When the parallel scale of a parallel program exceeds the optimal parallelism, issues such as increased communication overhead, intensified resource contention, and load imbalance can lead to longer execution times and wasted system resources. Existing methods for predicting the optimal parallelism of parallel programs rely on static modeling, but these methods suffer from problems such as insufficient feature representation, scarce training samples, and inadequate predictive reliability. Summary of the Invention

[0003] The technical problem to be solved by this invention is to provide a feature- and knowledge-driven optimal parallelism prediction method, system, and medium to address the above-mentioned problems in existing parallel program optimal parallelism prediction. This invention aims to solve the technical problems of insufficient feature representation, scarce training samples, and insufficient rationality and generalization ability of prediction results in existing parallel program optimal parallelism prediction, so as to achieve efficient, accurate, and reliable prediction of the optimal parallelism of the program, improve computational efficiency, reduce system resource consumption, and reduce program execution time.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A feature- and knowledge-driven method for predicting optimal parallelism includes the following steps: S101, obtain the multi-dimensional runtime features of the target parallel program and embed them into the encoding to obtain multi-dimensional fusion features; S102, input the multi-dimensional fusion features into the pre-trained speedup prediction model to predict the speedup of the target parallel program under given multiple degrees of parallelism. The speedup prediction model is a neural network prediction model, and the mapping relationship between the multi-dimensional fusion features of the parallel program and the speedup under given multiple degrees of parallelism is established by training samples constructed in advance using the multi-dimensional fusion features of the parallel program samples and the prior knowledge of the speedup under different degrees of parallelism. S103, select the parallelism with the highest speedup ratio as the optimal parallelism obtained from the prediction.

[0005] Optionally, the multi-dimensional runtime features in step S101 include the computational features, memory access features, communication features, and program identifier of the target parallel program during runtime. The computational features are CPU-related data extracted from performance counter data during the parallel program's execution. The memory access features are memory access-related data during the parallel program's execution. The communication features are inter-process behavior data during the parallel program's execution. Furthermore, when embedding and encoding the program identifier, it includes determining whether the target parallel program is in a preset parallel program sample and determining the embedding and encoding result of the program identifier according to the following formula: ; in, Parallel Programs for Targets The embedded encoding result of the program identifier, This indicates that the target parallel program is among the preset parallel program samples. This indicates that the target parallel program is not in the preset parallel program sample. This is the maximum index value of the preset parallel program sample. The default embedding encoding result is used; the multi-dimensional fusion feature is obtained by concatenating the embedding encoding results of each runtime feature in the multi-dimensional runtime feature.

[0006] Optionally, the CPU-related data includes some or all of the cache miss count and branch prediction miss count; the memory access-related data includes some or all of the memory usage and read / write status; and the inter-process behavior data includes some or all of the data transfer volume and number of transfers.

[0007] Optionally, after step S101 and before step S102, the method further includes calculating the distance between each cluster in the clustering result of the multivariate fusion features of the target parallel program and the multivariate fusion features of the preset parallel program samples, finding the closest cluster, and using the multivariate fusion features corresponding to the cluster center of the closest cluster as the final multivariate fusion features of the target parallel program; the preset parallel program samples are the parallel program samples used when training the speedup prediction model.

[0008] Optionally, training the speedup prediction model includes: S201: Obtain multi-dimensional runtime features of a batch of parallel program samples running at multiple parallelism levels within a given range and embed them into the encoding to obtain multi-dimensional fusion features. S202, for each parallel program sample, generates multi-dimensional fusion features based on multiple parallelism runtimes within a given parallelism range. A combination of parallelism windows, Indicates from Select from 10 different elements The number of combinations of elements, where For the number of parallelisms within a given range, This determines the parallelism window size, thus obtaining the size of each parallelism window. A training set is constructed from multi-factor fusion features with parallelism of 1, and a length of 1 is given. Within a given range of parallelism Construct training samples with varying degrees of parallelism; S203, Construct a neural network prediction model as a speedup prediction model. The input of the neural network prediction model is the multi-dimensional fusion features of the parallel program, and the output is the speedup under different degrees of parallelism. S204 optimizes the model parameters of the neural network prediction model using training samples, a preset loss function, and a Bayesian hyperparameter optimization algorithm, thereby obtaining a trained prediction model with a faster speedup.

[0009] Optionally, the preset loss function is the loss function with Amdahl's law constraint added, as shown in the following formula: ; in, Parallel program sample The loss function after adding Amdahl's law constraint, Parallel program sample The mean square error loss, The coefficient of the regularization error term is . This is a reference quantity in Amdahl's law that characterizes the proportion of a program that can be parallelized. To obtain the maximum value, Parallel program sample Given the j-th degree of parallelism within a given range, for Relative acceleration ratio The reciprocal of.

[0010] Optionally, the parallel program sample The expression for the mean squared error loss is: ; in, Parallel program sample The mean square error loss, For the number of parallelisms within a given range, For a given range of parallelism The actual relative acceleration ratio The reciprocal of; To speed up the prediction model for a given range of parallelism. Predicted relative acceleration ratio The reciprocal of; the relative acceleration ratio The expression for the computation function is: ; in, Parallel program sample The speedup performance when running at the j-th degree of parallelism within a given range of parallelism. Parallel program sample Acceleration performance when running at the minimum parallelism within a given range of parallelism.

[0011] The present invention also provides a feature and knowledge-driven optimal parallelism prediction system, comprising an interconnected microprocessor and a memory, wherein the microprocessor is programmed or configured to execute the feature and knowledge-driven optimal parallelism prediction method.

[0012] The present invention also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute the feature- and knowledge-driven optimal parallelism prediction method by a processor.

[0013] To address the problems of insufficient feature representation, scarce training samples, and inadequate prediction results and generalization ability in existing technologies, this invention obtains multi-dimensional runtime features of the target parallel program and embeds them into encoding to obtain multi-dimensional fusion features. These multi-dimensional fusion features are then input into a pre-trained speedup prediction model to predict the speedup of the target parallel program under multiple given degrees of parallelism. The parallelism with the highest speedup is selected as the predicted optimal parallelism. The speedup prediction model is a neural network prediction model, and it is trained using training samples constructed from the multi-dimensional fusion features of parallel program samples and prior knowledge of speedup under different degrees of parallelism to establish a mapping relationship between the multi-dimensional fusion features of the parallel program and the speedup under multiple given degrees of parallelism. This achieves the following beneficial effects: 1. Significantly improved prediction accuracy: Through the modeling method of constructing multi-dimensional fusion features and constraining domain knowledge, the complex relationship between program performance and parallelism is comprehensively captured, effectively avoiding misjudgment of "local optima" and improving the accuracy of optimal parallelism prediction; 2. Optimized sample utilization: Without adding additional pre-run sampling, the sample expansion method using multiple local parallelism windows fully utilizes limited sampled data to generate high-quality training samples, reducing data dependence; 3. Enhanced generalization ability: By leveraging Bayesian hyperparameter optimization and implicit feature modeling, the model's adaptability to different types of parallel programs is improved, effectively addressing the prediction needs of unknown programs; 4. Increased result reliability: By introducing domain knowledge constraints, abnormal prediction results are avoided, ensuring that the prediction output conforms to the basic principles of parallel computing, thus enhancing the practical value of the solution. Therefore, this invention can improve the accuracy, generalization ability, and result reliability of optimal parallelism prediction for parallel programs, and is suitable for various scenarios relying on parallel computing, such as large-scale scientific computing and deep learning model training. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the basic process of the method in an embodiment of the present invention.

[0015] Figure 2 This is a schematic diagram of the training process of the speedup prediction model in an embodiment of the present invention. Detailed Implementation

[0016] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be further described in detail below with reference to the accompanying drawings in the embodiments of the present invention.

[0017] like Figure 1 As shown, the feature- and knowledge-driven optimal parallelism prediction method in this embodiment includes the following steps: S101, obtain the multi-dimensional runtime features of the target parallel program and embed them into the encoding to obtain multi-dimensional fusion features; S102, input the multi-dimensional fusion features into the pre-trained speedup prediction model to predict the speedup of the target parallel program under given multiple degrees of parallelism. The speedup prediction model is a neural network prediction model, and the mapping relationship between the multi-dimensional fusion features of the parallel program and the speedup under given multiple degrees of parallelism is established by training samples constructed in advance using the multi-dimensional fusion features of the parallel program samples and the prior knowledge of the speedup under different degrees of parallelism. S103, select the parallelism with the highest speedup ratio as the optimal parallelism obtained from the prediction.

[0018] Step S101 is the step of constructing multi-dimensional fusion features, which includes collecting multi-dimensional runtime features and encoding them through an embedding encoding mechanism, encoding implicit features such as program identifiers and behavior similarity clustering, generating a unified dimension fusion feature vector, realizing the fusion representation of explicit features and implicit features, and comprehensively depicting the program behavior pattern.

[0019] The multi-dimensional runtime features in step S101 of this embodiment include the computational features, memory access features, communication features, and program identifier of the target parallel program during runtime. The computational features are CPU-related data extracted from the performance counter (PMC) data during the parallel program's execution. The memory access features are memory access-related data during the parallel program's execution, which can be sampled using relevant commands (such as perf, top, etc.). The communication features are inter-process behavior data during the parallel program's execution, which can be obtained using relevant tools (such as mpiP, etc.). The CPU-related data includes cache miss counts, branch prediction miss counts, etc.; the memory access-related data includes memory usage, read / write activity (such as read / write volume, read / write rate, read / write bandwidth, etc.); and the inter-process behavior data includes the amount of data transferred, the number of transfers, etc. For the program... Its runtime feature vector Includes computational features Memory access characteristics and communication characteristics During training, further consideration needs to be given to relevant program configuration features. (Parallelism), the target parallelism sequence is: , The feature vector of the target parallelism sequence can be obtained through encoding. .

[0020] The embedding encoding of program identifiers is used to represent the feature labels of known programs, so that when these programs are run again, a preliminary feature representation can be obtained. The embedding encoding result of the program identifier is not obtained through direct extraction, but through an embedding encoding layer. This embedding encoding layer can be used as a component of the speedup prediction model, dynamically updating its parameters during the training process. During model training, the embedding encoding result of the program identifier is continuously updated through backpropagation to achieve the goal of minimizing the speedup prediction error. In this embodiment, the embedding encoding of the program identifier includes determining whether the target parallel program is in a preset parallel program sample, and determining the embedding encoding result of the program identifier according to the following formula: ; in, Parallel Programs for Targets The embedded encoding result of the program identifier, This indicates that the target parallel program is among the preset parallel program samples. This indicates that the target parallel program is not in the preset parallel program sample. This is the maximum index value of the preset parallel program sample. The default embedding encoding result is used; the multi-dimensional fusion feature is obtained by concatenating the embedding encoding results of each runtime feature in the multi-dimensional runtime feature set. (Default embedding encoding result) Specifically, this refers to the program identifier embedding encoding vector assigned to programs not appearing in the training set. Its purpose is to ensure that the prediction model can output prediction results correctly during the speedup prediction process. (Default embedding encoding result) Instead of being obtained through feature extraction, it is generated through artificial settings, such as setting it as an all-zero vector or randomly assigning an existing program identifier embedding vector from the training set.

[0021] Program clustering is used to describe the similarity characteristics of parallel programs (with other known programs) in behavior. In this embodiment, after step S101 and before step S102, cluster embedding is also included, that is: calculating the distance between each cluster in the clustering result of the multivariate fusion features of the target parallel program and the multivariate fusion features of the preset parallel program samples, finding the nearest cluster, and using the multivariate fusion feature corresponding to the cluster center of the nearest cluster as the final multivariate fusion feature of the target parallel program; the preset parallel program samples are the parallel program samples used when training the speedup prediction model. For example, specifying the number of clusters. For known program assemblies Construct the initial cluster partitions And trained the program to belong to The eigenvector representation corresponding to the cluster In forecasting, for newly arriving procedures... The corresponding clusters are obtained based on the initial clustering partition. and return its feature vector representation. .

[0022] like Figure 2 As shown, the training of the speedup prediction model in this embodiment includes: S201: Obtain multi-dimensional runtime features of a batch of parallel program samples running at multiple parallelism levels within a given range and embed them into the encoding to obtain multi-dimensional fusion features. S202, for each parallel program sample, generates multi-dimensional fusion features based on multiple parallelism runtimes within a given parallelism range. A combination of parallelism windows, Indicates from Select from 10 different elements The number of combinations of elements, i.e.: ; in For the number of parallelisms within a given range, For the parallelism window size, " represents factorial; thus obtaining the window size for each degree of parallelism" A training set is constructed from multi-factor fusion features with parallelism of 1, and a length of 1 is given. Within a given range of parallelism Construct training samples with varying degrees of parallelism; S203, Construct a neural network prediction model as a speedup prediction model. The input of the neural network prediction model is the multi-dimensional fusion features of the parallel program, and the output is the speedup under different degrees of parallelism. S204 optimizes the model parameters of the neural network prediction model using training samples, a preset loss function, and a Bayesian hyperparameter optimization algorithm, thereby obtaining a trained prediction model with a faster speedup.

[0023] Step S202 is used for multi-window sample expansion. In this embodiment, based on the core idea of ​​"local prediction of global," a local parallelism window of a preset size is set to combine the sampling parallelism of a single program, generating multiple training samples covering different parallelism intervals. This expands the sample size while preserving the performance evolution correlation between parallelisms, thus improving the model's extrapolation capability. Specifically, a local parallelism window size can be set. For each sampling procedure If the program has a high degree of parallelism Run the following command to generate There are several parallelism window combinations, and the relevant features under each parallelism combination constitute a training set. Accordingly, for the program that needs to make predictions, the window size needs to be collected. Performance characteristics of program execution under parallelism, and also provide the length of the program. The prediction target parallelism sequence is used to predict the performance changes of the program under these parallelism levels.

[0024] In step S203, when constructing the neural network prediction model as the speedup prediction model, a multilayer learning machine (MLP) can be used. The relative speedup of the program under the target parallelism is used as the prediction target. Domain prior knowledge reflecting the reasonableness of the speedup is introduced to avoid the predicted speedup being too large, too small, or even negative, ensuring the reasonableness of the prediction results. During model training, a penalty term inspired by Amdahl's Law is added to the calculation of modeling error. Amdahl's Law is a law describing the speedup of parallel programs. It states that there is an upper limit to the speedup of parallel programs. When the speedup predicted by the model exceeds this upper limit, it indicates that the model prediction result is unreasonable, and a corresponding model penalty is imposed. Specifically, in this embodiment, the preset loss function is the loss function after adding the Amdahl's Law constraint, as shown in the following formula: ; in, Parallel program sample The loss function after adding Amdahl's law constraint, Parallel program sample The mean square error loss, The coefficient of the regularization error term (Amdahl's law penalty term) is... This is a reference quantity in Amdahl's law that characterizes the proportion of a program that can be parallelized. To obtain the maximum value, Parallel program sample Given the j-th degree of parallelism within a given range, for Relative acceleration ratio The reciprocal of the formula. That is, for each predicted speedup result, Amdahl's Law determines whether to accumulate the error. Amdahl's Law is a reference value characterizing the proportion of the program that can be parallelized. It is a component of the model's hyperparameters. It is the coefficient of the regularization error term and a component of the model's hyperparameters; its optimal value can be obtained through training.

[0025] For the program The model predicts the reciprocal of the relative speedup. According to Amdahl's law, the relative speedup of this program has an upper limit, meaning its reciprocal has a lower limit. Therefore, the parallel program sample in this embodiment The expression for the mean squared error loss is: ; in, Parallel program sample The mean square error loss, For the number of parallelisms within a given range, For a given range of parallelism The actual relative acceleration ratio The reciprocal of; To speed up the prediction model for a given range of parallelism. Predicted relative acceleration ratio The reciprocal of; the relative acceleration ratio The expression for the computation function is: ; in, Parallel program sample The speedup performance when running at the j-th degree of parallelism within a given range of parallelism. Parallel program sample Acceleration performance when running at the minimum parallelism within a given range of parallelism.

[0026] In step S204, when optimizing the model parameters of the neural network prediction model using training samples, a preset loss function, and the Bayesian hyperparameter optimization algorithm, to address the issues of model parameter sensitivity and low efficiency of manual tuning, the Bayesian hyperparameter optimization algorithm is used to iteratively search for key hyperparameters such as feature dimensions, network structure parameters, and constraint weights to obtain the optimal parameter configuration, thereby improving the model's prediction accuracy and generalization ability. It should be noted that the Bayesian hyperparameter optimization algorithm is a well-known method for optimizing model parameters in neural network prediction models; therefore, its implementation details will not be elaborated here. Based on the model being trained with various local parallelisms, for the parallel program to be predicted, feature data under local parallelism with a window size consistent with the training samples is collected, input into the Bayesian-optimized neural network model, and the program speedup ratio within the target parallelism range is output, thus determining the optimal parallelism of the program. In this embodiment, based on the neural network model of the feature and knowledge-driven optimal parallelism prediction method being trained with various local parallelisms, the running characteristics of the program to be predicted under partial parallelism are input, and the prediction speedup ratio within the target parallelism range is output, thus determining the optimal parallelism.

[0027] To verify the feature- and knowledge-driven optimal parallelism prediction method of this embodiment, this embodiment tested a set of known parallel program benchmark programs, including CG(C), CG(D), HPL-AI, EP(C), EP(D), BFS(20), BFS(21), BFS(22), IS(D), LU(C), LU(D), SMG2000, and HPCG. Based on the method of this embodiment, the optimal execution time (method ①), default (method ②), no embedding (program identifier embedding + cluster embedding, method ③), only program identifier embedding (method ④), only cluster embedding (method ⑤), no multi-window sample expansion (methods ⑥ and ⑦), no regularization error term (Amdahl's law penalty term, method ⑧), and Bayesian hyperparameter optimization (method ⑨) were tested. The final execution time test results under various methods are shown in Table 1.

[0028] Table 1: Execution time test results under various methods

[0029] In Table 1, the optimal execution time (Method ①) refers to the execution time of the program under the actual optimal parallelism, while the default (Method ②) refers to the error under the default hyperparameter configuration. For easier understanding, a plus sign is added to indicate "how much longer (slower) the predicted optimal execution time is compared to the actual optimal time." In the methods without multi-window sample expansion (Methods ⑥ and ⑦), Method ⑥ (TrainGen WLeastP) means not using training set expansion, but only using the minimum parallelism to construct the training set (the number of parallelisms is the same as the local parallelism window size). Method ⑦ (TrainGen WMostP) means not using training set expansion, but only using the maximum parallelism to construct the training set (the number of parallelisms is the same as the local parallelism window size). As shown in Table 1, in this embodiment, program identifier embedding, cluster embedding, multi-window sample expansion, regularization error term (Amdahl's law penalty term), and Bayesian hyperparameter optimization can all reduce the gap between the predicted optimal parallelism and the actual optimal parallelism, improving program performance and enhancing the prediction effect of optimal parallelism.

[0030] Those skilled in the art will understand that the technical solutions provided by this invention can take the form of methods, systems, or computer program products. For example, this invention can provide a feature- and knowledge-driven optimal parallelism prediction system, including an interconnected microprocessor and a memory, wherein the microprocessor is programmed or configured to execute the feature- and knowledge-driven optimal parallelism prediction method. This invention can provide a computer-readable storage medium storing a computer program or instructions programmed or configured to execute the feature- and knowledge-driven optimal parallelism prediction method via a processor. This invention can provide a computer program product including a computer program or instructions programmed or configured to execute the feature- and knowledge-driven optimal parallelism prediction method via a processor. This invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this invention can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of a flowchart and / or block diagram, and combinations of blocks in a flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0031] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A feature- and knowledge-driven optimal parallelism prediction method, characterized in that, Includes the following steps: S101, obtain the multi-dimensional runtime features of the target parallel program and embed them into the encoding to obtain multi-dimensional fusion features; S102, input the multi-dimensional fusion features into the pre-trained speedup prediction model to predict the speedup of the target parallel program under given multiple degrees of parallelism. The speedup prediction model is a neural network prediction model, and the mapping relationship between the multi-dimensional fusion features of the parallel program and the speedup under given multiple degrees of parallelism is established by training samples constructed in advance using the multi-dimensional fusion features of the parallel program samples and the prior knowledge of the speedup under different degrees of parallelism. S103, select the parallelism with the highest speedup ratio as the optimal parallelism obtained from the prediction.

2. The feature- and knowledge-driven optimal parallelism prediction method according to claim 1, characterized in that, The multi-dimensional runtime features in step S101 include the computational features, memory access features, communication features, and program identifier of the target parallel program during runtime. The computational features are CPU-related data extracted from performance counter data during the parallel program's execution. The memory access features are memory access-related data during the parallel program's execution. The communication features are inter-process behavior data during the parallel program's execution. Furthermore, when embedding and encoding the program identifier, it includes determining whether the target parallel program is in a preset parallel program sample and determining the embedding and encoding result of the program identifier according to the following formula: ; in, Parallel Programs for Targets The embedded encoding result of the program identifier, This indicates that the target parallel program is among the preset parallel program samples. This indicates that the target parallel program is not in the preset parallel program sample. This is the maximum index value of the preset parallel program sample. The default embedding encoding result is used; the multi-dimensional fusion feature is obtained by concatenating the embedding encoding results of each runtime feature in the multi-dimensional runtime feature.

3. The feature- and knowledge-driven optimal parallelism prediction method according to claim 2, characterized in that, The CPU-related data includes some or all of the cache miss count and branch prediction miss count; the memory access-related data includes some or all of the memory usage rate and read / write status; and the inter-process behavior data includes some or all of the data transfer volume and number of transfers.

4. The feature- and knowledge-driven optimal parallelism prediction method according to claim 1, characterized in that, After step S101 and before step S102, the method further includes calculating the distance between each cluster in the clustering result of the multivariate fusion features of the target parallel program and the multivariate fusion features of the preset parallel program samples, finding the closest cluster, and using the multivariate fusion features corresponding to the cluster center of the closest cluster as the final multivariate fusion features of the target parallel program; the preset parallel program samples are the parallel program samples used when training the speedup prediction model.

5. The feature- and knowledge-driven optimal parallelism prediction method according to claim 1, characterized in that, The training of the speedup prediction model includes: S201: Obtain multi-dimensional runtime features of a batch of parallel program samples running at multiple parallelism levels within a given range and embed them into the encoding to obtain multi-dimensional fusion features. S202, for each parallel program sample, generates multi-dimensional fusion features based on multiple parallelism runtimes within a given parallelism range. A combination of parallelism windows, Indicates from Select from 10 different elements The number of combinations of elements, where For the number of parallelisms within a given range, This determines the parallelism window size, thus obtaining the size of each parallelism window. A training set is constructed from multi-factor fusion features with parallelism of 1, and a length of 1 is given. Within a given range of parallelism Construct training samples with varying degrees of parallelism; S203, Construct a neural network prediction model as a speedup prediction model. The input of the neural network prediction model is the multi-dimensional fusion features of the parallel program, and the output is the speedup under different degrees of parallelism. S204 optimizes the model parameters of the neural network prediction model using training samples, a preset loss function, and a Bayesian hyperparameter optimization algorithm, thereby obtaining a trained prediction model with a faster speedup.

6. The feature- and knowledge-driven optimal parallelism prediction method according to claim 5, characterized in that, The preset loss function is the loss function after adding Amdahl's law constraint, as shown in the following formula: ; in, Parallel program sample The loss function after adding Amdahl's law constraint, Parallel program sample The mean square error loss, The coefficient of the regularization error term is . This is a reference quantity in Amdahl's law that characterizes the proportion of a program that can be parallelized. To obtain the maximum value, Parallel program sample Given the j-th degree of parallelism within a given range, for Relative acceleration ratio The reciprocal of.

7. The feature- and knowledge-driven optimal parallelism prediction method according to claim 6, characterized in that, The parallel program sample The expression for the mean squared error loss is: ; in, Parallel program sample The mean square error loss, For the number of parallelisms within a given range, For a given range of parallelism The actual relative acceleration ratio The reciprocal of; To speed up the prediction model for a given range of parallelism. Predicted relative acceleration ratio The reciprocal of; the relative acceleration ratio The expression for the computation function is: ; in, Parallel program sample The speedup performance when running at the j-th degree of parallelism within a given range of parallelism. Parallel program sample Acceleration performance when running at the minimum parallelism within a given range of parallelism.

8. A feature- and knowledge-driven optimal parallelism prediction system, comprising interconnected microprocessors and memory, characterized in that, The microprocessor is programmed or configured to execute the feature- and knowledge-driven optimal parallelism prediction method as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute the feature- and knowledge-driven optimal parallelism prediction method of any one of claims 1 to 7 via a processor.

Citation Information

Patent Citations

  • Machine learning based method for predicating parameters during MPI (message passing interface) optimal operation in multi-core environments

    CN102708404A

  • Self-distillation training method and device for convolutional neural network, and scalable dynamic prediction method

    WO2021023202A1