Compilation optimization method, device, storage medium and equipment of deep learning compiler

By adding and running probe instructions to the graph search space of the deep learning compiler, the graph search space is optimized using the optimal data from the previous compilation. This solves the problems of traditional compilers getting stuck in local optima and taking a long time, and achieves fast and efficient compilation optimization and performance improvement.

CN116976431BActive Publication Date: 2026-05-15JIUZHI (SUZHOU) INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIUZHI (SUZHOU) INTELLIGENT TECH CO LTD
Filing Date
2023-07-27
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Traditional deep learning compilers are prone to getting stuck in local optima during DSL optimization, which is time-consuming and requires highly skilled programmers. Random space search also results in excessively long compilation times.

Method used

Add probe instructions to each compiled computation graph in the graph search space and run them. Obtain running data through the probe instructions. Calculate a new graph search space using the optimal compiled computation graph from the previous compilation and the running data. Iterate and optimize to quickly converge to the optimal solution.

Benefits of technology

It accelerates the compilation and optimization process, improves compilation results and memory optimization, and achieves better performance and memory utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116976431B_ABST
    Figure CN116976431B_ABST
Patent Text Reader

Abstract

The application discloses a deep learning compiler compilation optimization method and device, a storage medium and equipment, and belongs to the technical field of deep learning. The method comprises the following steps: when performing first-time compilation, searching a graph search space according to a DSL calculation graph corresponding to a deep learning algorithm and different compilation strategy calculation graphs, adding a probe instruction and running when compiling each compilation calculation graph in the graph search space, and obtaining an optimal compilation calculation graph and running data; when performing non-first-time compilation, calculating a new graph search space according to the DSL calculation graph, a compilation strategy corresponding to the optimal compilation calculation graph obtained through last-time compilation and running data, adding a probe instruction to each compilation calculation graph in the new graph search space and then performing compilation, and obtaining an optimal compilation calculation graph and running data; and determining the optimal compilation calculation graph output in the last time as a final compilation calculation graph. The application can accelerate the compilation optimization process and the compilation effect, and brings better performance and memory optimization effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of deep learning technology, and in particular to a compilation optimization method, apparatus, storage medium and device for a deep learning compiler. Background Technology

[0002] As the applications of AI (Artificial Intelligence) become increasingly widespread, application-specific integrated circuits (ASICs) used for AI model computation and inference are gradually becoming the mainstream for these applications. Deep learning compilers (tools that translate the computational graph representation of deep neural network models into machine-executable binary streams) play a crucial role in the final deployment of AI models and in maximizing the performance of ASICs.

[0003] The compilation process of a traditional deep learning compiler generally includes the following steps: compiler front-end processing (responsible for converting deep learning algorithms into a sequence of computation graphs, high-level intermediate representations) -> computation graph level performance optimization -> conversion of the computation graph into a DSL (Domain Specific Language) computation graph (low-level intermediate representation) -> DSL optimization (scheduling optimization, memory optimization, etc.) -> code generation.

[0004] In the optimization of DSLs, the large number of variable parameters and the excessively large search space make it difficult to find the optimal solution. There are two main technical approaches to solving this problem: the traditional approach is based on handwritten or fixed-rule DSL optimization, where engineers with deep hardware knowledge write corresponding low-level operator optimization libraries or templates, and the deep learning compiler directly maps the computation graph based on the agreed-upon rules during compilation; to reduce the long development cycle and high cost of manually developing operator libraries, some deep learning compilers choose to randomly sample the compiler's variable parameters to generate corresponding binary data, thus constructing a large search space, and then automatically selecting the optimal solution based on the actual runtime of each possible solution within the search space.

[0005] Optimization methods using handwritten code or templates are not only prone to getting stuck in local optima, but also require programmers to have a very deep understanding of the hardware to write good optimization strategies—a process that is both tedious and time-consuming. While random space search-based methods alleviate the problem of getting stuck in local optima to some extent, their final optimization results are highly dependent on searching a large space, often leading to long compilation times. Summary of the Invention

[0006] This application provides a compilation optimization method, apparatus, storage medium, and device for a deep learning compiler, addressing the problems of optimization methods using manual coding or templates potentially getting stuck in local optima, resulting in long compilation times and high skill requirements for programmers; and optimization methods using random space search rely on large search results, leading to long compilation times. The technical solution is as follows:

[0007] On the one hand, a compilation optimization method for a deep learning compiler is provided, the method comprising:

[0008] Get the number of compilations by the deep learning compiler;

[0009] During the initial compilation, based on the domain-specific language (DSL) computation graph corresponding to the deep learning algorithm and the computation graph search space of different compilation strategies, a probe instruction is added and run when compiling each compilation computation graph in the graph search space to obtain an optimal compilation computation graph and running data. The running data is obtained based on the probe instruction. In the DSL computation graph, nodes represent operators, and edges represent data dependencies between operators.

[0010] During non-first compilation, a new graph search space is calculated based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation, and the running data. Probe instructions are added to each compilation computation graph in the new graph search space before compilation is performed to obtain an optimal compilation computation graph and running data.

[0011] The optimal compilation graph from the last output is determined as the final compilation graph.

[0012] In one possible implementation, the step of calculating the new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation, and the runtime data includes:

[0013] The compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation is used as the control factor of the iterative algorithm, and the running data obtained from the previous compilation is used as the iteration object of the iterative algorithm. The iterative algorithm is used to perform iterative operations on the DSL computation graph to obtain a new graph search space.

[0014] In one possible implementation, the step of adding and running probe instructions during the compilation of each compilation computation graph in the graph search space to obtain an optimal compilation computation graph and runtime data includes:

[0015] For each compiled computation graph in the graph search space, a probe instruction is added after the node when compiling the compiled computation graph;

[0016] Run each compiled computation graph to obtain an optimal compiled computation graph and running data.

[0017] In one possible implementation, for each compiled computation graph after execution, an optimal compiled computation graph and runtime data are obtained, including:

[0018] For each compilation computation graph, the compilation computation graph is mapped to hardware instructions to obtain a runtime library;

[0019] The runtime library is deployed to the corresponding chip platform and run to obtain a set of performance data and runtime data;

[0020] Calculate an optimal compilation computation graph based on the performance data.

[0021] In one possible implementation, calculating an optimal compilation computation graph based on the performance data includes:

[0022] Select the optimal set of performance data from all performance data;

[0023] The compilation computation graph corresponding to the optimal set of performance data is determined as the optimal compilation computation graph.

[0024] On the one hand, a compilation optimization device for a deep learning compiler is provided, the device comprising:

[0025] The acquisition module is used to obtain the number of compilations by the deep learning compiler;

[0026] The compilation module is used to add probe instructions and run them when compiling each compilation computation graph in the graph search space based on the domain-specific language (DSL) computation graph corresponding to the deep learning algorithm and the computation graph search space of different compilation strategies during the first compilation, so as to obtain an optimal compilation computation graph and running data. The running data is obtained based on the probe instructions. The nodes in the DSL computation graph represent operators, and the edges represent the data dependencies between operators.

[0027] The compilation module is also used to calculate a new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation, and the running data during non-first compilation. After adding probe instructions to each compilation computation graph in the new graph search space, the module is compiled to obtain an optimal compilation computation graph and running data.

[0028] The compilation module is also used to determine the optimal compilation computation graph of the last output as the final compilation computation graph.

[0029] In one possible implementation, the compilation module is further configured to:

[0030] The compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation is used as the control factor of the iterative algorithm, and the running data obtained from the previous compilation is used as the iteration object of the iterative algorithm. The iterative algorithm is used to perform iterative operations on the DSL computation graph to obtain a new graph search space.

[0031] In one possible implementation, the compiled module is also used for:

[0032] For each compiled computation graph in the graph search space, a probe instruction is added after the node when compiling the compiled computation graph;

[0033] Run each compiled computation graph to obtain an optimal compiled computation graph and running data.

[0034] On the one hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement the compilation optimization method of the deep learning compiler as described above.

[0035] On the one hand, a deep learning compiler is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the compilation optimization method of the deep learning compiler as described above.

[0036] The beneficial effects of the technical solution provided in this application include at least the following:

[0037] By adding probe instructions and running them during the compilation of each computational graph in the graph search space, an optimal computational graph and runtime data can be obtained. In the next compilation, a new graph search space can be calculated based on the DSL computational graph, the compilation strategy corresponding to the optimal computational graph obtained in the previous compilation, and the runtime data. After adding probe instructions to each computational graph in the new graph search space, compilation is performed. Since the runtime data can indicate the convergence direction, the new graph search space generated based on the runtime data and the optimal computational graph can converge quickly, greatly accelerating the compilation optimization process and compilation effect, while also bringing better performance and memory optimization effects. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1This is a flowchart of a compilation optimization method for a deep learning compiler provided in one embodiment of this application;

[0040] Figure 2 This is a flowchart of a compilation optimization method for a deep learning compiler provided in another embodiment of this application;

[0041] Figure 3 This is a structural block diagram of a deep learning compiler optimization device provided in another embodiment of this application. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0043] Please refer to Figure 1 This document illustrates a flowchart of a compilation optimization method for a deep learning compiler according to an embodiment of this application. This compilation optimization method can be applied to deep learning compilers. The compilation optimization method for the deep learning compiler may include:

[0044] Step 101: Obtain the number of compilations by the deep learning compiler.

[0045] The main purpose of a deep learning compiler is to generate effective code implementations of models described by deep learning frameworks on various hardware platforms. The conversion from model definition to specific code implementation is highly optimized for model specifications and hardware architecture.

[0046] Traditional deep learning compilers compile twice. In this embodiment, the number of compilation iterations can be set according to actual business needs.

[0047] Step 102: During the initial compilation, based on the DSL computation graph corresponding to the deep learning algorithm and the computation graph search space of different compilation strategies, a probe instruction is added and run when compiling each compilation computation graph in the graph search space to obtain an optimal compilation computation graph and running data. The running data is obtained based on the probe instruction. Nodes in the DSL computation graph represent operators, and edges represent data dependencies between operators.

[0048] The DSL computation graph consists of nodes and edges, where nodes represent operators in deep learning algorithms and edges represent data dependencies between operators.

[0049] In this embodiment, for a given deep learning algorithm, a corresponding front-end model can be constructed using currently popular training frameworks (PyTorch / TensorFlow). The front-end model is then used to convert the deep learning algorithm into a sequence of computational graphs, and performance optimization is performed at the computational graph level to obtain the DSL computational graph.

[0050] To achieve the desired translation / mapping effect, it is necessary to determine the compilation strategy of the DSL computation graph. This compilation strategy can include aspects such as split granularity, split dimension, memory allocation, and pipeline scheduling. During the compilation process of the DSL computation graph according to the compilation strategy, multiple compiled computation graphs may be generated, and these compiled computation graphs are combined to form the graph search space.

[0051] Probe instructions are added to each compilation computation graph in the compilation graph search space, and the compiled compilation computation graph is run, ultimately obtaining a set of optimal compilation computation graphs and runtime data (Profiling data). The runtime data is obtained by collecting the runtime status at each probe instruction, which can indicate the convergence direction.

[0052] Step 103: During non-first compilation, calculate a new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation, and the running data. Add probe instructions to each compilation computation graph in the new graph search space and then compile to obtain an optimal compilation computation graph and running data.

[0053] Deep learning compilers can calculate a new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained from the last compilation, and the runtime data. Since the runtime data can indicate the convergence direction, the new graph search space generated based on the runtime data and the optimal compilation computation graph can converge quickly, greatly accelerating the compilation optimization process and compilation effect, while bringing better performance and memory optimization effects.

[0054] After obtaining a new graph search space, the deep learning compiler can continue to add probe instructions to the compilation computation graph in the graph search space and then compile it to obtain a set of optimal compilation computation graphs and running data. This process continues until the number of compilations is reached and then compilation stops.

[0055] Step 104: Determine the optimal compilation computation graph from the last output as the final compilation computation graph.

[0056] A deep learning compiler can obtain the compilation computation graph obtained from the last compilation and determine that compilation computation graph as the final compilation computation graph.

[0057] In summary, the deep learning compiler optimization method provided in this application, by adding and running probe instructions during the compilation of each compilation computation graph in the graph search space, can obtain an optimal compilation computation graph and running data. In the next compilation, a new graph search space can be calculated based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation, and the running data. After adding probe instructions to each compilation computation graph in the new graph search space, compilation is performed. Since the running data can indicate the convergence direction, the new graph search space generated based on the running data and the optimal compilation computation graph can converge quickly, greatly accelerating the compilation optimization process and compilation effect, while also bringing better performance and memory optimization effects.

[0058] Please refer to Figure 2 This document illustrates a flowchart of a compilation optimization method for a deep learning compiler according to an embodiment of this application. This compilation optimization method can be applied to deep learning compilers. The compilation optimization method for the deep learning compiler may include:

[0059] Step 201: Obtain the number of compilations by the deep learning compiler.

[0060] The main purpose of a deep learning compiler is to generate effective code implementations of models described by deep learning frameworks on various hardware platforms. The conversion from model definition to specific code implementation is highly optimized for model specifications and hardware architecture.

[0061] Traditional deep learning compilers compile twice. In this embodiment, the number of compilation iterations can be set according to actual business needs.

[0062] Step 202: During the initial compilation, based on the DSL computation graph corresponding to the deep learning algorithm and the computation graph search space of different compilation strategies, a probe instruction is added and run when compiling each compilation computation graph in the graph search space to obtain an optimal compilation computation graph and running data. The running data is obtained based on the probe instruction. Nodes in the DSL computation graph represent operators, and edges represent data dependencies between operators.

[0063] The DSL computation graph consists of nodes and edges, where nodes represent operators in deep learning algorithms and edges represent data dependencies between operators.

[0064] In this embodiment, for a given deep learning algorithm, a corresponding front-end model can be constructed using currently popular training frameworks (PyTorch / TensorFlow). The front-end model is then used to convert the deep learning algorithm into a sequence of computational graphs, and performance optimization is performed at the computational graph level to obtain the DSL computational graph.

[0065] To achieve the desired translation / mapping effect, it is necessary to determine the compilation strategy of the DSL computation graph. This compilation strategy can include aspects such as split granularity, split dimension, memory allocation, and pipeline scheduling. During the compilation process of the DSL computation graph according to the compilation strategy, multiple compiled computation graphs may be generated, and these compiled computation graphs are combined to form the graph search space.

[0066] Probe instructions are added to each compilation computation graph in the compilation graph search space, and the compiled compilation computation graph is run, ultimately obtaining a set of optimal compilation computation graphs and runtime data (Profiling data). The runtime data is obtained by collecting the runtime status at each probe instruction, which can indicate the convergence direction.

[0067] Specifically, when compiling each compiled computation graph in the graph search space, a probe instruction is added and executed to obtain an optimal compiled computation graph and running data. This can include: for each compiled computation graph in the graph search space, adding a probe instruction after the node when compiling the compiled computation graph; running each compiled computation graph to obtain an optimal compiled computation graph and running data.

[0068] The process of running each compiled computation graph to obtain an optimal compiled computation graph and runtime data can include: mapping the compiled computation graph to hardware instructions for each compiled computation graph to obtain a runtime library; deploying the runtime library to the corresponding chip platform for execution to obtain a set of performance data and runtime data; and calculating an optimal compiled computation graph based on the performance data.

[0069] Specifically, calculating an optimal compiler computation graph based on performance data can include: selecting the optimal set of performance data from all performance data; and determining the compiler computation graph corresponding to the optimal set of performance data as the optimal compiler computation graph.

[0070] Step 203: During non-first compilation, the compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation is used as the control factor of the iterative algorithm, and the running data obtained in the previous compilation is used as the iteration object of the iterative algorithm. The iterative algorithm is used to perform iterative calculations on the DSL computation graph to obtain a new graph search space. After adding probe instructions to each compilation computation graph in the new graph search space, compilation is performed to obtain an optimal compilation computation graph and running data.

[0071] Deep learning compilers can calculate a new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained from the last compilation, and the runtime data. Since the runtime data can indicate the convergence direction, the new graph search space generated based on the runtime data and the optimal compilation computation graph can converge quickly, greatly accelerating the compilation optimization process and compilation effect, while bringing better performance and memory optimization effects.

[0072] When computing a new graph search space, the deep learning compiler can use the compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation as the control factor of the iterative algorithm, and use the running data obtained from the previous compilation as the iteration object of the iterative algorithm. The iterative algorithm is then used to perform iterative operations on the DSL computation graph to obtain a new graph search space.

[0073] After obtaining the new graph search space, the deep learning compiler can continue to add probe instructions to the compilation computation graph in the graph search space and then compile it to obtain a set of optimal compilation computation graphs and running data. This process continues until the required number of compilations is reached and then compilation stops. The specific compilation method is the same as the compilation direction in step 202, and will not be repeated here.

[0074] Step 204: Determine the optimal compilation computation graph from the last output as the final compilation computation graph.

[0075] A deep learning compiler can obtain the compilation computation graph obtained from the last compilation and determine that compilation computation graph as the final compilation computation graph.

[0076] In summary, the deep learning compiler optimization method provided in this application, by adding and running probe instructions during the compilation of each compilation computation graph in the graph search space, can obtain an optimal compilation computation graph and running data. In the next compilation, a new graph search space can be calculated based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation, and the running data. After adding probe instructions to each compilation computation graph in the new graph search space, compilation is performed. Since the running data can indicate the convergence direction, the new graph search space generated based on the running data and the optimal compilation computation graph can converge quickly, greatly accelerating the compilation optimization process and compilation effect, while bringing better performance and memory optimization effects.

[0077] Please refer to Figure 3 This illustration shows a structural block diagram of a compilation optimization device for a deep learning compiler according to an embodiment of this application. This compilation optimization device can be applied to a deep learning compiler. The compilation optimization device for the deep learning compiler may include:

[0078] Get module 310 to get the number of compilations by the deep learning compiler;

[0079] The compilation module 320 is used to add probe instructions and run them when compiling each compilation computation graph in the graph search space based on the domain-specific language DSL computation graph corresponding to the deep learning algorithm and the computation graph search space of different compilation strategies during the first compilation. This results in an optimal compilation computation graph and running data. The running data is obtained based on the probe instructions. Nodes in the DSL computation graph represent operators, and edges represent data dependencies between operators.

[0080] The compilation module 320 is also used to calculate a new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation, and the running data during non-first compilation. After adding probe instructions to each compilation computation graph in the new graph search space, the compilation is performed to obtain an optimal compilation computation graph and running data.

[0081] Compiler module 320 is also used to determine the optimal compilation computation graph of the last output as the final compilation computation graph.

[0082] In an optional embodiment, compilation module 320 is further configured to:

[0083] The compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation is used as the control factor of the iterative algorithm, and the running data obtained in the previous compilation is used as the iteration object of the iterative algorithm. The iterative algorithm is used to perform iterative operations on the DSL computation graph to obtain a new graph search space.

[0084] In an optional embodiment, compilation module 320 is further configured to:

[0085] For each compiled computation graph in the graph search space, add a probe instruction after the node when compiling the compiled computation graph;

[0086] Run each compiled computation graph to obtain an optimal compiled computation graph and running data.

[0087] In an optional embodiment, compilation module 320 is further configured to:

[0088] For each compiler computation graph, the compiler computation graph is mapped to hardware instructions to obtain the runtime library;

[0089] The runtime library is deployed to the corresponding chip platform to run, resulting in a set of performance data and runtime data;

[0090] Calculate an optimal compiler computation graph based on performance data.

[0091] In an optional embodiment, compilation module 320 is further configured to:

[0092] Select the optimal set of performance data from all performance data;

[0093] The optimal compiler computation graph is determined by identifying the compiler computation graph corresponding to the best set of performance data.

[0094] In summary, the deep learning compiler optimization apparatus provided in this application can obtain an optimal compilation computation graph and runtime data by adding probe instructions and running them during the compilation of each compilation computation graph in the graph search space. During the next compilation, a new graph search space can be calculated based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation, and the runtime data. After adding probe instructions to each compilation computation graph in the new graph search space, compilation is performed. Since the runtime data can indicate the convergence direction, the new graph search space generated based on the runtime data and the optimal compilation computation graph can converge quickly, greatly accelerating the compilation optimization process and compilation effect, while also bringing better performance and memory optimization effects.

[0095] One embodiment of this application provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the compilation optimization method of the deep learning compiler as described above.

[0096] One embodiment of this application provides a deep learning compiler, which includes a processor and a memory. The memory stores at least one instruction, which is loaded and executed by the processor to implement the compilation optimization method of the deep learning compiler as described above.

[0097] It should be noted that the compilation optimization device for the deep learning compiler provided in the above embodiments is only illustrated by the division of the above functional modules when performing compilation optimization for the deep learning compiler. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the compilation optimization device for the deep learning compiler can be divided into different functional modules to complete all or part of the functions described above. In addition, the compilation optimization device for the deep learning compiler provided in the above embodiments and the compilation optimization method embodiments for the deep learning compiler belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0098] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0099] The above description is not intended to limit the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A compilation optimization method for a deep learning compiler, characterized in that, The method includes: The compilation count of the deep learning compiler is obtained. During the first compilation, based on the domain-specific language (DSL) computation graph corresponding to the deep learning algorithm and the computation graph search space for different compilation strategies, probe instructions are added and run when compiling each computation graph in the graph search space to obtain an optimal computation graph and running data. The running data is obtained based on the probe instructions. Nodes in the DSL computation graph represent operators, and edges represent data dependencies between operators. The calculation of a new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal computation graph obtained from the previous compilation, and the running data includes: The compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation is used as the control factor of the iterative algorithm, and the running data obtained in the previous compilation is used as the iteration object of the iterative algorithm. The iterative algorithm is used to perform iterative operations on the DSL computation graph to obtain a new graph search space. The step of adding probe instructions and running them during the compilation of each compilation computation graph in the graph search space to obtain an optimal compilation computation graph and running data includes: For each compiled computation graph in the graph search space, a probe instruction is added after the node when compiling the compiled computation graph; Run each compiled computation graph to obtain an optimal compiled computation graph and running data; During non-first compilation, a new graph search space is calculated based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation, and the running data. Probe instructions are added to each compilation computation graph in the new graph search space before compilation is performed to obtain an optimal compilation computation graph and running data. The optimal compilation graph from the last output is determined as the final compilation graph.

2. The compilation optimization method for a deep learning compiler according to claim 1, characterized in that, Each compiled computation graph after execution yields an optimal compiled computation graph and runtime data, including: For each compilation computation graph, the compilation computation graph is mapped to hardware instructions to obtain a runtime library; The runtime library is deployed to the corresponding chip platform for operation, resulting in a set of performance data and runtime data; an optimal compilation computation graph is calculated based on the performance data.

3. The compilation optimization method for a deep learning compiler according to claim 2, characterized in that, The step of calculating an optimal compilation computation graph based on the performance data includes: Select the optimal set of performance data from all performance data; determine the compiler computation graph corresponding to the optimal set of performance data as the optimal compiler computation graph.

4. A compilation optimization device for a deep learning compiler, characterized in that, The device includes: The acquisition module is used to obtain the number of compilations by the deep learning compiler; The compilation module is used to, during the initial compilation, add probe instructions and run them while compiling each compilation computation graph in the graph search space based on the domain-specific language (DSL) computation graph corresponding to the deep learning algorithm and the computation graph search space of different compilation strategies, to obtain an optimal compilation computation graph and running data. The running data is obtained based on the probe instructions. Nodes in the DSL computation graph represent operators, and edges represent data dependencies between operators. The compilation module is also used to, during subsequent compilations, calculate a new graph search space based on the DSL computation graph, the compilation strategy corresponding to the optimal compilation computation graph obtained from the previous compilation, and the running data. After adding probe instructions to each compilation computation graph in the new graph search space, the module compiles it to obtain an optimal compilation computation graph and running data. The compilation module is also used to determine the optimal compilation computation graph of the last output as the final compilation computation graph; The compilation module is further configured to: use the compilation strategy corresponding to the optimal compilation computation graph obtained in the previous compilation as the control factor of the iterative algorithm, use the running data obtained in the previous compilation as the iteration object of the iterative algorithm, and use the iterative algorithm to perform iterative operations on the DSL computation graph to obtain a new graph search space; The compiled module is also used to: for each compiled computation graph in the graph search space, add probe instructions after the nodes when compiling the compiled computation graph; run each compiled computation graph to obtain an optimal compiled computation graph and running data.

5. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the compilation optimization method of the deep learning compiler as described in any one of claims 1 to 3.

6. A deep learning compiler, characterized in that, The deep learning compiler includes a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the compilation optimization method of the deep learning compiler as described in any one of claims 1 to 3.