Automatic compiler tuning method based on asynchronous data fusion Bayesian optimization

CN122569947APending Publication Date: 2026-08-14松雅湖人工智能创新中心
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

当编译调优任务从高算力的台式机平台迁移至资源受限的低算力平台时,计算资源不足导致评估时间延长,在相同时间内能够完成的搜索次数减少,使得调优过程的整体速度变慢

Benefits of technology

[0011]与相关技术相比较,本发明在低算力平台进行调优的同时引入一个高算力平台,通过贝叶斯优化先对候选参数列表进行预测,并选择最优参数进行真实评估,解决在低算力平台下编译调优速度变慢的问题;通过异步并行机制,让两个不同算力平台同时进行独立的编译调优进程,同时采用能相互共享的数据融合机制,让高算力平台快速产生的低保真数据辅助低算力平台的编译自动调优进程,提升了低算力平台编译自动调优的效率和速度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122569947A_ABST
    Figure CN122569947A_ABST
Patent Text Reader

Abstract

This invention provides an automatic compiler tuning method based on asynchronous data fusion Bayesian optimization. The method includes a low-computing-power platform A generating high-fidelity data and a high-computing-power platform B generating low-fidelity data, with data sharing between the platforms. Each platform constructs a proxy model; the low-fidelity proxy model is fitted using low-fidelity data, while the high-fidelity proxy model is trained and updated using data fusion. Each platform selects the optimal compilation parameters after model fitting using a data acquisition function for actual evaluation, obtaining the performance speedup ratio. Evaluation data is then used for iterative analysis, outputting the maximum performance speedup ratio and its corresponding compilation parameter combination. Compared with related technologies, the automatic compiler tuning method based on asynchronous data fusion Bayesian optimization provided by this invention can improve compilation tuning efficiency and increase the utilization of computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to the field of compiler optimization technology. Background Technology

[0002] Modern compilers (such as GCC and LLVM) typically offer hundreds of configurable optimization options, and different optimization options and their parameter combinations can significantly affect the performance of the generated code. Automatic compiler tuning aims to automatically find the optimal compilation configuration that maximizes specific performance metrics for a particular target program and hardware platform from a vast parameter space, and has become one of the key technologies for improving program execution efficiency.

[0003] Among existing automated compiler tuning methods, the Bayesian optimization tools SMAC3 and BOCA represent the mainstream technical approaches. SMAC3 uses a random forest as a surrogate model, achieving efficient global exploration by integrating model uncertainty, demonstrating excellent convergence speed and stability in compiler tuning. BOCA, on the other hand, introduces a two-stage candidate generation strategy based on the Bayesian optimization framework. It first enumerates key optimization combinations based on Gini importance, and then dynamically reduces the number of explorations for minor optimizations using a normal decay function, effectively improving search efficiency in high-dimensional discrete spaces. Both tools significantly reduce evaluation overhead on the target device through intelligent sampling strategies, providing a practical solution for automated compiler tuning.

[0004] Despite significant advancements in automated compiler tuning technology, limitations remain when performing automated compiler tuning on resource-constrained, low-computing-power platforms. The numerous optimization parameters of modern compilers and their complex interactions result in a vast number of parameter combinations, forming a discrete search space on the order of hundreds of millions. This enormous discrete search space places high demands on the efficiency and computational power of compiler tuning. When compiler tuning tasks are migrated from high-performance desktop platforms to resource-constrained, low-computing-power platforms, insufficient computing resources lead to longer evaluation times and fewer searches that can be completed within the same timeframe, thus slowing down the overall tuning process.

[0005] Therefore, it is necessary to provide a novel automatic compiler tuning method based on asynchronous data fusion Bayesian optimization to overcome the above-mentioned shortcomings. Summary of the Invention

[0006] The purpose of this invention is to provide a novel automatic compilation tuning method based on asynchronous data fusion Bayesian optimization, which can improve compilation tuning efficiency and increase the utilization of computing resources.

[0007] To achieve the above objectives, this invention provides an automatic compiler tuning method based on asynchronous data fusion Bayesian optimization, comprising: For generating high-fidelity data Low-computing-power platform A and the generation of low-fidelity data The high-computing-power platform B performs initial sampling and enables bidirectional data synchronization and exchange between the low-computing-power platform A and the high-computing-power platform B through a shared storage queue. Each platform uses a Bayesian optimization algorithm to compile and optimize, constructing a high-fidelity proxy model and a low-fidelity proxy model. The low-fidelity proxy model is fitted using low-fidelity data, while the high-fidelity proxy model is based on high-fidelity data and uses data fusion to train and update the model. Each platform selects the best compilation parameters from the data used to fit the proxy model using a data acquisition function. A practical evaluation was conducted to obtain the performance speedup of the program to be optimized after compilation optimization. Thus, evaluation data is obtained. The process is iterated to output the maximum performance speedup obtained during the entire iteration process and the corresponding combination of compilation parameters.

[0008] The present invention also provides an apparatus for an automatic compiler tuning method based on asynchronous data fusion Bayesian optimization, the apparatus comprising: Low-computing-power platform, used to compile and optimize programs to generate and output high-fidelity data; High-performance computing platforms are used to receive data from low-performance computing platforms to assist the low-performance computing platforms in optimization, and to generate and output low-fidelity data. A shared data queue is used to store data on low-computing-power platforms and high-computing-power platforms, and to share and exchange data on each platform. The surrogate model is used to predict candidate compilation parameters. Two sets of data from different platforms are used to train a low-fidelity surrogate model and a high-fidelity surrogate model respectively. The low-fidelity surrogate model provides prior knowledge to the high-fidelity surrogate model, and the high-fidelity surrogate model outputs the predicted probability of candidate compilation parameters. The collection function is used to select the most valuable compilation parameter from a number of candidate compilation parameters and output the evaluation value of the candidate compilation parameter.

[0009] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the automatic compilation tuning method based on asynchronous data fusion Bayesian optimization.

[0010] The present invention also provides a computer terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the automatic compilation tuning method based on asynchronous data fusion Bayesian optimization.

[0011] Compared with related technologies, this invention introduces a high-performance computing platform while performing optimization on a low-performance computing platform. It first predicts the candidate parameter list using Bayesian optimization and then selects the optimal parameters for real-world evaluation, solving the problem of slow compilation and optimization speed on low-performance computing platforms. Through an asynchronous parallel mechanism, two different computing platforms can simultaneously perform independent compilation and optimization processes. Furthermore, a data fusion mechanism that allows for mutual sharing enables low-fidelity data rapidly generated by the high-performance computing platform to assist the automatic compilation and optimization process on the low-performance computing platform, improving the efficiency and speed of automatic compilation and optimization on the low-performance computing platform. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. The accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 This is a schematic diagram of the automatic compilation tuning process based on asynchronous data fusion Bayesian optimization in this invention. Detailed Implementation

[0013] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] This invention proposes an automatic compiler tuning method based on asynchronous data fusion Bayesian optimization (aNARBO). The core idea of ​​this method is to construct a cross-platform collaborative tuning mechanism, using a high-computing-power platform to assist a low-computing-power platform in completing the compiler tuning work.

[0015] Although different target platforms differ at the instruction set architecture and microarchitecture levels, the mapping relationship between compilation options and program performance exhibits a degree of transferability. Leveraging this characteristic, an automatic compiler tuning method based on asynchronous data fusion Bayesian optimization (aNARBO) is introduced to high-performance computing platforms. This method transfers knowledge of compilation options and program performance from low-performance computing platforms to the high-performance platform for learning, enabling it to quickly generate a large amount of low-fidelity performance evaluation data to assist in tuning on the low-performance platform. The evaluation results generated by the low-performance platform are then fed back to the high-performance platform for information correction. By transferring this cross-platform knowledge, cross-platform asynchronous parallel automatic compiler tuning is achieved.

[0016] Please see Figure 1As shown, this invention provides an automatic compilation tuning method based on asynchronous data fusion Bayesian optimization, comprising: Step 1: Generate high-fidelity data Low-computing-power platform A and the generation of low-fidelity data The high-performance computing platform B performs initial sampling and enables bidirectional data synchronization and exchange between the low-performance computing platform A and the high-performance computing platform B through a shared storage queue.

[0017] High-fidelity data refers to real evaluation data generated by low-computing-power platforms. The target platform for compilation optimization is a low-computing-power platform. Real evaluation data from low-computing-power platforms can reflect the mapping relationship between compilation parameters and program performance on that platform. It is accurate and faithful, hence the name high-fidelity data.

[0018] Low-fidelity data refers to real evaluation data generated by high-computing-power platforms. High-computing-power platforms serve as auxiliary platforms for compiling and optimizing low-computing-power platforms. The data generated by high-computing-power platforms cannot truly reflect the mapping relationship between compilation parameters and program performance for low-computing-power platforms. Therefore, it is inaccurate and unfidelity-based, hence the term low-fidelity data.

[0019] Specifically, this includes: S1 parameter configuration initialization. Set the number of iterations for the compilation optimization task, the program to be optimized, the required compiler and its storage path, load the configuration file, and initialize the compiler path and runtime environment; select two platforms, A and B, to generate high-fidelity data. Low-computing-power platform A and the generation of low-fidelity data High-performance computing platform B, where the subscript , They represent high fidelity and low fidelity respectively. For compilation parameter vectors, To evaluate the performance speedup ratio obtained from the computing platform assessment, a multi-dimensional parameter space is constructed using a low-computing-power platform A as the target device. The search range and parameter value set are determined based on the compilation task type. Subsequent compilation optimization tasks sample from the parameter space to obtain combinations of compilation parameter vectors. ; S2 establishes queue communication and synchronization barriers. Define two queues To transfer evaluation results from low-computing-power platform A to high-computing-power platform B and To transfer evaluation results from high-performance computing platform B to low-performance computing platform A, a barrier synchronization mechanism is employed to ensure that all platforms execute synchronously during the initialization phase and complete preliminary sampling. Specifically, low-performance computing platform A first samples the data in the parameter space and processes the sampled data... An evaluation was conducted to obtain evaluation data. ), It is the performance speedup obtained by evaluating each vector in X, and then processed through a queue. Shared assessment data After receiving data from the low-computing-power platform A, the high-computing-power platform B performs an evaluation to obtain evaluation data. via queue Data synchronization with low-computing-power platform A; data exchange and synchronization between high- and low-computing-power platforms to ensure that each platform has complete high- and low-fidelity data.

[0020] Step 2: For each platform, the Bayesian optimization algorithm is used to compile and optimize the model to build a high-fidelity proxy model and a low-fidelity proxy model. The low-fidelity proxy model is fitted with low-fidelity data, while the high-fidelity proxy model is based on high-fidelity data. The model is trained and updated using a data fusion method.

[0021] Specifically, S3 model fitting Before model fitting, data is retrieved from the queue and synchronized to obtain the latest evaluation data. or Update the data to fit the proxy model.

[0022] Low-fidelity proxy model acquisition queue for low-computing-power platform A Low-fidelity assessment data ( Update the output mean The high-fidelity proxy model of low-computing-power platform A uses the high-fidelity evaluation data generated by low-computing-power platform A. First, the mean is obtained from the low-fidelity proxy model. High-fidelity assessment data ( Fusion Mean Feature concatenation is performed to form nonlinear enhanced input features. The data is then input into a high-fidelity proxy model for fitting and updating. High-computing-power platform B from queue Obtain high-fidelity evaluation data ( For the compilation parameter vector group Re-evaluation yielded low-fidelity data. The low-fidelity proxy model of high-computing-power platform B uses low-fidelity evaluation data generated by high-computing-power platform B. The high-fidelity proxy model of high-computing-power platform B is updated using high-fidelity evaluation data generated by low-computing-power platform A. To perform fitting, the input is first fed into a low-fidelity surrogate model to obtain the mean. High-fidelity assessment data ( Fusion Mean Feature concatenation is performed to form nonlinear enhanced input features. The data is then input into a high-fidelity proxy model for fitting and updating.

[0023] S4 Actual Assessment Step 3: Each platform selects the best compilation parameters from the candidate compilation parameters predicted by the proxy model through the collection function and performs actual evaluation.

[0024] The acquisition function focuses on the balance between exploration and utilization. The scheme uses two commonly used acquisition functions: PI (Probability of Improvement) and EI (Expected Improvement). Low-computing platform A uses PI as its acquisition function because its evaluation cost is higher, necessitating a high probability of improvement in each evaluation to discover better solutions. High-computing platform B uses the LFEI (Low-Frequency Exploration) portion of EI as its acquisition function, as it needs to discover potentially valuable search regions by searching the parameter space at low cost. The high-fidelity surrogate model's prediction input also employs nonlinear autoregressive data fusion, averaging the output predicted by the low-fidelity surrogate model. Concatenate the original input candidate parameter vector Obtain new data .

[0025] After each platform completes the agent model update, it processes the new batch of sampled data. To perform probabilistic predictions, a low-fidelity surrogate model is first used to generate the prediction mean. The candidate parameters will mean These features are concatenated as additional features to form non-linear enhanced input features. The data is input into a high-fidelity proxy for prediction, and the acquisition function selects the optimal compilation parameters based on the prediction results of the high-fidelity proxy model. Using compilation parameters Compile and run the program for practical evaluation to obtain the performance speedup of the program after compilation optimization. Thus, evaluation data is obtained. The new assessment data The evaluation data generated by low-computing-power platform A is sent to the corresponding queue. for Evaluation data generated by high-computing-power platform B for .

[0026] Each platform separately evaluated the data. The process iterates, sequentially executing steps such as surrogate model update, performance prediction, parameter selection based on the acquisition function, real evaluation, and data feedback. In the compilation optimization task, the core step is the iterative search process based on the surrogate model and acquisition function. The surrogate model is a probabilistic statistical model built on historical observation data, used to predict the performance of unevaluated compilation parameters, outputting their expected estimates and uncertainty measures. The acquisition function is a decision function that calculates the expected utility of each candidate parameter based on the expected estimates and uncertainty measures provided by the surrogate model, and selects the compilation parameter vector with the highest expected utility as the evaluation point for this iteration. After selecting parameters, the system executes a real compilation and execution process, measuring the actual program performance observations under those parameters, and adding them to the historical dataset to update the surrogate model. This process iterates cyclically, gradually approaching the optimal compilation parameter configuration with fewer real evaluations through a closed loop of "prediction-decision-evaluation-update." The loop exits when the number of iterations reaches a threshold, outputting the maximum performance improvement achieved by the optimized program after compilation tuning. and the combination of compilation parameters used Save the generated binary files and tuning logs, and generate a visualization of the compilation and tuning results.

[0027] Overall overview of the plan: The low-computing-power platform is used as the target optimization platform. Therefore, the low-computing-power platform generates high-fidelity data, denoted by the subscript h, while the high-computing-power platform generates low-fidelity data, denoted by the subscript l. During the compilation optimization process, initialization sampling is performed first. This initialization sampling utilizes a synchronization mechanism; the low-computing-power platform first samples in the parameter space to obtain the compilation parameter vector set. The compilation parameter vector was evaluated in practice to obtain high-fidelity data. And upload the evaluation data to the queue. Medium. High-performance computing platforms from queues Obtaining high-fidelity data And compile the parameter vector group Re-evaluation yielded low-fidelity data. And upload the data to the queue. In the middle, low-computing-power platforms from the queue Obtaining low-fidelity data This completes the initial sampling; both platforms now have two sets of data simultaneously. and Initially, these two sets of data were used to train and fit the surrogate model.

[0028] Proxy model fitting process. Each platform uses a Bayesian optimization algorithm for compilation and optimization, constructing two proxy models: a high-fidelity proxy model and a low-fidelity proxy model. The low-fidelity proxy model uses low-fidelity data. Fitting. High-fidelity proxy models use data fusion for training and updating; specifically, low-fidelity proxy models use low-fidelity data vector sets. The model has been updated; the high-fidelity proxy model uses high-fidelity data vector groups. First, output through a low-fidelity proxy model. Predicted mean High-fidelity data vector group splicing predicted mean A new set of vectors is obtained. The high-fidelity proxy model uses new high-fidelity data. Perform training updates.

[0029] The compilation parameter vector set is obtained by random sampling in the parameter space. The mean of the predicted output is obtained by a low-fidelity proxy model. ,Will As a new feature, it is concatenated into the vector group. New sampling data were obtained. The new sampled data is used as input to the high-fidelity surrogate model. The resulting predictions (including mean, variance, and the current best evaluation) are passed to the acquisition function. The acquisition function calculates the acquisition function value for each vector based on the predictions and selects the vector with the largest value. Conduct an actual assessment and obtain the assessment results. The evaluation results will be used as high-fidelity data for the current iteration. Send to queue The compilation and optimization process for high-performance computing platforms follows the same principle: selecting the vector with the largest value. Conduct an actual assessment and obtain the assessment results. The evaluation results will be used as low-fidelity data for the current iteration. Send to queue Update the record based on the current evaluation results to reflect the best current evaluation outcome. and the corresponding parameter vector .

[0030] Subsequent iterations repeat the model fitting and compilation parameter prediction steps until the number of iterations is exhausted and the loop exits. Finally, this scheme outputs the maximum performance improvement achieved by the program to be optimized after compilation and tuning. and the combination of compilation parameters used .

[0031] The present invention also provides an apparatus for an automatic compiler tuning method based on asynchronous data fusion Bayesian optimization, the apparatus comprising: A low-computing-power platform is used to compile and optimize programs and output high-fidelity data. High-performance computing platforms are used to receive data from low-performance computing platforms to assist them in optimization and output low-fidelity data. High-fidelity data refers to real evaluation data generated by low-computing-power platforms. The target platform for compilation optimization is a low-computing-power platform. Real evaluation data from low-computing-power platforms can reflect the mapping relationship between compilation parameters and program performance on that platform. It is accurate and faithful, hence the name high-fidelity data. Low-fidelity data refers to the real evaluation data generated by the high-computing-power platform. The high-computing-power platform serves as an auxiliary platform for compilation and optimization of the low-computing-power platform. The data generated by the high-computing-power platform cannot truly reflect the mapping relationship between compilation parameters and program performance for the low-computing-power platform. Therefore, it is inaccurate and unfidelity-based, hence the name low-fidelity data. Shared data queue is used to store data from both the low-computing-power platform and the high-computing-power platform, and to share and exchange data between each platform. Proxy models are used to predict candidate compilation parameters, including low-fidelity proxy models and high-fidelity proxy models, and output expected estimates of program performance and uncertainty measures. The collection function is used to select the most valuable compilation parameters, which are then used for candidate real-world compilation evaluation.

[0032] Compared to existing technologies, this invention uses Bayesian optimization to first predict the candidate parameter list and then selects the optimal parameters for real evaluation, reducing the number of candidate parameter evaluations, reducing hardware resource consumption, and improving the efficiency and speed of automatic compilation tuning. Based on an asynchronous parallel architecture, high-fidelity and low-fidelity platforms can work independently and simultaneously, avoiding resource idleness issues in traditional serial solutions and significantly improving the utilization of computing resources. It uses a nonlinear feature enhancement method to train a high-fidelity proxy model, achieving deep fusion of high-fidelity and low-fidelity information at the data level and information correction for the proxy model. The final high-fidelity and low-fidelity proxy model has significantly better prediction accuracy than traditional methods, and the selected combination of compilation parameters is closer to the optimal solution.

[0033] In another aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described automatic compilation tuning method based on asynchronous data fusion Bayesian optimization.

[0034] As an extension of another aspect of the present invention, a computer terminal is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described automatic compilation tuning method based on asynchronous data fusion Bayesian optimization.

[0035] When the processor executes the computer program, it implements the functions of each module / unit in the above-described device embodiments. For example, the computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in a terminal device.

[0036] The computer terminal can be a desktop computer, laptop, handheld computer, or cloud server, etc. It may include, but is not limited to, a processor and memory. It may include more or fewer components, or a combination of certain components, or different components; for example, it may also include input / output devices, network access devices, buses, etc.

[0037] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0038] The memory can be an internal storage unit, such as a hard drive or RAM. It can also be an external storage device, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, or a Flash Card. Furthermore, the memory can include both internal and external storage units. The memory is used to store the computer program, as well as other programs and data. The memory can also be used to temporarily store data that has been output or will be output.

[0039] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0040] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0041] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0042] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0043] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0044] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0045] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0046] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A compiler automatic tuning method based on asynchronous data fusion Bayesian optimization, characterized in that, include: For generating high-fidelity data Low-computing-power platform A and the generation of low-fidelity data The high-computing-power platform B performs initial sampling and enables bidirectional data synchronization and exchange between the low-computing-power platform A and the high-computing-power platform B through a shared storage queue. Each platform uses a Bayesian optimization algorithm to compile and optimize, constructing a high-fidelity proxy model and a low-fidelity proxy model. The low-fidelity proxy model is fitted using low-fidelity data, while the high-fidelity proxy model is based on high-fidelity data and uses data fusion to train and update the model. Each platform selects the best compilation parameters from the data used to fit the proxy model using a data acquisition function. A practical evaluation was conducted to obtain the performance speedup of the program to be optimized after compilation optimization. Thus, evaluation data is obtained. The process is iterated to output the maximum performance speedup obtained during the entire iteration process and the corresponding combination of compilation parameters.

2. The automatic compilation tuning method based on asynchronous data fusion Bayesian optimization according to claim 1, characterized in that, The initialization sampling of low-computing platform A (generating high-fidelity data) and high-computing platform B (generating low-fidelity data), and the bidirectional data synchronization and exchange between low-computing platform A and high-computing platform B through a shared storage queue, includes: Define a queue To transfer evaluation results from the low-computing-power platform A to the high-computing-power platform B, a queue is defined. To transmit the evaluation results from the high-computing-power platform B to the low-computing-power platform A; The low-computing-power platform A first samples the data in the parameter space and then processes the sampled data. An evaluation was conducted to obtain evaluation data. ), It is the performance speedup ratio obtained by evaluating each vector in X, and then processed through the queue. Shared assessment data ; The high-computing-power platform B obtains the queue. Shared assessment data Then, an evaluation is conducted to obtain evaluation data. and through the queue Data synchronization is performed with the low-computing-power platform A.

3. The automatic compilation tuning method based on asynchronous data fusion Bayesian optimization according to claim 2, characterized in that, Each platform uses a Bayesian optimization algorithm for compilation optimization to construct a high-fidelity proxy model and a low-fidelity proxy model. The low-fidelity proxy model is fitted using low-fidelity data, while the high-fidelity proxy model is based on high-fidelity data. The training and updating of the model using data fusion methods include: The low-fidelity proxy model of the low-computing-power platform A is based on the queue. Low-fidelity assessment data The fitting model updates parameters, and the high-fidelity proxy model of the low-computing-power platform A uses the high-fidelity evaluation data generated by the low-computing-power platform A. Update the proxy model parameters, first put the data The mean value is obtained by inputting it into the low-fidelity proxy model of the low-computing-power platform A. , Fusion Mean Feature concatenation is performed to form nonlinear enhanced input features. The data is input into the high-fidelity proxy model of the low-computing-power platform A for fitting and updating. The high-computing platform B is from the queue Obtain high-fidelity evaluation data ( , The low-fidelity data generated by the high-computing-power platform B The high-fidelity proxy model of the high-computing-power platform B is updated using the high-fidelity evaluation data generated by the low-computing-power platform A. To perform fitting, the data is first input into the low-fidelity proxy model of the high-computing-power platform B to obtain the mean value. , ( Fusion mean Feature concatenation is performed to form nonlinear enhanced input features. The data is then input into the high-fidelity proxy model of the high-computing-power platform B for fitting and updating.

4. The automatic compiler tuning method based on asynchronous data fusion Bayesian optimization according to claim 3, characterized in that, Each platform selects the optimal compilation parameters through a collection function. A practical evaluation was conducted to obtain the performance speedup of the program to be optimized after compilation optimization. Thus, evaluation data is obtained. Perform iterations and output the maximum performance speedup obtained during the entire iteration process, along with the corresponding combination of compilation parameters, including: After each platform completes the agent model update, it processes the new batch of sampled data. To perform probabilistic predictions, a low-fidelity surrogate model is first used to generate the prediction mean. The candidate parameters will be the mean These features are concatenated as additional features to form non-linear enhanced input features. The data is input into a high-fidelity proxy for prediction, and the acquisition function selects the optimal compilation parameters based on the prediction results of the high-fidelity proxy model. Using compilation parameters Compile and run the program for practical evaluation to obtain the performance speedup of the program after compilation optimization. Thus, evaluation data is obtained. ; The new evaluation data The evaluation data generated by the low-computing-power platform A is sent to the corresponding queue. for The evaluation data generated by the high-computing-power platform B for ; Each platform separately evaluated the data. The loop iterates until the number of iterations reaches a threshold, then exits and outputs the maximum performance improvement achieved by the program to be optimized after compilation and tuning. and the combination of compilation parameters used Save the generated binary files and tuning logs, and generate a visualization of the compilation and tuning results.

5. The automatic compilation tuning method based on asynchronous data fusion Bayesian optimization according to claim 4, characterized in that, The acquisition function includes PI as the acquisition function for the low computing power platform A and LFEI as the acquisition function for the high computing power platform B.

6. An apparatus for applying the automatic compiler tuning method based on asynchronous data fusion Bayesian optimization as described in any one of claims 1-5, characterized in that, The device includes: Low-computing-power platform, used to compile and optimize programs to generate and output high-fidelity data; High-performance computing platforms are used to receive data from low-performance computing platforms to assist the low-performance computing platforms in optimization, and to generate and output low-fidelity data. A shared data queue is used to store data on low-computing-power platforms and high-computing-power platforms, and to share and exchange data on each platform. The surrogate model is used to predict candidate compilation parameters. Two sets of data from different platforms are used to train a low-fidelity surrogate model and a high-fidelity surrogate model respectively. The low-fidelity surrogate model provides prior knowledge to the high-fidelity surrogate model, and the high-fidelity surrogate model outputs the predicted probability of candidate compilation parameters. The collection function is used to select the most valuable compilation parameter from a number of candidate compilation parameters and output the evaluation value of the candidate compilation parameter.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the automatic compilation tuning method based on asynchronous data fusion Bayesian optimization as described in any one of claims 1 to 5.

8. A computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the automatic compilation tuning method based on asynchronous data fusion Bayesian optimization as described in any one of claims 1 to 5.