Task processing method and device, electronic equipment and computer readable storage medium

By adjusting the large-scale neural network model into multiple sub-models, each sub-model adopts a different parameter adjustment method, and calling these sub-models for fusion processing when receiving the pending tasks, the high storage space and computing bandwidth requirements faced by large-scale neural network models in deployment and application is solved, and the accuracy of task processing is improved.

CN119718586APending Publication Date: 2025-03-28LYNXI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411958949.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Large-scale neural network models face high requirements for storage space and computing bandwidth in deployment and application, and the accuracy losses between different parameter adjustment methods affect each other, resulting in a decrease in the accuracy of task processing.

Method used

By adjusting the initial model into multiple sub-models, each sub-model adopts different preset adjustment methods (such as adjusting parameter sparseness, number of parameters or numerical accuracy), and when receiving the pending task, these sub-models are called to perform tasks separately, obtain the sub-processing results and perform fusion processing to obtain the final processing results.

Benefits of technology

It alleviates the mutual influence of accuracy losses between different parameter adjustment methods, improves the comprehensive accuracy of the target model, and thus improves the accuracy of task processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718586A_ABST
    Figure CN119718586A_ABST
Patent Text Reader

Abstract

The invention provides a task processing method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: calling a plurality of sub-models of a target model to execute a to-be-processed task under the condition that the to-be-processed task is received, and obtaining sub-processing results outputted by the plurality of sub-models; performing fusion processing on the sub-processing results of the plurality of sub-models to obtain a processing result of the to-be-processed task; wherein the sub-model is obtained by adjusting an initial model in a preset adjustment mode, and the preset adjustment mode comprises at least one of adjustment of the parameter sparseness of the initial model, adjustment of the parameter number of the initial model and adjustment of the numerical precision of the parameters of the initial model. The preset adjustment modes of the plurality of sub-models are different. According to the embodiment of the invention, the mutual influence of precision loss between different parameter adjustment modes can be relieved, and the task processing accuracy is improved.
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 a task processing method, device, electronic device, and computer-readable storage medium. Background Art

[0002] With the rapid development of neural network models, the number of parameters has also increased dramatically. Some models (such as large language models) have a huge number of parameters exceeding 100 billion, which brings huge challenges to deployment and application. At the same time, with the growing demand for privacy protection and timeliness, it has become necessary to deploy models locally on terminal devices such as mobile phones and laptops, which has put forward higher requirements for further reducing the storage space of the model and the transmission bandwidth during operation. Summary of the invention

[0003] The present disclosure provides a task processing method, device, electronic device and computer-readable storage medium.

[0004] In a first aspect, the present disclosure provides a task processing method, which includes: when receiving a task to be processed, calling multiple sub-models of a target model to respectively execute the task to be processed, and obtaining sub-processing results output by the multiple sub-models; fusing the sub-processing results of the multiple sub-models to obtain a processing result of the task to be processed; wherein the sub-model is obtained by adjusting the initial model in a preset adjustment manner, and the preset adjustment manner includes at least one of adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model, and adjusting the numerical accuracy of the parameters of the initial model, and the preset adjustment manners of the multiple sub-models are different.

[0005] In a second aspect, the present disclosure provides a task processing device, which includes: an execution module, which is used to call multiple sub-models of a target model to respectively execute the tasks to be processed when receiving a task to be processed, and obtain sub-processing results output by the multiple sub-models; a fusion module, which is used to fuse the sub-processing results of the multiple sub-models to obtain the processing result of the task to be processed; wherein the sub-model is obtained by adjusting the initial model in a preset adjustment method, and the preset adjustment method includes at least one of adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model, and adjusting the numerical accuracy of the parameters of the initial model, and the preset adjustment methods of the multiple sub-models are different.

[0006] In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can perform the above-mentioned task processing method.

[0007] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned task processing method when executed by a processor.

[0008] The embodiments provided by the present disclosure can use multiple sub-models obtained by adjusting the initial model in different parameter adjustment methods as the target model, and when receiving a task to be processed, call multiple sub-models of the target model to execute the task to be processed respectively, obtain sub-processing results output by the multiple sub-models, and then fuse the sub-processing results of the multiple sub-models to obtain the processing result of the task to be processed, thereby alleviating the mutual influence of the accuracy loss between different parameter adjustment methods, improving the comprehensive accuracy of the target model, and then improving the accuracy of task processing.

[0009] 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

[0010] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:

[0011] Figure 1 A flowchart of a task processing method provided by an embodiment of the present disclosure;

[0012] Figure 2 A schematic diagram of a task processing method provided by an embodiment of the present disclosure;

[0013] Figure 3 A schematic diagram of a task processing method provided by an embodiment of the present disclosure;

[0014] Figure 4 A schematic diagram of a task processing method provided by an embodiment of the present disclosure;

[0015] Figure 5A schematic diagram of a task processing method provided by an embodiment of the present disclosure;

[0016] Figure 6 A block diagram of a task processing device provided by an embodiment of the present disclosure;

[0017] Figure 7 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below 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, those of ordinary skill in the art should recognize that various changes and modifications can 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, the description of well-known functions and structures is omitted in the following description.

[0019] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0020] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0021] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.

[0022] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0023] Large models (LM), especially large language models (LLM) such as the third-generation generative pre-trained Transformer-3 (GPT-3) and general language models (GLM), have a huge number of parameters exceeding 100 billion, which brings huge challenges to deployment and application. At the same time, with the growing demand for privacy protection and timeliness, it has become necessary to deploy large language models locally on terminal devices such as mobile phones and laptops, which has put forward higher requirements for further reducing the storage space of large models and the transmission bandwidth during operation.

[0024] When using a large language model to perform reasoning tasks, the amount of computation required to generate each token is much smaller than the amount of data transmitted for the weight parameters. Therefore, compressing the total storage capacity of a large language model or the amount of data transmitted during operation can greatly increase the reasoning speed. Weight compression is usually used to compress the total storage capacity of a large language model or the amount of data transmitted during operation.

[0025] In the related technology, weight compression includes model quantization, dynamic sparsity, and reducing the number of parameters. Among them, model quantization refers to reducing the numerical precision of parameters. For example, the 32-bit floating point number (fp32) representation of the weight parameter is compressed into an 8-bit integer (int8) or a 4-bit integer (int4) or a lower bit width representation. Dynamic sparsity means that only a part of the parameters are loaded for calculation during the execution of the reasoning task. When the dynamic sparsity method is used, the loading (or abandonment) of parameters such as model weights is controlled by factors such as model input, and the selection of parameters for loading changes dynamically. For example, when performing matrix-vector multiplication, only the weight rows corresponding to the input dimension with the largest absolute value are loaded for calculation, which can reduce the amount of data transmission and calculation. Reducing the number of parameters means reducing the total number of parameters of the model, which can be achieved through knowledge distillation and other methods.

[0026] Since model quantization, dynamic sparsity, and parameter reduction all have mutual influence on accuracy loss, when a model is compressed using these three methods at the same time, the overall accuracy of the compressed model is severely reduced, thus affecting the accuracy of task processing.

[0027] In order to solve the above technical problems, an embodiment of the present disclosure provides a task processing method, which includes: when receiving a task to be processed, calling multiple sub-models of the target model to execute the task to be processed respectively, and obtaining sub-processing results output by the multiple sub-models; fusing the sub-processing results of the multiple sub-models to obtain the processing result of the task to be processed; wherein the sub-model is obtained by adjusting the initial model in a preset adjustment method, and the preset adjustment method includes adjusting at least one of the parameter sparsity of the initial model, adjusting the number of parameters of the initial model, and adjusting the numerical accuracy of the parameters of the initial model, and the preset adjustment methods of the multiple sub-models are different.

[0028] According to the task processing method of the embodiment of the present disclosure, multiple sub-models obtained by adjusting the initial model in different parameter adjustment methods are used as target models, and when a task to be processed is received, multiple sub-models of the target model are called to execute the task to be processed respectively, to obtain sub-processing results output by the multiple sub-models, and then the sub-processing results of the multiple sub-models are fused to obtain the processing result of the task to be processed, thereby alleviating the mutual influence of the precision loss between different parameter adjustment methods, improving the comprehensive precision of the target model, and then improving the accuracy of task processing.

[0029] The task processing method according to the embodiment of the present disclosure can be executed by an electronic device such as a terminal device or a server, and the terminal device can be a vehicle-mounted device, a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory. Alternatively, the method can be executed by a server.

[0030] Figure 1 A flowchart of a task processing method provided by an embodiment of the present disclosure. Figure 1 , the method comprising:

[0031] In step S11, when a task to be processed is received, multiple sub-models of the target model are called to respectively execute the task to be processed, and sub-processing results output by the multiple sub-models are obtained;

[0032] In step S12, the sub-processing results of the multiple sub-models are fused to obtain the processing result of the task to be processed; wherein the sub-model is obtained by adjusting the initial model in a preset adjustment method, and the preset adjustment method includes adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model and adjusting the numerical accuracy of the parameters of the initial model, and the preset adjustment methods of the multiple sub-models are different.

[0033] In some possible implementations, the initial model is used to indicate a large model with hundreds of billions of parameters, such as a large language model, a large visual model, a multimodal large model, etc. The present disclosure does not limit the specific type of the initial model. The initial model can be used to perform any of the graphics processing tasks, speech processing tasks, text processing tasks, and video processing tasks.

[0034] In some possible implementations, the target model includes multiple sub-models. The sub-models are obtained by adjusting the initial model in a preset adjustment manner, and the preset adjustment manners of the sub-models of the target model are different. The preset adjustment manner refers to a preset manner of adjusting the parameters of the initial model. The preset adjustment manner includes at least one of adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model, and adjusting the numerical precision of the parameters of the initial model.

[0035] Among them, adjusting the parameter sparsity of the initial model includes increasing the parameter sparsity of the initial model. The higher the parameter sparsity, the fewer the number of parameters activated when performing task processing; the lower the parameter sparsity, the more the number of parameters activated when performing task processing. Adjusting the parameter sparsity of the initial model can be achieved through dynamic sparse operations. Adjusting the number of parameters of the initial model includes reducing the number of parameters of the initial model, which can be achieved through a training method of model distillation, or through a model pruning operation (such as structured pruning, unstructured pruning, semi-structured pruning, etc.). Adjusting the numerical accuracy of the initial model includes reducing the numerical accuracy of the parameters of the initial model, which can be achieved through a model quantization operation.

[0036] For example, the target model includes five sub-models, namely sub-model A, sub-model B, sub-model C, sub-model D and sub-model E. The preset adjustment method of sub-model A includes adjusting the parameter sparsity of the initial model, and sub-model A can be obtained by dynamically sparsifying the initial model. The preset adjustment method of sub-model B includes adjusting the number of parameters of the initial model, and sub-model B can be obtained by performing structured pruning on the initial model. The preset adjustment method of sub-model C includes adjusting the number of parameters of the initial model and adjusting the numerical accuracy of the parameters of the initial model, and sub-model C can be obtained by performing semi-structured pruning and model quantization on the initial model. The preset adjustment method of sub-model D includes adjusting the numerical accuracy of the parameters of the initial model, and sub-model D can be obtained by performing model quantization on the initial model. The preset adjustment method of sub-model E includes adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model and adjusting the numerical accuracy of the parameters of the initial model, and sub-model E can be obtained by performing dynamic sparsification, pruning and model quantization on the initial model.

[0037] In some possible implementations, the target model is used to perform the same task processing as the initial model. The target model can be regarded as a model obtained by compressing the weight parameters of the initial model. From the perspective of storage space, the storage space occupied by storing the target model is smaller than the storage space occupied by storing the initial model. From the perspective of data transmission volume, the data transmission volume during the call of the target model to perform the task to be processed is smaller than the data transmission volume during the call of the initial model to perform the task to be processed. Therefore, the target model can be deployed locally on terminal devices such as mobile phones and laptops. Compared with the initial model, the target model can greatly increase the speed of task processing.

[0038] In some possible implementations, the task to be processed includes any one of an image processing task, a speech processing task, a text processing task, and a video processing task. When a task to be processed is received, step S11 may be executed to call multiple sub-models of the target model to respectively execute the task to be processed, and obtain sub-processing results output by the multiple sub-models. That is, when a task to be processed is received, the task to be processed may be respectively input into each sub-model of the target model for processing, and obtain sub-processing results output by the multiple sub-models.

[0039] For example, the target model includes five sub-models, namely sub-model A, sub-model B, sub-model C, sub-model D and sub-model E. When receiving the pending tasks, the five sub-models of the target model can be called to execute the pending tasks respectively, specifically: calling sub-model A to execute the pending tasks to obtain the sub-processing results output by sub-model A; calling sub-model B to execute the pending tasks to obtain the sub-processing results output by sub-model B; calling sub-model C to execute the pending tasks to obtain the sub-processing results output by sub-model C; calling sub-model D to execute the pending tasks to obtain the sub-processing results output by sub-model D; calling sub-model E to execute the pending tasks to obtain the sub-processing results output by sub-model E. Since the preset adjustment methods of each sub-model in the target model are different, sub-model A, sub-model B, sub-model C, sub-model D and sub-model E are all different, therefore, the sub-processing results output by sub-model A, the sub-processing results output by sub-model B, the sub-processing results output by sub-model C, the sub-processing results output by sub-model D and the sub-processing results output by sub-model E are all different.

[0040] In some possible implementations, in step S12, the sub-processing results of multiple sub-models may be fused to obtain the processing result of the task to be processed. The fusion processing of the sub-processing results of multiple sub-models may include at least one of adding the sub-processing results of multiple sub-models, taking the maximum value from the sub-processing results of multiple sub-models, taking the minimum value from the sub-processing results of multiple sub-models, and taking the median from the sub-processing results of multiple sub-models. Those skilled in the art may set the specific implementation of the fusion processing according to actual conditions, and the present disclosure does not limit this.

[0041] Figure 2 A schematic diagram of a task processing method provided by an embodiment of the present disclosure. Figure 2 , the target model 22 includes multiple sub-models, each of which is obtained by adjusting the initial model in a preset adjustment manner, and the preset adjustment manners of each sub-model are different. When receiving the task to be processed 21, multiple sub-models of the target model 22 are called to execute the task to be processed 21 respectively, and the sub-processing results output by the multiple sub-models are obtained; then the sub-processing results output by the multiple sub-models are fused 23 to obtain the processing result 24 of the task to be processed 21.

[0042] Figure 3 A schematic diagram of a task processing method provided by an embodiment of the present disclosure. Figure 3, the target model 32 includes N sub-models (N is a positive integer), namely the first sub-model 321, the second sub-model 322, ..., the Nth sub-model 323. Among them, the first sub-model 321 is obtained by adjusting the parameter sparsity of the initial model (for example, dynamically sparsifying the initial model), and its parameter sparsity is relatively high, and it can be regarded as a high-sparsity sub-model. The second sub-model 322 can be obtained by adjusting the number of parameters of the initial model, and its number of parameters is relatively small, and it can be regarded as a small-parameter sub-model. For example, the second sub-model 322 can be obtained by training the initial model by performing model distillation on the initial model, or it can also be trained by performing model pruning operations on the initial model. In the embodiments of this specification, the specific method of obtaining the second sub-model 322 is not specifically limited. The Nth sub-model 323 can be obtained by adjusting the numerical precision of the parameters of the initial model (for example, performing model quantization on the initial model), and the numerical precision of its parameters is relatively low, and it can be regarded as a low-precision sub-model.

[0043] When receiving the task to be processed 31, the N sub-models of the target model 32 are called to execute the task to be processed 31 respectively to obtain the sub-processing results output by these N sub-models; then the sub-processing results output by these N sub-models are fused 33 to obtain the processing result 34 of the task to be processed 31.

[0044] According to the task processing method of the embodiment of the present disclosure, multiple sub-models obtained by adjusting the initial model in different parameter adjustment methods are used as target models, and when a task to be processed is received, multiple sub-models of the target model are called to execute the task to be processed respectively, to obtain sub-processing results output by the multiple sub-models, and then the sub-processing results of the multiple sub-models are fused to obtain the processing result of the task to be processed, thereby alleviating the mutual influence of the precision loss between different parameter adjustment methods, improving the comprehensive precision of the target model, and then improving the accuracy of task processing.

[0045] The task processing method according to the embodiment of the present disclosure is described below.

[0046] In some possible implementations, the multiple sub-models of the target model include a first sub-model and a second sub-model, the preset adjustment method of the first sub-model includes adjusting the numerical precision of the parameters of the initial model, and the preset adjustment method of the second sub-model includes adjusting the number of parameters of the initial model; and the numerical precision of the parameters of the first sub-model is lower than the numerical precision of the parameters of the second sub-model, and the number of parameters of the first sub-model is greater than the number of parameters of the second sub-model;

[0047] The method also includes: processing the first sample task through the target model to obtain a processing result of the first sample task; determining a first loss based on the processing result of the first sample task and a processing result label corresponding to the first sample task; updating the parameters of the second sub-model based on the first loss; and obtaining a trained target model when a first training end condition is met.

[0048] The multiple sub-models of the target model include a first sub-model and a second sub-model. The preset adjustment method of the first sub-model includes adjusting the numerical precision of the parameters of the initial model. For example, the initial model may be quantized to obtain the first sub-model. The preset adjustment method of the second sub-model includes adjusting the number of parameters of the initial model. For example, the initial model may be pruned to obtain the second sub-model.

[0049] Since the preset adjustment method of the first sub-model includes adjusting the numerical precision of the parameters of the initial model, the numerical precision of the parameters of the first sub-model is lower than the numerical precision of the parameters of the initial model compared with the initial model, and the number of parameters of the first sub-model is the same as the number of parameters of the initial model. Since the preset adjustment method of the second sub-model includes adjusting the number of parameters of the initial model, the number of parameters of the second sub-model is less than the number of parameters of the initial model compared with the initial model, and the numerical precision of the parameters of the second sub-model is the same as the numerical precision of the parameters of the initial model. Thus, the numerical precision of the parameters of the first sub-model is lower than the numerical precision of the parameters of the second sub-model, and the number of parameters of the first sub-model is greater than the number of parameters of the second sub-model. The first sub-model can be regarded as a low-precision (low numerical precision of parameters) sub-model, and the second sub-model can be regarded as a high-precision and small-parameter (high numerical precision of parameters and small number of parameters) sub-model.

[0050] Since the first sub-model has a precision loss due to the reduced numerical precision of the parameters, when the sub-model of the target model includes the first sub-model and the second sub-model, the second sub-model can compensate for the precision of the first sub-model, thereby improving the precision of the target model. It should be noted that the compensation here is at the model level, which can compensate for the overall loss caused by the reduced numerical precision of the parameters, thereby reducing error accumulation.

[0051] In the case where the sub-model of the target model includes the first sub-model and the second sub-model, the target model can be trained to improve the accuracy of the task processing of the target model. The first sample task can be processed by the target model to obtain the processing result of the first sample task. For example, the first sub-model and the second sub-model of the target model can be called to execute the first sample task respectively to obtain the sub-processing results output by the first sub-model and the second sub-model; then the sub-processing results output by the first sub-model and the second sub-model are fused to obtain the processing result of the first sample task.

[0052] Then, according to the processing result of the first sample task and the processing result label corresponding to the first sample task, the first loss is determined, and according to the first loss, the parameters of the second sub-model are updated by back propagation or the like. When the first training end condition is met, the trained target model is obtained. The first training end condition may be, for example, any one of the training rounds reaching a preset round, the first loss converging within a preset interval, and the target model verification passing, etc. The present disclosure does not limit the specific content of the first training end condition.

[0053] Figure 4 A schematic diagram of a task processing method provided by an embodiment of the present disclosure. Figure 4 , the target model 42 includes two sub-models, a first sub-model 421 and a second sub-model 422. The first sub-model 421 is obtained by adjusting the numerical precision of the parameters of the initial model (for example, performing model quantization on the initial model), and the numerical precision of its parameters is low. The second sub-model 422 is obtained by adjusting the number of parameters of the initial model, and the number of its parameters is small. For example, it can be obtained by training the initial model by performing model distillation, or it can also be obtained by training the initial model by performing model pruning operation. In the embodiment of this specification, the specific method of obtaining the second sub-model is not specifically limited. The numerical precision of the parameters of the first sub-model 421 is lower than the numerical precision of the parameters of the second sub-model 422, and the number of parameters of the first sub-model 421 is greater than the number of parameters of the second sub-model 422. The first sub-model 421 can be regarded as a low-precision sub-model, and the second sub-model 422 can be regarded as a high-precision small-parameter sub-model. The second sub-model 422 can compensate for the accuracy of the first sub-model 421, thereby improving the accuracy of the target model 42.

[0054] When receiving the task to be processed 41, the first sub-model 421 and the second sub-model 422 of the target model 42 are called to execute the task to be processed 41 respectively, and the sub-processing results output by the first sub-model 421 and the second sub-model 422 are obtained; then the sub-processing results output by the first sub-model 421 and the second sub-model 422 are fused 43 to obtain the processing result 44 of the task to be processed 41.

[0055] In some possible implementations, the multiple sub-models of the target model include a third sub-model and a fourth sub-model, the preset adjustment method of the third sub-model includes adjusting the parameter sparsity of the initial model, and the preset adjustment method of the fourth sub-model includes adjusting the number of parameters of the initial model; and the parameter sparsity of the third sub-model is higher than the parameter sparsity of the fourth sub-model, and the number of parameters of the third sub-model is greater than the number of parameters of the fourth sub-model.

[0056] The method also includes: processing the second sample task through the target model to obtain a processing result of the second sample task; determining a second loss based on the processing result of the second sample task and a processing result label corresponding to the second sample task; updating the parameters of the fourth sub-model based on the second loss; and obtaining a trained target model when the second training end condition is met.

[0057] The multiple sub-models of the target model include a third sub-model and a fourth sub-model. The preset adjustment method of the third sub-model includes adjusting the parameter sparsity of the initial model. For example, the initial model may be dynamically sparse to obtain the third sub-model. The preset adjustment method of the fourth sub-model includes adjusting the number of parameters of the initial model. For example, the initial model may be pruned to obtain the fourth sub-model.

[0058] Since the preset adjustment method of the third sub-model includes adjusting the parameter sparsity of the initial model, the parameter sparsity of the third sub-model is higher than that of the initial model. Since the preset adjustment method of the fourth sub-model includes adjusting the number of parameters of the initial model, the number of parameters of the fourth sub-model is smaller than that of the initial model. Thus, the parameter sparsity of the third sub-model is higher than that of the fourth sub-model, and the number of parameters of the third sub-model is greater than that of the fourth sub-model. The third sub-model can be regarded as a high-sparsity sub-model, and the fourth sub-model can be regarded as a high-precision small-parameter sub-model.

[0059] Since the third sub-model has precision loss due to dynamic sparse processing, when the sub-models of the target model include the third sub-model and the fourth sub-model, the fourth sub-model can compensate for the precision of the first sub-model, thereby improving the precision of the target model. It should be noted that the compensation here is at the model level, which can compensate for the precision loss caused by dynamic sparse processing as a whole.

[0060] In the case where the sub-model of the target model includes the third sub-model and the fourth sub-model, the target model can be trained to improve the accuracy of the task processing of the target model. The second sample task can be processed by the target model to obtain the processing result of the second sample task. For example, the third sub-model and the fourth sub-model of the target model can be called to execute the second sample task respectively to obtain the sub-processing results output by the third sub-model and the fourth sub-model; then the sub-processing results output by the third sub-model and the fourth sub-model are fused to obtain the processing result of the second sample task.

[0061] Then, according to the processing result of the second sample task and the processing result label corresponding to the second sample task, the second loss is determined, and according to the second loss, the parameters of the fourth sub-model are updated by back propagation or the like. When the second training end condition is met, the trained target model is obtained. The second training end condition may be, for example, any one of the training rounds reaching a preset round, the second loss converging within a preset interval, and the target model verification passing, etc. The present disclosure does not limit the specific content of the second training end condition.

[0062] Figure 5 A schematic diagram of a task processing method provided by an embodiment of the present disclosure. Figure 5 , the target model 52 includes two sub-models, a third sub-model 521 and a fourth sub-model 522. The third sub-model 521 is obtained by adjusting the parameter sparsity of the initial model (for example, dynamically sparsifying the initial model), and its parameter sparsity is relatively high. The fourth sub-model 522 is obtained by adjusting the number of parameters of the initial model, and its number of parameters is reduced but the parameter accuracy is relatively high. For example, it can be obtained by training the initial model by performing model distillation, or it can also be obtained by training the initial model by performing model pruning operations. In the embodiments of this specification, the specific method of obtaining the fourth sub-model is not specifically limited. The parameter sparsity of the third sub-model 521 is higher than the parameter sparsity of the fourth sub-model 522, and the number of parameters of the third sub-model 521 is greater than the number of parameters of the fourth sub-model 522. The third sub-model 521 can be regarded as a high-sparseness sub-model, and the fourth sub-model 522 can be regarded as a high-precision small-parameter sub-model. The fourth sub-model 522 can compensate for the accuracy of the third sub-model 521, thereby improving the accuracy of the target model 52.

[0063] When receiving the task to be processed 51, the third sub-model 521 and the fourth sub-model 522 of the target model 52 are called to execute the task to be processed 51 respectively, and the sub-processing results output by the third sub-model 521 and the fourth sub-model 522 are obtained; then the sub-processing results output by the third sub-model 521 and the fourth sub-model 522 are fused 53 to obtain the processing result 54 of the task to be processed 51.

[0064] In some possible implementations, the multiple sub-models of the target model include a fifth sub-model, a sixth sub-model and a seventh sub-model, the preset adjustment method of the fifth sub-model includes adjusting the numerical precision of the parameters of the initial model, the preset adjustment method of the sixth sub-model includes adjusting the parameter sparsity of the initial model, and the preset adjustment method of the seventh sub-model includes adjusting the number of parameters of the initial model; and the parameter characteristics of the fifth sub-model, the sixth sub-model and the seventh sub-model are different, and the parameter characteristics include at least one of the number of parameters, the sparsity of parameters and the numerical precision of parameters.

[0065] The parameter characteristics of the sub-model of the target model include at least one of the number of parameters, parameter sparsity, and numerical precision of the parameters. Among them, the number of parameters can be divided into multiple levels according to the actual situation. For example, the number of parameter levels includes five levels: less than 100 million, 100 million to 1 billion, 1 billion to 10 billion, 10 billion to 100 billion, and more than 100 billion. The parameter sparsity can be divided into multiple sparsity levels according to the actual situation. For example, the sparsity level includes first-level sparsity, second-level sparsity, third-level sparsity, fourth-level sparsity, and fifth-level sparsity. Among them, the first-level sparsity level is the lowest, and the corresponding parameter sparsity is the lowest (which can be regarded as the original parameter sparsity without dynamic sparse processing); the fifth-level sparsity level is the highest, and the corresponding parameter sparsity is the highest. The numerical precision of the parameter can be divided into multiple levels of numerical precision according to the actual situation. For example, the numerical precision levels include level 1 numerical precision (e.g., parameters are represented by 4-bit integers), level 2 numerical precision (e.g., parameters are represented by 8-bit integers), level 3 numerical precision (e.g., parameters are represented by 16-bit floating-point numbers), and level 4 numerical precision (uncompressed original numerical precision, e.g., parameters are represented by 32-bit floating-point numbers). Among them, level 1 numerical precision is the lowest, and level 4 numerical precision is the highest. In this way, the number of parameters, parameter sparsity, and numerical precision of parameters are relatively continuously adjustable.

[0066] The multiple sub-models of the target model include a fifth sub-model, a sixth sub-model and a seventh sub-model. The preset adjustment method of the fifth sub-model may include adjusting the numerical precision of the parameters of the initial model. For example, the initial model is subjected to model quantization processing to obtain the fifth sub-model. Model quantization processing will reduce the numerical precision of the parameters. Therefore, compared with the initial model, the numerical precision of the parameters of the fifth sub-model is lower than the numerical precision of the parameters of the initial model, and the fifth sub-model can be regarded as a low-precision sub-model. The preset adjustment method of the sixth sub-model may include adjusting the parameter sparsity of the initial model. For example, the initial model is subjected to dynamic sparsification to obtain the sixth sub-model. Dynamic sparsification will increase the parameter sparsity. Therefore, compared with the initial model, the parameter sparsity of the sixth sub-model is higher than the parameter sparsity of the initial model, and the sixth sub-model can be regarded as a high-sparseness sub-model. The preset adjustment method of the seventh sub-model may include adjusting the number of parameters of the initial model. For example, it can be obtained by training the initial model by performing model distillation, or it can also be obtained by training the initial model by performing model pruning operation. In the embodiment of this specification, the specific method of obtaining the seventh sub-model is not specifically limited. The number of model parameters can be effectively reduced by performing model distillation training on the initial model or by performing model pruning on the initial model. Therefore, compared with the initial model, the number of parameters of the seventh sub-model is smaller than that of the initial model, and the seventh sub-model can be regarded as a small-parameter sub-model.

[0067] After obtaining the fifth sub-model, the sixth sub-model and the seventh sub-model, the parameter characteristics of the fifth sub-model, the sixth sub-model and the seventh sub-model can also be adjusted to make the parameter characteristics of the fifth sub-model, the sixth sub-model and the seventh sub-model different, thereby better alleviating the mutual influence of the accuracy loss of the fifth sub-model, the sixth sub-model and the seventh sub-model, and improving the accuracy of the target model.

[0068] For example, after adjusting the numerical precision of the parameters of the initial model, the numerical precision of the parameters of the fifth sub-model is level one numerical precision (for example, the parameters are represented by 4-bit integers), the parameter sparsity is level one sparsity, and the number of parameters is more than 100 billion; after adjusting the parameter sparsity of the initial model, the parameter sparsity of the sixth sub-model is level five sparsity, the numerical precision of the parameters is level four numerical precision, and the number of parameters is more than 100 billion; after adjusting the number of parameters of the initial model, the number of parameters of the seventh sub-model is less than 100 million, the parameter sparsity is level one sparsity, and the numerical precision of the parameters is level four numerical precision.

[0069] It can be seen from the above that some parameter characteristics are the same among the fifth sub-model, the sixth sub-model and the seventh sub-model. In order to improve the accuracy of the target model, the parameter characteristics of the fifth sub-model, the sixth sub-model and the seventh sub-model can be adjusted so that the parameter characteristics of the fifth sub-model, the sixth sub-model and the seventh sub-model are different. For example, the number of parameters of the fifth sub-model is adjusted to 1 billion to 10 billion; the numerical precision of the parameters of the sixth sub-model is adjusted to the third level of numerical precision; and the sparsity of the parameters of the seventh sub-model is adjusted to the third level of sparsity.

[0070] In some possible implementations, the step S11 includes: deploying multiple sub-models of the target model onto heterogeneous hardware respectively, running the multiple sub-models through the heterogeneous hardware to execute the tasks to be processed, and obtaining sub-processing results output by the multiple sub-models, wherein the heterogeneous hardware includes at least two of a central processing unit, a graphics processing unit, and a brain-like many-core chip.

[0071] The parameter characteristics of multiple sub-models of the target model are different, and the hardware suitable for running the sub-models is also different. According to the parameter characteristics of the sub-models, the multiple sub-models of the target model can be deployed on heterogeneous hardware respectively. Among them, the heterogeneous hardware may include at least two of the central processing unit (CPU), the graphics processing unit (GPU) and the brain-like many-core chip.

[0072] Multiple sub-models can be run through heterogeneous hardware to execute the tasks to be processed, and sub-processing results output by multiple sub-models can be obtained. When the sub-processing results of multiple sub-models are fused, the hardware for fusion processing can be selected according to the actual situation, such as using a CPU to perform fusion processing. This disclosure does not limit this.

[0073] In the embodiments of the present disclosure, multiple sub-models of the target model can be deployed on heterogeneous hardware respectively, and the multiple sub-models can be run through the heterogeneous hardware to execute the tasks to be processed, and sub-processing results output by the multiple sub-models can be obtained, so that the target model can be executed through the heterogeneous hardware, thereby improving the efficiency of task processing.

[0074] In some possible implementations, the multiple sub-models of the target model are deployed on heterogeneous hardware respectively, and the multiple sub-models are run through the heterogeneous hardware to execute the tasks to be processed, to obtain sub-processing results output by the multiple sub-models, including: deploying the fifth sub-model to the graphics processor, running the fifth sub-model through the graphics processor to execute the tasks to be processed, and outputting the sub-processing results of the fifth sub-model; deploying the sixth sub-model to the brain-like many-core chip, running the sixth sub-model through the brain-like many-core chip to execute the tasks to be processed, and outputting the sub-processing results of the sixth sub-model; deploying the seventh sub-model to the central processing unit, running the seventh sub-model through the central processing unit to execute the tasks to be processed, and outputting the sub-processing results of the seventh sub-model.

[0075] In the case where the target model includes the fifth sub-model, the sixth sub-model and the seventh sub-model, when the multiple sub-models of the target model are respectively deployed on heterogeneous hardware, since the preset adjustment method of the fifth sub-model includes adjusting the numerical precision of the parameters of the initial model, the fifth sub-model can be regarded as a low-precision sub-model, but the number of its parameters is large, and it can be deployed on a graphics processor suitable for performing parallel computing to improve the efficiency of the fifth sub-model in performing the task to be processed; since the preset adjustment method of the sixth sub-model includes adjusting the sparsity of the parameters of the initial model, the sixth sub-model can be regarded as a high-sparseness sub-model, and it can be deployed on a brain-like multi-core chip that optimizes sparsity to improve the efficiency of the sixth sub-model in performing the task to be processed; since the preset adjustment method of the seventh sub-model includes adjusting the number of parameters of the initial model, the seventh sub-model can be regarded as a small-parameter sub-model with a small number of parameters, and it can be deployed on a central processing unit to improve the efficiency of the seventh sub-model in performing the task to be processed.

[0076] After deploying the fifth sub-model, the sixth sub-model and the seventh sub-model according to the above method, the fifth sub-model can be run through the graphics processor to execute the task to be processed and output the sub-processing result of the fifth sub-model; the sixth sub-model can be run through the brain-like multi-core chip to execute the task to be processed and output the sub-processing result of the sixth sub-model; the seventh sub-model can be run through the central processing unit to execute the task to be processed and output the sub-processing result of the seventh sub-model.

[0077] In the embodiments of the present disclosure, the fifth sub-model obtained by adjusting the numerical precision of the parameters of the initial model can be deployed to a graphics processor, and the fifth sub-model is run by the graphics processor to perform the task to be processed, and the sub-processing result of the fifth sub-model is output; the sixth sub-model obtained by adjusting the parameter sparsity of the initial model is deployed to a brain-like multi-core chip, and the sixth sub-model is run by the brain-like multi-core chip to perform the task to be processed, and the sub-processing result of the sixth sub-model is output; the seventh sub-model obtained by adjusting the number of parameters of the initial model is deployed to a central processing unit, and the seventh sub-model is run by the central processing unit to perform the task to be processed, and the sub-processing result of the seventh sub-model is output. In this way, the sub-models obtained using different parameter adjustment methods can be deployed on suitable hardware, thereby improving the efficiency of each sub-model in performing the task to be processed.

[0078] In some possible implementations, the multiple sub-models of the target model include an eighth sub-model, and the eighth sub-model is obtained by training a preset model by taking the input of the initial model as the third sample task and the output of the initial model as the processing result label of the third sample task; the number of parameters of the preset model is less than the number of parameters of the initial model.

[0079] The multiple sub-models of the target sub-model may also include an eighth sub-model. The eighth sub-model is a model obtained by training the preset model based on the input and output of the initial model. The preset model and the initial model are used to perform the same task processing. The structure of the preset model may be similar to that of the initial model, or may be different from that of the initial model, and the present disclosure imposes restrictions on this. The number of parameters of the preset model is less than the number of parameters of the initial model (that is, the preset model can be regarded as a small parameter model), and further, the number of parameters of the eighth sub-model is less than the number of parameters of the initial model, and the eighth sub-model can be regarded as a small parameter sub-model.

[0080] When training the preset model, the input of the initial model can be used as the third sample task, and the output of the initial model can be used as the processing result label of the third sample task. Using this training method, the preset model can perform the same task processing as the initial model. After the training is completed, the trained preset model is used as the eighth sub-model.

[0081] In an embodiment of the present disclosure, multiple sub-models of the target model include an eighth sub-model, which is obtained by training a preset model by taking the input of the initial model as the third sample task and the output of the initial model as the processing result label of the third sample task. The number of parameters of the preset model is smaller than the number of parameters of the initial model, thereby being able to obtain a small parameter model in the target model through training.

[0082] It should be noted that, in addition to being obtained by adjusting the number of parameters of the initial model, the second sub-model and the fourth sub-model in the above embodiment can also be obtained in a manner similar to the eighth sub-model, that is, by training. Those skilled in the art can set the specific method for obtaining the second sub-model and the fourth sub-model according to actual conditions, and the present disclosure does not limit this.

[0083] According to the task processing method of the embodiment of the present disclosure, multiple sub-models obtained by adjusting the initial model in different parameter adjustment methods are used as target models, and when a task to be processed is received, multiple sub-models of the target model are called to execute the task to be processed respectively, to obtain sub-processing results output by the multiple sub-models, and then the sub-processing results of the multiple sub-models are fused to obtain the processing result of the task to be processed, thereby alleviating the mutual influence of the precision loss between different parameter adjustment methods, improving the comprehensive precision of the target model, and then improving the accuracy of task processing.

[0084] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.

[0085] In addition, the present disclosure also provides a task processing device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any task processing method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.

[0086] Figure 6 A block diagram of a task processing device provided in an embodiment of the present disclosure.

[0087] Reference Figure 6 , the embodiment of the present disclosure provides a task processing device, the task processing device 60 includes:

[0088] An execution module 61 is used for, when receiving a task to be processed, calling multiple sub-models of the target model to respectively execute the task to be processed, and obtaining sub-processing results output by the multiple sub-models;

[0089] A fusion module 62 is used to fuse the sub-processing results of the multiple sub-models to obtain the processing result of the task to be processed;

[0090] Among them, the sub-model is obtained by adjusting the initial model in a preset adjustment method, and the preset adjustment method includes at least one of adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model and adjusting the numerical accuracy of the parameters of the initial model, and the preset adjustment methods of multiple sub-models are different.

[0091] In some possible implementations, the multiple sub-models of the target model include a first sub-model and a second sub-model, the preset adjustment method of the first sub-model includes adjusting the numerical precision of the parameters of the initial model, and the preset adjustment method of the second sub-model includes adjusting the number of parameters of the initial model; and the numerical precision of the parameters of the first sub-model is lower than the numerical precision of the parameters of the second sub-model, and the number of parameters of the first sub-model is greater than the number of parameters of the second sub-model;

[0092] The device also includes: a first sample task execution module, used to execute the first sample task through the target model to obtain the processing result of the first sample task; a first loss determination module, used to determine the first loss according to the processing result of the first sample task and the processing result label corresponding to the first sample task; a first update module, used to update the parameters of the second sub-model according to the first loss; a first training end module, used to obtain the trained target model when the first training end condition is met.

[0093] In some possible implementations, the multiple sub-models of the target model include a third sub-model and a fourth sub-model, the preset adjustment method of the third sub-model includes adjusting the parameter sparsity of the initial model, and the preset adjustment method of the fourth sub-model includes adjusting the number of parameters of the initial model; and the parameter sparsity of the third sub-model is higher than the parameter sparsity of the fourth sub-model, and the number of parameters of the third sub-model is greater than the number of parameters of the fourth sub-model.

[0094] The device also includes: a second sample task execution module, which is used to execute the second sample task through the target model to obtain the processing result of the second sample task; a second loss determination module, which is used to determine the second loss according to the processing result of the second sample task and the processing result label corresponding to the second sample task; a second update module, which is used to update the parameters of the fourth sub-model according to the second loss; and a second training end module, which is used to obtain the trained target model when the second training end condition is met.

[0095] In some possible implementations, the multiple sub-models of the target model include a fifth sub-model, a sixth sub-model and a seventh sub-model, the preset adjustment method of the fifth sub-model includes adjusting the numerical precision of the parameters of the initial model, the preset adjustment method of the sixth sub-model includes adjusting the parameter sparsity of the initial model, and the preset adjustment method of the seventh sub-model includes adjusting the number of parameters of the initial model; and the parameter characteristics of the fifth sub-model, the sixth sub-model and the seventh sub-model are different, and the parameter characteristics include at least one of the number of parameters, the sparsity of parameters and the numerical precision of parameters.

[0096] In some possible implementations, the execution module 61 includes: a heterogeneous execution sub-module, which is used to deploy multiple sub-models of the target model on heterogeneous hardware respectively, run the multiple sub-models through the heterogeneous hardware to execute the tasks to be processed, and obtain sub-processing results output by the multiple sub-models, and the heterogeneous hardware includes at least two of a central processing unit, a graphics processing unit, and a brain-like many-core chip.

[0097] In some possible implementations, the heterogeneous execution submodule is used to: deploy the fifth sub-model to the graphics processor, run the fifth sub-model through the graphics processor to execute the task to be processed, and output the sub-processing result of the fifth sub-model; deploy the sixth sub-model to the brain-like many-core chip, run the sixth sub-model through the brain-like many-core chip to execute the task to be processed, and output the sub-processing result of the sixth sub-model; deploy the seventh sub-model to the central processing unit, run the seventh sub-model through the central processing unit to execute the task to be processed, and output the sub-processing result of the seventh sub-model.

[0098] In some possible implementations, the multiple sub-models of the target model include an eighth sub-model, and the eighth sub-model is obtained by training a preset model by taking the input of the initial model as the third sample task and the output of the initial model as the processing result label of the third sample task; the number of parameters of the preset model is less than the number of parameters of the initial model.

[0099] In some possible implementations, the storage space occupied by storing the target model is smaller than the storage space occupied by storing the initial model; and / or the amount of data transmitted during the call of the target model to execute the task to be processed is smaller than the amount of data transmitted during the call of the initial model to execute the task to be processed.

[0100] In some possible implementations, the task to be processed includes any one of an image processing task, a speech processing task, a text processing task, and a video processing task.

[0101] Figure 7 A block diagram of an electronic device provided in an embodiment of the present disclosure.

[0102] Reference Figure 7 An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 501; at least one memory 502, and one or more I / O interfaces 503, connected between the processor 501 and the memory 502; wherein the memory 502 stores one or more computer programs that can be executed by the at least one processor 501, and the one or more computer programs are executed by the at least one processor 501 so that the at least one processor 501 can perform the above-mentioned task processing method.

[0103] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned task processing method when executed by a processor. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.

[0104] The embodiment of the present disclosure also provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned task processing method.

[0105] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).

[0106] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.

[0107] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0108] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0109] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.

[0110] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0111] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0112] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0113] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0114] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A task processing method, characterized in that: include: When receiving a task to be processed, calling multiple sub-models of the target model to respectively execute the task to be processed, and obtaining sub-processing results output by the multiple sub-models; Performing fusion processing on the sub-processing results of the multiple sub-models to obtain the processing result of the task to be processed; Among them, the sub-model is obtained by adjusting the initial model in a preset adjustment method, and the preset adjustment method includes at least one of adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model and adjusting the numerical accuracy of the parameters of the initial model, and the preset adjustment methods of multiple sub-models are different.

2. The method according to claim 1, characterized in that The multiple sub-models of the target model include a first sub-model and a second sub-model, the preset adjustment method of the first sub-model includes adjusting the numerical precision of the parameters of the initial model, and the preset adjustment method of the second sub-model includes adjusting the number of parameters of the initial model; and, The numerical precision of the parameters of the first sub-model is lower than the numerical precision of the parameters of the second sub-model, and the number of parameters of the first sub-model is greater than the number of parameters of the second sub-model; The method further comprises: Executing a first sample task through the target model to obtain a processing result of the first sample task; Determining a first loss according to a processing result of the first sample task and a processing result label corresponding to the first sample task; According to the first loss, updating the parameters of the second sub-model; When the first training end condition is met, a trained target model is obtained.

3. The method according to claim 1, characterized in that The multiple sub-models of the target model include a third sub-model and a fourth sub-model, the preset adjustment method of the third sub-model includes adjusting the parameter sparsity of the initial model, and the preset adjustment method of the fourth sub-model includes adjusting the number of parameters of the initial model; and, The parameter sparsity of the third sub-model is higher than the parameter sparsity of the fourth sub-model, and the number of parameters of the third sub-model is greater than the number of parameters of the fourth sub-model, The method further comprises: executing a second sample task through the target model to obtain a processing result of the second sample task; Determining a second loss according to the processing result of the second sample task and the processing result label corresponding to the second sample task; According to the second loss, updating the parameters of the fourth sub-model; When the second training end condition is met, a trained target model is obtained.

4. The method according to claim 1, characterized in that: The multiple sub-models of the target model include a fifth sub-model, a sixth sub-model and a seventh sub-model, the preset adjustment method of the fifth sub-model includes adjusting the numerical precision of the parameters of the initial model, the preset adjustment method of the sixth sub-model includes adjusting the sparsity of the parameters of the initial model, and the preset adjustment method of the seventh sub-model includes adjusting the number of parameters of the initial model; and, The fifth sub-model, the sixth sub-model and the seventh sub-model have different parameter characteristics, and the parameter characteristics include at least one of the number of parameters, parameter sparsity, and numerical precision of parameters.

5. The method according to claim 4, characterized in that The calling of the multiple sub-models of the target model respectively executes the tasks to be processed, and obtains the sub-processing results output by the multiple sub-models, including: Deploy multiple sub-models of the target model onto heterogeneous hardware respectively, run the multiple sub-models through the heterogeneous hardware to execute the tasks to be processed, and obtain sub-processing results output by the multiple sub-models, wherein the heterogeneous hardware includes at least two of a central processing unit, a graphics processing unit, and a brain-like many-core chip.

6. The method according to claim 5, characterized in that in, The multiple sub-models of the target model are respectively deployed on heterogeneous hardware, and the multiple sub-models are run through the heterogeneous hardware to execute the tasks to be processed, and the sub-processing results output by the multiple sub-models are obtained, including: Deploying the fifth sub-model to the graphics processor, running the fifth sub-model through the graphics processor to execute the task to be processed, and outputting the sub-processing result of the fifth sub-model; Deploying the sixth sub-model to the brain-inspired many-core chip, running the sixth sub-model through the brain-inspired many-core chip to execute the task to be processed, and outputting a sub-processing result of the sixth sub-model; The seventh sub-model is deployed to the central processing unit, the seventh sub-model is run by the central processing unit to execute the task to be processed, and the sub-processing result of the seventh sub-model is output.

7. The method according to claim 1, characterized in that The multiple sub-models of the target model include an eighth sub-model, which is obtained by training a preset model by taking the input of the initial model as the third sample task and the output of the initial model as the processing result label of the third sample task; the number of parameters of the preset model is less than the number of parameters of the initial model.

8. The method according to claim 1, characterized in that The storage space occupied by storing the target model is smaller than the storage space occupied by storing the initial model; and / or, The amount of data transmitted during the period of calling the target model to execute the task to be processed is less than the amount of data transmitted during the period of calling the initial model to execute the task to be processed.

9. The method according to any one of claims 1 to 8, characterized in that: The task to be processed includes any one of an image processing task, a voice processing task, a text processing task, and a video processing task.

10. A task processing device, characterized in that: include: An execution module is used for, when receiving a task to be processed, calling multiple sub-models of the target model to respectively execute the task to be processed, and obtaining sub-processing results output by the multiple sub-models; A fusion module, used for fusing the sub-processing results of the multiple sub-models to obtain the processing result of the task to be processed; Among them, the sub-model is obtained by adjusting the initial model in a preset adjustment method, and the preset adjustment method includes at least one of adjusting the parameter sparsity of the initial model, adjusting the number of parameters of the initial model and adjusting the numerical accuracy of the parameters of the initial model, and the preset adjustment methods of multiple sub-models are different.

11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the task processing method according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the task processing method according to any one of claims 1 to 9.