Distributed training group synchronization methods, systems, devices, and storage media
By dynamically grouping and selecting the worker node with the best communication quality as the parameter server in the distributed training system, the communication bottleneck and synchronization waiting problems in traditional distributed training are solved, improving the utilization of computing resources and training throughput, and achieving good scalability.
Patent Information
- Application Number
- CN202611235658.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-11-27
AI Technical Summary
In traditional distributed training schemes, parameter server architecture is limited by centralized communication bottlenecks, while All-Reduce architecture is limited by global synchronization waiting overhead, making it difficult to balance communication efficiency and computational efficiency in large-scale complex network environments.
Global communication is decoupled into two levels: intra-group and inter-group. By dynamically grouping and selecting the working node with the best communication quality as the parameter server, intra-group gradient synchronization and inter-group gradient data transmission are achieved, reducing synchronization waiting overhead and improving intra-group communication efficiency.
It significantly improves the utilization rate of cluster computing resources and overall training throughput, reduces the bandwidth pressure on the central node, enhances the scalability of the system, and adapts to the training needs of large-scale heterogeneous clusters.
Smart Images

Figure CN123180281A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed training technology, and in particular to a distributed training group synchronization method, system, computer device, and computer-readable storage medium. Background Technology
[0002] The core objective of DNN (Deep Neural Network) training is to optimize complex models on massive datasets to achieve higher accuracy. However, with technological advancements, training on a single GPU (Graphics Processing Unit) or server has gradually revealed three insurmountable bottlenecks: computing power, memory, and time. This directly spurred the emergence of distributed training. Distributed DNN training refers to decomposing the training task of a deep neural network (DNN) across multiple computing nodes for parallel processing to address the problems of insufficient computing power on a single device and excessively long training cycles. These computing nodes can be multiple CPUs (Central Processing Units), multiple GPUs, or server clusters distributed across different geographical locations.
[0003] Distributed deep learning training typically employs a data-parallel paradigm, which involves replicating the complete model to each computing node (worker node) and dividing the training data into multiple subsets and distributing them to each node. Each node computes gradients based on its local data shards and aggregates these gradients through a gradient synchronization mechanism to update the global model parameters. Currently, the mainstream gradient synchronization methods include two architectures: All-Reduce and parameter server.
[0004] In a parameter server architecture, the central node (parameter server) is responsible for storing and maintaining global model parameters. Each worker node uploads its calculated local gradients to the parameter server, which then aggregates the gradients, updates the parameters, and distributes the updated parameters back to the worker nodes. However, as the number of model parameters and the cluster size continue to increase, all gradient information and parameter updates must be communicated through the parameter server. This makes the central node a bottleneck in communication bandwidth, severely restricting the cluster's scalability.
[0005] In the All-Reduce architecture, all worker nodes are equal, directly exchanging and aggregating gradients through a collective communication protocol. Ultimately, each node obtains the global average gradient to independently update its parameters, distributing the communication load across the entire cluster. However, this approach requires all worker nodes to complete gradient computation before gradient synchronization can occur. The computational delay of any node will cause global waiting, spreading the computational bottleneck throughout the entire cluster, especially prominent in large-scale heterogeneous clusters.
[0006] It is evident that in traditional distributed training schemes, parameter server architecture is limited by centralized communication bottlenecks, while All-Reduce architecture is limited by global synchronization waiting overhead. Neither of them can simultaneously achieve both communication efficiency and computational efficiency in large-scale complex network environments. Summary of the Invention
[0007] Therefore, it is necessary to provide a distributed training group synchronization method, system, computer device, and computer-readable storage medium to address the above-mentioned technical problems. This method decouples global communication into two levels: intra-group and inter-group. It can reduce synchronization waiting overhead, improve intra-group communication efficiency, and enhance the scalability of the system.
[0008] Firstly, this application provides a distributed training group synchronization method, which is applied to a distributed training system. The distributed training system includes a control node and multiple worker nodes. The worker nodes are used to perform multiple rounds of training iterations based on allocated data. The method includes:
[0009] During the current training iteration, when the control node detects that the cumulative number of worker nodes that have completed the training iteration has reached the grouping threshold, it divides the worker nodes that have accumulated to the grouping threshold into a group, so that the worker nodes in the group can synchronize the gradient within the group.
[0010] The control node uses the worker node with the best communication quality parameters in each group as the parameter server for the corresponding group, and uses the group that completes gradient synchronization first in the distributed training system as the main group.
[0011] After the target group completes gradient synchronization, the parameter server of the target group synchronizes gradient data with the parameter server of the main group; the target group is any group other than the main group.
[0012] The parameter server of the main group updates the model parameters based on the gradient data synchronized by all groups, and distributes the updated model parameters to the parameter server of each target group.
[0013] The parameter server for each group will synchronize the updated model parameters to each worker node within its respective group.
[0014] In one embodiment, before the control node classifies the currently accumulated number of worker nodes that have completed training iterations into a group when it detects that the cumulative number has reached a grouping threshold, the method further includes:
[0015] The control node sets the grouping threshold based on the network status information of each working node.
[0016] In one embodiment, the control node sets a grouping threshold based on the network status information of each working node, including:
[0017] The control node accumulates the currently completed training iterations of the working nodes into the current group;
[0018] The bandwidth pressure coefficient is determined based on the average bandwidth utilization of all working nodes in the current group;
[0019] Determine the channel quality coefficients based on the channel quality parameters of each working node in the current group;
[0020] Set the current packet threshold based on the bandwidth pressure coefficient and channel quality coefficient.
[0021] In one embodiment, after the parameter server of each group synchronizes the updated model parameters to each worker node within its respective group, the method further includes:
[0022] Each worker node of the distributed training system performs the next round of training iterations.
[0023] In one embodiment, after the parameter server of the target group synchronizes gradient data with the parameter server of the main group, the method further includes:
[0024] The parameter server of the target group updates the model parameters based on the gradient data synchronized by the target group, and synchronizes the updated model parameters to each working node of the target group;
[0025] After the target group completes parameter synchronization, each working node of the target group will proceed to the next round of training iterations;
[0026] Accordingly, the method further includes;
[0027] After receiving the updated model parameters distributed by the parameter server of the main group, the parameter server of the target group waits for all worker nodes in the group to complete the corresponding round of training iterations before synchronizing the received model parameters to each worker node in the group.
[0028] In one embodiment, the working nodes within a group perform gradient synchronization within the group, including:
[0029] Each worker node within a group performs a full reduction communication operation, sending its calculated local gradient to other worker nodes within the group and receiving local gradients from other worker nodes to obtain the group's aggregated gradient.
[0030] In one embodiment, the working nodes within a group perform gradient synchronization within the group, including:
[0031] Each working node within a group sends its calculated local gradient to the group's parameter server. The parameter server then sums all the received local gradients to obtain the group's aggregated gradient.
[0032] Secondly, this application also provides a distributed training system, which includes a control node and multiple worker nodes. The worker nodes are used to perform multiple rounds of training iterations based on allocated data, wherein:
[0033] During the current training iteration, the control node is used to divide the current accumulated number of worker nodes that have completed the training iteration into a group when the cumulative number of worker nodes that have completed the training iteration reaches the grouping threshold, so that the worker nodes in the group can synchronize the gradient within the group.
[0034] The control node is also used to select the working node with the best communication quality parameters in each group as the parameter server for the corresponding group, and to select the group that completes gradient synchronization first in the distributed training system as the main group.
[0035] After the target group completes gradient synchronization, the parameter server of the target group is used to synchronize gradient data with the parameter server of the main group; the target group is any group other than the main group.
[0036] The parameter server of the main group is used to update the model parameters based on the gradient data synchronized by all groups, and to distribute the updated model parameters to the parameter server of each target group.
[0037] Each group's parameter server is used to synchronize the updated model parameters to each worker node within its respective group.
[0038] Thirdly, this application also provides a computer device as a control node or working node in a distributed training system. The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.
[0039] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.
[0040] In the aforementioned distributed training group synchronization method, system, computer device, and computer-readable storage medium, during the current training iteration, when the control node detects that the cumulative number of worker nodes that have completed the training iteration has reached the grouping threshold, it divides the worker nodes that have accumulated to the grouping threshold into a group, enabling the worker nodes within the group to synchronize gradients within the group. The control node designates the worker node with the best communication quality parameters in each group as the parameter server for that group, and designates the group that first completes gradient synchronization in the distributed training system as the master group. After the target group completes gradient synchronization, the parameter server of the target group synchronizes gradient data to the parameter server of the master group. The target group can be any group other than the master group. The parameter server of the master group updates the model parameters based on the gradient data synchronized by all groups and distributes the updated model parameters to the parameter servers of each target group. The parameter server of each group synchronizes the updated model parameters to each worker node within its respective group. By employing the above method, during the current iteration, worker nodes are dynamically grouped according to the order in which they complete the training iteration. This allows worker nodes that complete computation earlier to synchronize gradients within their group without waiting for slower nodes, effectively reducing idle time caused by waiting for lagging nodes in traditional synchronous training. This significantly improves the utilization rate of cluster computing resources and overall training throughput. Within each group, the worker node with the best communication quality is selected as the group's parameter server. Since the size of nodes within a group is controllable, the communication bottleneck of a single central parameter server facing a massive number of worker nodes is avoided, reducing the bandwidth pressure on the central node. Gradients are centrally aggregated by a master group and then uniformly updated by the master group before being distributed to each group, achieving global gradient synchronization and parameter updates. Global communication is decoupled into two levels: intra-group communication and inter-group communication. Each level of parameter server only bears the communication load within its own group, avoiding the problem in traditional parameter server architectures where the central node quickly becomes a performance bottleneck as the cluster size increases. Distributing the communication pressure to multiple sub-groups gives the distributed training system good scalability and enables it to adapt to the training needs of large-scale heterogeneous clusters. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 A schematic diagram of the gradient and parameter synchronization process for the parameter server architecture;
[0043] Figure 2 A schematic diagram illustrating the gradient and parameter synchronization process in the All-Reduce architecture;
[0044] Figure 3 This is a flowchart illustrating a distributed training group synchronization method in one embodiment;
[0045] Figure 4 This is a flowchart illustrating the process of grouping working nodes and synchronizing gradients within a group in one embodiment.
[0046] Figure 5 This is a flowchart illustrating the process of inter-group gradient synchronization in one embodiment;
[0047] Figure 6 This is a flowchart illustrating the process of synchronizing parameters within a group in one embodiment;
[0048] Figure 7 This is a schematic diagram of the gradient and parameter synchronization process of a distributed training system in one embodiment;
[0049] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0051] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0052] Understandably, referring to Figure 1In the parameter server architecture, complete deep learning model parameters (e.g., weight values w) are centrally stored on the parameter server. Each worker node in the cluster pulls the current model parameters from the parameter server, performs forward and backward propagation based on its assigned training data shards, and calculates its local gradient. Each worker node uploads its calculated local gradient (Δw) to the parameter server, which aggregates the gradients from all worker nodes and updates the model weights based on the aggregated gradients. After completing the parameter update, the parameter server redistributes the updated model weights to all worker nodes to start the next round of iterative training.
[0053] In a parameter server architecture, since the gradient calculation speeds of each worker node are independent, this architecture supports asynchronous gradient transmission. Parameter updates can be performed without waiting for the slowest worker node in the cluster to complete gradient calculations, effectively avoiding idle computing resources. However, in this architecture, all gradient upload and parameter download operations must be completed through the parameter server. When the number of worker nodes in the cluster is large, the communication bandwidth of the parameter server will quickly become a system bottleneck, severely restricting the cluster's scalability.
[0054] Reference Figure 2 In the All-Reduce architecture, all worker nodes in the cluster are equal, and there is no centralized parameter server. Each worker node calculates its local gradient based on its own data shards, then exchanges local gradient information with all other worker nodes through all-reduce aggregation communication, performing gradient aggregation during the communication process. Finally, each worker node obtains the globally aggregated gradient and independently updates its local model parameters based on this aggregated gradient.
[0055] In the All-Reduce architecture, the communication load is evenly distributed across all worker nodes, eliminating the bandwidth bottleneck of a single central node and exhibiting good communication balance. However, in this architecture, all worker nodes must complete their backpropagation computations before initiating the collective communication operation for gradient exchange. At this point, the slowest worker node in the cluster determines the synchronization rhythm of the entire system, leading to low utilization of computing resources, especially pronounced in large-scale heterogeneous clusters.
[0056] Based on this, embodiments of this application provide a distributed training group synchronization method, system, computer device, and computer-readable storage medium. During the current iteration, worker nodes are dynamically grouped according to the order in which they complete the training iteration. This allows worker nodes that complete computation earlier to synchronize gradients within their group without waiting for slower nodes, effectively reducing idle time caused by waiting for lagging nodes in traditional synchronous training. This significantly improves the utilization rate of cluster computing resources and overall training throughput. Within each group, the worker node with the best communication quality is selected as the group's parameter server. Since the size of nodes within a group is controllable, the communication bottleneck of a single central parameter server facing a massive number of worker nodes is avoided, reducing the bandwidth pressure on the central node. Gradients are centrally aggregated by a master group, and the master group updates the model parameters and then distributes them to each group, achieving global gradient synchronization and parameter updates. Global communication is decoupled into two levels: intra-group communication and inter-group communication. Each level of parameter server only undertakes the communication load within its own group size, avoiding the problem in traditional parameter server architecture where the central node quickly becomes a performance bottleneck as the cluster size increases. The communication pressure is distributed to multiple sub-groups, giving the distributed training system good scalability and enabling it to adapt to the training needs of large-scale heterogeneous clusters.
[0057] In one exemplary embodiment, such as Figure 3 As shown, a distributed training group synchronization method is provided. The method is applied to a distributed training system, which includes a control node and multiple worker nodes. The worker nodes are used to perform multiple rounds of training iterations based on the allocated data.
[0058] As is understandable, a distributed training system includes a control node and multiple worker nodes. Worker nodes are interconnected via a high-speed bus or data center network. Worker nodes can be homogeneous or heterogeneous; that is, different worker nodes may use different types of AI accelerator cards, including but not limited to GPUs (Graphics Processing Units), NPUs (Neural Processing Units), and TPUs (Tensor Processing Units). Training data is distributed to each worker node in a data shard manner, and each worker node independently executes training iterations based on its allocated data shard.
[0059] A single training iteration consists of four stages: forward propagation, back propagation, gradient synchronization, and parameter update. In the forward propagation stage, worker nodes input the current batch of training data into the model and calculate the prediction results and loss values. In the back propagation stage, worker nodes calculate the gradients of each model parameter based on the loss values. In the gradient synchronization stage, each worker node exchanges and aggregates its locally calculated gradients with other worker nodes. In the parameter update stage, each worker node updates its local model parameters based on the aggregated gradients.
[0060] A control node is a physical device or logical functional entity in a distributed training system responsible for executing grouping decisions and scheduling management. In one optional implementation, the control node is an independent physical server equipped with a CPU and network interface for communicating with each worker node. This server receives training iteration completion status reports from each worker node and performs grouping operations according to the method provided in this embodiment. In another optional implementation, the control node is not an independent physical device, but rather a management process or thread deployed on the physical server where any worker node resides in the distributed training system. It executes grouping decision logic using the CPU resources of the worker node. Regardless of its physical implementation, the control node's function is to receive status information from each worker node, perform grouping judgments, and issue grouping instructions to each worker node.
[0061] A worker node is a physical device or logical entity with computation and communication capabilities, responsible for data processing and gradient calculation. Each worker loads a complete copy of the model and allocates it to a subset (data shard) of the training dataset. For example, each worker node independently executes multiple rounds of training iterations based on its allocated training data shard. These iterations include forward and backward propagation to calculate the local model gradient. It can be understood that when a worker node completes one training iteration, it means that the worker node, based on its currently held model parameters and the allocated training data shard, has completed one forward propagation and one backward propagation, and generated its local gradient.
[0062] The method includes:
[0063] Step 302: During the current training iteration, when the control node detects that the cumulative number of working nodes that have completed the training iteration has reached the grouping threshold, it divides the working nodes that have accumulated to the grouping threshold into a group, so that the working nodes in the group can synchronize the gradient within the group.
[0064] In the current training iteration, each worker node independently performs forward and backward propagation based on its allocated data shards. Once any worker node completes a full training iteration (i.e., completes one forward and one backward propagation, generating local gradients), it reports a completion notification to the control node. The completion notification includes at least the worker node's node identifier and, optionally, may also include the timestamp of the worker node's completion of this iteration or the currently held model parameter version number.
[0065] A grouping threshold is used to limit the number of worker nodes included in a group. In one optional implementation, the grouping threshold is a preset fixed value, for example, pre-configured by the system administrator based on the cluster size. In another preferred implementation, the grouping threshold is dynamically determined by the control node based on the network state information of each worker node. Optionally, the control node obtains the global network state information of the entire distributed training system and calculates a unified grouping threshold based on the global network state. This grouping threshold is applied to all groups in the current training iteration, meaning that each group contains the same number of worker nodes. Optionally, the grouping threshold for each group is not globally uniform, but is independently determined by the control node based on the actual network state among the worker nodes that have completed iterations within that group.
[0066] During the current training iteration, the control node continuously monitors the number of worker nodes that have completed the training iteration. Specifically, whenever the control node receives a completion notification from a worker node, it increments the cumulative count and adds that worker node to the current set to be grouped.
[0067] The control node determines whether the cumulative count has reached the grouping threshold. When the cumulative count reaches the grouping threshold, the control node divides all working nodes that have accumulated to the grouping threshold into one group. The division operation is as follows: the control node marks all working nodes in the current set to be grouped as one group, assigns a group identifier to the group, and clears the current set to be grouped and the cumulative counter to start the accumulation of the next group.
[0068] It should be noted that the grouping in this application embodiment is a logical grouping, that is, the control node logically divides the working nodes that meet the conditions into the same group, and does not involve the reconnection or migration of physical devices.
[0069] For example, a grouping threshold n is set, data is allocated to each worker, and iterative training begins. Due to differences in data, computing power, and operating environment, the backpropagation completion time of the workers varies. The number of workers that have completed backpropagation in real time is monitored. When the number reaches the grouping threshold n, the workers that have completed backpropagation at this point are grouped together. (Refer to...) Figure 4 The grouping threshold is 3. The first three completed workers are included in group1, and the workers from the fourth to the sixth completed workers are included in group2.
[0070] After the grouping is completed, the worker nodes within each group perform gradient synchronization. Specifically, each worker node in the same group exchanges and aggregates its local gradients through intra-group communication, so that each worker node in the group obtains the aggregated gradient within the group.
[0071] Reference Figure 4 Once the number of gradients reaches the grouping threshold, gradient synchronization is performed within the group. Depending on the network conditions within the group, either all-reduce or a parameter server approach can be used to synchronize gradients. In an all-reduce approach, the gradients are synchronized within the group without updating the parameters; after the all-reduce operation, each worker in the group receives the gradient sum of the entire group. In a parameter server approach, the parameter server collects the gradient sums without updating the parameters.
[0072] In an exemplary embodiment, intra-group gradient synchronization is implemented using an all-reduce approach. The intra-group gradient synchronization is achieved by each worker node within the group performing an all-reduce communication operation, sending its calculated local gradient to other worker nodes within the group, and receiving local gradients from other worker nodes to obtain the intra-group aggregated gradient.
[0073] In this process, each working node in the group performs a full reduction communication operation, sending its local gradient to other working nodes in the group and receiving local gradients sent by other working nodes. Each working node eventually obtains the aggregated result of the local gradients of all working nodes in the group, such as summation or averaging.
[0074] In an exemplary embodiment, the intra-group gradient synchronization is implemented using a parameter server approach. The intra-group gradient synchronization is performed by each working node within the group, which sends its calculated local gradient to the group's parameter server. The parameter server then accumulates all received local gradients to obtain the group's aggregated gradient.
[0075] In this system, after grouping, the control node selects one worker node from the group's worker nodes as the group's parameter server, or a pre-designated parameter server within the group assumes the aggregation responsibility. It should be noted that the parameter server within the group and the node responsible for inter-group communication can be the same physical node or different physical nodes. Other worker nodes within the group send their local gradients to the group's parameter server, which then aggregates the gradients and sends the aggregated gradients back to the worker nodes within the group. Because the group size is controlled by a group threshold, the communication load of the parameter server within the group is limited to a controllable range, avoiding the single-point communication bottleneck problem in traditional parameter server schemes.
[0076] Step 304: The control node selects the working node with the best communication quality parameters in each group as the parameter server for the corresponding group, and selects the group that completes gradient synchronization first in the distributed training system as the main group.
[0077] After completing the grouping, the control node obtains the communication quality parameters of each working node within each group. These communication quality parameters are quantitative indicators used to measure the communication status between working nodes and other nodes. In one optional implementation, the communication quality parameters include, but are not limited to, one or more of the following: network bandwidth utilization, round-trip time (RTT), packet loss rate, available bandwidth, maximum transmission unit (MTU), and congestion window size.
[0078] The control node selects the working node with the best communication quality from all working nodes within the group based on communication quality parameters, and designates it as the group's parameter server (PS). Optionally, selecting the working node with the best communication quality involves the control node calculating a comprehensive communication quality score for each working node within the group, and selecting the working node with the highest comprehensive score as the group's parameter server. The comprehensive score is calculated by weighting multiple factors, including bandwidth utilization, transmission latency, and packet loss rate. For example, a working node with lower transmission latency and packet loss rate, and larger available bandwidth, is rated as having the best communication quality.
[0079] In another alternative implementation, if a pre-specified parameter server already exists within a group, and the communication quality parameters of that parameter server are not optimal within the group, the control node can choose to replace the pre-specified parameter server with a working node that has better communication quality, or choose to retain the pre-specified parameter server.
[0080] After the parameter servers within the group are selected, each group performs gradient synchronization within the group. The control node or the monitoring module of the distributed training system monitors the gradient synchronization completion status of each group in real time. When a group in the distributed training system completes gradient synchronization within the group first, the control node designates that group as the master group. Completing gradient synchronization first means that, among all groups, that group completes the gradient aggregation operation of all worker nodes within its group earliest.
[0081] Step 306: After the target group completes gradient synchronization, the parameter server of the target group synchronizes gradient data with the parameter server of the main group; the target group is any group other than the main group.
[0082] In the distributed training system, all groups other than the main group are target groups. Each target group must send its aggregated gradient data to the main group. Specifically, when a target group completes its intra-group gradient synchronization—that is, when its intra-group parameter server has collected and aggregated the local gradients of all worker nodes within its group—it sends the aggregated sum of intra-group gradients to the main group's parameter server via the cluster network. The main group's parameter server receives the sums of intra-group gradients from each target group, accumulates them, and stores them for subsequent updates to global parameters. It's important to note that the process of each target group synchronizing gradient data with the main group is independent. Any target group can send gradient data to the main group after completing its own intra-group gradient synchronization, without waiting for other target groups to complete theirs.
[0083] For example, refer to Figure 5 After group1 completes its gradient synchronization, it selects the worker with the best communication quality parameters as the parameter server (PS) or retains the original parameter server. When group2 completes its gradient synchronization, it also selects a worker as the parameter server. Group2 and group1 synchronize the gradient sum of their respective groups. Since group1 has higher performance, it is selected as the main group, sending its gradients to group1's PS via group2's PS, which then performs the summation. Similarly, when group3 completes its gradient synchronization, it sends its gradients to group1's PS via group3's PS, which then sums the current gradients (including gradients from all three groups).
[0084] Step 308: The parameter server of the main group updates the model parameters based on the gradient data synchronized by all groups, and distributes the updated model parameters to the parameter server of each target group.
[0085] In this process, after receiving the sum of intra-group gradients reported by all target groups (i.e., all groups other than the main group), the parameter server of the main group performs a global parameter update operation. Specifically, the parameter server of the main group accumulates the received intra-group gradient sums to obtain the global gradient sum. Based on the total number of all working nodes participating in this iteration, the parameter server of the main group calculates the average of the global gradient sum to obtain the global average gradient. Based on the global average gradient, the parameter server of the main group updates the locally stored global model parameters using a preset optimization algorithm, completing the parameter update for this iteration. After completing the parameter update, the parameter server of the main group distributes the updated model parameters to the parameter servers of each target group. Specifically, the parameter server of the main group sends the updated model parameters to the intra-group parameter servers of each target group through the cluster network.
[0086] Step 310: The parameter server of each group synchronizes the updated model parameters to each working node within its respective group.
[0087] In this process, after receiving the updated model parameters, the parameter server within each target group synchronizes the updated model parameters to every worker node within that group. This ensures that all worker nodes in the group have consistent updated model parameters for use in the next training iteration. At this point, the model parameters of all worker nodes in the distributed training system have been updated to the latest version, completing the parameter synchronization for this round of global iteration.
[0088] For example, refer to Figure 6 Group1 acts as the main group, updates the model parameters (w) based on the gradient data synchronized by all groups, synchronizes the updated model parameters to other working nodes in the group, and distributes the updated model parameters to the parameter servers of group2 and group3; the parameter servers of group2 and group3 synchronize the updated model parameters to other working nodes in the group.
[0089] In the aforementioned distributed training group synchronization method, during the current training iteration, when the control node detects that the cumulative number of worker nodes that have completed the training iteration has reached the grouping threshold, it divides the worker nodes that have reached the grouping threshold into a group, enabling the worker nodes within the group to synchronize gradients within the group. The control node designates the worker node with the best communication quality parameters in each group as the parameter server for that group, and designates the group that first completes gradient synchronization in the distributed training system as the master group. After the target group completes gradient synchronization, the parameter server of the target group synchronizes gradient data to the parameter server of the master group. The target group can be any group other than the master group. The parameter server of the master group updates the model parameters based on the gradient data synchronized by all groups and distributes the updated model parameters to the parameter servers of each target group. The parameter server of each group synchronizes the updated model parameters to each worker node within its respective group. By employing the above method, during the current iteration, worker nodes are dynamically grouped according to the order in which they complete the training iteration. This allows worker nodes that complete computation earlier to synchronize gradients within their group without waiting for slower nodes, effectively reducing idle time caused by waiting for lagging nodes in traditional synchronous training. This significantly improves the utilization rate of cluster computing resources and overall training throughput. Within each group, the worker node with the best communication quality is selected as the group's parameter server. Since the size of nodes within a group is controllable, the communication bottleneck of a single central parameter server facing a massive number of worker nodes is avoided, reducing the bandwidth pressure on the central node. Gradients are centrally aggregated by a master group and then uniformly updated by the master group before being distributed to each group, achieving global gradient synchronization and parameter updates. Global communication is decoupled into two levels: intra-group communication and inter-group communication. Each level of parameter server only bears the communication load within its own group, avoiding the problem in traditional parameter server architectures where the central node quickly becomes a performance bottleneck as the cluster size increases. Distributing the communication pressure to multiple sub-groups gives the distributed training system good scalability and enables it to adapt to the training needs of large-scale heterogeneous clusters.
[0090] In an exemplary embodiment, before the control node classifies the currently accumulated number of worker nodes that have completed training iterations into a group when it detects that the cumulative number has reached the grouping threshold, the method further includes: the control node setting the grouping threshold based on the network status information of each worker node.
[0091] The control node acquires the network status information of each worker node when the distributed training system starts or before the start of each training iteration. This network status information characterizes the communication status of each worker node in the current cluster environment. For example, the network status information includes, but is not limited to, one or more of the following: network bandwidth utilization between worker nodes, round-trip time (RTT), packet loss rate, and available bandwidth.
[0092] The control node evaluates the overall or local network condition of the current cluster based on the acquired network status information, and sets a grouping threshold based on the evaluation results. The grouping threshold limits the maximum number of worker nodes in a group; that is, when the cumulative number of worker nodes that have completed training iterations reaches the grouping threshold, the grouping operation is triggered.
[0093] In one optional implementation, the control node calculates a globally uniform grouping threshold based on the average network bandwidth utilization and average transmission latency among the worker nodes. This grouping threshold applies to all groups in the current training iteration. Specifically, when the control node determines that the current cluster network status is good (e.g., the average bandwidth utilization is lower than a preset first threshold and the average transmission latency is lower than a preset second threshold), it sets the grouping threshold to a larger value, allowing each group to contain more worker nodes, thereby reducing the number of groups, decreasing the number of inter-group communications, and improving overall communication efficiency. When the control node determines that the current cluster network status is poor (e.g., the average bandwidth utilization is higher than a preset first threshold or the average transmission latency is higher than a preset second threshold), it sets the grouping threshold to a smaller value, allowing each group to contain fewer worker nodes, thereby reducing the amount of communication data for a single gradient synchronization within a group and avoiding communication delays caused by network congestion.
[0094] In another alternative implementation, the control node sets different grouping thresholds for different sets of worker nodes.
[0095] In this embodiment, the group size is dynamically controlled based on the cumulative number of working nodes that have completed the training iterations. This allows the group size to adapt to the network state of the cluster, avoiding communication congestion or bandwidth idleness caused by a fixed group size. This improves the adaptability to heterogeneous network environments while ensuring communication efficiency.
[0096] In an exemplary embodiment, the control node sets a grouping threshold based on the network status information of each working node, including: the control node accumulating the working nodes that have completed the training iteration into the current group; determining the bandwidth pressure coefficient based on the average bandwidth utilization of all working nodes in the current group; determining the channel quality coefficient based on the channel quality parameters of each working node in the current group; and setting the grouping threshold of the current group based on the bandwidth pressure coefficient and the channel quality coefficient.
[0097] The control node accumulates the currently completed training iterations of the working nodes into the current group, and determines the group threshold corresponding to the group based on the network state information of all working nodes in the current group.
[0098] The control node obtains the average bandwidth utilization among all worker nodes in the current group, which serves as the bandwidth pressure coefficient. Bandwidth utilization characterizes the degree of network bandwidth occupancy among worker nodes, and its value typically ranges from 0 to 1.
[0099] Specifically, the control node obtains the link bandwidth utilization rate between each working node in the current group, calculates the average of all link bandwidth utilization rates, and uses this average bandwidth utilization rate as the bandwidth pressure coefficient. A higher bandwidth pressure coefficient indicates a heavier network load and a greater risk of communication congestion. In this embodiment, the bandwidth pressure coefficient is negatively correlated with the group threshold; that is, a higher bandwidth pressure coefficient results in a smaller group threshold. When the network load is heavy, a smaller group threshold means that each group contains fewer working nodes, thereby reducing the amount of communication data required for gradient synchronization within a single group and avoiding communication delays caused by network congestion.
[0100] The control node obtains the channel quality parameters of each working node in the current packet and calculates the channel quality coefficient based on the channel quality parameters. The channel quality parameters include, but are not limited to, one or more of the following: bandwidth (b), packet loss rate (p), transmission delay (l), and topology (h).
[0101] In this embodiment, the channel quality coefficient is calculated by integrating multiple parameters including bandwidth, packet loss rate, transmission delay, and topology. In an optional implementation, the channel quality coefficient is calculated using a weighted summation method. Specifically, the control node obtains the average bandwidth, average packet loss rate, average transmission delay, and average topology hop count of all working nodes within the current packet, and calculates the channel quality coefficient according to the following weighted formula:
[0102] s=a1×b+a2×(1-p)+a3 / l+a4 / h;
[0103] Where s is the channel quality coefficient; b is the average bandwidth of each working node in the current packet; p is the average packet loss rate between each working node in the current packet; l is the average transmission delay between each working node in the current packet; h is the average topology hop count (i.e., the number of hops between network devices) between each working node in the current packet; a1, a2, a3, and a4 are preset proportional coefficients used to adjust the degree of influence of bandwidth, packet loss rate, transmission delay, and topology hop count on the channel quality coefficient, respectively.
[0104] It should be noted that all parameters in the above formula are calculated based on the average value of all working nodes within the current group, ensuring that the channel quality coefficient reflects the overall channel condition of the local network environment corresponding to the current group. In one optional implementation, the sum of a1, a2, a3, and a4 equals 1 to ensure that the channel quality coefficient is normalized to a preset value range, facilitating subsequent unified calculation with the bandwidth pressure coefficient.
[0105] A higher channel quality coefficient indicates better channel quality in the current network, making it more suitable for carrying large-scale intra-group communication. Therefore, the channel quality coefficient is positively correlated with the packet threshold; that is, the higher the channel quality coefficient, the larger the packet threshold.
[0106] The control node sets the packet threshold for the current packet based on the bandwidth pressure coefficient and the channel quality coefficient. In one optional implementation, the control node determines the packet threshold for the current packet using the following calculation method, based on the fundamental granularity and in conjunction with the bandwidth pressure coefficient and the channel quality coefficient:
[0107] n = n0 × (1 + v1 × (1 - w) + v2 × s);
[0108] Where n is the current packet threshold; n0 is the preset base granularity, representing the baseline packet size under standard network conditions; w is the bandwidth pressure coefficient; s is the channel quality coefficient; v1 and v2 are preset proportional coefficients, used to adjust the influence of the bandwidth pressure coefficient and the channel quality coefficient on the packet threshold, respectively.
[0109] Understandably, when the bandwidth pressure coefficient w is low (i.e., the network load is light), (1-w) is large, and the packet threshold n increases based on the basic granularity n0, allowing packets to accommodate more working nodes. Conversely, when the bandwidth pressure coefficient w is high (i.e., the network load is heavy), (1-w) is small, and the packet threshold n decreases based on the basic granularity n0, allowing packets to accommodate fewer working nodes to avoid congestion. Similarly, when the channel quality coefficient s is high, the packet threshold n increases to fully utilize high-quality channel resources; when the channel quality coefficient s is low, the packet threshold n decreases to avoid large-scale communication under poor channel conditions.
[0110] In one alternative implementation, the control node recalculates the packet threshold for the current packet whenever a worker node completes backpropagation and reports a completion notification. Since the set of worker nodes that have completed accumulation in the current packet has changed, their average bandwidth utilization and average channel quality parameters may also change; therefore, the recalculated packet threshold may differ from the value before the update.
[0111] It should be noted that the dynamic update of the grouping threshold only affects the subsequent partitioning decisions of the current group, and does not affect historical groups that have already been partitioned. When the control node determines, based on the latest grouping threshold, that the cumulative number of worker nodes that have completed iterations in the current group has reached the grouping threshold, it will partition all the currently accumulated worker nodes into one group and clear the current group to begin the accumulation of the next group. When a new group begins accumulation, the control node will reacquire the network state information of the new group and calculate the corresponding grouping threshold.
[0112] In this embodiment, a dynamic adjustment mechanism allows the grouping threshold to respond in real time to changes in the cluster network status. When communication quality is good, a larger group size is used to reduce the number of groups and the number of inter-group communications; when communication quality is poor, a smaller group size is used to avoid network congestion caused by excessive data volume in a single communication, thus maintaining high training efficiency in different network environments.
[0113] In an exemplary embodiment, after step 310, the method further includes: each worker node of the distributed training system performing the next round of training iterations.
[0114] After the global parameter update for this round of iteration is completed, that is, the parameter server of the main group distributes the updated model parameters to the parameter servers of each group, and the parameter servers within each group synchronize them to each worker node, each worker node in the distributed training system starts the next round of training iteration based on the updated model parameters.
[0115] In this embodiment, a Synchronous Stochastic Gradient Descent (SGD) mode is used. Before entering the next training iteration, all worker nodes must confirm that the global parameter update for the current iteration is complete. For example, after receiving the updated model parameters from the group's parameter server, each worker node reports the parameter update completion status to the control node. Once the control node detects that all worker nodes have completed the parameter update for this iteration, it broadcasts a start command for the next iteration to all worker nodes. In response to this start command, each worker node loads the updated model parameters as the current model parameters, reads the next batch of data slices from the training dataset, and performs forward and backward propagation calculations to generate the local gradient for this iteration. This process is repeated until a preset training iteration or model convergence condition is reached.
[0116] In synchronous SGD mode, since all worker nodes start the next iteration based on the same updated parameters, and each worker node waits for each other during the gradient synchronization phase, the update of global model parameters has strict consistency. There is no gradient staleness or direction conflict caused by inconsistent parameter versions in asynchronous SGD mode. The training process has definite convergence and reproducibility.
[0117] In an exemplary embodiment, after the parameter server of the target group synchronizes gradient data with the parameter server of the main group, the method further includes: the parameter server of the target group updates the model parameters according to the gradient data synchronized by the target group, and synchronizes the updated model parameters to each working node of the target group; after the target group completes parameter synchronization, each working node of the target group performs the next round of training iteration.
[0118] Accordingly, the method further includes: after receiving the updated model parameters distributed by the parameter server of the main group, the parameter server of the target group waits for all working nodes in the group to complete the corresponding round of training iterations before synchronizing the received model parameters to each working node in the group.
[0119] In this embodiment, using the Asynchronous Stochastic Gradient Descent (SGD) mode, each target group can enter the next training iteration without waiting for global parameter updates after synchronizing gradient data with the main group. Specifically, when the parameter server of a target group sends the sum of its intra-group gradients to the parameter server of the main group, that target group is considered to have completed the gradient reporting task for this round. At this time, the worker nodes within that target group do not need to wait for the main group to complete global parameter updates or for other target groups to complete gradient synchronization; they can directly load the next batch of training data based on the currently held model parameters and begin the next round of forward and backward propagation calculations. The iteration progress of different target groups is independent of each other; any target group can start the next iteration as soon as it completes gradient reporting.
[0120] Meanwhile, the parameter server of the main group continuously receives the sum of gradients within each target group, and after completing the global gradient aggregation and parameter update, distributes the updated model parameters to the parameter servers of each target group.
[0121] When the parameter server of a target group receives updated model parameters from the parameter server of the main group, the parameter server of the target group does not immediately synchronize the updated model parameters to all worker nodes within the group. Instead, it first determines whether there are any worker nodes in the group that are currently performing training iterations, i.e., whether any worker nodes are still performing forward or backward propagation calculations based on the old model parameters. If so, the parameter server of the target group temporarily suspends the distribution of the updated model parameters, waiting for all worker nodes in the group to complete the current round of training iterations before synchronizing the updated model parameters to every worker node in the group.
[0122] The mechanism of waiting for all working nodes in a group to complete the current iteration before synchronizing parameters ensures that each working node always calculates based on the same version of model parameters throughout a complete iteration, avoiding numerical instability or training crashes caused by unexpected parameter overwriting during calculation. Although there may be differences in parameter versions between different target groups (i.e., asynchronous between groups), the parameters of each working node within the same group are always updated synchronously at the iteration boundary, ensuring the consistency of calculations within the group.
[0123] Optionally, in asynchronous SGD mode, since the iteration speeds of different target groups may differ, the working nodes of different groups may be in different iteration rounds at the same time, and the versions of model parameters they hold may also be different. This difference in parameter versions may lead to some target groups reporting gradients based on relatively outdated model parameters when the main group performs global gradient summation, i.e., a gradient staleness problem exists. To address this issue, one optional implementation includes a dynamic gradient correction module. This module uses strategies such as differentiated weighted aggregation and gradient direction conflict detection to correct the sum of intra-group gradients reported by each target group, thereby balancing the parameter bias between groups.
[0124] For example, when the parameter server of the main group receives the sum of intra-group gradients reported by each target group, it simultaneously obtains the version information corresponding to that target group. The version information identifies the model parameter version used by the target group when calculating the gradient; it can be the global iteration step count, i.e., the total number of times the global model parameters have been updated when the target group completes gradient calculation. The parameter server of the main group compares the version information of each target group with the current global latest version number and calculates the version step difference. The larger the version step difference, the more outdated the gradient reported by the target group is, and the lower its reliability. The parameter server of the main group assigns a corresponding aggregation weight to each target group based on the version step difference. Specifically, target groups with larger version step differences are assigned smaller aggregation weights, and target groups with smaller version step differences are assigned larger aggregation weights. In an optional implementation, the aggregation weights are determined according to the following principle: target groups with a version step difference of zero are assigned the highest weight; target groups with a version step difference exceeding a preset threshold are assigned zero weight, i.e., their reported gradients are directly discarded to avoid outdated gradients interfering with model updates. The parameter server of the main group performs a weighted summation of the intra-group gradients reported by each target group based on the aggregation weights of each target group, thus obtaining the corrected global gradient. Through the above differentiated weighted aggregation, the influence of outdated gradients on global parameter updates is effectively suppressed, and the stability of model convergence is improved.
[0125] For example, the dynamic gradient correction module includes a gradient direction conflict detection step before differential weighted aggregation. The parameter server of the main group calculates the directional similarity between the sum of intra-group gradients reported by each target group and the currently accumulated global gradient direction. The directional similarity can be measured by calculating the cosine similarity between two gradient vectors. When the cosine similarity between the gradient direction reported by a target group and the current global gradient direction is less than a preset threshold (e.g., less than zero), it is determined that the gradient has a directional conflict. For target group gradients with directional conflicts, the dynamic gradient correction module performs direction correction processing, such as: pruning or attenuating the components in the target group gradient that are opposite to the global gradient direction, retaining only the components with the same direction to participate in subsequent weighted aggregation; or directly discarding target group gradients with severe directional conflicts, which do not participate in this global parameter update. Through the above direction conflict detection and correction, mutual cancellation between gradients of different groups is avoided, ensuring the consistency of the global gradient direction, thereby improving the convergence efficiency of the model in asynchronous training mode.
[0126] For example, since each worker node may be assigned to a different group each time it is grouped, the same worker node may be grouped with different worker nodes in different rounds. Therefore, even during the intra-group gradient synchronization phase, there may be slight differences in the model parameter versions held by each worker node within the same group. This embodiment also applies dynamic gradient correction during intra-group gradient synchronization. Specifically, when performing gradient aggregation within a group, the intra-group parameter server obtains the local version information of each worker node within that group, assigns differentiated aggregation weights to the local gradients uploaded by each worker node based on the version step difference of each worker node, and then performs intra-group gradient summation. Through this mechanism, even if the parameter versions of worker nodes within the same group are not completely consistent due to historical group differences, intra-group gradient synchronization can still be performed effectively, further enhancing the adaptability of this embodiment to dynamic grouping scenarios.
[0127] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0128] Based on the same inventive concept, this application also provides a distributed training system for implementing the distributed training group synchronization method described above. The solution provided by this system is similar to the implementation described in the above method; therefore, the specific limitations in one or more distributed training system embodiments provided below can be found in the limitations of the distributed training group synchronization method described above, and will not be repeated here.
[0129] In one exemplary embodiment, a distributed training system is provided, comprising a control node and multiple worker nodes, wherein the worker nodes are used to perform multiple rounds of training iterations based on allocated data, wherein:
[0130] During the current training iteration, the control node is used to divide the current accumulated number of worker nodes that have completed the training iteration into a group when the cumulative number of worker nodes that have completed the training iteration reaches the grouping threshold, so that the worker nodes in the group can synchronize the gradient within the group.
[0131] The control node is also used to select the working node with the best communication quality parameters in each group as the parameter server for the corresponding group, and to select the group that completes gradient synchronization first in the distributed training system as the main group.
[0132] After the target group completes gradient synchronization, the parameter server of the target group is used to synchronize gradient data with the parameter server of the main group; the target group is any group other than the main group.
[0133] The parameter server of the main group is used to update the model parameters based on the gradient data synchronized by all groups, and to distribute the updated model parameters to the parameter server of each target group.
[0134] Each group's parameter server is used to synchronize the updated model parameters to each worker node within its respective group.
[0135] In the aforementioned distributed training system, during the current iteration, worker nodes are dynamically grouped according to the order in which they complete the training iteration. This allows worker nodes that complete computation earlier to synchronize gradients within their group without waiting for slower nodes, effectively reducing idle time caused by waiting for lagging nodes in traditional synchronous training. This significantly improves the utilization of cluster computing resources and overall training throughput. Within each group, the worker node with the best communication quality is selected as the group's parameter server. Since the size of nodes within a group is controllable, the communication bottleneck of a single central parameter server facing a massive number of worker nodes is avoided, reducing the bandwidth pressure on the central node. Gradients are centrally aggregated by a master group and then uniformly updated by the master group before being distributed to each group, achieving global gradient synchronization and parameter updates. Global communication is decoupled into two levels: intra-group communication and inter-group communication. Each level of parameter server only bears the communication load within its own group, avoiding the problem in traditional parameter server architectures where the central node quickly becomes a performance bottleneck as the cluster size increases. Distributing the communication pressure to multiple sub-groups gives the distributed training system good scalability and the ability to adapt to the training needs of large-scale heterogeneous clusters.
[0136] In one exemplary embodiment, refer to Figure 7 In a distributed training system, multiple worker nodes are involved. Each worker node independently executes training iterations based on its allocated data shards. After completing forward and backward propagation, it reports a completion notification to the control node. The control node, based on a comparison between the cumulative number of worker nodes that have completed training iterations and a grouping threshold, groups the worker nodes that meet the criteria into the same group. Each group contains a preset number of worker nodes (e.g., 3 as shown in the figure). Worker nodes within each group perform intra-group gradient synchronization. Intra-group gradient synchronization can be achieved using a full reduction approach, where worker nodes within the group directly exchange and aggregate their local gradients (Δw) through collective communication, with each worker node receiving the aggregated gradient within the group; or it can use a parameter server approach, where a worker node within the group is selected as the intra-group parameter server, which collects and aggregates the local gradients of other worker nodes within the group.
[0137] After completing intra-group gradient synchronization, each group sends its intra-group gradient sum to the main group's parameter server via its respective intra-group parameter server (labeled PS in the diagram). The main group is the first group in the distributed training system to complete intra-group gradient synchronization. Each target group (i.e., all other groups besides the main group) reports its intra-group gradient sum (labeled ΔW in the diagram) to the main group's parameter server. The main group's parameter server accumulates and averages the reported intra-group gradient sums from all groups to obtain the global average gradient, and updates the global model parameters accordingly.
[0138] After completing the global parameter update, the parameter server of the main group distributes the updated model parameters (labeled W in the diagram) to the parameter servers of each target group (labeled PS in the diagram). Upon receiving the updated model parameters, the parameter server of each target group synchronizes the updated model parameters to every worker node within its group, ensuring that all worker nodes within that group receive consistent updated model parameters for use in the next training iteration.
[0139] In an exemplary embodiment, the control node is further configured to set the grouping threshold based on the network state information of each worker node before dividing the currently accumulated worker nodes that have reached the grouping threshold into a group when the cumulative number of worker nodes that have completed the training iteration is detected to reach the grouping threshold.
[0140] In an exemplary embodiment, the control node is further configured to: accumulate the currently completed training iterations of the working nodes into the current group; determine the bandwidth pressure coefficient based on the average bandwidth utilization of all working nodes in the current group; determine the channel quality coefficient based on the channel quality parameters of each working node in the current group; and set the grouping threshold of the current group based on the bandwidth pressure coefficient and the channel quality coefficient.
[0141] In one exemplary embodiment, after the parameter server of each group synchronizes the updated model parameters to each worker node within its respective group, the worker nodes of the distributed training system perform the next round of training iterations.
[0142] In an exemplary embodiment, the parameter server of the target group is further configured to synchronize gradient data with the parameter server of the main group, update the model parameters according to the gradient data synchronized by the target group, and synchronize the updated model parameters to each working node of the target group.
[0143] After the target group completes parameter synchronization, each working node of the target group is also used for the next round of training iterations;
[0144] Accordingly, after receiving the updated model parameters distributed by the parameter server of the main group, the parameter server of the target group is also used to wait for all working nodes in the group to complete the corresponding round of training iterations before synchronizing the received model parameters to each working node in the group.
[0145] In an exemplary embodiment, each working node within a group is further configured to perform a full reduction communication operation, sending the calculated local gradient to other working nodes within the group, and receiving local gradients sent by other working nodes, in order to obtain the group's aggregated gradient.
[0146] In an exemplary embodiment, each working node within a group is further configured to send its calculated local gradient to the group's parameter server, which then accumulates all received local gradients to obtain the group's aggregated gradient.
[0147] In one exemplary embodiment, a computer device is provided as a control node or worker node in a distributed training system. This computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a distributed training group synchronization method.
[0148] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0149] In one embodiment, a computer device is also provided as a control node or working node in a distributed training system. The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0150] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0151] 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, data stored, data displayed, 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 the relevant data must comply with relevant regulations.
[0152] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0153] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 application.
[0154] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A distributed training group synchronization method, characterized in that, The method is applied to a distributed training system, which includes a control node and multiple worker nodes. The worker nodes are used to perform multiple rounds of training iterations based on allocated data. The method includes: During the current training iteration, when the control node detects that the cumulative number of worker nodes that have completed the training iteration has reached the grouping threshold, it divides the worker nodes that have accumulated to the grouping threshold into a group, so that the worker nodes in the group can synchronize the gradient within the group. The control node uses the working node with the best communication quality parameters in each group as the parameter server for the corresponding group, and uses the group that completes gradient synchronization first in the distributed training system as the main group. After the target group completes gradient synchronization, the parameter server of the target group synchronizes gradient data with the parameter server of the main group; the target group is any group other than the main group. The parameter server of the main group updates the model parameters based on the gradient data synchronized by all groups, and distributes the updated model parameters to the parameter server of each target group. The parameter server for each group will synchronize the updated model parameters to each worker node within its respective group.
2. The method according to claim 1, characterized in that, Before the control node classifies the currently accumulated number of working nodes that have completed training iterations into a group when it detects that the cumulative number of working nodes has reached the grouping threshold, the method further includes: The control node sets the grouping threshold based on the network status information of each working node.
3. The method according to claim 2, characterized in that, The control node sets the grouping threshold based on the network status information of each working node, including: The control node accumulates the currently completed training iterations of the working nodes into the current group; The bandwidth pressure coefficient is determined based on the average bandwidth utilization of all working nodes in the current group; Based on the channel quality parameters of each working node in the current group, determine the channel quality coefficient; Based on the bandwidth pressure coefficient and the channel quality coefficient, set the group threshold for the current group.
4. The method according to claim 1, characterized in that, After the parameter server of each group synchronizes the updated model parameters to each worker node within its respective group, the method further includes: Each worker node of the distributed training system performs the next round of training iterations.
5. The method according to claim 1, characterized in that, After the parameter server of the target group synchronizes gradient data with the parameter server of the main group, the method further includes: The parameter server of the target group updates the model parameters according to the gradient data synchronized by the target group, and synchronizes the updated model parameters to each working node of the target group; After the target group completes parameter synchronization, each working node of the target group performs the next round of training iteration; Accordingly, the method further includes; After receiving the updated model parameters distributed by the parameter server of the main group, the parameter server of the target group waits for all working nodes in the group to complete the corresponding round of training iterations before synchronizing the received model parameters to each working node in the group.
6. The method according to any one of claims 1 to 5, characterized in that, The working nodes within the group perform gradient synchronization within the group, including: Each working node within the group performs a full reduction communication operation, sending the calculated local gradient to other working nodes within the group and receiving local gradients sent by other working nodes, in order to obtain the group's aggregated gradient.
7. The method according to any one of claims 1 to 5, characterized in that, The working nodes within the group perform gradient synchronization within the group, including: Each working node within the group sends its calculated local gradient to the parameter server of the group. The parameter server then accumulates all the received local gradients to obtain the aggregated gradient within the group.
8. A distributed training system, characterized in that, The distributed training system includes a control node and multiple worker nodes. The worker nodes are used to perform multiple rounds of training iterations based on allocated data, wherein: During the current training iteration, the control node is used to divide the current number of working nodes that have accumulated to the grouping threshold into a group when it detects that the cumulative number of working nodes that have completed the training iteration has reached the grouping threshold, so that the working nodes in the group can synchronize the gradient within the group. The control node is also used to designate the working node with the best communication quality parameters in each group as the parameter server for the corresponding group, and to designate the group that completes gradient synchronization first in the distributed training system as the main group. After the target group completes gradient synchronization, the parameter server of the target group is used to synchronize gradient data with the parameter server of the main group; the target group is any group other than the main group. The parameter server of the main group is used to update the model parameters according to the gradient data synchronized by all groups, and to distribute the updated model parameters to the parameter server of each target group. Each group's parameter server is used to synchronize the updated model parameters to each worker node within its respective group.
9. A computer device, serving as a control node or worker node in a distributed training system, the computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
