Task execution method, electronic equipment, storage medium and program product
By splitting the task into multiple operators through the artificial intelligence computing power framework and generating or reconstructing the target operators on the target device, the complexity of cross-platform adaptation of deep learning models is solved, and the adaptation efficiency and development efficiency of heterogeneous devices are improved.
Patent Information
- Application Number
- CN202511171269.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-08-20
AI Technical Summary
In existing technologies, deep learning models need to be adapted across platforms by writing operators for different hardware devices, which makes the adaptation process complex and inefficient. In addition, when connecting to heterogeneous devices, an in-depth understanding of the underlying hardware logic is required, which increases the difficulty and time consumption of development.
By using the artificial intelligence computing power framework as the intermediate architecture, the task to be executed is split into multiple first operators, and the second operator on the target device is used to generate or reconstruct the target operator, realizing cross-platform task execution and reducing the adaptation cost of docking heterogeneous devices.
It improves the model adaptation efficiency on heterogeneous devices, reduces repetitive work, reduces development and maintenance costs, and simplifies the cross-platform adaptation process.
Smart Images

Figure CN120671869A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a task execution method, electronic device, storage medium, and program product. Background Art
[0002] With the advancement of artificial intelligence technology, deep learning models have evolved from early single-domain, single-task structures to large-scale, cross-domain, multi-task models. At the same time, the diversification of hardware devices has placed higher demands on cross-platform model adaptation. Currently, model adaptation requires writing corresponding computing operators for heterogeneous hardware devices according to the rules of different deep learning frameworks. This process requires developers to have a deep understanding of the underlying operator libraries and implementation logic of each hardware platform. When integrating a new model, developers must first analyze the support status of existing operators. If the framework or hardware lacks the required operators, new operators must be developed and debugged separately for different hardware platforms, resulting in a complex and inefficient adaptation process. Summary of the Invention
[0003] In view of the above problems, the present application provides a task execution method, electronic device, storage medium and program product for improving model adaptation efficiency.
[0004] The first aspect of the present application provides a task execution method, which is applied to an artificial intelligence computing power framework. The method includes: based on a target model for the task to be executed, splitting the task to be executed into multiple first operators for the artificial intelligence computing power framework; in response to any first operator failing to successfully match a target operator with the same operation logic on a target device, sending a first instruction to the target device, the first instruction being used to instruct the target device to generate a target operator based on at least one stored second operator, and the at least one second operator being used to generate the target operator through combination or reconstruction; in response to multiple first operators all matching the target operator on the target device, sending a second instruction to the target device, the second instruction including the execution order of the target operators, so that the target device obtains the execution result of the task to be executed by executing multiple target operators in the execution order.
[0005] The second aspect of the present application provides a task execution method, applied to a target device, the method comprising: in response to receiving a first instruction, generating a target operator based on at least one stored second operator, the first instruction being an instruction sent by the artificial intelligence computing power framework to the target device in response to any first operator failing to successfully match a target operator with the same operation logic on the target device, the first operator being based on a target model for the task to be executed, splitting the task to be executed into operators for the artificial intelligence computing power framework, and at least one second operator being used to generate the target operator by combination or reconstruction; in response to receiving a second instruction, obtaining an execution order of the target operator from the second instruction, executing multiple target operators of the target model in accordance with the execution order, and obtaining an execution result of the task to be executed, the second instruction being an instruction sent by the artificial intelligence computing power framework to the target device in response to multiple first operators all matching the target operator on the target device.
[0006] The third aspect of the present application provides an electronic device comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method according to the first aspect.
[0007] The fourth aspect of the present application provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the method according to the first aspect when the computer program or instructions are executed by a processor.
[0008] The fifth aspect of the present application provides a computer program product, comprising a computer program or instructions, which implements the steps of the method according to the first aspect when the computer program or instructions are executed by a processor.
[0009] Through the task execution method, electronic device, storage medium and program product of the present application, the artificial intelligence computing power framework, as an intermediate architecture, can simultaneously connect to multiple deep learning frameworks and multiple heterogeneous devices. For each deep learning framework, the artificial intelligence computing power framework can decompose the tasks to be executed of different target models into multiple first operators with a unified format, and obtain the target operator by matching with the second operator on the target device, so that the target device can execute the tasks to be executed of the target model, that is, connect the model to the device. This method only requires the artificial intelligence computing power framework to be connected to the deep learning framework once, and can realize the connection of any target model built based on the deep learning model with multiple target devices, reducing the adaptation cost of the target model to heterogeneous target devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above contents and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:
[0011] Figure 1 The following schematically illustrates an application scenario of the task execution method according to an embodiment of the present application;
[0012] Figure 2 A flowchart schematically illustrates a task execution method for an artificial intelligence computing framework according to an embodiment of the present application;
[0013] Figure 3 A schematic diagram of operator adaptation in a task execution method according to an embodiment of the present application is schematically shown;
[0014] Figure 4 A schematic diagram of decomposition mapping of tasks to be executed according to a task execution method according to an embodiment of the present application is shown;
[0015] Figure 5 A schematic diagram of operator matching according to an embodiment of the present application is shown schematically;
[0016] Figure 6 A flowchart schematically illustrates a task execution method for a target device according to an embodiment of the present application;
[0017] Figure 7 A schematic diagram of operator matching according to an embodiment of the present application is shown schematically; and
[0018] Figure 8 The structural block diagram of the computer system of the electronic device according to the embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] Figure 1 The following schematically illustrates an application scenario of a task execution method according to an embodiment of the present invention.
[0022] like Figure 1 As shown, for different deep learning frameworks, the adaptation model must be adapted according to the rules established by the deep learning framework itself. For different heterogeneous devices, such as central processing units (CPUs), graphics processing units (GPUs), field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), and neural network processors (NPUs), after selecting a deep learning framework, operators must be written for these heterogeneous devices according to the deep learning framework's operator adaptation rules. Operator developers must be familiar with the underlying operator libraries of these heterogeneous devices and understand the basic logic behind writing these operators. Many deep learning frameworks have relatively independent hardware device adaptation projects, requiring maintenance across multiple projects. Furthermore, when analyzing operator support, it's necessary to consult the underlying operator libraries of these heterogeneous devices and analyze the adapted operators one by one.
[0023] Based on the above characteristics, the following problems will arise when heterogeneous devices are connected to new models: First, when the number of heterogeneous devices increases, the workload of repetitive operator adaptation will surge, affecting the efficiency of model deployment; Second, when the number of heterogeneous devices increases, multiple devices and multiple frameworks need to maintain multiple projects independently; Third, switching hardware between heterogeneous devices requires reconfiguring the environment, and the dependency library and tool chain are not unified, making the operation cumbersome; Fourth, for heterogeneous devices connected in most deep learning frameworks, most of them only connect to basic operators or operators provided in the hardware operator library. For complex, unique or hardware When adapting the model to operators not provided in the hardware operator library, developers need to combine them according to the hardware operator library, and they need to have a deep understanding of different hardware operator libraries, which increases the difficulty of adaptation; fifth, when a new model is connected, a comprehensive analysis of the operators in the model is required. Especially when it is determined that an operator is not connected, it is necessary to be extremely familiar with the maintained project, which requires R&D personnel to have a strong familiarity with the project and is relatively time-consuming; sixth, it relies on manual review of heterogeneous device operator libraries and comparison and adaptation one by one, with a low degree of automation, which greatly increases the time required for adaptation.
[0024] Figure 2 The flowchart of the task execution method according to an embodiment of the present application is schematically shown.
[0025] like Figure 2 As shown, the task execution method of this embodiment is applied to the artificial intelligence computing power framework, including operations S210 to S230.
[0026] In operation S210, based on the target model for the task to be executed, the task to be executed is split into multiple first operators for the artificial intelligence computing power framework.
[0027] In the embodiments of the present application, the target model can be any deep learning model. A deep learning model is an executable algorithm obtained through data training. It consists of a network structure, parameters, and computing logic. It can automatically learn data features and complete predictions or generate tasks to be executed. The construction and operation of these models rely on the support of a deep learning framework. The deep learning framework provides modular neural network components and high-level API interfaces for the model during the development phase, implements automatic differentiation and optimization algorithms during the training phase, and provides model conversion and hardware adaptation tools during the deployment phase. The artificial intelligence computing power framework is a bridge between the deep learning framework and the target device. It distributes the computing tasks of the target model to the most suitable hardware device for execution. On the one hand, the artificial intelligence computing power framework can shield the hardware differences for the deep learning framework and provide a unified operator library. On the other hand, it can perform in-depth optimization for different hardware characteristics, including memory management, parallel computing, and power consumption control, so as to give full play to the computing potential of heterogeneous devices.
[0028] As an intermediary framework, the AI computing framework not only connects to multiple deep learning frameworks but also supports multiple heterogeneous target devices. A deep learning framework only needs to connect to the AI computing framework once to connect to multiple heterogeneous devices. When a new model needs to be integrated, it only needs to connect to the AI computing framework to complete the integration on multiple heterogeneous devices. This avoids repetitive work and improves the efficiency of integrating new models into multiple heterogeneous devices. It also reduces maintenance costs by allowing developers to maintain only a single project, the AI computing framework.
[0029] In an embodiment of the present application, when there is a new target model to be executed task to be released to the target device, the task to be executed is split into multiple first operators of the artificial intelligence computing power framework. The first operator is a calculation unit that implements each operation step after splitting the target model's task to be executed into multiple operation steps to be executed sequentially. Based on the interactive interface between the artificial intelligence computing power framework and the target device, a target operator with the same operation logic as the first operator can be matched in the target device, and the operator adaptation can be implemented using the second operator already stored on the target device, thereby improving the adaptation efficiency of the unexecuted tasks of the target model in the target device. The second operator is a calculation unit stored on the target device. The operation of matching the first operator with the second operator on the target device can be performed on the artificial intelligence computing power framework without the participation of the target device.
[0030] In operation S220, in response to any first operator failing to successfully match a target operator with the same operation logic in the target device, a first instruction is sent to the target device, where the first instruction is used to instruct the target device to generate a target operator based on at least one stored second operator, where the at least one second operator is used to generate the target operator through combination or reconstruction.
[0031] In an embodiment of the present application, if any first operator fails to successfully match an operator with the same operational logic on a target device, it indicates that the target device is currently unable to fully execute the pending task of the target model. The artificial intelligence computing framework sends a first instruction to the target device, instructing the target device to generate a target operator with the same operational logic as the unmatched first operator, thereby completing the target operator required to execute the pending task on the target device.
[0032] In operation S230, in response to multiple first operators being matched to target operators on the target device, a second instruction is sent to the target device, where the second instruction includes an execution order of the target operators, so that the target device executes the multiple target operators in the execution order to obtain an execution result of the task to be executed.
[0033] In an embodiment of the present application, when it is determined that multiple first operators of the task to be executed are matched to target operators with the same operation logic on the target device, the target device can locally execute the task to be executed of the target model based on the target operator, that is, the target device completes the docking with the target model and can execute the task to be executed implemented by the target model. The first operators are split based on the execution logic of the task to be executed, and the execution order of each first operator corresponds to the execution order of each operation in the task to be executed. The execution order of the target operator can be consistent with the execution order of the first operator.
[0034] According to the task execution method provided in the embodiment of the present application, the artificial intelligence computing power framework serves as an intermediate architecture and can simultaneously connect to multiple deep learning frameworks and multiple heterogeneous devices. For each deep learning framework, the artificial intelligence computing power framework can decompose the tasks to be executed of different target models into multiple first operators with a unified format, and obtain the target operator by matching with the second operator on the target device, so that the target device can execute the tasks to be executed of the target model, that is, connect the model to the device. This method only requires the artificial intelligence computing power framework to be connected to the deep learning framework once, and can realize the connection of any target model built based on the deep learning model with multiple target devices, reducing the adaptation cost of the target model to heterogeneous target devices.
[0035] Figure 3 The figure schematically shows the operator adaptation in the task execution method according to the embodiment of the present application.
[0036] like Figure 3 As shown, in an embodiment of the present application, a deep learning framework can construct a variety of deep learning models, including visual models, language models, and multimodal models. The deep learning framework can be a variety of types of frameworks. The artificial intelligence computing power framework is connected to the deep learning framework and heterogeneous devices through an interactive interface. Among them, when it is necessary to publish the to-be-executed tasks of the target model to at least one target device in the heterogeneous devices, the to-be-executed tasks of the target model are parsed into multiple first operators and their execution order in the artificial intelligence computing power framework through the deep learning framework. It should be noted that different deep learning frameworks have different characteristics, and the operators analyzed and their execution order may be slightly different, but this does not affect the overall computational logic of the task to be executed. The mapping of the artificial intelligence computing power framework does not affect the number of operators and the execution order of operators in the deep learning framework.
[0037] The AI computing framework can connect to multiple target devices, which can be heterogeneous, through a dedicated interactive interface. The AI computing framework can simultaneously match a first operator with a second operator on multiple target devices to obtain the target operators on these multiple target devices. The AI computing framework schedules the target operators sequentially according to the execution order of the first operators, enabling these multiple target devices to execute the pending tasks of the target model based on the target operators, thereby achieving adaptation of the target model to these multiple target devices.
[0038] The specific steps of the task execution method will be described below in conjunction with specific embodiments.
[0039] When the target device needs to be used to execute the pending tasks of the target model, the artificial intelligence computing power framework is used as an intermediate framework to connect the deep learning architecture and the target device. The artificial intelligence computing power framework splits the model tasks under the deep learning architecture into multiple first operators, and then uses the artificial intelligence computing power framework to map the first operators to the target operators on the target device, so that the target device executes the pending tasks based on the target operators.
[0040] In some embodiments, the task to be executed is split into multiple first operators for the artificial intelligence computing power framework, and the artificial intelligence computing power framework sends a deconstruction instruction to the deep learning framework where the target model is located. The deconstruction instruction is used to instruct the deep learning framework to split the task to be executed into multiple initial operators; based on the mapping relationship between the deep learning framework and the artificial intelligence computing power framework, the initial operator is converted into a first operator.
[0041] Figure 4 A schematic diagram of the decomposition mapping of tasks to be executed in the task execution method according to an embodiment of the present application is schematically shown.
[0042] like Figure 4As shown, in an embodiment of the present application, a target model is constructed based on the modular application programming interface and computational graph mechanism of a deep learning framework. Based on the computational logic and hierarchical structure of the deep learning model, the target model's to-be-executed task can be decomposed into a series of operations. Based on the application programming interface used by the deep learning framework to execute these operations, the multiple initial operators required to execute the to-be-executed task and their execution order are obtained. After the deep learning framework structures the target model's to-be-executed task into multiple initial operators, each initial operator carries relevant description information, which describes the initial operator's operational logic (which can be expressed as a mathematical formula), input / output specifications, hardware feature requirements, and performance parameters, among other characteristic information. A first operator mapping list is provided between the artificial intelligence computing power framework and the deep learning framework. This first operator mapping list records the mapping relationship between the initial operator and the first operator and also includes description information of the initial operator and the first operator. The first operator has at least the same operational logic as the corresponding initial operator. By comparing the operational logic of the initial operator and the first operator in the first operator mapping list, the initial operator is mapped to the artificial intelligence computing power framework, obtaining the multiple first operators after the to-be-executed task is decomposed. After the initial operator is mapped to the first operator, the first operator is matched with the second operator on the target device to obtain the target operator used by the target device to execute the task to be executed.
[0043] The artificial intelligence computing power framework maps the operators analyzed by the deep learning framework into a unified operator expression. After this layer of mapping, operators in different deep learning frameworks can be called to a unique operator implementation through the artificial intelligence computing power framework.
[0044] In some embodiments, a first operator is matched with the operation logic of at least one second operator in a target device; in response to the first operator not being matched with a second operator having the same operation logic in the target device, the first description information is encapsulated to obtain a first instruction, where the first description information is used to describe the operation logic of the first operator; and the first instruction is sent to the target device so that the target device constructs a target operator according to the first description information.
[0045] The artificial intelligence computing power framework may be provided with a second operator mapping list, which records the second operators of multiple target devices connected to the artificial intelligence computing power framework and the second description information of the operation logic of the second operator. After the task to be executed is split into multiple first operators, each first operator is matched with the operation logic of the second operator in the second operator mapping list to determine whether there is a target operator on the target device that can execute the operation logic of the first operator. The operation logic of the first operator can be obtained from the first operator mapping list that records the mapping relationship between the initial operator and the first operator. The first operator mapping list records the first description information of the first operator. The first description information includes characteristic information such as the operation logic, input / output specifications, hardware feature requirements and performance parameters of the first operator; the operation logic of the second operator is obtained from the second operator mapping list and is specifically included in the second description information of the second operator. By matching the operation logic of the first operator and the second operator, it is determined whether the second operator is the target operator. If any of the first operators in the second operator mapping list does not match the target operator, the AI computing framework sends a first instruction to the target device, instructing the target device to locally match the second operator again based on the first description information to obtain the target operator. This method uses the second operator already stored on the target device to implement the pending tasks of the target model, eliminating the need to construct a separate operator for the target device, thereby improving the adaptation efficiency of the model operator.
[0046] It should be noted that the artificial intelligence computing power framework can maintain a second operator mapping list for each target device, or it can maintain the second operators of all target devices that have an interactive relationship with the artificial intelligence computing power framework based on a second operator mapping list. The artificial intelligence computing power framework can match the second operator based on the second operator mapping list and determine the target device to which the second operator belongs, thereby determining whether the target device has a target operator that corresponds one-to-one with multiple first operators.
[0047] After splitting the task to be executed into the first operator of the artificial intelligence computing power framework, the artificial intelligence computing power framework matches the first operator with the second operator in the target device to obtain the target operator in the target device, so that the target device can execute the task to be executed based on the target operator, thereby realizing the function of the target device accessing the target model to execute the task to be executed.
[0048] Figure 5 A schematic diagram of operator matching according to an embodiment of the present application is shown schematically.
[0049] like Figure 5As shown, the first operator is matched one by one with the m second operators stored in the target device to obtain a target operator with the same operation logic as the first operator. Where m is a positive integer, the m second operators can be all operators on the target device or operators similar to the first operator selected on the target device.
[0050] In some embodiments, a method for matching a first operator with the operation logic of at least one second operator in a target device includes: obtaining second description information for describing the operation logic of the second operator; and determining a second operator that matches the operation logic of the first operator based on the similarity between the first description information and the second description information.
[0051] In an embodiment of the present application, the second operator mapping list set on the artificial intelligence computing power framework includes the second description information of the second operator on the target device, and the second description information at least describes the operation logic of the second operator. The similarity between the first description information of the first operator and the second description information of the second operator is calculated by string matching, word vector cosine similarity matching, deep semantic model calculation of semantic similarity, etc. Based on this similarity, it can be determined whether the operation logic of the first operator and the second operator is the same, without the need to verify the actual calculation logic of the operator, thereby improving the adaptation efficiency of the operator.
[0052] In some embodiments, the artificial intelligence computing power framework obtains a candidate second operator with a similarity higher than a first preset threshold from at least one second operator; runs the first operator and schedules the target device to run the candidate second operator; and determines the second operator among the candidate second operators whose running results are the same as the running results of the first operator as the second operator that matches the first operator.
[0053] When the candidate second operator is determined based on the similarity, the artificial intelligence computing power framework inputs the same input data to the first operator and the candidate second operator, so that the first operator and the candidate second operator operate on the input data. By comparing the running results, it can be determined whether the candidate second operator can implement the operation logic of the first operator, thereby determining whether the candidate second operator is the target operator. In the case where multiple candidate second operators can implement the operation logic of the first operator, the computing performance of the multiple candidate second operators, such as time complexity or space complexity, can be compared to select the candidate second operator with the best performance as the target operator. This method can select the candidate second operator whose performance is more matched with the first operator as the target operator when there are multiple candidate second operators with a similarity higher than a first preset threshold, thereby ensuring that the target operator can accurately implement the operation logic of the first operator.
[0054] In some embodiments, the artificial intelligence computing power framework determines the second operator as the target operator in response to matching a second operator with the same operating logic as the first operator from the target device; or combines multiple second operators into the target operator in response to matching a second operator with the same operating logic as multiple sub-operators constituting the first operator from the target device.
[0055] In an embodiment of the present application, if the first description information of a first operator in the target device has the same operation logic as that described in the second description information of a second operator, the second operator can be directly determined as the target operator. For example, if the first operator is a ReLU activation function operator, and the target device GPU provides a second operator that supports the ReLU activation function operation type, the second operator can be determined as the target operator.
[0056] In an embodiment of the present application, if a second operator with the same operation logic as the first operator is not matched in the target device, multiple second operators that can realize the operation logic of the first operator by combination are obtained in the target device, and the multiple second operators are combined into a target operator. For example, the first operator is a layer normalization operator, which normalizes the feature dimensions of a single sample. Its operation logic includes calculating the mean and variance, performing normalization based on the mean and variance, and performing scaling and offset operations in sequence; according to the operation logic of the layer normalization algorithm, the first operator is decomposed into three sub-operator combinations, including a mean calculation operator, a variance calculation operator, and a normalization calculation operator; if a second operator corresponding to the mean calculation operator, the variance calculation operator, and the normalization calculation operator can be matched in the target device, the three matched second operators are combined in a logical order to obtain a target operator that can realize the layer normalization algorithm. This method can split the first operator with high complexity into multiple sub-operators to reduce the complexity of a single operator, obtain the target operator through operator combination, and minimize the need for manual customization of the target operator, thereby accelerating the efficiency of model operator adaptation.
[0057] In some embodiments, the artificial intelligence computing power framework sends a third instruction to the target device, where the third instruction is used to instruct the target device to determine a performance score for each target operator, and when the performance score is lower than a second preset threshold, reconstruct the target operator based on at least one second operator so that the performance score of the reconstructed target operator is higher than the second preset threshold.
[0058] The computing performance of an operator includes computing speed, memory efficiency, parallelism, computing latency, energy efficiency, hardware adaptability, etc. The performance score of the target operator can be calculated based on the evaluation of at least one computing performance.
[0059] In an embodiment of the present application, after determining that multiple first operators obtained by splitting the task to be executed are matched to the target operator on the target device, the artificial intelligence computing framework sends a third instruction to the target device before sending the second instruction to the target device, instructing the target device to run each target operator in sequence, obtain the scores of each computing performance of the target operator, and perform a comprehensive evaluation of the target operator based on the various computing performance scores to obtain a performance score. Based on this performance score, the target device can independently judge the performance of the corresponding target operator and decide whether to reconstruct the target operator.
[0060] Reconstructing the target operator is similar to matching the target operator on the target device. Specifically, it involves splitting the first operator into multiple sub-operators, matching the target operator with a second operator that uses the same computational logic as the sub-operator, and combining the multiple second operators into a new target operator. This method improves the computational efficiency of the target operator, thereby improving the processing efficiency of pending tasks in the target model.
[0061] Based on the above embodiments, the AI computing framework can match each first operator to a target operator on the target device as closely as possible. If the target device has a limited number of second operators, it may be impossible to match the target operator. Therefore, it is necessary to add more second operators with different computational logic and input / output formats to the target device to increase the probability of successfully matching the first operator to the target operator.
[0062] In some embodiments, in response to any first operator failing to successfully match a target operator on a target device, the artificial intelligence computing power framework sends a fourth instruction to the target device, where the fourth instruction is used to instruct the target device to obtain a custom operator based on a custom operator interface, where the custom operator interface is an interface for developing a custom operator, and the custom operator is used to implement the operation logic of the target operator; and a target operator is generated based on the custom operator and at least one second operator.
[0063] In an embodiment of the present application, if the target operator is not matched on the target device and the target operator cannot be obtained by combining multiple second operators, the artificial intelligence computing power framework needs to instruct the developer to write a target operator for the target device through a fourth instruction. The developer writes a custom operator through the custom operator interface on the target device to implement the operation logic of the target operator, or writes a custom operator on other devices different from the target device, and sends the custom operator to the target device through the custom operator interface defined between the target device and the target device. In the case where the target device has a second operator that can implement part of the operation logic of the target operator, the developer can write a custom operator that implements another part of the operation logic of the target operator, and form a target operator based on the custom operator and the second operator that can implement part of the operation logic of the target operator. This method can assist the target device to improve the missing target operator and accelerate the adaptation of the task to be executed in the target device.
[0064] According to the task execution method applied to the artificial intelligence framework provided by this application, it is possible to automatically adapt the tasks to be executed of the target model to the target operator in the target device, so that the target device can perform the task calculation of the target model. As an intermediate framework, the artificial intelligence computing power framework can not only connect to multiple deep learning frameworks, but also be compatible with multiple heterogeneous target devices. When a new model needs to be connected, it is only necessary to complete the docking of the artificial intelligence computing power execution framework to complete the access on multiple heterogeneous devices, thereby improving the work efficiency of accessing multiple heterogeneous devices. At the same time, developers only need to maintain the artificial intelligence computing power execution frame, and there is no need to maintain each deep learning framework and heterogeneous device separately.
[0065] Figure 6 A flowchart diagram schematically illustrates a task execution method applied to a target device according to an embodiment of the present application.
[0066] like Figure 6 As shown, the present application also provides a task execution method, which is applied to a target device, and the method includes operations S610 to S620.
[0067] In operation S610, the target device generates a target operator based on at least one stored second operator in response to receiving the first instruction. The first instruction is an instruction sent by the artificial intelligence computing power framework to the target device in response to any first operator failing to successfully match a target operator with the same operation logic on the target device. The first operator is based on a target model for the task to be executed, and splits the task to be executed into operators for the artificial intelligence computing power framework. At least one second operator is used to generate the target operator through combination or reconstruction.
[0068] In this embodiment of the present application, the first instruction is only used to instruct the target device to generate a target operator for the first operator that has not been successfully matched to the target operator on the artificial intelligence computing framework. The target device does not need to match each first operator obtained by splitting the task to be executed, thereby improving the efficiency of the target device in adapting to the task to be executed. In response to receiving the first instruction, the target device parses the operation logic of the first operator from the first instruction to locally match a second operator with the same logic.
[0069] In operation S620, the target device obtains the execution order of the target operator from the second instruction in response to receiving the second instruction, executes multiple target operators of the target model according to the execution order, and obtains the execution result of the task to be executed. The second instruction is an instruction sent by the artificial intelligence computing power framework to the target device in response to multiple first operators matching the target operators on the target device.
[0070] In this embodiment of the present application, the second instruction is an instruction from the AI computing framework instructing the target device to execute the pending task of the target model. When the target device receives the second instruction, it executes the pending task of the target model based on the execution order of the target operator, thus enabling the target model's task execution function on the target device.
[0071] According to the task execution method provided in the embodiment of the present application, when it is necessary to access the function of executing a task of the target model on the target device, there is no need for the developer to write each operator of the target model separately for the target device. It is only necessary to use the second operator stored on the target device according to the first instruction of the artificial intelligence computing power framework to generate the missing target operator, thereby reducing the cost of model adaptation.
[0072] The following describes in detail the task execution method applied to the target device.
[0073] Figure 7 A schematic diagram of operator matching according to an embodiment of the present application is shown schematically.
[0074] like Figure 7 As shown, in an embodiment of the present application, when a first operator on the AI computing framework side cannot be matched to a target operator, the AI operator framework sends a first instruction to the target device. Based on the first instruction, the target device will locally match a second operator that can implement the operation logic of the first operator to generate the target operator.
[0075] In some embodiments, in response to receiving a first instruction, the target device generates a target operator based on at least one second operator, including: obtaining first description information in the first instruction, the first description information being used to describe the operation logic of the first operator; matching the first description information with the second description information of at least one second operator, and determining the second operator that is successfully matched as the target operator.
[0076] Operator matching is a key step in ensuring the correct execution of tasks. The first description not only describes the operation logic of the first operator but also its input / output and parameter requirements. The second description also describes the operation logic, input / output, and parameter requirements of the second operator.
[0077] In this embodiment of the present application, if the first description information matches the second description information, the corresponding second operator has the same operational logic and input / output as the first operator, which can ensure the smooth execution of the task to be executed. By matching and reusing the second operator, the workload of operator adaptation for the target device is reduced and the adaptation efficiency is improved.
[0078] In some embodiments, in response to a failure in matching the first description information with the second description information of at least one second operator, the target device splits the first description information into multiple sub-operation information, where the sub-operation information is used to split the first operator into multiple sub-operators according to the operation logic; matches the sub-operation information with the second description information, and combines multiple second operators that successfully match the multiple sub-operation information to generate a target operator.
[0079] The first description information describes the operation logic of the first operator and actually corresponds to the calculation operation performed by the first operator.
[0080] like Figure 7 As shown, in an embodiment of the present application, in response to a failure of the first description information to match the second description information, the target device splits the first description information into p sub-operation information, which actually splits the first operator into p sub-operators, each of which is used to perform a calculation operation in the first operator, where p is a positive integer. By matching the sub-operation information with the second description information, a second operator capable of executing each sub-operation is obtained. The target device combines the second operators capable of executing each sub-operation to obtain a target operator capable of implementing the calculation logic of the first operator. This method reduces the complexity of a single operator by splitting the first operator, thereby increasing the probability of generating the target operator.
[0081] In some embodiments, the target device determines the performance score of the target operator in response to receiving a third instruction, where the third instruction is an instruction sent by the artificial intelligence computing power framework before sending the second instruction in response to multiple first operators being matched to target operators with the same operating logic on the target device; when the performance score is lower than a second preset threshold, the target operator is reconstructed based on at least one second operator so that the performance score of the reconstructed target operator is higher than the second preset threshold.
[0082] In an embodiment of the present application, the target device can execute the task to be executed in response to the second instruction, and evaluate the performance score of each target operator according to the third instruction. The computing performance of the target operator includes computing speed, memory efficiency, latency, energy consumption ratio, etc. The target device evaluates the performance score of each target operator on different computing performances according to the running status of each target operator, and performs weighted calculation on the performance scores of different computing performances according to the importance of each computing performance to obtain a performance score. Based on the performance score, the target device can determine whether the target operator is applied to the task to be executed. When the performance score of the target operator is lower than the second preset threshold, for example, the score of the target operator is 80 and the second preset threshold is 85, it means that the performance of the target operator is lower than expected, and the target operator needs to be reconstructed on the target device to improve the performance of the target operator.
[0083] The method of reconstructing the target operator is the same as the method of processing the first operator with high complexity. The target device can split the target operator into multiple sub-operators to obtain multiple second operators with the same operation logic as the multiple sub-operators, and reconstruct the target operator based on the multiple second operators. After obtaining the reconstructed target operator, the target device will run the reconstructed target operator, obtain the performance score of the reconstructed target operator, and determine whether its performance score is higher than the second preset threshold. If the performance score of the reconstructed target operator is higher than the second preset threshold, the reconstructed target operator meets expectations and can be used for the task to be executed; if the performance score of the reconstructed target operator is lower than the second preset threshold, the custom operator interface can be used by the developer to manually write a custom operator to obtain the expected target operator.
[0084] In some embodiments, in response to failure to successfully generate the target operator based on the second operator, the target device generates prompt information, where the prompt information is used to indicate that generation of the target operator has failed.
[0085] In an embodiment of the present application, a prompt module is provided on the target device. When the target device fails to generate a target operator based on a second operator, the prompt module records the event and generates a prompt message on the target device. This prompt message is displayed on the screen to alert the developer to the event. The prompt message may include the process and reasons for the unsuccessful generation of the target operator, allowing the developer to accurately identify the problem and generate the corresponding target operator through a custom operator.
[0086] Figure 8 A schematic block diagram of an electronic device suitable for implementing a server testing method according to an embodiment of the present application is schematically shown.
[0087] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement the method of an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0088] like Figure 8 As shown, an electronic device 800 according to an embodiment of the present application includes a processor 801, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 802 or a program loaded from a storage unit 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.
[0089] Various programs and data required for the operation of the electronic device 800 are stored in the RAM 803. The processor 801, ROM 802, and RAM 803 are connected to each other via a bus 804. The processor 801 performs various operations of the method flow according to the embodiment of the present application by executing the programs in the ROM 802 and / or RAM 803. It should be noted that the programs can also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 can also perform various operations of the method flow according to the embodiment of the present application by executing the programs stored in one or more memories.
[0090] According to an embodiment of the present application, electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to bus 804. Electronic device 800 may also include one or more of the following components connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 808 including a hard disk; and a communication section 809 including a network interface card such as a LAN card or modem. Communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. Removable media 811, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 810 as needed, so that computer programs read from the removable media can be installed into storage section 808 as needed.
[0091] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the task execution method according to the embodiments of this application is implemented.
[0092] According to an embodiment of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0093] The embodiments of the present application also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to cause the computer system to implement the task execution method provided in the embodiments of the present application.
[0094] The computer program executes the above functions defined in the system / device of the embodiment of the present application when the processor 801 executes the computer program. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0095] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0096] In such an embodiment, the computer program can be downloaded and installed from the network via the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.
[0097] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0099] Those skilled in the art will appreciate that the features described in the various embodiments of this application may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in this application. In particular, the features described in the various embodiments of this application may be combined and / or coupled in various ways without departing from the spirit and teachings of this application. All such combinations and / or couplings fall within the scope of this application.
[0100] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present application, those skilled in the art may make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present application.
Claims
1. A task execution method, applied to an artificial intelligence computing framework, characterized in that: The method comprises: Splitting the task to be executed into a plurality of first operators for an artificial intelligence computing framework based on a target model for the task to be executed; In response to any first operator not being successfully matched to a target operator having the same operation logic on the target device, sending a first instruction to the target device, wherein the first instruction is used to instruct the target device to generate the target operator based on at least one stored second operator, wherein the at least one second operator is used to generate the target operator by combination or reconstruction; In response to multiple first operators being matched to target operators on the target device, a second instruction is sent to the target device, where the second instruction includes the execution order of the target operators, so that the target device executes the multiple target operators in the execution order to obtain the execution result of the task to be executed.
2. The method according to claim 1, characterized in that The step of splitting the task to be executed into a plurality of first operators for the artificial intelligence computing framework based on the target model for the task to be executed includes: Sending a deconstruction instruction to the deep learning framework where the target model is located, wherein the deconstruction instruction is used to instruct the deep learning framework to split the task to be executed into multiple initial operators; Based on the mapping relationship between the deep learning framework and the artificial intelligence computing power framework, the initial operator is converted into the first operator.
3. The method according to claim 1, characterized in that In response to any first operator failing to successfully match a target operator having the same operation logic on the target device, sending the first instruction to the target device includes: Matching the first operator with the operation logic of at least one second operator in the target device; In response to the first operator not matching a second operator with the same operation logic on the target device, encapsulating the first description information to obtain the first instruction, where the first description information is used to describe the operation logic of the first operator; The first instruction is sent to the target device, so that the target device constructs the target operator according to the first description information.
4. The method according to claim 3, characterized in that Matching the first operator with the operation logic of at least one second operator in the target device includes: Acquire second description information for describing the operation logic of the second operator; Based on the similarity between the first description information and the second description information, a second operator that matches the operation logic of the first operator is determined.
5. The method according to claim 4, characterized in that The determining, based on the similarity between the first description information and the second description information, a second operator that logically matches the first operator includes: Acquire, from the at least one second operator, a candidate second operator whose similarity is higher than a first preset threshold; Running the first operator, and scheduling the target device to run the candidate second operator; A second operator among the candidate second operators whose running result is the same as the running result of the first operator is determined as a second operator matching the first operator.
6. The method according to claim 1, characterized in that Before sending the second instruction to the target device, the method further includes: A third instruction is sent to the target device, where the third instruction is used to instruct the target device to determine a performance score of each of the target operators, and when the performance score is lower than a second preset threshold, reconstruct the target operator based on the at least one second operator so that the performance score of the reconstructed target operator is higher than the second preset threshold.
7. The method according to claim 1, characterized in that The method further comprises: In response to a second operator having the same operation logic as the first operator being matched from the target device, determining the second operator as the target operator; or In response to matching a second operator having the same operation logic as the plurality of sub-operators constituting the first operator from the target device, the plurality of second operators are combined into the target operator.
8. A task execution method, applied to a target device, characterized in that: The method comprises: In response to receiving a first instruction, generating a target operator based on at least one stored second operator, wherein the first instruction is an instruction sent by the artificial intelligence computing framework to the target device in response to any first operator failing to successfully match a target operator with the same operating logic on the target device, the first operator splitting the task to be executed into operators specific to the artificial intelligence computing framework based on a target model for the task to be executed, and the at least one second operator is used to generate the target operator through combination or reconstruction; In response to receiving a second instruction, the execution order of the target operator is obtained from the second instruction, and the multiple target operators of the target model are executed according to the execution order to obtain the execution result of the task to be executed. The second instruction is an instruction sent by the artificial intelligence computing power framework to the target device in response to multiple first operators matching the target operator on the target device.
9. The method according to claim 8, characterized in that In response to receiving the first instruction, generating a target operator based on at least one second operator includes: Obtaining first description information in the first instruction, where the first description information is used to describe the operation logic of the first operator; The first description information is matched with the second description information of the at least one second operator, and the second operator with successful matching is determined as the target operator.
10. The method according to claim 9, characterized in that The method further comprises: In response to a failure in matching the first description information with the second description information of the at least one second operator, splitting the first description information into a plurality of sub-operation information, wherein the sub-operation information is used to split the first operator into a plurality of sub-operators according to an operation logic; The sub-operation information is matched with the second description information, and multiple second operators that successfully match the multiple sub-operation information are combined to generate the target operator.
11. The method according to claim 8, characterized in that The method further comprises: In response to receiving a third instruction, determining a performance score of the target operator, wherein the third instruction is an instruction sent by the artificial intelligence computing framework before sending the second instruction in response to multiple first operators being matched to target operators with the same operation logic on the target device; When the performance score is lower than a second preset threshold, the target operator is reconstructed based on the at least one second operator so that the performance score of the reconstructed target operator is higher than the second preset threshold.
12. The method according to claim 8, characterized in that The method further comprises: In response to the target operator being unsuccessfully generated based on the second operator, prompt information is generated, where the prompt information is used to indicate that the generation of the target operator has failed.
13. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7 or 8 to 12.
14. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 or 8 to 12 are implemented.
15. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 or 8 to 12 are implemented.
Citation Information
Patent Citations
Three-party library access method and device, equipment, program product and medium
CN118394349A
Method and device for operator migration between hardware platforms and migration model construction method
CN119292667A
Model determination method and device, equipment, medium and product
CN119312834A