Task execution method and device, electronic equipment and storage medium
By splitting or fusing the initial constant data to generate new tasks to be executed during the task execution of the deep learning model, the problem of insufficient hardware resource utilization in the existing technology is solved, and more efficient task execution and improvement are achieved High accuracy.
Patent Information
- Application Number
- CN202411580719.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
AI Technical Summary
In the process of task execution of deep learning models, it is difficult for the prior art to make full use of hardware computing resources, resulting in low chip performance.
By splitting the initial constant data of the task to be executed into a plurality of constant sub-data, a plurality of second to-do tasks are generated, and the initial constant data of the multiple third to-do tasks are fused into the pending constant data, a fourth is generated The task to be executed, thereby optimizing the execution of the task queue.
It improves the task execution efficiency of the computing unit, reduces the number of tasks that need to be executed, maintains high-precision calculation results, and makes full use of hardware resources.
Smart Images

Figure CN119440878A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the technical fields of chips, deep learning and large models, and can be applied to scenes such as image processing, text processing and audio processing. 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, deep learning models or large models can be deployed on artificial intelligence chips. Artificial intelligence chips can include general purpose graphics processing units (GPGPU), tensor processing units (TPU) and neural network processing units (NPU). 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: in response to determining that a subsequent task of a first task to be executed in a task queue includes a first target task, using at least one of a plurality of computing units to split initial constant data of the first task to be executed into a plurality of constant sub-data to obtain a plurality of second tasks to be executed, wherein the first target task is used to obtain a plurality of first target results according to a first execution result of the first task to be executed; deleting the first target task after the first task to be executed from the task queue; wherein the plurality of second tasks to be executed are executed according to the plurality of constant sub-data using at least one of the plurality of computing units, and the plurality of second execution results of the plurality of second tasks to be executed are a plurality of first target results.
[0005] According to another aspect of the present disclosure, a task execution method is provided, the method comprising: in response to determining that the subsequent tasks of each of a plurality of third tasks to be executed in a task queue include the same second target task, using at least one of a plurality of computing units to fuse the initial constant data of each of the plurality of third tasks to be executed into constant data to be processed, to obtain a fourth task to be executed, wherein the second target task is used to fuse the third execution results of each of the plurality of third tasks to be executed into a second target result; deleting the second target task after the third task to be executed from the task queue; wherein the fourth task to be executed is executed according to the constant data to be processed using at least one of the plurality of computing units, and the execution result of the fourth task to be executed is the second target result.
[0006] According to another aspect of the present disclosure, a task execution device is provided, which includes: a storage unit configured to store a task queue and initial constant data of at least one task to be executed in the task queue; multiple computing units, wherein at least one of the multiple computing units is configured to: in response to determining that a subsequent task of a first task to be executed in the task queue includes a first target task, split the initial constant data of the first task to be executed into multiple constant sub-data to obtain multiple second tasks to be executed, wherein the first target task is used to obtain multiple first target results according to a first execution result of the first task to be executed; delete the first target task after the first task to be executed from the task queue; wherein the multiple second tasks to be executed are executed according to the multiple constant sub-data using at least one of the multiple computing units, and the multiple second execution results of the multiple second tasks to be executed are multiple first target results.
[0007] According to another aspect of the present disclosure, a task execution device is provided, which includes: a storage unit configured to store a task queue and initial constant data of each of a plurality of tasks to be executed in the task queue; a plurality of computing units, wherein at least one of the plurality of computing units is configured to: in response to determining that the subsequent tasks of each of a plurality of third tasks to be executed in the task queue include the same second target task, fuse the initial constant data of each of the plurality of third tasks to be executed into constant data to be processed to obtain a fourth task to be executed, wherein the second target task is used to fuse the third execution results of each of the plurality of third tasks to be executed into a second target result; delete the second target task after the third task to be executed from the task queue; wherein the fourth task to be executed is executed according to the constant data to be processed using at least one of the plurality of computing units, and the execution result of the fourth task to be executed is the second target result.
[0008] According to another aspect of the present disclosure, a task execution device is provided, including the apparatus provided by the present disclosure.
[0009] 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.
[0010] 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.
[0011] 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.
[0012] 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
[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0014] Figure 1 is a flowchart of a task execution method according to an embodiment of the present disclosure;
[0015] Figure 2A is a schematic diagram of a task queue according to an embodiment of the present disclosure;
[0016] Figure 2B and Figure 2C is a schematic diagram of a plurality of second tasks to be performed according to an embodiment of the present disclosure;
[0017] Figure 3 is a flowchart of a task execution method according to another embodiment of the present disclosure;
[0018] Figure 4A is a schematic diagram of a task queue according to another embodiment of the present disclosure;
[0019] Figure 4B is a schematic diagram of a fourth task to be performed according to an embodiment of the present disclosure;
[0020] Figure 5 is a schematic block diagram of a task execution device according to an embodiment of the present disclosure;
[0021] Figure 6 is a schematic block diagram of a task execution device according to another embodiment of the present disclosure;
[0022] Figure 7 is a block diagram of a task execution device according to an embodiment of the present disclosure; and
[0023] Figure 8 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
[0024] 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.
[0025] In the process of model inference, in order to make full use of the computing resources of the hardware, the deep learning inference framework can adjust the model at multiple levels. The model can correspond to the computational graph. At the computational graph level, quantization, operator fusion, layout transformation and other processing can be performed to make full use of the computing resources of the hardware. Quantization processing can reduce the computing resource overhead and storage resource overhead with limited loss of computing accuracy of the chip. Operator fusion can fuse multiple small operators with single functions into a large operator with complex functions and excellent performance to reduce data transmission between the global memory and the local memory, and also reduce the number of times the operator kernel is started. Layout transformation can make the data distribution of the model more optimized for the hardware and give full play to the performance of the hardware.
[0026] Some models may include operators such as convolution operators and matrix multiplication operators. After the convolution operator or matrix multiplication operator, a split operator and a concatenation operator may also be included. During the inference process, the chip may execute the task corresponding to the split operator or concatenation operator after executing the task corresponding to the convolution operator or matrix multiplication operator. In most cases, operator fusion processing will not be performed on the convolution operator and the split operator or concatenation operator, nor will operator fusion processing be performed on the matrix multiplication operator and the split operator or concatenation operator.
[0027] The splitting operator or concatenation operator mainly changes the address and data placement of data (such as tensors) in the storage unit, but does not perform actual calculations. It is a memory-bound operator. When the dimension of the split data is low or the dimension of the data used for concatenation is low, it is necessary to process data of smaller granularity, the number of data transfers is high, the bandwidth utilization is low, and the chip performance is low.
[0028] Therefore, in order to improve the performance of the chip, the present disclosure provides a task execution method, which will be described below.
[0029] Figure 1 is a flowchart of a task execution method according to an embodiment of the present disclosure.
[0030] like Figure 1 As shown, the method 100 may include operations S110 to S120.
[0031] In operation S110, in response to determining that the subsequent task of the first task to be executed in the task queue includes the first target task, initial constant data of the first task to be executed is split into multiple constant sub-data using at least one of the multiple computing units to obtain multiple second tasks to be executed.
[0032] In an embodiment of the present disclosure, a task queue may include multiple tasks to be executed. The multiple tasks to be executed may include multiple tasks to be executed sequentially and multiple tasks to be executed in parallel. The task queue may correspond to the above-mentioned computation graph, and the operators in the computation graph correspond to the tasks.
[0033] In the disclosed embodiment, the first target task can obtain multiple first target results according to the first execution result of the first task to be executed. For example, the task corresponding to the above convolution operator can be used as the first task to be executed. The task corresponding to the above split operator can be used as a first target task.
[0034] In the disclosed embodiment, the plurality of computing units may include a central processing unit (CPU) and an artificial intelligence processing unit. The artificial intelligence chip may be used as an artificial intelligence computing unit. The initial constant data may be split using the central processing unit, or the artificial intelligence computing unit.
[0035] In the embodiment of the present disclosure, the initial constant data may include weight data. The constant sub-data may be weight sub-data.
[0036] In operation S120 , a first target task subsequent to the first to-be-executed task is deleted from the task queue.
[0037] In the embodiment of the present disclosure, after obtaining a plurality of second tasks to be executed, the first target task may be deleted to reduce the tasks that need to be executed.
[0038] In the disclosed embodiment, the plurality of second tasks to be performed are performed by at least one of the plurality of computing units according to the plurality of constant sub-data. For example, the one or more second tasks to be performed may be performed by a central processing unit, or may be performed by an artificial intelligence computing unit.
[0039] In the embodiment of the present disclosure, the multiple second execution results of the multiple second tasks to be executed are multiple first target results. For example, the first target result can be obtained by executing the second tasks to be executed according to the constant subdata and the input data of the first tasks to be executed.
[0040] Through the disclosed embodiment, it is possible to determine whether there is a first target task after the task to be executed in the task queue. In the case of the first target task, the constant data of the first task to be executed before the first target task is split. Thus, the action to be executed by the first target task is transferred to the preprocessing stage of the constant data of the first task to be executed, and there is no need to execute the first target task again, which reduces the number of tasks that need to be executed by the computing unit, and helps to improve the task execution efficiency of the computing unit. In addition, by executing multiple second tasks to be executed according to multiple constant subdata, the same execution result as the original task queue can be obtained, and the accuracy of the computing unit can be effectively guaranteed. Thus, while improving the task execution efficiency of the computing unit, the high accuracy of the computing unit is maintained.
[0041] Through the embodiments of the present disclosure, when the first computing unit is used to perform operations S110 and S120 and the second computing unit is used to perform one or more second tasks to be performed, the number of tasks that the second computing unit needs to perform can be effectively reduced, which helps to improve the task execution efficiency of the computing unit. The first computing unit can be, for example, a central processing unit, and the second computing unit can be, for example, an artificial intelligence computing unit.
[0042] It should be noted that, in response to determining that the subsequent tasks of the first task to be executed in the task queue include the first target task, the initial constant data of the first task to be executed may be split first, and then operation S120 may be performed. However, the present disclosure is not limited thereto, and these two operations may also be performed in other orders, for example, the operation of splitting the initial constant data of the first task to be executed and operation S120 may be performed in parallel, or operation S120 may be performed first, and then the initial constant data of the first task to be executed may be split.
[0043] It can be understood that the method of the present disclosure is described above. The method of the present disclosure will be further described below by taking the input data of the first task to be performed being obtained according to the input image as an example.
[0044] Figure 2A is a schematic diagram of a task queue according to an embodiment of the present disclosure.
[0045] like Figure 2A As shown, the task queue may include a convolution task conv20 and a split task split20. The convolution task conv20 may be used as the first task to be executed. The split task split20 may be used as the first target task after the convolution task conv20. The convolution task conv20 and the split task split20 may be executed by the second computing unit.
[0046] In some embodiments, the initial constant data may be data of multiple dimensions. Figure 2AAs shown, the scale of the initial constant data w20 can be [Co, Ci, kh, kw]. The multiple dimensions of the initial constant data w20 can include an output channel dimension Co, an input channel dimension Ci, a height dimension kh, and a width dimension kw. Co is an integer greater than 1. Ci, kh, and kw are integers greater than or equal to 1, respectively.
[0047] In some embodiments, the input data of the first task to be performed may be data of multiple dimensions. Figure 2A As shown, the scale of the input data input20 can be [N, Ci, Hi, Wi]. The multiple dimensions of the input data input20 can include the sample number dimension N, the input channel dimension Ci, the input height dimension Hi and the input width dimension Wi. N, Ci, Hi, Wi are integers greater than or equal to 1 respectively.
[0048] like Figure 2A As shown, if the convolution task conv20 is performed according to the input data inpu20 and the initial constant data, the first execution result conv_out20 can be obtained. According to the first execution result conv_out20, the splitting task split20 can be performed to obtain the first target result out201 and the first target result out202. The scale of the first target result out201 can be [N, Co1, Ho, Wo]. The multiple dimensions of the first target result out201 can include the sample number dimension N, the output channel dimension Co1, the output height dimension Ho, and the output width dimension Wo. The scale of the first target result out202 can be [N, Co2, Ho, Wo]. The multiple dimensions of the first target result out202 can include the sample number dimension N, the output channel dimension Co2, the output height dimension Ho, and the output width dimension Wo. Co1, Co2, Ho, Wo are integers greater than or equal to 1 respectively. It can be understood that the number of first target results split out of the first execution result by the splitting task split20 is only an example, and the first execution result can also be split into 3 or more first target results.
[0049] In some embodiments, in some implementations of the above operation S110, using at least one of the multiple computing units to split the initial constant data of the first task to be executed into multiple constant sub-data, and obtaining multiple second tasks to be executed may include: using the first computing unit to split the initial constant data based on the output channel dimension to obtain multiple constant sub-data. For example, the first computing unit may be a central processing unit. In the case where the subsequent task of the convolution task conv20 includes the splitting task split20, based on the output channel dimension Co of the initial constant data w20, the initial constant data w20 can be split into two constant sub-data. The scales of the two constant sub-data are [Co1, Ci, kh, kw] and [Co2, Ci, kh, kw], respectively. The value Co of the output channel dimension of the initial constant data w20 may be, for example, the sum of the values of the output channel dimension of the two constant sub-data. That is, Co=Co1+Co2.
[0050] In some embodiments, in some implementations of the above operation S110, using at least one of the multiple computing units to split the initial constant data of the first task to be executed into multiple constant sub-data to obtain multiple second tasks to be executed may also include: obtaining multiple second tasks to be executed based on the multiple constant sub-data and the input data of the first task to be executed. For example, two second tasks to be executed can be determined based on the input data input20 and the above two constant sub-data.
[0051] In some embodiments, in some implementations of the above operation S120, the first target task after the first task to be executed can be deleted from the task queue. For example, the split task split20 can be deleted. Figure 2B and Figure 2C Provide explanation.
[0052] Figure 2B and Figure 2C is a schematic diagram of multiple second tasks to be performed according to an embodiment of the present disclosure.
[0053] like Figure 2B and Figure 2C As shown, convolution task conv201 and convolution task conv202 can be used as two second tasks to be executed.
[0054] In some embodiments, the plurality of second tasks to be performed are performed by at least one of the plurality of computing units according to the plurality of constant sub-data by the following operation: according to the input data of the first task to be performed and the plurality of constant sub-data, the plurality of second tasks to be performed are respectively performed by the second computing unit to obtain the plurality of first target results. Figure 2BAs shown, according to the input data input20 and the constant sub-data w201, the second computing unit can be used to perform the convolution task conv201 to obtain the first target result out201. Figure 2C As shown, according to the input data input20 and the constant sub-data w202, the second computing unit can be used to perform the convolution task conv202 to obtain the first target result out202. FIG. 2A to FIG. 2C As shown, the results obtained by executing convolution task conv201 and convolution task conv202 respectively are the same as the results obtained by executing convolution task conv20 and split task split20 in sequence. Therefore, splitting a task to be executed into multiple tasks to be executed can improve the parallelism of task execution. When the scale of constant subdata is smaller than the initial constant data, the computing resource overhead of executing multiple second tasks to be executed is almost the same as the computing resource overhead of executing the first task to be executed, and the computing resource overhead required for executing the first target task is saved, which can fully improve the task execution efficiency of the chip while ensuring the chip accuracy.
[0055] It can be understood that the above description uses the example that the input data is obtained based on the input image to explain the present disclosure. However, the present disclosure is not limited thereto, and the following description uses the example that the input data of the first task to be executed is obtained based on the input text to explain the present disclosure.
[0056] In some embodiments, when the input data is obtained according to input text, the first task to be performed may include a matrix multiplication task.
[0057] In some embodiments, the multiple dimensions of the initial constant data include a first dimension and a second dimension. For example, the initial constant data may be a K×N' weight matrix. The first dimension of the initial constant data may be K, and the second dimension may be N'. K may be an integer greater than or equal to 1, and N' may be an integer greater than 1.
[0058] In some embodiments, the multiple dimensions of the input data include a third dimension and a fourth dimension. For example, the input data may be obtained based on the input text. The input data may be an M×K matrix. The third dimension of the input data may be M, and the fourth dimension may be K. M may be an integer greater than or equal to 1.
[0059] In some embodiments, the value of the first dimension is the same as the value of the fourth dimension. As described above, the values of the first dimension and the fourth dimension are both K. For example, if a matrix multiplication task is performed based on the input data and the initial constant data, a product matrix can be obtained. The scale of the product matrix can be M×N'. If a splitting task is performed based on the product matrix, two first target results can be obtained. The scale of the first target result can be M×(N' / 2). It can be understood that splitting the product matrix into 2 first target results is only an example, and the product matrix can also be split into 3 or more first target results.
[0060] In some embodiments, in other implementations of the above operation S110, the initial constant data is split based on the second dimension using the first computing unit to obtain a plurality of constant sub-data. For example, the first computing unit may be the above central processing unit. The first task to be executed may be a matrix multiplication task. In the case where the subsequent task of the matrix multiplication task includes a splitting task, the initial constant data may be split based on the second dimension to obtain a plurality of constant sub-data. The constant sub-data may be a matrix of K×(N' / 2).
[0061] Next, the above operation S120 can be performed to delete the split task after the matrix multiplication task. Afterwards, based on the input data of size M×K and 2 constant subdata of size K×(N' / 2), the second computing unit can be used to perform 2 matrix multiplication tasks to obtain 2 first target results of size M×(N' / 2). These 2 matrix multiplication tasks can be used as 2 second tasks to be executed. Therefore, when the input data is obtained based on the input text, the task execution efficiency of the chip can be fully improved while ensuring the chip accuracy, while maintaining the computing resource overhead basically unchanged.
[0062] It is understood that the above description of the present disclosure is based on an example that the input data is obtained based on the input text. However, the present disclosure is not limited to this, and the input data can also be obtained based on the input audio. The processing method of the input audio is the same or similar to that of the input text or the input image, and the present disclosure will not be repeated here.
[0063] It can be understood that the above description uses the first task to be performed being a convolution task or a matrix multiplication task as an example to illustrate the present disclosure, but the present disclosure is not limited thereto, and the first task to be performed can be various types of tasks performed based on constant data.
[0064] It is understood that the above description uses the example that the first target task is a split task to explain the present disclosure. However, the present disclosure is not limited to this. The first target task can also be a slice task, a strider slice task, or other tasks that obtain multiple results from one result. It is also understood that other tasks can be included between the first task to be executed and the first target task.
[0065] It can be understood that the above description is based on the example that the task after the task to be performed includes the first target task, and the disclosure is described below by taking the example that the task after the task to be performed includes the second target task.
[0066] Figure 3 is a flowchart of a task execution method according to another embodiment of the present disclosure.
[0067] like Figure 3 As shown, the method 300 may include operations S310 to S320.
[0068] In operation S310, in response to determining that the subsequent tasks of each of the multiple third tasks to be executed in the task queue include the same second target task, at least one of the multiple computing units is used to merge the initial constant data of each of the multiple third tasks to be executed into constant data to be processed to obtain a fourth task to be executed.
[0069] In an embodiment of the present disclosure, a task queue may include multiple tasks to be executed. The multiple tasks to be executed may include multiple tasks to be executed sequentially and multiple tasks to be executed in parallel. The task queue may correspond to the above-mentioned computation graph, and the operators in the computation graph correspond to the tasks.
[0070] In the disclosed embodiment, the second target task is used to merge the third execution results of the plurality of third tasks to be executed into the second target result. For example, the task corresponding to the convolution operator can be used as the third task to be executed. The task corresponding to the concatenation operator can be used as a second target task.
[0071] In the embodiment of the present disclosure, the plurality of computing units may include a central processing unit and an artificial intelligence processing unit. The artificial intelligence chip may be used as an artificial intelligence computing unit. The central processing unit may be used to fuse a plurality of initial constant data, and the artificial intelligence computing unit may be used to fuse a plurality of initial constant data.
[0072] In the embodiment of the present disclosure, the initial constant data may include weight data. The constant data to be processed may also be referred to as constant fusion data.
[0073] In operation S320 , the second target task following the third to-be-performed task is deleted from the task queue.
[0074] In the embodiment of the present disclosure, after the fourth task to be executed is obtained, the second target task may be deleted to reduce the tasks that need to be executed.
[0075] In the embodiment of the present disclosure, the fourth task to be executed is executed by at least one of the plurality of computing units according to the constant data to be processed. For example, the fourth task to be executed may be executed by a central processing unit or by an artificial intelligence computing unit.
[0076] In the embodiment of the present disclosure, the execution result of the fourth task to be executed is the second target result. For example, the second target result can be obtained by executing the fourth task to be executed according to the constant data to be processed and the input data of the third task to be executed.
[0077] Through the disclosed embodiment, it is determined whether there is a second target task after the task to be executed in the task queue. In the case of the second target task, the constant data of the multiple third tasks to be executed before the second target task are fused. Thus, the action to be executed by the second target task is transferred to the preprocessing stage of the constant data of the third task to be executed, and there is no need to execute the second target task again, which reduces the number of tasks that need to be executed by the computing unit, and helps to improve the task execution efficiency of the computing unit. In addition, the fourth task to be executed is executed according to the fused constant data to be processed, and the same execution result as the original task queue can be obtained, which can effectively ensure the accuracy of the computing unit. Thus, while improving the task execution efficiency of the computing unit, the high accuracy of the computing unit is maintained.
[0078] Through the embodiments of the present disclosure, when the first computing unit is used to perform operations S310 and S320 and the second computing unit is used to perform the fourth task to be performed, the number of tasks that the second computing unit needs to perform can be effectively reduced, which helps to improve the task execution efficiency of the computing unit. The first computing unit can be, for example, a central processing unit, and the second computing unit can be, for example, an artificial intelligence computing unit.
[0079] It should be noted that, in response to determining that the subsequent tasks of each of the plurality of third tasks to be executed in the task queue include the same second target task, the initial constant data of each of the plurality of third tasks to be executed may be merged into the constant data to be processed, and then operation S320 may be performed. However, the present disclosure is not limited thereto, and the two groups of operations may also be performed in other orders, for example, the operation of merging the initial constant data of each of the plurality of third tasks to be executed into the constant data to be processed may be performed in parallel with operation S320, or operation S320 may be performed first, and then the initial constant data of each of the plurality of third tasks to be executed may be merged into the constant data to be processed.
[0080] It can be understood that the above is an explanation of the method of the present disclosure. The following will take the example that the input data of the third task to be performed is obtained according to the input image to further explain the method of the present disclosure.
[0081] Figure 4A is a schematic diagram of a task queue according to another embodiment of the present disclosure.
[0082] like Figure 4A As shown, the task queue may include convolution task conv411, convolution task conv412 and concatenation task concat40. Convolution task conv411 and convolution task conv412 may be used as two third tasks to be executed. Concatenation task concat40 may be used as the second target task after convolution task conv40. Convolution task conv411, convolution task conv412 and concatenation task concat40 may be executed by the above-mentioned second computing unit.
[0083] In some embodiments, the initial constant data may be data of multiple dimensions. Figure 4A As shown, the scale of the initial constant data w411 may be [Co1, Ci, kh, kw]. The multiple dimensions of the initial constant data w411 may include the output channel dimension Co1, the input channel dimension Ci, the height dimension kh, and the width dimension kw. The scale of the initial constant data w412 may be [Co2, Ci, kh, kw]. The multiple dimensions of the initial constant data w412 may include the output channel dimension Co2, the input channel dimension Ci, the height dimension kh, and the width dimension kw.
[0084] In some embodiments, the input data of the third task to be performed may be data of multiple dimensions. Figure 4A As shown, the scale of the input data input40 may be [N, Ci, Hi, Wi]. The multiple dimensions of the input data input40 may include a sample number dimension N, an input channel dimension Ci, an input height dimension Hi, and an input width dimension Wi.
[0085] like Figure 4AAs shown, if the convolution task conv411 is performed according to the input data inpu40 and the initial constant data w411, a third execution result conv_out411 can be obtained. If the convolution task conv412 is performed according to the input data inpu40 and the initial constant data w412, a third execution result conv_out412 can be obtained. According to the third execution result conv_out411 and the third execution result conv_out412, the concatenation task concat40 can be performed to obtain the second target result out41. The scale of the second target result out41 can be [N, Co, Ho, Wo]. The multiple dimensions of the second target result out41 may include the sample number dimension N, the output channel dimension Co, the output height dimension Ho, and the output width dimension Wo. It can be understood that the concatenation task concat40 is used to concatenate two third execution results into the second target result only as an example, and three or more third execution results can also be fused into the second target result.
[0086] In some embodiments, in some implementations of the above operation S310, using at least one of the multiple computing units to fuse the initial constant data of each of the multiple third tasks to be executed into the constant data to be processed, and obtaining the fourth task to be executed may include: using the first computing unit to fuse the multiple initial constant data based on the output channel dimension to obtain the constant data to be processed. For example, the first computing unit may be a central processing unit. In the case where the subsequent tasks of the convolution task conv411 and the convolution task conv412 each include the same concatenation task concat40, based on the output channel dimension Co1 of the initial constant data w411 and the output channel dimension Co2 of the initial constant data w412, the initial constant data w411 and the initial constant data w412 can be spliced into the constant data to be processed. The scale of the constant data to be processed is [Co, Ci, kh, kw]. The value Co of the output channel dimension of the constant data to be processed can be, for example, the sum of the values of the output channel dimensions of the two initial constant data. That is, Co=Co1+Co2.
[0087] In some embodiments, in some implementations of the above operation S310, using at least one of the plurality of computing units to fuse the initial constant data of the plurality of third tasks to be executed into the constant data to be processed, and obtaining the fourth task to be executed may also include: obtaining the fourth task to be executed according to the constant data to be processed and the input data of the third task to be executed. For example, the fourth task to be executed may be determined according to the input data input40 and the above constant data to be processed.
[0088] In some embodiments, in some implementations of the above operation S320, the second target task after the third task to be executed can be deleted from the task queue. For example, the concatenation task concat40 can be deleted. Figure 4B Provide explanation.
[0089] Figure 4B is a schematic diagram of a fourth task to be performed according to an embodiment of the present disclosure.
[0090] like Figure 4B As shown, the convolution task conv41 can be used as the fourth task to be performed.
[0091] In some embodiments, the fourth task to be executed is executed by using at least one of the plurality of computing units according to the plurality of constant data to be processed by the following operation: according to the input data of the third task to be executed and the constant data to be processed, the fourth task to be executed is executed by using the second computing unit to obtain the second target result. Figure 4B As shown, according to the input data input40 and the constant data to be processed w41, the second computing unit can be used to perform the convolution task conv41 to obtain the second target result out41. FIG. 4A to FIG. 4B As shown, the results obtained by executing convolution task conv411, convolution task conv412 and concatenation task concat40 are the same as the results obtained by executing convolution task conv41. Therefore, by merging multiple tasks to be executed into one task to be executed, the efficiency of task execution can be improved. When the scale of multiple initial constant data is basically the same as the scale of the constant data to be processed, the computing resource overhead of executing multiple third tasks to be executed is almost the same as the computing resource overhead of executing the fourth task to be executed, and the computing resource overhead required for executing the second target task is saved, which can fully improve the task execution efficiency of the chip while ensuring the chip accuracy.
[0092] It can be understood that the above description uses the example that the input data is obtained based on the input image to explain the present disclosure. However, the present disclosure is not limited thereto, and the following description uses the example that the input data of the third task to be performed is obtained based on the input text to explain the present disclosure.
[0093] In some embodiments, when the input data is obtained according to input text, the third task to be performed may include a matrix multiplication task.
[0094] In some embodiments, the multiple dimensions of the initial constant data include a first dimension and a second dimension. For example, the initial constant data may be a K×N′ weight matrix. The first dimension of the initial constant data may be K, and the second dimension may be N′.
[0095] In some embodiments, the multiple dimensions of the input data include a third dimension and a fourth dimension. For example, the input data may be obtained based on the input text. The input data may be an M×K matrix. The third dimension of the input data may be M, and the fourth dimension may be K.
[0096] In some embodiments, the value of the first dimension is the same as the value of the fourth dimension. As described above, the values of the first dimension and the fourth dimension are both K. For example, if multiple matrix multiplication tasks are performed based on input data and multiple initial constant data, multiple product matrices can be obtained. The scale of the product matrix can be M×N'. If a splicing task is performed based on multiple product matrices, a second target result can be obtained. The scale of the second target result can be M×2N'. It can be understood that splicing 2 product matrices into 1 second target result is only an example, and 3 or more product matrices can also be spliced into the second target result.
[0097] In some embodiments, in other implementations of the above operation S310, the first computing unit is used to fuse multiple initial constant data based on the second dimension to obtain constant data to be processed. For example, the first computing unit may be the above central processing unit. The third task to be executed may be a matrix multiplication task. In the case where the subsequent tasks of the multiple matrix multiplication tasks include the same splicing task, the multiple initial constant data may be fused based on the second dimension to obtain constant data to be processed. The constant data to be processed may be a matrix of K×2N'.
[0098] Next, the above operation S320 can be performed to delete the splicing task after the matrix multiplication task. Afterwards, according to the input data of size M×K and the constant data to be processed of size K×2N', the second computing unit can be used to perform the matrix multiplication task to obtain the second target result of size M×2N'. The matrix multiplication task can be the fourth task to be executed. Therefore, when the input data is obtained according to the input text, the task execution efficiency of the chip can be fully improved while ensuring the chip accuracy, while maintaining the computing resource overhead basically unchanged.
[0099] It is understood that the above description of the present disclosure is based on an example that the input data is obtained based on the input text. However, the present disclosure is not limited to this, and the input data can also be obtained based on the input audio. The processing method of the input audio is the same or similar to that of the input text or the input image, and the present disclosure will not be repeated here.
[0100] It can be understood that the third task to be performed is a convolution task or a matrix multiplication task, and the present disclosure is described above by taking the third task to be performed as an example, but the present disclosure is not limited thereto, and the third task to be performed can be various types of tasks performed based on constant data.
[0101] It is understood that the second target task is a splicing task as an example to illustrate the present disclosure. However, the present disclosure is not limited thereto, and the second target task may also be a chunk task or other tasks that obtain one result based on multiple results. It is also understood that other tasks may be included between the third task to be executed and the second target task.
[0102] It can be understood that the above describes the device of the present disclosure, and the following will describe the device of the present disclosure.
[0103] Figure 5 is a block diagram of a task execution device according to an embodiment of the present disclosure.
[0104] like Figure 5 As shown, the apparatus 500 may include a storage unit 510 and a plurality of computing units 520. At least one of the plurality of computing units 520 may be configured to execute the method 100 described above.
[0105] The storage unit 510 is configured to store the task queue and initial constant data of at least one task to be executed in the task queue.
[0106] At least one of the plurality of computing units 520 is configured to: in response to determining that a subsequent task of a first task to be executed in the task queue includes a first target task, split the initial constant data of the first task to be executed into a plurality of constant sub-data to obtain a plurality of second tasks to be executed. The first target task is used to obtain a plurality of first target results according to a first execution result of the first task to be executed. The first target task after the first task to be executed is deleted from the task queue.
[0107] In the embodiment of the present disclosure, the plurality of second tasks to be executed are executed according to a plurality of constant subdata using at least one of the plurality of computing units, and the plurality of second execution results of the plurality of second tasks to be executed are a plurality of first target results.
[0108] In some embodiments, the input data of the first task to be performed is obtained based on the input image, the multiple dimensions of the initial constant data include the output channel dimension, and the multiple computing units include the first computing unit. The first computing unit is configured to perform the following operations to split the initial constant data of the first task to be performed into multiple constant sub-data to obtain multiple second tasks to be performed: split the initial constant data based on the output channel dimension to obtain multiple constant sub-data. Based on the multiple constant sub-data and the input data of the first task to be performed, multiple second tasks to be performed are obtained.
[0109] In some embodiments, the input data of the first task to be executed is obtained based on the input text, the multiple dimensions of the initial constant data include a first dimension and a second dimension, the multiple dimensions of the input data include a third dimension and a fourth dimension, the value of the first dimension is the same as the value of the fourth dimension, and the multiple computing units include a first computing unit. The first computing unit is configured to perform the following operations to split the initial constant data of the first task to be executed into multiple constant sub-data to obtain multiple second tasks to be executed: the initial constant data is split based on the second dimension to obtain multiple constant sub-data. Based on the multiple constant sub-data and the input data of the first task to be executed, multiple second tasks to be executed are obtained.
[0110] Figure 6 is a block diagram of a task execution device according to another embodiment of the present disclosure.
[0111] like Figure 6 As shown, the apparatus 600 may include a storage unit 610 and a plurality of computing units 620. At least one of the plurality of computing units 620 may be configured to execute the method 300 described above.
[0112] The storage unit 610 is configured to store the task queue and initial constant data of each of the multiple tasks to be executed in the task queue.
[0113] At least one of the plurality of computing units 620 is configured to: in response to determining that the subsequent tasks of the plurality of third tasks to be executed in the task queue include the same second target task, fuse the initial constant data of the plurality of third tasks to be executed into the constant data to be processed, and obtain a fourth task to be executed. The second target task is used to fuse the third execution results of the plurality of third tasks to be executed into the second target result. The second target task after the third task to be executed is deleted from the task queue.
[0114] In the embodiment of the present disclosure, the fourth task to be executed is executed by using at least one of the plurality of computing units according to the constant data to be processed, and the execution result of the fourth task to be executed is the second target result.
[0115] In some embodiments, the input data of the third task to be performed is obtained based on the input image, the multiple dimensions of the initial constant data include the output channel dimension, and the multiple computing units include a first computing unit. The first computing unit is configured to perform the following operations to fuse the initial constant data of each of the multiple third tasks to be performed into the constant data to be processed, and obtain the fourth task to be performed: fuse the multiple initial constant data based on the output channel dimension to obtain the constant data to be processed. The fourth task to be performed is obtained based on the constant data to be processed and the input data of the third task to be performed.
[0116] In some embodiments, the input data of the first task to be executed is obtained based on the input text, the multiple dimensions of the initial constant data include a first dimension and a second dimension, the multiple dimensions of the input data include a third dimension and a fourth dimension, the number of the first dimension is the same as the number of the fourth dimension, and the multiple computing units include a first computing unit. The first computing unit is configured to perform the following operations to fuse the initial constant data of each of the multiple third tasks to be executed into the constant data to be processed, and obtain the fourth task to be executed: fuse the multiple initial constant data based on the second dimension to obtain the constant data to be processed. The fourth task to be executed is obtained based on the constant data to be processed and the input data of the third task to be executed.
[0117] It can be understood that the apparatus of the present disclosure is described above, and the equipment including the apparatus will be described below.
[0118] Figure 7 is a schematic block diagram of a task execution device according to an embodiment of the present disclosure.
[0119] like Figure 7 As shown, the device 7000 may include a task execution device 700. The task execution device 700 may be the device 500 or the device 600 described above.
[0120] 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.
[0121] 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.
[0122] Figure 8 A schematic block diagram of an example electronic device 800 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.
[0123] like Figure 8As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0124] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0125] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 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, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 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 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the task execution method described above may be executed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the task execution method in any other appropriate manner (eg, by means of firmware).
[0126] 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 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.
[0127] 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.
[0128] 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.
[0129] 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).
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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: In response to determining that a subsequent task of a first task to be executed in a task queue includes a first target task, using at least one of a plurality of computing units to split initial constant data of the first task to be executed into a plurality of constant sub-data to obtain a plurality of second tasks to be executed, wherein the first target task is used to obtain a plurality of first target results according to a first execution result of the first task to be executed; Deleting the first target task after the first to-be-executed task from the task queue; The plurality of second tasks to be executed are executed by using at least one of the plurality of computing units according to the plurality of constant sub-data, and the plurality of second execution results of the plurality of second tasks to be executed are the plurality of first target results.
2. The method according to claim 1, wherein: The input data of the first task to be performed is obtained according to an input image, the multiple dimensions of the initial constant data include an output channel dimension, the multiple computing units include a first computing unit, The step of using at least one of the plurality of computing units to split the initial constant data of the first task to be executed into a plurality of constant sub-data to obtain a plurality of second tasks to be executed comprises: Using the first computing unit to split the initial constant data based on the output channel dimension to obtain a plurality of constant sub-data; A plurality of the second tasks to be executed are obtained according to the plurality of the constant sub-data and the input data of the first task to be executed.
3. The method according to claim 1, wherein: The input data of the first task to be executed is obtained according to the input text, the multiple dimensions of the initial constant data include a first dimension and a second dimension, the multiple dimensions of the input data include a third dimension and a fourth dimension, the value of the first dimension is the same as the value of the fourth dimension, the multiple computing units include a first computing unit, The step of using at least one of the plurality of computing units to split the initial constant data of the first task to be executed into a plurality of constant sub-data to obtain a plurality of second tasks to be executed comprises: Using the first calculation unit to split the initial constant data based on the second dimension to obtain a plurality of constant sub-data; A plurality of the second tasks to be executed are obtained according to the plurality of the constant sub-data and the input data of the first task to be executed.
4. A task execution method, comprising: In response to determining that the subsequent tasks of the plurality of third tasks to be executed in the task queue include the same second target task, using at least one of the plurality of computing units to fuse the initial constant data of the plurality of third tasks to be executed into the constant data to be processed, to obtain a fourth task to be executed, wherein the second target task is used to fuse the third execution results of the plurality of third tasks to be executed into the second target result; Deleting the second target task after the third task to be executed from the task queue; The fourth task to be executed is executed by using at least one of a plurality of computing units according to the constant data to be processed, and the execution result of the fourth task to be executed is the second target result.
5. The method according to claim 4, wherein: The input data of the third task to be performed is obtained according to the input image, the multiple dimensions of the initial constant data include the output channel dimension, the multiple computing units include the first computing unit, The step of using at least one of the plurality of computing units to fuse the respective initial constant data of the plurality of third tasks to be executed into constant data to be processed to obtain the fourth task to be executed comprises: Using the first computing unit to fuse the plurality of initial constant data based on the output channel dimension to obtain the constant data to be processed; The fourth task to be executed is obtained according to the constant data to be processed and the input data of the third task to be executed.
6. The method according to claim 4, wherein: The input data of the first task to be executed is obtained according to the input text, the multiple dimensions of the initial constant data include a first dimension and a second dimension, the multiple dimensions of the input data include a third dimension and a fourth dimension, the number of the first dimension is the same as the number of the fourth dimension, the multiple computing units include a first computing unit, The step of using at least one of the plurality of computing units to fuse the respective initial constant data of the plurality of third tasks to be executed into constant data to be processed to obtain the fourth task to be executed comprises: Using the first computing unit to fuse the plurality of initial constant data based on the second dimension to obtain the constant data to be processed; The fourth task to be executed is obtained according to the constant data to be processed and the input data of the third task to be executed.
7. A task execution device, comprising: A storage unit configured to store a task queue and initial constant data of at least one task to be executed in the task queue; A plurality of computing units, wherein at least one of the plurality of computing units is configured as: In response to determining that a subsequent task of a first task to be executed in a task queue includes a first target task, initial constant data of the first task to be executed is split into a plurality of constant sub-data to obtain a plurality of second tasks to be executed, wherein the first target task is used to obtain a plurality of first target results according to a first execution result of the first task to be executed; Deleting the first target task after the first to-be-executed task from the task queue; The plurality of second tasks to be executed are executed by using at least one of the plurality of computing units according to the plurality of constant sub-data, and the plurality of second execution results of the plurality of second tasks to be executed are the plurality of first target results.
8. The device according to claim 7, wherein: The input data of the first task to be performed is obtained according to an input image, the multiple dimensions of the initial constant data include an output channel dimension, the multiple computing units include a first computing unit, The first computing unit is configured to perform the following operations to split the initial constant data of the first task to be executed into a plurality of constant sub-data to obtain a plurality of second tasks to be executed: Splitting the initial constant data based on the output channel dimension to obtain a plurality of constant sub-data; A plurality of the second tasks to be executed are obtained according to the plurality of the constant sub-data and the input data of the first task to be executed.
9. The device according to claim 7, wherein: The input data of the first task to be executed is obtained according to the input text, the multiple dimensions of the initial constant data include a first dimension and a second dimension, the multiple dimensions of the input data include a third dimension and a fourth dimension, the value of the first dimension is the same as the value of the fourth dimension, the multiple computing units include a first computing unit, The first computing unit is configured to perform the following operations to split the initial constant data of the first task to be executed into a plurality of constant sub-data to obtain a plurality of second tasks to be executed: Splitting the initial constant data based on the second dimension to obtain a plurality of constant sub-data; A plurality of the second tasks to be executed are obtained according to the plurality of the constant sub-data and the input data of the first task to be executed.
10. A task execution device, comprising: A storage unit configured to store a task queue and initial constant data of each of a plurality of tasks to be executed in the task queue; A plurality of computing units, wherein at least one of the plurality of computing units is configured as: In response to determining that the subsequent tasks of the plurality of third tasks to be executed in the task queue include the same second target task, initial constant data of the plurality of third tasks to be executed are merged into constant data to be processed to obtain a fourth task to be executed, wherein the second target task is used to merge the third execution results of the plurality of third tasks to be executed into the second target result; Deleting the second target task after the third task to be executed from the task queue; The fourth task to be executed is executed by using at least one of a plurality of computing units according to the constant data to be processed, and the execution result of the fourth task to be executed is the second target result.
11. The device according to claim 10, wherein: The input data of the third task to be performed is obtained according to the input image, the multiple dimensions of the initial constant data include the output channel dimension, the multiple computing units include the first computing unit, The first computing unit is configured to perform the following operations to merge the initial constant data of each of the plurality of third tasks to be executed into constant data to be processed, so as to obtain a fourth task to be executed: Fusing the plurality of initial constant data based on the output channel dimension to obtain the constant data to be processed; The fourth task to be executed is obtained according to the constant data to be processed and the input data of the third task to be executed.
12. The device according to claim 10, wherein: The input data of the first task to be executed is obtained according to the input text, the multiple dimensions of the initial constant data include a first dimension and a second dimension, the multiple dimensions of the input data include a third dimension and a fourth dimension, the number of the first dimension is the same as the number of the fourth dimension, the multiple computing units include a first computing unit, The first computing unit is configured to perform the following operations to merge the initial constant data of each of the plurality of third tasks to be executed into constant data to be processed, so as to obtain a fourth task to be executed: Based on the second dimension, a plurality of the initial constant data are merged to obtain the constant data to be processed; The fourth task to be executed is obtained according to the constant data to be processed and the input data of the third task to be executed.
13. A task execution device, comprising the apparatus as claimed in any one of claims 8 to 12.
14. 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 6.
15. 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 6.
16. 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 6.
Citation Information
Cited By
Model reasoning method applied to computing device, computing device, medium and program product
CN119902901A