Adaptive bit width allocation method and system applied to large model multi-modal mixed precision training

By using an adaptive bit-width allocation method, a large multimodal model is divided into training computation units with independently configured numerical precision. The precision configuration is dynamically adjusted according to the multimodal precision sensitivity and resource constraints, which solves the stability and precision problems in the training of large multimodal models and achieves coordination between training performance and resource overhead.

CN123137941APending Publication Date: 2026-11-20XINGFAN XINGQI (CHENGDU) TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611628489.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-21
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing technologies, when multimodal large models are trained with a fixed precision configuration, the stability and training accuracy of the model are easily affected, especially due to the accumulation and propagation of numerical errors caused by the differences in the sensitivity of different network parts to low-precision calculations.

Method used

By using an adaptive bit width allocation method, the multimodal large model is divided into training computation units with independently configured numerical precision. The multimodal precision sensitivity of each unit is calculated based on the training state information, and the precision configuration, including data type and bit width, is dynamically adjusted under the condition of satisfying resource constraints.

Benefits of technology

It improves the training stability and accuracy of multimodal large models, reduces the impact of low-precision computation on model training, and achieves a balance between training performance and resource overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123137941A_ABST
    Figure CN123137941A_ABST
Patent Text Reader

Abstract

The application discloses an adaptive bit width allocation method and system applied to large model multi-modal mixed precision training, and comprises the following steps: obtaining training state information of a target multi-modal large model, and dividing to obtain a plurality of training calculation units; according to the training state information, calculating the multi-modal precision sensitivity of each training calculation unit; according to the multi-modal precision sensitivity and the training resource constraint, determining the target precision configuration of the corresponding training calculation unit; according to the target precision configuration, executing the mixed precision training, when the preset training round is reached or the training loss meets the convergence condition, outputting the trained target multi-modal large model, and using the trained target multi-modal large model for text task, image task or speech task inference, and outputting the corresponding task processing result. The application belongs to the field of large model training. The application can reduce the influence of low precision calculation on the training precision and stability of the multi-modal large model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large model training, and more particularly to an adaptive bit width allocation method and system for multimodal mixed-precision training of large models. Background Technology

[0002] As the parameter size and training data size of large multimodal models continue to grow, mixed-precision training is increasingly being applied to the training process of large multimodal models in order to reduce memory usage and computational resource consumption during model training. Existing mixed-precision training methods typically use preset data types and bit widths to perform low-precision calculations on model parameters, activations, and gradients, or adjust the precision according to the local numerical characteristics of the model.

[0003] However, large multimodal models typically include encoding structures for different modalities and cross-modal fusion structures. Different network parts differ in feature distribution, gradient propagation, and modal information interaction, and have varying sensitivities to numerical errors caused by low-precision computation. If a uniform or relatively fixed precision configuration is adopted, some precision-sensitive network parts are prone to generating large numerical errors after reducing numerical precision, leading to the accumulation or propagation of errors during training, thereby affecting the training accuracy and stability of the large multimodal model.

[0004] Therefore, how to reasonably configure numerical precision according to the actual training state of different network parts of a multimodal large model in order to reduce the impact of low-precision calculation on the training accuracy and stability of the model has become an urgent technical problem to be solved. Summary of the Invention

[0005] This invention provides an adaptive bit width allocation method and system for training large multimodal models with mixed precision, which solves the technical problem in the prior art that the stability of large multimodal models is easily affected when trained with a fixed precision configuration, and achieves the technical effect of improving the stability of large multimodal models.

[0006] In a first aspect, the present invention provides an adaptive bit-width allocation method for training large-scale multimodal mixed-precision models, comprising: The training state information of the target multimodal large model is obtained and divided into several training computation units; Calculate the multimodal accuracy sensitivity of each training computation unit based on the training state information; Based on multimodal precision sensitivity and training resource constraints, the target precision configuration of the corresponding training computing unit is determined, wherein the precision configuration includes data type and corresponding bit width; Mixed-precision training is performed based on the target precision configuration. When the preset training rounds are reached or the training loss meets the convergence condition, the trained target multimodal large model is output. The trained target multimodal large model is then used for inference on text tasks, image tasks, or speech tasks, and the corresponding task processing results are output.

[0007] Furthermore, the training state information of the target multimodal large model is obtained, and it is divided into several training computation units, including: Based on the network structure of the target multimodal large model, the target multimodal large model is divided into training computation units, where each training computation unit can be configured with numerical precision independently. Collect training state information during the training process of the target multimodal large model, including: , in, Indicates the first In the training cycle, the first Training state information of each training computation unit. Indicates the training period. Indicates the first In the training cycle, the first The weights of each training computation unit, Indicates the first In the training cycle, the first Activation of each training computational unit, Indicates the first In the training cycle, the first The gradient of each training computation unit, Indicates the first Training loss per training cycle.

[0008] Furthermore, based on the training state information, the multimodal accuracy sensitivity of each training computation unit is calculated, including: Several candidate precision configurations are set for each training computation unit, including: , in, Indicates the first Candidate precision configuration for each training computation unit. For the first The precision of candidate numerical values ​​corresponding to the weights of each training computation unit. For the first The candidate numerical precision corresponding to the activation of each training computation unit. For the first The candidate numerical precision corresponding to the gradient of each training computation unit, wherein the candidate numerical precision is one of FP16, BF16, FP8, INT8 or INT4; Configure according to candidate precision Perform simulated low-precision calculations on the corresponding training computation units and determine the resulting numerical errors, gradient propagation changes, training loss perturbations, and modality alignment loss perturbations, respectively. The multimodal accuracy sensitivity of the training computation unit is calculated based on numerical error, gradient propagation changes, training loss perturbation, and modal alignment loss perturbation.

[0009] Furthermore, configuration according to candidate precision Simulated low-precision calculations are performed on the corresponding training computation units, and the resulting numerical errors, gradient propagation changes, training loss perturbations, and modality alignment loss perturbations are determined, including: Based on the candidate precision configuration, the weights, activations and gradients in the corresponding training computation units are mapped with low precision to obtain the corresponding low precision training tensors. The numerical error of the training computation unit is determined based on the difference between each low-precision training tensor and the corresponding original training tensor. The gradient propagation change of the training computation unit is determined based on the change between the gradient under the baseline accuracy condition and the gradient under the candidate accuracy configuration. The training loss perturbation corresponding to the training computation unit is determined based on the difference between the training loss under the baseline accuracy condition and the training loss under the candidate accuracy configuration. Based on the difference between the modal alignment loss under the baseline accuracy condition and the modal alignment loss under the candidate accuracy configuration, the modal alignment loss perturbation corresponding to the training computation unit is determined.

[0010] Furthermore, based on numerical error, gradient propagation changes, training loss perturbation, and modal alignment loss perturbation, the multimodal accuracy sensitivity of the training computation unit is calculated, including: , in, Indicates the first Each training computation unit employs a candidate precision configuration. Multimodal accuracy sensitivity during time, Indicates the first Each training computation unit employs a candidate precision configuration. Numerical error, For the first Each training computation unit employs a candidate precision configuration. Gradient propagation changes, For the first Each training computation unit employs a candidate precision configuration. Training loss perturbation, For the first Each training computation unit employs a candidate precision configuration. The modal alignment loss perturbation.

[0011] Furthermore, based on multimodal accuracy sensitivity and training resource constraints, the target accuracy configuration of the corresponding training computation units is determined, including: Based on the multimodal precision sensitivity of each training computation unit under different candidate precision configurations, the candidate precision configurations are filtered to obtain the candidate precision configuration set corresponding to each training computation unit. Based on the candidate precision configuration set corresponding to each training computation unit, several model-level candidate precision configurations are obtained by combining them, and the training memory usage, training computation overhead, and training communication overhead corresponding to each model-level candidate precision configuration are determined. The training memory usage, training computation overhead, and training communication overhead are normalized and weighted to obtain the comprehensive training resource overhead corresponding to each model-level candidate accuracy configuration. The model-level multimodal accuracy sensitivity corresponding to the candidate accuracy configuration is determined based on the multimodal accuracy sensitivity of the candidate accuracy configuration selected by each training computation unit. In the model-level candidate accuracy configuration that meets the preset training resource constraints, the target accuracy configuration is determined based on the comprehensive training resource overhead and the model-level multimodal accuracy sensitivity.

[0012] Furthermore, based on the multimodal precision sensitivity of each training computation unit under different candidate precision configurations, the candidate precision configurations are filtered to obtain the candidate precision configuration set corresponding to each training computation unit, including: The different candidate precision configurations of the training computation unit are classified into high candidate precision configuration, medium candidate precision configuration and low candidate precision configuration; If the multimodal accuracy sensitivity of a low candidate accuracy configuration is greater than the first sensitivity threshold, then the low candidate accuracy configuration is removed; otherwise, it is retained. If the multimodal precision sensitivity of a candidate precision configuration is greater than the second sensitivity threshold, then that candidate precision configuration is removed; otherwise, it is retained. The second sensitivity threshold is greater than the first sensitivity threshold. High-precision candidate configurations are retained, and the retained candidate precision configurations after screening are combined into a set of candidate precision configurations for the corresponding training computation unit.

[0013] Furthermore, the target accuracy configuration is determined based on the overall training resource overhead and the model-level multimodal accuracy sensitivity, including: , in, Configured for target accuracy. A set of model-level candidate accuracy configurations to meet preset training resource constraints. To configure any model-level candidate accuracy to meet preset training resource constraints. To cover the overall training resource expenditure, To preset the balance coefficient, For model-level multimodal accuracy sensitivity.

[0014] Furthermore, mixed-precision training is performed according to the target precision configuration. When the preset training epochs are reached or the training loss meets the convergence condition, the target multimodal large model is output, including: Based on the target accuracy configuration, perform forward propagation, backward propagation, and parameter updates; The multimodal accuracy sensitivity of each training computing unit is redefined according to the preset accuracy adjustment cycle, and the accuracy configuration of the corresponding training computing unit is increased, maintained, or decreased based on the multimodal accuracy sensitivity. Continue mixed-precision training based on the adjusted precision configuration until the preset training rounds are reached or the training loss meets the convergence condition, and output the target multimodal large model.

[0015] Secondly, this invention provides an adaptive bit-width allocation system for training large-scale multimodal mixed-precision models, comprising: The computational unit partitioning module is used to obtain the training state information of the target multimodal large model and divide it into several training computational units. The sensitivity determination module is used to calculate the multimodal accuracy sensitivity of each training computation unit based on the training state information. The precision configuration determination module is used to determine the target precision configuration of the corresponding training computing unit based on the multimodal precision sensitivity and training resource constraints. The precision configuration includes the data type and the corresponding bit width. The training module is used to perform mixed-precision training according to the target precision configuration. When the preset training rounds are reached or the training loss meets the convergence condition, the trained target multimodal large model is output. The trained target multimodal large model is then used for inference on text tasks, image tasks, or speech tasks, and the corresponding task processing results are output.

[0016] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention divides the target multimodal large model into several training computation units that can independently configure numerical accuracy, and combines the training state information such as weights, activations, gradients and training losses of each training computation unit to determine the multimodal accuracy sensitivity from multiple dimensions such as numerical error, gradient propagation changes, training loss perturbations and modal alignment loss perturbations.

[0017] This invention can further consider the different sensitivity of different training computing units to low-precision computation. In particular, it reflects the impact of low-precision computation on the semantic relationship between different modalities through modal alignment loss perturbation, thereby more accurately identifying training computing units that are sensitive to numerical precision. This provides a basis for different data types and bit width configurations for different training computing units, which is beneficial to reducing the impact of low-precision computation on the training accuracy and stability of multimodal large models.

[0018] The present invention further filters candidate precision configurations based on the multimodal precision sensitivity of each training computing unit, and determines the target precision configuration by comprehensively considering training memory usage, training computing overhead, and training communication overhead, while meeting the preset training resource constraints. This enables different training computing units to adopt appropriate data types and bit widths according to their own precision sensitivity, thereby achieving coordination between training performance and training resource overhead.

[0019] In the mixed-precision training process, the present invention redetermines the multimodal precision sensitivity according to a preset precision adjustment cycle, and dynamically increases, maintains or decreases the precision configuration of the corresponding training computing unit, so that the precision configuration can be adaptively adjusted as the model training state changes. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating the adaptive bit width allocation method for multimodal mixed-precision training of large models provided by the present invention. Detailed Implementation

[0022] This invention provides an adaptive bit width allocation method for training large multimodal models with mixed precision, which solves the technical problem in the prior art that the stability of large multimodal models is easily affected when trained with a fixed precision configuration.

[0023] The technical solution of this invention is to solve the above-mentioned technical problems, and the overall idea is as follows: An adaptive bit-width allocation method for multimodal mixed-precision training of large models includes: acquiring the training state information of the target multimodal large model and dividing it into several training computation units; calculating the multimodal precision sensitivity of each training computation unit based on the training state information; determining the target precision configuration of the corresponding training computation unit based on the multimodal precision sensitivity and training resource constraints, wherein the precision configuration includes data type and corresponding bit width; performing mixed-precision training according to the target precision configuration; when a preset number of training epochs is reached or the training loss meets the convergence condition, outputting the trained target multimodal large model; and using the trained target multimodal large model for inference on text tasks, image tasks, or speech tasks, and outputting the corresponding task processing results.

[0024] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0025] First, it should be clarified that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0026] It should be noted that the various thresholds, preset values, or preset weights in this invention can be determined based on actual conditions, experiments, or historical values, and are not limited in this invention.

[0027] This invention provides, for example Figure 1 The adaptive bit width allocation method shown for training large-scale multimodal mixed-precision models includes steps S11-S14: Step S11: Obtain the training state information of the target multimodal large model and divide it into several training computation units.

[0028] This includes: dividing the target multimodal large model into training computation units based on the network structure of the target multimodal large model, wherein each training computation unit can be configured with numerical precision independently; Collect training state information during the training process of the target multimodal large model, including: , in, Indicates the first In the training cycle, the first Training state information of each training computation unit. Indicates the training period. Indicates the first In the training cycle, the first The weights of each training computation unit, Indicates the first In the training cycle, the first Activation of each training computational unit, Indicates the first In the training cycle, the first The gradient of each training computation unit, Indicates the first Training loss per training cycle.

[0029] Specifically: Obtain the network structure of the target multimodal large model, and divide the target multimodal large model into several training computing units according to the data processing function and modality affiliation of each network node in the network structure.

[0030] The training computation unit is a computation node or several consecutive computation nodes that can be independently configured with numerical precision, and may include modality coding computation unit, cross-modality fusion computation unit, and multimodality output computation unit.

[0031] Taking the image-text multimodal large model as an example, the image patch embedding part, attention calculation part and feedforward network part in the visual encoder can be divided into corresponding training calculation units, the attention calculation part and feedforward network part in the text encoder or text decoder can be divided into corresponding training calculation units, and the cross-attention part and multimodal projection part used to realize the interaction between image features and text features can be divided into corresponding training calculation units.

[0032] Furthermore, during the training process of the target multimodal large model, the training state information corresponding to each training computation unit is collected according to the preset training cycle. The training state information includes at least the weights, activations, gradients of the corresponding training computation unit and the training loss of the target multimodal large model.

[0033] Here, the weights are the model parameters that the training computation unit participates in the model computation, the activation is the intermediate computation result generated during the forward computation of the training computation unit, the gradient is the parameter update information obtained when backpropagating based on the training loss, and the training loss is used to characterize the difference between the current training result of the target multimodal large model and the training target.

[0034] Step S12: Calculate the multimodal accuracy sensitivity of each training computation unit based on the training state information.

[0035] Several candidate precision configurations are set for each training computation unit, including: , in, Indicates the first Candidate precision configuration for each training computation unit. For the first The precision of candidate numerical values ​​corresponding to the weights of each training computation unit. For the first The candidate numerical precision corresponding to the activation of each training computation unit. For the first The candidate numerical precision corresponding to the gradient of each training computation unit, wherein the candidate numerical precision is one of FP16, BF16, FP8, INT8 or INT4; Configure according to candidate precision Simulated low-precision calculations are performed on the corresponding training computation units, and the resulting numerical errors, gradient propagation changes, training loss perturbations, and modality alignment loss perturbations are determined, including: Based on the candidate precision configuration, the weights, activations and gradients in the corresponding training computation units are mapped with low precision to obtain the corresponding low precision training tensors. The numerical error of the training computation unit is determined based on the difference between each low-precision training tensor and the corresponding original training tensor. The gradient propagation change of the training computation unit is determined based on the change between the gradient under the baseline accuracy condition and the gradient under the candidate accuracy configuration. The training loss perturbation corresponding to the training computation unit is determined based on the difference between the training loss under the baseline accuracy condition and the training loss under the candidate accuracy configuration. Based on the difference between the modal alignment loss under the baseline accuracy condition and the modal alignment loss under the candidate accuracy configuration, the modal alignment loss perturbation corresponding to the training computation unit is determined.

[0036] The multimodal accuracy sensitivity of the training computation unit is calculated based on numerical error, gradient propagation changes, training loss perturbation, and modal alignment loss perturbation, including: , in, Indicates the first Each training computation unit employs a candidate precision configuration. Multimodal accuracy sensitivity during time, Indicates the first Each training computation unit employs a candidate precision configuration. Numerical error, For the first Each training computation unit employs a candidate precision configuration. Gradient propagation changes, For the first Each training computation unit employs a candidate precision configuration. Training loss perturbation, For the first Each training computation unit employs a candidate precision configuration. The modal alignment loss perturbation.

[0037] Specifically: For each training computation unit obtained by partitioning, several candidate precision configurations are set. Each candidate precision configuration limits the candidate numerical precision corresponding to the weights, activations and gradients of the training computation unit. The candidate numerical precision can be one of FP16, BF16, FP8, INT8 or INT4.

[0038] Different training computation units can be configured with the same or different candidate precision settings. By changing the candidate numerical precision of weights, activations, and gradients respectively, the training state changes of different training computation units under different numerical precision conditions can be evaluated, providing a basis for subsequently determining the target precision configuration for each training computation unit.

[0039] For any training computation unit, perform simulated low-precision computation on the training computation unit according to the corresponding candidate precision configuration.

[0040] Specifically, based on the candidate precision configuration, the weights, activations, and gradients in the training computation unit are mapped with low precision to obtain the corresponding low-precision training tensors.

[0041] When the candidate value precision is INT8 or INT4, the value representation range can be determined according to the corresponding bit width, and low-precision mapping can be completed through scaling, rounding and truncation. When the precision of the candidate value is FP16, BF16 or FP8, the value conversion can be performed according to the corresponding floating-point data format.

[0042] Further, based on the difference between the low-precision training tensor and the corresponding original training tensor, the low-precision errors generated by the weights, activations and gradients are determined respectively, and each low-precision error is weighted to obtain the numerical error of the training computation unit when using the current candidate precision configuration.

[0043] Furthermore, based on the acquired training state information, the gradient propagation changes and training loss perturbations caused by the candidate precision configuration are determined.

[0044] Under the same training data conditions, training calculations are performed using the baseline precision and the current candidate precision configuration respectively. The corresponding gradient propagation change is determined based on the directional change between the gradient under the baseline precision condition and the gradient under the candidate precision configuration (referring to the degree of deviation of the gradient under the baseline precision condition and the gradient under the candidate precision configuration in the parameter space, which can be determined based on their cosine similarity). Meanwhile, based on the relative difference between the training loss under the baseline accuracy condition and the training loss under the candidate accuracy configuration, the corresponding training loss perturbation is determined.

[0045] The greater the change in gradient propagation or the perturbation of training loss, the more significant the impact of reducing the numerical accuracy of the training computation unit on the training process of the target multimodal large model.

[0046] Furthermore, based on the feature interaction relationships between different modes in the target multimodal large model, the modal alignment loss perturbation corresponding to the candidate accuracy configuration is determined.

[0047] Modality alignment loss is used to characterize the semantic consistency between different modality features. Modality alignment loss can be determined based on the cosine distance between different modality features, the contrastive learning loss, or other cross-modality feature distances (for example, the modality alignment loss can be calculated using the cosine distance or contrastive learning loss between image features and text features).

[0048] Under the same training data conditions, the modal alignment loss under the baseline accuracy condition and the modal alignment loss under the current candidate accuracy configuration are obtained respectively, and the modal alignment loss perturbation is determined based on the difference between the two.

[0049] Therefore, when a training computation unit significantly affects the semantic alignment relationship between different modalities by reducing its numerical precision, even if its numerical error is small, the modal alignment loss perturbation can reflect its sensitivity to the current candidate precision configuration.

[0050] Finally, the numerical error, gradient propagation changes, training loss perturbation, and modal alignment loss perturbation are normalized and weighted according to their respective contribution weights to obtain the multimodal accuracy sensitivity of each training computation unit under the corresponding candidate accuracy configuration.

[0051] The higher the multimodal precision sensitivity, the more obvious the changes in training state and multimodal semantic alignment are after the training computation unit adopts the current candidate precision configuration, that is, the more sensitive the training computation unit is to the current candidate precision configuration; conversely, the lower the multimodal precision sensitivity, the higher the degree of adaptation of the training computation unit to the current candidate precision configuration.

[0052] Step S13: Based on the multimodal precision sensitivity and training resource constraints, determine the target precision configuration of the corresponding training computing unit, wherein the precision configuration includes the data type and the corresponding bit width.

[0053] include: Based on the multimodal precision sensitivity of each training computation unit under different candidate precision configurations, candidate precision configurations are filtered to obtain a set of candidate precision configurations for each training computation unit, including: The different candidate precision configurations of the training computation unit are classified into high candidate precision configuration, medium candidate precision configuration and low candidate precision configuration; If the multimodal accuracy sensitivity of a low candidate accuracy configuration is greater than the first sensitivity threshold, then the low candidate accuracy configuration is removed; otherwise, it is retained. If the multimodal precision sensitivity of a candidate precision configuration is greater than the second sensitivity threshold, then that candidate precision configuration is removed; otherwise, it is retained. The second sensitivity threshold is greater than the first sensitivity threshold. High-precision candidate configurations are retained, and the retained candidate precision configurations after screening are combined into a set of candidate precision configurations for the corresponding training computation unit.

[0054] Based on the candidate precision configuration set corresponding to each training computation unit, several model-level candidate precision configurations are obtained by combining them, and the training memory usage, training computation overhead, and training communication overhead corresponding to each model-level candidate precision configuration are determined. Normalize (Min-Max normalization or Z-score standardization can be used to convert them to a uniform numerical scale) and weight the training memory usage, training computation overhead and training communication overhead to obtain the comprehensive training resource overhead corresponding to each model-level candidate accuracy configuration. The model-level multimodal accuracy sensitivity corresponding to the candidate accuracy configuration is determined based on the multimodal accuracy sensitivity of the candidate accuracy configuration selected by each training computation unit. In the model-level candidate accuracy configurations that meet preset training resource constraints, the target accuracy configuration is determined based on the comprehensive training resource overhead and the model-level multimodal accuracy sensitivity, including: , in, Configured for target accuracy. A set of model-level candidate accuracy configurations to meet preset training resource constraints. To configure any model-level candidate accuracy to meet preset training resource constraints. To cover the overall training resource expenditure, To preset the balance coefficient, For model-level multimodal accuracy sensitivity.

[0055] Specifically: Based on the data type and the numerical precision represented by the corresponding bit width, the candidate precision configuration can be divided into high candidate precision configuration, medium candidate precision configuration and low candidate precision configuration. For example, the candidate precision configuration corresponding to FP16 or BF16 can be used as the high candidate precision configuration, the candidate precision configuration corresponding to FP8 can be used as the medium candidate precision configuration, and the candidate precision configuration corresponding to INT8 or INT4 can be used as the low candidate precision configuration. The specific classification method can be determined according to the data types supported by the target multimodal large model and the training hardware.

[0056] For low candidate precision configurations, if the corresponding multimodal precision sensitivity is greater than the first sensitivity threshold, it indicates that using this candidate precision configuration is likely to have a significant impact on the training process, so it is removed. For medium candidate precision configurations, the second sensitivity threshold is used for screening. High candidate precision configurations are retained, thus obtaining the candidate precision configuration set corresponding to each training computation unit.

[0057] Furthermore, a candidate precision configuration is selected from the candidate precision configuration set corresponding to each training computation unit, and combined according to the correspondence between the training computation units to form a model-level candidate precision configuration. Here, a model-level candidate precision configuration is used to characterize the data type and corresponding bit width adopted by each training computation unit in the target multimodal large model.

[0058] For each model-level candidate accuracy configuration, its training memory usage, training computation overhead, and training communication overhead are determined separately.

[0059] The training memory usage can be determined based on the amount of data and bit width of the weights, activations, gradients, and optimizer states corresponding to each training computation unit; the training computation overhead can be determined based on the computational load of each training computation unit, the data type used, and the computational performance of the corresponding training hardware; and the training communication overhead can be determined based on the amount of data of gradients, activations, or model parameters that need to be transmitted during distributed training, the corresponding bit width, and the number of communication attempts.

[0060] Furthermore, since the dimensions and numerical ranges of training memory usage, training computation overhead, and training communication overhead are different, the three are normalized and weighted according to the preset resource contribution weights to obtain the comprehensive training resource overhead corresponding to each model-level candidate accuracy configuration.

[0061] Simultaneously, the model-level multimodal accuracy sensitivity is determined based on the candidate accuracy configurations adopted by each training computation unit that constitutes the model-level candidate accuracy configuration and their corresponding multimodal accuracy sensitivity.

[0062] For example, the multimodal accuracy sensitivity corresponding to each training computation unit can be weighted and summed or weighted and averaged. The weights corresponding to each training computation unit can be pre-set according to its parameter quantity, computational quantity or functional importance in the target multimodal large model, so as to characterize the overall influence of the current model-level candidate accuracy configuration on the training accuracy and training stability of the target multimodal large model.

[0063] Furthermore, the candidate accuracy configurations for each model level are screened according to preset training resource constraints. The preset training resource constraints may include at least one of the following: the upper limit of available video memory, the upper limit of allowed training computation overhead, and the upper limit of training communication overhead.

[0064] When the training resource overhead corresponding to any model-level candidate accuracy configuration exceeds the corresponding preset training resource constraint, the model-level candidate accuracy configuration is removed; the model-level candidate accuracy configurations that meet the preset training resource constraint are combined into a model-level candidate accuracy configuration set, thereby ensuring that the target accuracy configuration determined subsequently can be executed under the current training hardware and training resource conditions.

[0065] In the model-level candidate accuracy configurations that meet preset training resource constraints, the target accuracy configuration is determined based on the comprehensive training resource overhead and the model-level multimodal accuracy sensitivity, including: , The preset balance coefficient is used to adjust the relative influence of training resource overhead and accuracy sensitivity in the selection process of target accuracy configuration. By comparing the joint optimization results corresponding to different model-level candidate accuracy configurations, the model-level candidate accuracy configuration that minimizes the weighted result of the comprehensive training resource overhead and model-level multimodal accuracy sensitivity is selected as the target accuracy configuration. This ensures that, under the condition of satisfying training resource constraints, the low-precision training efficiency of the target multimodal large model is balanced with training accuracy and stability.

[0066] Step S14: Perform mixed precision training according to the target precision configuration. When the preset training rounds are reached or the training loss meets the convergence condition, output the trained target multimodal large model and use the trained target multimodal large model for inference on text tasks, image tasks or speech tasks, and output the corresponding task processing results.

[0067] This includes: performing forward propagation, backward propagation, and parameter updates based on the target accuracy configuration; The multimodal accuracy sensitivity of each training computing unit is redefined according to the preset accuracy adjustment cycle, and the accuracy configuration of the corresponding training computing unit is increased, maintained, or decreased based on the multimodal accuracy sensitivity. Continue mixed-precision training based on the adjusted precision configuration until the preset training rounds are reached or the training loss meets the convergence condition, and output the target multimodal large model.

[0068] Specifically: During forward propagation, the weights and activations are calculated with the corresponding precision according to the target precision configuration of each training computation unit; during backpropagation, the gradients are calculated and propagated according to the corresponding target precision configuration; and the model parameters are updated based on the gradients obtained from backpropagation.

[0069] For training computation units with high requirements for numerical stability, high numerical accuracy can be maintained, while for training computation units with low sensitivity to multimodal accuracy, lower numerical accuracy can be used. This reduces training resource overhead while maintaining the training accuracy and stability of the target multimodal large model. Specifically, preset values ​​can be set before training.

[0070] Furthermore, during the mixed precision training process, the updated training status information of each training computing unit is collected according to the preset precision adjustment cycle, and the multimodal precision sensitivity of each training computing unit under the corresponding candidate precision configuration is re-determined according to the processing method in step S12.

[0071] The precision configuration of each training computation unit is dynamically adjusted based on the redefined multimodal precision sensitivity: when the multimodal precision sensitivity increases and exceeds the corresponding sensitivity threshold, the data type and / or bit width of the corresponding training computation unit can be increased; when the multimodal precision sensitivity is within a preset stable range, the current precision configuration is maintained; when the multimodal precision sensitivity decreases to below the corresponding sensitivity threshold, the data type and / or bit width of the corresponding training computation unit can be decreased.

[0072] After the accuracy adjustment is completed, forward propagation, backward propagation and parameter updates are performed according to the adjusted accuracy configuration, so that the accuracy configuration can dynamically change with the training state of the target multimodal large model.

[0073] When the mixed-precision training reaches the preset training rounds or the training loss meets the preset convergence condition, the training ends and the trained target multimodal large model is output.

[0074] The convergence condition can be that the training loss is lower than a preset loss threshold, or that the change in training loss over several consecutive training rounds is lower than a preset change threshold.

[0075] The trained target multimodal large model can be used for inference on text tasks, image tasks, or speech tasks according to its training task. For example, it can perform text generation, image recognition, image-text understanding, or speech recognition, and output the corresponding task processing results.

[0076] For example, after training the image-text multimodal large model, the image data and / or text data to be processed are input into the trained target multimodal large model. Image features and text features are extracted through the corresponding modality coding part, and the image features and text features are associated and fused through the cross-modal fusion part to obtain the multimodal joint representation. Based on the multimodal joint representation, image recognition, image-text matching, visual question answering, or image content description tasks are performed, and the corresponding category recognition results, image-text matching results, question answering results, or image content description results are output, thereby realizing the processing of actual image and text data.

[0077] In summary, this invention divides the target multimodal large model into several training computation units that can independently configure numerical accuracy, and combines the training state information such as weights, activations, gradients, and training losses of each training computation unit to determine the multimodal accuracy sensitivity from multiple dimensions such as numerical error, gradient propagation changes, training loss perturbations, and modal alignment loss perturbations.

[0078] This invention can further consider the different sensitivity of different training computing units to low-precision computation. In particular, it reflects the impact of low-precision computation on the semantic relationship between different modalities through modal alignment loss perturbation, thereby more accurately identifying training computing units that are sensitive to numerical precision. This provides a basis for different data types and bit width configurations for different training computing units, which is beneficial to reducing the impact of low-precision computation on the training accuracy and stability of multimodal large models.

[0079] The present invention further filters candidate precision configurations based on the multimodal precision sensitivity of each training computing unit, and determines the target precision configuration by comprehensively considering training memory usage, training computing overhead, and training communication overhead, while meeting the preset training resource constraints. This enables different training computing units to adopt appropriate data types and bit widths according to their own precision sensitivity, thereby achieving coordination between training performance and training resource overhead.

[0080] In the mixed-precision training process, the present invention redetermines the multimodal precision sensitivity according to a preset precision adjustment cycle, and dynamically increases, maintains or decreases the precision configuration of the corresponding training computing unit, so that the precision configuration can be adaptively adjusted as the model training state changes.

[0081] Based on the same inventive concept, this invention provides an adaptive bit-width allocation system for training large-scale multimodal mixed-precision models, comprising: The computational unit partitioning module is used to obtain the training state information of the target multimodal large model and divide it into several training computational units. The sensitivity determination module is used to calculate the multimodal accuracy sensitivity of each training computation unit based on the training state information. The precision configuration determination module is used to determine the target precision configuration of the corresponding training computing unit based on the multimodal precision sensitivity and training resource constraints. The precision configuration includes the data type and the corresponding bit width. The training module is used to perform mixed-precision training according to the target precision configuration. When the preset training rounds are reached or the training loss meets the convergence condition, the trained target multimodal large model is output. The trained target multimodal large model is then used for inference on text tasks, image tasks, or speech tasks, and the corresponding task processing results are output.

[0082] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0083] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. An adaptive bit width allocation method applied to multimodal mixed-precision training of large models, characterized in that, include: The training state information of the target multimodal large model is obtained and divided into several training computation units; Based on the training state information, calculate the multimodal accuracy sensitivity of each training computation unit; Based on multimodal precision sensitivity and training resource constraints, the target precision configuration of the corresponding training computing unit is determined, wherein the precision configuration includes data type and corresponding bit width; Mixed-precision training is performed based on the target precision configuration. When the preset training rounds are reached or the training loss meets the convergence condition, the trained target multimodal large model is output. The trained target multimodal large model is then used for inference on text tasks, image tasks, or speech tasks, and the corresponding task processing results are output.

2. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 1, characterized in that, The training state information of the target multimodal large model is obtained and divided into several training computation units, including: Based on the network structure of the target multimodal large model, the target multimodal large model is divided into training computation units, where each training computation unit can be configured with numerical precision independently. Collect training state information during the training process of the target multimodal large model, including: , in, Indicates the first In the training cycle, the first Training state information of each training computation unit. Indicates the training period. Indicates the first In the training cycle, the first The weights of each training computation unit, Indicates the first In the training cycle, the first Activation of each training computational unit, Indicates the first In the training cycle, the first The gradient of each training computation unit, Indicates the first Training loss per training cycle.

3. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 1, characterized in that, Based on the training state information, the multimodal accuracy sensitivity of each training computation unit is calculated, including: Several candidate precision configurations are set for each training computation unit, including: , in, Indicates the first Candidate precision configuration for each training computation unit. For the first The precision of candidate numerical values ​​corresponding to the weights of each training computation unit. For the first The candidate numerical precision corresponding to the activation of each training computation unit. For the first The candidate numerical precision corresponding to the gradient of each training computation unit, wherein the candidate numerical precision is one of FP16, BF16, FP8, INT8 or INT4; Configure according to candidate precision Perform simulated low-precision calculations on the corresponding training computation units and determine the resulting numerical errors, gradient propagation changes, training loss perturbations, and modality alignment loss perturbations, respectively. The multimodal accuracy sensitivity of the training computation unit is calculated based on numerical error, gradient propagation changes, training loss perturbation, and modal alignment loss perturbation.

4. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 3, characterized in that, Configure according to candidate precision Simulated low-precision calculations are performed on the corresponding training computation units, and the resulting numerical errors, gradient propagation changes, training loss perturbations, and modality alignment loss perturbations are determined, including: Based on the candidate precision configuration, the weights, activations and gradients in the corresponding training computation units are mapped with low precision to obtain the corresponding low precision training tensors. The numerical error of the training computation unit is determined based on the difference between each low-precision training tensor and the corresponding original training tensor. The gradient propagation change of the training computation unit is determined based on the change between the gradient under the baseline accuracy condition and the gradient under the candidate accuracy configuration. The training loss perturbation corresponding to the training computation unit is determined based on the difference between the training loss under the baseline accuracy condition and the training loss under the candidate accuracy configuration. Based on the difference between the modal alignment loss under the baseline accuracy condition and the modal alignment loss under the candidate accuracy configuration, the modal alignment loss perturbation corresponding to the training computation unit is determined.

5. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 4, characterized in that, The multimodal accuracy sensitivity of the training computation unit is calculated based on numerical error, gradient propagation changes, training loss perturbation, and modal alignment loss perturbation, including: , in, Indicates the first Each training computation unit employs a candidate precision configuration. Multimodal accuracy sensitivity during time, Indicates the first Each training computation unit employs a candidate precision configuration. Numerical error, For the first Each training computation unit employs gradient propagation changes based on candidate precision configurations. For the first Each training computation unit employs a candidate precision configuration. Training loss perturbation, For the first Each training computation unit employs a candidate precision configuration. The modal alignment loss perturbation.

6. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 5, characterized in that, Based on multimodal accuracy sensitivity and training resource constraints, the target accuracy configuration of the corresponding training computation units is determined, including: Based on the multimodal precision sensitivity of each training computation unit under different candidate precision configurations, the candidate precision configurations are filtered to obtain the candidate precision configuration set corresponding to each training computation unit. Based on the candidate precision configuration set corresponding to each training computation unit, several model-level candidate precision configurations are obtained by combining them, and the training memory usage, training computation overhead, and training communication overhead corresponding to each model-level candidate precision configuration are determined. The training memory usage, training computation overhead, and training communication overhead are normalized and weighted to obtain the comprehensive training resource overhead corresponding to each model-level candidate accuracy configuration. The model-level multimodal accuracy sensitivity corresponding to the candidate accuracy configuration is determined based on the multimodal accuracy sensitivity of the candidate accuracy configuration selected by each training computation unit. In the model-level candidate accuracy configuration that meets the preset training resource constraints, the target accuracy configuration is determined based on the comprehensive training resource overhead and the model-level multimodal accuracy sensitivity.

7. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 6, characterized in that, Based on the multimodal precision sensitivity of each training computation unit under different candidate precision configurations, candidate precision configurations are filtered to obtain a set of candidate precision configurations for each training computation unit, including: The different candidate precision configurations of the training computation unit are classified into high candidate precision configuration, medium candidate precision configuration and low candidate precision configuration; If the multimodal accuracy sensitivity of a low candidate accuracy configuration is greater than the first sensitivity threshold, then the low candidate accuracy configuration is removed; otherwise, it is retained. If the multimodal precision sensitivity of a candidate precision configuration is greater than the second sensitivity threshold, then that candidate precision configuration is removed; otherwise, it is retained. The second sensitivity threshold is greater than the first sensitivity threshold. High-precision candidate configurations are retained, and the retained candidate precision configurations after screening are combined into a set of candidate precision configurations for the corresponding training computation unit.

8. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 6, characterized in that, The target accuracy configuration is determined based on the overall training resource overhead and model-level multimodal accuracy sensitivity, including: , in, Configured for target accuracy. A set of model-level candidate accuracy configurations to meet preset training resource constraints. To configure any model-level candidate accuracy to meet preset training resource constraints. To cover the overall training resource expenditure, To preset the balance coefficient, For model-level multimodal accuracy sensitivity.

9. The adaptive bit width allocation method for multimodal mixed-precision training of large models as described in claim 1, characterized in that, Hybrid precision training is performed according to the target precision configuration. When the preset training epochs are reached or the training loss meets the convergence condition, the target multimodal large model is output, including: Based on the target accuracy configuration, perform forward propagation, backward propagation, and parameter updates; The multimodal precision sensitivity of each training computing unit is redefined according to the preset precision adjustment cycle, and the precision configuration of the corresponding training computing unit is increased, maintained, or decreased according to the multimodal precision sensitivity. Continue mixed-precision training according to the adjusted precision configuration until the preset training rounds are reached or the training loss meets the convergence condition, and output the target multimodal large model.

10. An adaptive bit-width allocation system for training large-scale multimodal mixed-precision models, characterized in that, include: The computational unit partitioning module is used to obtain the training state information of the target multimodal large model and divide it into several training computational units. The sensitivity determination module is used to calculate the multimodal accuracy sensitivity of each training computation unit based on the training state information. The precision configuration determination module is used to determine the target precision configuration of the corresponding training computing unit based on the multimodal precision sensitivity and training resource constraints. The precision configuration includes the data type and the corresponding bit width. The training module is used to perform mixed-precision training according to the target precision configuration. When the preset training rounds are reached or the training loss meets the convergence condition, the trained target multimodal large model is output. The trained target multimodal large model is then used for inference on text tasks, image tasks, or speech tasks, and the corresponding task processing results are output.