Deployment method and device of multi-modal language model, equipment, medium and product
By dynamically combining the encoder clusters, mapper clusters and generative language models of the multi-modal language model, the problems of resource waste and throughput bottlenecks in the existing technology are solved, and efficient allocation of resources and improvement of computing performance are achieved.
Patent Information
- Application Number
- CN202410766522.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-27
AI Technical Summary
In the existing multi-modal language model inference deployment solution, the generative language model, encoder cluster and mapper cluster are exclusively bound, resulting in redundant waste of resources, throughput bottlenecks, and the inability to fully utilize the encoder cluster and mapper cluster. computing performance.
By dynamically combining encoder clusters, mapper clusters and generative language models, the appropriate combination is selected according to demand constraints to build a multi-modal language model, achieving optimal allocation of resources and maximizing throughput.
It effectively saves redundant computing power and memory resources of high computing performance modules, improves the overall inference computing performance of multi-modal language models, and optimizes resource utilization and costs.
Smart Images

Figure CN118708339A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a deployment method, device, equipment, medium and product of a multimodal language model. Background Art
[0002] At present, a popular multimodal language model (MLMM) is mainly composed of three parts: encoder cluster (EC), projector cluster (PC) and generative language model (GL). In the existing multimodal language model reasoning deployment scheme, the generative language model, projector cluster and encoder cluster are exclusively bound and cannot be dynamically selected and combined; encoders cannot be shared between encoder clusters, and mappers cannot be shared between mapper clusters.
[0003] The exclusive inference deployment scheme will lead to redundant waste of computing power, memory and other resources; in many cases, the inference throughput of the generative language model is much smaller than the achievable throughput of the encoder cluster and the mapper cluster. The inference computing performance bottleneck of the generative language model in the exclusive coupled inference deployment scheme will cause the throughput of its exclusive encoder cluster and mapper cluster to be lowered to the same level, and the achievable throughput of the encoder cluster and the mapper cluster is therefore not fully utilized; when the achievable throughput of the encoder cluster and the mapper cluster is not fully utilized, in order to improve the throughput of the exclusive coupled inference deployment scheme, the deployment of the generative language model can only be increased simultaneously with the deployment of the encoder cluster and the mapper cluster, resulting in a large waste of computing power, memory and other resources. Summary of the invention
[0004] The present invention provides a method, device, equipment, medium and product for deploying a multimodal language model, so as to solve the defect of resource waste in the multimodal language model reasoning deployment in the prior art, and reduce the waste of computing power, memory and other resources.
[0005] The present invention provides a method for deploying a multimodal language model, comprising the following steps: Dynamically combining any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model; For any multimodal reasoning task, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, and the multimodal language model is deployed to perform the multimodal reasoning task.
[0006] According to a method for deploying a multimodal language model provided by the present invention, the demand constraint refers to a specific requirement or restriction on the operating state of the multimodal language model when executing the multimodal reasoning task; the demand constraint at least includes maximizing throughput, minimizing resource usage and minimizing cost.
[0007] According to a method for deploying a multimodal language model provided by the present invention, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, including: If the requirement constraint is throughput maximization, a combination with the lowest throughput load is selected from all combinations to form the multimodal language model.
[0008] According to a method for deploying a multimodal language model provided by the present invention, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, including: If the requirement constraint is minimization of resource usage, a combination with the least resource usage is selected from all combinations to form the multimodal language model.
[0009] According to a method for deploying a multimodal language model provided by the present invention, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, including: If the requirement constraint is the lowest cost, then the combination with the lowest cost is selected from all combinations to form the multimodal language model.
[0010] According to a method for deploying a multimodal language model provided by the present invention, the encoder cluster set is constructed based on the following method: Classifying all encoders to classify the encoders that are interchangeable in reasoning effects into the same category; determining all required encoder categories according to the completeness requirement of the multimodal language model to perform any of the multimodal reasoning tasks; wherein each category of encoder includes at least one; A combination of any encoders of the encoder set belonging to each category is determined as an encoder cluster; wherein the encoder set of each category is composed of all encoders belonging to the same category; All combinations between any encoders of the encoder sets belonging to each category are determined as the encoder cluster set.
[0011] According to a method for deploying a multimodal language model provided by the present invention, the mapper cluster set is constructed based on the following method: Classifying all mappers to classify the mappers that are interchangeable in reasoning effects into the same category; determining all required mapper categories according to the completeness requirement of the multimodal language model to perform any of the multimodal reasoning tasks; wherein each category of mappers includes at least one; A combination of any mappers in the mapper set belonging to each category is determined as a mapper cluster; wherein the mapper set of each category is composed of all mappers belonging to the same category; All combinations between any mappers in the mapper sets belonging to each category are determined as the mapper cluster set.
[0012] The present invention also provides a device for constructing a multimodal language model, comprising the following modules: A combination module, used for dynamically combining any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model; A deployment module is used to select any combination that meets the requirement constraints from all combinations to form a multimodal language model for any multimodal reasoning task, and deploy the multimodal language model to perform the multimodal reasoning task.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for deploying the multimodal language model as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for deploying a multimodal language model as described in any one of the above.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for deploying a multimodal language model.
[0016] The deployment method, device, equipment, medium and product of the multimodal language model provided by the present invention are through dynamic combination of any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set and any generative language model in the generative language model set; wherein, there is at least one combination of encoder cluster, mapper cluster and generative language model; for any multimodal reasoning task, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, and the multimodal language model is deployed to perform the multimodal reasoning task. The present invention constructs a multimodal language model to perform a multimodal reasoning task through the dynamic combination of encoder clusters, mapper clusters and generative language models, and some encoders can be reused between encoder clusters, and some mappers can be reused between mapper clusters, so that each module with high computing performance is fully reused to save redundant computing power, memory and other resources occupied by modules with high computing performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a flowchart of the deployment method of the multimodal language model provided by the present invention.
[0019] Figure 2 It is a schematic diagram of the exclusive coupled reasoning deployment of a multimodal language model in the prior art.
[0020] Figure 3 It is one of the schematic diagrams of dynamically combining multimodal language models to perform multimodal reasoning provided by the present invention.
[0021] Figure 4 This is the second schematic diagram of the multimodal language model dynamically combined to perform multimodal reasoning provided by the present invention.
[0022] Figure 5 This is the third schematic diagram of the multimodal language model dynamically combined to perform multimodal reasoning provided by the present invention.
[0023] Figure 6 It is a structural schematic diagram of a deployment device for a multimodal language model provided by the present invention.
[0024] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] Any multimodal language model consists of three parts: an encoder cluster, a mapper cluster, and a generative language model: (1) Encoder cluster: In a multimodal language model, the role of the encoder cluster is to extract and convert all modal data into modal feature tensors; the modal data input to the encoder cluster can be images, videos, voices, etc.; the encoder cluster will not take text as input, and on this basis, the present invention does not limit the input modality; the encoders that constitute the encoder cluster can be encoders of different modalities, or encoders with the same modality input but focusing on different tasks, and the present invention does not limit this; any two encoders in the encoder cluster cannot be interchangeable in effect, and encoders that are interchangeable in effect are regarded as repeated encoders of the same type; there is at least one encoder that constitutes the encoder cluster.
[0027] (2) Mapper cluster: In a multimodal language model, the role of the mapper cluster is to convert the dimension of the modal features output by the encoder cluster into the input token vector dimension required by the generative language model; based on the token vector dimension alignment function, the mapper cluster can also have other functions such as feature attention enhancement and reducing the length of the token vector sequence. On the basis of satisfying the token vector dimension alignment, the present invention does not limit the other functions of the mapper cluster; the text can be input into the mapper cluster or not according to the needs of the mapper cluster, and the present invention does not limit this; any two mappers in the mapper cluster cannot be interchangeable in effect, and mappers that are interchangeable in effect are regarded as repeated mappers of the same type; there is at least one mapper constituting a mapper cluster.
[0028] (3) Generative language model: A language model that generates text in an autoregressive manner. It is the backbone of the multimodal language model. Text input is converted into a sequence of word vectors and input into the generative language model. Other modal inputs are converted into a sequence of feature vectors through an encoder cluster and a mapper cluster and input into the generative language model. The generative language model generates the corresponding result text based on the text word vector sequence and feature vector sequence.
[0029] Existing multimodal language model reasoning deployment solutions include Figure 2As shown, the generative language model, mapper cluster and encoder cluster are exclusively bound and cannot be dynamically selected for combination; the encoder cannot be shared between encoder clusters, and the mapper cannot be shared between mapper clusters.
[0030] like Figure 2 The existing exclusive coupled reasoning deployment scheme of multimodal language models shown in the figure will lead to redundant waste of computing power, memory and other resources; in many cases, the reasoning throughput of the generative language model is much smaller than the achievable throughput of the encoder cluster and the mapper cluster. The reasoning computing performance bottleneck of the generative language model in the exclusive coupled reasoning deployment scheme will cause the throughput of its exclusive encoder cluster and mapper cluster to be reduced to the same level, and the achievable throughput of the encoder cluster and the mapper cluster is therefore not fully utilized.
[0031] When the achievable throughput of the encoder cluster and mapper cluster is not fully utilized, in order to improve the throughput of the exclusive coupled reasoning deployment solution, the encoder cluster and mapper cluster can only be deployed simultaneously while increasing the deployment of the generative language model, resulting in a large waste of computing power, memory and other resources.
[0032] Generally, in an exclusive coupled reasoning deployment scheme, the overall reasoning computing performance of a multimodal language model is equivalent to the lowest reasoning computing performance of each module of the encoder cluster, mapper cluster, and generative language model. In order to improve the overall reasoning computing performance of a multimodal language model, due to the limitations of the exclusive coupled deployment scheme, the improvement of the overall reasoning computing performance of the multimodal language model must simultaneously improve the computing power, memory, and other resources of all modules of the encoder cluster, mapper cluster, and generative language model. For modules with higher reasoning computing performance, relatively fewer resources can be used to achieve the same reasoning computing performance, so the resources occupied by modules with higher reasoning computing performance are redundantly wasted.
[0033] Based on the above problems, the present invention proposes a deployment method of a multimodal language model, specifically a dynamic combination reasoning deployment method of a multimodal language model.
[0034] Combine the following Figure 1-Figure 7 Describe the deployment method, apparatus, device, medium and product of the multimodal language model of the present invention.
[0035] Figure 1 is a flow chart of the deployment method of the multimodal language model provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 101: dynamically combine any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model.
[0036] The present invention uses EC to represent the encoder cluster, PC to represent the mapper cluster, and GL to represent the generative language model, and the multimodal language model M is represented by {EC, PC, GL}.
[0037] In a multimodal language model, the number of different encoder categories required for an encoder cluster to fully execute any reasoning task is r. The same category between encoders described in the present invention means that the encoders play exactly the same functional role in the end-to-end reasoning process for the same multimodal reasoning task, that is, for any multimodal reasoning task, the two are interchangeable in effect. For example, although the weight parameters of the CLIP ViT image encoder with floating-point weights and the CLIPViT image encoder with floating-point weights quantized by INT8 are different, they play exactly the same functional role in the end-to-end reasoning process and are interchangeable in effect, so they belong to the same category of encoders.
[0038] The encoder cluster set is constructed in the following manner: classify all encoders to classify encoders that are interchangeable in reasoning effect into the same category; determine all required encoder categories based on the completeness requirement of the multimodal language model to perform any multimodal reasoning task; wherein each category of encoder includes at least one; determine a combination of any encoders in the encoder set belonging to each category as an encoder cluster; wherein each category of encoder set is composed of all encoders belonging to the same category; and determine all combinations of any encoders in the encoder set belonging to each category as an encoder cluster set.
[0039] For example, using E i Represents the set of i-th encoders among r class encoders: in, represents the enum(i)-1th encoder in the i-th encoder category, enum(i) represents the number of encoders in the i-th encoder category, and satisfies enum(i)≥1, enum(i)∈Z; i satisfies O≤i<r, i∈Z; r satisfies r≥1, r∈Z. Among them, represents the jth encoder in the i-th encoder of enum(i), that is: Among them, j satisfies 0≤j<enum(i), j∈Z.
[0040] According to the r categories of encoder sets, all possible combinations between any encoders belonging to each category of encoder sets constitute the encoder cluster set ECS: ECS={{e 0, ..., e r-1}|e i ∈E i , 0≤i<r,i∈Z}; Among them, e 0 represents the 0th type encoder, e r-1 Denotes the r-1th encoder. Any encoder combination in ECS corresponds to any encoder cluster. Obviously, encoder clusters in ECS can share some encoders.
[0041] Considering the categories and interchangeability of encoders helps to dynamically select appropriate encoder clusters in multimodal language models, thereby better meeting the system's demand constraints and achieving the best reasoning effect under given resource constraints.
[0042] In a multimodal language model, the number of different mapper categories required for a mapper cluster to fully execute any reasoning task is s. The same category between mappers described in the present invention means that for the same multimodal reasoning task, the mappers play exactly the same functional role in the end-to-end reasoning process, that is, for any reasoning task, the two are interchangeable in effect. For example, a fully connected layer mapper that is compatible with the CLIP ViT image encoder, and a fully connected layer mapper that is quantized by INT8 and is compatible with the CLIP ViT image encoder, both have the same weight parameters, but the functional roles enabled in the end-to-end reasoning process are exactly the same, and are interchangeable in effect, so they belong to the same type of encoders.
[0043] The mapper cluster set is constructed in the following manner: classify all mappers to group mappers that are interchangeable in reasoning effect into the same category; determine all required mapper categories based on the integrity requirements of the multimodal language model to perform any multimodal reasoning task; wherein each category of mapper includes at least one; determine a combination of any mapper in the mapper set belonging to each category as a mapper cluster; wherein each category of mapper set is composed of all mappers belonging to the same category; determine all combinations of any mapper in the mapper set belonging to each category as a mapper cluster set.
[0044] For example, using P i represents the set of i-th class mappers in s class encoders: in, represents the pnum(i)-1th mapper in the i-th type of mapper, pnum(i) represents the number of the i-th type of mapper, and satisfies pnum(i)≥1, pnum(i)∈Z; i satisfies O≤i<s, i∈Z; s satisfies s≥1, s∈Z; represents the j-th mapper in the pnum(i)-th type of mapper, that is: Among them, j satisfies 0≤j <pnum(i),j∈Z。
[0045] According to the mapper sets of s categories, all possible combinations between any mapper belonging to each category of mapper set constitute the mapper cluster set PCS: PCS={{p 0 ,…,p s-1}|p i ∈P i , 0≤i<s,i∈Z}; Among them, p 0 Indicates the type 0 mapper, p s-1 Denotes the s-1th type of mapper. Any combination of mappers in the PCS corresponds to any mapper cluster. Obviously, some mappers can be shared between mapper clusters in the PCS.
[0046] By considering the categories and interchangeability of mappers, it is helpful to dynamically select appropriate mapper clusters in multimodal language models, so as to better meet the system's requirement constraints and achieve the best reasoning effect under given resource constraints.
[0047] Assume that there are t generative language models, represented as a set GLS: GLS={GL0,…,GL t-1}; Where t satisfies t≥1, t∈Z; GL i represents the i-th generative language model, i satisfies O≤i <t,i∈Z。
[0048] Dynamically combine any encoder cluster in the encoder cluster set ECS, any mapper cluster in the mapper cluster set PCS, and any generative language model in the generative language model set GLS; wherein there is at least one combination of encoder cluster, mapper cluster, and generative language model.
[0049] Step 102: For any multimodal reasoning task, select any combination that meets the requirement constraints from all combinations to form a multimodal language model, and deploy the multimodal language model to perform the multimodal reasoning task.
[0050] Demand constraints can be understood as various specific requirements or restrictions that need to be considered when a multimodal language model performs multimodal reasoning tasks. These demand constraints can be considerations of system performance, resource utilization, model effect, hardware configuration, and various restrictions on system operation. For example, demand constraints can be to maximize the throughput of the multimodal language model under existing resources, consume the least resources under a fixed throughput, have the lowest cost, and exclusive binding. The present invention does not limit the specific demand constraints that determine the dynamic combination between the generative language model, the encoder cluster, and the mapper cluster.
[0051] In one embodiment, if the demand constraint is to maximize throughput, then the combination with the lowest throughput load is selected from all combinations to form a multimodal language model. It can be understood that if the demand constraint is to maximize throughput, that is, it is hoped that the amount of tasks processed in the reasoning task is maximized, then the combination with the lowest throughput load can be selected, which means selecting a combination that can process more input data in a given time to improve the throughput of the system.
[0052] In one embodiment, if the demand constraint is to maximize throughput, then the combination with the lowest throughput load is selected from all combinations to form a multimodal language model. It is understandable that if the demand constraint is to minimize resource usage, that is, it is hoped to minimize the amount of resource usage in the reasoning task, then the combination with the least resource usage can be selected, which means selecting a combination that is more efficient in terms of resource consumption to reduce the system's demand for computing resources, thereby reducing the system's resource consumption.
[0053] In one embodiment, if the requirement constraint is the lowest cost, the combination with the lowest cost is selected from all combinations to form a multimodal language model. It can be understood that if the requirement constraint is the lowest cost, that is, it is hoped to save cost in the reasoning task, the combination with the lowest cost can be selected at this time, which means selecting a combination with relatively low cost to save cost.
[0054] By selecting the appropriate combination according to different demand constraints, the system can better balance the relationship between performance and resource consumption when processing multimodal reasoning tasks, optimize the system's throughput, resource utilization, and cost to meet the needs of different scenarios.
[0055] It should be noted that, for any multimodal reasoning task, the encoder clusters that dynamically compose the multimodal language model are interchangeable in effect, the mapper clusters that dynamically compose the multimodal language model are interchangeable in effect, and the generative language models that dynamically compose the multimodal language model are interchangeable in effect. Under the above conditions, the present invention does not restrict the differences between encoder clusters, mapper clusters, and generative language models due to model quantization, incremental increase in model capabilities, etc.
[0056] The dynamic combination of the encoder cluster, the mapper cluster and the generative language model of the present invention is a dynamic combination of various submodules under the multimodal generative language model, rather than a dynamic combination of independent models or independent functions or independent services.
[0057] The encoders in the encoder cluster, the mappers in the mapper cluster, and the generative language model of the present invention can be deployed on different computing devices respectively, or on the same computing device, and the present invention does not impose any restrictions on this; the computing device can be a GPU, or a CPU or NPU, etc., and the present invention does not impose any restrictions on this.
[0058] like Figure 3 As shown, it is assumed that the modal input includes modal input A, modal input B, and modal input C, wherein A is input at the previous moment, and B and C are input at the next moment.
[0059] The encoder cluster r-1, the mapper cluster 0, and the generative language model t-1 constitute a multimodal language model for processing modal input A and text input A: {Encoder cluster r-1, Mapper cluster 0, Generative language model t-1}; Encoder cluster 0, mapper cluster s-1, and generative language model 1 form a multimodal language model that processes modal input B and text input B: {Encoder cluster 0, Mapper cluster s-1, Generative language model 1}; The encoder cluster r-1, the mapper cluster s-1, and the generative language model t-2 constitute a multimodal language model for processing modal input C and text input C: {Encoder cluster r-1, Mapper cluster s-1, Generative language model t-2}; Figure 3 Dynamically combine multimodal language models according to demand constraints to perform multimodal reasoning tasks.
[0060] The deployment method of the multimodal language model provided by the present invention can dynamically combine the encoder cluster, the mapper cluster and the generative language model to form a multimodal generative language model; the encoder cluster, the mapper cluster and the generative language model are no longer exclusively bound, so that the modules with high computing performance in the encoder cluster, the mapper cluster and the generative language model can be reused by the modules with low computing performance, so that the redundant resources occupied by the modules with high computing performance are saved. On the other hand, part of the encoder can be shared between the encoder clusters. When the encoder cluster has multiple encoders, the encoder with high computing performance can be reused by the multiple encoder clusters, so that the redundant resources occupied by the encoder with high computing performance are saved. At the same time, part of the mapper can be shared between the mapper clusters. When the mapper cluster has multiple mappers, the mapper with high computing performance can be reused by the multiple mapper clusters, so that the redundant resources occupied by the mapper with high computing performance are saved.
[0061] In order to further analyze and illustrate the deployment method of the multimodal language model proposed in the present invention, refer to the following embodiments.
[0062] like Figure 4 As shown, Figure 4 To support multimodal language model deployment cases for images and texts, the encoder cluster consists of a single image encoder, the mapper cluster consists of a single image fully connected layer mapper, and the generative language model is Vicuna fine-tuned on multimodal data of images and texts.
[0063] In this case, the requirement constraint is throughput maximization, where the encoder cluster is dynamically selected based on the encoder cluster throughput load, encoder cluster 0 is bound to mapper cluster 0, encoder cluster 1 is bound to mapper cluster 1, and the generative language model is dynamically selected based on the generative language model throughput load.
[0064] The CLIP ViT image encoder has a achievable throughput of 15qps, the fully connected layer has a achievable throughput of 60qps, and the achievable throughput of Vicuna after fine-tuning of multimodal data of images and texts is 5qps. Limited by the 5qps achievable throughput bottleneck of Vicuna, if an exclusive binding deployment is adopted between the encoder cluster, the mapper cluster and the generative language model, 6 Vicuna, 6 CLIP ViT image encoders and 6 image fully connected layers are required to enable the overall system to achieve a throughput of 30qps. However, if the deployment method of the multimodal language model provided by the present invention is adopted, 6 Vicuna, 2 CLIP ViT image encoders and 2 image fully connected layers are required, which can enable the overall system to reach 30qps.
[0065] like Figure 4 As shown in the figure, the multimodal task reasoning process is as follows: (1) For any image input, select the encoder cluster with the lowest throughput load between encoder cluster 0 and encoder cluster 1 to encode the image input and extract features.
[0066] (2) The image features output by encoder cluster 0 are processed by the bound mapper cluster 0, and the image features output by encoder cluster 1 are processed by the bound mapper cluster 1. After processing, the image features are obtained that are aligned with the word element vector dimension of the generative language model.
[0067] (3) The mapped image features are transmitted to the Vicuna with the lowest throughput load among the six generative language models, and the instruction text corresponding to the input image is also transmitted to this Vicuna, and finally the corresponding result text is generated.
[0068] like Figure 5 As shown, Figure 5 The example given here is a deployment case of a multimodal language model that supports images, speech, and text. The encoder cluster consists of encoders for both image and speech modalities, the mapper cluster consists of image fully-connected layer mappers and speech fully-connected layer mappers, and the generative language model is Chinese LLaMA2 7B that has been fine-tuned on multimodal data of images, text, and speech. In this case, the demand constraint is throughput maximization, in which the encoder cluster is dynamically selected based on the encoder cluster throughput load, the generative language model is dynamically selected based on the generative language model throughput load, and the mapper cluster is dynamically selected based on the mapper cluster throughput load. However, there is only one mapper cluster in this case, which is equivalent to the encoder clusters sharing one mapper cluster.
[0069] The CLIP ViT image encoder has a throughput of 15qps, the Whisper speech encoder has a throughput of 40qps, the image and speech fully connected layers have a throughput of 60qps, and the Chinese LLaMA2 7B has a throughput of 5qps. Limited by the 5qps throughput bottleneck of Chinese LLaMA2 7B, if an exclusive binding deployment is adopted between the encoder cluster, the mapper cluster and the generative language model, 6 Chinese LLaMA2 7Bs, 6 CLIP ViT image encoders, 6 Whisper speech encoders, 6 image fully connected layers and 6 speech fully connected layers are required to enable the overall system to achieve a throughput of 30qps. However, if the deployment method of the multimodal language model provided by the present invention is adopted, 6 ChineseLLaMA2 7Bs, 2 CLIP ViT image encoders, 1 Whisper speech encoder, 1 image fully connected layer and 1 speech fully connected layer are required to enable the overall system to achieve a throughput of 30qps.
[0070] like Figure 5As shown in the figure, the multimodal reasoning task process is as follows: (1) For any image and any speech input, select the encoder cluster with the lowest throughput load in encoder cluster 0 and encoder cluster 1 to encode the image and speech input and extract features, where encoder cluster 0 and encoder cluster 1 share one Whisper encoder.
[0071] (2) The image features and speech features output by encoder cluster 0 or encoder cluster 1 are processed by mapper cluster 0 to obtain image features aligned with the dimension of the word unit vector of the generative language model and speech features aligned with the dimension of the word unit vector.
[0072] (3) The mapped image features and speech features are transmitted to the Chinese LLaMA2 7B with the lowest throughput load among the six generative language models Chinese LLaMA27B. At the same time, the instruction text corresponding to the input image and speech is also transmitted to this Chinese LLaMA2 7B, and finally the corresponding result text is generated.
[0073] The deployment method of the multimodal language model provided by the present invention constructs a multimodal language model to perform multimodal reasoning tasks through the dynamic combination of encoder clusters, mapper clusters and generative language models, and some encoders can be reused between encoder clusters, and some mappers can be reused between mapper clusters, so that each module with high computing performance can be fully reused to save redundant computing power, memory and other resources occupied by the modules with high computing performance.
[0074] It should be noted that the deployment method of the multimodal language model provided by the present invention is suitable for combination with large-scale platform-level products such as computing network scheduling platforms and capability service platforms. Under the same circumstances, compared with the platform that does not use the solution of the present invention, the resource cost used for reasoning of the multimodal language model in the platform product that applies the solution of the present invention can be greatly reduced to enhance the commercial competitiveness of the product. On the other hand, the solution of the present invention can also optimize the computing performance of the deployed multimodal language model in the edge terminal product. Under the condition of achieving the same inference concurrency, the solution of the present invention uses less computing power, memory and other resources; under the condition of the same computing power, memory and other resources, the solution of the present invention can achieve a higher inference concurrency; the solution of the present invention can enhance the commercial competitiveness of products related to the edge terminal multimodal language model.
[0075] The following is a description of a deployment device for a multimodal language model provided by the present invention. The deployment device for a multimodal language model described below and the deployment method for a multimodal language model described above can refer to each other.
[0076] refer to Figure 6 The deployment device of the multimodal language model provided by the present invention includes a combination module 601 and a deployment module 602.
[0077] A combination module 601 is used to dynamically combine any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model; The deployment module 602 is used to select any combination that meets the requirement constraints from all combinations to form a multimodal language model for any multimodal reasoning task, and deploy the multimodal language model to perform the multimodal reasoning task.
[0078] The deployment device of the multimodal language model provided by the present invention can dynamically combine the encoder cluster, the mapper cluster and the generative language model to form a multimodal generative language model; the encoder cluster, the mapper cluster and the generative language model are no longer exclusively bound, so that the modules with high computing performance in the encoder cluster, the mapper cluster and the generative language model can be reused by the modules with low computing performance, so that the redundant resources occupied by the modules with high computing performance are saved. On the other hand, some encoders can be shared between encoder clusters. When there are multiple encoders in the encoder cluster, the encoder with high computing performance can be reused by multiple encoder clusters, so that the redundant resources occupied by the encoder with high computing performance are saved. At the same time, some mappers can be shared between mapper clusters. When there are multiple mappers in the mapper cluster, the mapper with high computing performance can be reused by multiple mapper clusters, so that the redundant resources occupied by the mapper with high computing performance are saved.
[0079] In one embodiment, the demand constraint refers to the specific requirements or restrictions on the operating state of the multimodal language model when executing the multimodal reasoning task; the demand constraint at least includes maximizing throughput, minimizing resource usage and minimizing cost.
[0080] In one embodiment, the combination module 601 is further configured to: If the requirement constraint is throughput maximization, a combination with the lowest throughput load is selected from all combinations to form the multimodal language model.
[0081] In one embodiment, the combination module 601 is further used for: If the requirement constraint is minimization of resource usage, a combination with the least resource usage is selected from all combinations to form the multimodal language model.
[0082] In one embodiment, the combination module 601 is further used for: If the requirement constraint is the lowest cost, then the combination with the lowest cost is selected from all combinations to form the multimodal language model.
[0083] In one embodiment, the encoder cluster set is constructed based on the following method: Classifying all encoders to classify the encoders that are interchangeable in reasoning effects into the same category; determining all required encoder categories according to the completeness requirement of the multimodal language model to perform any of the multimodal reasoning tasks; wherein each category of encoder includes at least one; A combination of any encoders of the encoder set belonging to each category is determined as an encoder cluster; wherein the encoder set of each category is composed of all encoders belonging to the same category; All combinations between any encoders of the encoder sets belonging to each category are determined as the encoder cluster set.
[0084] In one embodiment, the mapper cluster set is constructed based on the following method: Classifying all mappers to classify the mappers that are interchangeable in reasoning effects into the same category; determining all required mapper categories according to the completeness requirement of the multimodal language model to perform any of the multimodal reasoning tasks; wherein each category of mappers includes at least one; A combination of any mappers in the mapper set belonging to each category is determined as a mapper cluster; wherein the mapper set of each category is composed of all mappers belonging to the same category; All combinations between any mappers in the mapper sets belonging to each category are determined as the mapper cluster set.
[0085] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a method for deploying a multimodal language model, the method comprising: dynamically combining any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster and the generative language model; for any multimodal reasoning task, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, and the multimodal language model is deployed to perform the multimodal reasoning task.
[0086] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0087] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multimodal language model deployment method provided by the above methods, the method comprising: dynamically combining any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model; for any multimodal reasoning task, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, and the multimodal language model is deployed to perform the multimodal reasoning task.
[0088] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the multimodal language model deployment method provided by the above-mentioned methods, the method comprising: dynamically combining any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model; for any multimodal reasoning task, selecting any combination that meets the requirement constraints from all combinations to form a multimodal language model, and deploying the multimodal language model to execute the multimodal reasoning task.
[0089] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for deploying a multimodal language model, characterized in that: include: Dynamically combining any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model; For any multimodal reasoning task, any combination that meets the requirement constraints is selected from all combinations to form a multimodal language model, and the multimodal language model is deployed to perform the multimodal reasoning task.
2. The method for deploying a multimodal language model according to claim 1, characterized in that: The demand constraint refers to the specific requirements or restrictions on the operating state of the multimodal language model when executing the multimodal reasoning task; the demand constraint at least includes maximizing throughput, minimizing resource usage and minimizing cost.
3. The method for deploying a multimodal language model according to claim 2, characterized in that: Select any combination that meets the requirements from all combinations to form a multimodal language model, including: If the requirement constraint is throughput maximization, a combination with the lowest throughput load is selected from all combinations to form the multimodal language model.
4. The method for deploying a multimodal language model according to claim 2, characterized in that: Select any combination that meets the requirements from all combinations to form a multimodal language model, including: If the requirement constraint is minimization of resource usage, a combination with the least resource usage is selected from all combinations to form the multimodal language model.
5. The method for deploying a multimodal language model according to claim 2, characterized in that: Select any combination that meets the requirements from all combinations to form a multimodal language model, including: If the requirement constraint is the lowest cost, then the combination with the lowest cost is selected from all combinations to form the multimodal language model.
6. The method for deploying a multimodal language model according to claim 1, characterized in that: The encoder cluster set is constructed based on the following method: Classifying all encoders to classify the encoders that are interchangeable in reasoning effects into the same category; determining all required encoder categories according to the completeness requirement of the multimodal language model to perform any of the multimodal reasoning tasks; wherein each category of encoder includes at least one; A combination of any encoders of the encoder set belonging to each category is determined as an encoder cluster; wherein the encoder set of each category is composed of all encoders belonging to the same category; All combinations between any encoders of the encoder sets belonging to each category are determined as the encoder cluster set.
7. The method for deploying a multimodal language model according to claim 1, characterized in that: The mapper cluster set is constructed based on the following method: Classifying all mappers to classify the mappers that are interchangeable in reasoning effects into the same category; determining all required mapper categories according to the completeness requirement of the multimodal language model to perform any of the multimodal reasoning tasks; wherein each category of mappers includes at least one; A combination of any mappers in the mapper set belonging to each category is determined as a mapper cluster; wherein the mapper set of each category is composed of all mappers belonging to the same category; All combinations between any mappers in the mapper sets belonging to each category are determined as the mapper cluster set.
8. A device for constructing a multimodal language model, characterized in that: include: A combination module, used for dynamically combining any encoder cluster in the encoder cluster set, any mapper cluster in the mapper cluster set, and any generative language model in the generative language model set; wherein there is at least one combination of the encoder cluster, the mapper cluster, and the generative language model; A deployment module is used to select any combination that meets the requirement constraints from all combinations to form a multimodal language model for any multimodal reasoning task, and deploy the multimodal language model to perform the multimodal reasoning task.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the deployment method of the multimodal language model as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for deploying a multimodal language model as claimed in any one of claims 1 to 7 is implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for deploying a multimodal language model according to any one of claims 1 to 7 is implemented.
