Task execution method and device, electronic equipment and storage medium

By remapping the initial forward task queue of the deep learning model, the target task queue containing forward fusion computing tasks is generated, which solves the problem of high hardware resource consumption in the training stage of the deep learning model and achieves more efficient task execution.

CN119597431APending Publication Date: 2025-03-11KUNLUNXIN TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411833480.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The deep learning model requires a large hardware resource during the training stage, especially in the remapping process of reverse computing graphs, which has a large hardware resource overhead, resulting in inefficiency.

Method used

By remapping the initial forward task queue, a target forward task queue is generated, which contains forward fusion calculation tasks, and determining the corresponding target reverse fusion calculation tasks, reducing the remapping requirement for reverse task queues.

Benefits of technology

It significantly saves the overhead of hardware resources, improves the efficiency of hardware equipment to determine reverse task queues, and ensures the accuracy and efficiency of task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597431A_ABST
    Figure CN119597431A_ABST
Patent Text Reader

Abstract

The invention provides a task execution method, and relates to the technical field of artificial intelligence, in particular to the technical fields of deep learning, cloud computing, distributed computing, chips and the like. According to the specific implementation scheme, an initial forward task queue is remapped, a target forward task queue is obtained, the target forward task queue comprises at least one forward fusion calculation task, and the forward fusion calculation task is obtained by fusing at least two initial forward calculation tasks; in response to completion of remapping of the initial forward task queue, determining at least one target reverse fusion calculation task corresponding to the at least one forward fusion calculation task to obtain a target reverse task queue; and executing at least one forward fusion calculation task in the target forward task queue and at least one target reverse fusion calculation task in the target reverse task queue by using the calculation unit to obtain a task execution result. The invention further provides a task execution device, electronic equipment and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the technical fields of deep learning, cloud computing, distributed computing, chips, etc. More specifically, the present disclosure provides a task execution method, device, electronic device, and storage medium. Background Art

[0002] With the development of artificial intelligence technology, the hardware resources required for reasoning or training of deep learning models are increasing. In order to save the hardware resources required for the reasoning stage of deep learning models, multiple reasoning tasks can be remapped into one fusion task. Summary of the invention

[0003] The present disclosure provides a task execution method, apparatus, device and storage medium.

[0004] According to one aspect of the present disclosure, a task execution method is provided, the method comprising: remapping an initial forward task queue to obtain a target forward task queue, wherein the initial forward task queue includes a plurality of initial forward computing tasks, the target forward task queue includes at least one forward fusion computing task, and the forward fusion computing task is obtained by fusing at least two initial forward computing tasks; in response to the completion of the remapping of the initial forward task queue, determining at least one target reverse fusion computing task corresponding to the at least one forward fusion computing task to obtain a target reverse task queue; and using a computing unit to execute at least one forward fusion computing task in the target forward task queue and at least one target reverse fusion computing task in the target reverse task queue to obtain a task execution result.

[0005] According to another aspect of the present disclosure, a task execution device is provided, which includes: a remapping module, which is used to remap an initial forward task queue to obtain a target forward task queue, wherein the initial forward task queue includes multiple initial forward computing tasks, and the target forward task queue includes at least one forward fusion computing task, and the forward fusion computing task is obtained by fusing at least two initial forward computing tasks; a determination module, which is used to determine at least one target reverse fusion computing task corresponding to the at least one forward fusion computing task in response to the completion of the remapping of the initial forward task queue, to obtain a target reverse task queue; and an execution module, which is used to use a computing unit to execute at least one forward fusion computing task in the target forward task queue and at least one target reverse fusion computing task in the target reverse task queue to obtain a task execution result.

[0006] According to another aspect of the present disclosure, a task execution device is provided, including the apparatus provided by the present disclosure.

[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided according to the present disclosure.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.

[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method provided according to the present disclosure is implemented.

[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0012] Figure 1 is a schematic diagram of an exemplary system architecture to which a task execution method and apparatus can be applied according to an embodiment of the present disclosure;

[0013] Figure 2 is a flowchart of a task execution method according to an embodiment of the present disclosure;

[0014] Figure 3 is a schematic flow chart of remapping an initial forward task queue according to an embodiment of the present disclosure;

[0015] Figure 4 is a schematic diagram of a forward task queue and a reverse task queue according to an embodiment of the present disclosure;

[0016] Figure 5 is a block diagram of a task execution device according to an embodiment of the present disclosure;

[0017] Figure 6 is a block diagram of a task execution device according to an embodiment of the present disclosure; and

[0018] Figure 7 is a block diagram of an electronic device to which a task execution method can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0020] Models can be quickly deployed to multiple hardware devices based on deep learning frameworks. Deep learning frameworks can include TensorFlow frameworks, PaddlePaddle frameworks, etc. Deep learning frameworks can include a remapping optimizer. A remapping optimizer can also be called a remapper.

[0021] The computation graph of a deep learning model can include multiple local computation subgraphs. A local computation subgraph can include multiple operators. The remapping optimizer can map the local computation subgraph of the computation graph into a single equivalent operator to improve computational efficiency and save computing resources and time required for model reasoning. Taking the remapping optimizer of the tensorflow framework as an example, the remapping optimizer can be used for optimization in the model reasoning stage, but it is difficult to directly use it for computation graph optimization in the model training stage.

[0022] During the model training phase, the computational graph of the model may include a forward computational graph and a reverse computational graph. In order to optimize the reverse computational graph using the remapping optimizer, the reverse computational graph may be searched to determine one or more reverse computational subgraphs in the reverse computational graph that meet the mapping conditions. After mapping each reverse computational subgraph to an equivalent operator, the optimized reverse computational graph may be obtained. However, compared with the forward computational graph, the structure of the computational subgraph of the reverse computational graph is often more complex, and the search process is more cumbersome. In addition, the remapping optimizer needs to process both the forward computational graph and the reverse computational graph, which results in a large hardware resource overhead.

[0023] During the remapping process, the reverse computation subgraph and some intermediate operators or variables can be deleted. The remapping process of multiple computation subgraphs is performed sequentially. During the training phase, the deleted intermediate variables may be the input variables that the subsequent reverse computation subgraph depends on, which can easily cause remapping errors.

[0024] Therefore, in order to save the hardware resources required for the model training process, the present disclosure provides a task execution method, which will be described below.

[0025] Figure 1 An exemplary system architecture to which the task execution method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.

[0026] It should be noted that Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0027] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a terminal device 101, a network 102, and a server cluster 103. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server cluster 103. The network 102 may also be used to provide a medium for a communication link within the server cluster 103. The network 102 may include various connection types, such as wired and / or wireless communication links, etc.

[0028] The user can use the terminal device 101 to interact with the server cluster 103 through the network 102 to receive or send messages, etc. For example, the terminal device 101 can send a request for training a deep learning model and / or a request for reasoning based on a deep learning model to the server cluster 103 through the network 102.

[0029] Various communication client applications may be installed on the terminal device 101, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software (for example only).

[0030] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.

[0031] The server cluster 103 may be a server that provides various services, such as a background management server that provides support for requests sent by users using the terminal device 101 (only an example).

[0032] The server cluster 103 may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0033] The task execution method can be applied to a server cluster 103. The server cluster 103 includes multiple servers 1031, 1032, 1033, and 1034, each of which includes one or more hardware computing units. The server cluster 103 can be used to implement deep learning model reasoning or training.

[0034] It should be understood that Figure 1 The number of terminal devices, networks, and server nodes in the server cluster is only illustrative. Any number of terminal devices, networks, and server nodes may be provided as required.

[0035] It should be noted that the sequence number of each operation in the following method is only used as a representation of the operation for the purpose of description, and should not be regarded as representing the execution order of the various operations. Unless explicitly stated, the method does not need to be executed completely in the order shown. The task execution method provided in the embodiment of the present disclosure can generally be executed by the server cluster 103, can also be executed by the terminal device 101, or can be executed by the terminal device 101 and the server cluster 103 together. Accordingly, the task execution device provided in the embodiment of the present disclosure can generally be arranged in the server cluster 103, or can be arranged in the terminal device 101. The task execution method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 103 and can communicate with the terminal device 101 and / or the server cluster 103. Correspondingly, the task execution device provided in the embodiment of the present disclosure can also be arranged in a server or server cluster that is different from the server cluster 103 and can communicate with the terminal device 101 and / or the server cluster 103.

[0036] Figure 2 is a flowchart of a task execution method according to an embodiment of the present disclosure.

[0037] like Figure 2 As shown, the method 200 may include operations S210 to S230.

[0038] In operation S210 , the initial forward task queue is remapped to obtain a target forward task queue.

[0039] In the disclosed embodiment, the initial forward task queue may include multiple initial forward computing tasks. For example, the initial forward task queue may correspond to the forward computing graph. The initial forward computing task may correspond to the forward computing operator in the forward computing graph. The multiple forward computing tasks of the initial forward task queue are executed by the hardware computing unit, and the forward task execution result can be obtained.

[0040] In an embodiment of the present disclosure, the target forward task queue may include at least one forward fusion computing task. The forward fusion computing task may be obtained by fusing at least two initial forward computing tasks. For example, the forward fusion computing task may correspond to the above-mentioned equivalent operator or fusion operator. In the initial forward computing task queue, if at least two forward computing tasks meet a preset mapping condition, the at least two forward computing tasks may be remapped into one forward fusion computing task.

[0041] In operation S220, in response to the completion of remapping of the initial forward task queue, at least one target reverse fusion computing task corresponding to the at least one forward fusion computing task is determined to obtain a target reverse task queue.

[0042] In the embodiment of the present disclosure, after the remapping of the initial forward task queue is completed, the above-mentioned target forward task queue can be obtained.

[0043] In the embodiments of the present disclosure, the target reverse fusion computing task corresponding to the forward fusion computing task can be determined in various ways. For example, the target reverse fusion computing task corresponding to the forward fusion computing task can be determined from multiple preset reverse fusion computing tasks, or the target reverse fusion computing task corresponding to the forward fusion computing task can be determined by using the automatic derivation mechanism of the deep learning framework.

[0044] In operation S230, the computing unit is used to execute at least one forward fusion computing task in the target forward task queue and at least one target reverse fusion computing task in the target reverse task queue to obtain a task execution result.

[0045] In the disclosed embodiment, according to the input data, the computing unit can be used to execute the tasks in the target forward task queue, and then execute the tasks in the target reverse task queue to obtain the task execution results.

[0046] Through the disclosed embodiment, in the model training stage, after remapping the forward task queue, the reverse task queue is determined. Compared with remapping according to the forward task queue and the reverse task queue respectively, the hardware resources required for remapping the reverse task queue can be saved, and overly complex remapping based on the reverse task queue can be avoided, which can significantly improve the efficiency of the hardware device in determining the reverse task queue. The accurate target reverse task queue can be obtained, which helps to improve the accuracy of the hardware device in executing tasks.

[0047] It can be understood that the above describes the task execution method of the present disclosure, and some methods of obtaining a target forward task queue will be described below.

[0048] In the embodiment of the present disclosure, the initial forward task queue can be remapped by using the first computing unit to obtain the target forward task queue. The first computing unit can be, for example, a central computing unit (CPU). Figure 3 Provide explanation.

[0049] Figure 3 is a schematic flow chart of remapping an initial forward task queue according to an embodiment of the present disclosure.

[0050] like Figure 3 As shown, method 310 may remap the initial forward task queue, which will be described below in conjunction with operations S311 to S314.

[0051] In operation S311, an initial forward task sub-queue is obtained.

[0052] In the embodiments of the present disclosure, the initial forward computing task can be obtained in various ways. For example, the initial forward computing task is determined according to one or more lines of code input by the user. The code input by the user can be written in Python. For another example, in response to the user triggering a control corresponding to an operator on a visual interface, the task corresponding to the operator can be used as the initial forward computing task.

[0053] In the embodiment of the present disclosure, the initial forward task subqueue may be determined according to the acquired initial forward computing task.

[0054] In operation S312 , it is determined whether the initial forward task sub-queue matches the remapping template.

[0055] In the embodiment of the present disclosure, there may be multiple remapping modules. The multiple remapping templates may include user-defined templates or templates provided by the deep learning framework. Through the embodiment of the present disclosure, the remapping template may be a user-defined template. Thus, the operators in the computational graph may be remapped according to the needs of the user, and the model training efficiency may be improved in a targeted manner, effectively improving the user experience.

[0056] In the disclosed embodiment, the initial forward task subqueue may be determined based on a plurality of initial forward tasks. For example, if it is determined that the first initial forward computing task obtained is the same as a preset task in one or more remapping templates, the first initial forward computing task may be retained as the first initial forward task subqueue. Next, after the second initial forward computing task is obtained, the first initial forward computing task and the second initial forward computing task may be used as the second initial forward task subqueue.

[0057] In the embodiment of the present disclosure, in response to determining that the initial forward task subqueue does not match any remapping template, the operation S311 can be returned to continue to obtain the initial forward task. For example, if it is determined that the second initial forward task subqueue does not match any remapping template and it is determined that the first initial forward computing task and the second forward computing task are the same as the preset tasks in one or more remapping templates, the first initial forward computing task and the second initial forward computing task can be retained and the operation S311 can be returned. If a third initial forward computing task is obtained, the third initial forward task subqueue can be determined based on the first initial forward computing task, the second initial forward computing task and the third initial forward computing task.

[0058] In the disclosed embodiment, in response to determining that the initial forward task subqueue matches a target remapping template in a plurality of remapping templates, operation S313 is performed. For example, if it is determined that the third initial forward task subqueue is the same as a plurality of preset tasks in a remapping template and the dependency relationship between the plurality of tasks in the third initial forward task subqueue is consistent with the dependency relationship between the plurality of preset tasks, the remapping template may be used as the target remapping template. It is understood that the above mapping rule may include: the initial forward task subqueue matches a target remapping template in a plurality of remapping templates.

[0059] In operation S313, a forward fusion computing task corresponding to a plurality of initial forward computing tasks of the initial forward task subqueue is determined according to the target remapping template.

[0060] For example, the target remapping template may correspond to a preset forward fusion computing task. The forward fusion computing task may be determined as the forward fusion computing task corresponding to the third initial forward task subqueue. Next, operation S314 may be performed.

[0061] In operation S314 , it is determined whether the remapping of the initial forward task queue has been completed.

[0062] In the embodiment of the present disclosure, in response to determining that the remapping of the queue of the initial forward task is not completed, the process may return to operation S311. For example, if a new initial forward computing task is obtained, the process may return to operation S311.

[0063] In the disclosed embodiment, in response to determining that the remapping of the initial forward task queue has been completed, the target forward task queue is output. For example, after receiving a signal that the task addition is complete or a reverse computing task queue is generated, a queue including one or more forward fusion computing tasks can be used as the target forward task queue.

[0064] In addition, in another embodiment of the present disclosure, if it is determined that the above-mentioned second initial forward task subqueue does not match any remapping template and it is determined that the above-mentioned first initial forward calculation task and the above-mentioned second forward calculation task are different from the preset tasks in any remapping template, the first initial forward calculation task and the second initial forward calculation task can be deleted and return to operation S311.

[0065] It can be understood that some methods for obtaining the target forward task queue are described above, and some methods for determining the target reverse task queue will be described below.

[0066] Figure 4 is a schematic diagram of a forward task queue and a reverse task queue according to an embodiment of the present disclosure.

[0067] like Figure 4 As shown, the initial forward task queue may include a convolution task conv41, an addition task ba41, an activation task relu41, and a forward batch normalization task bn41. For example, if the initial forward task queue is executed, the convolution task conv41 may be executed according to the input data in40 to obtain a forward convolution result. The convolution task conv41 may be a two-dimensional convolution (conv2d) task. When executing the convolution task conv41, the training parameters (kernel) related to the convolution task conv41 may be read. According to the forward convolution result and the bias bias41, the addition task ba41 may be executed to obtain an operation result. According to the operation result, the activation task relu41 may be executed to obtain an activation result. The activation task may be implemented based on a linear rectifier unit (ReLu). According to the activation result, the forward batch normalization (batchnorm) task bn41 may be executed to obtain a forward normalization result.

[0068] For the initial forward task queue, the above operation S210 can be performed. For example, if a plurality of preset tasks of a remapping template provided by the deep learning framework include convolution tasks, addition tasks and activation tasks that are executed in sequence, and the dependency relationship between the plurality of preset tasks is consistent with the dependency relationship between the convolution task conv41, the addition task ba41, and the activation task relu41, it can be determined that the initial forward task subqueue including the convolution task conv41, the addition task ba41, and the activation task relu41 matches the remapping template, and the convolution task conv41, the addition task ba41, and the activation task relu41 can be fused to obtain the forward fusion calculation task ft41. Thus, the target forward task queue can include the forward fusion calculation task queue ft41 and the forward batch normalization task bn41. Next, the target reverse task queue can be determined, which will be explained below. It can be understood that the dependency relationship can indicate the input and output of the task.

[0069] In some embodiments, in some implementations of the above operation S220, determining at least one target reverse fusion computing task corresponding to at least one forward fusion computing task, and obtaining the target reverse task queue may include: determining at least one initial reverse computing task corresponding to at least one initial forward computing task. Figure 4 As shown, the forward batch normalization task bn41 can be an initial forward calculation task. A reverse batch normalization task bn42 corresponding to the forward batch normalization task bn41 can be determined as an initial reverse calculation task. For example, the initial reverse calculation task can be determined from a plurality of preset reverse calculation tasks, or the initial reverse calculation task can be determined using the automatic derivation mechanism of the deep learning framework, which is not limited in the present disclosure.

[0070] In some embodiments, in some implementations of the above operation S220, determining at least one target reverse fusion computing task corresponding to at least one forward fusion computing task may include: determining at least one target reverse fusion computing task corresponding to at least one forward fusion computing task from multiple preset reverse fusion computing tasks, and obtaining a target reverse task queue. For example, there are multiple remapping templates. Multiple remapping templates correspond to multiple preset reverse fusion computing tasks. From multiple preset reverse fusion computing tasks, the reverse fusion computing task bt42 corresponding to the forward fusion computing task ft41 can be determined as the target reverse fusion computing task.

[0071] In some embodiments, in some implementations of the above operation S220, determining at least one target reverse fusion computing task corresponding to at least one forward fusion computing task, and obtaining a target reverse task queue may include: obtaining a target reverse task queue according to at least one initial reverse computing task and at least one target reverse fusion computing task. For example, the target reverse task queue may include at least one initial reverse computing task and at least one target reverse fusion computing task. Figure 4 As shown, the target reverse task queue may include a reverse batch normalization task bn42 and a reverse fusion computing task bt42.

[0072] It can be understood that some methods for determining the target forward task queue and the target reverse task queue are described above, and some methods for executing the target forward task queue and the target reverse task queue will be described below.

[0073] In some embodiments, in some implementations of the above operation S230, using a computing unit to execute at least one forward fusion computing task in the target forward task queue and at least one target reverse fusion computing task in the target reverse task queue includes: using a computing unit to execute at least one forward fusion computing task to obtain a forward task execution result. For example, the second computing unit may be used to execute at least one forward fusion computing task in the target forward task queue. Figure 4 As shown, according to the input data in40, the second computing unit can be used to execute the forward fusion computing task ft41 in the target forward task queue to obtain the above activation result. According to the activation result, the second computing unit can be used to execute the forward batch normalization task bn41 to obtain the forward normalization result as the forward task execution result. The second computing unit can be an artificial intelligence computing unit. The artificial intelligence computing unit can be various hardware computing units such as a general purpose graphics processing unit (GPGPU), a tensor processing unit (TPU), and a neural network processing unit (NPU).

[0074] In some embodiments, in some implementations of the above operation S230, using a computing unit to execute at least one forward fusion computing task in a target forward task queue and at least one target reverse fusion computing task in a target reverse task queue includes: according to the forward task execution result, using the computing unit to execute at least one target reverse fusion computing task to obtain a reverse task execution result.

[0075] For example, the second computing unit may be used to execute at least one reverse fusion computing task of the target reverse task queue. Figure 4 As shown, the target gradient task gy42 and the scale task sh42 can be executed to obtain two execution results. According to these two execution results and the forward normalization result, the second computing unit can be used to execute the filling task fi42 to obtain the execution result of the filling task fi42. According to the execution result of the filling task fi42 and the forward normalization result, the loss loss42 can be obtained. In addition, the second computing unit can also be used to execute the zero similarity task zl42. It can be understood that the filling task fi42 can be implemented based on the filling function (fill). The zero similarity task zl421 can be implemented based on the zero similarity function (zeros_like). The target gradient task gy42 can be implemented based on the target gradient function (grad_ys). The scale task sh42 can be implemented based on the scale function (shape).

[0076] like Figure 4 As shown, the zero similarity task zl422 can be executed. According to the loss loss42, the forward normalization result and the execution result of the zero similarity task zl422, the reverse normalization task bn42 can be executed to obtain the reverse normalization result. After executing the reverse normalization task bn42, according to the reverse normalization result, the addition task a421, the addition task a422 and the addition task a423 can be executed. According to the execution result of the addition task a421, the input data in40 and the intermediate calculation result of the forward fusion calculation task ft41, the reverse fusion calculation task bt42 can be executed to obtain the reverse task execution result. The intermediate calculation result of the forward fusion calculation task ft41 can include the execution result of the above-mentioned convolution task conv41 and the execution result of the activation task relu41.

[0077] It can be understood that in the process of users adding relevant codes for forward computing tasks, some tasks are called in the form of application programming interfaces (APIs). Taking the above-mentioned forward batch normalization task as an example, users can call the code related to the batch normalization task through an application programming interface. When executing the forward batch normalization task, operations such as averaging and variance need to be performed. These operations include one or more addition operations. When executing the reverse batch normalization task, it is necessary to execute the addition tasks a421, a422, and a423 corresponding to these addition operations.

[0078] Through the disclosed embodiment, the convolution task, the addition task and the activation task are fused into a forward fusion computing task. When determining the reverse task queue, the forward fusion computing task can be quickly determined based on the preset reverse fusion computing task, thereby reducing the hardware resource overhead and time cost required to determine the reverse task queue.

[0079] In addition, if Figure 4As shown, the reverse task subqueue including the filling task fi42, the zero similarity task zl421, the target gradient task gy42, the scale task sh42, the zero similarity task zl422, the reverse batch normalization task bn42, the addition task a421, the addition task a422, and the addition task a423 is relatively complex. If remapping is performed based on the reverse task subqueue, the hardware resource overhead is large and the time cost is high. Remapping is performed based on the initial forward task queue, and the hardware resource overhead is small and the time cost is low. Through the embodiment of the present disclosure, the target reverse task queue is determined according to the target forward task queue obtained after remapping, thereby reducing the hardware resource overhead and time cost required for remapping the reverse task subqueue.

[0080] It can be understood that the present disclosure is described above in conjunction with the remapping template provided by the deep learning framework, but the present disclosure is not limited thereto and will be described below in conjunction with a user-defined template.

[0081] For example, a remapping template may be user-defined. The remapping template may include multiple preset tasks. The multiple preset tasks may include convolution tasks, addition tasks, activation tasks, and batch normalization tasks. If it is determined that the dependencies between the multiple preset tasks are consistent with the dependencies between the convolution task conv41, the addition task ba41, the activation task relu41, and the forward batch normalization task bn41, it can be determined that the initial forward task queue including the convolution task conv41, the addition task ba41, the activation task relu41, and the forward batch normalization task bn41 matches the remapping template, and the convolution task conv41, the addition task ba41, the activation task relu41, and the forward batch normalization task bn41 can be fused to obtain a forward fusion calculation task. Next, the reverse fusion calculation task corresponding to the forward fusion calculation task can be determined. The intermediate calculation result of the reverse fusion calculation task may include the execution results of the addition task a421, the addition task a422, and the addition task a423. In this way, the reverse task queue can be determined more accurately, and the accuracy of hardware devices in performing tasks related to model training can be improved.

[0082] It can be understood that the method of the present disclosure is described above, and the device of the present disclosure will be described below.

[0083] Figure 5 is a block diagram of a task execution device according to an embodiment of the present disclosure.

[0084] like Figure 5 As shown, the apparatus 500 may include a remapping module 510 , a determining module 520 and an executing module 530 .

[0085] The remapping module 510 is used to remap the initial forward task queue to obtain a target forward task queue. The initial forward task queue includes multiple initial forward computing tasks, and the target forward task queue includes at least one forward fusion computing task, which is obtained by fusing at least two initial forward computing tasks.

[0086] The determination module 520 is used to determine at least one target reverse fusion computing task corresponding to at least one forward fusion computing task in response to the completion of remapping of the initial forward task queue, and obtain a target reverse task queue.

[0087] The execution module 530 is used to use the computing unit to execute at least one forward fusion computing task in the target forward task queue and at least one target reverse fusion computing task in the target reverse task queue to obtain a task execution result.

[0088] In some embodiments, the remapping module includes: a first determination submodule, for responding to receiving an initial forward task subqueue of an initial forward task queue and determining that the initial forward task subqueue matches a target remapping template among multiple remapping templates, and determining, according to the target remapping template, a forward fusion computing task corresponding to multiple initial forward computing tasks of the initial forward task subqueue.

[0089] In some embodiments, the plurality of remapping templates includes a user defined template.

[0090] In some embodiments, the determination module includes: a second determination submodule, used to determine at least one target reverse fusion computing task corresponding to at least one forward fusion computing task from a plurality of preset reverse fusion computing tasks, and obtain a target reverse task queue.

[0091] In some embodiments, the target forward task queue also includes at least one initial forward computing task. The determination module includes: a third determination submodule, used to determine at least one initial reverse computing task corresponding to the at least one initial forward computing task. A fourth determination submodule, used to determine at least one target reverse fusion computing task corresponding to the at least one forward fusion computing task. An acquisition submodule, used to obtain the target reverse task queue according to the at least one initial reverse computing task and the at least one target reverse fusion computing task.

[0092] In some embodiments, the remapping module includes: a remapping submodule, which is used to remap the initial forward task queue using the first computing unit to obtain the target forward task queue. The execution module includes: a first execution submodule, which is used to execute at least one forward fusion computing task in the target forward task queue and at least one target reverse fusion computing task in the target reverse task queue using the second computing unit.

[0093] In some embodiments, the execution module includes: a second execution submodule, which is used to use the computing unit to execute at least one forward fusion computing task to obtain a forward task execution result; and a third execution submodule, which is used to use the computing unit to execute at least one target reverse fusion computing task according to the forward task execution result to obtain a reverse task execution result.

[0094] It can be understood that the apparatus of the present disclosure is described above, and the device including the apparatus will be described below.

[0095] Figure 6 is a block diagram of a task execution device according to an embodiment of the present disclosure.

[0096] like Figure 6 As shown, the device 60 may include a task execution device 600. For example, the task execution device 600 may be the device 500 described above.

[0097] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0098] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0099] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure 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 processing, 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 disclosure described and / or required herein.

[0100] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0101] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0102] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the task execution method. For example, in some embodiments, the task execution method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the task execution method described above may be executed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the task execution method in any other appropriate manner (eg, by means of firmware).

[0103] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0104] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0105] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories (EPROM) or flash memories, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0106] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) display or a liquid crystal display (LCD)) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0107] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a Local Area Network (LAN), a Wide Area Network (WAN), and the Internet.

[0108] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0109] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0110] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A task execution method, comprising: Remapping the initial forward task queue to obtain a target forward task queue, wherein the initial forward task queue includes a plurality of initial forward computing tasks, and the target forward task queue includes at least one forward fusion computing task, and the forward fusion computing task is obtained by fusing at least two of the initial forward computing tasks; In response to the completion of remapping of the initial forward task queue, determining at least one target reverse fusion computing task corresponding to at least one forward fusion computing task, and obtaining a target reverse task queue; and The computing unit is used to execute at least one of the forward fusion computing tasks in the target forward task queue and at least one of the target reverse fusion computing tasks in the target reverse task queue to obtain a task execution result.

2. The method according to claim 1, wherein: The remapping of the initial forward task queue to obtain the target forward task queue includes: In response to receiving an initial forward task subqueue of the initial forward task queue and determining that the initial forward task subqueue matches a target remapping template among multiple remapping templates, the forward fusion computing task corresponding to the multiple initial forward computing tasks of the initial forward task subqueue is determined according to the target remapping template.

3. The method according to claim 2, wherein: The plurality of remapping templates includes user-defined templates.

4. The method according to claim 1, wherein: The determining at least one target reverse fusion computing task corresponding to at least one forward fusion computing task to obtain a target reverse task queue comprises: At least one target reverse fusion computing task corresponding to at least one forward fusion computing task is determined from a plurality of preset reverse fusion computing tasks to obtain the target reverse task queue.

5. The method according to claim 1, wherein: The target forward task queue also includes at least one initial forward computing task, The determining at least one target reverse fusion computing task corresponding to at least one forward fusion computing task to obtain a target reverse task queue comprises: determining at least one initial reverse computation task corresponding to at least one of the initial forward computation tasks; determining at least one of the target reverse fusion computing tasks corresponding to at least one of the forward fusion computing tasks, The target reverse task queue is obtained according to at least one of the initial reverse computing tasks and at least one target reverse fusion computing task.

6. The method according to claim 1, wherein: The remapping of the initial forward task queue to obtain the target forward task queue includes: Remapping the initial forward task queue using the first computing unit to obtain the target forward task queue; The using a computing unit to execute at least one of the forward fusion computing tasks in the target forward task queue and at least one of the target reverse fusion computing tasks in the target reverse task queue comprises: The second computing unit is used to execute at least one of the forward fusion computing tasks in the target forward task queue and at least one of the target reverse fusion computing tasks in the target reverse task queue.

7. The method according to claim 1, wherein: The using a computing unit to execute at least one of the forward fusion computing tasks in the target forward task queue and at least one of the target reverse fusion computing tasks in the target reverse task queue comprises: Utilizing the computing unit to execute at least one of the forward fusion computing tasks to obtain a forward task execution result; According to the forward task execution result, the computing unit is used to execute at least one of the target reverse fusion computing tasks to obtain a reverse task execution result.

8. A task execution device, comprising: A remapping module, used for remapping an initial forward task queue to obtain a target forward task queue, wherein the initial forward task queue includes a plurality of initial forward computing tasks, and the target forward task queue includes at least one forward fusion computing task, and the forward fusion computing task is obtained by fusing at least two of the initial forward computing tasks; a determination module, configured to determine, in response to the completion of remapping of the initial forward task queue, at least one target reverse fusion computing task corresponding to at least one of the forward fusion computing tasks, and obtain a target reverse task queue; and The execution module is used to use the computing unit to execute at least one of the forward fusion computing tasks in the target forward task queue and at least one of the target reverse fusion computing tasks in the target reverse task queue to obtain task execution results.

9. The device according to claim 8, wherein: The remapping module comprises: The first determination submodule is used to respond to receiving an initial forward task subqueue of the initial forward task queue and determining that the initial forward task subqueue matches a target remapping template among multiple remapping templates, and determine the forward fusion computing task corresponding to the multiple initial forward computing tasks of the initial forward task subqueue according to the target remapping template.

10. The device according to claim 9, wherein: The plurality of remapping templates includes user-defined templates.

11. The device according to claim 8, wherein: The determination module comprises: The second determination submodule is used to determine at least one target reverse fusion computing task corresponding to at least one forward fusion computing task from a plurality of preset reverse fusion computing tasks, and obtain the target reverse task queue.

12. The device according to claim 8, wherein: The target forward task queue also includes at least one initial forward computing task, The determination module comprises: A third determination submodule, configured to determine at least one initial reverse computing task corresponding to at least one of the initial forward computing tasks; A fourth determination submodule, used to determine at least one of the target reverse fusion computing tasks corresponding to at least one of the forward fusion computing tasks; The obtaining submodule is used to obtain the target reverse task queue according to at least one of the initial reverse computing tasks and at least one target reverse fusion computing task.

13. The device according to claim 8, wherein: The remapping module comprises: A remapping submodule, configured to remap the initial forward task queue using the first computing unit to obtain the target forward task queue; The execution module includes: The first execution submodule is used to use the second computing unit to execute at least one of the forward fusion computing tasks in the target forward task queue and at least one of the target reverse fusion computing tasks in the target reverse task queue.

14. The device according to claim 8, wherein: The execution module includes: A second execution submodule, used to use the computing unit to execute at least one of the forward fusion computing tasks to obtain a forward task execution result; The third execution submodule is used to use the computing unit to execute at least one of the target reverse fusion computing tasks according to the forward task execution result to obtain a reverse task execution result.

15. A task execution device, comprising the apparatus according to any one of claims 8 to 14.

16. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

17. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

18. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.