Distributed training micro-batch data determination method and device, equipment and medium

By dynamically adjusting the size of micro-batch data based on multi-objective reinforcement learning methods, the problem of gradient synchronization delay caused by unreasonable division of micro-batch data in distributed training is solved, improving model training efficiency and performance, and adapting to heterogeneous computing resources. Reduce hardware costs.

CN118709752APending Publication Date: 2024-09-27CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1

Patent Information

Application Number
CN202410749393.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In distributed training, unreasonable division of micro-batch data leads to gradient synchronization delays and model performance degradation, and existing technology is difficult to effectively solve the problem of gradient value waiting delays caused by dynamic changes in computing power.

Method used

Using a method based on multi-objective reinforcement learning, by obtaining the computing resources and model parameter information of the training node, the micro-batch data size is dynamically calculated, and based on the received gradient value and model performance parameters, the micro-batch data size is adjusted to optimize gradient synchronization and model training efficiency.

Benefits of technology

It achieves a reasonable division of micro-batch data size, reduces gradient synchronization delay, improves model training efficiency, enhances adaptability to heterogeneous computing resources, reduces hardware costs, and improves the autonomous controllability of the AI ​​platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709752A
    Figure CN118709752A
Patent Text Reader

Abstract

The invention provides a distributed training micro-batch data determination method and device, equipment and a medium, and relates to the technical field of emerging information, for example, the method comprises the steps that a training data set is divided into a plurality of training data subsets based on the size of pre-determined micro-batch data, so that corresponding gradient values are calculated; receiving gradient values returned by the preset number of training nodes, and screening out a target training node from the training nodes; judging whether a gradient value which is returned by the target training node and meets a preset condition is received within a preset duration or not; inputting all the received gradient values, the total duration consumed for receiving all the gradient values and the model performance parameters of all the training nodes into a pre-trained neural network model, outputting the updated model performance parameters of all the training nodes, and finally determining the size of micro-batch data corresponding to all the training nodes. According to the invention, the micro-batch size of the training data can be reasonably divided so as to ensure the performance and training condition of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Batch data partitioning is a common method used in data processing during the training process of machine learning and deep learning. It divides a large number of data samples into several small data sets, each of which is called a batch of data. This partitioning helps to train and verify the model more efficiently. In the data parallel distributed training scenario, the batch data partitioning problem evolves into the mini-batch data partitioning problem.

[0003] Data parallelism in distributed training is a commonly used parallelization strategy, especially suitable for the training of deep learning models. The core idea is to divide the batch data of a training iteration into multiple micro-batches and process these micro-batches in parallel on multiple computing devices (such as graphics processors GPU). In data parallelism, each computing device holds a complete copy of the entire neural network model. At the beginning of training, the entire data set is divided into multiple micro-batches, which are further distributed to various computing devices. Each device is responsible for processing one or more micro-batches and independently performs forward calculations, loss calculations, and back propagation.

[0004] Specifically, each device performs forward calculations based on the assigned micro-batch data, and after obtaining the output and loss, calculates the gradient of each parameter, and collects these gradients for aggregation. The aggregation method is usually to take the average of the gradients of all devices, and after obtaining the average gradient, update the model parameters. This process is repeated in each epoch until the model converges or reaches the predetermined number of training rounds. Among them, an epoch of the model refers to a complete cycle in the model training process, that is, the process in which the model completes a traversal of the entire training data set and updates its parameters accordingly.

[0005] Data parallelism has significant advantages in a distributed environment. First, it fully utilizes the computing power of multiple computing devices and accelerates the model training process. Second, by dividing a large data set into multiple micro-batches and processing them in parallel, it reduces the memory pressure of a single device. However, due to the existence of gradient synchronization, the division of micro-batches becomes very important and more complicated.

[0006] In the related art, the division of micro-batch data directly affects the computational delay of a single iteration. When the size of micro-batch data is small, since each micro-batch data needs to be forward propagated, backward propagated, and parameter updated, and these operations may be processed in parallel on the graphics processing unit GPU or the central processing unit CPU, the amount of data processed in each iteration is small, and the update speed of the neural network may be slowed down. Therefore, if the size of the micro-batch data is too small, the system may not be able to fully utilize the hardware resources, resulting in increased processing delays; when the size of the micro-batch data is too large, since each micro-batch data can more effectively utilize the hardware resources, the amount of data processed in each iteration increases, and the update speed of the neural network may increase, but at the same time, there may be problems of insufficient memory or insufficient computing resources, which in turn affects the performance and stability of the system.

[0007] In addition, the division of micro-batch data will also affect the gradient aggregation during distributed training. In distributed deep learning, when using multiple GPUs or multiple machines for training, the division of micro-batch data may cause the problem of gradient synchronization delay. Among them, gradient synchronization delay means that when updating parameters, the gradients calculated on different devices need to be synchronized, and this synchronization operation may cause a certain delay, thereby affecting the speed and efficiency of the overall training.

[0008] Specifically, after each device calculates the gradient value of the assigned micro-batch data, these gradient values ​​need to be collected and aggregated in order to calculate the final average gradient for parameter update. This collection and aggregation process may cause gradient synchronization delays, especially when the communication speed between devices is slow or the network latency is high, the impact of the delay will be greater. For example, the problem of gradient synchronization delay is more prominent in heterogeneous computing power scenarios. When the processing speeds of different nodes are inconsistent, it is inevitable that the fast node needs to wait for the calculation of the slow node to complete before the gradient can be synchronized. This affects the speed and efficiency of the overall training. When the micro-batch data is not divided reasonably, this useless waiting delay will be further amplified.

[0009] Due to the dynamic change of computing power, the static part of micro-batch data cannot completely solve the problem of gradient value waiting delay. In this regard, in the related art, in addition to the synchronous waiting method of unevenly dividing micro-batch data, there is also an asynchronous update method, that is, the gradient calculation and parameter update between different devices are performed asynchronously, that is, the fast node does not wait for the gradient of the slow node, and directly uses the existing gradient to update the model parameters. If the gradient of the subsequent slow node arrives, it will be updated to the new model. This method eliminates the waiting delay, but brings the problem of stale gradients, that is, when the parameters are updated, the gradient information used is outdated or inaccurate. This will lead to the instability and convergence of the model parameter update, thereby affecting the performance and accuracy of the model.

[0010] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0011] The present disclosure provides a distributed training micro-batch data determination method, device, equipment and medium, which at least to a certain extent overcome the problem in the related art that the micro-batch data size cannot be reasonably divided.

[0012] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0013] According to one aspect of the present disclosure, a method for determining distributed training micro-batch data based on multi-objective reinforcement learning is provided, comprising: obtaining a training data set to be distributed to multiple training nodes; calculating the micro-batch data size corresponding to each training node based on the computing power resources and model parameter information of each training node, and dividing the training data set into multiple training data subsets according to the micro-batch data size corresponding to each training node; distributing each training data subset to a corresponding training node so that each training node performs model training using the distributed training data subset, and calculates a corresponding gradient value, wherein the gradient value of each training node is used to reflect the model training status of the training node; receiving the gradient values ​​returned by a preset number of training nodes, and according to the received gradient values, A target training node is selected from each training node, wherein the target training node is a training node among the multiple training nodes that has not completed gradient value calculation; it is determined whether a gradient value satisfying a preset condition is received from the target training node within a preset time period, wherein the preset condition is that a time difference between a calculation time point of the gradient value and a calculation time point of a model on a training node corresponding to the gradient value is less than a preset threshold; all received gradient values, a total time consumed for receiving all gradient values, and model performance parameters of each training node are input into a pre-trained neural network model, and updated model performance parameters of each training node are output; and a micro-batch data size corresponding to each training node is determined according to the computing power resources of each training node and the updated model performance parameters.

[0014] In some embodiments, the micro-batch data size corresponding to each training node is calculated based on the computing power resources and model parameter information of each training node, including: calculating the normalized computing power of each training node based on the computing power resources of each training node; calculating the batch data size corresponding to each training node according to the normalized computing power of each training node; calculating the micro-batch data size corresponding to each training node according to the normalized computing power, batch data size and preset scaling factor of each training node, wherein the preset scaling factor is used to balance the computing power gap between each training node.

[0015] In some embodiments, the micro-batch data size corresponding to each training node is calculated by the following formula:

[0016]

[0017] Among them, mbSize(i) represents the micro-batch data size of the i-th training node, SDR represents the preset scaling factor, normC(i) represents the normalized computing power of the i-th training node, BS represents the batch data size corresponding to each training node in advance, and S represents the total number of training nodes.

[0018] In some embodiments, after determining whether a gradient value satisfying a preset condition is received from the target training node within a preset time length, the method further includes: if a gradient value satisfying the preset condition is received from the target training node within a preset time length, retaining the gradient value satisfying the preset condition returned by the target training node; if a gradient value satisfying the preset condition is not received from the target training node within the preset time length, stopping receiving the gradient value satisfying the preset condition returned by the target training node.

[0019] In some embodiments, all received gradient values, the total time consumed for receiving all gradient values, and the model performance parameters of each training node are input into a pre-trained neural network model, and the updated model performance parameters of each training node are output, including: determining the loss value corresponding to each training node through all received gradient values; determining the target loss value and the target total time according to the Pareto optimal solution calculation method; inputting the target loss value, the target total time, and the model performance parameters of each training node into a pre-trained neural network model, and outputting the updated model performance parameters of each training node.

[0020] In some embodiments, before outputting the updated model performance parameters of each training node, the method also includes: tuning the model performance parameters of each training node according to preset configuration requirements, and generating a parameter configuration template so that the pre-trained neural network model updates the model performance parameters of each training node according to the target loss value, the target total duration and the parameter configuration template.

[0021] In some embodiments, the pre-trained neural network model is a deep dual Q network model DDQN.

[0022] According to another aspect of the present disclosure, a distributed training micro-batch data determination device based on multi-objective reinforcement learning is also provided, including: a training data set acquisition module, used to acquire a training data set to be distributed to multiple training nodes; a micro-batch data size calculation module, used to calculate the micro-batch data size corresponding to each training node based on the computing power resources and model parameter information of each training node, and divide the training data set into multiple training data subsets according to the micro-batch data size corresponding to each training node; a gradient value calculation module, used to distribute each training data subset to the corresponding training node, so that each training node uses the distributed training data subset to perform model training and calculate the corresponding gradient value, wherein the gradient value of each training node is used to reflect the model training status of the training node; a target training node screening module, used to receive the gradient values ​​returned by a preset number of training nodes, and according to the received The target training node is selected from each training node according to the gradient value received, wherein the target training node is a training node that has not completed the gradient value calculation among the multiple training nodes; a target gradient value judgment module is used to judge whether a gradient value satisfying a preset condition is received from the target training node within a preset time length, wherein the preset condition is that the time difference between the calculation time point of the gradient value and the calculation time point of the model on the training node corresponding to the gradient value is less than a preset threshold; a model performance parameter output module is used to input all the received gradient values, the total time consumed for receiving all the gradient values, and the model performance parameters of each training node into a pre-trained neural network model, and output the updated model performance parameters of each training node; a micro-batch data size update module is used to determine the micro-batch data size corresponding to each training node according to the computing power resources of each training node and the updated model performance parameters.

[0023] According to another aspect of the present disclosure, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods for determining distributed training micro-batch data based on multi-objective reinforcement learning by executing the executable instructions.

[0024] According to another aspect of the present disclosure, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the method for determining distributed training micro-batch data based on multi-objective reinforcement learning described in any one of the above is implemented.

[0025] According to another aspect of the present disclosure, a computer program product is also provided, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for determining distributed training micro-batch data based on multi-objective reinforcement learning.

[0026] The distributed training micro-batch data determination method, device, equipment and medium provided in the embodiments of the present disclosure calculate the micro-batch data size corresponding to each training node based on the computing power resources and model parameter information of each training node, to divide the training data set to be distributed to each training node, obtain multiple training data subsets and distribute them to the corresponding training nodes, so that each training node uses the distributed training data subsets for model training and calculates the corresponding gradient value; receives the gradient values ​​returned by a preset number of training nodes, and according to the received gradient values, selects the training nodes that have not completed the gradient value calculation from each training node as the target training node; determines whether the gradient value returned by the target training node that meets the preset conditions is received within the preset time length, and inputs all the received gradient values, the total time consumed to receive all the gradient values, and the model performance parameters of each training node into the pre-trained neural network model, outputs the updated model performance parameters of each training node, and re-determines the micro-batch data size corresponding to each training node based on this. The embodiments of the present disclosure can reasonably divide the micro-batch size of the training data to ensure the performance and training status of the model.

[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0029] Figure 1 A schematic diagram of an exemplary application system architecture to which the distributed training micro-batch data determination method based on multi-objective reinforcement learning in an embodiment of the present disclosure can be applied is shown;

[0030] Figure 2 A flow chart of a method for determining distributed training micro-batch data based on multi-objective reinforcement learning in an embodiment of the present disclosure is shown;

[0031] Figure 3 A flow chart of another method for determining distributed training micro-batch data based on multi-objective reinforcement learning in an embodiment of the present disclosure is shown;

[0032] Figure 4 A flow chart of a gradient value aggregation method in an embodiment of the present disclosure is shown;

[0033] Figure 5 A schematic diagram of a reinforcement learning module implementation framework in an embodiment of the present disclosure is shown;

[0034] Figure 6 A schematic diagram of a distributed training micro-batch data determination device based on multi-objective reinforcement learning in an embodiment of the present disclosure is shown;

[0035] Figure 7 A block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0037] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0038] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the distributed training micro-batch data determination method based on multi-objective reinforcement learning in the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include: a training node 101, a parameter node 102 and an offline reinforcement learning module 103.

[0039] The parameter node 102 may include a parameter synchronization module 1021 and an online reinforcement learning module 1022 .

[0040] The training cluster may include one or more training nodes 101 and parameter nodes 102. The parameter synchronization module 1021 in the parameter node 102 is responsible for aggregating model parameters and distributing training data subsets corresponding to the training nodes, and the online reinforcement learning module 1022 is responsible for performing online reinforcement learning training, thereby updating the model performance parameters of each training node.

[0041] Among them, the online reinforcement learning module 1022 also includes an online training agent module and a reward generator. The online training agent module is responsible for interacting with the environment and adjusting the model performance parameters to optimize the operation, and combining the reward function generated by the reward generator to update the pre-trained neural network model to generate updated model performance parameters.

[0042] The offline reinforcement learning module 103 is responsible for performing offline reinforcement learning training. The offline reinforcement learning training is a model pre-trained in an environment outside the training cluster, that is, a non-training cluster, based on the collected historical model training information.

[0043] Those skilled in the art will know that Figure 1 The number of training nodes in is only illustrative, and any number of training nodes may be provided according to actual needs. This embodiment of the present disclosure does not limit this.

[0044] Under the above system architecture, an embodiment of the present disclosure provides a method for determining distributed training micro-batch data based on multi-objective reinforcement learning, which can be executed by any electronic device with computing and processing capabilities.

[0045] In some embodiments, the method for determining distributed training micro-batch data based on multi-objective reinforcement learning provided in the embodiments of the present disclosure can be executed by a terminal device of the above-mentioned system architecture; in other embodiments, the method for determining distributed training micro-batch data based on multi-objective reinforcement learning provided in the embodiments of the present disclosure can be executed by a server in the above-mentioned system architecture.

[0046] Figure 2 A flow chart of a method for determining distributed training micro-batch data based on multi-objective reinforcement learning in an embodiment of the present disclosure is shown. Figure 2 As shown, the method comprises the following steps:

[0047] S202, obtaining a training data set to be distributed to multiple training nodes.

[0048] In one embodiment of the present disclosure, the training data set is a data set containing a large number of samples. The parameter node can divide the training data set into multiple training data subsets according to the corresponding needs of the training node and distribute them to each training node, so that each training node performs model training according to the received training data subset.

[0049] S204, based on the computing power resources and model parameter information of each training node, calculate the micro-batch data size corresponding to each training node, and divide the training data set into multiple training data subsets according to the micro-batch data size corresponding to each training node.

[0050] In one embodiment of the present disclosure, the training nodes can be divided into grades according to the peak computing power scale by a computing power normalization method, and the batch data size is determined based on this, and then the micro-batch data size is further determined according to each training node according to the normalized computing power ratio and the preset scaling factor. The training data set is divided into multiple training data subsets according to the determined micro-batch data size, so that each training node can perform model training according to the corresponding training data subset.

[0051] S206, distributing each training data subset to a corresponding training node, so that each training node performs model training using the distributed training data subset, and calculates a corresponding gradient value, wherein the gradient value of each training node is used to reflect the model training status of the training node.

[0052] In one embodiment of the present disclosure, each training node performs model training based on the obtained training data subset, inputs the training data subset into the model of the training node, performs forward propagation, and generates a predicted output result; calculates the loss value based on the predicted output result; performs back propagation, calculates the gradient value of the loss value relative to the model parameters, and reflects the model training status of the training node through the gradient value.

[0053] S208, receiving gradient values ​​returned by a preset number of training nodes, and screening out a target training node from each training node according to the received gradient values, wherein the target training node is a training node for which gradient value calculation has not been completed among the multiple training nodes.

[0054] In one embodiment of the present disclosure, due to the different computing power of each training node, the speed at which each training node calculates the gradient value is different. The target training node may refer to the remaining training node that has not calculated the gradient value when receiving the gradient values ​​calculated by a preset number of training nodes.

[0055] S210, determining whether a gradient value satisfying a preset condition is received from a target training node within a preset time period, wherein the preset condition is that a time difference between a calculation time point of the gradient value and a calculation time point of a model on a training node corresponding to the gradient value is less than a preset threshold.

[0056] In one embodiment of the present disclosure, after receiving a preset number of training nodes, a waiting timer can be started, and gradient values ​​can still be received during the waiting timer. Since adding the gradient value to the gradient value corresponding to the previous preset number of training nodes within the allowed range of staleness will not affect the convergence performance of the model and can also avoid waste of training data, a preset threshold is set. When the staleness of the gradient is greater than or equal to the preset threshold, it is regarded as a stale gradient and directly discarded or does not participate in parameter update. When the staleness of the gradient is less than the preset threshold, it is added to the gradient value summary process, and the gradient value will not affect the performance of the training.

[0057] S212, input all received gradient values, the total time consumed for receiving all gradient values, and the model performance parameters of each training node into a pre-trained neural network model, and output the updated model performance parameters of each training node.

[0058] In one embodiment of the present disclosure, in order to achieve the target model training situation, multi-objective deep reinforcement learning (MORL) is used to learn a strategy or decision sequence to achieve a balance of multiple goals while considering multiple goals. The parameter node counts the overall training time of this model training and the final loss value, and inputs it into the pre-trained neural network model for online reasoning and training, and finally outputs the updated model performance parameters.

[0059] S214, determining the micro-batch data size corresponding to each training node according to the computing resources of each training node and the updated model performance parameters.

[0060] In one embodiment of the present disclosure, the micro-batch data size is readjusted according to the updated model performance parameters and in combination with the computing resources of each training node, and the training data subsets are re-divided based on this to continue model training.

[0061] As can be seen from the above, in the embodiment of the present disclosure, based on the computing power resources and model parameter information of each training node, the micro-batch data size corresponding to each training node is calculated to divide the training data set to be distributed to each training node, and multiple training data subsets are obtained and distributed to the corresponding training nodes, so that each training node uses the distributed training data subset for model training and calculates the corresponding gradient value; the gradient values ​​returned by a preset number of training nodes are received, and according to the received gradient values, the training nodes that have not completed the gradient value calculation are screened out from each training node as the target training node; it is determined whether the gradient value returned by the target training node that meets the preset conditions is received within the preset time length, and all the received gradient values, the total time consumed to receive all the gradient values, and the model performance parameters of each training node are input into the pre-trained neural network model, and the updated model performance parameters of each training node are output, and based on this, the micro-batch data size corresponding to each training node is re-determined. The embodiment of the present disclosure can reasonably divide the micro-batch size of the training data to ensure the performance and training status of the model.

[0062] In one embodiment of the present disclosure, the above S204 includes: calculating the normalized computing power of each training node based on the computing power resources of each training node; calculating the batch data size corresponding to each training node according to the normalized computing power of each training node; calculating the micro-batch data size corresponding to each training node according to the normalized computing power, batch data size and preset scaling factor of each training node, wherein the preset scaling factor is used to balance the computing power gap between each training node.

[0063] In one embodiment of the present disclosure, the training nodes are divided into grades according to the peak computing power scale. Specifically, the normalized computing power corresponding to each training node is calculated by the following formula:

[0064]

[0065] Where normC(i) represents the normalized computing power of the i-th training node, ceiling(·) is used to round up the value calculated by the internal formula of the function, and s i represents the computing power of the i-th training node, m represents the minimum computing power among the S training nodes, and S represents the total number of training nodes.

[0066] It should be noted that the calculation result of this formula can be understood as dividing the training nodes into two adjacent levels with a difference of approximately ten times in computing power. In practical applications, other multiples may be used depending on the distribution of the computing power gap between each training node. For example, if the gap is too large, the base of the logarithm may be modified to twenty or other data. The embodiments of the present disclosure do not make specific limitations on this.

[0067] In one embodiment of the present disclosure, the micro-batch data size corresponding to each training node is calculated by the following formula:

[0068]

[0069] Among them, mbSize(i) represents the micro-batch data size of the i-th training node, SDR represents the preset scaling factor, normC(i) represents the normalized computing power of the i-th training node, BS represents the predetermined batch data size corresponding to each training node, and S represents the total number of training nodes.

[0070] In one embodiment of the present disclosure, the preset scaling factor is used to correct the situation where the computing power is too large or too small according to the distribution of the computing power gap of each training node. It should be noted that the value of the scaling factor can be set according to the actual situation, and the embodiment of the present disclosure does not specifically limit this.

[0071] In one embodiment of the present disclosure, after the above S210, the method further includes: if a gradient value satisfying a preset condition is received from the target training node within a preset time length, the gradient value satisfying the preset condition is retained; if a gradient value satisfying the preset condition is not received from the target training node within the preset time length, the gradient value satisfying the preset condition is stopped from being received from the target training node.

[0072] In one embodiment of the present disclosure, the above S212 includes: determining the loss value corresponding to each training node through all the received gradient values; determining the target loss value and the target total duration according to the Pareto optimal solution calculation method; inputting the target loss value, the target total duration and the model performance parameters of each training node into a pre-trained neural network model, and outputting the updated model performance parameters of each training node.

[0073] In one embodiment of the present disclosure, before the above S212, the method also includes: according to preset configuration requirements, tuning the model performance parameters of each training node, generating a parameter configuration template, so that the pre-trained neural network model updates the model performance parameters of each training node according to the target loss value, target total duration and parameter configuration template.

[0074] In one embodiment of the present disclosure, the value space of the model performance parameter tuning operation can be discretized and a configuration template can be preformed to significantly reduce the combinable action space, thereby enhancing the practicality of reinforcement learning.

[0075] In one embodiment of the present disclosure, the pre-trained neural network model is a deep dual Q network model DDQN.

[0076] In one embodiment of the present disclosure, based on the characteristics of the deep dual Q network model DDQN, the reward function is calculated by the following formula:

[0077] r(τ,L)=1 / (αlogτ+βlogL) (3)

[0078] Among them, τ represents the total time consumed after a certain model training is completed, that is, the above-mentioned target total time, L represents the model loss value obtained after a certain model training is completed, that is, the above-mentioned target loss value, r(τ,L) represents the reward value at the current time point, that is, the Pareto optimal solution between the target total time and the target loss value at the current time point, and α and β represent weight coefficients.

[0079] The model performance parameters of each training node are updated according to the following formula:

[0080]

[0081] Among them, y jrepresents the target value, which is used to guide the update of Q value, r j represents the reward value at the jth time point, γ represents the discount factor, Q(S j+1 ,a,θ) represents the current model according to the state S at the j+1th time point j+1 and the estimated Q value given by action a, θ represents the current model performance parameter, Indicates that in state S j+1 Next, the best action a selected by the current model is It represents the value of evaluating the best action selected by the current model using the target model performance parameter θ′.

[0082] Among them, L(θ) represents the loss value of the current model calculated according to the current model performance parameter θ, N represents the number of iterations of the current model, and Q(S j ,a j ,θ) represents the current model according to the state S at the jth time point j and action a j The estimated Q value is given.

[0083] In one embodiment of the present disclosure, on the one hand, the synchronization waiting delay between training nodes when different computing powers are in parallel is reduced by dynamically adjusting the mini-Batch size, and a waiting threshold (i.e., the above-mentioned preset duration or waiting time) is also introduced to limit the delay in the worst case; on the other hand, the gradient asynchronous update mechanism under the control of the gradient stale threshold (i.e., the above-mentioned preset threshold) is used to avoid the waste of computing power and sample data, and the convergence and performance of the model will not be affected by the aggregation of gradients that have expired for too long. The disclosed embodiment not only improves the training efficiency, but also enhances the adaptability to heterogeneous computing resources, reduces the demand for high-performance GPU interconnection devices, thereby reducing hardware costs, improving the autonomous controllability of the AI ​​platform, and reducing the difficulty and cost of large model applications in the intelligent computing center.

[0084] Figure 3 A flow chart of another method for determining distributed training micro-batch data based on multi-objective reinforcement learning in an embodiment of the present disclosure is shown. Figure 3 As shown, the method comprises the following steps:

[0085] S301, obtaining a training data set to be distributed to multiple training nodes.

[0086] S302, based on the computing resources of each training node, calculate the normalized computing power of each training node.

[0087] In one embodiment of the present disclosure, the normalized computing power of each training node is calculated using the above formula (1).

[0088] S303, calculating the batch data size corresponding to each training node according to the normalized computing power of each training node.

[0089] In one embodiment of the present disclosure, the parameter node also needs to initialize the current training node set S, the current calculated training node set SF, and the current uncalculated training node set SR.

[0090] S304, calculating the micro-batch data size corresponding to each training node according to the normalized computing power, batch data size and preset scaling factor of each training node.

[0091] In one embodiment of the present disclosure, the micro-batch data size corresponding to each training node is calculated by the above formula (2).

[0092] In one embodiment of the present disclosure, the parameter node also needs to initialize the sequence number of the current batch data batchNum=0 and the current model era MG=0.

[0093] S305, dividing the training data set into multiple training data subsets according to the micro-batch data size corresponding to each training node, and deriving the index interval of the micro-batch data size according to the micro-batch data size corresponding to each training node, and sending the obtained index to all corresponding training nodes.

[0094] In one embodiment of the present disclosure, the parameter node also needs to re-initialize the current training node set S, the current calculated training node set SF, and the current uncalculated training node set SR.

[0095] S306, receiving the gradient values ​​returned by each training node, and when the gradient values ​​returned by the training nodes of the preset summary lower limit number SL are received, starting the preset summary waiting delay time WN.

[0096] S307, continue to receive the gradient values ​​returned by the training nodes that have not been calculated when starting WN, until the waiting timer expires, stop receiving the gradient values ​​and start summarizing the gradient values.

[0097] In one embodiment of the present disclosure, it is determined whether the time difference between the time of the gradient value received after starting WN and the time of the current model satisfies a preset obsolescence threshold FN. If so, the gradient value is added to the gradient summary for calculation; if not, the gradient value is discarded.

[0098] Specifically, Figure 4 A flow chart of a gradient value aggregation method in an embodiment of the present disclosure is shown as follows: Figure 4 As shown, the method includes:

[0099] S3071, receiving the first batch of gradient values ​​returned by the training nodes of the preset summary number SL.

[0100] In one embodiment of the present disclosure, the first batch of gradient values ​​are gradient values ​​returned by a preset number of training nodes.

[0101] S3072, check the waiting time Twait. If Twait=0, execute S3073; if Twait=1, execute S3074; if Twait>1, execute S3075.

[0102] It should be noted that the value range of the waiting time is Twait≥0 and Twait is an integer.

[0103] S3073, activate waiting timer.

[0104] S3074, reduce the normalized computing power of the model.

[0105] S3075, reduce the waiting time.

[0106] S3076, aggregate the received first batch of gradient values ​​and the second batch of gradient values.

[0107] In one embodiment of the present disclosure, the second batch of gradient values ​​are gradient values ​​returned by the training node after the activation wait timer that meet the preset staleness threshold. It should be noted that the preset staleness threshold is the era difference between the era of the second batch of gradient values ​​and the era of the current model.

[0108] S3077, wait for the timing to end, exit the loop, and prepare to enter the iteration end phase.

[0109] S3078, receiving the acquired second batch of gradient values.

[0110] As can be seen from the above, the embodiment of the present disclosure can start the waiting timer after receiving the gradient values ​​returned by a preset number of training nodes (i.e., the first batch of gradient values), receive the gradient values ​​that meet the preset threshold within a preset time period (i.e., the second batch of gradient values), and aggregate all received gradient values ​​to perform subsequent model training. The embodiment of the present disclosure can avoid data waste, but at the same time, regardless of whether the second batch of gradient values ​​is received, it indicates that the computing power level of the training node is low, and the normalized computing power of the training node needs to be multiplicatively reduced in order to reduce the size of the micro-batch data for the training node next time.

[0111] In one embodiment of the present disclosure, if the first batch of gradient values ​​is the gradient value returned by all training nodes, it means that the computing power level of the training node is relatively high, and the normalized computing power of the training node is additively increased to increase the size of the micro-batch data for the training node next time. The embodiment of the present disclosure is adapted to the scenario of fluctuation of computing power of a single node.

[0112] S308, based on the gradient value obtained by summary, determine the loss value corresponding to the model, and input the total duration of this model training, the loss value corresponding to the model and the model performance parameters of each training node into the pre-trained neural network model, and output the updated model performance parameters of each training node.

[0113] In one embodiment of the present disclosure, the parameter node needs to perform model training according to a preset cycle duration u. It should be noted that u can be determined according to actual conditions and only needs to be smaller than the interval at which the gradient value arrives.

[0114] In one embodiment of the present disclosure, the pre-trained neural network model may refer to a deep dual Q network model DDQN, which can reduce overestimation by decomposing the maximum operation in the target into action selection and action evaluation. Reinforcement learning is implemented through the model, reasoning and training are performed, and the latest model performance parameters are returned as the basis for the next model training.

[0115] In one embodiment of the present disclosure, mini-batches of different sizes are dynamically allocated to different nodes based on computing power to reduce the generation of gradient waiting delays, and a preset waiting timer is added to limit the impact of delays; in addition, an obsolete threshold is used to selectively merge the thresholds of slow nodes to avoid waste of computing power and sample data, and the convergence and performance of the model will not be affected by gradient expiration for too long. In response to computing power fluctuations, the normalized computing power of the nodes is adjusted in each round according to the summary delay to better meet the actual operating conditions.

[0116] In one embodiment of the present disclosure, the hardware can give full play to the computing power in heterogeneous scenarios, which is suitable for the intelligent computing transformation of data centers with heterogeneous computing power, and is also suitable for future computing power upgrades, enhancing the autonomous controllability of AI computing power. It can adapt to such scenarios with mismatched computing power, allowing the deployment of heterogeneous computing power nodes both within a rack and between racks, making full use of existing resources, and on the other hand, opening up space for the addition of new computing power in the future, while also making the construction of the intelligent computing center not restricted to a certain type of equipment. At the same time, the disclosed embodiment can also adapt to the heterogeneity of the time dimension, that is, the situation of computing power fluctuations, and is suitable for the intelligent computing transformation of traditional cloud computing data centers.

[0117] Specifically, Figure 5 A schematic diagram of a reinforcement learning module implementation framework in an embodiment of the present disclosure is shown. Figure 5 As shown, the framework includes: an online learning agent module 501, a parameter setting template selection module 502, a training node parameter setting module 503, a parameter synchronization module 1021, a playback buffer 505 and an offline reinforcement learning module 103.

[0118] In one embodiment of the present disclosure, the state represents the environmental information applied as the proxy input, that is, the current training state. The state can be expressed as S = {τ, L, SDR, WN, FN, SL}, where τ represents the total time spent after a certain model training, L represents the model loss value obtained after a certain model training, SDR represents the preset scaling factor in a certain model training, WN represents the preset time in a certain model training, FN represents the preset threshold in a certain model training, and SL represents the preset number in a certain model training.

[0119] In one embodiment of the present disclosure, the reward function is defined by the above formula (3) to obtain the Pareto optimal solution, that is, to find a solution that simultaneously reduces τ and L without sacrificing any objective, thereby improving the convergence efficiency of training.

[0120] In one embodiment of the present disclosure, the values ​​of parameter tuning operations are spatially discretized in advance to form a configuration template, for example, SDR = {2, 3, 5, 10}, WN = {0.1T, 0.2T, 0.5T}, FN = {1, 2, 3, 5}, SL = {N, N+2, N+5}, where T is the time for a single iteration of training, and N is the number of training nodes with normalized computing power above the 80% percentile. By pre-setting the model performance parameter template, the combinable action space is greatly reduced, the complexity is reduced, and the practicality of reinforcement learning is enhanced.

[0121] In one embodiment of the present disclosure, the online learning agent module 501 obtains the state S j ={}, the online learning agent module 501 selects action a j = argmaxQ(S j ,a,θ), where a represents an action set of optional actions, and j represents the current time point. The parameter setting template selection module 502 selects the corresponding model performance parameter template according to the template number, and the training node parameter setting module 503 determines the model performance parameters, and returns the state containing the model performance parameters to the online learning agent module 501 for online learning training through the parameter synchronization module 1021. The parameter synchronization module 1021 also sends the data to the playback buffer 505.

[0122] In one embodiment of the present disclosure, the playback buffer can receive and save the trajectory of the model training to the trajectory set, which can be, for example, {S j-1 ,a j-1 ,r j ,S j+1}, as a historical trajectory, so that the embodiment of the present disclosure can, under certain circumstances, use the offline reinforcement learning module 103 to enable the model to be trained according to a preset trajectory in an environment outside the training cluster. When the online training is resumed, the training results are sent to the online learning agent module 501 to continue the training, thereby improving the speed of model training.

[0123] Based on the same inventive concept, the embodiments of the present disclosure also provide a distributed training micro-batch data determination device based on multi-objective reinforcement learning, as described in the following embodiments. Since the principle of solving the problem in the embodiment of the device is similar to that in the above method embodiment, the implementation of the embodiment of the device can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0124] Figure 6 A schematic diagram of a distributed training micro-batch data determination device based on multi-objective reinforcement learning in an embodiment of the present disclosure is shown. Figure 6 As shown, the device includes: a training data set acquisition module 601, a micro-batch data size calculation module 602, a gradient value calculation module 603, a target training node screening module 604, a target gradient value judgment module 605, a model performance parameter output module 606 and a micro-batch data size update module 607.

[0125] Among them, the training data set acquisition module 601 is used to acquire the training data set to be distributed to multiple training nodes; the micro-batch data size calculation module 602 is used to calculate the micro-batch data size corresponding to each training node based on the computing power resources and model parameter information of each training node, and divide the training data set into multiple training data subsets according to the micro-batch data size corresponding to each training node; the gradient value calculation module 603 is used to distribute each training data subset to the corresponding training node, so that each training node uses the distributed training data subset to perform model training and calculate the corresponding gradient value, wherein the gradient value of each training node is used to reflect the model training status of the training node; the target training node screening module 604 is used to receive the gradient values ​​returned by a preset number of training nodes, and screen out from each training node according to the received gradient values. A target training node, wherein the target training node is a training node among multiple training nodes that has not completed gradient value calculation; a target gradient value judgment module 605, used to judge whether a gradient value satisfying a preset condition is received from the target training node within a preset time length, wherein the preset condition is that the time difference between the calculation time point of the gradient value and the calculation time point of the model on the training node corresponding to the gradient value is less than a preset threshold; a model performance parameter output module 606, used to input all received gradient values, the total time consumed for receiving all gradient values, and the model performance parameters of each training node into a pre-trained neural network model, and output the updated model performance parameters of each training node; a micro-batch data size update module 607, used to determine the micro-batch data size corresponding to each training node according to the computing power resources of each training node and the updated model performance parameters.

[0126] As can be seen from the above, the embodiment of the present disclosure calculates the micro-batch data size corresponding to each training node based on the computing power resources and model parameter information of each training node to divide the training data set to be distributed to each training node, obtain multiple training data subsets and distribute them to the corresponding training nodes, so that each training node uses the distributed training data subsets for model training and calculates the corresponding gradient value; receives the gradient values ​​returned by a preset number of training nodes, and according to the received gradient values, selects the training nodes that have not completed the gradient value calculation from each training node as the target training node; determines whether the gradient value returned by the target training node that meets the preset conditions is received within the preset time length, and inputs all the received gradient values, the total time consumed to receive all the gradient values, and the model performance parameters of each training node into the pre-trained neural network model, outputs the updated model performance parameters of each training node, and re-determines the micro-batch data size corresponding to each training node based on this. The embodiment of the present disclosure can reasonably divide the micro-batch size of the training data to ensure the performance and training status of the model.

[0127] In one embodiment of the present disclosure, the above-mentioned micro-batch data size calculation module 602 is also used to calculate the normalized computing power of each training node based on the computing power resources of each training node; calculate the batch data size corresponding to each training node according to the normalized computing power of each training node; calculate the micro-batch data size corresponding to each training node according to the normalized computing power, batch data size and preset scaling factor of each training node, wherein the preset scaling factor is used to balance the computing power gap between each training node.

[0128] In one embodiment of the present disclosure, the micro-batch data size calculation module 602 is further used to calculate the micro-batch data size corresponding to each training node through the above formula (2).

[0129] In one embodiment of the present disclosure, the target gradient value judgment module 605 is also used to retain the gradient value that meets the preset conditions returned by the target training node if the gradient value that meets the preset conditions is received from the target training node within a preset time length; if the gradient value that meets the preset conditions is not received from the target training node within the preset time length, stop receiving the gradient value that meets the preset conditions returned by the target training node.

[0130] In one embodiment of the present disclosure, the above-mentioned model performance parameter output module 606 is also used to determine the loss value corresponding to each training node through all the received gradient values; determine the target loss value and the target total duration according to the Pareto optimal solution calculation method; input the target loss value, the target total duration and the model performance parameters of each training node into a pre-trained neural network model, and output the updated model performance parameters of each training node.

[0131] In one embodiment of the present disclosure, the device also includes: a model performance parameter template generation module 608, which is used to tune the model performance parameters of each training node according to preset configuration requirements, and generate a parameter configuration template so that the pre-trained neural network model can update the model performance parameters of each training node according to the target loss value, target total duration and parameter configuration template.

[0132] In one embodiment of the present disclosure, the pre-trained neural network model is a deep dual Q network model DDQN.

[0133] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0134] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present disclosure is described. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0135] Figure 7 A block diagram of an electronic device in an embodiment of the present disclosure is shown. Figure 7 An electronic device 700 according to this embodiment of the present disclosure is described. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0136] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include but are not limited to: at least one processing unit 710, at least one storage unit 720, and a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710).

[0137] Among them, the storage unit stores a program code, and the program code can be executed by the processing unit 710, so that the processing unit 710 executes the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 710 can execute the following steps of the above method embodiment: obtain a training data set to be distributed to multiple training nodes; based on the computing resources and model parameter information of each training node, calculate the micro-batch data size corresponding to each training node, and divide the training data set into multiple training data subsets according to the micro-batch data size corresponding to each training node; distribute each training data subset to the corresponding training node, so that each training node uses the distributed training data subset to perform model training and calculate the corresponding gradient value, wherein the gradient value of each training node is used to reflect the model training status of the training node; receive the gradient values ​​returned by a preset number of training nodes, and according to the received gradient values, calculate the gradient values ​​from each training node; A target training node is selected from the training nodes, wherein the target training node is a training node that has not completed the gradient value calculation among multiple training nodes; it is determined whether a gradient value satisfying a preset condition is received from the target training node within a preset time length, wherein the preset condition is that the time difference between the calculation time point of the gradient value and the calculation time point of the model on the training node corresponding to the gradient value is less than a preset threshold; all the received gradient values, the total time consumed for receiving all the gradient values, and the model performance parameters of each training node are input into a pre-trained neural network model, and the updated model performance parameters of each training node are output; the micro-batch data size corresponding to each training node is determined according to the computing power resources of each training node and the updated model performance parameters.

[0138] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .

[0139] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0140] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0141] The electronic device 700 may also communicate with one or more external devices 740 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0142] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0143] Based on the same inventive concept, a computer-readable storage medium is also provided in an embodiment of the present disclosure, on which a computer program is stored, and when the computer program is executed by a processor, any of the above-mentioned methods for determining distributed training micro-batch data based on multi-objective reinforcement learning is implemented. Since the implementation of the computer-readable storage medium embodiment can refer to the implementation of the above-mentioned method embodiment, the repeated parts will not be repeated.

[0144] Based on the same inventive concept, a computer-readable storage medium is also provided in an embodiment of the present disclosure, on which a computer program is stored, and when the computer program is executed by a processor, any of the above-mentioned methods for determining distributed training micro-batch data based on multi-objective reinforcement learning is implemented. Since the implementation of the computer-readable storage medium embodiment can refer to the implementation of the above-mentioned method embodiment, the repeated parts will not be repeated.

[0145] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0146] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0147] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0148] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0149] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0150] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0151] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0152] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A method for determining distributed training micro-batch data based on multi-objective reinforcement learning, characterized in that: include: Obtaining a training data set to be distributed to multiple training nodes; Based on the computing power resources and model parameter information of each training node, the micro-batch data size corresponding to each training node is calculated, and according to the micro-batch data size corresponding to each training node, the training data set is divided into multiple training data subsets; Distribute each training data subset to a corresponding training node, so that each training node uses the distributed training data subset to perform model training and calculate a corresponding gradient value, wherein the gradient value of each training node is used to reflect the model training status of the training node; Receive gradient values ​​returned by a preset number of training nodes, and select a target training node from each training node according to the received gradient values, wherein the target training node is a training node for which gradient value calculation has not been completed among the multiple training nodes; Determine whether a gradient value satisfying a preset condition is received from a target training node within a preset time period, wherein the preset condition is that a time difference between a calculation time point of the gradient value and a calculation time point of a model on a training node corresponding to the gradient value is less than a preset threshold; Input all received gradient values, the total time spent receiving all gradient values, and the model performance parameters of each training node into the pre-trained neural network model, and output the updated model performance parameters of each training node; According to the computing power resources of each training node and the updated model performance parameters, the micro-batch data size corresponding to each training node is determined.

2. The method for determining distributed training micro-batch data based on multi-objective reinforcement learning according to claim 1, characterized in that: The step of calculating the micro-batch data size corresponding to each training node based on the computing power resources and model parameter information of each training node includes: Based on the computing resources of each training node, calculate the normalized computing power of each training node; According to the normalized computing power of each training node, calculate the batch data size corresponding to each training node; According to the normalized computing power, batch data size and preset scaling factor of each training node, the micro-batch data size corresponding to each training node is calculated, wherein the preset scaling factor is used to balance the computing power gap between each training node.

3. The method for determining distributed training micro-batch data based on multi-objective reinforcement learning according to claim 2, characterized in that: The micro-batch data size corresponding to each training node is calculated by the following formula: Among them, mbSize(i) represents the micro-batch data size of the i-th training node, SDR represents the preset scaling factor, normC(i) represents the normalized computing power of the i-th training node, BS represents the batch data size corresponding to each training node in advance, and S represents the total number of training nodes.

4. The method for determining distributed training micro-batch data based on multi-objective reinforcement learning according to claim 1, characterized in that: After determining whether a gradient value satisfying a preset condition is received from a target training node within a preset time period, the method further includes: If a gradient value satisfying a preset condition is received from a target training node within a preset time period, the gradient value satisfying the preset condition is retained; If the gradient value satisfying the preset condition returned by the target training node is not received within the preset time length, the receiving of the gradient value satisfying the preset condition returned by the target training node is stopped.

5. The method for determining distributed training micro-batch data based on multi-objective reinforcement learning according to claim 1, characterized in that: The method inputs all received gradient values, the total time spent on receiving all gradient values, and the model performance parameters of each training node into the pre-trained neural network model, and outputs the updated model performance parameters of each training node, including: Determine the loss value corresponding to each training node through all the received gradient values; Determine the target loss value and target total duration based on the Pareto optimal solution calculation method; The target loss value, the target total duration and the model performance parameters of each training node are input into a pre-trained neural network model, and the updated model performance parameters of each training node are output.

6. The method for determining distributed training micro-batch data based on multi-objective reinforcement learning according to claim 5, characterized in that: Before outputting the updated model performance parameters of each training node, the method further includes: According to the preset configuration requirements, the model performance parameters of each training node are tuned and a parameter configuration template is generated so that the pre-trained neural network model updates the model performance parameters of each training node according to the target loss value, the target total duration and the parameter configuration template.

7. The method for determining distributed training micro-batch data based on multi-objective reinforcement learning according to claim 5, characterized in that: The pre-trained neural network model is the deep dual Q network model DDQN.

8. A distributed training micro-batch data determination device based on multi-objective reinforcement learning, characterized in that: include: A training data set acquisition module, used to acquire a training data set to be distributed to multiple training nodes; A micro-batch data size calculation module, used to calculate the micro-batch data size corresponding to each training node based on the computing power resources and model parameter information of each training node, and divide the training data set into multiple training data subsets according to the micro-batch data size corresponding to each training node; A gradient value calculation module is used to distribute each training data subset to a corresponding training node, so that each training node uses the distributed training data subset to perform model training and calculate a corresponding gradient value, wherein the gradient value of each training node is used to reflect the model training status of the training node; A target training node screening module is used to receive the gradient values ​​returned by a preset number of training nodes, and screen out a target training node from each training node according to the received gradient values, wherein the target training node is a training node for which the gradient value calculation has not been completed among the multiple training nodes; A target gradient value judgment module is used to judge whether a gradient value satisfying a preset condition is received from a target training node within a preset time period, wherein the preset condition is that the time difference between the calculation time point of the gradient value and the calculation time point of the model on the training node corresponding to the gradient value is less than a preset threshold; A model performance parameter output module is used to input all received gradient values, the total time consumed for receiving all gradient values, and the model performance parameters of each training node into a pre-trained neural network model, and output the updated model performance parameters of each training node; The micro-batch data size update module is used to determine the micro-batch data size corresponding to each training node according to the computing power resources of each training node and the updated model performance parameters.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the distributed training micro-batch data determination method based on multi-objective reinforcement learning as described in any one of claims 1 to 7 by executing the executable instructions.

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 method for determining distributed training micro-batch data based on multi-objective reinforcement learning described in any one of claims 1 to 7 is implemented.

11. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, it implements the method for determining distributed training micro-batch data based on multi-objective reinforcement learning as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Distributed training method and device for deep learning model, and computing equipment

    CN113642734A

  • Federal learning method and device, electronic equipment and computer readable storage medium

    CN117350370A

  • Method and apparatus for updating model parameter

    JP2021144696A

  • Control of Processing Node Operations

    US20210312268A1

  • Synchronous training method and cluster for convolutional neural network model, and readable storage medium

    WO2021056390A1

Cited By

  • Model processing method and device, program product and equipment

    CN119358643A

  • Classification model training method based on big data distributed computing

    CN120234158A

  • A classification model training method based on big data distributed computing

    CN120234158B

  • Large model reasoning optimization method and device, storage medium and electronic equipment

    CN120471177A

  • A large model inference optimization method and device, a storage medium and an electronic device

    CN120471177B