Model segmentation method and device, electronic equipment and computer storage medium

By dividing the multi-task model into sub-task models and removing unnecessary quantization and dequantization operators, the problem of low interaction efficiency in the multi-task model is solved, resulting in faster running process and higher performance.

CN117217279BActive Publication Date: 2026-02-27ARM TECH CHINA CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311185309.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-13
Publication Date
2026-02-27
Estimated Expiration
2043-09-13

AI Technical Summary

Technical Problem

In existing multi-task models, there are a large number of unnecessary quantization and dequantization operators during the interaction process, resulting in resource waste and low performance.

Method used

The multi-task model is divided into multiple sub-task models, and the quantization and dequantization operators are deleted when the input identifier and output identifier are the same. Each sub-task model is run by updating the interaction information to process the target task.

Benefits of technology

It accelerated the overall operation process, improved the overall performance and throughput efficiency of the multi-task model, and reduced the external storage bandwidth usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117217279B_ABST
    Figure CN117217279B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a model splitting method and device, electronic equipment and computer storage medium, relating to the technical field of deep learning. The method comprises: obtaining a multi-task model, splitting the multi-task model into a plurality of sub-task models, if it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, deleting the quantization operator and the inverse quantization operator in the interaction information of the first task model and the second task model to obtain updated interaction information, and running each sub-task model to process a target task through the updated interaction information corresponding to each sub-task model to obtain a target result corresponding to the target task. The model splitting method provided by the present application converts the multi-task model into a plurality of models for collaborative processing, deletes the quantization and inverse quantization operators between the models, can save interaction time, speed up the processing speed of the target task, and improve the overall performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of deep learning, in particular, the present application relates to a model segmentation method and device, electronic equipment and computer storage medium. BACKGROUND

[0002] With the rapid development of deep learning technology, the structure of network model is more and more complex. When the network model is inferred on the model inference platform, each substructure in the network model will involve data interaction, and usually each substructure needs to be quantized, and when each substructure interacts with another substructure, the quantized substructure needs to be dequantized and then data interaction is performed.

[0003] The method in the prior art adds quantization operators or dequantization operators at some positions that do not need quantization or dequantization operation, so that the efficiency of the interaction of the substructures in the model is low, the time is spent more, the resources are wasted, and the overall performance is low. SUMMARY

[0004] The embodiments of the present application aim to solve the problem of wasting resources, spending more time and low overall performance caused by inserting a large number of unnecessary quantization and dequantization operators among multiple models in the prior art. The technical solution is as follows:

[0005] In a first aspect, the present application provides a model segmentation method, comprising:

[0006] obtaining a multi-task model, and segmenting the multi-task model into a plurality of sub-task models; each sub-task model corresponds to an input identifier and an output identifier of a selectable task;

[0007] If it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, deleting the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model, and obtaining updated interaction information;

[0008] By using the updated interaction information corresponding to each sub-task model, the sub-task model is run to process a target task, and a target result corresponding to the target task is obtained.

[0009] In an optional embodiment of the first aspect, the step of segmenting the multi-task model into a plurality of sub-task models comprises:

[0010] determining the input identifier and the output identifier of a plurality of selectable tasks in the multi-task model;

[0011] determining a segmentation point based on the input identifier and the output identifier of each selectable task;

[0012] split the multi-task model based on the split point to obtain the plurality of sub-task models.

[0013] In an optional embodiment of the first aspect, the determining the split point based on the input identifier and the output identifier of each optional task comprises:

[0014] If it is detected that the input identifier of a first task in the plurality of optional tasks is the same as the output identifier of a second task, a node corresponding to the input identifier of the first task or the output identifier of the second task in the multi-task model is taken as the split point.

[0015] In an optional embodiment of the first aspect, after the splitting the multi-task model based on the split point, the method further comprises:

[0016] determining a connection relationship between the plurality of sub-task models based on the input identifier and the output identifier of each optional task;

[0017] the running the plurality of sub-task models to process the target task comprises:

[0018] running the plurality of sub-task models to process the target task through the connection relationship.

[0019] In an optional embodiment of the first aspect, the running the plurality of sub-task models to process the target task comprises:

[0020] running the plurality of sub-task models to process the target task through the thread corresponding to each sub-task model respectively.

[0021] In an optional embodiment of the first aspect, the deleting the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model to obtain updated interaction information comprises:

[0022] deleting the quantization operator of the first task model in the interaction information and deleting the dequantization operator of the second task model in the interaction information to obtain the updated interaction information.

[0023] In an optional embodiment of the first aspect, before the running the plurality of sub-task models to process the target task to obtain a target result corresponding to the target task, the method further comprises:

[0024] determining at least one first task corresponding to the target task from the plurality of optional tasks;

[0025] determining a target sub-task model corresponding to the at least one first task from the plurality of sub-task models respectively;

[0026] The running of the respective sub-task models to process the target task obtains a target result corresponding to the target task, and the target result comprises:

[0027] The running of the respective target sub-task models obtains a running result, and the running result is taken as the target result corresponding to the target task.

[0028] In an optional embodiment of the first aspect, the running of the respective target sub-task models obtains a running result, and the running result is taken as the target result corresponding to the target task.

[0029] The output information of the respective target sub-task models is saved in a preset storage space.

[0030] If it is detected that the input identifier of a first target task model in the respective target sub-task models is the output identifier of a second target task model, the output information of the second target task model is obtained from the storage space as the input information of the first target task model, so as to run the respective target sub-task models to obtain a running result.

[0031] The running result is taken as the target result corresponding to the target task.

[0032] In a second aspect, a model cutting device is provided, and the device comprises:

[0033] A cutting module is configured to obtain a multi-task model and cut the multi-task model into a plurality of sub-task models; each sub-task model corresponds to an input identifier and an output identifier of an optional task.

[0034] A deleting module is configured to, if it is detected that the input identifier of a first task model in the plurality of sub-task models is the output identifier of a second task model, delete a quantization operator and a dequantization operator in interaction information of the first task model and the second task model to obtain updated interaction information.

[0035] A running module is configured to run the respective sub-task models to process a target task through the updated interaction information corresponding to the respective sub-task models, so as to obtain a target result corresponding to the target task.

[0036] In a third aspect, an electronic device is provided, which comprises a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the method in any one of the first aspect.

[0037] In a fourth aspect, a computer readable storage medium is provided, and a computer program is stored in the computer readable storage medium, and the computer program is executed by a processor to implement the model cutting method in any one of the first aspect.

[0038] The technical scheme provided by the embodiments of the present application has the beneficial effects that:

[0039] The model splitting method provided by the present application splits the multi-task model into multiple sub-task models, deletes the quantization operator and the dequantization operator in the interaction information of any first task model and a second task model in the multiple sub-task models if it is detected that the input identifier of the first task model is the output identifier of the second task model, obtains updated interaction information, runs each sub-task model to process a target task through the updated interaction information corresponding to each sub-task model, and obtains a target result corresponding to the target task. When the sub-task models interact with each other, the process of a large number of unnecessary quantization and dequantization is deleted, which can speed up the overall running process and improve the overall performance of the multi-task model running.

[0040] Further, the split sub-task models are respectively run on separate threads, and when the output identifier of a sub-task model is the same as the input identifier of multiple other sub-task models, the other sub-task models can be run in parallel on different threads after the corresponding thread of the sub-task model is run to completion, which can greatly reduce the running time, quickly obtain the running results of multiple tasks, and effectively increase the throughput efficiency of the multi-task model running.

[0041] In addition, when each sub-task model is run, the output result obtained after the running of each sub-task model can be stored in a preset storage space, and if a sub-task model needs to use the output information of another sub-task model as input information, the corresponding output information can be directly obtained from the preset storage space as input information to run the sub-task model, and the output information obtained by running is stored in the local preset storage space, without the need to rely on external memory, thereby effectively reducing the bandwidth occupation of external storage. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced.

[0043] Figure 1 An application scenario diagram of the model splitting method provided by the embodiments of the present application;

[0044] Figure 2 A flowchart of the model splitting method provided by the embodiments of the present application;

[0045] Figure 3 A flowchart of an example of the model splitting method provided by the embodiments of the present application;

[0046] Figure 4A flowchart of updating the sub-task model after the interaction information is updated in an example of a model splitting method provided by an embodiment of the present application is shown in FIG. 1.

[0047] Figure 5 A structural diagram of a model splitting device provided by an embodiment of the present application is shown in FIG. 2.

[0048] Figure 6 A structural diagram of an electronic device to which a model splitting method provided by an embodiment of the present application is applicable is shown in FIG. 3. DETAILED DESCRIPTION

[0049] Embodiments of the present application will be described below in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions of the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0050] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an" and "the" used herein can also include the plural forms. It should be further understood that the terms "comprise" and "include" used by the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations and components, but do not exclude other features, information, data, steps, operations, components and / or combinations thereof supported by the present technology. It should be understood that when we say that an element is "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or can mean that the element and the other element are connected through an intermediate element. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The term "and / or" used herein means that at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".

[0051] In order to better illustrate and understand the solutions provided by the embodiments of the present application, first, some related technical terms involved in the embodiments of the present application are introduced:

[0052] Quantization: In a neural network, it refers to the process of converting floating-point type weights and activation values into low-precision integer or fixed-point number representations. Through quantization, the storage and calculation requirements can be reduced, thereby improving the efficiency of the neural network.

[0053] Dequantization: In a neural network, it refers to restoring the quantized integer or fixed-point number representation to a floating-point type. This process is opposite to quantization, and a dequantizer is usually used to perform it.

[0054] Operator: In a neural network, it refers to the operation used to perform various mathematical operations and transformations. These operators are commonly used in the forward propagation and back propagation processes of neural networks to achieve specific functions and calculations.

[0055] Thread: It refers to the smallest unit of execution within a process that performs independent tasks or execution streams. Threads can be executed concurrently within the same process, utilizing multi-core processors to achieve parallel computing, thereby improving the performance and efficiency of programs. A process can contain multiple threads, each with its own execution path and can be executed concurrently. Threads share the same memory space and resources, so they can directly access the same data and share the context of the process.

[0056] To make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.

[0057] In the case of a multi-task neural network, the usual practice is to obtain all task results after a complete inference. If only the output results of several tasks in the multi-task neural network are needed, the target results can only be obtained after all tasks are completed, which takes a lot of time, resulting in resource waste and low overall performance.

[0058] To address at least one of the technical problems or areas for improvement in the related art, the present application provides a model splitting method, device, electronic equipment and computer storage medium. The model splitting method provided by the scheme splits the multi-task model into multiple sub-task models. If the input identifier of any first task model in the multiple sub-task models is detected as the output identifier of a second task model, the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model are deleted to obtain updated interaction information. Each sub-task model is run to process the target task through the updated interaction information corresponding to each sub-task model to obtain the target result corresponding to the target task. When interacting between sub-models, a large number of unnecessary quantization and dequantization processes in the deletion process are deleted, which can speed up the overall running process and improve the overall performance of the multi-task model running.

[0059] Further, the split sub-task models are run on separate threads. When the output identifier of a sub-task model is the same as the input identifier of multiple other sub-task models, the sub-task model can be run on a different thread in parallel after the corresponding thread is run to completion. This can greatly reduce the running time, quickly obtain the running results of multiple tasks, and effectively increase the throughput efficiency of the multi-task model running.

[0060] In addition, when each sub-task model is run, the output result obtained after each sub-task model is run can be stored in a preset storage space. If a sub-task model needs to use the output information of another sub-task model as input information, the corresponding output information can be directly obtained from the preset storage space as input information to run the sub-task model, and the output information obtained by running is stored in the local preset storage space, without the need to use external memory, thereby effectively reducing the bandwidth occupation of external storage.

[0061] The technical solutions of the embodiments of the present application and the technical effects generated by the technical solutions of the present application will be described below through the description of several exemplary embodiments. It should be pointed out that the following embodiments can be mutually referenced, borrowed or combined. For the same terms, similar features and similar implementation steps in different embodiments, they will not be described repeatedly.

[0062] Figure 1 The application scenario of the model splitting method provided by the embodiments of the present application is shown in the figure, wherein the application environment can include a terminal 101, and the terminal 101 can be installed with an application program capable of using the above-mentioned model splitting method.

[0063] Specifically, on the terminal 101, a multi-task model is obtained, the multi-task model is split into a plurality of sub-task models, if it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model are deleted to obtain updated interaction information; each sub-task model is run to process a target task through the updated interaction information corresponding to each sub-task model to obtain a target result corresponding to the target task.

[0064] In the above application scenario, the program capable of implementing the splitting method can be on the terminal or on the server, and the specific implementation can be determined based on the actual application scenario requirements. The above-mentioned application scenario is only an example, and does not limit the application scenario of the model splitting method of the present application.

[0065] Those skilled in the art can understand that the terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a notebook computer, a digital broadcast receiver, a MID (Mobile Internet Devices), a PDA (Personal Digital Assistant), a desktop computer, a smart home appliance, a vehicle-mounted terminal (such as a vehicle-mounted navigation terminal, a vehicle-mounted computer, etc.), a smart speaker, a smart watch, etc. The terminal and the server can be directly or indirectly connected through wired or wireless communication, but are not limited thereto.

[0066] The server can include a server installed with a server capable of processing database operations. The server can be a standalone physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be a cloud server or a server cluster providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, intelligent transportation, and assisted driving. Specifically, it can be determined based on the actual application scenario requirements, which is not limited here.

[0067] In some possible embodiments, taking a terminal capable of applying the above-mentioned model splitting method as an example, the embodiments of the present application provide a model splitting method, as shown in Figure 2 The method can include the following steps:

[0068] S201, obtaining a multi-task model, and splitting the multi-task model into a plurality of sub-task models.

[0069] Each sub-task model corresponds to an input identifier and an output identifier of a selectable task.

[0070] Specifically, when splitting the multi-task model, the multi-task model is split into a plurality of sub-task models using a preset splitting method and splitting information. The association relationship between the sub-task models can be determined by the input identifier and the output identifier of the task corresponding to each sub-task model, so as to determine the association relationship and interaction information between the plurality of sub-task models after splitting.

[0071] In the specific implementation process, the multi-task model can be a deep learning model capable of solving a plurality of related tasks. The multi-task model is split into a plurality of sub-task models, so that the plurality of sub-task models can focus on solving a single task, and the complexity and computational burden of the multi-task model can be reduced, and the overall performance can be improved.

[0072] S202, if it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, deleting the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model, obtaining updated interaction information.

[0073] The input identifier and the output identifier can be a name or a numerical value capable of representing input information and output information.

[0074] Specifically, the input identifier and the output identifier of each sub-task model are determined from the input of the initial sub-task model. If the input identifier of any first task model is detected as the output identifier of a second task model, the first task model can be referred to as a consumer of new information output by the second task model, and the second task model is a producer relative to the first task model. The first task model interacts with the second task model, the interaction information of the first task model and the second task model is obtained, and the quantization operator and the dequantization operator in the interaction information are deleted to obtain updated interaction information.

[0075] In the specific implementation process, each sub-task model has a quantization and dequantization operator during interaction. If the input identifier and the output identifier meet the requirements, the quantization and dequantization operators in the corresponding interaction information are deleted, the unnecessary quantization and dequantization steps are reduced, and the overall performance is improved.

[0076] S203, running the sub-task models to process the target task by using the updated interaction information corresponding to each sub-task model to obtain a target result corresponding to the target task.

[0077] The updated interaction information is the interaction information between the sub-task models after the unnecessary quantization and dequantization operators are deleted.

[0078] Specifically, the sub-task models interact with each other according to the updated interaction information. The previous sub-task model receives input and obtains output information after running. The next sub-task model uses the output information as input information to obtain a running result. The sub-task models corresponding to the target task are executed in turn to obtain the final output information, that is, the target result.

[0079] In the specific implementation process, after obtaining the updated interaction information corresponding to each sub-task model, the sub-task models related to the target task are determined according to the target task, and the models are run according to the updated interaction information to obtain the target result corresponding to the target task.

[0080] In some possible implementation manners, the splitting of the multi-task model into the sub-task models in S201 includes:

[0081] (1) determining the input identifier and the output identifier of each optional task in the multi-task model;

[0082] (2) determining a splitting point based on the input identifier and the output identifier of each optional task;

[0083] (3) splitting the multi-task model based on the splitting point to obtain the sub-task models.

[0084] The split point can be determined according to the input identifier and the output identifier of each optional task, or can be preset.

[0085] In a specific implementation process, according to the input and output identifiers of the tasks and the association relationship between the tasks in the multi-task model, the split point is determined based on each different task. The specific manner of determining the split point can include: traversing from the output identifier and the input identifier of each task to the parent task of the task until the first input identifier is reached, when the input identifier of any task and the output identifier of the parent task are the same, the input identifier of the task or the output identifier of the parent task can be used as the split point, and the multi-task model is split into a plurality of sub-task models according to the split point, wherein the parent task can include a task whose output identifier is the same as the input identifier of the current task.

[0086] In some possible implementation manners, the split point is determined based on the input identifier and the output identifier of each optional task in the above step, which includes:

[0087] (1) If it is detected that the input identifier of a first task in the plurality of optional tasks is the same as the output identifier of a second task, the node corresponding to the input identifier of the first task or the output identifier of the second task in the multi-task model is used as the split point.

[0088] The input identifier of the first task being the same as the output identifier of the second task can include that the input identifier of the first task includes the output identifier of the second task.

[0089] Specifically, if the input identifier of the first task is the same as the output identifier of the second task, a split point selection instruction can be received to determine the split point from the input identifier and the output identifier.

[0090] In some possible implementation manners, after the multi-task model is split based on the split point in the above step, the method further includes:

[0091] (1) determining the connection relationship between the sub-task models based on the input identifier and the output identifier of each optional task;

[0092] The running of the sub-task models to process the target task includes:

[0093] (2) running the sub-task models through the connection relationship to process the target task.

[0094] The connection relationship of the sub-task models can include the running order and the interaction relationship of the sub-task models.

[0095] Specifically, based on the input and output identifiers of each optional task, a connection relationship of each sub-task model is determined, and when the plurality of sub-task models are run, each sub-task model is sequentially run according to the connection relationship to process the target task.

[0096] In some possible implementation manners, the running of the plurality of sub-task models to process the target task in the step S203 includes:

[0097] (1) the plurality of sub-task models are respectively run by threads corresponding to the plurality of sub-task models respectively to process the target task.

[0098] Each sub-task model corresponds to a thread, the threads corresponding to the plurality of sub-task models are different, and each sub-task model can be independently run on the thread corresponding to the sub-task model.

[0099] In the implementation process, after the plurality of task models are divided into the plurality of sub-task models, a thread corresponding to each sub-task model is allocated, each sub-task model can be independently run on the corresponding thread to obtain a target result of processing the target task; each thread is independently run, and the target result corresponding to the target task can be obtained without waiting for all the sub-task models to be completely run, thereby increasing the throughput efficiency of the plurality of task models in inference running.

[0100] In some possible implementation manners, the deleting of the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model in the step S202 to obtain updated interaction information includes:

[0101] (1) the quantization operator of the first task model in the interaction information is deleted, and the dequantization operator of the second task model in the interaction information is deleted to obtain the updated interaction information.

[0102] Specifically, if it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, the quantization operator of the first task model and the dequantization operator of the second task model are deleted to obtain updated interaction information, so as to run each sub-task model, that is, the quantization operator or the dequantization operator between the sub-task models that need to interact is deleted, the conversion process of information is reduced, resource waste is reduced, and the overall performance is effectively improved.

[0103] In some possible implementation manners, before the running of the plurality of sub-task models to process the target task in the step S203 to obtain a target result corresponding to the target task, the method further includes:

[0104] (1) at least one first task corresponding to the target task is determined from the plurality of optional tasks.

[0105] (2) determining a target sub-task model corresponding to each of the at least one first task from the respective sub-task models;

[0106] The running of the respective sub-task models to process the target task to obtain a target result corresponding to the target task comprises:

[0107] (3) running each of the target sub-task models to obtain a running result, and taking the running result as the target result corresponding to the target task.

[0108] The target task can be at least one, and the corresponding first task can also include at least one.

[0109] Specifically, the related information of the target task can be obtained, the related information can include an output result required by the target task, the corresponding at least one first task and the corresponding target sub-task model are determined according to the output result, each of the target sub-task models is run, and a running result is obtained, and the running result is the target result corresponding to the target task.

[0110] In some possible implementation manners, the running of each of the target sub-task models to obtain a running result, and the taking of the running result as the target result corresponding to the target task in the above step comprises:

[0111] (1) saving output information of the respective target sub-task models in a preset storage space;

[0112] (2) if it is detected that input identification of a first target sub-task model in the respective target sub-task models is output identification of a second target sub-task model, obtaining output information of the second target sub-task model from the storage space as input information of the first target sub-task model to run the respective target sub-task models to obtain a running result;

[0113] (3) taking the running result as the target result corresponding to the target task.

[0114] The preset storage space can include a local cache.

[0115] Specifically, each of the target sub-task models can store the output result in the preset storage space after running, and before running of any target sub-task model, input information corresponding to input identification can be found from the preset storage space to run the respective target sub-task models to obtain a running result, and the running result is the target result corresponding to the target task.

[0116] In the implementation process, the output information obtained by running each target sub-task model is stored in a local preset storage space, without the need for external memory, which can effectively reduce the bandwidth occupation of external storage and improve the running efficiency of the sub-task model.

[0117] In the above embodiment, by dividing the multi-task model into multiple sub-task models, if it is detected that the input identifier of any first task model in the multiple sub-task models is the output identifier of a second task model, the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model are deleted to obtain updated interaction information, each sub-task model is run to process the target task through the updated interaction information corresponding to each sub-task model to obtain a target result corresponding to the target task, and when the sub-models interact, the process of a large number of unnecessary quantization and dequantization in the deletion process is deleted, which can accelerate the overall running process and improve the overall performance of the multi-task model running.

[0118] Further, the divided sub-task models are respectively run on separate threads, and when the output identifier of a sub-task model is the same as the input identifier of multiple other sub-task models, after the sub-task model is run on the corresponding thread, the other sub-task models can be run in parallel on different threads, which can greatly reduce the running time, quickly obtain the running results of multiple tasks, and effectively increase the throughput efficiency of the multi-task model running.

[0119] In addition, when each sub-task model is run, the output result obtained after running each sub-task model can be stored in a preset storage space, and if a sub-task model needs to use the output information of another sub-task model as input information, the corresponding output information can be directly obtained from the preset storage space as input information to run the sub-task model. The output information obtained by running is stored in a local preset storage space, without the need for external memory, which effectively reduces the bandwidth occupation of external storage.

[0120] To more clearly understand the model splitting method described in the embodiments of the present application, the following will be further described in detail with examples.

[0121] In one example, the model splitting method of the present application, as shown in Figure 3 and Figure 4 may include:

[0122] The multi-task model is obtained, the multi-task model is divided into a plurality of sub-task models, each sub-task model corresponds to an input identifier and an output identifier of a selectable task, if it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, the quantization operator of the first task model in the interaction information is deleted, and the dequantization operator of the second task model in the interaction information is deleted, to obtain updated interaction information, and each sub-task model is run to process the target task through the updated interaction information corresponding to each sub-task model.

[0123] At runtime, each sub-task model is assigned a corresponding thread, at least one first task corresponding to the target task is determined from a plurality of selectable tasks, and the target sub-task model corresponding to the at least one first task is determined from each sub-task model, the output information of each target sub-task model is saved in a preset storage space, if it is detected that the input identifier of a first target task model in each target sub-task model is the output identifier of a second target task model, the output information of the second target task model is obtained from the storage space as the input information of the first target task model, each target sub-task model is run on the corresponding thread, the running result is obtained, and the running result is taken as the target result corresponding to the target task.

[0124] The above model division method divides the multi-task model into a plurality of sub-task models, if it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, the quantization operator and the dequantization operator in the interaction information of the first task model and the second task model are deleted to obtain updated interaction information, each sub-task model is run to process the target task through the updated interaction information corresponding to each sub-task model, and the target result corresponding to the target task is obtained, when the sub-models interact, a large number of unnecessary quantization and dequantization processes in the deletion process are deleted, the overall running process is accelerated, and the overall performance of the multi-task model running is improved.

[0125] Further, the divided sub-task models are respectively run on separate threads, when the output identifier of a sub-task model is the same as the input identifier of a plurality of other sub-task models, after the sub-task model is run on the corresponding thread, the other sub-task models can be respectively run in parallel on different threads, the running time is greatly reduced, the running results of the plurality of tasks can be quickly obtained, and the throughput efficiency during the multi-task model running can be effectively increased.

[0126] In addition, when each sub-task model is running, the output result obtained after each sub-task model is running can be stored in a preset storage space. If a sub-task model needs to use the output information of another sub-task model as input information, the corresponding output information can be directly obtained from the preset storage space as input information to run the sub-task model, and the output information obtained after running is stored in the local preset storage space, without the need to use external memory, thereby effectively reducing the bandwidth occupation of external storage.

[0127] The embodiment of the present application provides a model cutting device, as shown in the figure, the device 50 can include: cutting module 501, deletion module 502 and running module 503, wherein, Figure 5

[0128] The cutting module 501 is used for obtaining a multi-task model, and cutting the multi-task model into a plurality of sub-task models; each sub-task model corresponds to an input identifier and an output identifier of an optional task;

[0129] The deletion module 502 is used for deleting quantization operators and dequantization operators in interaction information of a first task model and a second task model if it is detected that the input identifier of the first task model is the output identifier of the second task model, to obtain updated interaction information;

[0130] The running module 503 is used for running each sub-task model to process a target task through the updated interaction information corresponding to each sub-task model, to obtain a target result corresponding to the target task.

[0131] In the model cutting device provided by the present application, the multi-task model is cut into a plurality of sub-task models, if it is detected that the input identifier of any first task model in the plurality of sub-task models is the output identifier of a second task model, the quantization operators and the dequantization operators in the interaction information of the first task model and the second task model are deleted to obtain updated interaction information, each sub-task model is run to process a target task through the updated interaction information corresponding to each sub-task model, to obtain a target result corresponding to the target task, and when the sub-models interact, a large number of unnecessary quantization and dequantization processes in the deletion process can speed up the overall running process and improve the overall performance of the multi-task model running.

[0132] Further, the cut sub-task models are respectively run on separate threads, when the output identifier of a sub-task model is the same as the input identifier of a plurality of other sub-task models, after the sub-task model is run on the corresponding thread, the other sub-task models can be respectively run in parallel on different threads, which can greatly reduce the running time, quickly obtain the running result of the plurality of tasks, and effectively increase the throughput efficiency when the multi-task model is running.​

[0133] In addition, when each sub-task model is run, the output result obtained after each sub-task model is run can be stored in a preset storage space. If a sub-task model needs to use the output information of another sub-task model as input information, the corresponding output information can be directly obtained from the preset storage space as input information to run the sub-task model, and the output information obtained by running is stored in the local preset storage space, without the need to use external memory, thereby effectively reducing the bandwidth occupation of external storage.

[0134] An electronic device is provided in the embodiments of the present application, which includes a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the model splitting method. Compared with related technologies, the model splitting method can split a multi-task model into multiple sub-task models and update the interaction information between the sub-task models, thereby obtaining a running result.

[0135] In an optional embodiment, an electronic device is provided, as shown in Figure 6 Figure 6 The electronic device 6000 shown in the optional embodiment includes a processor 6006 and a memory 6003. The processor 6006 and the memory 6003 are connected, for example, through a bus 6002. Optionally, the electronic device 6000 can also include a transceiver 6004, which can be used for data interaction, such as data transmission and / or data reception, between the electronic device and other electronic devices. It should be noted that the transceiver 6004 is not limited to one in actual application, and the structure of the electronic device 6000 does not constitute a limitation on the embodiments of the present application.

[0136] The processor 6006 can be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, digital signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure. The processor 6006 can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc.

[0137] ​The bus 6002 can include a path that transmits information between the above-described components. The bus 6002 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 6002 can be divided into an address bus, a data bus, a control bus, or the like. For convenience of representation, Figure 6 Only one thick line is used in the middle, but it does not mean that there is only one bus or one type of bus.

[0138] The memory 6003 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, a magnetic disk storage medium, other magnetic storage device, or any other medium that can be used to carry or store computer programs and that can be read by a computer, without limitation.

[0139] The memory 6003 is used to store a computer program for implementing the embodiments of the present application, and is controlled by the processor 6006 to execute. The processor 6006 is used to execute the computer program stored in the memory 6003 to realize the steps shown in the foregoing method embodiments.

[0140] Among them, the electronic device includes but is not limited to: the terminal and the server which can apply the above-mentioned model segmentation method.

[0141] The embodiments of the present application provide a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to realize the steps and corresponding contents of the foregoing method embodiments.

[0142] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described.

[0143] It should be understood that, although each operation step in the flowchart of the embodiments of the present application is indicated by an arrow, the implementation order of the steps is not limited to the order indicated by the arrow. Unless otherwise specified herein, in some implementation scenarios of the embodiments of the present application, the implementation steps in each flowchart can be executed in other orders as required. In addition, part or all of the steps in each flowchart can include multiple sub-steps or multiple stages based on the actual implementation scenario. Part or all of these sub-steps or stages can be executed at the same time, and each of these sub-steps or stages can also be executed at different times. In the scenario where the execution times are different, the execution order of these sub-steps or stages can be flexibly configured as required, and the embodiments of the present application do not limit this.

[0144] The above is only an optional implementation of some implementation scenarios of the present application, and it should be pointed out that, for ordinary skilled persons in the technical field, other similar implementation means based on the technical idea of the present application without departing from the technical concept of the present application also belong to the protection scope of the embodiments of the present application.

Claims

1. A model segmentation method, characterized by, The method comprises the following steps: obtaining a multi-task model, and splitting the multi-task model into a plurality of sub-task models; each sub-task model corresponds to an input identifier and an output identifier of a selectable task; the step of splitting the multi-task model into a plurality of sub-task models comprises the following steps: determining the input identifiers and the output identifiers of a plurality of selectable tasks in the multi-task model; if it is detected that the input identifier of a first task is the same as the output identifier of a second task in the plurality of selectable tasks, then taking a node corresponding to the input identifier of the first task or the output identifier of the second task in the multi-task model as a splitting point; splitting the multi-task model based on the splitting point to obtain the plurality of sub-task models; if it is detected that the input identifier of any first task model is the output identifier of a second task model in the plurality of sub-task models, then deleting quantization operators and dequantization operators in interaction information of the first task model and the second task model to obtain updated interaction information; running the plurality of sub-task models to process a target task through the updated interaction information corresponding to each sub-task model, to obtain a target result corresponding to the target task; the step of running the plurality of sub-task models to process the target task comprises the following step:

2. The model segmentation method of claim 1, wherein, running the plurality of sub-task models to process the target task through threads corresponding to each sub-task model respectively. after the step of splitting the multi-task model based on the splitting point, the method further comprises the following steps: determining a connection relationship between the plurality of sub-task models based on the input identifiers and the output identifiers of each selectable task; the step of running the plurality of sub-task models to process the target task comprises the following step:

3. The model segmentation method of claim 1, wherein, running the plurality of sub-task models to process the target task through the connection relationship. the step of deleting the quantization operators and the dequantization operators in the interaction information of the first task model and the second task model to obtain the updated interaction information comprises the following steps:

4. The model segmentation method of claim 1, wherein, deleting the quantization operators of the first task model in the interaction information, and deleting the dequantization operators of the second task model in the interaction information to obtain the updated interaction information. before the step of running the plurality of sub-task models to process the target task to obtain a target result corresponding to the target task, the method further comprises the following steps: determining at least one first task corresponding to the target task from a plurality of selectable tasks; determining target sub-task models corresponding to the at least one first task from the plurality of sub-task models respectively; the step of running the plurality of sub-task models to process the target task to obtain a target result corresponding to the target task comprises the following steps:

5. The model segmentation method according to claim 4, characterized in that, running the plurality of target sub-task models to obtain running results, and taking the running results as the target result corresponding to the target task. the step of running the plurality of target sub-task models to obtain running results, and taking the running results as the target result corresponding to the target task comprises the following steps: saving output information of the plurality of target sub-task models in a preset storage space; If it is detected that the input identifier of a first target task model in the respective target sub-task models is the output identifier of a second target task model, the output information of the second target task model is obtained from the storage space as the input information of the first target task model to run the respective target sub-task models and obtain a running result; The running result is taken as a target result corresponding to the target task.

6. A model segmentation device characterized by, The method comprises the following steps: A splitting module is configured to obtain a multi-task model and split the multi-task model into a plurality of sub-task models; Each sub-task model corresponds to an input identifier and an output identifier of an optional task; The splitting module is configured to determine the input identifier and the output identifier of the plurality of optional tasks in the multi-task model; In a case where it is detected that the input identifier of a first task in the plurality of optional tasks is the same as the output identifier of a second task, a node corresponding to the input identifier of the first task or the output identifier of the second task in the multi-task model is taken as a splitting point; The multi-task model is split based on the splitting point to obtain the plurality of sub-task models; A deletion module is configured to, if it is detected that the input identifier of a first task model in the plurality of sub-task models is the output identifier of a second task model, delete a quantization operator and a dequantization operator in interaction information of the first task model and the second task model to obtain updated interaction information; A running module is configured to run the respective target sub-task models to process a target task by using the updated interaction information corresponding to the respective target sub-task models, and obtain a target result corresponding to the target task; The running module is further configured to run the respective target sub-task models to process a target task by using threads corresponding to the respective target sub-task models, respectively.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1-6. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the model splitting method in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Model quantification method and device, computer equipment and storage medium

    CN115705482A

  • Method and system of DNN modularization for optimal loading

    US20230153565A1

  • Performing segmented inference operations of a machine learning model

    WO2023043459A1