Task execution methods, electronic devices, storage media, and program products
By breaking down deep learning models into multiple operators and matching them with target devices through an artificial intelligence computing framework, the complexity of cross-platform adaptation is solved, enabling efficient access and maintenance of heterogeneous devices.
Patent Information
- Application Number
- CN202511171269.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-08-20
AI Technical Summary
In existing technologies, deep learning models need to write operators for different hardware devices when adapting to cross-platform, which makes the adaptation process complex and inefficient. In particular, the workload of repetitive tasks increases dramatically when there are more heterogeneous devices, resulting in high maintenance costs and low automation.
An artificial intelligence computing framework is used as the intermediate architecture to break down the task to be executed into multiple first operators. The target operator is generated by matching it with the second operator on the target device. The task is executed by combining or reconstructing the stored operators, thereby reducing the complexity of the interface.
It improves the model's adaptation efficiency on heterogeneous devices, reduces repetitive work, lowers maintenance costs, and enables efficient access to multiple heterogeneous devices.
Smart Images

Figure CN120671869B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a task execution method, electronic device, storage medium, and program product. Background Technology
[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. Simultaneously, the diversification of hardware devices has placed higher demands on the cross-platform adaptability of models. Currently, model adaptation requires writing corresponding computational operators for heterogeneous hardware devices based on the rules of different deep learning frameworks. This process demands that developers have a deep understanding of the underlying operator libraries and their implementation logic for each hardware platform. When integrating a new model, developers must first analyze the existing operator support. 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, this application provides a task execution method, electronic device, storage medium and program product to improve model adaptation efficiency.
[0004] The first aspect of this application provides a task execution method applied to an artificial intelligence computing framework. The method includes: splitting the task to be executed into multiple first operators for the artificial intelligence computing framework based on a target model for the task; in response to any first operator failing to find a target operator with the same computational logic on a target device, sending a first instruction to the target device, the first instruction instructing the target device to generate a target operator based on at least one stored second operator, the at least one second operator being used to generate the target operator through combination or reconstruction; in response to multiple first operators finding a 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 this application provides a task execution method applied to a target device. The method includes: 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 to the target device by an artificial intelligence computing framework in response to any first operator failing to find a target operator with the same computational logic on the target device, wherein the first operator is based on a target model for the task to be executed, splitting the task to be executed into operators for the artificial intelligence computing framework, and at least one second operator is used to generate the target operator by combination or reconstruction; in response to receiving a second instruction, obtaining the execution order of the target operators from the second instruction, executing multiple target operators of the target model according to the execution order, and obtaining the execution result of the task to be executed, wherein the second instruction is an instruction sent to the target device by the artificial intelligence computing framework in response to multiple first operators finding a target operator on the target device.
[0006] A third aspect of this application provides an electronic device comprising: one or more processors; and 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] A fourth aspect of this application provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the method according to the first aspect.
[0008] The fifth aspect of this application provides a computer program product including a computer program or instructions that, when executed by a processor, implement the steps of the method according to the first aspect.
[0009] Through the task execution method, electronic device, storage medium, and program product of this application, the artificial intelligence computing framework, as an intermediate architecture, can simultaneously connect to multiple deep learning frameworks and multiple heterogeneous devices. Specifically, for each deep learning framework, the artificial intelligence computing framework can decompose the tasks to be executed for different target models into multiple first operators with a uniform format, and obtain the target operator by matching them with the second operators on the target device. This enables the target device to execute the tasks to be executed for the target model, effectively connecting the model to the device. This method only requires one connection between the artificial intelligence computing framework and the deep learning framework, enabling any target model built based on that deep learning model to connect with multiple target devices, reducing the adaptation cost of connecting the target model to heterogeneous target devices. Attached Figure Description
[0010] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0011] Figure 1 This illustration schematically depicts an application scenario of the task execution method according to an embodiment of this application;
[0012] Figure 2 A flowchart illustrating a task execution method applied to an artificial intelligence computing framework according to an embodiment of this application is shown schematically.
[0013] Figure 3 The diagram illustrates operator adaptation in a task execution method according to an embodiment of this application.
[0014] Figure 4 This illustration schematically shows a decomposition mapping diagram of the task to be executed in the task execution method according to an embodiment of this application;
[0015] Figure 5 This illustration schematically shows an operator matching diagram according to an embodiment of the present application;
[0016] Figure 6 This illustration schematically shows a flowchart of a task execution method applied to a target device according to an embodiment of this application;
[0017] Figure 7 A schematic diagram illustrating an operator matching according to an embodiment of this application is shown; and
[0018] Figure 8 A schematic block diagram of a computer system for an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0019] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] Figure 1 The diagram illustrates an application scenario of the task execution method according to an embodiment of the present invention.
[0022] like Figure 1 As shown, for different deep learning frameworks, the adapted model needs to be adapted according to the rules defined 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 Processing Units (NPUs), after selecting a deep learning framework, operators need to be written for different heterogeneous devices according to the deep learning framework's operator adaptation rules. Simultaneously, operator developers need to be familiar with the underlying operator libraries of different heterogeneous devices and understand the basic logic of writing underlying operators. Many deep learning framework adaptation projects for different hardware devices are relatively independent, requiring the maintenance of multiple projects. Furthermore, when analyzing operator support, it is necessary to consult the underlying operator libraries of heterogeneous devices and analyze the adapted operators one by one.
[0023] Based on the above characteristics, the following problems arise when integrating new models onto heterogeneous devices: First, as the number of heterogeneous devices increases, the workload of adapting repetitive operators surges, impacting model deployment efficiency. Second, with an increase in heterogeneous devices, multiple projects need to be maintained independently across multiple devices and frameworks. Third, switching hardware between heterogeneous devices requires reconfiguring the environment; inconsistent dependency libraries and toolchains lead to cumbersome operations. Fourth, for most heterogeneous devices interfaced with deep learning frameworks, only basic operators or operators provided in hardware operator libraries are typically integrated; complex, unique, or hardware-specific operators remain largely unavailable. When adapting a model to operators not provided in the hardware operator library, developers need to combine them manually based on the hardware operator library, requiring them to have a deep understanding of different hardware operator libraries, which increases the difficulty of adaptation; fifth, when a new model is introduced, a comprehensive analysis of the operators in the model is required, especially when it is determined that no operators have been introduced. This requires extreme familiarity with the maintained project, demanding strong familiarity with the project from the R&D personnel, and is relatively time-consuming; sixth, relying on manual searching of heterogeneous device operator libraries and comparing and adapting them one by one results in low automation and greatly increases the adaptation time.
[0024] Figure 2 A flowchart illustrating a task execution method according to an embodiment of this application is shown schematically.
[0025] like Figure 2 As shown, the task execution method of this embodiment is applied to an artificial intelligence computing 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 broken down into multiple first operators for the artificial intelligence computing power framework.
[0027] In this embodiment, the target model can be any deep learning model. A deep learning model is an executable algorithm trained on data. It consists of a network structure, parameters, and computational logic, and can automatically learn data features to complete predictions or generate tasks to be executed. The construction and operation of these models all rely on the support of deep learning frameworks. Deep learning frameworks provide modular neural network components and high-level API interfaces for models during the development phase, implement automatic differentiation and optimization algorithms during the training phase, and provide model conversion and hardware adaptation tools during the deployment phase. The artificial intelligence computing power framework acts as a bridge between the deep learning framework and the target device, distributing the computational tasks of the target model to the most suitable hardware devices for execution. On the one hand, the artificial intelligence computing power framework can shield the deep learning framework from hardware differences by providing a unified operator library; on the other hand, it can perform deep optimization for different hardware characteristics, including memory management, parallel computing, and power consumption control, fully leveraging the computing potential of heterogeneous devices.
[0028] As an intermediate framework, the AI computing power framework can not only interface with multiple deep learning frameworks but also be compatible with multiple heterogeneous target devices. A deep learning framework only needs to interface with the AI computing power framework once to connect to multiple heterogeneous devices; when a new model needs to be integrated, only the integration with the AI computing power framework needs to be completed to achieve integration on multiple heterogeneous devices. This avoids repetitive work, improves the efficiency of integrating new models with multiple heterogeneous devices, and reduces maintenance costs by requiring developers to maintain only one AI computing power framework project.
[0029] In this embodiment, when a new target model's task to be executed is to be published to the target device, the task is broken down into multiple first operators of the AI computing framework. Each first operator is a computational unit that implements the computation of each sequentially executed operation step after the target model's task is broken down into multiple operation steps. Based on the interaction interface between the AI computing framework and the target device, a target operator with the same computational logic as the first operator can be matched in the target device. Operator adaptation is achieved using second operators already stored on the target device, thereby improving the adaptation efficiency of the target model's unexecuted tasks in the target device. The second operator is a computational unit already 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 AI computing framework without the participation of the target device.
[0030] In operation S220, in response to any first operator failing to find a target operator with the same operational logic in the target device, a first instruction is sent to the target device. The first instruction is used to instruct the target device to generate a target operator based on at least one stored second operator. The at least one second operator is used to generate the target operator by combination or reconstruction.
[0031] In this embodiment, if any first operator fails to find a matching operator with the same computational logic in the target device, it indicates that the target device is currently unable to fully execute the task to be executed by 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 computational logic as the unmatched first operator, thus completing the target operator required to execute the task to be executed on the target device.
[0032] In operation S230, in response to multiple first operators being matched with target operators on the target device, a second instruction is sent to the target device. The second instruction includes the execution order of the target operators, so that the target device executes multiple target operators in the execution order to obtain the execution result of the task to be executed.
[0033] In this embodiment, when it is determined that multiple first operators of the task to be executed all match target operators with the same computational logic on the target device, the target device can execute the task to be executed in the target model locally based on the target operators. That is, the target device completes the interface with the target model and can execute the task to be executed implemented using the target model. The first operators are decomposed 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 operators can be consistent with the execution order of the first operators.
[0034] According to the task execution method provided in this application, the artificial intelligence computing framework, as an intermediate architecture, can simultaneously connect to multiple deep learning frameworks and multiple heterogeneous devices. Specifically, for each deep learning framework, the artificial intelligence computing framework can decompose the tasks to be executed for different target models into multiple first operators with a uniform format. These first operators are then matched with second operators on the target device to obtain the target operator, enabling the target device to execute the tasks to be executed for the target model, thus connecting the model to the device. This method only requires one connection between the artificial intelligence computing framework and the deep learning framework, enabling any target model built based on that deep learning model to connect with multiple target devices, reducing the adaptation cost of connecting the target model to heterogeneous target devices.
[0035] Figure 3 The diagram illustrates operator adaptation in a task execution method according to an embodiment of this application.
[0036] like Figure 3 As shown in the embodiments of this application, the deep learning framework can construct various deep learning models, including visual models, language models, and multimodal models. The deep learning framework can be of various types. The artificial intelligence computing power framework interfaces with the deep learning framework and heterogeneous devices through an interactive interface. Specifically, when it is necessary to publish the task to be executed for a target model to at least one target device among the heterogeneous devices, the deep learning framework parses the task to be executed for the target model into multiple first operators and their execution order in the artificial intelligence computing power framework. It should be noted that different deep learning frameworks have different inherent characteristics, and the analyzed operators and their execution order may differ slightly, 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 or the operator execution order in the deep learning framework.
[0037] The AI computing framework can interface with multiple target devices, which can be heterogeneous, through a dedicated interactive interface. The framework can simultaneously match the first operator with the second operators of multiple target devices to obtain the target operators on those devices. The framework then schedules the target operators sequentially according to the execution order of the first operator, enabling the multiple target devices to execute the tasks to be performed by the target model based on the target operators, thus achieving adaptation between the target model and the multiple target devices.
[0038] The specific steps of the task execution method will be described below with reference to specific embodiments.
[0039] When it is necessary to use the target device to execute the task to be executed 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 decomposes the model task under the deep learning architecture into multiple first operators, and then maps the first operators to the target operators on the target device, so that the target device can execute the task to be executed 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 framework. The artificial intelligence computing 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 framework, the initial operators are converted into first operators.
[0041] Figure 4 The diagram illustrates a decomposition mapping of a task to be executed according to an embodiment of the present application.
[0042] like Figure 4As shown in the embodiments of this application, the target model is constructed based on the modular application programming interface and computation graph mechanism of the deep learning framework. Based on the computational logic and hierarchical structure of the deep learning model, the task to be executed by the target model can be decomposed into a series of operations, and based on the application programming interface used by the deep learning framework to execute these operations, multiple initial operators required to execute the task and their execution order are obtained. After the deep learning framework structures the task to be executed by the target model into multiple initial operators, each initial operator carries relevant descriptive information, which describes the operational logic (which can be expressed mathematically), input / input specifications, hardware characteristic requirements, and performance parameters of the initial operator. 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 operators and the first operator, and also contains the descriptive information of the initial operators and the first operator. The first operator has at least the same operational logic as the corresponding initial operator. By comparing the initial operators and the first operators in the first operator mapping list, the initial operators are mapped to the artificial intelligence computing power framework to obtain multiple first operators after the task to be executed is decomposed. After the initial operator and the first operator are mapped, 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 AI computing power framework maps the operators analyzed by the deep learning framework into a unified operator expression. After this mapping, operators in different deep learning frameworks can be invoked by the AI computing power framework to achieve a unique operator implementation.
[0044] In some embodiments, the first operator is matched with the operational logic of at least one second operator in the target device; in response to the first operator not being matched with a second operator having the same operational logic in the target device, the first description information is encapsulated to obtain a first instruction, the first description information being used to describe the operational logic of the first operator; the first instruction is sent to the target device so that the target device constructs a target operator based on the first description information.
[0045] The AI computing framework can include a second operator mapping list. This list records the second operators and their operational logic descriptions for multiple target devices interfaced with the AI computing framework. After the task to be executed is divided into multiple first operators, the operational logic of each first operator is matched against the second operator in the second operator mapping list to determine if a target operator exists on the target device capable of executing the operational logic of that first operator. The operational logic of the first operator can be obtained from the first operator mapping list, which records the mapping relationship between the initial operator and the first operators. The first operator mapping list records the first description information of the first operator, including its operational logic, input / input specifications, hardware requirements, and performance parameters. The operational logic of the second operator is obtained from the second operator mapping list and is specifically contained within its second description information. By matching the operational logic of the first and second operators, it is determined whether the second operator is a target operator. If any of the first operators fails to match the target operator in the second operator mapping list, the AI computing framework sends a first instruction to the target device, instructing the target device to match the second operator locally again based on the first description information to obtain the target operator. This method utilizes the second operators already stored on the target device to implement the task to be executed by the target model, without the need to construct operators separately for the target device, thereby improving the adaptation efficiency of model operators.
[0046] It should be noted that the AI computing power framework can maintain a separate second operator mapping list for each target device, or it can maintain the second operators for all target devices that interact with the AI computing power framework based on a single second operator mapping list. The AI computing power framework can match second operators based on this second operator mapping list and determine the target device to which the second operator belongs, thereby determining whether the target device has target operators that correspond one-to-one with multiple first operators.
[0047] After the task to be executed is broken down into the first operator of the AI computing framework, the AI computing framework then 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 The illustration shows a schematic diagram of an operator matching according to an embodiment of this application.
[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 the target operator with the same operational logic as the first operator. Here, m is a positive integer, and the m second operators can be all operators on the target device, or operators similar to the first operator selected from the target device.
[0050] In some embodiments, matching the first operator with the operational logic of at least one second operator in the target device includes: obtaining second descriptive information for describing the operational logic of the second operator; and determining the second operator that matches the operational logic of the first operator based on the similarity between the first descriptive information and the second descriptive information.
[0051] In this embodiment, the second operator mapping list set on the artificial intelligence computing framework includes second description information of the second operator on the target device, which 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 using methods such as string matching, word vector cosine similarity matching, and semantic similarity calculation by deep semantic models. Based on this similarity, it can be determined whether the operation logic of the first operator and the second operator is the same, without needing to verify the actual operation logic of the operator, thus improving the adaptation efficiency of the operator.
[0052] In some embodiments, the AI computing framework obtains candidate second operators 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 operators; and determines the second operator in 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 candidate second operators are identified based on similarity, the AI computing framework inputs the same input data into both the first operator and the candidate second operators, enabling both to perform operations on that input data. By comparing the results, it can be determined whether the candidate second operator can implement the computational logic of the first operator, thus determining whether it is the target operator. If multiple candidate second operators can implement the computational logic of the first operator, the computational performance of these multiple candidate second operators can be compared, such as time complexity or space complexity, 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 closely matched to the first operator as the target operator when multiple candidate second operators with similarity higher than a first preset threshold exist, thereby ensuring that the target operator can accurately implement the computational logic of the first operator.
[0054] In some embodiments, the AI computing framework determines the second operator as the target operator in response to finding a second operator in the target device that has the same operational logic as the first operator; or in response to finding a second operator in the target device that has the same operational logic as the multiple sub-operators that make up the first operator, it combines the multiple second operators into the target operator.
[0055] In this embodiment, if the first description information of the first operator in the target device is the same as the operational logic described in the second description information of the second operator, then the second operator can be directly identified 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, then the second operator can be identified as the target operator.
[0056] In this embodiment, if no second operator with the same operational logic as the first operator is found in the target device, multiple second operators that can implement the operational logic of the first operator are obtained in the target device and combined to form a target operator. For example, the first operator is a layer normalization operator, which performs standardization processing on the feature dimensions of a single sample. Its operational logic includes calculating the mean and variance, performing standardization processing based on the mean and variance, and scaling and offset operations. According to the operational logic of the layer normalization algorithm, the first operator is decomposed into a combination of three sub-operators, including a mean calculation operator, a variance calculation operator, and a normalization calculation operator. If a second operator corresponding to the mean calculation operator, variance calculation operator, and normalization calculation operator can be found in the target device, the three matched second operators are combined in logical order to obtain a target operator that can implement the layer normalization algorithm. This method can break down the highly complex first operator into multiple sub-operators to reduce the complexity of a single operator. The target operator is obtained by combining operators, minimizing the need for manually defining the target operator and thus accelerating the efficiency of model operator adaptation.
[0057] In some embodiments, the AI computing framework sends a third instruction to the target device, which instructs the target device to determine the performance score of each target operator, and if the performance score is lower than a second preset threshold, to 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 computational performance of an operator includes computational speed, memory efficiency, parallelism, computational latency, energy efficiency, and hardware adaptability. The performance score of the target operator can be calculated based on at least one evaluation of computational performance.
[0059] In this embodiment, after determining that the task to be executed, divided into multiple first operators, all match target operators on the target device, the AI computing framework sends a third instruction to the target device before sending the second instruction. This instruction instructs the target device to run each target operator sequentially, obtain scores for each computational performance aspect of the target operator, and perform a comprehensive evaluation based on these scores to obtain a performance score. Based on this performance score, the target device can independently determine the performance of the corresponding target operator and decide whether to reconstruct it.
[0060] The method for reconstructing the target operator is similar to that for matching the target operator on the target device. Specifically, it involves splitting the first operator into multiple sub-operators, matching a second operator with the same operational logic as the sub-operators onto the target operator, and combining multiple second operators into a new target operator. This method can improve the computational efficiency of the target operator, thereby improving the processing efficiency of the target model's tasks.
[0061] Based on the above embodiments, the AI computing framework can match each first operator with a target operator on the target device as much as possible. However, if the types of second operators on the target device are limited, there may be situations where a target operator cannot be matched. Therefore, it is necessary to supplement the target device with more second operators of different computational logic and different input / output formats to increase the probability that the first operator can successfully match the target operator.
[0062] In some embodiments, in response to any first operator failing to match a target operator on the target device, the AI computing framework sends a fourth instruction to the target device. The fourth instruction instructs the target device to obtain a custom operator based on a custom operator interface. The custom operator interface is an interface for developing custom operators. The custom operator is used to implement the computational logic of the target operator. Based on the custom operator and at least one second operator, the target operator is generated.
[0063] In this embodiment, if no target operator is found on the target device, and the target operator cannot be obtained by combining multiple second operators, the AI computing framework needs to instruct developers to write a target operator for the target device via a fourth instruction. Developers can write custom operators through the custom operator interface on the target device to implement the target operator's computational logic, or they can write custom operators on other devices different from the target device and send them to the target device through the custom operator interface defined between the target device and the target device. If the target device has a second operator capable of implementing part of the target operator's computational logic, developers can write a custom operator that implements another part of the target operator's computational logic. The target operator is then formed based on this custom operator and the second operator capable of implementing part of the target operator's computational logic. This method can assist the target device in completing the missing target operator and accelerate the adaptation of the task to be executed on the target device.
[0064] According to the task execution method applied to an artificial intelligence framework provided in this application, the task to be executed by the target model can be automatically adapted to the target operator in the target device, enabling the target device to perform task calculations for the target model. The artificial intelligence computing power framework, as an intermediate framework, can not only interface with multiple deep learning frameworks but also be compatible with multiple heterogeneous target devices. When a new model needs to be integrated, only the integration of the artificial intelligence computing power execution framework needs to be completed to achieve integration on multiple heterogeneous devices, improving the efficiency of integrating multiple heterogeneous devices. Furthermore, developers only need to maintain the artificial intelligence computing power execution framework, eliminating the need for separate maintenance for each deep learning framework and heterogeneous device.
[0065] Figure 6 A schematic flowchart of a task execution method applied to a target device according to an embodiment of this application is shown.
[0066] like Figure 6 As shown, this application also provides a task execution method applied to a target device, the method including operations S610~S620.
[0067] In operation S610, the target device, in response to receiving a first instruction, generates a target operator based on at least one stored second operator. 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 match a target operator with the same operational logic. The first operator is based on a target model for the task to be executed, which breaks down the task to be executed into operators for the artificial intelligence computing framework. At least one second operator is used to generate the target operator by combination or reconstruction.
[0068] In this embodiment, 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 with the target operator on the artificial intelligence computing power framework. This eliminates the need for the target device to match each of the first operators obtained from the breakdown of the task to be executed, thereby improving the efficiency of the target device in adapting to the task. Upon receiving the first instruction, the target device parses the operational 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 responds to receiving the second instruction, obtains the execution order of the target operators from 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 the instruction sent by the artificial intelligence computing power framework to the target device in response to multiple first operators matching the target operators in the target device.
[0070] In this embodiment, the second instruction is an instruction from the artificial intelligence computing framework to the target device to execute the task to be executed by the target model. When the target device receives the second instruction, it executes the task to be executed by the target model based on the execution order of the target operators, that is, the function of executing the task of the target model is integrated into the target device.
[0071] According to the task execution method provided in the embodiments of this application, when it is necessary to access the function of the target model to perform tasks on the target device, the developer does not need to write each operator of the target model separately for the target device. Instead, the missing target operator is generated by using the second operator already stored on the target device according to the first instruction of the artificial intelligence computing power framework, thereby reducing the cost of model adaptation.
[0072] The following will provide a detailed explanation of the task execution method applied to the target device.
[0073] Figure 7 The illustration shows a schematic diagram of an operator matching according to an embodiment of this application.
[0074] like Figure 7 As shown in this embodiment, when the first operator in the AI computing framework cannot be matched with the 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 capable of implementing the computational logic of the first operator to generate the target operator.
[0075] In some embodiments, the target device generates a target operator based on at least one second operator in response to receiving a first instruction, comprising: obtaining first description information in the first instruction, the first description information being used to describe the operational logic of the first operator; matching the first description information with second description information of at least one second operator; and determining the successfully matched second operator as the target operator.
[0076] Operator matching is a crucial step in ensuring the correct execution of the task. The first descriptive information describes not only the operational logic of the first operator but also its input / output and parameter requirements. The second descriptive information also describes the operational logic, input / output, and parameter requirements of the second operator.
[0077] In this embodiment, if the first description information and the second description information match, the corresponding second operator has the same operational logic and input / output as the first operator, ensuring the smooth execution of the task. 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 of the first description information to match the second description information of at least one second operator, the target device splits the first description information into multiple sub-operation information, the sub-operation information being used to split the first operator into multiple sub-operators according to the operation logic; the sub-operation information is matched with the second description information, and the multiple second operators that successfully match the multiple sub-operation information are combined to generate the target operator.
[0079] The first description describes the operational logic of the first operator, which actually corresponds to the computational operation performed by the first operator.
[0080] like Figure 7 As shown in this embodiment, in response to a failure to match the first description information with the second description information, the target device splits the first description information into p sub-operation information, which is essentially splitting the first operator into p sub-operators. Each sub-operator is used to execute one computational operation of 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 that implements the computational 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, in response to receiving a third instruction, determines the performance score of the target operator. The third instruction is an instruction sent by the artificial intelligence computing framework before sending the second instruction, in response to multiple first operators matching the target operator with the same computational logic on the target device. If 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 this embodiment, the target device can execute the task to be executed in response to a second instruction, and evaluate the performance score of each target operator according to a third instruction. The computational performance of the target operator includes computational speed, memory efficiency, latency, and energy efficiency. The target device evaluates the performance score of each target operator on different computational performance levels according to its running status, and performs a weighted calculation of the performance scores of different computational performance levels according to the importance of each computational performance level to obtain a performance score. Based on the performance score, the target device can determine whether the target operator should be applied to the task to be executed. When the performance score of the target operator is lower than a second preset threshold, for example, if the target operator's score is 80 and the second preset threshold is 85, it indicates that the performance of the target operator is lower than expected, and the target device needs to reconstruct the target operator to improve its performance.
[0083] The method for reconstructing the target operator is the same as that for handling the first operator with high complexity. The target device can break down the target operator into multiple sub-operators to obtain multiple second operators with the same operational logic as these sub-operators, and then reconstruct the target operator based on these second operators. After obtaining the reconstructed target operator, the target device will run the reconstructed target operator to obtain its performance score and determine whether the performance score is higher than a second preset threshold. If the performance score of the reconstructed target operator is higher than the second preset threshold, then 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, then a custom operator can be manually written by developers through a custom operator interface to obtain a target operator that meets expectations.
[0084] In some embodiments, the target device generates a prompt message in response to the failure to generate the target operator based on the second operator, the prompt message indicating that the target operator generation failed.
[0085] In this embodiment, the target device is equipped with a prompting module. When the target device fails to generate a target operator based on the second operator, the prompting module records the event and generates a prompt message on the target device. By displaying this prompt message on the screen, the developer is alerted to the event. The prompt message may include the process and reason for the failure to generate the target operator, so that the developer can accurately locate the problem and generate the corresponding target operator by customizing the operator.
[0086] Figure 8 A schematic block diagram of an electronic device suitable for implementing a server testing method according to an embodiment of this application is shown.
[0087] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement the methods of embodiments of this 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 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0088] like Figure 8 As shown, an electronic device 800 according to an embodiment of this application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 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 an associated chipset and / or a special-purpose 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 this application.
[0089] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 802 and / or RAM 803. It should be noted that programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in one or more memories.
[0090] According to embodiments of this application, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output (I / O) interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the 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 it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the task execution method according to the embodiments of this application.
[0092] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.
[0093] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the task execution method provided in the embodiments of this application.
[0094] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0095] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0096] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0097] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational 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's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0099] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
[0100] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.
Claims
1. A task execution method applied to an artificial intelligence computing framework, characterized in that, The method includes: Based on the target model for the task to be executed, the task to be executed is broken down into multiple first operators for the artificial intelligence computing power framework. The artificial intelligence computing power framework simultaneously interfaces with multiple deep learning frameworks and multiple heterogeneous target devices. The target model is built based on the deep learning framework. In response to any first operator failing to find a target operator with the same operational logic in the target device, a first instruction is sent to the target device. The first instruction is used to instruct the target device to generate the target operator based on at least one stored second operator. The at least one second operator is used to generate the target operator by combination or reconstruction. Generating the target operator includes splitting the first operator into multiple sub-operators, matching the target operator with a second operator with the same operational logic as the sub-operator, and combining the multiple second operators into a new target operator. In response to multiple first operators matching target operators on the target device, a second instruction is sent to the target device. The second instruction includes the execution order of the target operators, so that the target device executes 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 breaking down the task to be executed into multiple first operators for the artificial intelligence computing power framework based on the target model for the task to be executed includes: Send a destructuring instruction to the deep learning framework where the target model is located. The destructuring 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, The step of sending a first instruction to the target device in response to any first operator failing to find a target operator with the same operational logic on the target device includes: The first operator is matched with the operational logic of at least one second operator in the target device; In response to the first operator not being matched with a second operator having the same operational logic in the target device, the first description information is encapsulated to obtain the first instruction, wherein the first description information is used to describe the operational logic of the first operator; The first instruction is sent to the target device so that the target device constructs the target operator based on the first description information.
4. The method according to claim 3, characterized in that, Matching the first operator with the operational logic of at least one second operator in the target device includes: Obtain second descriptive information used to describe the operational 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 operational logic of the first operator is determined.
5. The method according to claim 4, characterized in that, The step of determining a second operator that logically matches the first operator based on the similarity between the first description information and the second description information includes: From the at least one second operator, obtain the candidate second operator whose similarity is higher than the first preset threshold; Run the first operator, and schedule the target device to run the candidate second operator; The second operator whose execution result is the same as that of the first operator is determined as the second operator that matches 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, the third instruction being used to instruct the target device to determine the performance score of each of the target operators, and, if the performance score is lower than a second preset threshold, to reconstruct the target operators based on at least one second operator, so that the performance score of the reconstructed target operators is higher than the second preset threshold.
7. The method according to claim 1, characterized in that, The method further includes: In response to finding a second operator with the same operational logic as the first operator matched from the target device, the second operator is determined as the target operator; or In response to the matching of a second operator from the target device that has the same operational logic as the plurality of sub-operators constituting the first operator, 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 includes: In response to receiving a first instruction, a target operator is generated based on at least one stored second operator. The first instruction is an instruction sent by the AI computing power framework to the target device in response to any first operator failing to find a target operator with the same computational logic on the target device. The AI computing power framework simultaneously interfaces with multiple deep learning frameworks and multiple heterogeneous target devices. The target model is constructed based on the deep learning framework. The first operator is based on the target model for the task to be executed, and the task to be executed is split into operators for the AI computing power framework. The at least one second operator is used to generate the target operator by combination or reconstruction. Generating the target operator includes splitting the first operator into multiple sub-operators, matching the target operator with a second operator with the same computational logic as the sub-operator, and combining the multiple second operators into a new target operator. In response to receiving a second instruction, the execution order of the target operators is obtained from the second instruction, and 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 operators on the target device.
9. The method according to claim 8, characterized in that, The step of generating a target operator based on at least one second operator in response to receiving a first instruction includes: Obtain the first description information from the first instruction, wherein the first description information is used to describe the operational 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 successfully matched second operator is determined as the target operator.
10. The method according to claim 9, characterized in that, The method further includes: In response to the failure of the first description information to match the second description information of the at least one second operator, the first description information is split into multiple sub-operation information, and the sub-operation information is used to split the first operator into multiple sub-operators according to the operation logic; The sub-operation information is matched with the second description information, and the target operator is generated by combining multiple second operators that successfully match multiple sub-operation information.
11. The method according to claim 8, characterized in that, The method further includes: In response to receiving a third instruction, the performance score of the target operator is determined. The third instruction is an instruction sent by the artificial intelligence computing framework before sending the second instruction, in response to the fact that multiple first operators have matched the target operators with the same operation logic on the target device. If the performance score is lower than the 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 includes: In response to the failure to successfully generate the target operator based on the second operator, a prompt message is generated, the prompt message indicating that the target operator generation failed.
13. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is 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 instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7 or 8 to 12.
15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7 or 8 to 12.
Citation Information
Patent Citations
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