Adaptive optimization method and system for training process of multi-modal large model
By dynamically adjusting the training strategy of multimodal large models, the problem that training strategies in the existing technology cannot adapt to them is solved, and more efficient model training and better performance are achieved.
Patent Information
- Application Number
- CN202411561472.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-14
AI Technical Summary
The existing large-scale parallel training technology cannot dynamically adjust the model training strategy based on actual conditions and changing factors, resulting in inefficient multimodal large model training and inability to achieve optimal results.
By receiving training execution scripts and strategies for multimodal large models, using pre-stored large model training scripts to execute distributed training tasks, obtain real-time monitoring data, and dynamically adjust training strategies based on these data, including adjusting video memory usage, learning rate and parallelism, including adjusting video memory usage, learning rate and parallelism Training strategies.
By dynamically adjusting the training strategy in real time, the waste of computing resources is avoided, the model training time is shortened, the training efficiency is improved, and the accuracy and generalization ability of multimodal large models are improved.
Smart Images

Figure CN119443193A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of neural network technology, and in particular to a method and system for adaptively optimizing the training process of a multi-modal large model. Background Art
[0002] In recent years, deep learning technology has made significant progress in various fields, especially in natural language processing, computer vision, and reinforcement learning. Deep learning frameworks have become widely used tools in research and industry. These frameworks provide rich application programming interface APIs and flexible programming models, allowing researchers and developers to easily design and train complex neural networks.
[0003] However, as the size of models continues to grow, traditional deep learning frameworks face limitations in graphics memory and computing resources when processing large-scale data and complex models.
[0004] Although existing large-scale parallel training technologies have solved the problems of resource utilization and training efficiency to a certain extent, they mostly rely on pre-set parameters and strategies, and cannot autonomously and flexibly adjust the model training strategies according to actual conditions and various changing factors, and lack the ability to adapt to dynamic changes in the training process. In practical applications, model training is often affected by multiple factors such as data distribution and hardware environment, and fixed training strategies may not achieve the best results. Summary of the invention
[0005] The present invention provides a method and system for adaptively optimizing the training process of a multimodal large model, so as to solve the defect that the large-scale parallel training technology in the prior art cannot adjust the strategy for model training according to the actual situation and various changing factors, resulting in that the multimodal large model training cannot achieve the optimal effect.
[0006] The present invention provides a method for adaptively optimizing a training process of a multimodal large model, comprising: Receive the submitted training execution script and training strategy of the multimodal large model; the training execution script is used to provide the information required for the distributed training task; According to the training execution script and the training strategy, the distributed training task is executed using a pre-stored large model training script to generate a multimodal large model; the large model training script is used to define the process of the distributed training task; Obtain real-time monitoring data generated during the execution of distributed training tasks; The training strategy is adjusted based on the real-time monitoring data, and the distributed training task is continued to be executed using the large model training script according to the large model training execution script and the adjusted training strategy, until a trained multimodal large model is obtained.
[0007] According to the adaptive optimization method for the training process of a multimodal large model provided by the present invention, real-time monitoring data generated in the process of executing a distributed training task is obtained, including: obtaining the amount of video memory usage and the number of video memory usage layers generated in the process of executing the distributed training task; The training strategy is adjusted based on real-time monitoring data, including: comparing the video memory usage with a set video memory threshold to determine whether the number of video memory usage layers needs to be adjusted; if it is determined that the video memory usage needs to be adjusted, calling a corresponding video memory adjustment function to adjust the number of video memory usage layers.
[0008] According to the adaptive optimization method for the training process of a multimodal large model provided by the present invention, real-time monitoring data generated during the execution of a distributed training task is obtained, including: Get the learning rate generated during the execution of distributed training tasks; Adjusting the training strategy based on real-time monitoring data includes: based on the learning rate, determining whether the user has provided a custom setting for the learning rate; if so, adjusting the learning rate according to the user's learning rate adjustment instruction; if not, automatically adjusting the learning rate according to a predefined learning rate setting value.
[0009] According to the adaptive optimization method for the training process of a multimodal large model provided by the present invention, real-time monitoring data generated in the process of executing a distributed training task is obtained, including: obtaining gradient information, loss value, and accuracy rate generated in the process of executing the distributed training task; Adjust the training strategy based on real-time monitoring data, including: According to the gradient information, loss value and accuracy, determine whether it is necessary to adjust the parallel training strategy; wherein the parallel training strategy includes a model parallel strategy, a data parallel strategy and a pipeline parallel strategy; When it is determined that the parallel training strategy needs to be adjusted, the parallel training strategy is adjusted according to the strategy adjustment instruction input by the user.
[0010] According to the adaptive optimization method for the training process of a multimodal large model provided by the present invention, the distributed training task is executed using a pre-stored large model training script according to the training execution script and the training strategy, specifically including: According to the training execution script and the training strategy, the training data is obtained in the distributed cloud platform, the distributed training task is executed using the pre-stored large model training script, and the generated real-time monitoring data is stored in the storage cluster of the distributed cloud platform; Obtain real-time monitoring data generated during the execution of distributed training tasks, including: The real-time monitoring data generated during the execution of the distributed training task is obtained in the storage cluster of the distributed cloud platform.
[0011] According to the adaptive optimization method for the training process of a multimodal large model provided by the present invention, after acquiring the real-time monitoring data generated in the process of executing a distributed training task, the method further includes: performing feature extraction and analysis based on the real-time monitoring data, and displaying the analysis results.
[0012] The present invention also provides a multi-modal large model training process adaptive optimization system, comprising: A training data receiving module, used to receive a submitted training execution script and training strategy for a multimodal large model, wherein the training execution script is used to provide information required for a distributed training task; A training task execution module, used to execute the distributed training task using a pre-stored large model training script according to the training execution script and the training strategy to generate a multimodal large model; the large model training script is used to define the process of the distributed training task; A monitoring data acquisition module is used to obtain real-time monitoring data generated during the execution of distributed training tasks; The training strategy adjustment module is used to adjust the training strategy based on real-time monitoring data, and according to the large model training execution script and the adjusted training strategy, the large model training script is used to continue to execute the distributed training task until a trained multimodal large model is obtained.
[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, it implements a method for adaptively optimizing the training process of a multimodal large model as described in any one of the above.
[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 adaptively optimizing the training process of a multimodal large model as described in any one of the above.
[0015] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the adaptive optimization method for the training process of any of the multimodal large models described above.
[0016] The method and system for adaptively optimizing the training process of a multimodal large model provided by the present invention receive a submitted training execution script and a training strategy of a multimodal large model; execute distributed training tasks using a pre-stored large model training script according to the training execution script and the training strategy to generate a multimodal large model; obtain real-time monitoring data generated in the process of executing the distributed training tasks; adjust the training strategy based on the real-time monitoring data; avoid unnecessary waste of computing resources by dynamically adjusting the training strategy in real time, shorten the training time of the model, and improve the training efficiency; then continue to execute the distributed training tasks according to the large model training execution script and the adjusted training strategy until a trained multimodal large model is obtained. Since the model can be adaptively optimized according to the characteristics of the monitoring data, the accuracy and generalization ability of the multimodal large model finally obtained are improved. 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 flow chart of the adaptive optimization method for the training process of a multimodal large model provided by the present invention.
[0019] Figure 2 It is a schematic diagram of the architecture of the system used in the adaptive optimization method for the training process of the multimodal large model provided by the present invention.
[0020] Figure 3 It is a structural schematic diagram of the adaptive optimization system for the training process of the multimodal large model provided by the present invention.
[0021] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] 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.
[0023] First, the terms involved in the present invention are schematically explained.
[0024] Megatron-DeepSpeed: is a powerful and efficient open source deep learning framework that combines the advantages of Megatron-LM and DeepSpeed, aiming to accelerate the training and reasoning process of large-scale pre-trained models. Megatron-DeepSpeed combines the core features of two well-known projects.
[0025] Among them, Megatron-LM: focuses on large-scale parallel training, supports data parallelism, model parallelism and hybrid parallelism strategies, and effectively utilizes distributed cluster resources.
[0026] DeepSpeed: is an optimized PyTorch training library that provides various advanced optimizers, tensor splitting, zero redundancy optimization (ZeRO) and other tools, which significantly reduces video memory usage and improves training speed.
[0027] GPU: Graphics Processing Unit, also known as display core, visual processor, display chip. It is a microprocessor that specializes in image and graphics related computing on personal computers, workstations, game consoles and some mobile devices (such as tablets, smartphones, etc.). Compared with CPU, GPU has more computing cores and higher parallel processing capabilities, which is very suitable for handling large-scale parallel computing tasks.
[0028] Training execution script: used to provide the information required for distributed training tasks, including model parameters, training data, training objectives, etc.
[0029] Large model training script: used to define the process of the distributed training task, including data loading, model initialization, training loop, model saving, etc.
[0030] Distributed training tasks: refers to distributing the training process of a large model to multiple computing nodes to improve training efficiency and the ability to process large-scale data. This training method is particularly suitable for large models and large-scale data sets.
[0031] Multimodal large model: refers to a large model that can process different types of data, such as text, images, audio and other multimodal data.
[0032] The adaptive optimization method of the embodiment of the present invention improves the training efficiency by dynamically adjusting the training strategy in real time during the training process of the large model; and the adjustment of the training strategy can be adaptively optimized according to the characteristics of the monitoring data, thereby improving the accuracy and generalization ability of the multimodal large model.
[0033] Combine the following Figure 1-Figure 2The present invention describes an adaptive optimization method for the training process of a multimodal large model.
[0034] See also Figure 1 , the adaptive optimization method provided by the embodiment of the present invention includes: 101. Receive a submitted training execution script and training strategy for a multimodal large model; the training execution script is used to provide information required for a distributed training task.
[0035] The adaptive optimization method in this embodiment is executed based on the Megatron-DeepSpeed framework.
[0036] Specifically, the training execution script includes: Model definition: specifies parameters such as the number of layers of the model, the type of each layer (such as convolutional layer, recurrent layer, fully connected layer), activation function (such as ReLU, Sigmoid), and pooling strategy.
[0037] Data Description: Lists the paths to the training, validation, and test datasets, as well as the steps for data preprocessing, such as image size normalization, text segmentation, and audio sampling rate conversion.
[0038] Training objective: It sets the evaluation criteria for model performance, such as classification accuracy or regression mean square error, and defines the conditions for stopping training, such as when the performance on the validation set no longer improves.
[0039] Next, this embodiment provides a training strategy, which can be provided by the user at the beginning of the training phase in the initial phase.
[0040] Here are some examples of training strategies: Learning rate scheduling: A learning rate decay schedule is defined with an initial learning rate of 0.01, which is dynamically adjusted after each epoch based on the performance evaluation results.
[0041] Regularization technique: L2 regularization was applied to prevent the model from overfitting, and the regularization coefficient was set.
[0042] Early stopping: If the performance on the validation set does not improve in 5 consecutive epochs, stop training to avoid overfitting.
[0043] In a distributed training environment, this embodiment configures a cluster of 8 GPU nodes, each of which has the necessary deep learning framework and communication library installed. In addition, a distributed data loader can be used, which can load data from multiple hard drives in parallel to reduce I / O bottlenecks.
[0044] Users submit training execution scripts and training strategies through a graphical user interface (GUI). The GUI allows users to upload script files, set training parameters, and start training tasks. Once training starts, the system automatically parses the scripts and strategies, configures the training environment, and executes the training tasks on the GPU cluster of the distributed cloud platform.
[0045] In step 101, the system has received the training execution script and training strategy of the multimodal large model. Next, step 102 will be executed, that is, the specific implementation process of executing the distributed training task.
[0046] 102. According to the training execution script and the training strategy, the distributed training task is executed using a pre-stored large model training script to generate a multimodal large model; the large model training script is used to define the process of the distributed training task.
[0047] Among them, the large model training script includes steps such as data loading, model initialization, training loop, and model saving.
[0048] In an illustrative implementation, a completed distributed training task specifically includes: Initialize the training environment: In a distributed cloud platform environment, the system first initializes the required computing resources. This includes starting multiple computing nodes and allocating GPU resources to each node.
[0049] Loading training data: Using the data loading method specified in the training execution script, the system obtains training data from the storage cluster of the distributed cloud platform. The data may include text, images, and audio files, which are preprocessed and organized into a format suitable for model input.
[0050] Model initialization: Based on the model definition in the training execution script, the system initializes the model parameters on all computing nodes. This may involve loading pre-trained model weights or training from scratch.
[0051] Distributed training script execution: Using the pre-stored large model training script, the system starts to execute distributed training tasks. The script defines the training loop, including forward propagation, loss calculation, back propagation, and parameter update.
[0052] Data parallel processing: To improve training efficiency, the system adopts a data parallel strategy, splitting the training data into multiple batches and processing them in parallel on different computing nodes. Each node calculates the gradient of its data batch and aggregates them through the network to update the global model parameters.
[0053] Model parallel processing: For particularly large models, the system may also adopt a model parallel strategy to distribute different parts of the model to different computing nodes. This approach allows certain layers of the model to be calculated independently on different GPUs, thereby reducing the memory pressure of a single GPU.
[0054] Training monitoring and logging: During the training process, the system monitors key performance indicators in real time as real-time monitoring data, such as loss value, accuracy, and memory usage. The generated real-time monitoring data is stored in the storage cluster of the distributed cloud platform to facilitate subsequent analysis and adjustment of training strategies.
[0055] Model preservation and recovery: According to the preservation strategy in the training strategy, the system saves the current state of the model after each epoch. This includes model parameters, optimizer status, and training progress. These saved models can be restored when training is interrupted to ensure the continuity of training.
[0056] Dynamic adjustment of training strategies: If monitoring data shows that the model training effect is not good, the system will dynamically adjust the training parameters such as learning rate, regularization coefficient or optimizer type according to the instructions in the training strategy. These adjustments are designed to optimize the convergence speed and final performance of the model.
[0057] Training completion and model evaluation: Once the predetermined training cycle or performance indicator is reached, the system completes the training task. The final model is evaluated on the validation set and test set to verify its accuracy and generalization ability.
[0058] 103. Obtain real-time monitoring data generated during the execution of distributed training tasks.
[0059] In step 103, the real-time monitoring data generated during the execution of the distributed training task can be obtained in the storage cluster of the distributed cloud platform.
[0060] During the training process, the system monitors and records key indicators in real time as real-time monitoring data, such as loss value, accuracy, memory usage, and learning rate. If the real-time monitoring data shows that the model performance is stagnant, the method of this embodiment is used to automatically adjust the training strategy, such as reducing the learning rate or changing the regularization coefficient.
[0061] Considering the distributed nature of the training task, this embodiment can design a distributed data collection system. During the training process, each computing node periodically sends real-time monitoring data to the central node or monitoring server. The central node or monitoring server receives data from each computing node and processes it in real time. This includes data aggregation, averaging, maximum / minimum value calculation, etc., in order to better understand the status of the entire training process.
[0062] 104. Adjust the training strategy based on the real-time monitoring data, and continue to execute the distributed training task using the large model training script according to the large model training execution script and the adjusted training strategy, until a trained multimodal large model is obtained.
[0063] Specifically, the adjustments to the training strategy include: Data evaluation: Once the real-time monitoring data is collected, the system first evaluates the data to determine the current status of the model training. This includes checking whether the loss value is decreasing, the accuracy is improving, and whether the resource usage is within a reasonable range.
[0064] Threshold setting: Set thresholds for each key monitoring indicator. When the monitoring data reaches or exceeds these thresholds, the system will automatically trigger the policy adjustment mechanism.
[0065] Performance analysis: Use advanced data analysis techniques, such as machine learning models, to predict training trends and identify factors that may be causing performance degradation.
[0066] Strategy adjustment decision: Based on the results of performance analysis, the training system automatically or under the guidance of the user decides to adjust the strategy. Possible adjustments include changing the learning rate, adjusting the regularization parameters, changing the optimizer algorithm, etc.
[0067] User Interaction: In some cases, the system may require user input to decide how to adjust the training strategy. For example, if model performance stagnates, the user may choose to reduce the learning rate or increase the diversity of the training data.
[0068] Automatic adjustment execution: For automated adjustments, the system will directly modify the training script or parameters and restart the training process. For example, if overfitting is detected, the system may increase the dropout rate or the strength of data augmentation.
[0069] Logging updates: All policy adjustment actions and results will be recorded in the training log for subsequent auditing and analysis.
[0070] Feedback loop: After adjusting the strategy, the system continues to monitor the training process and makes further adjustments based on new data feedback, forming a closed-loop optimization system.
[0071] Model preservation: After each strategy adjustment, if the model performance improves, the system will save the current best model parameters for subsequent comparison and deployment.
[0072] Final evaluation: When the training reaches the predetermined number of iterations or performance indicators, the system performs a final evaluation to determine whether a multimodal model that meets the requirements has been obtained.
[0073] Report Generation: Generates detailed training reports including all key data points during training, detailed records of strategy adjustments, and performance metrics of the final model.
[0074] The adaptive optimization method for the training process of a multimodal large model provided in an embodiment of the present invention receives a submitted training execution script and a training strategy of a multimodal large model; executes a distributed training task using a pre-stored large model training script according to the training execution script and the training strategy to generate a multimodal large model; obtains real-time monitoring data generated in the process of executing the distributed training task; adjusts the training strategy based on the real-time monitoring data; avoids unnecessary waste of computing resources by dynamically adjusting the training strategy in real time, shortens the training time of the model, and improves the training efficiency; and then continues to execute the distributed training task according to the large model training execution script and the adjusted training strategy until a trained multimodal large model is obtained. Since the model can be adaptively optimized according to the characteristics of the monitoring data, the accuracy and generalization ability of the final multimodal large model are improved.
[0075] Furthermore, after acquiring the real-time monitoring data generated in the process of executing the distributed training task, the method further includes: performing feature extraction and analysis based on the real-time monitoring data, and displaying the analysis results.
[0076] Based on the analysis results of the monitoring data, the system may make suggestions for performance optimization, such as adjusting the learning rate, changing the batch size, optimizing the data loading process, etc.
[0077] Specifically, the following embodiments respectively take the video memory usage adjustment strategy, the learning rate adjustment strategy, and the parallel training strategy in the real-time monitoring data as examples to schematically illustrate the adjustment strategy of this embodiment.
[0078] Specifically, for video memory usage, step 103 includes: obtaining video memory usage generated during the execution of the distributed training task; In step 104, the training strategy is adjusted based on the real-time monitoring data, including: comparing the video memory usage with the set video memory threshold to determine whether the number of video memory usage layers needs to be adjusted; if it is determined that the video memory usage needs to be adjusted, calling the corresponding video memory adjustment function to adjust the number of video memory usage layers.
[0079] System administrators or users can set the video memory threshold of the upper limit of video memory usage based on hardware specifications and training requirements to avoid training failures caused by video memory overflow.
[0080] In this embodiment, the system calls a predefined video memory adjustment function, such as adjust_memory_usage_layers(), which dynamically adjusts the number of layers of the model according to the current video memory usage and model structure.
[0081] See the corresponding pseudo code below: / * * Description: Adaptively adjust the training strategy based on the monitoring data provided by the data monitoring module statistic_info: monitoring data provided by the data monitoring module status: used to know whether the function is executed successfully. It can change the corresponding bits through the operation to show whether the corresponding type of policy adjustment is executed correctly. * / status adjust_distributed_setting(statistic_info) { status s_code; / * Adjust the video memory used by the model according to the video memory usage provided by the data monitoring module* / if (statistic_info.dev_mem_usage <min(system_dev_mem_capacity, user_setting__dev_mem_capacity) ) { s_code | = Adjust_memory_usage (true); } else { s_code | = Adjust_memory_usage (false); } / * Adjust learning_rate according to the configuration provided by the user* / if (user_provide_learning_rate_setting){ s_code | = Adjust_learning_rate(true) } / * Adjust according to the parallel strategy provided by the user * / if (user_provide_3d_parallel_setting){ s_code | = Adjust_3D_parallel_setting() } ... / * You can add strategy adjustment code as needed based on user needs* / return s_code;} / * Description: Adjust the video memory used by the model increase_mem : whether to increase the video memory used by the model * / status Adjust_memory_usage(bool increase_dev_mem) { status s_code; ... if(increase_dev_mem) { / / There are many ways to increase video memory. Here is just an example. layer_number++; } else{ layer_numer--; } ... return s_code; } By monitoring and adjusting the usage of video memory, you can avoid program crashes or training interruptions caused by insufficient video memory, ensuring the stability of the training process. In addition, dynamically adjusting the usage of video memory can more efficiently utilize available hardware resources, avoid unnecessary waste of computing resources, and shorten the training time of the model.
[0082] Specifically, for the learning rate, step 103 includes: obtaining a learning rate generated in the process of executing the distributed training task.
[0083] Before training begins, configure the monitoring system to track the updated learning rate value after each epoch. During training, the monitoring agent of each computing node collects the current learning rate in real time and uploads it to the central monitoring system. The system records the historical changes of the learning rate, including the initial value of the learning rate, the decay coefficient, and any changes caused by the adjustment strategy.
[0084] In step 104, the training strategy is adjusted based on the real-time monitoring data, including: based on the learning rate, determining whether the user has provided a custom setting for the learning rate; if so, adjusting the learning rate according to the user's learning rate adjustment instruction; if not, automatically adjusting the learning rate according to a predefined learning rate setting value.
[0085] Specifically, after each epoch, the system checks whether the user provided a custom setting or adjustment instruction for the learning rate.
[0086] If the user has custom settings, call adjust_learning_rate(true) to adjust the learning rate based on the settings provided by the user. For example, the user may decide to lower the learning rate to encourage finer convergence.
[0087] If the user does not provide custom settings, the system will adjust according to a predefined learning rate adjustment strategy. This may include learning rate decay, periodic adjustment, or other adaptive learning rate methods.
[0088] See the corresponding pseudo code below: / * Description: Adjust the learning rate * / status Adjust_learning_rate(bool user_provide) { status s_code; ... if(user_provide){ learning_rate = read_lr_from_user_setting() } else { learning_rate = use_custom_lr_setting() } ... return s_code; } By adjusting the learning rate, the speed at which the model converges to the optimal solution can be accelerated, the training efficiency can be improved, and thus the performance of the model on the validation set and test set can be improved.
[0089] Specifically, for the parallel training strategy, step 103 includes: obtaining gradient information, loss value, and accuracy generated in the process of executing the distributed training task; In step 104, the training strategy is adjusted based on the real-time monitoring data, including: judging whether it is necessary to adjust the parallel training strategy according to the gradient information, loss value and accuracy; wherein the parallel training strategy includes a model parallel strategy, a data parallel strategy and a pipeline parallel strategy; when it is determined that the parallel training strategy needs to be adjusted, adjusting the parallel training strategy according to the strategy adjustment instruction input by the user.
[0090] If the user provides a 3D parallel training strategy setting, call adjust_3D_parallel_setting() to adjust the 3D parallel strategy.
[0091] See the corresponding pseudo code below: / * Description: Adjust 3D parallel strategy status Adjust_3D_parallel_setting() { status s_code; ... 3d_setting = read_user_3d_setting() set_3d_setting(3d_setting) ... return s_code } Among them, 3D parallel training strategies include model parallel strategy, data parallel strategy and pipeline parallel strategy.
[0092] Model parallel strategy: If the model is too large to be trained on a single computing node, the system may need to adjust the model parallel strategy, such as changing the distribution of model layers.
[0093] Data parallel strategy: Adjust the data parallel strategy based on the efficiency of data loading and processing, such as changing the batch size or the number of worker threads for data loading.
[0094] Pipeline parallel strategy: For deep or complex models, the system may need to adjust the pipeline parallel strategy to optimize the utilization of computing resources.
[0095] By adjusting the parallel training strategy and reasonably allocating computing tasks to multiple computing nodes, the computing pressure of a single node can be reduced and the overall computing efficiency can be improved; the time required for model training can be significantly reduced, especially for large-scale data sets and complex model structures; it helps to more efficiently utilize available computing resources, including CPU, GPU, and video memory.
[0096] See also Figure 2 The embodiment of the present invention discloses a method for adaptively optimizing the training process of a multimodal large model, comprising: Step 1: Receive the training execution script and training strategy of the multimodal large model submitted by the user. The training execution script is used to provide the information required for the distributed training task, including model parameters, training data, training objectives, etc.
[0097] Step 2: According to the training execution script and the training strategy, the distributed training task is executed using the pre-stored large model training script to generate a multimodal large model.
[0098] Step 2 uses the large model training script provided by the Megatron-DeepSpeed framework to train the model passed in by the user. This framework can be used to easily start distributed applications.
[0099] The large model training script is used to define the process of the distributed training task. The large model training script includes data loading, model initialization, training loop, and model saving.
[0100] Step 3. The data monitoring module of this embodiment can obtain real-time monitoring data during the training process from the distributed cloud platform storage cluster, such as: step number, loss value, accuracy, tflops, memory usage, etc.
[0101] Step 4: Adjust the training strategy based on real-time monitoring data.
[0102] Step 5: According to the large model training execution script and the adjusted training strategy, use the large model training script to continue to execute the distributed training task until a trained multimodal large model is obtained.
[0103] Among them, steps 2-5 form a scheduling loop. Users can specify the goals to be achieved. For example, when users need to adjust the accuracy of the model to a specified value, they can specify some parameter configurations such as the learning rate, and then these configurations can be used to achieve the purpose of adaptive model training, thereby helping users improve model training efficiency.
[0104] 6. Users can configure the training strategy through this process. The configuration process can be specified at the beginning of training, and users can also dynamically adjust the training strategy by observing the data during the training process.
[0105] 7. Perform feature extraction and analysis based on the real-time monitoring data, and display the analysis results.
[0106] Compared with the prior art, the present invention has the following advantages: 1) Improve training efficiency: By dynamically adjusting parameters and strategies in real time, unnecessary waste of computing resources is avoided and the training time of the model is shortened.
[0107] 2) Improve model performance: The model can be adaptively optimized according to the characteristics of the monitoring data to improve the accuracy and generalization ability of the model.
[0108] The following is a description of the adaptive optimization device for the training process of a multimodal large model provided by the present invention. The adaptive optimization device for the training process of a multimodal large model described below and the adaptive optimization method for the training process of a multimodal large model described above can be referenced to each other.
[0109] The embodiment of the present invention discloses a multi-modal large model training process adaptive optimization system, see Figure 3 ,include: The training data receiving module 301 is used to receive the submitted training execution script and training strategy of the multimodal large model, wherein the training execution script is used to provide the information required for the distributed training task; The training task execution module 302 is used to execute the distributed training task using a pre-stored large model training script according to the training execution script and the training strategy to generate a multimodal large model; the large model training script is used to define the process of the distributed training task; A monitoring data acquisition module 303 is used to acquire real-time monitoring data generated during the execution of a distributed training task; The training strategy adjustment module 304 is used to adjust the training strategy based on real-time monitoring data, and according to the large model training execution script and the adjusted training strategy, continue to execute the distributed training task using the large model training script until a trained multimodal large model is obtained.
[0110] Optionally, the monitoring data acquisition module 303 is specifically used to: obtain the video memory usage and the number of video memory usage layers generated in the process of executing the distributed training task; The training strategy adjustment module 304 is specifically used to: compare the video memory usage with the set video memory threshold to determine whether the number of video memory usage layers needs to be adjusted; if it is determined that the video memory usage needs to be adjusted, call the corresponding video memory adjustment function to adjust the number of video memory usage layers.
[0111] Optionally, the monitoring data acquisition module 303 is specifically used to: obtain a learning rate generated during the execution of the distributed training task; The training strategy adjustment module 304 is specifically used to: based on the learning rate, determine whether the user provides a custom setting for the learning rate; if so, adjust the learning rate according to the user's learning rate adjustment instruction; if not, automatically adjust the learning rate according to a predefined learning rate setting value.
[0112] Optionally, the monitoring data acquisition module 303 is specifically used to: obtain gradient information, loss value and accuracy generated in the process of executing the distributed training task; The training strategy adjustment module 304 is specifically used to: determine whether the parallel training strategy needs to be adjusted based on the gradient information, loss value and accuracy; wherein the parallel training strategy includes a model parallel strategy, a data parallel strategy and a pipeline parallel strategy; when it is determined that the parallel training strategy needs to be adjusted, adjust the parallel training strategy according to the strategy adjustment instruction input by the user.
[0113] Optionally, the training task execution module 302 is specifically used to: obtain training data in the distributed cloud platform according to the training execution script and the training strategy, execute the distributed training task using the pre-stored large model training script, and store the generated real-time monitoring data in the storage cluster of the distributed cloud platform; The monitoring data acquisition module 303 is specifically used to obtain the real-time monitoring data generated in the process of executing the distributed training task in the storage cluster of the distributed cloud platform.
[0114] Optionally, the device further includes: a feature analysis module, which is used to extract and analyze features based on the real-time monitoring data generated in the process of executing the distributed training task after acquiring the real-time monitoring data, and display the analysis results.
[0115] The adaptive optimization system for the training process of a multimodal large model provided in an embodiment of the present invention receives a submitted training execution script and a training strategy of a multimodal large model; executes distributed training tasks using a pre-stored large model training script according to the training execution script and the training strategy to generate a multimodal large model; obtains real-time monitoring data generated in the process of executing the distributed training tasks; adjusts the training strategy based on the real-time monitoring data; avoids unnecessary waste of computing resources by dynamically adjusting the training strategy in real time, shortens the training time of the model, and improves the training efficiency; and then continues to execute the distributed training tasks according to the large model training execution script and the adjusted training strategy until a trained multimodal large model is obtained. Since the model can be adaptively optimized according to the characteristics of the monitoring data, the accuracy and generalization ability of the final multimodal large model are improved.
[0116] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the adaptive optimization method of the training process of the multimodal large model, including: receiving the submitted training execution script and training strategy of the multimodal large model; the training execution script is used to provide the information required for the distributed training task; according to the training execution script and the training strategy, the distributed training task is executed using the pre-stored large model training script to generate the multimodal large model; the large model training script is used to define the process of the distributed training task; obtaining the real-time monitoring data generated in the process of executing the distributed training task; adjusting the training strategy based on the real-time monitoring data, and continuing to execute the distributed training task using the large model training script according to the large model training execution script and the adjusted training strategy until a trained multimodal large model is obtained.
[0117] In addition, the logic instructions in the above-mentioned memory 430 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 this 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, etc. Various media that can store program codes.
[0118] On the other hand, the present invention also provides a computer program product, which includes a computer program, which 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 adaptive optimization method of the training process of the multimodal large model provided by the above methods, including: receiving a submitted training execution script and training strategy of the multimodal large model; the training execution script is used to provide the information required for the distributed training task; according to the training execution script and the training strategy, the distributed training task is executed using a pre-stored large model training script to generate a multimodal large model; the large model training script is used to define the process of the distributed training task; obtain real-time monitoring data generated in the process of executing the distributed training task; adjust the training strategy based on the real-time monitoring data, and continue to execute the distributed training task using the large model training script according to the large model training execution script and the adjusted training strategy until a trained multimodal large model is obtained.
[0119] 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, implements the adaptive optimization method for the training process of a multimodal large model provided by the above-mentioned methods, including: receiving a submitted training execution script and training strategy of a multimodal large model; the training execution script is used to provide the information required for a distributed training task; according to the training execution script and the training strategy, the distributed training task is executed using a pre-stored large model training script to generate a multimodal large model; the large model training script is used to define the process of the distributed training task; real-time monitoring data generated in the process of executing the distributed training task is obtained; the training strategy is adjusted based on the real-time monitoring data, and according to the large model training execution script and the adjusted training strategy, the distributed training task is continued to be executed using the large model training script until a trained multimodal large model is obtained.
[0120] 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.
[0121] 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, 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.
[0122] 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 adaptive optimization of the training process of a multimodal large model, characterized in that: include: Receive submitted training execution scripts and training strategies for multimodal large models; The training execution script is used to provide information required for distributed training tasks; According to the training execution script and the training strategy, the distributed training task is executed using the pre-stored large model training script to generate a multimodal large model; The large model training script is used to define the process of the distributed training task; Obtain real-time monitoring data generated during the execution of distributed training tasks; The training strategy is adjusted based on the real-time monitoring data, and the distributed training task is continued to be executed using the large model training script according to the large model training execution script and the adjusted training strategy, until a trained multimodal large model is obtained.
2. The adaptive optimization method according to claim 1, characterized in that: Obtain real-time monitoring data generated during the execution of distributed training tasks, including: Get the amount of video memory used and the number of video memory layers used during the execution of distributed training tasks; Adjust the training strategy based on real-time monitoring data, including: Compare the video memory usage with a set video memory threshold to determine whether the number of video memory usage layers needs to be adjusted; When it is determined that the video memory usage needs to be adjusted, a corresponding video memory adjustment function is called to adjust the number of video memory usage layers.
3. The adaptive optimization method according to claim 1, characterized in that: Obtain real-time monitoring data generated during the execution of distributed training tasks, including: Get the learning rate generated during the execution of distributed training tasks; Adjust the training strategy based on real-time monitoring data, including: Based on the learning rate, determining whether the user provides a custom setting for the learning rate; If yes, adjusting the learning rate according to the user's learning rate adjustment instruction; If not, the learning rate is automatically adjusted according to a predefined learning rate setting value.
4. The adaptive optimization method according to claim 1, characterized in that: Obtain real-time monitoring data generated during the execution of distributed training tasks, including: Obtain the gradient information, loss value, and accuracy generated during the execution of distributed training tasks; Adjust the training strategy based on real-time monitoring data, including: According to the gradient information, loss value and accuracy, determine whether it is necessary to adjust the parallel training strategy; wherein the parallel training strategy includes a model parallel strategy, a data parallel strategy and a pipeline parallel strategy; When it is determined that the parallel training strategy needs to be adjusted, the parallel training strategy is adjusted according to the strategy adjustment instruction input by the user.
5. The adaptive optimization method according to claim 1, characterized in that: According to the training execution script and the training strategy, the distributed training task is executed using the pre-stored large model training script, specifically including: According to the training execution script and the training strategy, the training data is obtained in the distributed cloud platform, the distributed training task is executed using the pre-stored large model training script, and the generated real-time monitoring data is stored in the storage cluster of the distributed cloud platform; Obtain real-time monitoring data generated during the execution of distributed training tasks, including: The real-time monitoring data generated during the execution of the distributed training task is obtained in the storage cluster of the distributed cloud platform.
6. The adaptive optimization method according to claim 1, characterized in that: After acquiring the real-time monitoring data generated during the execution of the distributed training task, the method further includes: Feature extraction and analysis are performed based on the real-time monitoring data, and the analysis results are displayed.
7. A multi-modal large model training process adaptive optimization system, characterized in that: include: A training data receiving module, used to receive a submitted training execution script and training strategy for a multimodal large model, wherein the training execution script is used to provide information required for a distributed training task; A training task execution module, used to execute the distributed training task using a pre-stored large model training script according to the training execution script and the training strategy to generate a multimodal large model; The large model training script is used to define the process of the distributed training task; A monitoring data acquisition module is used to obtain real-time monitoring data generated during the execution of distributed training tasks; The training strategy adjustment module is used to adjust the training strategy based on real-time monitoring data, and according to the large model training execution script and the adjusted training strategy, the large model training script is used to continue to execute the distributed training task until a trained multimodal large model is obtained.
8. 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, it implements the adaptive optimization method for the training process of the multimodal large model as described in any one of claims 1 to 6.
9. 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, it implements the adaptive optimization method for the training process of the multimodal large model as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the adaptive optimization method for the training process of the multimodal large model as described in any one of claims 1 to 6.
Citation Information
Cited By
Cross-modal large model fine tuning training system based on cue word embedding
CN120597993A
Distributed training method of multi-modal model, electronic equipment and storage medium
CN121144857A
Distributed training method of multi-modal model, electronic device and storage medium
CN121144857B
Method for accelerating model training recovery, electronic equipment and storage medium
CN121960626A