Multi-device training parameter updating method and device, computer device and storage medium

By slicing and dividing training parameters and data, only some parameters are updated in each process, which solves the problem of redundant calculations in traditional methods and achieves efficient multi-device training parameter update, which is suitable for distributed deep learning training. .

CN118760518APending Publication Date: 2024-10-11TAICHU (HANGZHOU) INTEGRATED CIRCUIT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410799946.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

In traditional distributed data parallel methods, the optimizer's redundant calculations lead to a large amount of redundant storage and calculations, and the ZeRO parallel strategy is incompatible with existing deep learning training frameworks, limiting its versatility.

Method used

By segmenting training parameters and data based on the number of processes after startup and the preset process mapping relationship, using preset data processing algorithms and load balancing algorithms for parameter segmentation, only some parameters are updated in each process to avoid redundant calculations. And update the training parameters through the aggregation function.

Benefits of technology

It saves the calculation time of parameter update, reduces the use of redundant storage and computing resources, while maintaining the accuracy of training parameters, improving training efficiency and stability, and is suitable for multi-device distributed deep learning training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760518A_ABST
    Figure CN118760518A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-device training parameter updating method and device, computer equipment and a storage medium. The method comprises the steps that current training parameters and training data are segmented based on the number of processes after starting and a preset process mapping relation, and a plurality of segmented training parameter sets and a plurality of data sets are obtained; performing updating training on each segmented training parameter group according to a preset data processing algorithm to obtain a current updated parameter and a current training count value; evaluating the updated training result according to a preset training threshold value, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result; and when the training evaluation result is that the training ending condition is met, ending the updating training and setting the current updated parameter as the target training parameter. According to the method, a large number of redundant storage and computing resources are prevented from being called when the training parameters are updated, so that the computing time of parameter updating is saved, and the accuracy of updating the training parameters is kept.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment and storage medium for updating multi-device training parameters. Background Art

[0002] Distributed deep learning refers to distributing the training and inference process of deep learning models on multiple computing nodes, and coordinating the calculation and parameter updates between nodes through communication and synchronization mechanisms. The basic principle of distributed deep learning is to divide large-scale data into multiple subsets, each subset is processed by one or more computing nodes, and then integrate the calculation results of each node through parameter transfer and model synchronization.

[0003] In traditional technology, since a single device can only carry a limited number of model parameters and data, it is very important to use multi-device parallel processing. Among them, DDP (Distributed Data Parallel) is the most commonly used multi-device parallel method. This is a method to achieve data parallelism at the module level, and most deep learning frameworks integrate this method. It synchronizes gradients, parameters, and buffers through communication sets. In a process, DDP copies the input module to the specified device, inputs the model according to the batch dimension accordingly, and collects the output to the output device. Between processes, DDP inserts necessary parameter synchronization in the forward pass and gradient synchronization in the backward pass. Users need to map processes to available resources as long as the processes do not share devices. Going a step further, the ZeRO parallel strategy further removes the model state redundancy that each process in DDP will copy. ZeRO has three different levels, corresponding to different degrees of segmentation of model states: ZeRO-1 only segments the optimizer state; ZeRO-2 segments the optimizer state and gradients; ZeRO-3 segments the optimizer state, gradients, and parameters. After using ZeRO, each process only saves 1 / the number of GPUs of the complete state, without overlapping and no redundancy.

[0004] However, the redundant calculation of the optimizer in the distributed data parallel (DDP) scheme is a significant drawback of the above traditional methods. Since DDP requires each process to keep a complete copy of the model, including model parameters and optimizer status, this leads to a large amount of redundant storage and calculation. In addition, due to ZeRO's special parallel partitioning method, it is incompatible with DDP's parallel strategy, limiting its versatility in existing deep learning training frameworks. Summary of the invention

[0005] Based on this, it is necessary to provide a multi-device training parameter update method, apparatus, computer equipment, computer-readable storage medium and computer program product that can solve the above-mentioned technical problems and improve performance.

[0006] In a first aspect, the present application provides a method for updating multi-device training parameters, comprising:

[0007] Based on the number of processes after startup and the preset process mapping relationship, current training parameters and training data are segmented to obtain multiple post-segmentation training parameter groups and multiple data groups;

[0008] Performing update training on each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values;

[0009] Evaluate the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result;

[0010] When the training evaluation result reaches the training end condition, the update training is ended and the current updated parameters are set as the target training parameters.

[0011] In one embodiment, the current training parameters and training data are segmented based on the number of processes after startup and the preset process mapping relationship to obtain multiple segmented training parameter groups and multiple data groups, including:

[0012] Dividing all the started processes according to the preset process mapping relationship to obtain multiple communication groups;

[0013] Dividing the current training parameters based on a preset load balancing algorithm and the number of the communication groups to obtain a plurality of divided parameters;

[0014] Segmenting the optimizer state corresponding to the current training parameter based on the multiple segmented parameters to obtain multiple segmented optimizer states;

[0015] A set of the post-segmentation parameters and their corresponding post-segmentation optimizer states are set as a post-segmentation training parameter group.

[0016] In one embodiment, the segmenting of the current training parameters and training data based on the number of processes after startup and the preset process mapping relationship to obtain multiple segmented training parameter groups and multiple data groups also includes:

[0017] The training data is segmented based on the number of processes after startup to obtain multiple data groups.

[0018] In one embodiment, the updating and training of each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values ​​includes:

[0019] In each post-startup process, data processing is performed on the data group corresponding to the post-startup process based on the preset data processing algorithm to obtain a current process gradient;

[0020] In the master node, all the current process gradients are aggregated based on a preset aggregation function to obtain a current global gradient;

[0021] In each of the post-startup processes, updating the post-segmentation training parameter group corresponding to each of the post-startup processes based on the current global gradient to obtain an updated segmentation parameter group;

[0022] In the master node, the updated parameters in all the updated segmentation parameter groups are aggregated based on the preset aggregation function to obtain updated training parameters;

[0023] Update the last training count value to obtain the current training count value.

[0024] In one embodiment, in each of the post-startup processes, updating the post-splitting training parameter group corresponding to each of the post-startup processes based on the current global gradient to obtain the updated training parameter group includes:

[0025] In each of the post-startup processes, each post-segmentation parameter and its corresponding optimizer parameter in the post-segmentation training parameter group are updated based on the current global gradient to obtain a plurality of updated parameters and their corresponding updated optimizer parameters;

[0026] The multiple updated parameters and their corresponding updated optimizer parameters are set as an updated segmentation parameter group.

[0027] In one embodiment, evaluating the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain the training evaluation result includes:

[0028] Accurately verifying the verification data according to the model including the currently updated parameters to obtain an accurate verification value;

[0029] Compare the verification precise value with a preset verification threshold to obtain a verification comparison result;

[0030] When the verification comparison result is that the verification precise value is less than the preset verification threshold, the current training count value is compared with the preset training times to obtain a times comparison result;

[0031] When the number comparison result is that the current training count value is less than the preset training number, the next update training is performed on the current updated parameters, and the training evaluation result is set as not meeting the training end condition.

[0032] In one embodiment, the step of evaluating the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain the training evaluation result further includes:

[0033] When the verification comparison result is that the verification accuracy value is greater than or equal to the preset verification threshold, the training evaluation result is set as meeting the training end condition;

[0034] or

[0035] When the number comparison result is that the current training count value is greater than or equal to the preset training number, the training evaluation result is set as reaching the training end condition.

[0036] In a second aspect, the present application also provides a multi-device training parameter updating apparatus, comprising:

[0037] A data segmentation module is used to segment the current training parameters and training data based on the number of processes after startup and the preset process mapping relationship to obtain multiple training parameter groups and multiple data groups after segmentation;

[0038] A parameter updating module, used for updating and training each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values;

[0039] A training evaluation module, used to evaluate the updated training result according to a preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result;

[0040] The result output module is used to end the update training and set the current updated parameters as the target training parameters when the training evaluation result reaches the training end condition.

[0041] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0042] Based on the number of processes after startup and the preset process mapping relationship, current training parameters and training data are segmented to obtain multiple post-segmentation training parameter groups and multiple data groups;

[0043] Performing update training on each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values;

[0044] Evaluate the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result;

[0045] When the training evaluation result reaches the training end condition, the update training is ended and the current updated parameters are set as the target training parameters.

[0046] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0047] Based on the number of processes after startup and the preset process mapping relationship, current training parameters and training data are segmented to obtain multiple post-segmentation training parameter groups and multiple data groups;

[0048] Performing update training on each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values;

[0049] Evaluate the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result;

[0050] When the training evaluation result reaches the training end condition, the update training is ended and the current updated parameters are set as the target training parameters.

[0051] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0052] Based on the number of processes after startup and the preset process mapping relationship, current training parameters and training data are segmented to obtain multiple post-segmentation training parameter groups and multiple data groups;

[0053] Performing update training on each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values;

[0054] Evaluate the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result;

[0055] When the training evaluation result reaches the training end condition, the update training is ended and the current updated parameters are set as the target training parameters.

[0056] The above-mentioned multi-device training parameter updating method, apparatus, computer equipment, storage medium and computer program product divide and process the training parameters and training data according to the number of post-startup processes, and further divide the training parameters based on a preset process mapping relationship, and then update the divided training parameters in combination with each post-startup process through a distributed data parallel processing process to obtain updated training parameters. Only part of the parameters are calculated and updated through each post-startup process, which avoids calling a large amount of redundant storage and computing resources when updating the training parameters, thereby saving the computing time of parameter updating and maintaining the accuracy of updating the training parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 It is a flowchart of a method for updating training parameters of multiple devices in one embodiment;

[0059] Figure 2 A schematic diagram of a process of segmenting training parameters in one embodiment;

[0060] Figure 3 A schematic diagram of a process for updating training parameters in one embodiment;

[0061] Figure 4 It is a structural block diagram of a multi-device training parameter updating apparatus in one embodiment;

[0062] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0064] In one embodiment, Figure 1 As shown, a method for updating training parameters of multiple devices is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0065] Step 102, dividing the current training parameters and training data based on the number of processes after startup and the preset process mapping relationship, to obtain multiple divided training parameter groups and multiple data groups.

[0066] Exemplarily, after starting training, multiple processes are started. Then the master node transmits the current training parameters to all the processes after startup, and each process after startup reads the model to which the current training parameters belong into the device corresponding to the process after startup. At the same time, after determining the number of processes after startup, the training data is segmented according to the number, and the segmented training data is read into each process after startup.

[0067] Then, each started process is divided according to the device to which it belongs, thereby obtaining a plurality of communication groups. According to the number of communication groups, the current training parameters are divided into a plurality of groups, and each divided training parameter group is respectively assigned to a communication group.

[0068] Step 104: update training for each segmented training parameter group according to a preset data processing algorithm to obtain current updated parameters and current training count values.

[0069] The preset data processing algorithm includes a preset aggregation function, and each post-segmentation training parameter group includes multiple post-segmentation parameters.

[0070] Exemplarily, a post-segmentation training parameter group is obtained in a communication group, each post-segmentation parameter in the post-segmentation training parameter group is assigned to a post-startup process in the communication group and updated and trained, thereby obtaining multiple updated training parameters. Then, a preset aggregation function is used to aggregate the multiple obtained finer post-training parameters into the current updated parameters, and the current training round is recorded as the current training count value.

[0071] Step 106, evaluating the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result.

[0072] The preset training threshold includes a preset number of training times and a preset verification threshold.

[0073] Exemplarily, the verification data is input into the model containing the currently updated parameters, and the verification result is compared with the actual result in the verification data to obtain a verification precise value, which is compared with a preset verification threshold to determine whether the training end condition is met.

[0074] Or compare the current training count value with the preset training times to determine whether the training end condition is reached.

[0075] Step 108: When the training evaluation result reaches the training end condition, the update training is ended and the current updated parameters are set as the target training parameters.

[0076] Exemplarily, when it is determined that the update training reaches the training end condition after comparison with the preset training threshold, the training is ended and the last updated parameter is set as the target training parameter.

[0077] In the above-mentioned multi-device training parameter updating method, the training parameters and training data are segmented and processed according to the number of post-startup processes, and the training parameters are further segmented based on the preset process mapping relationship. Then, the segmented training parameters are updated in combination with each post-startup process through the distributed data parallel processing process to obtain the updated training parameters. Only part of the parameters are calculated and updated through each post-startup process, which avoids calling a large amount of redundant storage and computing resources when updating the training parameters, thereby saving the calculation time of parameter updating and maintaining the accuracy of updating the training parameters.

[0078] In an exemplary embodiment, Figure 2 As shown, the current training parameters and training data are segmented based on the number of processes after startup and the preset process mapping relationship to obtain multiple training parameter groups and multiple data groups after segmentation, including steps 202 to 208. Among them:

[0079] Step 202: divide all started processes according to a preset process mapping relationship to obtain multiple communication groups.

[0080] The preset process mapping relationship is a subordinate relationship between a process and a device.

[0081] Exemplarily, after starting training, an initialization operation is performed, specifically including:

[0082] Based on the subordinate relationship between processes and devices, all started processes are divided into multiple communication groups;

[0083] Build a model parameter buffer, which is a contiguous device memory space consisting of all training parameters;

[0084] Construct a gradient set consisting of the gradients corresponding to the training parameters in the parameter buffer;

[0085] Construct an optimizer parameter set, which consists of optimizer parameters corresponding to the model parameters in the parameter buffer.

[0086] In the parameter buffer, the training parameters can be represented as a continuous memory space or as each independent parameter, and the gradient does not need to be continuous. In addition, the optimizer parameter set can be located in a continuous device memory space or in a discontinuous device memory space.

[0087] In addition, after dividing into multiple communication groups, the number of communication groups is determined and

[0088] Step 204, dividing the current training parameters based on the preset load balancing algorithm and the number of communication groups to obtain multiple divided parameters.

[0089] Exemplarily, the size of all current training parameters is calculated, and the current training parameters are divided into multiple parameter sets of similar size, that is, multiple divided parameters, according to the number of communication groups using a preset load balancing algorithm.

[0090] And when splitting, if a parameter needs to be split into different processes, the splitting of the parameter is put into the parameter set. For example, if a parameter of length 20 needs to be split into two blocks of length 16 and length 4, the name of the parameter and the cutting position 16 are recorded in the parameter combination. In one embodiment, the preset load balancing algorithm adopts the greedy method.

[0091] Step 206, segmenting the optimizer state corresponding to the current training parameter based on the multiple segmented parameters to obtain the multiple segmented optimizer states.

[0092] The optimizer state includes the gradient corresponding to the parameters and the optimizer parameters.

[0093] Exemplarily, after the current training parameters are segmented, the gradient and optimizer parameters corresponding to each parameter in each segmented parameter are put into the gradient set and optimizer parameter combination corresponding to the post-startup process of updating the parameter.

[0094] Step 208: Set a set of post-segmentation parameters and their corresponding post-segmentation optimizer states as a post-segmentation training parameter group.

[0095] Exemplarily, after the segmentation is completed, each post-segmentation parameter and its corresponding gradient set and optimizer parameter are combined and set as a post-segmentation training parameter group.

[0096] In this embodiment, by obtaining the size of each parameter in the current training parameters and evenly dividing the current training parameters according to the number of communication groups, the computing core corresponding to each communication group only needs to calculate part of the training parameters, thereby saving the calculation time for parameter update and maintaining the communication delay within a smaller fluctuation range.

[0097] In an exemplary embodiment, the current training parameters and training data are segmented based on the number of processes after startup and the preset process mapping relationship to obtain multiple segmented training parameter groups and multiple data groups, and further includes:

[0098] The training data is divided based on the number of processes after startup to obtain multiple data groups.

[0099] Exemplarily, the training data is divided into a plurality of data groups of the same size according to the number of processes after startup.

[0100] In an exemplary embodiment, Figure 3 As shown, each segmented training parameter group is updated and trained according to a preset data processing algorithm to obtain the current updated parameters and the current training count value, including steps 302 to 310. Among them:

[0101] Step 302: In each post-startup process, data processing is performed on the data group corresponding to the post-startup process based on a preset data processing algorithm to obtain a current process gradient.

[0102] Among them, the preset data processing algorithm includes a forward calculation algorithm, a preset loss function, a back propagation algorithm and a preset aggregation function.

[0103] Exemplarily, after starting the training update, each post-startup process reads a data set and processes the data set through the forward calculation algorithm and the model containing the current training parameters to obtain a prediction result. Then, the prediction result and the actual result are compared and calculated through a preset loss function to obtain a loss value. After that, the loss value is back-propagated through the back-propagation algorithm to obtain a local gradient, that is, the current process gradient.

[0104] Step 304: In the master node, all current process gradients are aggregated based on a preset aggregation function to obtain a current global gradient.

[0105] Among them, the preset aggregation function is the allreduce (global integration) function.

[0106] Exemplarily, the current process gradient is aggregated through the allreduce function to obtain the current global gradient.

[0107] Step 306 , in each post-startup process, update the parameters of the post-segmentation training parameter group corresponding to each post-startup process based on the current global gradient to obtain an updated segmentation parameter group.

[0108] Each post-segmentation training parameter group includes multiple post-segmentation parameters.

[0109] Exemplarily, each started process updates the segmented parameters in the corresponding communication group using the current global gradient through a single parameter optimizer, thereby obtaining an updated segmented parameter group corresponding to each communication group.

[0110] Step 308: In the master node, the updated parameters in all updated segmentation parameter groups are aggregated based on a preset aggregation function to obtain updated training parameters.

[0111] Exemplarily, after all the post-slicing parameters are updated, all the post-slicing parameter groups are aggregated through the allreduce function to obtain updated training parameters.

[0112] Step 310, update the last training count value to obtain the current training count value.

[0113] Exemplarily, the last training count value is updated, that is, the training count value is increased by one to obtain the current training count value.

[0114] In this embodiment, after the conventional distributed data parallel processing process, all the split parameters are updated using the aggregated global gradient, and then the updated split parameter group is aggregated using the aggregation function to obtain the updated training parameters. By reducing the size of the calculation data of each computing core, the communication time is reduced and the computing performance assigned to each parameter is improved. At the same time, the optimizer also greatly saves time.

[0115] In an exemplary embodiment, in each post-startup process, the post-segmentation training parameter group corresponding to each post-startup process is updated based on the current global gradient to obtain the updated training parameter group, including:

[0116] In each post-startup process, each post-splitting parameter and its corresponding optimizer parameter in the post-splitting training parameter group are updated based on the current global gradient to obtain multiple updated parameters and their corresponding updated optimizer parameters; the multiple updated parameters and their corresponding updated optimizer parameters are set as an updated split parameter group.

[0117] Each post-segmentation training parameter group includes multiple post-segmentation parameters, and each post-segmentation training parameter group also includes a post-segmentation optimizer state corresponding to each post-segmentation parameter, and the post-segmentation optimizer state includes optimizer parameters.

[0118] Exemplarily, while updating the post-slicing parameters, the optimizer parameters are updated according to the preset update rules using the gradient corresponding to the optimizer parameters in the current global gradient, thereby obtaining the updated optimizer parameters corresponding to each optimizer. Then, the post-slicing parameters and the updated optimizer parameters in the communication group are set as an updated post-slicing parameter group.

[0119] In this embodiment, while updating the training parameters, the optimizer parameters corresponding to each parameter are synchronously updated, thereby improving the training efficiency, maintaining the stability of the training, and better utilizing distributed computing resources, avoiding idle resources and inefficient communication overhead.

[0120] In an exemplary embodiment, the updated training result is evaluated according to a preset training threshold, a current updated parameter, a current training count value, and verification data to obtain a training evaluation result, including:

[0121] The verification data is accurately verified according to the model containing the current updated parameters to obtain the verification accurate value; the verification accurate value is compared with the preset verification threshold to obtain the verification comparison result; when the verification comparison result is that the verification accurate value is less than the preset verification threshold, the current training count value is compared with the preset number of training times to obtain the number comparison result; when the number comparison result is that the current training count value is less than the preset number of training times, the next update training is performed on the current updated parameters, and the training evaluation result is set as the training end condition is not met.

[0122] The preset training threshold includes a preset number of training times and a preset verification threshold.

[0123] Exemplarily, the verification data is input into the model including the currently updated parameters, the verification result is obtained through model processing, and then the verification result is compared with the actual result to determine the verification accuracy. The accuracy is compared with a preset accuracy threshold to determine whether this round of update training has achieved the expected effect.

[0124] If the expected effect is not achieved, the current training count value is compared with the preset count threshold to determine whether a sufficient update effect is achieved.

[0125] In one embodiment, the updated training results are evaluated according to a preset training threshold, the current updated parameters, the current training count value and the verification data to obtain a training evaluation result, which also includes: when the verification comparison result is that the verification precise value is greater than or equal to the preset verification threshold, the training evaluation result is set to meet the training end condition; or when the number comparison result is that the current training count value is greater than or equal to the preset training number of times, the training evaluation result is set to meet the training end condition.

[0126] In this embodiment, by accurately verifying the verification data with the model of the current updated parameters, combining the comparison of the verification accuracy value and the preset verification threshold, and monitoring the number of training times, the training process of the deep learning model is optimized to better adapt to the data and improve accuracy.

[0127] In an exemplary embodiment, a multi-device training parameter updating method is provided, the method comprising the following steps:

[0128] All started processes are divided according to a preset process mapping relationship to obtain multiple communication groups.

[0129] The training data is divided based on the number of processes after startup to obtain multiple data groups.

[0130] The current training parameters are divided based on a preset load balancing algorithm and the number of communication groups to obtain multiple divided parameters.

[0131] The optimizer state corresponding to the current training parameter is segmented based on the multiple segmented parameters to obtain the multiple segmented optimizer states.

[0132] A set of post-segmentation parameters and their corresponding post-segmentation optimizer states are set as a post-segmentation training parameter group.

[0133] In each post-startup process, data processing is performed on the data group corresponding to the post-startup process based on a preset data processing algorithm to obtain a current process gradient.

[0134] In the master node, all current process gradients are aggregated based on the preset aggregation function to obtain the current global gradient.

[0135] In each post-startup process, each post-splitting parameter and its corresponding optimizer parameter in the post-splitting training parameter group are updated based on the current global gradient to obtain multiple updated parameters and their corresponding updated optimizer parameters.

[0136] The multiple updated parameters and their corresponding updated optimizer parameters are set as an updated segmentation parameter group.

[0137] In the master node, the updated parameters in all updated segmentation parameter groups are aggregated based on a preset aggregation function to obtain updated training parameters.

[0138] Update the last training count value to obtain the current training count value.

[0139] The validation data is accurately validated according to the model containing the current updated parameters to obtain the validation precise values.

[0140] The verification precise value is compared with the preset verification threshold to obtain a verification comparison result.

[0141] When the verification comparison result is that the verification precise value is less than the preset verification threshold, the current training count value is compared with the preset training times to obtain a times comparison result.

[0142] When the number comparison result is that the current training count value is less than the preset training number, the next update training is performed on the current updated parameters, and the training evaluation result is set as not meeting the training end condition.

[0143] When the verification comparison result is that the verification precision value is greater than or equal to the preset verification threshold, the training evaluation result is set to meet the training end condition; or when the number comparison result is that the current training count value is greater than or equal to the preset training number of times, the training evaluation result is set to meet the training end condition.

[0144] When the training evaluation result reaches the training end condition, the update training is ended and the current updated parameters are set as the target training parameters.

[0145] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0146] Based on the same inventive concept, the embodiment of the present application also provides a multi-device training parameter updating device for implementing the multi-device training parameter updating method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more multi-device training parameter updating device embodiments provided below can refer to the limitations of the multi-device training parameter updating method above, and will not be repeated here.

[0147] In an exemplary embodiment, Figure 4 As shown, a multi-device training parameter updating apparatus is provided, comprising: a data segmentation module 402, a parameter updating module 404, a training evaluation module 406 and a result output module 408, wherein:

[0148] The data segmentation module 402 is used to segment the current training parameters and training data based on the number of processes after startup and the preset process mapping relationship to obtain multiple training parameter groups and multiple data groups after segmentation.

[0149] The parameter updating module 404 is used to update and train each segmented training parameter group according to a preset data processing algorithm to obtain current updated parameters and current training count values.

[0150] The training evaluation module 406 is used to evaluate the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain the training evaluation result.

[0151] The result output module 408 is used to end the update training and set the current updated parameters as the target training parameters when the training evaluation result reaches the training end condition.

[0152] In an exemplary embodiment, the data segmentation module 402 is also used to divide all post-startup processes according to a preset process mapping relationship to obtain multiple communication groups; segment the current training parameters based on a preset load balancing algorithm and the number of communication groups to obtain multiple segmented parameters; segment the optimizer states corresponding to the current training parameters based on the multiple segmented parameters to obtain multiple segmented optimizer states; set a segmented parameter and its corresponding segmented optimizer state as a segmented training parameter group.

[0153] In an exemplary embodiment, the data segmentation module 402 is further configured to segment the training data based on the number of processes started to obtain multiple data groups.

[0154] In an exemplary embodiment, the parameter update module 404 is also used to perform data processing on the data group corresponding to the post-startup process based on a preset data processing algorithm in each post-startup process to obtain a current progress gradient; in the master node, aggregate all current process gradients based on a preset aggregation function to obtain a current global gradient; in each post-startup process, perform parameter update on the post-splitting training parameter group corresponding to each post-startup process based on the current global gradient to obtain an updated split parameter group; in the master node, aggregate the updated parameters in all updated split parameter groups based on a preset aggregation function to obtain updated training parameters; update the last training count value to obtain the current training count value.

[0155] In an exemplary embodiment, the parameter updating module 404 is also used to update each post-splitting parameter and its corresponding optimizer parameter in the post-splitting training parameter group based on the current global gradient in each post-startup process, to obtain multiple updated parameters and their corresponding updated optimizer parameters; and set the multiple updated parameters and their corresponding updated optimizer parameters as an updated split parameter group.

[0156] In an exemplary embodiment, the training evaluation module 406 is also used to accurately verify the verification data according to the model containing the current updated parameters to obtain the verification precise value; compare the verification precise value with the preset verification threshold to obtain the verification comparison result; when the verification comparison result is that the verification precise value is less than the preset verification threshold, compare the current training count value with the preset number of training times to obtain the number comparison result; when the number comparison result is that the current training count value is less than the preset number of training times, perform the next update training on the current updated parameters, and set the training evaluation result as not meeting the training end condition.

[0157] In an exemplary embodiment, the result output module 408 is also used to set the training evaluation result to meet the training end condition when the verification comparison result is that the verification precision value is greater than or equal to a preset verification threshold; or when the number comparison result is that the current training count value is greater than or equal to a preset training number of times, the training evaluation result is set to meet the training end condition.

[0158] Each module in the above-mentioned multi-device training parameter updating apparatus can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0159] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store training parameter data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a multi-device training parameter update method is implemented.

[0160] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0161] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0162] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0163] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0164] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0165] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0166] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0167] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A multi-device training parameter updating method, characterized in that: The method comprises: Based on the number of processes after startup and the preset process mapping relationship, current training parameters and training data are segmented to obtain multiple post-segmentation training parameter groups and multiple data groups; Performing update training on each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values; Evaluate the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result; When the training evaluation result reaches the training end condition, the update training is ended and the current updated parameters are set as the target training parameters.

2. The method according to claim 1, characterized in that Each of the split training parameter groups includes multiple split parameters; the current training parameters and training data are split based on the number of processes after startup and the preset process mapping relationship to obtain multiple split training parameter groups and multiple data groups, including: Dividing all the started processes according to the preset process mapping relationship to obtain multiple communication groups; Dividing the current training parameters based on a preset load balancing algorithm and the number of the communication groups to obtain a plurality of divided parameters; Segmenting the optimizer state corresponding to the current training parameter based on the multiple segmented parameters to obtain multiple segmented optimizer states; A set of the post-segmentation parameters and their corresponding post-segmentation optimizer states are set as a post-segmentation training parameter group.

3. The method according to claim 2, characterized in that The method further includes: dividing the current training parameters and training data based on the number of processes after startup and the preset process mapping relationship to obtain multiple training parameter groups and multiple data groups after division; The training data is segmented based on the number of processes after startup to obtain multiple data groups.

4. The method according to claim 1, characterized in that: The preset data processing algorithm includes a preset aggregation function; each of the post-segmentation training parameter groups includes a plurality of post-segmentation parameters; The updating and training of each of the segmented training parameter groups according to the preset data processing algorithm to obtain the current updated parameters and the current training count value includes: In each post-startup process, data processing is performed on the data group corresponding to the post-startup process based on the preset data processing algorithm to obtain a current process gradient; In the master node, all the current process gradients are aggregated based on a preset aggregation function to obtain a current global gradient; In each of the post-startup processes, updating the post-segmentation training parameter group corresponding to each of the post-startup processes based on the current global gradient to obtain an updated segmentation parameter group; In the master node, the updated parameters in all the updated segmentation parameter groups are aggregated based on the preset aggregation function to obtain updated training parameters; Update the last training count value to obtain the current training count value.

5. The method according to claim 4, characterized in that Each of the post-segmentation training parameter groups also includes a post-segmentation optimizer state corresponding to each of the post-segmentation parameters; the post-segmentation optimizer state includes optimizer parameters; in each of the post-startup processes, the post-segmentation training parameter group corresponding to each of the post-startup processes is updated based on the current global gradient to obtain an updated training parameter group, including: In each of the post-startup processes, each post-segmentation parameter and its corresponding optimizer parameter in the post-segmentation training parameter group are updated based on the current global gradient to obtain a plurality of updated parameters and their corresponding updated optimizer parameters; The multiple updated parameters and their corresponding updated optimizer parameters are set as an updated segmentation parameter group.

6. The method according to claim 1, characterized in that The preset training threshold includes a preset number of training times and a preset verification threshold; The step of evaluating the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain the training evaluation result includes: Accurately verifying the verification data according to the model including the currently updated parameters to obtain an accurate verification value; Compare the verification precise value with a preset verification threshold to obtain a verification comparison result; When the verification comparison result is that the verification precise value is less than the preset verification threshold, the current training count value is compared with the preset training times to obtain a times comparison result; When the number comparison result is that the current training count value is less than the preset training number, the next update training is performed on the current updated parameters, and the training evaluation result is set as not meeting the training end condition.

7. The method according to claim 6, characterized in that The step of evaluating the updated training result according to the preset training threshold, the current updated parameter, the current training count value and the verification data to obtain the training evaluation result further includes: When the verification comparison result is that the verification accuracy value is greater than or equal to the preset verification threshold, the training evaluation result is set as meeting the training end condition; or When the number comparison result is that the current training count value is greater than or equal to the preset training number, the training evaluation result is set as reaching the training end condition.

8. A multi-device training parameter updating apparatus, characterized in that: The device comprises: A data segmentation module is used to segment the current training parameters and training data based on the number of processes after startup and the preset process mapping relationship to obtain multiple training parameter groups and multiple data groups after segmentation; A parameter updating module, used for updating and training each of the segmented training parameter groups according to a preset data processing algorithm to obtain current updated parameters and current training count values; A training evaluation module, used to evaluate the updated training result according to a preset training threshold, the current updated parameter, the current training count value and the verification data to obtain a training evaluation result; The result output module is used to end the update training and set the current updated parameters as the target training parameters when the training evaluation result reaches the training end condition.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.