Operator component heterogeneous resource quantity estimation method and system, and electronic device

By constructing an operator component library and a DAG heterogeneous resource scheduling system, the problems of large computational load and long time in heterogeneous resource scheduling of operator development framework are solved, realizing efficient and automated resource quantity estimation and scheduling, and improving the compatibility and flexibility of operator components.

CN117056070BActive Publication Date: 2025-10-24STATE GRID HEBEI ELECTRIC POWER CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311020353.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-14
Publication Date
2025-10-24
Estimated Expiration
2043-08-14

AI Technical Summary

Technical Problem

Existing operator development frameworks cannot run developed operator components on general-purpose GPUs, resulting in poor compatibility and flexibility, high learning costs, and an inability to automatically build commonly used operator components. Furthermore, when calculating heterogeneous resource quantities in large-scale workflows, the computational load is large and the time is long, affecting the efficiency of heterogeneous resource scheduling.

Method used

By building an operator component library, the amount of heterogeneous resources is estimated and updated to the actual amount of resources. The DAG heterogeneous resource scheduling subsystem is used for resource scheduling. Combined with a visual interactive interface and an operator relation database, high-frequency sequence operator components are automatically built to optimize resource allocation.

Benefits of technology

It improves the compatibility and flexibility of operator components, reduces learning costs, reduces resource calculation time, and improves the efficiency and accuracy of heterogeneous resource scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117056070B_ABST
    Figure CN117056070B_ABST
Patent Text Reader

Abstract

The application provides an operator component heterogeneous resource quantity estimation method and system and an electronic device. The application belongs to the technical field of computers. The method comprises the following steps: selecting at least one operator component from an operator component library to arrange a workflow; the operator component library comprises a plurality of operator components and the required estimated heterogeneous resource quantity of the operator components; and scheduling the heterogeneous resources of each operator component in the workflow based on the estimated heterogeneous resource quantity corresponding to each operator component in the workflow. The application can directly obtain the commonly used operator components and the required estimated heterogeneous resource quantity of the operator components from the operator component library, can avoid repeated calculation of the heterogeneous resource quantity, effectively reduces the calculation amount, shortens the calculation time, and improves the efficiency of subsequent heterogeneous resource scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to an operator component heterogeneous resource quantity estimation method and system and electronic equipment. BACKGROUND

[0002] In the field, Op (Operator, deep learning operator) is a basic operation unit in a deep learning framework. A complete deep learning model is usually composed of multiple operators, and there are common operators among different deep learning algorithms. Therefore, in order to improve the reusability and expansibility of operators in deep learning, an operator development framework is designed. The operator development framework is used to develop and use operators. The operator development framework can build common operators in deep learning algorithms, and call operators to build common operator components in the operator arrangement stage, saving the time of repeated development of operator components and improving the development efficiency of deep learning models.

[0003] The current operator development framework, such as Huawei TBE (Tensor Boost Engine) operator development framework, can only develop TBE operator components for Ascend NPU (Neural-network Processing Unit), and cannot run the developed operator components on general-purpose GPU. The high-reusable operator library PHI (Paddle High reusability operator Library) developed by Baidu Paddle has the advantages of high flexibility and good reusability, but the operator components developed by it belong to the API function level, and the learning threshold is high, which is more suitable for professional developers to use. In addition, before heterogeneous resource scheduling in the field, the operator components required by the operator components are usually estimated after the operator components required by the workflow are determined. However, the algorithm development framework usually cannot calculate the heterogeneous resources required by the operator components in the process of building the operator components, so as to calculate the heterogeneous resources required by the operator components for heterogeneous resource scheduling, and cannot automatically build common operator components, which is not intelligent enough and has low running efficiency.

[0004] As above, the current development framework mainly includes the following shortcomings:

[0005] 1) The developed operator components can only be applied to specific computing architectures, have poor compatibility and flexibility, have high learning cost, and are not suitable for non-professional personnel to use.

[0006] 2) Cannot calculate the heterogeneous resource quantity required by the operator components for heterogeneous resource scheduling.

[0007] 3) The operator development framework is not intelligent enough, and cannot automatically build common operator components.

[0008] In addition, with the wide application of heterogeneous computing, scheduling of heterogeneous resources has become a research focus in the field of computer technology. Before scheduling of heterogeneous resources in the field, the amount of heterogeneous resources required by operator components is usually estimated after the operator components required by a workflow are determined. However, when the above method is applied to a workflow with a large number of operator components, there is a problem of large amount of calculation and long calculation time, which affects the scheduling efficiency of heterogeneous resources. SUMMARY

[0009] Embodiments of the present application provide an operator component heterogeneous resource amount estimation method and system and electronic equipment to solve the problem of large amount of calculation and long calculation time in estimating the amount of heterogeneous resources required by operator components after the operator components required by a workflow are determined, which affects the scheduling efficiency of heterogeneous resources.

[0010] In a first aspect, embodiments of the present application provide an operator component heterogeneous resource amount estimation method, comprising:

[0011] selecting at least one operator component from an operator component library to arrange into a workflow; wherein the operator component library includes a plurality of operator components and the estimated amount of heterogeneous resources required by the operator components;

[0012] scheduling the operator components in the workflow based on the estimated amount of heterogeneous resources corresponding to each operator component in the workflow.

[0013] In a possible implementation, after scheduling the operator components in the workflow, the method further comprises:

[0014] calculating the actual amount of heterogeneous resources of each operator component in the workflow when the hardware platform is executed;

[0015] updating the corresponding estimated amount of heterogeneous resources of each operator component in the workflow included in the operator component library to the corresponding actual amount of heterogeneous resources.

[0016] In a possible implementation, the calculation of the actual amount of heterogeneous resources of each operator component in the workflow when the hardware platform is executed comprises:

[0017] establishing a directed acyclic graph according to the workflow; each node in the directed acyclic graph corresponds to each operator component in the workflow;

[0018] calculating the actual amount of heterogeneous resources of each node in the directed acyclic graph according to a preset condition, wherein the preset condition is used to make the time difference of completion of different paths with the same function in the directed acyclic graph less than a preset value;

[0019] The actual heterogeneous resource quantity of each node in the directed acyclic graph is taken as the actual heterogeneous resource quantity of each operator component in the hardware platform when the operator component is executed.

[0020] In a possible implementation, the actual heterogeneous resource quantity of each node in the directed acyclic graph is calculated according to the preset condition, including:

[0021] In the directed acyclic graph, all paths are obtained by traversing from the start node to the end node.

[0022] If there is a node with an out-degree greater than 1 in the path, the node with the out-degree greater than 1 is updated as the start node, and all paths between the updated start node and the corresponding end node are determined as different paths with the same function in the directed acyclic graph.

[0023] According to the preset condition, the heterogeneous resource quantity is allocated to each node in the different paths with the same function in the directed acyclic graph.

[0024] The heterogeneous resource quantity allocated to each node in the different paths with the same function in the directed acyclic graph according to the preset condition is taken as the actual heterogeneous resource quantity.

[0025] If there is another node in the directed acyclic graph, the estimated heterogeneous resource quantity required by the node is taken as the actual heterogeneous resource quantity; the other node is a node other than each node in the different paths with the same function in the directed acyclic graph.

[0026] In a possible implementation, the method for constructing the operator component library includes:

[0027] At least one operator component to be processed is obtained.

[0028] The estimated heterogeneous resource quantity required by each operator component in the at least one operator component is calculated.

[0029] Each operator component in the at least one operator component and the corresponding estimated heterogeneous resource quantity are stored in the operator component library.

[0030] In a possible implementation, the method further includes:

[0031] An operator relationship database is established; the operator relationship database stores the predecessor and successor relationship between operators in a sequence form; wherein, the sequence in the operator relationship database is a linear sequence and / or a different sequence with the same function; the start node and the end node of the different sequence with the same function are the same.

[0032] obtain high-frequency sequences in the operator relationship database; the high-frequency sequences are sequences in the operator relationship database sorted in descending order of occurrence frequency, and a preset number of sequences ranked at the top are selected;

[0033] construct the high-frequency sequences into operator components, and store the operator components in the operator component library.

[0034] In a possible implementation, the calculating of the estimated amount of heterogeneous resources required by each operator component in the at least one operator component includes:

[0035] obtaining assembly instructions obtained after compilation of each operator component in the at least one operator component;

[0036] For each operator component, the following steps are performed:

[0037] determining the type of each assembly instruction of the operator component;

[0038] based on the type of each assembly instruction of the operator component, determining the basic operand required by each assembly instruction of the operator component;

[0039] calculating the estimated amount of heterogeneous resources required by the operator component according to the basic operand required by each assembly instruction of the operator component.

[0040] In a possible implementation, the selecting of at least one operator component from the operator component library to compile into a workflow includes:

[0041] displaying a visual interactive interface; the visual interactive interface includes an operator component display area and an operator component compilation area; the operator component display area is configured to display operator components in the operator component library, and the operator component compilation area is configured to generate a workflow;

[0042] when a drag operation is detected, displaying one operator component indicated by the drag operation in the operator component compilation area;

[0043] when a connection operation is detected, displaying a connection line pointing to the end point, starting from the start position of the connection operation and ending at the end position of the connection operation.

[0044] In a second aspect, an operator component heterogeneous resource amount estimation system is provided, and the system includes a DAG heterogeneous resource scheduling subsystem, an operator component library management module, an operator component construction subsystem, a component construction subsystem, an estimated heterogeneous resource amount calculation subsystem, and a compilation module.

[0045] The orchestration module is configured to select at least one operator component from an operator component library to orchestrate into a workflow; wherein the operator component library comprises a plurality of operator components and required estimated heterogeneous resource amounts of the operator components;

[0046] The DAG heterogeneous resource scheduling subsystem is configured to perform heterogeneous resource scheduling on each operator component in the workflow based on the estimated heterogeneous resource amount corresponding to each operator component in the workflow.

[0047] In a third aspect, an electronic device is provided, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, the steps of the method according to the first aspect or any possible implementation manner of the first aspect are implemented.

[0048] The operator component heterogeneous resource amount estimation method and system and the electronic device provided by the embodiments of the present application have the following beneficial effects:

[0049] In the embodiments of the present application, the operator component library comprises a plurality of operator components and required estimated heterogeneous resource amounts of the operator components. Therefore, the selected operator components from the operator component library can directly obtain the corresponding estimated heterogeneous resource amounts, which avoids the calculation of the heterogeneous resource amount each time the operator component is applied, especially in the case where the number of operator components in the workflow is large. The scheme of the present application can effectively reduce the calculation amount, shorten the calculation time, and improve the efficiency of subsequent heterogeneous resource scheduling. BRIEF DESCRIPTION OF DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0051] Figure 1 is a flowchart of the operator component heterogeneous resource amount estimation method provided by the embodiments of the present application;

[0052] Figure 2 is a schematic diagram of the architecture of the operator component heterogeneous resource amount estimation system provided by the embodiments of the present application;

[0053] Figure 3 is a schematic diagram of the structure of the directed acyclic graph provided by the embodiments of the present application;

[0054] Figure 4 is a flowchart of the componentized construction subsystem provided by the embodiments of the present application;

[0055] Figure 5is a flowchart of an operator component test process provided by an embodiment of the present application.

[0056] Figure 6 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0057] In the following description, specific details such as specific system structures, techniques, etc. are presented in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one skilled in the art that the present application can be implemented without these specific details. In other instances, well-known systems, devices, circuits, and methods have not been described in detail in order to avoid obscuring the description of the present application.

[0058] The present application provides an operator component heterogeneous resource quantity estimation method, system and electronic device to solve the above problems.

[0059] In order to make the purpose, technical scheme and advantages of the present application clearer, specific embodiments will be described below with reference to the accompanying drawings.

[0060] Figure 1 is a flowchart of an operator component heterogeneous resource quantity estimation method provided by an embodiment of the present application.

[0061] As shown in Figure 1 , the method comprises:

[0062] S101: Select at least one operator component from an operator component library to arrange into a workflow.

[0063] In the present embodiment, the operator component library includes a plurality of operator components and the estimated heterogeneous resource quantities required by the operator components.

[0064] In the present embodiment, the operator component library can be constructed in advance. The construction of the operator component library involves the construction of operator components and the calculation of the estimated heterogeneous resource quantities required by the operator components. One operator component includes at least one operator.

[0065] S102: Based on the estimated heterogeneous resource quantities corresponding to each operator component in the workflow, schedule the heterogeneous resources for each operator component in the workflow.

[0066] In the present embodiment of the present application, the operator component library includes a plurality of operator components and the estimated heterogeneous resource quantities required by the operator components. Therefore, the selected operator components from the operator component library can directly obtain their corresponding estimated heterogeneous resource quantities, avoiding the calculation of the heterogeneous resource quantities each time the operator components are applied. Especially in the case where the number of operator components in the workflow is large, the present application can effectively reduce the calculation amount, shorten the calculation time, and improve the efficiency of subsequent heterogeneous resource scheduling.

[0067] In a possible implementation, after the heterogeneous resource scheduling of each operator component in the workflow, further comprising:

[0068] calculating the actual heterogeneous resource amount of each operator component in the computing workflow when executed on the hardware platform.

[0069] updating the corresponding estimated heterogeneous resource amount of each operator component in the computing workflow included in the operator component library to the corresponding actual heterogeneous resource amount.

[0070] In the embodiment, the operator component library can further include a hardware platform, and the operator component, the estimated heterogeneous resource amount, and the hardware platform in the operator component library can be in a one-to-one correspondence. Considering that the heterogeneous resource amount of the same operator component can be different when executed on different hardware platforms, the actual heterogeneous resource amount of each operator component in the computing workflow when executed on the corresponding hardware platform needs to be calculated, and the estimated heterogeneous resource amount corresponding to the hardware platform in the operator component library can be updated to the corresponding actual heterogeneous resource amount. It should be noted that updating the estimated heterogeneous resource amount to the corresponding actual heterogeneous resource amount in the present application refers to updating the value of the estimated heterogeneous resource amount to the value of the corresponding actual heterogeneous resource amount. In actual application, the estimated heterogeneous resource amount in the operator component library will be updated continuously, and the estimated heterogeneous resource amount required by the operator component will also be continuously close to the true value, improving the accuracy of the estimation of the heterogeneous resource amount of the operator component, and being beneficial to subsequent more reasonable heterogeneous resource scheduling and providing more accurate scheduling services.

[0071] The overall design framework of the scheme of the present application can refer to the operator component heterogeneous resource amount estimation system architecture diagram provided by the embodiment of the present application as shown in Figure 2 As shown in Figure 2 The overall design framework of the scheme of the present application includes a DAG heterogeneous resource scheduling subsystem, an operator component library management module, an operator component construction subsystem, a componentized construction subsystem, an estimated heterogeneous resource amount calculation subsystem, and an arrangement module.

[0072] Referring to the DAG heterogeneous resource scheduling subsystem in the operator component heterogeneous resource amount estimation system architecture diagram as shown in Figure 2 The module is used for analyzing the computing workflow, calculating the priority of each operator component in the computing workflow when executed on the hardware platform according to the HEFT algorithm, and scheduling each operator component in the computing workflow according to the priority. The module implements the specific scheme of calculating the actual heterogeneous resource amount of each operator component in the computing workflow when executed on the hardware platform, as follows:

[0073] In a possible implementation, the actual heterogeneous resource amount of each operator component in the computing workflow when executed on the hardware platform includes:

[0074] A directed acyclic graph is established according to the workflow. Each node in the directed acyclic graph corresponds to each operator component in the workflow.

[0075] Actual heterogeneous resource amounts of each node in the directed acyclic graph are calculated according to preset conditions. The preset conditions are used to make the time difference of completion of different paths with the same function in the directed acyclic graph less than a preset value.

[0076] The actual heterogeneous resource amounts of each node in the directed acyclic graph are taken as actual heterogeneous resource amounts of each operator component in the workflow when the operator component is executed on a hardware platform.

[0077] The specific scheme for calculating the actual heterogeneous resource amounts of each node in the directed acyclic graph according to the preset conditions is as follows:

[0078] In a possible implementation, the actual heterogeneous resource amounts of each node in the directed acyclic graph are calculated according to the preset conditions, including:

[0079] In the directed acyclic graph, all paths are obtained by traversing from a start node to an end node.

[0080] If there is a node with an out-degree greater than 1 in the path, the node with the out-degree greater than 1 is updated as the start node, and all paths between the updated start node and the corresponding end node are determined as different paths with the same function in the directed acyclic graph.

[0081] Heterogeneous resource amounts are allocated to each node in the different paths with the same function in the directed acyclic graph according to the preset conditions.

[0082] The heterogeneous resource amounts allocated to each node in the different paths with the same function in the directed acyclic graph according to the preset conditions are taken as actual heterogeneous resource amounts.

[0083] If there are other nodes in the directed acyclic graph, the estimated heterogeneous resource amounts required by the other nodes are taken as actual heterogeneous resource amounts. The other nodes are nodes other than the nodes in the different paths with the same function in the directed acyclic graph.

[0084] In this embodiment, if there is a node with an out-degree greater than 1 in the directed acyclic graph, the heterogeneous resource amounts allocated to each node in the different paths with the same function in the directed acyclic graph according to the preset conditions can be taken as actual heterogeneous resource amounts.

[0085] In this embodiment, if there is no node with an out-degree greater than 1 in the directed acyclic graph, it can be considered that the estimated heterogeneous resource amounts of each operator component in the workflow are actual heterogeneous resource amounts of each operator component in the workflow when the operator component is executed on a hardware platform.

[0086] When executing the step of updating the estimated heterogeneous resource quantities corresponding to each operator component in the workflow included in the operator component library to the corresponding actual heterogeneous resource quantities, only the estimated heterogeneous resource quantities of each node in different paths with the same function in the directed acyclic graph can be updated, and the estimated heterogeneous resource quantities corresponding to other nodes will not be updated.

[0087] In this embodiment, the DAG heterogeneous resource scheduling subsystem module receives the workflow generated by the orchestration module and needs to parse the workflow, that is, parse the directed acyclic graph established according to the workflow, obtain all paths in the directed acyclic graph, and determine different paths with the same function in the directed acyclic graph. In this embodiment, the node with an out-degree greater than 1 in the path can be updated to the start node. If there is more than one path between the start node and the corresponding end node, all paths between the start node and the corresponding end node are defined as an interval. In other words, the interval includes different paths with the same function in the directed acyclic graph.

[0088] by Figure 3 Take the directed acyclic graph shown as an example for analysis. Figure 3 Each node in the directed acyclic graph shown corresponds to each operator component in the workflow. Taking node A and node E as an example, node A corresponds to operator component A, and node E corresponds to operator component E. The specific steps of this embodiment are as follows:

[0089] exist Figure 3 In the directed acyclic graph shown, traverse from the starting node A to the ending node E to obtain all paths. If there are no other nodes and there are nodes A and B1 with out-degree greater than 1 in the path, then update the nodes A and B1 with out-degree greater than 1 to the starting nodes. In the directed acyclic graph, there is more than one path from the starting node A to the ending node E, and any path starting from the starting node A can reach the ending node E. Then all paths between the starting node A and the corresponding ending node E are defined as an interval. And Figure 3 In the directed acyclic graph shown, in addition to the start node A, there is also a node B1 with an out-degree greater than 1. Then node B1 is updated to the start node. The end node corresponding to the start node B1 is D. Then all paths between the start node B1 and the corresponding end node E are defined as an interval.

[0090] That is to say, Figure 3The shown directed acyclic graph includes two intervals, one is an interval I1 composed of all paths between node A and node E, I1 = {A→B1→C1→D→E, A→B1→C2→D→E, A→B2→E}. The other is an interval I2 composed of all paths between node B1 and node D, I2 = {B1→C1→D, B1→C2→D}. Since the interval has a containing relationship, interval I1 contains interval I2, interval I1 can be rewritten as I1 = {A→I2→E, A→B2→E}.

[0091] In the embodiment, when calculating the actual heterogeneous resource amount of each node in the directed acyclic graph, a preset condition (the time difference of different paths with the same function in the directed acyclic graph is less than a preset value) needs to be met. The method can make the different paths with the same function in the same interval complete as close as possible in time, avoid the phenomenon of waiting for the slowest path to complete of the first completed path, and save the calculation time. For example, for interval I1, the time difference of the two paths needs to be less than a preset value, and the actual heterogeneous resource amount needs to be allocated according to the heterogeneous resource required by interval I2 and node B2. In order to make the time difference of each path in interval I2 less than a preset value, the actual heterogeneous resource amount needs to be allocated according to the heterogeneous resource required by node C1 and node C2. In the embodiment, the allocation of the actual heterogeneous resource is realized in a recursive manner. Figure 3

[0092] The scheme in the embodiment is applied to the execution process of each operator component in the workflow on the hardware platform. Based on the scheme in the embodiment, the completion time and the actual heterogeneous resource amount of each operator component can be further accurately calculated in the execution process of each operator component in the workflow on the hardware platform. Since the operator component can be actually executed on different hardware platforms or heterogeneous hardware, the completion time and the actual heterogeneous resource amount of the operator component on different hardware platforms can be further obtained according to the scheme in the embodiment. The estimated heterogeneous resource amount of the operator component in the operator component library can be updated to the actual heterogeneous resource amount, so that when the operator component is used for the next arrangement, more accurate resource allocation and task scheduling can be performed according to the actual heterogeneous resource amount of the operator component in the operator component library. In this process, the estimated heterogeneous resource amount in the operator component library is constantly updated, and therefore the estimated heterogeneous resource amount required by the operator component also constantly approaches the true value.

[0093] In a possible implementation, a method for constructing an operator component library includes:

[0094] At least one operator component to be processed is obtained.

[0095] The estimated heterogeneous resource amount required by each operator component in the at least one operator component is calculated. ​

[0096] The at least one operator component and the corresponding estimated heterogeneous resource amount of each operator component are stored in association in an operator component library.

[0097] In this embodiment, building the operator component library requires obtaining the operator component and calculating the estimated heterogeneous resource amount required by the operator component.

[0098] Reference Figure 2 The operator component library management module in the operator component heterogeneous resource amount estimation system architecture schematic diagram shown in the figure is mainly responsible for providing addition, deletion, modification and query operations on the built operator components. In addition, this module also provides the function of creating a new operator component based on an existing operator component as a template, thereby facilitating the addition of operator components that need to be adjusted in fine granularity.

[0099] Reference Figure 2 The operator component construction subsystem in the operator component heterogeneous resource amount estimation system architecture schematic diagram shown in the figure is used to establish an operator relationship database. The high-frequency sequence is obtained from the operator relationship database based on the frequent sequence mining method of PrefixSpan (Prefix-Projected Pattern Growth, prefix projected pattern growth). The high-frequency sequence is constructed into an operator component. The specific scheme of the module for building the operator component is as follows:

[0100] In a possible implementation, the specific construction method of the operator component is as follows:

[0101] An operator relationship database is established. The predecessor and successor relationship between operators and operators in the operator relationship database is stored in the form of a sequence. Among them, the sequence in the operator relationship database is a linear sequence and / or different sequences with the same function. The start node and end node of the different sequences with the same function are the same.

[0102] High-frequency sequences in the operator relationship database are obtained. The high-frequency sequence is to sort the sequences in the operator relationship database in descending order of occurrence frequency, and select a preset number of sequences ranked at the top.

[0103] The high-frequency sequence is constructed into an operator component, and the operator component is stored in the operator component library.

[0104] In this embodiment, an operator relationship database needs to be established. The construction method of the operator relationship database is that the operator component construction subsystem parses the predecessor and successor relationship between operators and operators from all workflows defined by directed acyclic graphs, and stores the predecessor and successor relationship between operators and operators in the form of a sequence. Subsequently, the PrefixSpan algorithm is used to mine high-frequency sequences, and finally the high-frequency sequences are handed over to the componentized construction subsystem for automatic construction. Unified construction of these operators can further save operator development and use time.

[0105] In the embodiment, the high-frequency sequence can be a series of linear operator sequences. If there is more than one sequence between a start node and an end node in the sequence, the high-frequency sequence can include all the sequences between the start node and the end node. Sequences with multiple start nodes or multiple end nodes cannot be constructed as operator components.

[0106] In the embodiment, the high-frequency sequence is constructed as an operator component, so that the component can be directly called in subsequent operator component arrangement, saving the time for operator component development and arrangement.

[0107] In the embodiment, the component construction subsystem in the operator component heterogeneous resource quantity estimation system architecture schematic diagram shown in Figure 2 The module constructs an operator component by obtaining the operator file, operator script file, input and output, and component parameters uploaded by the user, and tests the operator component. If the test is passed, the operator component is transferred to the operator component library management module. The main process of the component construction subsystem is shown in Figure 4 .

[0108] The component construction subsystem includes an operator file upload module, an operator script upload module, a path configuration module, an operator component parameter configuration module, and an operator component test module.

[0109] The operator file upload module is used to upload the operator file. The operator file is used to implement the operator function, and is usually a Python file. The operator file is the specific implementation of the operator component function, and the function of the operator component can be completed by running the file. The system should also include common operator files in the field of deep learning.

[0110] The operator script upload module is used to upload the operator script file. The operator script file is used to determine the entry of the operator file running. The operator script file is the entry of the operator file running, and the file can be a binary file that can be directly executed by the system, or a Shell script, etc.

[0111] The path configuration module is used to configure the input path and output path of data. The module is responsible for configuring the data stream and data file required by the operator file, and storing the operator running result in the configured output location. The input and output can be a specific path file, or a storage service address conforming to Amazon S3.

[0112] The operator component parameter configuration module is used to configure the parameters of the operator script file running. Using this way can facilitate the modification of the parameters of the operator script file running, thereby increasing the flexibility of the operator component.

[0113] After the parameter setting of the operator component is completed, the operator component is submitted to the estimated heterogeneous resource computing subsystem to calculate the estimated heterogeneous resource amount required by the operator component.

[0114] The operator component test module is used to test whether the function of the new operator component is complete. The module is responsible for testing the built operator component. If the test is passed, the operator component is submitted to the operator component library management module, and the operator component and the required estimated heterogeneous resource amount can be stored in the operator component library. If the test fails, the user is reminded of the operator component test error, and the related error information is reported. The test flow is as shown in Figure 5

[0115] Referring to Figure 2 The estimated heterogeneous resource amount calculation subsystem in the operator component heterogeneous resource amount estimation system architecture schematic diagram is as follows:

[0116] In a possible implementation, the estimated heterogeneous resource amount required by each operator component in the at least one operator component is calculated, including:

[0117] The assembly instructions obtained after the compilation of each operator component in the at least one operator component are acquired.

[0118] For each operator component, the following steps are performed:

[0119] The type of each assembly instruction of the operator component is determined.

[0120] Based on the type of each assembly instruction of the operator component, the basic operation number required by each assembly instruction of the operator component is determined.

[0121] The estimated heterogeneous resource amount required by the operator component is calculated according to the basic operation number required by each assembly instruction of the operator component.

[0122] In this embodiment, the estimated heterogeneous resource amount required by each operator component includes CPU computing amount, GPU computing amount, NPU computing amount, FPGA computing amount, memory usage amount, and external storage usage amount. (The computing amount and the usage amount correspond to the resource amount.) The estimated heterogeneous resource amount calculation subsystem acquires the assembly instructions obtained after the compilation of the operator component on the corresponding hardware platform, determines the basic operation number required by each assembly instruction of the operator component according to the type of each assembly instruction, such as addition, subtraction, multiplication, division, shift, and loop, adds the basic operation numbers of all assembly instructions of the operator component, and obtains the estimated heterogeneous resource amount required by the operator component.

[0123] ​For example, an operator component after compilation obtains 3 assembly instructions, the types of the 3 assembly instructions are addition, subtraction and loop in turn, the basic operand required by the assembly instruction of type addition is 2, the basic operand required by the assembly instruction of type subtraction is 3, the loop is performed 2 times, and the addition is calculated once and the subtraction is calculated twice each time, then the estimated heterogeneous resource quantity required by the operator component is: 2+3+(1+2)×2=11.

[0124] Reference Figure 2 The arrangement module in the operator component heterogeneous resource quantity estimation system architecture diagram is shown in the figure, and the specific scheme of arranging at least one operator component into a workflow from the operator component library is as follows:

[0125] In a possible implementation, arranging at least one operator component into a workflow from the operator component library comprises:

[0126] A visual interactive interface is displayed. The visual interactive interface includes an operator component display area and an operator component arrangement area. The operator component display area is used to display operator components in the operator component library, and the operator component arrangement area is used to generate a workflow.

[0127] When a drag operation is detected, display one operator component indicated by the drag operation in the operator component arrangement area;

[0128] When a connection operation is detected, display a connection line pointing to the end point from the start point of the connection operation to the end point.

[0129] In this embodiment, operator component arrangement is a process of arranging operator components into a workflow through production line logic. This module can select operator components built from the operator component library, and arrange the operator components into a custom workflow through a visual interface and an interactive way. The workflow arranged by the operator components needs to meet the condition of a directed acyclic graph, a workflow can have one or more start nodes and one or more end nodes, and each node can start running only after all its predecessor nodes have completed running. An example of the structure of a workflow is shown in the figure. Figure 3 The workflow formed by the arrangement module is checked and delivered to the DAG heterogeneous resource scheduling subsystem for execution and scheduling.

[0130] The operator combination data (the predecessor and successor relationship between operator components and the predecessor and successor relationship between operators inside an operator component) can be stored in a sequence form into an operator relationship database for the operator component construction subsystem to construct commonly used operator components.

[0131] In view of the problems of current deep learning operators, such as great development difficulty, poor compatibility, insufficient flexibility and expandability, etc., the application proposes an operator component construction method and a componentized construction method, which constructs deep learning operators into operator components through a componentized construction subsystem for unified management and use in the arrangement module, and can use various heterogeneous hardware resources for calculation, thereby improving the compatibility, flexibility and reusability of the operator components.

[0132] In view of the problem that current heterogeneous resource scheduling algorithms need to obtain the required heterogeneous resource amount of the operator component in advance, the application proposes a calculation and updating method of the estimated heterogeneous resource amount required by the operator component, which estimates the CPU, GPU, NPU, FPGA, memory and external storage and other heterogeneous resource amounts required by the operator component in advance, and updates the estimated heterogeneous resource amount in the operator component library during the operation of the operator component, thereby providing data support for the directed acyclic graph (DAG) task scheduling algorithm based on heterogeneous resources, and saving the workflow running time.

[0133] During the construction of the operator component, the estimated heterogeneous resource amount required is calculated by calculating the basic operands of the assembly instructions after the operator component is compiled, and is recorded as a component parameter in the operator component library, which facilitates subsequent heterogeneous resource scheduling, and the data is also updated during the operation of the operator, so that the heterogeneous resource scheduling of the next workflow is more accurate.

[0134] In view of the repeated arrangement and calling of some commonly used operator combinations, which will consume redundant calling and arrangement time, the application proposes an operator component construction method, which uses the PrefixSpan algorithm to analyze the high-frequency sequence appearing in the operator arrangement according to the historical data, and automatically constructs the high-frequency sequence into an operator component, thereby further saving the operator calling and arrangement time.

[0135] The design idea of the application scheme is: first, an operator component is designed through the research on the characteristics and commonality of deep learning operators, and a componentized construction service is provided for users, who can develop and manage operator components through the service, and the estimated heterogeneous resource amount required by the operator component is automatically calculated after the construction is completed. Each operator component in at least one operator component and the corresponding estimated heterogeneous resource amount are associated and stored in an operator component library. Users can call the operator components in the operator component library in the arrangement module, and arrange the operator components into a workflow, and after the arrangement is completed, the workflow is submitted to a heterogeneous resource scheduling system for task scheduling, and the operator combination data is also saved in an operator relationship database, and an operator component construction subsystem can obtain the operator and the predecessor and successor relationship between operators from the database, thereby automatically analyzing and constructing commonly used operator components. The scheme of the application greatly reduces the cost of learning and developing operators for users, improves the utilization rate and expandability of the operators, and also saves the overall running time of the workflow.

[0136] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0137] Figure 6 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 6 As shown, the electronic device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the processor 61 executes the computer program 63, the steps in the above-mentioned embodiment of the method for estimating heterogeneous resource quantities of each operator component are implemented, for example Figure 1 S101 and S102 shown.

[0138] For example, the computer program 63 may be divided into one or more modules, one or more of which are stored in the memory 62 and executed by the processor 61 to implement the present application. The one or more modules may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 63 in the electronic device 60.

[0139] The electronic device 60 may be a computing device such as a desktop computer, a notebook computer, a PDA, or a cloud server. The electronic device 60 may include, but is not limited to, a processor 61 and a memory 62. It will be understood by those skilled in the art that Figure 6 This is merely an example of the electronic device 60 and does not constitute a limitation of the electronic device 60 . The electronic device 60 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0140] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0141] The memory 62 can be an internal storage unit of the electronic device 60, for example, a hard disk or a memory of the electronic device 60. The memory 62 can also be an external storage device of the electronic device 60, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, or the like equipped on the electronic device 60. Further, the memory 62 can include both an internal storage unit and an external storage device of the electronic device 60. The memory 62 is used to store a computer program and other programs and data required by the electronic device. The memory 62 can also be used to temporarily store data that has been output or will be output.

[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0143] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0144] Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0145] In the embodiments of the present application, it should be understood that the disclosed apparatus / equipment and method can be implemented in other manners. For example, the embodiments of the apparatus / equipment described above are merely schematic. For example, the division of the modules or units is merely logical function division. There can be another division manner for the actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0146] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.

[0147] In addition, each functional unit in the embodiments of the present application can be integrated in a processing unit, or each unit can exist physically as a separate unit, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional unit.

[0148] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such an understanding, all or part of the flow of the method in the above embodiments can also be implemented by a computer program instructing related hardware to complete, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of the above various operator component heterogeneous resource quantity estimation method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0149] The above examples are only used to illustrate the technical solutions of the present application, but not to limit it. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent ones. The modification or replacement does not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. An operator component heterogeneous resource quantity estimation method, characterized by, The method comprises the following steps: selecting at least one operator component from an operator component library to compile a workflow; wherein the operator component library comprises a plurality of operator components and their required estimated heterogeneous resource amounts; calculating the priority of each operator component in the workflow when executed on a hardware platform according to the HEFT algorithm based on the estimated heterogeneous resource amounts corresponding to each operator component in the workflow, and scheduling the heterogeneous resources for each operator component in the workflow according to the priority; wherein after scheduling the heterogeneous resources for each operator component in the workflow, the method further comprises the following steps: calculating the actual heterogeneous resource amount of each operator component in the workflow when executed on a hardware platform; updating the corresponding estimated heterogeneous resource amount of each operator component in the workflow included in the operator component library to the corresponding actual heterogeneous resource amount; The operator component heterogeneous resource amount estimation method further comprises the following steps: establishing an operator relationship database; the operator relationship database stores the predecessor and successor relationships between operators in a sequence; wherein the sequence in the operator relationship database is a linear sequence and / or a different sequence with the same function; the start node and the end node of the different sequence with the same function are the same; obtaining a high-frequency sequence from the operator relationship database; the high-frequency sequence is a sequence selected from the top of a ranking according to the order of the frequency of appearance from high to low of the sequences in the operator relationship database; constructing the high-frequency sequence into an operator component, which is stored in the operator component library; wherein the calculation of the actual heterogeneous resource amount of each operator component in the workflow when executed on a hardware platform comprises the following steps: establishing a directed acyclic graph according to the workflow; each node in the directed acyclic graph corresponds to each operator component in the workflow; calculating the actual heterogeneous resource amount of each node in the directed acyclic graph according to a preset condition, wherein the preset condition is used to make the completion time difference of different paths with the same function in the directed acyclic graph less than a preset value; taking the actual heterogeneous resource amount of each node in the directed acyclic graph as the actual heterogeneous resource amount of each operator component in the workflow when executed on a hardware platform.

2. The method of claim 1, wherein, The calculation of the actual heterogeneous resource amount of each node in the directed acyclic graph according to the preset condition comprises the following steps: in the directed acyclic graph, traversing from the start node to the end node to obtain all paths; if there is a node with an out-degree greater than 1 in the path, updating the node with the out-degree greater than 1 to a start node, and determining all paths between the updated start node and the corresponding end node as different paths with the same function in the directed acyclic graph; taking the heterogeneous resource amount allocated to each node in the different paths with the same function in the directed acyclic graph according to the preset condition as the actual heterogeneous resource amount; if there are other nodes in the directed acyclic graph, taking the estimated heterogeneous resource amount required by the other nodes as the actual heterogeneous resource amount; the other nodes are nodes other than the nodes in the different paths with the same function in the directed acyclic graph.

3. The method of claim 1, wherein, The construction method of the operator component library comprises the following steps: obtaining at least one operator component to be processed; calculating an estimated heterogeneous resource amount required by each of the at least one operator component; storing each of the at least one operator component and the corresponding estimated heterogeneous resource amount thereof in the operator component library.

4. The method of claim 3, wherein, The calculation of the estimated heterogeneous resource amount required by each of the at least one operator component comprises: obtaining the assembly instructions obtained after compiling each of the at least one operator component; For each operator component, the following steps are performed: determining the type of each assembly instruction of the operator component; based on the type of each assembly instruction of the operator component, determining the basic operand required by each assembly instruction of the operator component; calculating the estimated heterogeneous resource amount required by the operator component according to the basic operand required by each assembly instruction of the operator component.

5. The method of claim 1, wherein, The selection of at least one operator component from the operator component library to compile into a workflow comprises: displaying a visual interactive interface; the visual interactive interface comprises an operator component display area and an operator component compilation area; the operator component display area is used to display the operator components in the operator component library, and the operator component compilation area is used to generate a workflow; when a drag operation is detected, displaying the operator component indicated by the drag operation in the operator component compilation area; when a connection operation is detected, displaying a connection line pointing to the end point starting from the start position of the connection operation and ending at the end position of the connection operation.

6. An operator component heterogeneous resource quantity estimation system, characterized by, It comprises: a DAG heterogeneous resource scheduling subsystem, an operator component library management module, an operator component construction subsystem, a componentized construction subsystem, an estimated heterogeneous resource amount calculation subsystem and a compilation module; The compilation module is configured to select at least one operator component from the operator component library to compile into a workflow; wherein the operator component library comprises a plurality of operator components and the estimated heterogeneous resource amounts required by the plurality of operator components; The DAG heterogeneous resource scheduling subsystem is configured to calculate the priority of each operator component in the workflow when the operator component is executed on a hardware platform based on the estimated heterogeneous resource amount corresponding to each operator component in the workflow according to the HEFT algorithm, and to schedule the heterogeneous resources of each operator component in the workflow according to the priority. The DAG heterogeneous resource scheduling subsystem is further configured to: calculate the actual heterogeneous resource amount of each operator component in the workflow when the operator component is executed on a hardware platform; update the corresponding estimated heterogeneous resource amount of each operator component in the workflow included in the operator component library to the corresponding actual heterogeneous resource amount; The operator component construction subsystem is configured to: establish an operator relationship database; the operator relationship database stores the predecessor and successor relationship between operators in a sequence; wherein the sequence in the operator relationship database is a linear sequence and / or a different sequence with the same function; the start node and the end node of the different sequence with the same function are the same; obtain high-frequency sequences from the operator relationship database; the high-frequency sequences are sequences in the operator relationship database sorted in descending order of frequency, and a preset number of sequences ranked at the top are selected; The high-frequency sequence is constructed as an operator component, and the operator component is stored in the operator component library; The DAG heterogeneous resource scheduling subsystem is configured to: establish a directed acyclic graph according to the workflow, wherein each node in the directed acyclic graph corresponds to each operator component in the workflow; calculate actual heterogeneous resource amounts of each node in the directed acyclic graph according to a preset condition, wherein the preset condition is used to make a difference between completion times of different paths with the same function in the directed acyclic graph less than a preset value; use the actual heterogeneous resource amounts of each node in the directed acyclic graph as actual heterogeneous resource amounts of each operator component in the workflow when the operator component is executed on a hardware platform.

7. An electronic device, comprising: The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 5 when executing the computer program.

Citation Information

Patent Citations

  • Processing method and device for artificial intelligence AI, electronic equipment and storage medium

    CN112199385A