Operator scheduling method, device, equipment and computer-readable storage medium

Through the combination of high-level language expressions and execution engines, the target execution tree is generated and operators are uniformly scheduled, which solves the problems of operator scheduling complexity and low efficiency in deep learning models, and improves scheduling efficiency and development convenience.

CN118394348BActive Publication Date: 2024-10-22LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410853484.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-22
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

Existing operator scheduling methods in deep learning models have problems such as a lot of repetitive work, low code readability and maintainability, high maintenance complexity, and low scheduling efficiency.

Method used

By obtaining the operators to be scheduled and calculation logic in the deep learning framework, using high-level language expressions to combine operators, the execution engine parses the expressions to generate target execution trees, and schedules operators uniformly through preset universal function interfaces to simplify operator calls. and maintenance.

Benefits of technology

It reduces the differences between operators, simplifies the use and maintenance of operators, improves the calling efficiency of back-end operators of the deep learning framework, reduces code complexity and system hardware consumption, and improves development convenience and overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394348B_ABST
    Figure CN118394348B_ABST
Patent Text Reader

Abstract

The present invention discloses an operator scheduling method, device, equipment and computer-readable storage medium, which relates to the field of deep learning technology, including: obtaining each operator to be scheduled and calculation logic contained in the current deep learning framework; searching each operator to be scheduled from the back-end operator library; combining each operator to be scheduled according to the calculation logic using a high-level language expression to obtain a target expression; parsing the target expression using an execution engine to obtain a parsing result; scheduling each operator to be scheduled using a preset general function interface according to the parsing result to calculate and process the input data of the current deep learning framework. The operator scheduling method provided by the present invention solves the problems of high maintenance complexity, high development workload, low operator scheduling efficiency, etc. of the current operator scheduling method, reduces the differences in calls between operators, simplifies the use and maintenance of operators, and improves the calling efficiency of the back-end operators of the deep learning framework.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to an operator scheduling method, device, equipment and computer-readable storage medium. Background Art

[0002] In complex deep learning models, it is often necessary to combine multiple operators to implement specific computing logic, which leads to a lot of repetitive work and reduces the readability and maintainability of the code.

[0003] The current operator scheduling methods mainly include direct function calls, object-oriented design, and computational graph frameworks. However, the above methods all have their own shortcomings. First, direct function calls are to call operators as direct functions or methods. Different operators may require different parameter formats and calling methods, which increases the complexity of operator use and maintenance and makes them difficult to expand and manage. Secondly, object-oriented design is that operators are encapsulated as objects and executed through method calls, which has performance overhead. Furthermore, the computational graph framework is that operator operations are represented as nodes in the computational graph and executed through graph optimization. It is more complicated to build and parse the computational graph. When executing operators, users need to manually create and manage the input and output data structures of operators, which increases the development workload.

[0004] In summary, how to effectively solve the problems of high maintenance complexity, high development workload, and low operator scheduling efficiency of current operator scheduling methods is an issue that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide an operator scheduling method, which reduces the differences in calls between operators, simplifies the use and maintenance of operators, and improves the calling efficiency of back-end operators of a deep learning framework; another purpose of the present invention is to provide an operator scheduling device, equipment and computer-readable storage medium.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] An operator scheduling method, comprising:

[0008] Get the operators and calculation logic to be scheduled contained in the current deep learning framework;

[0009] Search for operators to be scheduled from the backend operator library;

[0010] Using a high-level language expression to combine the operators to be scheduled according to the calculation logic to obtain a target expression;

[0011] Utilizing an execution engine to parse the target expression and obtain a parsing result;

[0012] According to the analysis result, each operator to be scheduled is scheduled using a preset universal function interface to perform calculation processing on the input data of the current deep learning framework.

[0013] In a specific implementation of the present invention, the target expression is parsed using an execution engine to obtain a parsing result, including:

[0014] The target expression is parsed by using the execution engine to obtain a target execution tree; wherein the target execution tree contains the calculation steps involved in each operator to be scheduled and the dependency relationship between the calculation steps;

[0015] Correspondingly, each operator to be scheduled is scheduled using a preset universal function interface according to the analysis result to perform calculation processing on the input data of the current deep learning framework, including:

[0016] The preset universal function interface is used to schedule each operator to be scheduled in the order of the target execution tree to execute each calculation step to perform calculation processing on the input data of the current deep learning framework.

[0017] In a specific implementation of the present invention, the target expression is parsed by the execution engine to obtain a target execution tree, including:

[0018] Decomposing the target expression using a lexical analyzer in the execution engine to obtain a lexical token sequence;

[0019] The target execution tree is constructed according to the lexical token sequence using a syntax analyzer in the execution engine.

[0020] In a specific implementation of the present invention, scheduling each operator to be scheduled using a preset universal function interface according to the order of the target execution tree includes:

[0021] Taking the root node of the target execution tree as the execution starting point, traversing each node in the target execution tree to obtain a traversal result;

[0022] According to the traversal result and in the order of the target execution tree, each operator to be scheduled is scheduled using the preset universal function interface.

[0023] In a specific implementation of the present invention, traversing each node in the target execution tree with the root node of the target execution tree as the execution starting point includes:

[0024] Taking the root node of the target execution tree as the execution starting point, traverse each node in the target execution tree from left to right.

[0025] In a specific implementation of the present invention, after traversing each node in the target execution tree from left to right, the method further includes:

[0026] When traversing to a child node representing a basic operator, determining the child node representing the basic operator as the first child node;

[0027] Recursively traverse each child node of the first child node until reaching a leaf node of the target execution tree.

[0028] In a specific implementation of the present invention, the preset universal function interface is used to schedule each operator to be scheduled according to the traversal result in the order of the target execution tree, so as to execute each calculation step to calculate and process the input data of the current deep learning framework, including:

[0029] When it is determined according to the traversal result that there is a child node whose child nodes are all external input nodes, the child node whose child nodes are all external input nodes is determined as the second child node;

[0030] Get the input value of each external input node;

[0031] Using the preset universal function interface to call the target operator corresponding to the second sub-node;

[0032] generating an output value according to the target operator and each input value;

[0033] The output value is determined as the input of the upper-level operator of the target operator, and the other operators to be scheduled except the target operator are recursively scheduled using the preset universal function interface in the order of the target execution tree, so as to execute each calculation step to perform calculation processing on the input data of the current deep learning framework.

[0034] In a specific implementation of the present invention, obtaining the input value of each external input node includes:

[0035] Obtaining input values ​​of each external input node from the input container corresponding to the second subnode;

[0036] Accordingly, after generating the output value according to the target operator and each input value, it also includes:

[0037] The output value is stored in an output container corresponding to the second child node.

[0038] In a specific implementation manner of the present invention, after storing the output value in the output container corresponding to the second child node, the method further includes:

[0039] Deleting each external input node corresponding to the second sub-node;

[0040] Get the freed memory obtained by deleting each external input node;

[0041] The released memory is recorded.

[0042] In a specific implementation of the present invention, recursively scheduling other operators to be scheduled except the target operator using the preset universal function interface in the order of the target execution tree to execute each calculation step to calculate and process the input data of the current deep learning framework, including:

[0043] Recursively schedule the operators to be scheduled except the target operator using the preset universal function interface in the order of the target execution tree, so as to execute each calculation step according to the input value in the input container and the output value in the output container respectively corresponding to each intermediate operator, and perform calculation processing on the input data of the current deep learning framework;

[0044] Among them, each intermediate operator is an operator to be scheduled that is used for intermediate process calculation among other operators to be scheduled except the target operator.

[0045] In a specific implementation of the present invention, scheduling each operator to be scheduled using a preset universal function interface according to the analysis result includes:

[0046] According to the analysis result, each operator to be scheduled is scheduled using a preset universal function interface constructed by an operator name function template; wherein the preset universal function interface includes a structure composed of a union for storing various types of data and an enumeration type for identifying data types.

[0047] In a specific implementation of the present invention, obtaining each operator to be scheduled and calculation logic contained in the current deep learning framework includes:

[0048] Get the operator name and calculation logic corresponding to each operator to be scheduled contained in the current deep learning framework;

[0049] Accordingly, each operator to be scheduled is searched from the backend operator library, including:

[0050] Search each operator to be scheduled from the backend operator library according to the operator name corresponding to each operator to be scheduled.

[0051] An operator scheduling device, comprising:

[0052] Memory for storing computer programs;

[0053] A processor is used to implement the steps of the operator scheduling method as described above when executing the computer program.

[0054] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the operator scheduling method described above are implemented.

[0055] Corresponding to the above method embodiment, the present invention also provides a computer program product, including a computer program, which implements the steps of the operator scheduling method as described above when executed by a processor.

[0056] The operator scheduling method provided by the present invention obtains each operator to be scheduled and the calculation logic contained in the current deep learning framework; searches each operator to be scheduled from the back-end operator library; combines each operator to be scheduled according to the calculation logic using a high-level language expression to obtain a target expression; parses the target expression using an execution engine to obtain a parsing result; and schedules each operator to be scheduled using a preset general function interface according to the parsing result to perform calculation processing on the input data of the current deep learning framework.

[0057] The beneficial effect of the present invention is that by setting a unified universal function interface to schedule each operator to be scheduled, all operators follow a unified calling mode, reducing the differences in calls between operators and simplifying the use and maintenance of operators. By combining each operator to be scheduled using a high-level language expression, duplicate code is greatly reduced, the reusability of the code is increased, the complexity of operator calls is simplified, the code is more concise, and the consumption of system hardware is reduced. The target expression is automatically parsed by the execution engine, which reduces the workload of manual coding, improves execution efficiency, improves the convenience of the development process and the overall performance of the framework, and improves the calling efficiency of the back-end operators of the deep learning framework.

[0058] Correspondingly, the present invention also provides an operator scheduling device, equipment and computer-readable storage medium corresponding to the above-mentioned operator scheduling method, which have the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 This is an implementation flow chart of the operator scheduling method in an embodiment of the present invention;

[0061] Figure 2 Another implementation flow chart of the operator scheduling method in an embodiment of the present invention;

[0062] Figure 3 A schematic diagram of the structure of an execution tree in an embodiment of the present invention;

[0063] Figure 4 is a structural block diagram of an operator scheduling device in an embodiment of the present invention;

[0064] Figure 5 is a structural block diagram of an operator scheduling device in an embodiment of the present invention;

[0065] Figure 6 A schematic diagram of the specific structure of an operator scheduling device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0067] See also Figure 1 , Figure 1 This is a flowchart of an implementation of the operator scheduling method in an embodiment of the present invention. The method may include the following steps:

[0068] S101: Obtain each operator to be scheduled and the calculation logic contained in the current deep learning framework.

[0069] A deep neural network framework may involve multiple operators. Get the operators and calculation logic to be scheduled contained in the current deep learning framework.

[0070] The operators to be scheduled may include a cumsum operator, a divide operator, a sum operator, and the like.

[0071] The calculation logic includes the logical operation relationship between the operators to be scheduled.

[0072] S102: Searching for each operator to be scheduled from the backend operator library.

[0073] The backend operator library is pre-built, and multiple pre-written operators are stored in the backend operator library. After obtaining the operators to be scheduled contained in the current deep learning framework, the operators to be scheduled are searched from the backend operator library. This enables direct search of stored operators and avoids recoding the operators to be scheduled.

[0074] In a specific implementation of the present invention, step S101 may include the following steps:

[0075] Get the operator name and calculation logic corresponding to each operator to be scheduled contained in the current deep learning framework;

[0076] Accordingly, step S102 may include the following steps:

[0077] Search each operator to be scheduled from the backend operator library according to the operator name corresponding to each operator to be scheduled.

[0078] For the convenience of description, the above steps can be combined for explanation.

[0079] Get the operator names and calculation logic corresponding to each operator to be scheduled contained in the current deep learning framework. After obtaining the operator names corresponding to each operator to be scheduled, search for each operator to be scheduled from the backend operator library according to the operator names corresponding to each operator to be scheduled. By searching for operators based on operator names, the operator search method is simple and the operator search efficiency is improved.

[0080] S103: Using a high-level language expression, combine the operators to be scheduled according to the calculation logic to obtain a target expression.

[0081] After finding each operator to be scheduled from the backend operator library, the high-level language expression is used to combine each operator to be scheduled according to the calculation logic to obtain the target expression. The high-level language expression is used to achieve an effective combination of operators to be scheduled, and a target expression that can represent the logical relationship between each operator to be scheduled is generated. By using high-level language expressions, users are allowed to describe complex calculation logic in a concise string format, which improves the intuitiveness and ease of expression.

[0082] A high-level language expression is a string format used to describe a calculation process. It allows users to describe the calculation process in a programming-like way and allows users to combine multiple operators in an intuitive way to implement complex calculation logic.

[0083] S104: Utilize the execution engine to parse the target expression and obtain a parsing result.

[0084] Pre-built execution engines, such as FundamentalEngine, are used to perform natural language processing (NLP) tasks. It provides a powerful framework for processing text and includes a series of pre-trained models and algorithms for performing various natural language processing tasks, such as text classification, sentiment analysis, entity recognition, etc. The execution engine allows users to set input and output data.

[0085] After the target expression is obtained by combining the operators to be scheduled, the target expression is parsed by the execution engine to obtain the parsing result. The automatic parsing of the target expression obtained by combining the high-level language expressions is realized by the execution engine.

[0086] S105: Schedule each operator to be scheduled using a preset universal function interface according to the analysis result to perform computational processing on the input data of the current deep learning framework.

[0087] A general function interface for unified scheduling of operators is pre-set. After the target expression is parsed by the execution engine and the parsing result is obtained, each operator to be scheduled is scheduled using the preset general function interface according to the parsing result. By scheduling each operator to be scheduled, the input data of the current deep learning framework is calculated and processed, thereby realizing the processing of the corresponding deep learning task. The unified interface and high-level language description method improve the ease of use of the framework and lower the user's usage threshold.

[0088] In a specific implementation of the present invention, scheduling each operator to be scheduled using a preset universal function interface according to the analysis result may include the following steps:

[0089] According to the parsing result, each operator to be scheduled is scheduled using a preset universal function interface constructed by an operator name function template; wherein the preset universal function interface includes a structure composed of a union for storing various types of data and an enumeration type for identifying data types.

[0090] The operator name function template is pre-set, and the preset universal function interface is constructed through the operator name function template. The following is an example of a preset universal function interface:

[0091] Among them, operator_name is the name of the operator, inputs is a vector of UniData type containing input data, and outputs is a vector of UniData type containing output data. This interface design makes all operators follow the same calling mode, which is easy to manage and maintain.

[0092] The preset universal function interface includes a structure consisting of a union for storing various types of data and an enumeration type for identifying data types. A data structure named UniData is designed, which contains a union UniValue and an enumeration type UniType. UniValue is used to store actual data values, which can be Boolean values, integers, floating-point numbers, tensors, etc. UniType is used to identify the type of data. The following is an example of a structure:

[0093]

[0094]

[0095] DLTensor is a structure used to represent a tensor. It contains information such as shape, strides, data type, dimension, layout, and device. It also includes a pointer to the actual data void* data.

[0096] The UniData structure supports multiple data types, including scalars and complex data structures such as tensors. The UniValue union and UniType enumeration ensure consistent representation of different data types.

[0097] After the execution engine is used to parse the target expression and obtain the parsing result, the preset universal function interface constructed by the operator name (operator_name) function template is used to schedule each operator to be scheduled according to the parsing result. The preset universal function interface constructed by the operator name function template realizes the unified call of different operators. The unified interface design makes the integration of new operators and the upgrade of old operators more convenient. The uniformity and universality of the interface design ensure that operators can be seamlessly integrated into different deep learning frameworks.

[0098] It can be seen from the above technical solutions that by setting a unified universal function interface to schedule each operator to be scheduled, all operators follow a unified calling mode, which reduces the differences in calls between operators and simplifies the use and maintenance of operators. By combining each operator to be scheduled using high-level language expressions, duplicate code is greatly reduced, the reusability of the code is increased, the complexity of operator calls is simplified, the code is more concise, and the consumption of system hardware is reduced. The execution engine automatically parses the target expression, reducing the workload of manual coding, improving execution efficiency, improving the convenience of the development process and the overall performance of the framework, and improving the calling efficiency of the back-end operators of the deep learning framework.

[0099] It should be noted that, based on the above embodiment, the embodiment of the present invention also provides corresponding improved solutions. In the subsequent embodiments, the same steps or corresponding steps as those in the above embodiment can be referenced to each other, and the corresponding beneficial effects can also be referenced to each other, which will not be repeated one by one in the following improved embodiments.

[0100] See also Figure 2 , Figure 2 FIG. 4 is another implementation flow chart of the operator scheduling method in an embodiment of the present invention. The method may include the following steps:

[0101] S201: Obtain each operator to be scheduled and the calculation logic contained in the current deep learning framework.

[0102] S202: Searching for each operator to be scheduled from the backend operator library.

[0103] S203: Using a high-level language expression, combine the operators to be scheduled according to the calculation logic to obtain a target expression.

[0104] S204: Utilize the execution engine to parse the target expression and obtain a target execution tree.

[0105] The target execution tree includes the calculation steps involved in each operator to be scheduled and the dependencies between the calculation steps.

[0106] The execution engine can generate an execution tree including the calculation steps involved in each operator to be scheduled and the dependencies between the calculation steps according to the target expression obtained by combining each operator to be scheduled. After combining each operator to be scheduled according to the calculation logic using a high-level language expression to obtain the target expression, the execution engine is used to parse the target expression to obtain the target execution tree.

[0107] The following is an example of a high-level language expression:

[0108]

[0109] See also Figure 3 , Figure 3 Schematic diagram of the structure of an execution tree in an embodiment of the present invention. In the above example, the sum (sum) of the input tensor x along the last dimension (index is -1) is first calculated, then x is divided by this sum to obtain the L1 norm (L1norm), and finally the cumulative sum (cumsum) of the L1 norm along the first dimension (index is 1) is calculated.

[0110] In a specific implementation of the present invention, step S204 may include the following steps:

[0111] Step 1: Use the lexical analyzer in the execution engine to decompose the target expression and obtain a lexical token sequence;

[0112] Step 2: Use the syntax analyzer in the execution engine to build the target execution tree based on the lexical token sequence.

[0113] For the convenience of description, the above two steps can be combined for explanation.

[0114] The execution engine is a parser and executor of high-level language expressions. After combining the operators to be scheduled according to the calculation logic using the high-level language expressions to obtain the target expression, the lexical analyzer in the execution engine is used to decompose the target expression to obtain a lexical token sequence, and the syntax analyzer in the execution engine is used to build a target execution tree based on the lexical token sequence. By combining the lexical analyzer and the syntax analyzer to parse high-level language expressions, the accuracy of the parsing results is improved, the parsing efficiency is improved, and the accuracy and efficiency of the algorithm scheduling are improved. The following is an example of an execution tree:

[0115]

[0116]

[0117] The lexer is a lexical analyzer that decomposes the expression expr into lexical tokens, and the parser is a syntax analyzer that identifies operator calls in the expression. Both are used to assist in generating the execution tree.

[0118] Each node of the execution tree can be represented by a TreeNode structure, whose members include the name and type of the node. If the current node is a basic operator, its members also include the child nodes and the calculation result of the current node. The following is another execution tree example:

[0119]

[0120] S205: Schedule each operator to be scheduled using a preset universal function interface in the order of the target execution tree to execute each calculation step to perform calculation processing on the input data of the current deep learning framework.

[0121] After the target expression is parsed by the execution engine and the target execution tree is obtained, each operator to be scheduled is scheduled using the preset universal function interface in the order of the target execution tree to execute each calculation step to calculate and process the input data of the current deep learning framework. By scheduling each operator to be scheduled in the order of the target execution tree, an effective reference is provided for the scheduling order of each operator to be scheduled, which greatly improves the operator scheduling efficiency and thus improves the processing efficiency of the data to be processed.

[0122] In a specific implementation of the present invention, scheduling each operator to be scheduled using a preset universal function interface according to the order of the target execution tree may include the following steps:

[0123] Step 1: Using the root node of the target execution tree as the execution starting point, traverse each node in the target execution tree to obtain the traversal result;

[0124] Step 2: Schedule each operator to be scheduled using the preset general function interface according to the traversal results and the order of the target execution tree.

[0125] For the convenience of description, the above two steps can be combined for explanation.

[0126] After parsing and obtaining the target execution tree, the root node of the target execution tree is used as the execution starting point to traverse each node in the target execution tree to obtain a traversal result. The traversal result may include the node type of each node in the target execution tree (such as constant node, input node, basic operator node, etc.), and may also include the association relationship between each node. According to the traversal result, each operator to be scheduled is scheduled using a preset universal function interface in the order of the target execution tree. By traversing each node in the target execution tree with the root node of the target execution tree as the execution starting point, and scheduling operators in the order of the target execution tree according to the traversal result, an orderly traversal of each node in the target execution tree is guaranteed.

[0127] In a specific implementation of the present invention, traversing each node in the target execution tree with the root node of the target execution tree as the execution starting point may include the following steps:

[0128] The root node of the target execution tree is used as the execution starting point, and each node in the target execution tree is traversed from left to right.

[0129] When traversing each node in the target execution tree, the root node of the target execution tree is used as the execution starting point, and each node in the target execution tree is traversed from left to right. By traversing each node in the target execution tree from left to right, the orderliness of traversing each node in the target execution tree is further improved, and omissions when traversing the nodes in the target execution tree are avoided. Automated execution tree management and optimization strategies improve the overall computing execution efficiency.

[0130] In a specific implementation of the present invention, after traversing each node in the target execution tree from left to right, the method may further include the following steps:

[0131] Step 1: When traversing to a child node representing a basic operator, determine the child node representing the basic operator as the first child node;

[0132] Step 2: Recursively traverse each child node of the first child node until reaching the leaf node of the target execution tree.

[0133] For the convenience of description, the above two steps can be combined for explanation.

[0134] After traversing each node in the target execution tree from left to right, when traversing to the child node representing the basic operator, the child node representing the basic operator is determined as the first child node, and the child nodes of the first child node are recursively traversed until the leaf node of the target execution tree is reached. By recursively traversing each child node of the first child node representing the basic operator, the orderliness of traversing each node in the target execution tree is further improved. The clear automation management process and execution tree structure improve the readability of the code, making it easier to understand and maintain.

[0135] like Figure 3 As shown, when the root node representing the cumulative summation operator is traversed, its child nodes are traversed in order from left to right to obtain the child node representing the division operator and the child node representing the constant 1. Since the child node representing the division operator still has child nodes, its child nodes are further traversed to obtain the leaf node representing the input tensor x and the child node representing the summation operator. Since the child node representing the summation operator still has child nodes, its child nodes are further traversed to obtain the leaf node representing the tensor x, the leaf node representing the input tensor x, the leaf node representing the input constant -1, and the leaf node representing the Boolean constant True.

[0136] In a specific implementation of the present invention, scheduling each operator to be scheduled using a preset universal function interface in the order of the target execution tree according to the traversal result to execute each calculation step to calculate and process the input data of the current deep learning framework may include the following steps:

[0137] Step 1: when it is determined according to the traversal result that there is a child node whose child nodes are all external input nodes, the child node whose child nodes are all external input nodes is determined as the second child node;

[0138] Step 2: Get the input value of each external input node;

[0139] Step 3: Use the preset general function interface to call the target operator corresponding to the second child node;

[0140] Step 4: Generate output value according to the target operator and each input value;

[0141] Step 5: Determine the output value as the input of the previous level operator of the target operator, and recursively schedule other operators to be scheduled except the target operator using the preset general function interface in the order of the target execution tree to execute each calculation step to calculate and process the input data of the current deep learning framework.

[0142] For the convenience of description, the above five steps can be combined for explanation.

[0143] When it is determined according to the traversal results that there is a child node whose child nodes are all external input nodes, the child node whose child nodes are all external input nodes is determined as the second child node, the input value of each external input node is obtained, the target operator corresponding to the second child node is called using the preset universal function interface, the output value is generated according to the target operator and each input value, and the output value is determined as the input of the upper-level operator of the target operator. Figure 3 As shown, each child node of the child node representing the summation operator is an external input node, and an output value is generated according to the summation operator and each input value, and its output value is used as the input of the child node representing the division operator. According to the order of the target execution tree, the preset universal function interface is used to recursively schedule other operators to be scheduled except the target operator, so as to execute each calculation step to calculate and process the input data of the current deep learning framework. By setting the child nodes whose child nodes are all external input nodes to directly calculate the output value, the traversal efficiency of each node in the execution tree is improved, and the operator scheduling efficiency is improved.

[0144] When executing a basic operator, the execution engine executes the current basic operator by calling the CallBackendOp (call backend operation) function:

[0145]

[0146] After the execution is completed, the intermediate result is used as the input of the previous level operator, and the recursive execution continues until the final result is obtained. After the basic operator is identified in the target execution tree, the automatic scheduling of each operator to be scheduled contained in the target execution tree is promoted by calling the backend operation function, further improving the operator scheduling efficiency.

[0147] In a specific implementation of the present invention, obtaining the input value of each external input node may include the following steps:

[0148] Obtain the input value of each external input node from the input container corresponding to the second child node;

[0149] Accordingly, after generating the output value according to the target operator and each input value, the method may further include the following steps:

[0150] The output value is stored in the output container corresponding to the second child node.

[0151] An input container for storing node input values ​​is pre-set for child nodes other than the root node in the execution tree, and an output container for storing node output values ​​is pre-set. When obtaining the input value of each external input node, the input value of each external input node is obtained from the input container corresponding to the second child node. After generating the output value according to the target operator and each input value, the output value is stored in the output container corresponding to the second child node. The execution engine automatically creates and manages the input and output containers of the intermediate operators, which improves the reusability of the code, reduces the workload of manual coding, and improves development efficiency.

[0152] The following is an example of an input container:

[0153]

[0154] Use the input container to store the input value of the current operator.

[0155] The following is an example output container:

[0156]

[0157] Use the output container to store the output value of the current operator.

[0158] In a specific implementation of the present invention, after storing the output value in the output container corresponding to the second child node, the method may further include the following steps:

[0159] Step 1: Delete each external input node corresponding to the second child node;

[0160] Step 2: Get the freed memory obtained by deleting each external input node;

[0161] Step 3: Record the released memory.

[0162] For the convenience of description, the above three steps can be combined for explanation.

[0163] After storing the output value in the output container corresponding to the second child node, delete each external input node corresponding to the second child node, obtain the released memory obtained by deleting each external input node, and record the released memory. By timely deleting the nodes corresponding to the operators that have been scheduled, the system memory is released in time, and the released memory is effectively recorded, which facilitates the subsequent use of the released memory and improves the memory usage efficiency.

[0164] In a specific implementation of the present invention, recursively scheduling other operators to be scheduled except the target operator using a preset universal function interface in the order of the target execution tree to execute each calculation step to calculate and process the input data of the current deep learning framework, which may include the following steps:

[0165] Recursively schedule the operators to be scheduled except the target operator using the preset universal function interface in the order of the target execution tree, so as to execute each calculation step according to the input value in the input container and the output value in the output container corresponding to each intermediate operator, and perform calculation processing on the input data of the current deep learning framework;

[0166] Among them, each intermediate operator is an operator to be scheduled other than the target operator and is used for intermediate process calculation.

[0167] After the target operator is scheduled, the preset universal function interface is used to recursively schedule other operators to be scheduled except the target operator in the order of the target execution tree, so as to perform various calculation steps according to the input values ​​in the input container and the output values ​​in the output container corresponding to each intermediate operator, and perform calculation processing on the input data of the current deep learning framework. The execution engine automatically creates and manages the input and output containers of the intermediate operators, and performs various calculation steps according to the input values ​​in the input container and the output values ​​in the output container corresponding to each intermediate operator, which improves the operator scheduling efficiency, code reusability and development efficiency.

[0168] The present invention does not limit the application scenarios involved in the current deep learning framework, which can be the recognition of image, text, audio and other data. For example, when the data to be recognized is image data, the current deep learning framework is an image recognition deep learning framework, which contains multiple operators, and there is a calculation logic between each operator. After finding each operator contained in the image recognition deep learning framework from the back-end operator library, the high-level language expression is used to combine each operator to be scheduled according to the calculation logic to obtain the target expression. The execution engine is used to parse the target expression to obtain the target execution tree, and the preset general function interface is used to schedule each operator to be scheduled in the order of the target execution tree, and then each calculation step is executed to recognize the input image data of the image recognition deep learning framework. By analogy, when the data to be recognized is text, audio and other data, it is changed accordingly.

[0169] Corresponding to the above method embodiment, the present invention further provides an operator scheduling device. The operator scheduling device described below and the operator scheduling method described above can refer to each other.

[0170] See also Figure 4 , Figure 4 This is a structural block diagram of an operator scheduling device in an embodiment of the present invention, and the device may include:

[0171] An operator and computing logic acquisition module 41 is used to acquire each operator to be scheduled and computing logic contained in the current deep learning framework;

[0172] An operator search module 42 is used to search for each operator to be scheduled from a backend operator library;

[0173] An expression acquisition module 43 is used to combine the operators to be scheduled according to the calculation logic using a high-level language expression to obtain a target expression;

[0174] The parsing result obtaining module 44 is used to parse the target expression using the execution engine to obtain the parsing result;

[0175] The operator scheduling module 45 is used to schedule each operator to be scheduled using a preset general function interface according to the analysis result, so as to perform calculation processing on the input data of the current deep learning framework.

[0176] It can be seen from the above technical solutions that by setting a unified universal function interface to schedule each operator to be scheduled, all operators follow a unified calling mode, which reduces the differences in calls between operators and simplifies the use and maintenance of operators. By combining each operator to be scheduled using high-level language expressions, duplicate code is greatly reduced, the reusability of the code is increased, the complexity of operator calls is simplified, the code is more concise, and the consumption of system hardware is reduced. The execution engine automatically parses the target expression, reducing the workload of manual coding, improving execution efficiency, improving the convenience of the development process and the overall performance of the framework, and improving the calling efficiency of the back-end operators of the deep learning framework.

[0177] In a specific embodiment of the present invention, the parsing result obtaining module is specifically a module that uses an execution engine to parse the target expression to obtain a target execution tree; wherein the target execution tree contains each calculation step involved in each operator to be scheduled and the dependency relationship between each calculation step;

[0178] The operator scheduling module is specifically a module that schedules each operator to be scheduled according to the order of the target execution tree using a preset general function interface to execute each calculation step to perform calculation processing on the input data of the current deep learning framework.

[0179] In a specific embodiment of the present invention, the analysis result obtaining module includes:

[0180] The lexical token sequence acquisition submodule is used to decompose the target expression using the lexical analyzer in the execution engine to obtain the lexical token sequence;

[0181] The execution tree construction submodule is used to use the syntax analyzer in the execution engine to construct a target execution tree according to the lexical token sequence.

[0182] In a specific implementation of the present invention, the operator scheduling module includes:

[0183] The traversal result obtaining submodule is used to traverse each node in the target execution tree with the root node of the target execution tree as the execution starting point to obtain the traversal result;

[0184] The first operator scheduling submodule is used to schedule each operator to be scheduled according to the traversal result and the order of the target execution tree using a preset universal function interface.

[0185] In a specific implementation of the present invention, the traversal result obtaining submodule is specifically a module that takes the root node of the target execution tree as the execution starting point and traverses each node in the target execution tree from left to right.

[0186] In a specific embodiment of the present invention, the device may further include:

[0187] A first child node determination module is used to, after traversing each node in the target execution tree from left to right, determine the child node representing the basic operator as the first child node when the child node representing the basic operator is traversed;

[0188] The node recursive traversal module is used to recursively traverse each child node of the first child node until reaching the leaf node of the target execution tree.

[0189] In a specific implementation of the present invention, the operator scheduling module includes:

[0190] A second child node determination submodule, for determining a child node whose child nodes are all external input nodes as a second child node when it is determined according to the traversal result that there is a child node whose child nodes are all external input nodes;

[0191] The input value acquisition submodule is used to obtain the input value of each external input node;

[0192] An operator calling submodule, used to call the target operator corresponding to the second subnode using a preset general function interface;

[0193] An output value generation submodule is used to generate output values ​​according to the target operator and each input value;

[0194] The first operator scheduling submodule is used to determine the output value as the input of the previous level operator of the target operator, and recursively schedule other operators to be scheduled except the target operator using a preset general function interface in the order of the target execution tree, so as to execute each calculation step to perform calculation processing on the input data of the current deep learning framework.

[0195] In a specific implementation of the present invention, the input value acquisition submodule is specifically a module for acquiring the input value of each external input node from the input container corresponding to the second child node;

[0196] The device may also include:

[0197] The output value storage module is used to store the output value in the output container corresponding to the second child node after generating the output value according to the target operator and each input value.

[0198] In a specific embodiment of the present invention, the device may further include:

[0199] A node deletion module, used for deleting each external input node corresponding to the second child node after storing the output value in the output container corresponding to the second child node;

[0200] A released memory acquisition module is used to acquire released memory obtained by deleting each external input node;

[0201] The released memory recording module is used to record the released memory.

[0202] In a specific embodiment of the present invention, the first operator scheduling submodule is specifically a module that recursively schedules other operators to be scheduled except the target operator using a preset general function interface in the order of the target execution tree, so as to execute each calculation step according to the input value in the input container and the output value in the output container respectively corresponding to each intermediate operator, and performs calculation processing on the input data of the current deep learning framework;

[0203] Among them, each intermediate operator is an operator to be scheduled other than the target operator and is used for intermediate process calculation.

[0204] In a specific embodiment of the present invention, the operator scheduling module is specifically a module that schedules each operator to be scheduled according to the parsing result using a preset general function interface constructed by an operator name function template; wherein the preset general function interface includes a structure composed of a union for storing various types of data and an enumeration type for identifying data types.

[0205] In a specific implementation of the present invention, the operator and calculation logic acquisition module is specifically a module for acquiring the operator name and calculation logic corresponding to each operator to be scheduled contained in the current deep learning framework;

[0206] The operator search module is specifically a module that searches for each operator to be scheduled from the backend operator library according to the operator name corresponding to each operator to be scheduled.

[0207] Corresponding to the above method embodiment, see Figure 5 , Figure 5 This is a schematic diagram of an operator scheduling device provided by the present invention, and the device may include:

[0208] A memory 332, for storing computer programs;

[0209] The processor 322 is used to implement the steps of the operator scheduling method of the above method embodiment when executing a computer program.

[0210] For details, please refer to Figure 6 , Figure 6 A specific structural diagram of an operator scheduling device provided for this embodiment, the operator scheduling device may have relatively large differences due to different configurations or performances, and may include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer programs 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the operator scheduling device 301.

[0211] The operator scheduling device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .

[0212] The steps in the operator scheduling method described above can be implemented by the structure of the operator scheduling device.

[0213] Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:

[0214] Obtain the operators to be scheduled and the calculation logic contained in the current deep learning framework; search for the operators to be scheduled from the backend operator library; use high-level language expressions to combine the operators to be scheduled according to the calculation logic to obtain the target expression; use the execution engine to parse the target expression to obtain the parsing result; according to the parsing result, use the preset general function interface to schedule the operators to be scheduled to perform calculations on the input data of the current deep learning framework.

[0215] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0216] For an introduction to the computer-readable storage medium provided by the present invention, please refer to the above method embodiment, and the present invention will not be elaborated here.

[0217] Corresponding to the above method embodiment, the present invention also provides a computer program product, including a computer program, which implements the steps of the above operator scheduling method when executed by a processor.

[0218] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the devices, equipment and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0219] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the technical solution and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. An operator scheduling method, characterized in that: include: Get the operators and calculation logic to be scheduled contained in the current deep learning framework; Search for operators to be scheduled from the backend operator library; Using a high-level language expression to combine the operators to be scheduled according to the calculation logic to obtain a target expression; Utilizing an execution engine to parse the target expression and obtain a parsing result; According to the analysis result, each operator to be scheduled is scheduled using a preset universal function interface to perform calculation processing on the input data of the current deep learning framework; The target expression is parsed by using the execution engine to obtain a parsing result, including: The target expression is parsed by using the execution engine to obtain a target execution tree; wherein the target execution tree contains the calculation steps involved in each operator to be scheduled and the dependency relationship between the calculation steps; Correspondingly, each operator to be scheduled is scheduled using a preset universal function interface according to the analysis result to perform calculation processing on the input data of the current deep learning framework, including: Scheduling each operator to be scheduled using the preset universal function interface in the order of the target execution tree to execute each calculation step to calculate and process the input data of the current deep learning framework; Among them, scheduling each operator to be scheduled using a preset universal function interface according to the order of the target execution tree includes: Taking the root node of the target execution tree as the execution starting point, traversing each node in the target execution tree, when traversing to a child node representing a basic operator, determining the child node representing the basic operator as the first child node; Recursively traverse each child node of the first child node until reaching a leaf node of the target execution tree, and obtain a traversal result; According to the traversal result and in the order of the target execution tree, each operator to be scheduled is scheduled using the preset universal function interface.

2. The operator scheduling method according to claim 1, characterized in that: The target expression is parsed by using the execution engine to obtain a target execution tree, including: Decomposing the target expression using a lexical analyzer in the execution engine to obtain a lexical token sequence; The target execution tree is constructed according to the lexical token sequence using a syntax analyzer in the execution engine.

3. The operator scheduling method according to claim 1, characterized in that: Taking the root node of the target execution tree as the execution starting point, traversing each node in the target execution tree includes: Taking the root node of the target execution tree as the execution starting point, traverse each node in the target execution tree from left to right.

4. The operator scheduling method according to claim 3, characterized in that: According to the traversal result, each operator to be scheduled is scheduled using the preset universal function interface in the order of the target execution tree to execute each calculation step to calculate and process the input data of the current deep learning framework, including: When it is determined according to the traversal result that there is a child node whose child nodes are all external input nodes, the child node whose child nodes are all external input nodes is determined as the second child node; Get the input value of each external input node; Using the preset universal function interface to call the target operator corresponding to the second sub-node; generating an output value according to the target operator and each input value; The output value is determined as the input of the upper-level operator of the target operator, and the other operators to be scheduled except the target operator are recursively scheduled using the preset universal function interface in the order of the target execution tree, so as to execute each calculation step to perform calculation processing on the input data of the current deep learning framework.

5. The operator scheduling method according to claim 4, characterized in that: Get the input value of each external input node, including: Obtaining input values ​​of each external input node from the input container corresponding to the second subnode; Accordingly, after generating the output value according to the target operator and each input value, it also includes: The output value is stored in an output container corresponding to the second child node.

6. The operator scheduling method according to claim 5, characterized in that: After storing the output value in the output container corresponding to the second child node, the method further includes: Deleting each external input node corresponding to the second sub-node; Get the freed memory obtained by deleting each external input node; The released memory is recorded.

7. The operator scheduling method according to claim 5, characterized in that: Recursively scheduling other operators to be scheduled except the target operator using the preset universal function interface in the order of the target execution tree to execute each calculation step to calculate and process the input data of the current deep learning framework, including: Recursively schedule the operators to be scheduled except the target operator using the preset universal function interface in the order of the target execution tree, so as to execute each calculation step according to the input value in the input container and the output value in the output container respectively corresponding to each intermediate operator, and perform calculation processing on the input data of the current deep learning framework; Among them, each intermediate operator is an operator to be scheduled that is used for intermediate process calculation among other operators to be scheduled except the target operator.

8. The operator scheduling method according to claim 1, characterized in that: According to the analysis result, each operator to be scheduled is scheduled using a preset universal function interface, including: According to the analysis result, each operator to be scheduled is scheduled using a preset universal function interface constructed by an operator name function template; wherein the preset universal function interface includes a structure composed of a union for storing various types of data and an enumeration type for identifying data types.

9. The operator scheduling method according to claim 1, characterized in that: Get the operators and calculation logic to be scheduled contained in the current deep learning framework, including: Get the operator name and calculation logic corresponding to each operator to be scheduled contained in the current deep learning framework; Accordingly, each operator to be scheduled is searched from the backend operator library, including: Search each operator to be scheduled from the backend operator library according to the operator name corresponding to each operator to be scheduled.

10. An operator scheduling device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the operator scheduling method as claimed in any one of claims 1 to 9 when executing the computer program.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the operator scheduling method according to any one of claims 1 to 9 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the operator scheduling method as described in any one of claims 1 to 9 are implemented.