Task processing method and device

By dynamically configuring the model weights of the processing unit in the multi-processing unit electronic device and synchronously executing tasks, the performance degradation caused by insufficient available computing resources of the processing unit is solved, and task processing efficiency and result accuracy are improved.

CN119396570APending Publication Date: 2025-02-07LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411391777.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In a multi-processing unit electronic device, the processing unit may degrade performance due to insufficient available computing resources when receiving a new task, thereby reducing task processing efficiency.

Method used

By obtaining the computing resource information of each processing unit, the model weights of each processing unit are configured to perform target processing tasks simultaneously. The method includes monitoring changes in computing power resources, updating model weights, and integrating the task processing results of each processing unit.

Benefits of technology

By dynamically adjusting the model weight of the processing unit, we ensure that each processing unit performs tasks according to its own computing resources, avoids performance degradation, improves task processing efficiency, and ensures the accuracy of target processing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396570A_ABST
    Figure CN119396570A_ABST
Patent Text Reader

Abstract

The invention discloses a task processing method and device, and the method comprises the steps: obtaining the computing power resource information of a plurality of processing units of electronic equipment in response to a target processing task; and configuring a first model weight of each processing unit based on the computing power resource information, so that the plurality of processing units synchronously execute the target processing task based on the respective first model weights.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task processing method and device. Background Art

[0002] At present, electronic devices can be equipped with multiple processing units, such as CPU (Central Processing Unit), NPU (Neural Processing Unit), GPU (Graphic Processing Unit), etc. There is a method of using multiple processing units to perform model inference to perform task processing. In this method, each processing unit allocates fixed computing resources to participate in model reasoning. However, when the processing unit receives a new task, the performance may be degraded due to insufficient available computing resources, thereby reducing the task processing efficiency. Summary of the invention

[0003] An embodiment of the present application provides a task processing method, including: in response to obtaining a target processing task, obtaining computing power resource information of multiple processing units of an electronic device; configuring a first model weight of each processing unit based on the computing power resource information, so that the multiple processing units synchronously execute the target processing task based on their respective first model weights.

[0004] In some embodiments, it also includes at least one of the following: monitoring the computing power resource change information of each processing unit, and updating the first model weight configured for each processing unit based on the computing power resource change information, so that the multiple processing units perform the target processing task based on the updated second model weight; integrating the task processing results of each processing unit to obtain the target processing result.

[0005] In some embodiments, obtaining computing power resource information of multiple processing units of an electronic device includes: obtaining hardware configuration information of the electronic device, and determining the priority of each processing unit of the electronic device based on the hardware configuration information; determining the remaining available computing power resources of each processing unit based on the current usage of each processing unit in turn based on the priority or based on the priority and the assembly probability of each processing unit.

[0006] In some embodiments, the first model weight of each processing unit is configured based on the computing power resource information, including: calculating the proportion information of each processing unit in the available computing power resources of the electronic device based on the remaining available computing power resources of each processing unit; configuring the model weight of the target processing model corresponding to the target processing task based on the proportion information to obtain the first model weight of each processing unit.

[0007] In some embodiments, the model weight of the target processing model corresponding to the target processing task is configured based on the proportion information, including: obtaining target reference information; adjusting the proportion information based on the target reference information to configure the model weight of the target processing model using the adjusted proportion information; or, adjusting the initial model weights of each processing unit determined based on the proportion information based on the target reference information to obtain the first model weights of each processing unit.

[0008] In some embodiments, the model weight of the target processing model corresponding to the target processing task is configured based on the proportion information, including at least one of the following: obtaining the priority information of each processing unit, and configuring the model weight of the target processing model based on the priority information and the proportion information; obtaining the target task information of the target processing task, and configuring the model weight of the target processing model based on the target task information and the proportion information; obtaining the current task information of each processing unit, and configuring the model weight of the target processing model based on the current task information and the proportion information.

[0009] In some embodiments, the multiple processing units synchronously execute the target processing task based on their respective first model weights, including: configuring each processing unit to run a sub-processing model loaded into their respective operating space, the sub-processing model being obtained by splitting the target processing model corresponding to the target processing task based on their respective first model weights; splitting the target processing task into multiple sub-processing tasks based on the first model weights of each processing unit; configuring the multiple processing units to perform processing operations on the corresponding sub-processing tasks based on their respective running sub-processing models, to obtain multiple sub-processing results.

[0010] In some embodiments, the task processing results of the various processing units are integrated and processed, including: obtaining target task information of the target processing task and / or current task information of each processing unit; determining a processing strategy for multiple sub-processing results obtained by performing corresponding processing operations on each processing unit based on the target task information and / or the current task information; and integrating the multiple sub-processing results based on the determined processing strategy to obtain a target processing result.

[0011] In some embodiments, it also includes: in response to obtaining communication connection change information between the electronic device and the target processing device, updating the model weights configured for each processing unit based on the communication connection change information, so that the electronic device and the multiple processing units of the target processing device perform the target processing task based on their respective configured model weights.

[0012] An embodiment of the present application also proposes a task processing device, including: an acquisition module, used to obtain computing power resource information of multiple processing units of an electronic device in response to obtaining a target processing task; a configuration module, used to configure the first model weight of each processing unit based on the computing power resource information, so that the multiple processing units synchronously execute the target processing task based on their respective first model weights.

[0013] An embodiment of the present application further proposes an electronic device, including a processor and a memory, wherein the memory stores an executable program, and the processor executes the executable program to perform the task processing method as described above.

[0014] The embodiment of the present application further proposes a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the task processing method described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0016] Figure 1 A flowchart of a task processing method according to an embodiment of the present application;

[0017] Figure 2 A flowchart of obtaining computing resource information of multiple processing units of an electronic device according to an embodiment of the present application;

[0018] Figure 3 A flowchart of configuring the first model weight of each processing unit based on computing power resource information in an embodiment of the present application;

[0019] Figure 4 A flowchart of configuring the model weight of the target processing model corresponding to the target processing task based on the proportion information in an embodiment of the present application;

[0020] Figure 5 A flowchart of configuring the model weight of the target processing model corresponding to the target processing task based on the proportion information according to another embodiment of the present application;

[0021] Figure 6 A flowchart of a plurality of processing units according to an embodiment of the present application synchronously executing a target processing task based on respective first model weights;

[0022] Figure 7A flowchart of integrating the task processing results of each processing unit according to an embodiment of the present application;

[0023] Figure 8 A flowchart of determining a priority list according to an embodiment of the present application;

[0024] Fig. 9 A flowchart of a task processing method according to another embodiment of the present application;

[0025] Fig.10 A schematic diagram of the principle of multiple processing units synchronously executing target processing tasks according to an embodiment of the present application;

[0026] Fig.11 This is a structural block diagram of a task processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] Various aspects and features of the present application are described herein with reference to the accompanying drawings.

[0028] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.

[0029] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0030] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.

[0031] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.

[0032] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.

[0033] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.

[0034] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.

[0035] A task processing method in an embodiment of the present application configures the first model weight of each processing unit based on the computing power resource information of multiple processing units in an electronic device, so that the multiple processing units synchronously execute the target processing task based on their respective first model weights, thereby enabling each processing unit to execute the target processing task according to its own computing power resources, avoiding performance degradation of the processing unit and improving task processing efficiency.

[0036] like Figure 1 As shown, the task processing method includes the following steps:

[0037] Step S101, in response to obtaining a target processing task, obtaining computing power resource information of multiple processing units of an electronic device.

[0038] In this embodiment, the target processing task may be any task triggered by any application, such as an image generation task triggered by an image generation application, a video generation task triggered by a video generation application, an image processing task, a model training task, an image rendering task, etc. triggered by an image processing application. The electronic device is provided with a plurality of processing units, and the computing power resource information of the plurality of processing units may be obtained according to a computing power measurement index, and an example of the computing power measurement index may include any one of TOPS (Tera Operations Per Second, trillion operations per second), FLOPS (Floating Point Operations Per Second, floating point operations per second), MIPS (Million Instructions Per Second, average execution speed of single-word fixed-point instructions), etc.

[0039] The processing unit may include at least one of a CPU, a GPU, a TPU (tensor processing unit), an NPU, an APU (Accelerated Processing Unit), and the like.

[0040] After obtaining the target processing task, the computing power resources of each processing unit can be obtained first, and the total computing power resources can be determined based on the sum of each computing power resource. The computing power resource information can be determined based on each computing power resource and the total computing power resource.

[0041] For example, if each processing unit is a CPU, a GPU, and a TPU, the computing power resource information of the multiple processing units can be determined by determining the TOPS of the CPU, GPU, and TPU respectively, and according to the TOPS of the CPU, GPU, and TPU and the total TOPS.

[0042] Step S102: configure the first model weight of each processing unit based on the computing power resource information, so that the multiple processing units synchronously execute the target processing task based on their respective first model weights.

[0043] In this embodiment, each processing unit is used to perform model reasoning to achieve synchronous execution of the target processing task. The processing model corresponding to the target processing task can be configured to each processing unit based on the weight of each first model, so that each processing unit executes the target processing task.

[0044] The computing power resource information may include the total computing power resources of the electronic device and the computing power resources of each processing unit. The first model weight of each processing unit can be configured only based on the proportion of the computing power resources of each processing unit in the total computing power resources of the electronic device; in other embodiments, the task type of the target processing task may also be considered. For example, more first model weights may be configured for processing units that are more suitable for processing this task type so that the task can be executed more efficiently. Specifically, if the task type of the target processing task is image processing, more first model weights may be configured for the GPU. If the task type of the target processing task is model training, more first model weights may be configured for the NPU. Alternatively, the task information currently executed by each processing unit may also be considered. The task information may include the execution completion of the current task, and which processing unit can be configured with more first model weights is determined based on the execution completion. For example, more first model weights are assigned to processing units with high execution completion, and the processing unit can quickly execute the target processing task after completing the current task.

[0045] The target processing task can be divided into multiple subtasks based on the first model weight, and each processing unit executes each subtask to achieve synchronous execution of the target processing task.

[0046] The task processing method of the embodiment of the present application obtains computing power resource information of multiple processing units of the electronic device in response to obtaining the target processing task; configures the first model weight of each processing unit based on the computing power resource information, so that the multiple processing units synchronously execute the target processing task based on their respective first model weights. Thus, each processing unit can execute the target processing task according to its own computing power resources, avoiding the performance degradation of the processing unit and improving the task processing efficiency.

[0047] In some embodiments of the present application, at least one of the following is also included:

[0048] Monitoring computing power resource change information of each processing unit, and updating the first model weight configured for each processing unit based on the computing power resource change information, so that the multiple processing units perform the target processing task based on the updated second model weight;

[0049] The task processing results of the various processing units are integrated to obtain the target processing result.

[0050] In this embodiment, since the executed tasks may change, such as the completion of the current task or the receipt of a new task, the remaining computing power resources of each processing unit may change. The computing power resource change information of each processing unit can be monitored in real time or periodically (such as 2 seconds or 1 minute, etc.). The computing power resource change information includes the change of the total computing power resources and the change of the computing power resources corresponding to each processing unit. When the total computing power resources remain unchanged, the computing power resources corresponding to each processing unit may also change. According to the computing power resource change information, the model weight allocation ratio of each processing unit is reconfigured, and the first model weight is updated. After that, the updated second model weight can be used to assign new subtasks to each processing unit, so that each processing unit can synchronously execute the target processing task.

[0051] After multiple processing units synchronously execute the target processing tasks based on their respective first model weights, the task processing results of each processing unit are obtained, and the task processing results of each processing unit are integrated to obtain the target processing result. For example, if the target processing task is a task of generating an image, the task processing results of each processing unit may be each layer of the image, and each layer is spliced ​​or fused to obtain the target image. If the target processing task is a video generation task, the task processing results of each processing unit may be each image frame of the video, and each image frame is spliced ​​or fused to obtain the target video. If the target processing task is a text generation task, the task processing results of each processing unit may be each text, and each text is fused to obtain the target text.

[0052] The weight of the first model is updated by the change of the computing resources of each processing unit, so as to flexibly adjust the amount of tasks executed by the processing unit, so that the processing unit can maintain good operating performance and improve the task processing efficiency. The accuracy of the target processing results is guaranteed by integrating the task processing results of each processing unit.

[0053] In some embodiments of the present application, computing resource information of multiple processing units of an electronic device is obtained, such as Figure 2 As shown, the following steps are included:

[0054] Step S1011: Obtain hardware configuration information of the electronic device, and determine the priority of each processing unit of the electronic device based on the hardware configuration information.

[0055] In this embodiment, the hardware configuration information may include the number of processing units in the electronic device, the type of processing unit, power configuration information, heat dissipation module configuration information, etc., and the hardware configuration information can be obtained according to the reported information of each hardware when the boot program (such as BIOS) of the electronic device is initialized. The priority of each processing unit is determined based on the hardware configuration information. For example, the hardware configuration information includes the TOPS of the processing unit, and the priority of each processing unit is determined according to the TOPS of the processing unit. In the specific application scenario of this application, an initial priority List table can be established, as shown in Table 1.

[0056] Table 1

[0057]

[0058]

[0059] In Table 1, the processing units include dGPU, NPU, iGPU and CPU, 0 has the highest priority and 3 has the lowest priority, and the higher the priority, the stronger the processing capability.

[0060] Step S1012: determining the remaining available computing resources of each processing unit based on the priority or based on the priority and the assembly probability of each processing unit and based on the current usage of each processing unit.

[0061] In this embodiment, each processing unit has a corresponding storage space. The higher the load of the processing unit, the smaller its remaining storage space. The current usage of each processing unit may include the current load of the processing unit, whether the processing unit is assembled, etc. The remaining storage space of each processing unit can be determined in turn based on the priority of each processing unit and the current usage of each processing unit, thereby determining the remaining available computing power resources of each processing unit. The probability of assembly of each processing unit can also be considered. For example, the probability of assembly of the CPU is the highest, followed by the probability of assembly of the iGPU, followed by the probability of assembly of the NPU, etc. The remaining storage space of each processing unit is determined based on the priority and the probability of assembly of each processing unit, as well as the current usage of each processing unit, thereby determining the remaining available computing power resources of each processing unit.

[0062] The remaining available computing power resources of each processing unit are determined by the priority or priority and assembly probability of each processing unit, as well as the current usage of the processing unit, so that the computing power resource information conforms to the actual situation of each processing unit, thereby improving the accuracy of the computing power resource information.

[0063] In some embodiments of the present application, the first model weight of each processing unit is configured based on the computing power resource information, such as Figure 3 As shown, the following steps are included:

[0064] Step S1021, based on the remaining available computing resources of each processing unit, calculate the proportion of each processing unit in the available computing resources of the electronic device.

[0065] In this embodiment, the available computing power resources of the electronic device can be determined by the remaining available computing power resources of each processing unit, and the corresponding proportion information is determined according to the proportion of the remaining available computing power resources of each processing unit to the available computing power resources of the electronic device.

[0066] Step S1022: configuring the model weight of the target processing model corresponding to the target processing task based on the proportion information to obtain the first model weight of each processing unit.

[0067] The target processing model can be, for example, a neural network model, a large model, etc., and the target processing model can be split based on the proportion information, that is, the model weight of the target processing model is configured, and the target processing model is split into sub-models that can be loaded into each processing unit, so as to process the corresponding sub-tasks of the target processing task through the sub-models running on each processing unit.

[0068] The model weight of the target processing model corresponding to the target processing task is configured through the proportion information to obtain the first model weight of each processing unit, thereby accurately determining the first model weight of each processing unit.

[0069] In some embodiments of the present application, the model weight of the target processing model corresponding to the target processing task is configured based on the proportion information, such as Figure 4 As shown, the following steps are included:

[0070] Step S10221, obtain target reference information.

[0071] In this embodiment, the target reference information may be reference information related to the target processing task or reference information related to the processing unit. For example, the target reference information may be the task type, task completion level, and task update information of the task currently processed by each processing unit of the electronic device, or the current heat dissipation condition and power supply information of the electronic device, or the spatial environment information of the current location of the electronic device, or the communication connection information with other processing devices, etc.

[0072] Step S10222: adjusting the proportion information based on the target reference information, so as to configure the model weight of the target processing model using the adjusted proportion information.

[0073] First, the proportion information is adjusted based on the target reference information to make the proportion information more consistent with the actual situation of the target processing task or processing unit, and then the target processing model is split using the adjusted proportion information to obtain the first model weight of each processing unit, thereby further improving the accuracy of each first model weight.

[0074] In some embodiments of the present application, as an alternative, the model weight of the target processing model corresponding to the target processing task is configured based on the proportion information, such as Figure 5 As shown, the following steps are included:

[0075] Step S10221, obtain target reference information.

[0076] In this embodiment, the target reference information may be reference information related to the target processing task, or may be reference information related to the processing unit.

[0077] Step S10223, based on the target reference information, the initial model weights of the processing units determined based on the proportion information are adjusted to obtain the first model weights of the processing units.

[0078] In this embodiment, the target processing model is first split based on the proportion information to determine the initial model weights of each processing unit, and then the initial model weights are adjusted based on the target reference information to obtain the first model weights of each processing unit, so that the first model weights are more in line with the actual situation of the target processing task or processing unit, thereby further improving the accuracy of each first model weight.

[0079] In some embodiments of the present application, configuring the model weight of the target processing model corresponding to the target processing task based on the proportion information includes at least one of the following:

[0080] Obtaining priority information of each processing unit, and configuring a model weight of the target processing model based on the priority information and the proportion information;

[0081] Obtaining target task information of the target processing task, and configuring a model weight of the target processing model based on the target task information and the proportion information;

[0082] The current task information of each processing unit is obtained, and the model weight of the target processing model is configured based on the current task information and the proportion information.

[0083] In this embodiment, the target reference information may be the priority information of each processing unit, and the priority information is determined by the hardware configuration information of the electronic device. The proportion information may be adjusted based on the priority information, and then the target processing model may be split based on the adjusted proportion information to determine the first model weight of each processing unit; the target processing model may also be split based on the proportion information to determine the initial model weight of each processing unit, and then the initial model weight may be adjusted based on the priority information of each processing unit to obtain the first model weight, thereby further improving the accuracy of the first model weight. For example, if the priority of the iGPU is higher, the proportion information corresponding to the iGPU may be increased first, and then the first model weight of the iGPU may be determined based on the increased proportion information, so that more processing tasks may be configured for the iGPU with a higher priority. An initial model weight may also be determined first through the proportion information of the iGPU, and then the initial model weight may be increased according to the priority of the iGPU, so that more processing tasks may be configured for the iGPU with a higher priority.

[0084] The target reference information may also be the target task information of the target processing task, which may include one or more of the task type, task priority, task urgency, and task requirement information of the target task. The task type determines which processing unit is more suitable, and the task priority and task urgency determine which processing units need to undertake more processing tasks. The task requirement information may, for example, specify a specific processing unit to perform task processing. The proportion information may be adjusted based on the target task information, and then the target processing model may be split based on the adjusted proportion information to determine the first model weight of each processing unit; the target processing model may also be split based on the proportion information to determine the initial model weight of each processing unit, and then the initial model weight may be adjusted based on the target task information of each processing unit to obtain the first model weight, thereby further improving the accuracy of the first model weight.

[0085] For example, if the task type of the target processing task belongs to an image processing task, and the GPU is more suitable for processing images, the GPU can be made to take on more processing tasks by adjusting the proportion information or adjusting the initial model weights. If the task type of the target processing task belongs to a model training task, and the NPU is more suitable for processing model training tasks, the NPU can be made to take on more processing tasks by adjusting the proportion information or adjusting the initial model weights. If the task priority or urgency of the target processing task is high, the CPU and GPU are set to process processing tasks with high priority or high urgency, and the CPU and GPU can be made to take on more processing tasks by adjusting the proportion information or adjusting the initial model weights. If the target processing task is specified to be executed by the CPU and NPU, the CPU and NPU can be made to take on more processing tasks by adjusting the proportion information or adjusting the initial model weights.

[0086] The target reference information may also be the current task information of each processing unit, which may include the priority of the current processing task (whether the processing can be suspended or delayed), the completion percentage (after completion, more model weights may be considered for allocation), etc. The proportion information may be adjusted based on the current task information, and then the target processing model may be split based on the adjusted proportion information to determine the first model weight of each processing unit; the target processing model may also be split based on the proportion information to determine the initial model weight of each processing unit, and then the initial model weight may be adjusted based on the current task information of each processing unit to obtain the first model weight, thereby further improving the accuracy of the first model weight.

[0087] For example, if the priority of the current processing task of the CPU is higher, the CPU can be made to take on fewer processing tasks by adjusting the proportion information or the initial model weight. If the priority of the current processing task of the GPU is lower, the current processing task can be paused, and the GPU can be made to take on more processing tasks by adjusting the proportion information or the initial model weight. If the completion percentage of the current processing task of the CPU is higher, the CPU can be made to take on more processing tasks corresponding to the target processing task after completing the current processing task by adjusting the proportion information or the initial model weight.

[0088] In some embodiments of the present application, if the priority of the current processing task of the processing unit is higher than the target priority, or the computing resource utilization rate caused by the current processing task of the processing unit reaches the target utilization rate (such as 80%), the processing unit is determined as a target processing unit that does not participate in the processing of the target task, so as to ensure the reliable execution of the current processing task or the reliability of the processing unit.

[0089] In addition, at least two of the priority information of each processing unit, the target task information of the target processing task, and the current task information of each processing unit can be used to adjust the proportion information or the initial model weight, so that the first model weight is more in line with the actual situation of the processing unit and the target processing task, thereby improving the accuracy of the first model weight.

[0090] In some embodiments of the present application, the multiple processing units synchronously execute the target processing tasks based on their respective first model weights, such as Figure 6 As shown, the following steps are included:

[0091] Step S201, configuring each processing unit to run a sub-processing model loaded into each operating space, wherein the sub-processing model is obtained by splitting the target processing model corresponding to the target processing task based on the respective first model weights.

[0092] In this embodiment, the running space can be a memory space for each processing unit. The target processing model corresponding to the target processing task is split based on the weights of each first model to obtain multiple sub-processing models. Each sub-processing model corresponds to a processing unit. Each sub-processing model is loaded into the memory space of the corresponding processing unit, so that the processing unit runs the sub-processing model loaded into its own memory space.

[0093] Step S202: split the target processing task into multiple sub-processing tasks based on the first model weight of each processing unit.

[0094] The target processing task is split into multiple sub-processing tasks based on the weights of each first model. For example, if the target processing task is an image generation task, each sub-processing task may be to generate sub-images corresponding to different areas of the image, or to generate different layers of the image. If the target processing task is a video generation task, each sub-processing task may be to generate one or more corresponding video frames. If the target processing task is a model training task, each sub-processing task may be to complete model reasoning of different layers or different nodes of the model to be trained, wherein the same sub-processing task may correspond to one layer of the model to be trained, or may correspond to multiple layers of the model to be trained.

[0095] Step S203: configure the multiple processing units to respectively perform processing operations on corresponding sub-processing tasks based on the sub-processing models they are running, to obtain multiple sub-processing results.

[0096] In this embodiment, each processing unit is configured to perform model reasoning based on the sub-processing model being run by each processing unit, so as to perform processing operations on the corresponding sub-processing tasks and obtain multiple sub-processing results. For example, if the target processing task is an image generation task, the multiple sub-processing results correspond to sub-images of various regions of the target image, or to different layers of the target image. If the target processing task is a video generation task, the multiple sub-processing results correspond to one or more corresponding video frames. If the target processing task is image rendering, the multiple sub-processing results correspond to rendering results of different rendering stages.

[0097] By configuring multiple processing units to execute processing operations on corresponding sub-processing tasks based on their respective running sub-processing models, the task processing efficiency is improved.

[0098] In some embodiments of the present application, the multiple processing units synchronously execute the target processing task based on their respective first model weights, such as Figure 7 As shown, the following steps are included:

[0099] Step S301, obtaining target task information of a target processing task and / or current task information of each processing unit.

[0100] In this embodiment, the target task information may include one or more of the task type, task priority, task urgency, and task requirement information of the target task. The task type determines which processing unit is more suitable to be used, and the task priority and task urgency determine which processing units need to undertake more processing tasks. The task requirement information may, for example, specify a specific processing unit to perform task processing. The current task information of each processing unit may include the priority of the current processing task (whether the processing can be suspended or delayed), the completion percentage (after completion, more model weights can be considered for allocation), etc.

[0101] Step S302: determining, based on the target task information and / or the current task information, a processing strategy for a plurality of sub-processing results obtained by executing corresponding processing operations on each processing unit.

[0102] In this embodiment, for the target task information, the fusion strategy of multiple sub-processing results is mainly determined based on different task types or types of generated content, such as whether to use splicing, interpolation, fusion processing, or summary processing, filling, etc. For example, if the task type is image generation, splicing or fusion processing can be used. If the task type is model training, fusion processing can be used. For the current task information, it is mainly used to determine which processor will perform the fusion processing operation, which is mainly determined by the idle busy state of each processing unit. For example, if the current load of the CPU is high and the load of the GPU is low, the GPU can be used as the processing unit for fusion processing.

[0103] Step S303: integrating the multiple sub-processing results based on the determined processing strategy to obtain a target processing result.

[0104] In this embodiment, based on the determined processing strategy, the corresponding processing units are used to integrate the multiple processing results in a corresponding integration manner. For example, the GPU performs splicing and fusion processing on multiple sub-images. Or the CPU fuses the model inference results of each processing unit to obtain the final inference result.

[0105] In some embodiments of the present application, it also includes:

[0106] In response to obtaining communication connection change information between the electronic device and the target processing device, the model weights configured for each processing unit are updated based on the communication connection change information, so that the multiple processing units of the electronic device and the target processing device perform the target processing task based on their respective configured model weights.

[0107] In this embodiment, the electronic device and the target processing device can cooperate to perform the target processing task. The target processing device may also include multiple processing units. There is a communication connection between the electronic device and the target processing device. The communication connection change information includes establishing a connection or disconnecting a connection. After the connection is established, the target processing device will share some processing tasks, so that the processing tasks of the electronic device are reduced. At this time, the model weights of some processing units (such as CPU) in the electronic device can be reduced so that the corresponding processing units can perform other tasks. If the communication connection between the electronic device and the target processing device is disconnected, the electronic device will assume all the target processing tasks, and it is necessary to increase the model weights of some processing units (such as CPU, GPU) with higher processing performance to ensure efficient execution of the target processing tasks.

[0108] In order to further explain the technical idea of ​​the present application, the technical solution of the present application is now described in combination with specific application scenarios.

[0109] An embodiment of the present application provides a task processing method, wherein a processing unit of an electronic device includes a CPU, an iGPU, a dGPU, and an NPU.

[0110] Combination Fig. 9 , the task processing method includes the following processes:

[0111] Step S1, receiving model instructions.

[0112] The model instruction is a model inference instruction for the target processing model corresponding to the target processing task.

[0113] Before step S1, the static priority list of CPU, iGPU, dGPU and NPU is determined, as shown in Table 1.

[0114] Step S2, obtaining the current system available resource list.

[0115] Specifically, if Figure 8 As shown, first obtain the TOPS of xPU (i.e., CPU, iGPU, dGPU, and NPU), and then calibrate the static priority list shown in Table 1. After obtaining the static priority list, start dynamic detection. Specifically, obtain the real-time utilization of xPU, and determine the dynamic priority list according to the utilization and the TOPS in the static priority list of the embodiment. Among them, if the utilization of a processing unit is greater than 80%, the processing unit is not used for task processing. Dynamic detection can be performed every 2 seconds to update the current system available resource list.

[0116] An example of a dynamic priority list may be shown in Table 2.

[0117] Table 2

[0118]

[0119]

[0120] It can be seen from Table 2 that the priority of NPU is the highest, followed by that of CPU, and the utilization rate of dGPU and iGPU is 80%. It is possible to consider not allowing dGPU and iGPU to participate in task processing.

[0121] Step S3, obtaining a valid SoC unit.

[0122] The effective SoC unit is the remaining available computing power resources of each processing unit. If the CPU, iGPU, dGPU and NPU are all available, the remaining available computing power resources of each processing unit are determined based on the available memory capacity of the CPU, iGPU, dGPU and NPU. The available memory capacity of the CPU, iGPU, dGPU and NPU is represented by cMem, igMem, dgMem and nMem respectively.

[0123] Step S4: Determine the remaining total available memory capacity tMem.

[0124] cMem+igMem+dgMem+nMem=tMem.

[0125] Step S5, compare the remaining total available memory capacity tMem with the capacity Model Weight of the target processing model, if tMem>Model Weight, execute step S6, otherwise end.

[0126] Step S6, determining the weight allocation ratios (ie, the first model weights) nRate, igRate, dgRate, nRate according to the ratios of cMem, igMem, dgMem, nMem to tMem respectively.

[0127] Step S7, dividing the target processing model into multiple sub-processing models according to nRate, igRate, dgRate, and nRate, and loading each sub-processing model into the CPU, iGPU, dGPU, and NPU.

[0128] Step S8, split the target processing task into multiple sub-processing tasks according to nRate, igRate, dgRate, and nRate.

[0129] Step S9, configure the CPU, iGPU, dGPU and NPU to perform processing operations on corresponding sub-processing tasks based on their respective running sub-processing models, and obtain multiple sub-inference results.

[0130] In this embodiment, the target processing model includes multiple layers, each layer uses multiple processing units for reasoning, such as Fig.10 As shown, the CPU can perform calculations on the B1 node and the C1 node, the iGPU can perform calculations on the B2 node and the C2 node, and the dGPU can perform calculations on the C3 node.

[0131] Step S10, summarizing the sub-reasoning results to obtain a total reasoning result.

[0132] Step S11, the target processing model may include multiple reasoning processes in a loop, and the reasoning results corresponding to the target processing task are obtained by executing steps S7-S10 in a loop.

[0133] The present application also proposes a task processing device, such as Fig.11 As shown, it includes: an acquisition module, used to obtain computing power resource information of multiple processing units of the electronic device in response to obtaining a target processing task; a configuration module, used to configure the first model weights of each processing unit based on the computing power resource information, so that the multiple processing units synchronously execute the target processing task based on their respective first model weights.

[0134] In a specific application scenario, it also includes: an update module, which is used to monitor the computing power resource change information of each processing unit, and update the first model weight configured for each processing unit based on the computing power resource change information, so that the multiple processing units perform the target processing task based on the updated second model weight; an integration module, which is used to integrate the task processing results of the various processing units to obtain the target processing results.

[0135] In a specific application scenario, the acquisition module is specifically used to: obtain the hardware configuration information of the electronic device, and determine the priority of each processing unit of the electronic device based on the hardware configuration information; determine the remaining available computing power resources of each processing unit based on the current usage of each processing unit based on the priority or based on the priority and the assembly probability of each processing unit.

[0136] In a specific application scenario, the configuration module is specifically used to: calculate the proportion of each processing unit in the available computing resources of the electronic device based on the remaining available computing resources of each processing unit; configure the model weight of the target processing model corresponding to the target processing task based on the proportion information to obtain the first model weight of each processing unit.

[0137] In a specific application scenario, the configuration module is also used to: obtain target reference information; adjust the proportion information based on the target reference information to configure the model weight of the target processing model using the adjusted proportion information; or, based on the target reference information, adjust the initial model weights of each processing unit determined based on the proportion information to obtain the first model weights of each processing unit.

[0138] In a specific application scenario, the configuration module is also specifically used to perform at least one of the following: obtaining the priority information of each processing unit, and configuring the model weight of the target processing model based on the priority information and the proportion information; obtaining the target task information of the target processing task, and configuring the model weight of the target processing model based on the target task information and the proportion information; obtaining the current task information of each processing unit, and configuring the model weight of the target processing model based on the current task information and the proportion information.

[0139] In a specific application scenario, it also includes an execution module, which is used to: configure each processing unit to run a sub-processing model loaded into its respective running space, wherein the sub-processing model is obtained by splitting the target processing model corresponding to the target processing task based on their respective first model weights; split the target processing task into multiple sub-processing tasks based on the first model weights of each processing unit; configure the multiple processing units to perform processing operations on the corresponding sub-processing tasks based on their respective running sub-processing models, and obtain multiple sub-processing results.

[0140] In a specific application scenario, the integration module is specifically used to: obtain the target task information of the target processing task and / or the current task information of each processing unit; determine the processing strategy for multiple sub-processing results obtained by performing corresponding processing operations on each processing unit based on the target task information and / or the current task information; integrate the multiple sub-processing results based on the determined processing strategy to obtain the target processing result.

[0141] In a specific application scenario, the update module is also used to: in response to obtaining communication connection change information between the electronic device and the target processing device, update the model weights configured for each processing unit based on the communication connection change information, so that the multiple processing units of the electronic device and the target processing device perform the target processing task based on their respective configured model weights.

[0142] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0143] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. A task processing method, comprising: In response to obtaining the target processing task, obtaining computing resource information of multiple processing units of the electronic device; The first model weight of each processing unit is configured based on the computing power resource information, so that the multiple processing units synchronously execute the target processing task based on their respective first model weights.

2. The method according to claim 1, wherein: Also includes at least one of the following: Monitoring computing power resource change information of each processing unit, and updating the first model weight configured for each processing unit based on the computing power resource change information, so that the multiple processing units perform the target processing task based on the updated second model weight; The task processing results of the various processing units are integrated to obtain the target processing result.

3. The method according to claim 1, wherein: Obtaining computing power resource information of multiple processing units of an electronic device, including: Obtaining hardware configuration information of the electronic device, and determining the priority of each processing unit of the electronic device based on the hardware configuration information; Based on the priority or based on the priority and the assembly probability of each processing unit, the remaining available computing power resources of each processing unit are determined based on the current usage of each processing unit.

4. The method according to claim 1 or 3, wherein: Configuring a first model weight of each processing unit based on the computing power resource information includes: Calculate the proportion of each processing unit in the available computing resources of the electronic device based on the remaining available computing resources of each processing unit; Based on the proportion information, the model weight of the target processing model corresponding to the target processing task is configured to obtain the first model weight of each processing unit.

5. The method according to claim 4, wherein: Configuring a model weight of a target processing model corresponding to the target processing task based on the proportion information includes: Obtain target reference information; Adjusting the proportion information based on the target reference information, so as to configure the model weight of the target processing model using the adjusted proportion information; or, Based on the target reference information, the initial model weights of the processing units determined based on the proportion information are adjusted to obtain the first model weights of the processing units.

6. The method according to claim 5, wherein: Configuring a model weight of a target processing model corresponding to the target processing task based on the proportion information includes at least one of the following: Obtaining priority information of each processing unit, and configuring a model weight of the target processing model based on the priority information and the proportion information; Obtaining target task information of the target processing task, and configuring a model weight of the target processing model based on the target task information and the proportion information; The current task information of each processing unit is obtained, and the model weight of the target processing model is configured based on the current task information and the proportion information.

7. The method according to claim 1, wherein: The multiple processing units synchronously execute the target processing task based on their respective first model weights, including: Configuring each processing unit to run a sub-processing model loaded into each running space, wherein the sub-processing model is obtained by splitting the target processing model corresponding to the target processing task based on the respective first model weights; Splitting the target processing task into a plurality of sub-processing tasks based on the first model weight of each processing unit; The multiple processing units are configured to perform processing operations on corresponding sub-processing tasks based on the sub-processing models respectively running, so as to obtain multiple sub-processing results.

8. The method according to claim 2, wherein: Integrating the task processing results of each processing unit includes: Obtaining target task information of the target processing task and / or current task information of each processing unit; Determine, based on the target task information and / or the current task information, a processing strategy for a plurality of sub-processing results obtained by executing corresponding processing operations on each processing unit; The multiple sub-processing results are integrated based on the determined processing strategy to obtain the target processing result.

9. The method according to claim 1, further comprising: In response to obtaining communication connection change information between the electronic device and the target processing device, the model weights configured for each processing unit are updated based on the communication connection change information, so that the multiple processing units of the electronic device and the target processing device perform the target processing task based on their respective configured model weights.

10. A task processing device, comprising: An acquisition module, configured to obtain computing resource information of multiple processing units of the electronic device in response to obtaining the target processing task; A configuration module is used to configure the first model weight of each processing unit based on the computing power resource information, so that the multiple processing units can synchronously execute the target processing task based on their respective first model weights.