Data processing method, device, instruction fusion method, and code generation method

By evaluating and selecting the optimal fusion instruction set in the calculation graph, the problem of node fusion in the calculation graph in the existing technology is solved, and hardware performance improvement and diversified scene adaptation capabilities are achieved.

CN112947997BActive Publication Date: 2024-08-30ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911268729.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-11
Publication Date
2024-08-30
Estimated Expiration
2039-12-11

AI Technical Summary

Technical Problem

Existing technology is difficult to integrate finely divided computing graph nodes in computing expressions, resulting in the inability to expand hardware execution granularity, limited performance improvement, and lack of generalization capabilities to face diverse business scenarios.

Method used

By obtaining the calculation graph state, evaluating and selecting the optimal fusion instruction group, fusing the instruction group to adapt to the underlying hardware, using preset search indicators for state search expansion, determining instruction dependencies and performing topological sorting, and generating executable code to implement Command fusion.

Benefits of technology

It achieves the expansion of hardware execution granularity and performance improvement, has the generalization ability to face diverse business scenarios, and adapts to various different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112947997B
    Figure CN112947997B
Patent Text Reader

Abstract

The disclosed embodiment discloses a data processing method, an apparatus, an instruction fusion method, and a code generation method, wherein the data processing method comprises: obtaining a computational graph state according to a computational graph; obtaining a set of fusible instruction groups in the computational graph according to the computational graph state; determining whether the set of fusible instruction groups is empty; evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty; selecting the optimal fusible instruction group based on the evaluation result of the instruction groups in the set of fusible instruction groups, so that a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the disclosed embodiment can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, a device, an instruction fusion method, and a code generation method. Background Art

[0002] In recent years, computing technology has been widely used in various scenarios. The process of business implementation in each scenario is completed through computing and relying on specific underlying computing devices. As business development becomes increasingly complex and diversified, the adaptation efficiency between the business expressed by computing and the underlying hardware platform will become one of the important factors affecting the cost of business implementation.

[0003] Currently, for the problem of computational expression, the solutions in related technologies are based on computational graph representation in high-level languages, which are then mapped to the underlying hardware platform through a dedicated computing framework. This design concept makes the computational graph not limited to specific businesses. But on the other hand, in order to take into account the flexibility of user expression and the requirements of business diversity, the granularity of the computational graph nodes will be relatively fragmented in many scenarios and have a complex interdependent structure. Related technologies cannot fuse fragmented nodes, cannot expand the granularity of hardware execution, and are difficult to improve hardware performance. Moreover, the fusion solutions of related technologies are based on business rules extracted from specific business scenarios. Therefore, they lack generalization capabilities when facing diverse business scenarios and are difficult to adapt to various scenarios. Summary of the invention

[0004] In order to solve the problems in the related art, the embodiments of the present disclosure provide a data processing method, an apparatus, an instruction fusion method, and a code generation method.

[0005] In a first aspect, an embodiment of the present disclosure provides a data processing method, including:

[0006] Get the computational graph status according to the computational graph;

[0007] Acquire a set of fusible instruction groups in the computation graph according to the computation graph state;

[0008] Determine whether the set of fusible instruction groups is empty;

[0009] According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups;

[0010] Based on the evaluation results of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected.

[0011] In combination with the first aspect, the present disclosure, in a first implementation of the first aspect, further includes:

[0012] According to determining that the set of fusible instruction groups is empty, the fusible instruction group with the greatest confidence is selected as the optimal fusible instruction group.

[0013] In combination with the first aspect, in a second implementation of the first aspect of the present disclosure, obtaining a set of fusible instruction groups in the computation graph according to the computation graph state includes:

[0014] According to the selected optimal fusible instruction group, a set of fusible instruction groups in the computation graph is obtained.

[0015] In combination with the first aspect, in a third implementation of the first aspect of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0016] According to determining that the set of fusible instruction groups is not empty, a state search expansion is performed on the instruction group according to a preset search index.

[0017] In combination with the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect of the present disclosure, based on determining that the set of fusible instruction groups is not empty, performing a state search expansion on the instruction group according to a preset search index includes:

[0018] Determining whether the instruction group in the fusible instruction group set has been evaluated according to determining that the fusible instruction group set is not empty;

[0019] According to the instruction group in the set of fusible instruction groups having been evaluated, the state parameters of the computation graph state are updated.

[0020] In combination with the fourth implementation manner of the first aspect, in a fifth implementation manner of the first aspect of the present disclosure, according to determining that the set of fusible instruction groups is not empty, performing a state search expansion for the instruction group according to a preset search index, further includes:

[0021] According to the instruction group in the set of fusible instruction groups not being evaluated, calculating the state parameter of the graph state for the unevaluated instruction group;

[0022] Expand the status search based on the preset search indicators.

[0023] In combination with the fifth implementation of the first aspect, in a sixth implementation of the first aspect of the present disclosure, the state search expansion according to the preset search index further includes:

[0024] Based on the preset search rules, the status search is expanded according to the preset search indicators.

[0025] In combination with the fifth implementation of the first aspect, in a seventh implementation of the first aspect of the present disclosure, the state search expansion according to the preset search index further includes:

[0026] According to the result of the state search expansion performed according to the preset search index, the state parameters of the computation graph state are updated.

[0027] In combination with the first aspect, in an eighth implementation manner of the first aspect of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0028] The computation graph state is updated according to the evaluation result of the instruction groups in the set of fusible instruction groups.

[0029] In combination with the first aspect, in a ninth implementation of the first aspect of the present disclosure, obtaining a set of fusible instruction groups in the computation graph according to the computation graph state includes:

[0030] Determining dependencies between instructions in the computation graph;

[0031] Determining whether the instructions with dependencies can be merged according to the determined dependencies between the instructions;

[0032] According to the result of determining that the instructions with dependencies can be fused, the instructions that can be fused are formed into an instruction group and added into the set of fusible instruction groups.

[0033] In combination with the ninth implementation manner of the first aspect, in a tenth implementation manner of the first aspect of the present disclosure, determining whether the instructions with dependencies can be merged according to the determined dependencies between the instructions includes:

[0034] topologically sorting the instructions according to the determined dependencies between the instructions;

[0035] Traverse all instructions according to the result of topological sorting to determine all instructions that each instruction depends on;

[0036] Determines whether dependent instructions can be fused.

[0037] In combination with the first aspect, in an eleventh implementation manner of the first aspect of the present disclosure, before acquiring the set of fusible instruction groups in the computation graph according to the computation graph state, the method includes:

[0038] Initialize the fusible instruction group set to empty.

[0039] In combination with the first aspect, the present disclosure, in a twelfth implementation of the first aspect, further includes:

[0040] According to preset instruction fusion rules, based on the selected optimal fusionable instruction group, an executable code for executing the fusion action represented by the optimal instruction group is generated.

[0041] In combination with the first aspect, in the thirteenth implementation manner of the first aspect of the present disclosure, the computational graph state is represented by a tuple including an instruction type and a connection bitmap representing the dependency relationship between instructions.

[0042] In combination with the fourth implementation manner of the first aspect, in the fourteenth implementation manner of the first aspect of the present disclosure, the state parameters of the computation graph state include a revenue parameter of the state and an access frequency parameter of the state.

[0043] In combination with the fourteenth implementation manner of the first aspect, in the fifteenth implementation manner of the first aspect of the present disclosure, the benefit parameter of the state is obtained by predicting a preset performance model or by calling a code generator to generate actual measurement of the target code.

[0044] In combination with the fourteenth implementation manner of the first aspect, in the sixteenth implementation manner of the first aspect of the present disclosure, the benefit parameter of the state includes at least one of an execution performance parameter and a memory occupancy parameter of the executable code generated based on the fusible instruction group.

[0045] In combination with the first aspect, in a seventeenth implementation manner of the first aspect of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0046] Selecting a sub-fusible instruction group set from the fusible instruction group set;

[0047] The instruction groups in the sub-set of fusible instruction groups are evaluated.

[0048] In combination with the first aspect, in an eighteenth implementation manner of the first aspect of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0049] The instruction groups in the set of fusible instruction groups are evaluated based on a Monte Carlo tree search method.

[0050] In combination with the first aspect, in a nineteenth implementation manner of the first aspect of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0051] Cache the evaluation results.

[0052] In a second aspect, an embodiment of the present disclosure provides a data processing device, including:

[0053] A first acquisition module is configured to acquire a computation graph state according to the computation graph;

[0054] A second acquisition module is configured to acquire a set of fusible instruction groups in the computation graph according to the computation graph state;

[0055] A determination module is configured to determine whether the set of fusible instruction groups is empty;

[0056] an evaluation module, configured to evaluate the instruction groups in the fusionable instruction group set according to the determination module determining that the fusionable instruction group set is not empty;

[0057] The selection module is configured to select an optimal fusible instruction group based on an evaluation result of the evaluation module on the instruction groups in the set of fusible instruction groups.

[0058] In a third aspect, an instruction fusion method is provided in an embodiment of the present disclosure, including:

[0059] Get the computational graph status according to the computational graph;

[0060] Acquire a set of fusible instruction groups in the computation graph according to the computation graph state;

[0061] Determine whether the set of fusible instruction groups is empty;

[0062] According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups;

[0063] Based on the evaluation results of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected for instruction fusion.

[0064] In a fourth aspect, an embodiment of the present disclosure provides a code generation method, including:

[0065] Get the computational graph status according to the computational graph;

[0066] Acquire a set of fusible instruction groups in the computation graph according to the computation graph state;

[0067] Determine whether the set of fusible instruction groups is empty;

[0068] According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups;

[0069] Based on the evaluation results of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected to generate executable code for executing the fusion action represented by the optimal instruction group.

[0070] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including a memory and a processor; wherein:

[0071] The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method as described in any one of the first aspect, the first to nineteenth implementations of the first aspect, the third aspect, and the fourth aspect.

[0072] In the sixth aspect, a readable storage medium is provided in an embodiment of the present disclosure, on which computer instructions are stored. When the computer instructions are executed by a processor, the method described in any one of the first aspect, the first to nineteenth implementations of the first aspect, the third aspect, and the fourth aspect is implemented.

[0073] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0074] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the state of the calculation graph according to the calculation graph; obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; determining whether the set of fusible instruction groups is empty; evaluating the instruction groups in the set of fusible instruction groups according to the determination that the set of fusible instruction groups is not empty; selecting the optimal fusible instruction group based on the evaluation result of the instruction groups in the set of fusible instruction groups, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0075] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is empty, selecting the fusible instruction group with the largest confidence as the optimal fusible instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0076] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph, including: obtaining the set of fusible instruction groups in the calculation graph according to the selected optimal fusible instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0077] According to the technical solution provided by the embodiment of the present disclosure, the instruction groups in the set of fusible instruction groups are evaluated based on the determination that the set of fusible instruction groups is not empty, including: based on the determination that the set of fusible instruction groups is not empty, a state search expansion is performed on the instruction groups according to preset search indicators, so that a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0078] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, a state search expansion is performed for the instruction group according to a preset search index, including: determining whether the instruction group in the set of fusible instruction groups has been evaluated according to determining that the set of fusible instruction groups is not empty; updating the state parameters of the computational graph state according to the instruction group in the set of fusible instruction groups has been evaluated, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0079] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty according to the above, a state search expansion is performed for the instruction group according to the preset search index, and it also includes: according to the instruction group in the set of fusible instruction groups not being evaluated, the state parameters of the graph state are calculated for the unevaluated instruction group; the state search expansion is performed according to the preset search index, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0080] According to the technical solution provided by the embodiment of the present disclosure, by performing state search expansion according to preset search indicators, it also includes: based on preset search rules, performing state search expansion according to preset search indicators, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0081] According to the technical solution provided by the embodiment of the present disclosure, by performing state search expansion according to preset search indicators, it also includes: updating the state parameters of the computational graph state according to the result of performing state search expansion according to preset search indicators, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0082] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: according to the evaluation results of the instruction groups in the set of fusible instruction groups, the state of the calculation graph is updated, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0083] According to the technical solution provided by the embodiment of the present disclosure, the set of fusible instruction groups in the calculation graph is obtained according to the state of the calculation graph, including: determining the dependency relationship between the instructions in the calculation graph; determining whether the instructions with dependencies can be fused according to the determined dependency relationship between the instructions; according to the determination result that the instructions with dependencies can be fused, the instructions that can be fused are formed into an instruction group and added to the set of fusible instruction groups, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0084] According to the technical solution provided by the embodiment of the present disclosure, whether the instructions with dependencies can be fused is determined according to the determined dependencies between the instructions, including: topologically sorting the instructions according to the determined dependencies between the instructions; traversing all instructions according to the results of the topological sorting to determine all the instructions on which each instruction depends; determining whether the instructions with dependencies can be fused, a set of fused instruction groups can be obtained, and the optimal fused instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diverse business scenarios and can adapt to various different scenarios.

[0085] According to the technical solution provided by the embodiment of the present disclosure, before obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph, it includes: initializing the set of fusible instruction groups to empty, which is conducive to the implementation of the calculation of the set of fusible instruction groups, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0086] According to the technical solution provided by the embodiment of the present disclosure, by generating executable code for executing the fusion action represented by the optimal instruction group based on the selected optimal fusible instruction group according to the preset instruction fusion rule, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can adapt the underlying hardware facilities more efficiently. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0087] According to the technical solution provided by the embodiment of the present disclosure, the computational graph state is represented by a tuple including an instruction type and a connection bitmap representing the dependency relationship between instructions, so that a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0088] According to the technical solution provided by the embodiment of the present disclosure, a set of fusible instruction groups can be obtained through the state parameters of the computational graph state, including the state's revenue parameter and the state's access frequency parameter, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0089] According to the technical solution provided by the embodiment of the present disclosure, the benefit parameter of the state is obtained by predicting through a preset performance model or calling a code generator to generate actual measurement of the target code, and a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can adapt to the underlying hardware facilities more efficiently. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0090] According to the technical solution provided by the embodiment of the present disclosure, the benefit parameter of the state includes at least one of the execution performance parameter and the memory occupancy parameter of the executable code generated based on the fusible instruction group, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0091] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: selecting a sub-set of fusible instruction groups in the set of fusible instruction groups; evaluating the instruction groups in the sub-set of fusible instruction groups, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0092] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: the instruction groups in the set of fusible instruction groups are evaluated based on the Monte Carlo tree search method, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0093] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including caching the evaluation results. When encountering an evaluation of the same status after the evaluation is completed, the previously cached evaluation results can be directly reused, thereby avoiding repeated evaluations and saving resources.

[0094] According to the technical solution provided by the embodiment of the present disclosure, the first acquisition module is configured to acquire the state of the calculation graph according to the calculation graph; the second acquisition module is configured to acquire the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; the determination module is configured to determine whether the set of fusible instruction groups is empty; the evaluation module is configured to determine that the set of fusible instruction groups is not empty according to the determination module, and evaluate the instruction groups in the set of fusible instruction groups; the selection module is configured to select the optimal fusible instruction group based on the evaluation result of the instruction group in the set of fusible instruction groups by the evaluation module, so that the set of fusible instruction groups can be acquired, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0095] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the state of the calculation graph according to the calculation graph; obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; determining whether the set of fusible instruction groups is empty; evaluating the instruction groups in the set of fusible instruction groups according to the determination that the set of fusible instruction groups is not empty; based on the evaluation results of the instruction groups in the set of fusible instruction groups, selecting the optimal fusible instruction group for instruction fusion, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0096] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the state of the calculation graph according to the calculation graph; obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; determining whether the set of fusible instruction groups is empty; evaluating the instruction groups in the set of fusible instruction groups according to the determination that the set of fusible instruction groups is not empty; based on the evaluation result of the instruction groups in the set of fusible instruction groups, selecting the optimal fusible instruction group to generate an executable code for executing the fusion action represented by the optimal instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0097] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0098] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0099] Figure 1 A flowchart showing a data processing method according to an embodiment of the present disclosure;

[0100] Figure 2 A flowchart showing a data processing method according to another embodiment of the present disclosure;

[0101] Figure 3A flowchart showing a data processing method according to another embodiment of the present disclosure;

[0102] Figure 4 A flowchart showing a data processing method according to another embodiment of the present disclosure;

[0103] Figure 5 A schematic diagram showing a state space search method in a data processing method according to an embodiment of the present disclosure;

[0104] Figure 6 An exemplary schematic diagram showing an instruction fusion process based on state search in a data processing method according to an embodiment of the present disclosure;

[0105] Figure 7 An exemplary schematic diagram showing a process of calculating an action set in a data processing method according to an embodiment of the present disclosure;

[0106] Figure 8 A schematic diagram showing an example of instruction fusion rules in a data processing method according to an embodiment of the present disclosure;

[0107] Fig. 9 An exemplary schematic diagram showing an action evaluation and state space expansion process in a data processing method according to an embodiment of the present disclosure;

[0108] Fig.10 An exemplary schematic diagram showing an action selection process in a data processing method according to an embodiment of the present disclosure;

[0109] Fig.11 A structural block diagram of a data processing device according to an embodiment of the present disclosure is shown;

[0110] Fig.12 A flowchart of an instruction fusion method according to an embodiment of the present disclosure is shown;

[0111] Fig.13 A flowchart showing a code generation method according to an embodiment of the present disclosure is shown;

[0112] Fig.14 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0113] Fig.15 It is a structural diagram of a computer system suitable for implementing a data processing method, an instruction fusion method or a code generation method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0114] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0115] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of labels, numbers, steps, behaviors, components, parts, or combinations thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other labels, numbers, steps, behaviors, components, parts, or combinations thereof exist or are added.

[0116] It should also be noted that, in the absence of conflict, the embodiments and labels in the embodiments of the present disclosure can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0117] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the state of the calculation graph according to the calculation graph; obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; determining whether the set of fusible instruction groups is empty; evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty; selecting the optimal fusible instruction group based on the evaluation results of the instruction groups in the set of fusible instruction groups, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0118] Figure 1 A flow chart of a data processing method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the data processing method includes the following steps S110, S120, S130, S140 and S150:

[0119] In step S110, the computation graph state is obtained according to the computation graph.

[0120] In step S120, a set of fusible instruction groups in the computation graph is obtained according to the computation graph state.

[0121] In step S130 , it is determined whether the set of fusible instruction groups is empty.

[0122] In step S140, based on determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated.

[0123] In step S150, based on the evaluation results of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected.

[0124] In one embodiment of the present disclosure, the calculation Figure 1 Once a fusion action consisting of a fusionable instruction group is executed, a new state is entered from the current state. The current state and the new state can be called a computational graph state.

[0125] In one embodiment of the present disclosure, the computation graph state is represented by a tuple including an instruction type and a connection bitmap representing the dependency relationship between instructions.

[0126] In one embodiment of the present disclosure, given a computation graph, the computation graph state can be defined as a two-tuple (instruction type, connection bitmap). Among them, the instruction type is a list of operators after the instructions in the computation graph are stably topologically sorted, which characterizes the computation type of each instruction. The connection bitmap is the dependency relationship between instructions represented by an adjacency matrix. Note that the instructions mentioned in the present disclosure can be a single tensor operation or a fused sequence of instructions, generally represented by a special type encoding. Those skilled in the art can understand that the computation graph state in the form of a two-tuple is only an example, and the present disclosure can adopt various forms of computation graph states as long as the technical solution of the present disclosure can be implemented.

[0127] In one embodiment of the present disclosure, as the fusible instruction groups (fusion actions) in the computation graph are executed, the computation graph state will change accordingly, and the state space can be expanded from each state. Subsequent embodiments will mention how to search and expand the state space.

[0128] In one embodiment of the present disclosure, a fusible instruction group refers to a group of instructions constituting a fusion action.

[0129] In one embodiment of the present disclosure, given a computation graph and a state space consisting of computation graph states, a fusible action can be defined as a fusible instruction group, also referred to as a tuple. For example, a tuple can be a binary (instruction A, instruction B), indicating that instruction A and instruction B are merged into a fused instruction. Note that not all instructions can be fused into a fusible instruction group, and whether instructions can be fused depends on the capabilities of the underlying code generation system. It should also be noted that the fusible instruction group is not limited to the binary form, but can be more tuples. For example, the capabilities of the code generation system can be formally characterized using the Backus-Naur form (BNF paradigm). Subsequent embodiments will provide specific examples.

[0130] In one embodiment of the present disclosure, determining whether the set of fusible instruction groups is empty may indicate whether all fusible instruction groups (fusion actions) in the computation graph have been evaluated based on the computation graph state.

[0131] In one embodiment of the present disclosure, for a fusion action, it is necessary to evaluate the benefits that can be obtained by executing the fusion action. There are two schemes for action evaluation. One scheme is the measurement method. The measurement method can call the code generator to generate the code before and after the fusion of the fusionable instruction group, execute it on the hardware, and measure the benefits. Another scheme is the prediction method. The prediction method can build a performance model to directly predict the benefits. Generally speaking, the prediction method is fast, but the accuracy is not as good as the direct measurement method. Once a fusion action is executed, the calculation graph enters a new state. Based on this new state, the set of fusionable instruction groups (legal action sets) can be further analyzed and the new fusionable instruction group (new action) can be evaluated. In theory, the fusionable instruction group can be continuously executed and the state can be expanded until there are no instructions that can be fused, but the deeper the state expansion depth, the greater the search cost.

[0132] In one embodiment of the present disclosure, based on the action evaluation and state expansion, a fusion action is finally selected to perform the search benefit obtained and the opportunity of not searching the space that needs to be weighed comprehensively. For example, the calculation method of the action evaluation index can be customized based on the UCB (confidence upper limit) formula of the Monte Carlo tree search algorithm. It can be understood by those skilled in the art that the calculation method of the action evaluation index can be formulated according to the teachings of the embodiments of the present disclosure and related technologies, and the present disclosure does not limit this.

[0133] The following reference Figure 2 A data processing method according to another embodiment of the present disclosure is described.

[0134] Figure 2 A flow chart showing a data processing method according to another embodiment of the present disclosure is shown. Figure 2 The embodiment shown includes Figure 1 In addition to steps S110 to S150 shown in the implementation method, the method also includes step S210.

[0135] In step S210, based on determining that the set of fusible instruction groups is empty, the instruction group with the highest confidence is selected as the optimal fusible instruction group.

[0136] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is empty, selecting the fusible instruction group with the largest confidence as the optimal fusible instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0137] The following reference Figure 5 Describe an example of how state space search works.

[0138] Figure 5 A schematic diagram of a state space search method in a data processing method according to an embodiment of the present disclosure is shown.

[0139] An example of a search iteration scheme in the state tree space is Figure 5 shown. Figure 5 The set of instructions (fusion actions) that can be taken by the initial state S0 shown in the figure is (A1, A2, ..., A k ), each time a fusion action is executed, it will switch to the corresponding new state (S1, S2, ..., S k ). Afterwards, the state space can be further expanded from each state, such as (S 11 ,S 12 ,…,S 1n ). Starting from state S0, the subsequent state space can be continuously searched and expanded at the set search depth D, for example, D0, D1, D2... The search expansion is based on the benefit of each action evaluation, and records two parameters for each state: benefit (V) and state access frequency (N). For example, performing fusion action A1 in the initial state S0 can obtain state S1. In state S1, the benefit of action A1 can be evaluated as V1, and the state access frequency is N1. After the state space search is completed, according to the state (S1, S2, ..., S k ) collected (V, N) parameters. In one embodiment, the confidence strategy calculation formula can be set from (S1, S2, ..., S k ) to select the best action (optimal fusion instruction group). After that, the above search process can be repeated with the new state as the initial state S0 until there is no executable fusion action in the computation graph.

[0140] In one embodiment of the present disclosure, step S120 includes: acquiring a set of fusible instruction groups in the computation graph according to the selected optimal fusible instruction group.

[0141] According to the technical solution provided by the embodiment of the present disclosure, by obtaining a set of fusible instruction groups in the computation graph according to the state of the computation graph, including: obtaining a set of fusible instruction groups in the computation graph according to the selected optimal fusible instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0142] In one embodiment of the present disclosure, in the current state, the instructions in the computation graph may form different fusible instruction groups, and therefore, the evaluation results of different fusible instruction groups (fusion actions) may also be different. After obtaining the evaluation results of different fusible instruction groups, the fusible instruction group with the best evaluation index (e.g., the highest confidence) may be executed.

[0143] The following reference Figure 6 An example of a state search based instruction fusion process is described.

[0144] Figure 6 An exemplary schematic diagram is shown of an instruction fusion process based on state search in a data processing method according to an embodiment of the present disclosure.

[0145] First, a calculation graph is input (step S610), and the calculation graph can be input in various ways commonly used in the industry.

[0146] Afterwards, state modeling is performed and an initial state is set (step S620), which represents the state of the computational graph before fusion.

[0147] Next, according to the given computational graph state, that is, the instruction composition (instruction type) and interconnection relationship (connection bitmap) in the graph, the set of instruction groups (fusible actions) that can be fused in the current computational graph is calculated (step S630). The set of instruction groups (fusible actions) that can be fused refers to a set of actions that conform to the underlying code generation rules. If it is determined in step S640 that the action set is empty, it means that the state search has been completed and the process ends. If it is determined in step S640 that the action set is not empty, the actions in the selected action set are evaluated and the state expansion continues to search based on the evaluated indicators (for example, revenue situation, etc.) (step S650).

[0148] For actual computational graphs, the action set may be too large, and all evaluation and search are very time-consuming. In this case, you can search the sub-state space based on a certain greedy strategy or randomly select a subset of actions. When expanding the state space for the selected action, you can also set a suitable search depth to balance the selection of search efficiency and action quality. It should be noted that the process of action evaluation and state space search does not modify the computational graph itself, because it is necessary to ensure that the search of these states can be backtracked.

[0149] After the action evaluation and state expansion (step S650) are completed, return to the state selected at the beginning, comprehensively consider the evaluation indicators (for example, benefits and state node access frequency, etc.) for all evaluated actions, and select the optimal action (step S660). At this time, execute the action, modify the calculation graph, and enter the next state. Repeat the above process, that is, after executing the optimal action, calculate the set of instruction groups (fusible actions) that can be fused in the current calculation graph again (step S630), and perform the corresponding operation.

[0150] In one embodiment of the present disclosure, step S120 includes: determining the dependencies between instructions in the computation graph; determining whether the dependent instructions can be fused based on the determined dependencies between the instructions; and based on the determination result that the dependent instructions can be fused, forming the instructions that can be fused into an instruction group and adding them to a set of fusible instruction groups.

[0151] According to the technical solution provided by the embodiment of the present disclosure, a set of fusible instruction groups in the calculation graph is obtained according to the state of the calculation graph, including: determining the dependency relationship between the instructions in the calculation graph; determining whether the instructions with dependencies can be fused according to the determined dependency relationship between the instructions; according to the determination result that the instructions with dependencies can be fused, the instructions that can be fused are formed into an instruction group and added to the set of fusible instruction groups, and a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0152] In one embodiment of the present disclosure, determining whether instructions with dependencies can be merged is performed based on the determined dependencies between the instructions, including: topologically sorting the instructions based on the determined dependencies between the instructions; traversing all instructions based on the result of the topological sorting to determine all instructions on which each instruction depends; and determining whether instructions with dependencies can be merged.

[0153] According to the technical solution provided by the embodiment of the present disclosure, by determining whether the instructions with dependencies can be fused according to the determined dependencies between the instructions, including: topologically sorting the instructions according to the determined dependencies between the instructions; traversing all the instructions according to the results of the topological sorting to determine all the instructions on which each instruction depends; determining whether the instructions with dependencies can be fused, a set of fused instruction groups can be obtained, and the optimal fused instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diverse business scenarios and can adapt to various different scenarios.

[0154] The following reference Figure 7 An example of the action set calculation process described.

[0155] Figure 7 An exemplary schematic diagram showing a process of calculating an action set in a data processing method according to an embodiment of the present disclosure.

[0156] Figure 7 This is an example of the calculation process of the legal action set (the set of fused instruction groups) of the calculation graph (input in step S710). Here, an output instruction can be defined for the calculation graph to generate the output tensor of the entire calculation graph. Before starting the calculation, the action set is initialized to be empty (step S720). Then, a topological sorting is performed according to the dependency relationship between instructions (step S730), that is, for instruction A->instruction B, that is, B depends on A, then A is sorted first. After completing the sorting (step S730), each instruction is traversed in reverse order starting from the output instruction (step S740) until all instructions are traversed (the result of step S750 is yes) and the end. In the case where the traversal is not completed (the result of step S750 is no), for each traversed instruction, all instructions that the instruction depends on are checked, and it is determined whether it can be fused with the instruction (step S760). If it can be fused, a legal action (a fused instruction group) is generated and added to the action set (step S770).

[0157] In one embodiment of the present disclosure, whether multiple instructions (instruction groups) can be fused depends on the underlying code generation capability. Note that in the embodiment of the present disclosure, it is not necessary to introduce any business field-related rules to assist in the benefit judgment, but as long as the instruction group that can generate the target code is a legal action (a fusion-capable instruction group). Therefore, a set of fusion-capable instruction groups can be obtained, and the selected optimal fusion-capable instruction group can be more efficiently adapted to the underlying hardware facilities, thereby improving the hardware performance.

[0158] For example, given a code generator, this rule can be formally described using a set of BNF paradigms. An example is Figure 8 shown.

[0159] Figure 8 A schematic diagram showing an example of instruction fusion rules in a data processing method according to an embodiment of the present disclosure.

[0160] Figure 8 The instruction INST shown in can be Reduce, Binary, Unary, Bitcast, Slice, Concat, Transpose, Gather, Broadcast, and Fusion. Figure 8 In the fusion rules shown, as long as the instruction sequence INSTS composed of these instructions, the code generation tool can generate the target code, but it does not guarantee the execution performance when the hardware resources are satisfied or the hardware resources are satisfied. The satisfaction or performance constraints of hardware resources can be solved by adaptive planning through action evaluation and sub-state space expansion. Therefore, the scheme according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the scheme according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios. Those skilled in the art can understand that as long as the underlying code generation capabilities of the system that executes the calculation graph allow, the fusion rules can be free of any specific restrictions.

[0161] The following further describes the process of evaluating the legal action set (the set of fusible instruction groups) and expanding the state space with reference to the embodiments.

[0162] In one embodiment of the present disclosure, step S140 includes: based on determining that the set of fusible instruction groups is not empty, performing a state search expansion on the instruction group according to a preset search index.

[0163] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: according to determining that the set of fusible instruction groups is not empty, the state search expansion is performed on the instruction groups according to the preset search index, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0164] In one embodiment of the present disclosure, the search index may refer to, for example, the benefit of the fusion action and the frequency of state node visits, or the confidence based on comprehensive consideration of the benefit of the fusion action and the frequency of state node visits, etc.

[0165] In one embodiment of the present disclosure, based on determining that the set of fusible instruction groups is not empty, a state search expansion is performed on the instruction group according to a preset search index, including: based on determining that the set of fusible instruction groups is not empty, determining whether the instruction groups in the set of fusible instruction groups have been evaluated; based on the fact that the instruction groups in the set of fusible instruction groups have been evaluated, updating the state parameters of the computational graph state.

[0166] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the state search expansion is performed on the instruction group according to the preset search index, including: determining whether the instruction group in the fusible instruction group set has been evaluated according to the determination that the set of fusible instruction groups is not empty; updating the state parameters of the computation graph state according to the instruction group in the fusible instruction group set has been evaluated, the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0167] In one embodiment of the present disclosure, based on determining that the set of fusible instruction groups is not empty, performing a state search expansion on the instruction groups according to preset search indicators, further comprising: based on the fact that the instruction groups in the set of fusible instruction groups have not been evaluated, calculating state parameters of the graph states for the unevaluated instruction groups; and performing a state search expansion according to preset search indicators.

[0168] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, a state search expansion is performed for the instruction group according to a preset search index, and it also includes: according to the fact that the instruction group in the set of fusible instruction groups is not evaluated, the state parameters of the graph state are calculated for the unevaluated instruction group; the state search expansion is performed according to the preset search index, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0169] In one embodiment of the present disclosure, performing state search expansion according to preset search indicators further includes: performing state search expansion according to preset search indicators based on preset search rules.

[0170] According to the technical solution provided by the embodiment of the present disclosure, by performing state search expansion according to preset search indicators, it also includes: based on preset search rules, performing state search expansion according to preset search indicators, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0171] In one embodiment of the present disclosure, performing state search expansion according to a preset search index further includes: updating state parameters of the computation graph state according to a result of performing state search expansion according to the preset search index.

[0172] According to the technical solution provided by the embodiment of the present disclosure, by performing state search expansion according to preset search indicators, it also includes: according to the result of state search expansion according to preset search indicators, the state parameters of the computational graph state are updated, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0173] In one embodiment of the present disclosure, the state parameters of the computation graph state include a revenue parameter of the state and an access frequency parameter of the state.

[0174] According to the technical solution provided by the embodiment of the present disclosure, a set of fusible instruction groups can be obtained by calculating the state parameters of the graph state, including the revenue parameter of the state and the access frequency parameter of the state, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0175] In one embodiment of the present disclosure, the benefit parameter of the state is obtained by predicting a preset performance model or by actually measuring the target code generated by calling a code generator.

[0176] According to the technical solution provided by the embodiment of the present disclosure, the revenue parameter of the state is obtained by predicting through a preset performance model or calling a code generator to generate actual measurement of the target code, and a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can adapt the underlying hardware facilities more efficiently. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0177] In one embodiment of the present disclosure, the benefit parameter of the state includes at least one of an execution performance parameter and a memory occupancy parameter of the executable code generated based on the fusible instruction group.

[0178] According to the technical solution provided by the embodiment of the present disclosure, the benefit parameter of the state includes at least one of the execution performance parameter and the memory occupancy parameter of the executable code generated based on the fusible instruction group, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0179] In one embodiment of the present disclosure, step S140 includes: updating the computation graph state according to the evaluation result of the instruction group in the fusible instruction group set.

[0180] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: according to the evaluation results of the instruction groups in the set of fusible instruction groups, the state of the calculation graph is updated, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0181] The following reference Fig. 9An example of the action evaluation and state space expansion process described.

[0182] Fig. 9 An exemplary schematic diagram showing the action evaluation and state space expansion process in a data processing method according to an embodiment of the present disclosure.

[0183] Fig. 9 This is an example of the process of evaluating a legal action set (a set of fused instruction groups) and expanding the state space under a given state. First, select the action set to be evaluated from the input action set (step S910) (step S920). Generally speaking, it is only necessary to select an action set when the action set is too large for a large computational graph, resulting in too high a compilation phase overhead. Random strategies, model predictions, or empirical rules can be used to select an action set, and then the action evaluation phase is entered.

[0184] If the action set is empty (step S930 is judged as yes), the process ends. If the action set is not empty (step S930 is judged as no), get the initial action or the next action (step S940). The state obtained by the calculation graph when executing the selected action can be defined as the initial state, and the action evaluation is attempted. If the action has been evaluated (step S950 is judged as yes), the evaluation result is directly obtained and the initial state is backtracked to update (step S980). If the action has not been evaluated (step S950 is judged as no), the action is evaluated (step S960), for example, the benefit V and state access frequency N of the action are calculated.

[0185] In one embodiment of the present disclosure, the Monte Carlo tree search method may repeatedly visit some state nodes. In order to avoid repeated evaluation each time the nodes are visited, a cache can be designed to save the results of each local action evaluation. In this way, when the evaluation of the same state is encountered in the future, the previously cached evaluation results can be directly reused, thereby avoiding repeated evaluation.

[0186] In one embodiment of the present disclosure, step S140 includes: evaluating the instruction groups in the set of fusible instruction groups based on a Monte Carlo tree search method.

[0187] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: the set of fusible instruction groups is evaluated based on the Monte Carlo tree search method, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0188] In one embodiment of the present disclosure, step S140 includes: caching the evaluation results.

[0189] According to the technical solution provided by the embodiment of the present disclosure, the instruction groups in the fusible instruction group set are evaluated by determining that the fusible instruction group set is not empty, including: caching the evaluation results, so that when encountering an evaluation of the same status after the evaluation is completed, the previously cached evaluation results can be directly reused, thereby avoiding repeated evaluations and saving resources.

[0190] In one embodiment of the present disclosure, the action evaluation (step S960) process determines the benefit of executing the generated code after fusing the instruction group defined by it. When the calculation mode is simple and the hardware structure pipeline software is visible, an approximate evaluation can be performed by building a performance model. In addition, the action (instruction group that can be fused) can be directly compiled to generate the target code and judged by actual measurement.

[0191] In one embodiment of the present disclosure, the benefit criteria for evaluating an action (a fusionable instruction group) include but are not limited to the following two dimensions: (1) the degree of execution performance before and after the fusion of the instruction group; (2) the degree of use of device resources (such as memory) before and after the fusion of the instruction group. For example, if resources are saved after fusion, it means that more computing services can be carried. After evaluating the benefits of each dimension, the benefits V value of the action is summarized and updated, and the access frequency N of the state defined by the action is initialized to 1.

[0192] The sub-state space expansion (step S970) continues to select subsequent actions (fusible instruction groups) according to the set exploration depth and continues to search until the search depth is exceeded or the action set is empty. The search method is similar to the aforementioned process, but after each subsequent action evaluation, it is necessary to backtrack and update the (V, N) value of the initial state. In one embodiment of the present disclosure, the method for updating the (V, N) value of the initial state is as follows: (1) V value update, each update is the maximum value of the benefit on the fusion path from the initial state to the leaf state; (2) N value update, each time a new state is searched, the N value of all states starting from the parent state of the state to the initial state is increased by 1. In other words, the (V, N) of the initial state represents the overall benefit and access frequency after the expansion.

[0193] The following reference Fig.10 An example of the action selection process described.

[0194] Fig.10 An exemplary schematic diagram showing an action selection process in a data processing method according to an embodiment of the present disclosure.

[0195] Fig.10 is an example of the process of finally selecting an action for the initial state after action evaluation. First, initialize the (V, N) value for the initial state (step S1010). After that, evaluate each action in the action set in turn. For example, input an action set (a set of fused instruction groups) (step S1020), and determine whether the set is empty (step S1030). If the set is not empty (the result of step S1030 is no), obtain the action (step S1040). For each action k, evaluate and obtain (V k ,N k ) (step S1050), and update the (V, N) value of the initial state (step S1060). For example, V = max(V, V k ), N=N k The initial state is updated until all actions are evaluated. Afterwards, if the set is empty (the result of step S1030 is yes), the action with the largest confidence (eg, UCB confidence) is selected and returned (step S1070), and the selection is ended.

[0196] For example, the reference calculation formula for confidence is as follows:

[0197]

[0198] Where C is a constant.

[0199] Those skilled in the art can understand that, according to the teachings of the present disclosure, the confidence calculation can be performed using means known in the relevant art, and the confidence calculation formula is not limited to the above formula.

[0200] The following reference Figure 3 A data processing method according to yet another embodiment of the present disclosure is described.

[0201] Figure 3 A flow chart showing a data processing method according to another embodiment of the present disclosure is shown. Figure 3 The embodiment shown is similar to Figure 1 The embodiment shown is different in that it further includes step S310 before step S120.

[0202] In step S310, the set of fusible instruction groups is initialized to empty.

[0203] According to the technical solution provided by the embodiment of the present disclosure, before obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph, the set of fusible instruction groups is initialized to empty, which is conducive to the implementation of the calculation of the set of fusible instruction groups, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0204] The following reference Figure 4 A data processing method according to yet another embodiment of the present disclosure is described.

[0205] Figure 4 A flow chart showing a data processing method according to another embodiment of the present disclosure is shown. Figure 4 The embodiment shown includes Figure 1 In addition to steps S110 to S150 shown in the implementation method, step S410 is also included.

[0206] In step S410, according to a preset instruction fusion rule, an executable code for executing the fusion action represented by the optimal instruction group is generated based on the selected optimal fusionable instruction group.

[0207] According to the technical solution provided by the embodiment of the present disclosure, by generating executable code for executing the fusion action represented by the optimal instruction group based on the selected optimal fusible instruction group according to the preset instruction fusion rule, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can adapt the underlying hardware facilities more efficiently. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0208] In one embodiment of the present disclosure, based on determining that the fusible instruction group set is not empty, the instruction groups in the fusible instruction group set are evaluated, including: selecting a sub-fusible instruction group set in the fusible instruction group set; and evaluating the instruction groups in the sub-fusible instruction group set.

[0209] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: selecting a sub-set of fusible instruction groups in the set of fusible instruction groups; evaluating the instruction groups in the sub-set of fusible instruction groups, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0210] The following reference Fig.11 A data processing device according to an embodiment of the present disclosure is described.

[0211] Fig.11 FIG. 1 is a block diagram showing a data processing device 1100 according to an embodiment of the present disclosure. Fig.11 As shown, the data processing device 1100 includes a first acquisition module 1110 , a second acquisition module 1120 , a determination module 1130 , an evaluation module 1140 and a selection module 1150 .

[0212] The first acquisition module 1110 is configured to acquire a computation graph state according to the computation graph.

[0213] The second acquisition module 1120 is configured to acquire a set of fusible instruction groups in the computation graph according to the computation graph state.

[0214] The determination module 1130 is configured to determine whether the set of fusible instruction groups is empty.

[0215] The evaluation module 1140 is configured to evaluate the instruction groups in the fusible instruction group set according to the determination module 1130 determining that the fusible instruction group set is not empty.

[0216] The selection module 1150 is configured to select an optimal fusible instruction group based on the evaluation result of the evaluation module 1140 on the instruction groups in the fusible instruction group set.

[0217] According to the technical solution provided by the embodiment of the present disclosure, the first acquisition module is configured to obtain the state of the calculation graph according to the calculation graph; the second acquisition module is configured to obtain the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; the determination module is configured to determine whether the set of fusible instruction groups is empty; the evaluation module is configured to determine that the set of fusible instruction groups is not empty according to the determination module, and evaluate the instruction groups in the set of fusible instruction groups; the selection module is configured to select the optimal fusible instruction group based on the evaluation result of the evaluation module on the instruction groups in the set of fusible instruction groups, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0218] Those skilled in the art will understand that referring to Fig.11 The technical solutions described can be compared with Figures 1 to 10 The described embodiments are combined to provide a reference Figures 1 to 10 The technical effects achieved by the described embodiments. Figures 1 to 10 The specific content of the description will not be repeated here.

[0219] The following reference Fig.12 An instruction fusion method according to an embodiment of the present disclosure is described.

[0220] Fig.12 FIG. 1 is a flow chart of an instruction fusion method according to an embodiment of the present disclosure. Fig.12 As shown, the instruction fusion method includes the following steps S1210, S1220, S1230, S1240 and S1250:

[0221] In step S1210, the computation graph state is obtained according to the computation graph.

[0222] In step S1220, a set of fusible instruction groups in the computation graph is obtained according to the computation graph state.

[0223] In step S1230 , it is determined whether the set of fusible instruction groups is empty.

[0224] In step S1240, based on determining that the fusible instruction group set is not empty, the instruction groups in the fusible instruction group set are evaluated.

[0225] In step S1250, based on the evaluation results of the instruction groups in the set of fusible instruction groups, the optimal fusible instruction group is selected for instruction fusion.

[0226] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the state of the calculation graph according to the calculation graph; obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; determining whether the set of fusible instruction groups is empty; evaluating the instruction groups in the set of fusible instruction groups according to the determination that the set of fusible instruction groups is not empty; based on the evaluation results of the instruction groups in the set of fusible instruction groups, selecting the optimal fusible instruction group for instruction fusion, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0227] In one embodiment of the present disclosure, the method of this embodiment further includes the step of: selecting a fusible instruction group with the highest confidence as an optimal fusible instruction group based on determining that the set of fusible instruction groups is empty.

[0228] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is empty, selecting the fusible instruction group with the largest confidence as the optimal fusible instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0229] In one embodiment of the present disclosure, obtaining a set of fusible instruction groups in a computation graph according to a computation graph state includes: obtaining a set of fusible instruction groups in the computation graph according to a selected optimal fusible instruction group.

[0230] According to the technical solution provided by the embodiment of the present disclosure, by obtaining a set of fusible instruction groups in the computation graph according to the state of the computation graph, including: obtaining a set of fusible instruction groups in the computation graph according to the selected optimal fusible instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0231] In one embodiment of the present disclosure, based on determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: based on determining that the set of fusible instruction groups is not empty, performing a state search expansion for the instruction groups according to preset search indicators.

[0232] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: according to determining that the set of fusible instruction groups is not empty, the state search expansion is performed on the instruction groups according to the preset search index, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0233] In one embodiment of the present disclosure, based on determining that the set of fusible instruction groups is not empty, a state search expansion is performed on the instruction group according to a preset search index, including: based on determining that the set of fusible instruction groups is not empty, determining whether the instruction groups in the set of fusible instruction groups have been evaluated; based on the fact that the instruction groups in the set of fusible instruction groups have been evaluated, updating the state parameters of the computational graph state.

[0234] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the state search expansion is performed on the instruction group according to the preset search index, including: determining whether the instruction group in the fusible instruction group set has been evaluated according to the determination that the set of fusible instruction groups is not empty; updating the state parameters of the computation graph state according to the instruction group in the fusible instruction group set has been evaluated, the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0235] In one embodiment of the present disclosure, based on determining that the set of fusible instruction groups is not empty, performing a state search expansion on the instruction groups according to preset search indicators, further comprising: based on the fact that the instruction groups in the set of fusible instruction groups have not been evaluated, calculating state parameters of the graph states for the unevaluated instruction groups; and performing a state search expansion according to preset search indicators.

[0236] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, a state search expansion is performed for the instruction group according to a preset search index, and it also includes: according to the fact that the instruction group in the set of fusible instruction groups is not evaluated, the state parameters of the graph state are calculated for the unevaluated instruction group; the state search expansion is performed according to the preset search index, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0237] In one embodiment of the present disclosure, performing state search expansion according to preset search indicators further includes: performing state search expansion according to preset search indicators based on preset search rules.

[0238] According to the technical solution provided by the embodiment of the present disclosure, by performing state search expansion according to preset search indicators, it also includes: based on preset search rules, performing state search expansion according to preset search indicators, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0239] In one embodiment of the present disclosure, performing state search expansion according to a preset search index further includes: updating state parameters of the computation graph state according to a result of performing state search expansion according to the preset search index.

[0240] According to the technical solution provided by the embodiment of the present disclosure, by performing state search expansion according to preset search indicators, it also includes: according to the result of state search expansion according to preset search indicators, the state parameters of the computational graph state are updated, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0241] In one embodiment of the present disclosure, based on determining that the fusible instruction group set is not empty, the instruction groups in the fusible instruction group set are evaluated, including: updating the computation graph state based on the evaluation result of the instruction groups in the fusible instruction group set.

[0242] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: according to the evaluation results of the instruction groups in the set of fusible instruction groups, the state of the calculation graph is updated, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0243] In one embodiment of the present disclosure, a set of fusible instruction groups in a computation graph is obtained according to a computation graph state, including: determining dependencies between instructions in the computation graph; determining whether instructions with dependencies can be fused according to the determined dependencies between the instructions; and according to the result of determining that instructions with dependencies can be fused, forming instructions that can be fused into an instruction group and adding the instructions to the set of fusible instruction groups.

[0244] According to the technical solution provided by the embodiment of the present disclosure, a set of fusible instruction groups in the calculation graph is obtained according to the state of the calculation graph, including: determining the dependency relationship between the instructions in the calculation graph; determining whether the instructions with dependencies can be fused according to the determined dependency relationship between the instructions; according to the determination result that the instructions with dependencies can be fused, the instructions that can be fused are formed into an instruction group and added to the set of fusible instruction groups, and a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0245] In one embodiment of the present disclosure, determining whether instructions with dependencies can be merged is performed based on the determined dependencies between the instructions, including: topologically sorting the instructions based on the determined dependencies between the instructions; traversing all instructions based on the result of the topological sorting to determine all instructions on which each instruction depends; and determining whether instructions with dependencies can be merged.

[0246] According to the technical solution provided by the embodiment of the present disclosure, by determining whether the instructions with dependencies can be fused according to the determined dependencies between the instructions, including: topologically sorting the instructions according to the determined dependencies between the instructions; traversing all the instructions according to the results of the topological sorting to determine all the instructions on which each instruction depends; determining whether the instructions with dependencies can be fused, a set of fused instruction groups can be obtained, and the optimal fused instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diverse business scenarios and can adapt to various different scenarios.

[0247] In one embodiment of the present disclosure, before obtaining the set of fusible instruction groups in the computation graph according to the computation graph state, it includes: initializing the set of fusible instruction groups to empty.

[0248] According to the technical solution provided by the embodiment of the present disclosure, before obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph, the set of fusible instruction groups is initialized to empty, which is conducive to the implementation of the calculation of the set of fusible instruction groups, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0249] In one embodiment of the present disclosure, according to a preset instruction fusion rule, an executable code for executing the fusion action represented by the optimal instruction group is generated based on the selected optimal fusionable instruction group.

[0250] According to the technical solution provided by the embodiment of the present disclosure, by generating executable code for executing the fusion action represented by the optimal instruction group based on the selected optimal fusible instruction group according to the preset instruction fusion rule, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can adapt the underlying hardware facilities more efficiently. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0251] In one embodiment of the present disclosure, the computation graph state is represented by a tuple including an instruction type and a connection bitmap representing the dependency relationship between instructions.

[0252] According to the technical solution provided by the embodiment of the present disclosure, a set of fusible instruction groups can be obtained by representing the computational graph state by a tuple including an instruction type and a connection bitmap representing the dependency relationship between instructions, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0253] In one embodiment of the present disclosure, the state parameters of the computation graph state include a revenue parameter of the state and an access frequency parameter of the state.

[0254] According to the technical solution provided by the embodiment of the present disclosure, a set of fusible instruction groups can be obtained by calculating the state parameters of the graph state, including the revenue parameter of the state and the access frequency parameter of the state, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0255] In one embodiment of the present disclosure, the benefit parameter of the state is obtained by predicting a preset performance model or by actually measuring the target code generated by calling a code generator.

[0256] According to the technical solution provided by the embodiment of the present disclosure, the revenue parameter of the state is obtained by predicting through a preset performance model or calling a code generator to generate actual measurement of the target code, and a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can adapt the underlying hardware facilities more efficiently. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the granularity of hardware execution, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0257] In one embodiment of the present disclosure, the benefit parameter of the state includes at least one of an execution performance parameter and a memory occupancy parameter of the executable code generated based on the fusible instruction group.

[0258] According to the technical solution provided by the embodiment of the present disclosure, the benefit parameter of the state includes at least one of the execution performance parameter and the memory occupancy parameter of the executable code generated based on the fusible instruction group, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can more efficiently adapt to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0259] In one embodiment of the present disclosure, based on determining that the fusible instruction group set is not empty, the instruction groups in the fusible instruction group set are evaluated, including: selecting a sub-fusible instruction group set in the fusible instruction group set; and evaluating the instruction groups in the sub-fusible instruction group set.

[0260] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: selecting a sub-set of fusible instruction groups in the set of fusible instruction groups; evaluating the instruction groups in the sub-set of fusible instruction groups, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0261] In one embodiment of the present disclosure, based on determining that the fusible instruction group set is not empty, evaluating the instruction groups in the fusible instruction group set includes: evaluating the instruction groups in the fusible instruction group set based on a Monte Carlo tree search method.

[0262] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including: the set of fusible instruction groups is evaluated based on the Monte Carlo tree search method, and the set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation result can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0263] In one embodiment of the present disclosure, based on determining that the fusible instruction group set is not empty, the instruction groups in the fusible instruction group set are evaluated, including: caching the evaluation results.

[0264] According to the technical solution provided by the embodiment of the present disclosure, by determining that the set of fusible instruction groups is not empty, the instruction groups in the set of fusible instruction groups are evaluated, including caching the evaluation results. When encountering an evaluation of the same state after the evaluation is completed, the previously cached evaluation results can be directly reused, thereby avoiding repeated evaluations and saving resources.

[0265] Those skilled in the art will understand that referring to Fig.12 The technical solutions described can be compared with Figures 1 to 11 The described embodiments are combined to provide a reference Figures 1 to 11 The technical effects achieved by the described embodiments. Figures 1 to 11 The specific content of the description will not be repeated here.

[0266] The following reference Fig.13 A code generation method according to an embodiment of the present disclosure is described.

[0267] Fig.13 A flow chart of a code generation method according to an embodiment of the present disclosure is shown. Fig.13 As shown, the code generation method includes the following steps S1310, S1320, S1330, S1340 and S1350.

[0268] In step S1310, the computation graph state is obtained according to the computation graph.

[0269] In step S1320, a set of fusible instruction groups in the computation graph is obtained according to the computation graph state.

[0270] In step S1330 , it is determined whether the set of fusible instruction groups is empty.

[0271] In step S1340, based on determining that the fusible instruction group set is not empty, the instruction groups in the fusible instruction group set are evaluated.

[0272] In step S1350, based on the evaluation result of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected to generate executable code for executing the fusion action represented by the optimal instruction group.

[0273] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the state of the calculation graph according to the calculation graph; obtaining the set of fusible instruction groups in the calculation graph according to the state of the calculation graph; determining whether the set of fusible instruction groups is empty; evaluating the instruction groups in the set of fusible instruction groups according to the determination that the set of fusible instruction groups is not empty; based on the evaluation results of the instruction groups in the set of fusible instruction groups, selecting the optimal fusible instruction group to generate an executable code for executing the fusion action represented by the optimal instruction group, a set of fusible instruction groups can be obtained, and the optimal fusible instruction group selected according to the evaluation results can be more efficiently adapted to the underlying hardware facilities. The solution according to the embodiment of the present disclosure can fuse fragmented nodes, expand the hardware execution granularity, and improve hardware performance. Moreover, the solution according to the embodiment of the present disclosure does not need to extract business rules from specific business scenarios, so it has generalization capabilities when facing diversified business scenarios and can adapt to various different scenarios.

[0274] Those skilled in the art will appreciate that the technical solution of this embodiment can be compared with the reference Figures 1 to 12 The described embodiments are combined to provide a reference Figures 1 to 12 The technical effects achieved by the described embodiments. Figures 1 to 12 The specific content of the description will not be repeated here.

[0275] The above embodiments describe the internal functions and structures of the data processing device. In a possible design, the structure of the data processing device can be implemented as an electronic device, such as Fig.14 As shown in , the electronic device 1400 may include a processor 1401 and a memory 1402 .

[0276] The memory 1402 is used to store a program that supports the positioning device to execute the data processing method or the code generation method in any of the above embodiments, and the processor 1401 is configured to execute the program stored in the memory 1402 .

[0277] In one embodiment of the present disclosure, the memory 1402 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 1401 to implement the following steps:

[0278] Get the computational graph status according to the computational graph;

[0279] Acquire a set of fusible instruction groups in the computation graph according to the computation graph state;

[0280] Determine whether the set of fusible instruction groups is empty;

[0281] According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups;

[0282] Based on the evaluation results of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected.

[0283] In one embodiment of the present disclosure, the one or more computer instructions are further executed by the processor 1401 to implement the following steps:

[0284] According to determining that the set of fusible instruction groups is empty, the fusible instruction group with the greatest confidence is selected as the optimal fusible instruction group.

[0285] In one embodiment of the present disclosure, the acquiring, according to the computation graph state, a set of fusible instruction groups in the computation graph includes:

[0286] According to the selected optimal fusible instruction group, a set of fusible instruction groups in the computation graph is obtained.

[0287] In one embodiment of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0288] According to determining that the set of fusible instruction groups is not empty, a state search expansion is performed on the instruction group according to a preset search index.

[0289] In one embodiment of the present disclosure, the step of performing a state search expansion on the instruction group according to a preset search index based on determining that the set of fusible instruction groups is not empty includes:

[0290] Determining whether the instruction group in the fusible instruction group set has been evaluated according to determining that the fusible instruction group set is not empty;

[0291] According to the instruction group in the set of fusible instruction groups having been evaluated, the state parameters of the computation graph state are updated.

[0292] In one embodiment of the present disclosure, the step of performing state search expansion on the instruction group according to a preset search index based on determining that the set of fusible instruction groups is not empty further includes:

[0293] According to the instruction group in the set of fusible instruction groups not being evaluated, calculating the state parameter of the graph state for the unevaluated instruction group;

[0294] Expand the status search based on the preset search indicators.

[0295] In one embodiment of the present disclosure, the state search expansion according to the preset search index further includes:

[0296] Based on the preset search rules, the status search is expanded according to the preset search indicators.

[0297] In one embodiment of the present disclosure, the state search expansion according to the preset search index further includes:

[0298] According to the result of the state search expansion performed according to the preset search index, the state parameters of the computation graph state are updated.

[0299] In one embodiment of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0300] The computation graph state is updated according to the evaluation result of the instruction groups in the set of fusible instruction groups.

[0301] In one embodiment of the present disclosure, the acquiring, according to the computation graph state, a set of fusible instruction groups in the computation graph includes:

[0302] Determining dependencies between instructions in the computation graph;

[0303] Determining whether the instructions with dependencies can be merged according to the determined dependencies between the instructions;

[0304] According to the result of determining that the instructions with dependencies can be fused, the instructions that can be fused are formed into an instruction group and added into the set of fusible instruction groups.

[0305] In one embodiment of the present disclosure, determining whether the instructions with dependencies can be merged according to the determined dependencies between the instructions includes:

[0306] topologically sorting the instructions according to the determined dependencies between the instructions;

[0307] Traverse all instructions according to the result of topological sorting to determine all instructions that each instruction depends on;

[0308] Determines whether dependent instructions can be fused.

[0309] In one embodiment of the present disclosure, before acquiring the set of fusible instruction groups in the computation graph according to the computation graph state, the method includes:

[0310] Initialize the fusible instruction group set to empty.

[0311] In one embodiment of the present disclosure, the one or more computer instructions are further executed by the processor 1401 to implement the following steps:

[0312] According to preset instruction fusion rules, based on the selected optimal fusionable instruction group, an executable code for executing the fusion action represented by the optimal instruction group is generated.

[0313] In one embodiment of the present disclosure, the computation graph state is represented by a tuple including an instruction type and a connection bitmap representing dependency relationships between instructions.

[0314] In one embodiment of the present disclosure, the state parameters of the computation graph state include a revenue parameter of the state and an access frequency parameter of the state.

[0315] In one embodiment of the present disclosure, the benefit parameter of the state is obtained by predicting a preset performance model or by actually measuring the target code generated by calling a code generator.

[0316] In one embodiment of the present disclosure, the benefit parameter of the state includes at least one of an execution performance parameter and a memory occupancy parameter of the executable code generated based on the fusible instruction group.

[0317] In one embodiment of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0318] Selecting a sub-fusible instruction group set from the fusible instruction group set;

[0319] The instruction groups in the sub-set of fusible instruction groups are evaluated.

[0320] In one embodiment of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0321] The instruction groups in the set of fusible instruction groups are evaluated based on a Monte Carlo tree search method.

[0322] In one embodiment of the present disclosure, the step of evaluating the instruction groups in the set of fusible instruction groups according to determining that the set of fusible instruction groups is not empty includes:

[0323] Cache the evaluation results.

[0324] In another embodiment of the present disclosure, the one or more computer instructions are executed by the processor 1401 to implement the following steps:

[0325] Get the computational graph status according to the computational graph;

[0326] Acquire a set of fusible instruction groups in the computation graph according to the computation graph state;

[0327] Determine whether the set of fusible instruction groups is empty;

[0328] According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups;

[0329] Based on the evaluation results of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected for instruction fusion.

[0330] In yet another embodiment of the present disclosure, the one or more computer instructions are executed by the processor 1401 to implement the following steps:

[0331] Get the computational graph status according to the computational graph;

[0332] Acquire a set of fusible instruction groups in the computation graph according to the computation graph state;

[0333] Determine whether the set of fusible instruction groups is empty;

[0334] According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups;

[0335] Based on the evaluation results of the instruction groups in the set of fusible instruction groups, an optimal fusible instruction group is selected to generate executable code for executing the fusion action represented by the optimal instruction group.

[0336] The exemplary embodiments of the present disclosure further provide a computer storage medium for storing computer software instructions used by the positioning device, which includes a program for executing any of the above embodiments, thereby achieving the technical effects brought by the method.

[0337] Fig.15 It is a structural diagram of a computer system suitable for implementing a data processing method, an instruction fusion method or a code generation method according to an embodiment of the present disclosure.

[0338] like Fig.15 As shown, the computer system 1500 includes a central processing unit (CPU) 1501, which can perform various processes in the embodiments shown in the above figures according to the program stored in the read-only memory (ROM) 1502 or the program loaded from the storage part 1508 to the random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the system 1500 are also stored. The CPU 1501, the ROM 1502, and the RAM 1503 are connected to each other through a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0339] The following components are connected to the I / O interface 1505: an input section 1506 including a keyboard, a mouse, etc.; an output section 1507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN card, a modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1510 as needed, so that a computer program read therefrom is installed into the storage section 1508 as needed.

[0340] In particular, according to an embodiment of the present disclosure, the method described above with reference to the accompanying drawings can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes program code for executing the method in the accompanying drawings. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1509, and / or installed from the removable medium 1511.

[0341] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the road map or block diagram can represent a part of a module, program segment or code, and the part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0342] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0343] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the device described in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure, thereby achieving the technical effects brought by the method.

[0344] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A data processing method, characterized in that: include: Acquire a computation graph state according to the computation graph; the state parameters of the computation graph state include a state benefit parameter and a state access frequency parameter, and the state benefit parameter includes at least one of an execution performance parameter and a memory occupancy parameter of an executable code generated based on a fusible instruction group; Acquire a set of fusible instruction groups in the computation graph according to the computation graph state; Determine whether the set of fusible instruction groups is empty; According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups; Selecting an optimal fusible instruction group based on an evaluation result of the instruction groups in the set of fusible instruction groups; According to preset instruction fusion rules, based on the selected optimal fusionable instruction group, an executable code for executing the fusion action represented by the optimal instruction group is generated.

2. The method according to claim 1, characterized in that Also includes: According to determining that the set of fusible instruction groups is empty, the fusible instruction group with the greatest confidence is selected as the optimal fusible instruction group.

3. The method according to claim 1, characterized in that The acquiring a set of fusible instruction groups in the computation graph according to the computation graph state includes: According to the selected optimal fusible instruction group, a set of fusible instruction groups in the computation graph is obtained.

4. The method according to claim 1, characterized in that The step of evaluating the instruction groups in the fusionable instruction group set according to determining that the fusionable instruction group set is not empty includes: According to determining that the set of fusible instruction groups is not empty, a state search expansion is performed on the instruction group according to a preset search index.

5. The method according to claim 4, characterized in that The step of determining that the set of fusible instruction groups is not empty and performing a state search expansion on the instruction group according to a preset search index includes: Determining whether the instruction group in the fusible instruction group set has been evaluated according to determining that the fusible instruction group set is not empty; According to the instruction group in the set of fusible instruction groups having been evaluated, the state parameters of the computation graph state are updated.

6. The method according to claim 5, characterized in that The step of performing state search expansion on the instruction group according to a preset search index based on determining that the set of fusible instruction groups is not empty also includes: According to the instruction group in the set of fusible instruction groups not being evaluated, calculating the state parameter of the graph state for the unevaluated instruction group; Expand the status search based on the preset search indicators.

7. The method according to claim 6, characterized in that The state search expansion according to the preset search index also includes: Based on the preset search rules, the status search is expanded according to the preset search indicators.

8. The method according to claim 6, characterized in that The state search expansion according to the preset search index also includes: According to the result of the state search expansion performed according to the preset search index, the state parameters of the computation graph state are updated.

9. The method according to claim 1, characterized in that: The step of evaluating the instruction groups in the fusionable instruction group set according to determining that the fusionable instruction group set is not empty includes: The computation graph state is updated according to the evaluation result of the instruction groups in the set of fusible instruction groups.

10. The method according to claim 1, characterized in that The acquiring a set of fusible instruction groups in the computation graph according to the computation graph state includes: Determining dependencies between instructions in the computation graph; Determining whether the instructions with dependencies can be merged according to the determined dependencies between the instructions; According to the result of determining that the instructions with dependencies can be fused, the instructions that can be fused are formed into an instruction group and added into the set of fusible instruction groups.

11. The method according to claim 10, characterized in that The step of determining whether the instructions with dependencies can be merged according to the determined dependencies between the instructions includes: topologically sorting the instructions according to the determined dependencies between the instructions; Traverse all instructions according to the result of topological sorting to determine all instructions that each instruction depends on; Determines whether dependent instructions can be fused.

12. The method according to claim 1, characterized in that Before acquiring the set of fusible instruction groups in the computation graph according to the computation graph state, the method further comprises: Initialize the fusible instruction group set to empty.

13. The method according to claim 1, characterized in that The computation graph state is represented by a tuple including an instruction type and a connection bitmap representing dependencies between instructions.

14. The method according to claim 1, characterized in that The yield parameter of the state is obtained by predicting through a preset performance model or by actually measuring by calling a code generator to generate a target code.

15. The method according to claim 1, characterized in that The step of evaluating the instruction groups in the fusionable instruction group set according to determining that the fusionable instruction group set is not empty includes: Selecting a sub-fusible instruction group set from the fusible instruction group set; The instruction groups in the sub-set of fusible instruction groups are evaluated.

16. The method according to claim 1, characterized in that The step of evaluating the instruction groups in the fusionable instruction group set according to determining that the fusionable instruction group set is not empty includes: The instruction groups in the set of fusible instruction groups are evaluated based on a Monte Carlo tree search method.

17. The method according to claim 1, characterized in that The step of evaluating the instruction groups in the fusionable instruction group set according to determining that the fusionable instruction group set is not empty includes: Cache the evaluation results.

18. A data processing device, characterized in that: include: A first acquisition module is configured to acquire a computation graph state according to the computation graph; the state parameters of the computation graph state include a state benefit parameter and a state access frequency parameter, and the state benefit parameter includes at least one of an execution performance parameter and a memory occupancy parameter of an executable code generated based on a fusible instruction group; A second acquisition module is configured to acquire a set of fusible instruction groups in the computation graph according to the computation graph state; A determination module is configured to determine whether the set of fusible instruction groups is empty; an evaluation module, configured to evaluate the instruction groups in the fusionable instruction group set according to the determination module determining that the fusionable instruction group set is not empty; A selection module configured to select an optimal fusible instruction group based on an evaluation result of the evaluation module on the instruction groups in the set of fusible instruction groups; According to preset instruction fusion rules, based on the selected optimal fusionable instruction group, an executable code for executing the fusion action represented by the optimal instruction group is generated.

19. An instruction fusion method, characterized in that: include: Acquire a computation graph state according to the computation graph; the state parameters of the computation graph state include a state benefit parameter and a state access frequency parameter, and the state benefit parameter includes at least one of an execution performance parameter and a memory occupancy parameter of an executable code generated based on a fusible instruction group; Acquire a set of fusible instruction groups in the computation graph according to the computation graph state; Determine whether the set of fusible instruction groups is empty; According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups; Based on the evaluation results of the instruction groups in the set of fusible instruction groups, selecting the best fusible instruction group for instruction fusion; According to preset instruction fusion rules, based on the selected optimal fusionable instruction group, an executable code for executing the fusion action represented by the optimal instruction group is generated.

20. A code generation method, characterized in that: include: Acquire a computation graph state according to the computation graph; the state parameters of the computation graph state include a state benefit parameter and a state access frequency parameter, and the state benefit parameter includes at least one of an execution performance parameter and a memory occupancy parameter of an executable code generated based on a fusible instruction group; Acquire a set of fusible instruction groups in the computation graph according to the computation graph state; Determine whether the set of fusible instruction groups is empty; According to determining that the set of fusible instruction groups is not empty, evaluating the instruction groups in the set of fusible instruction groups; Based on the evaluation results of the instruction groups in the set of fusible instruction groups, selecting the best fusible instruction group to generate executable code for executing the fusion action represented by the best instruction group; According to preset instruction fusion rules, based on the selected optimal fusionable instruction group, an executable code for executing the fusion action represented by the optimal instruction group is generated.

21. An electronic device, characterized in that: comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to any one of claims 1-17, 19, and 20.

22. A readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, a method as described in any one of claims 1-17, 19, and 20 is implemented.