A communication optimization method, device and equipment for distributed AI training and a medium

By co-training a dual-branch deep decision network and a centralized Critic network, the problem of dynamic adjustment of sparse communication and topology switching in distributed AI training is solved, thereby improving communication efficiency and enhancing model stability.

CN123185098APending Publication Date: 2026-11-27CHONGQING BITMAP INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611329472.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, the fixed-period alternation strategy of sparse and dense communication during distributed AI training cannot be dynamically adjusted according to the network state, resulting in low communication efficiency. In particular, when the gradient distribution differs greatly between the early and late stages of training, it lacks adaptive adjustment capabilities and cannot maintain the optimal gradient compression effect.

Method used

A dual-branch deep decision network is adopted, which extracts representational data through a shared underlying feature extraction network and outputs gradient sparsity adjustment magnitude and communication topology switching decisions respectively. A gated differentiation module and a centralized Critic network are introduced to construct a global quantized reward function and collaboratively train the Actor network of each node to achieve coordinated optimization of sparsity and topology switching.

Benefits of technology

It significantly improves the performance of distributed training communication optimization, avoids gradient conflicts between sparsity adjustment and topology switching, improves the accuracy and stability of the model, and reduces the risks brought about by asynchronous decision-making in multiple nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185098A_ABST
    Figure CN123185098A_ABST
Patent Text Reader

Abstract

The application provides a distributed AI training communication optimization method and device, equipment and medium, belonging to the technical field of distributed communication. Through the double-branch deep decision network based on the same shared bottom feature extraction network, the first branch outputs the adjustment range of the gradient sparsification reservation ratio based on the current network state, the second branch outputs the switching decision of the communication topology structure based on the same network state, and the gating differentiation module is introduced and composed of a learnable dynamic weight network. Therefore, the gradient update range of the two branches can be automatically adjusted according to the current state, the gradient conflict between continuous sparsity adjustment and discrete topology switching is effectively avoided, the two sub-tasks are coordinated and optimized in the shared representation space, the decision mismatch problem caused by the split processing of the compression rate adjustment and the topology switching in the traditional scheme is overcome, and the overall effect of the distributed training communication optimization is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of distributed communication technology, and specifically relates to a communication optimization method, apparatus, device and medium for distributed AI training. Background Technology

[0002] AI training communication optimization methods refer to a series of technical strategies employed during the training of distributed artificial intelligence models to overcome the communication bottlenecks caused by the frequent exchange of gradients, parameters, and other data between computing nodes. These strategies aim to reduce the amount of communication data, accelerate data transmission, or achieve parallel computation and communication. These methods are mainly divided into two levels: algorithm-level and network-level. Algorithm-level optimization focuses on reducing communication overhead at the source, such as through gradient sparsity (transmitting only some important gradients), gradient quantization (representing gradients with low-precision values), or designing more efficient communication topologies and synchronization strategies to reduce the number of communication rounds and the amount of data per communication.

[0003] In existing technologies, a fixed-period alternation strategy of sparse and dense communication is adopted. The alternation period is a preset fixed value and cannot be dynamically adjusted according to changes in current network bandwidth utilization, link latency, and model training accuracy. When network conditions fluctuate, this fixed switching strategy cannot respond in a timely manner, resulting in low communication efficiency.

[0004] It lacks adaptive adjustment capabilities when the gradient distribution differs significantly between the early and late stages of training, and cannot maintain optimal gradient compression performance at different training stages. Summary of the Invention

[0005] In view of the above problems, this application proposes a communication optimization method, apparatus, device, and medium for distributed AI training. It overcomes the decision mismatch problem caused by the traditional approach of handling compression rate adjustment and topology switching separately, effectively avoids gradient conflicts between continuous sparsity rate adjustment and discrete topology switching, and enables coordinated optimization of the two sub-tasks in a shared representation space, significantly improving the overall effect of distributed training communication optimization.

[0006] One embodiment of this application provides a communication optimization method for distributed AI training, including:

[0007] Multidimensional environmental information is collected at each distributed node of the distributed deep neural network. The current observation vector and historical observation vector in the multidimensional environmental information are smoothed to obtain a stable state vector. The stable state vector is used as the input feature of a two-branch deep decision network. The stable state vector is encoded by a shared low-level feature extraction network to extract the representation data related to communication optimization. The representation data is fed into the two-branch deep decision networks. The two-branch deep decision networks output the determined value of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, respectively. Based on the determined value of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, the input interface of the local Actor network and the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node are defined. A global quantization reward function is constructed to train the cloud-based Critic network and the node Actor networks collaboratively, outputting the weight parameter results of the local Actor networks of all nodes and the weight results of the cloud-based Critic value evaluation model. Based on the network parameter results and evaluation model weight results of all nodes, the same type of new topology is determined to be switched. The coordinator broadcasts the switching intention and freezes the gradient transmission, and the coordinator uniformly issues the switching command. Each node synchronously rebuilds the communication connection and submits the protocol for switching.

[0008] Furthermore, the acquisition of multi-dimensional environmental information at each distributed node of the distributed deep neural network includes:

[0009] In a distributed deep neural network training scenario, after each distributed node completes the forward propagation and gradient calculation of the deep neural network model in the current round, it collects the model training accuracy, gradient communication time, and available bandwidth and latency status of the inter-node communication link for the current round.

[0010] Multidimensional environmental information is generated based on the training accuracy, gradient communication time, and available bandwidth and latency status of inter-node communication links.

[0011] Furthermore, the step of smoothing the current observation vector and historical observation vector in the multidimensional environmental information to obtain a stable state vector includes:

[0012] Obtain the round number of the current observation vector, and perform exponential moving average smoothing on the multidimensional environmental information based on the round number of the current observation vector and the smoothing factor;

[0013] The smoothed multidimensional environmental information is normalized in each dimension to generate a stable state vector that includes the input state's awareness of switching costs.

[0014] Furthermore, the process of encoding the stable state vector using a shared low-level feature extraction network to extract representational data related to communication optimization includes:

[0015] Based on the shared underlying feature extraction network, the model training accuracy, gradient communication time, and available bandwidth and delay status of the inter-node communication link in the current round of each node are encoded to obtain a state vector encoding sequence.

[0016] Characteristic data associated with inter-node communication links are extracted from the state vector encoding sequence.

[0017] Furthermore, the step of using two branch deep decision networks to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology, respectively, includes:

[0018] The first branch deep decision network outputs a determined value for the adjustment range of the gradient sparsity retention ratio based on the current network state;

[0019] The second branch deep decision network outputs switching decisions for the communication topology based on the same network state.

[0020] Furthermore, the step of using two branch deep decision networks to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology, respectively, includes:

[0021] The two branches are connected to the gated differentiation module, which includes a dynamic weight network;

[0022] The gradient update magnitude of the two branches is automatically adjusted based on the current state.

[0023] For the first branch, a deterministic gradient update method is adopted to output a deterministic value of the sparsity adjustment range. The deterministic value of the sparsity adjustment range is superimposed on the current sparsity during subsequent execution to form a new sparsity retention ratio.

[0024] For the second branch, the Gumbel-Softmax reparameterization technique is used to relax the discrete topology selection process into a continuously differentiable sampling process, so that this branch is trained end-to-end through gradient descent and outputs the probability distribution of each candidate topology type in the current state. The node makes a topology switching decision based on this distribution.

[0025] Furthermore, the definition of the input interface for the local Actor network based on the determination of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, as well as the definition of the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node, include:

[0026] Deploy a centralized Critic network in the cloud or on a parameter server to acquire global state splicing information of all nodes, as well as joint actions and global reward signals of all nodes during the training phase.

[0027] During training, the centralized Critic evaluates the value of the current joint decision based on global information and transmits gradient information to the Actor network of each node for parameter updates.

[0028] Furthermore, the definition of the input interface for the local Actor network, based on the determination of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, as well as the definition of the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node, also includes:

[0029] A local Actor network is incorporated into the jointly trained image recognition model, while a centralized Critic network is deployed in the cloud.

[0030] The Actor network input interface quantization specification stipulates that the stable state vector of the network after single-node smoothing adopts a 32-bit floating-point array format and a fixed 18-dimensional feature dimension. It is sent to the local Actor to complete forward inference based on the gRPC lightweight communication protocol.

[0031] The cloud-based centralized Critic network interacts with the training interface of the Actor network at each node. Each node is trained to generate an 18-dimensional local state, a 1-dimensional sparse adjustment magnitude, and a 3-dimensional topology selection probability as a floating-point array of length 22 and upload it to the cloud.

[0032] The 10 sets of node data are vertically spliced ​​to obtain a 180-dimensional global state. The global gradient output by the cloud-centralized Critic network adopts a fixed 512-byte segmented communication format and is uniformly distributed to all node Actors every one iteration cycle to complete the synchronous update of network parameters.

[0033] Furthermore, a global quantized reward function is constructed, and the cloud-based Critic network and node Actor networks are trained collaboratively. The output includes the weight parameters of all node-local Actor networks and the weight results of the cloud-based Critic value evaluation model, including:

[0034] After each round of distributed training iteration, gradient sparsity statistics, model validation accuracy data, and topology switching log data are collected synchronously.

[0035] The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data.

[0036] Furthermore, a global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data, including:

[0037] The gradient sparsity statistics correspond to the communication time benefit, and the global communication benefit is determined based on the gradient sparsity retention ratio, bandwidth utilization and weight hyperparameters of the node.

[0038] The model validation accuracy data corresponds to the model penalty accuracy, and the model penalty accuracy is determined based on the model accuracy of the model validation set, the accuracy of the previous round, the accuracy decrease threshold, and the accuracy penalty hyperparameter.

[0039] The topology switching log statistics correspond to the topology switching penalty, which is determined based on the basic switching cost, exponential growth coefficient, cumulative number of topology switching within the iteration window, and transient loss coefficient.

[0040] The global reward signal is determined based on the benefits of communication time consumption, model penalty accuracy, and topology switching penalty.

[0041] Furthermore, the method also includes: cloud-based Critic network value loss quantification update;

[0042] The global reward is calculated based on the global state concatenation vector, the coefficient adjustment magnitude of all nodes, and the node topology probability distribution.

[0043] The estimated value of the current joint action is obtained through forward reasoning using the Critic network based on the global state.

[0044] A temporal difference loss function is constructed to update network parameters, and the gradient loss of the Critic network is determined by controlling the weight of the historical iteration reward and the reward decay coefficient.

[0045] Furthermore, the method also includes: after calculating the Critic loss in the cloud, solving the global policy gradient in reverse;

[0046] Based on the centralized training distributed execution architecture, and following the agreed 512-byte segmented communication format, a unified gradient is sent to all nodes every one iteration.

[0047] Each node's local lightweight Actor network receives gradients and updates its own dual-branch decision network parameters, so that all nodes' sparsity adjustment and topology selection actions converge synchronously in the direction of maximizing global reward.

[0048] Set a training termination quantization threshold: if the global reward fluctuation amplitude is less than the set minimum value for a number of consecutive periods, the collaborative strategy is considered to have converged.

[0049] After the convergence condition is met, the results of the local Actor network weight parameters of all nodes and the weight results of the cloud-based Critic value assessment model are exported.

[0050] Furthermore, the process of determining the same type of new topology to switch to based on the network parameter results and evaluation model weight results of all nodes, employing a coordinator broadcasting the switching intention and freezing gradient transmission, and a coordinator uniformly issuing switching instructions, with each node synchronously rebuilding communication connections and submitting the protocol for switching, includes:

[0051] Introducing a coordinator arbitration mechanism: When more than two-thirds of the nodes propose to switch to the same new topology, the switching process is triggered; otherwise, the current topology is maintained.

[0052] The switching process employs a two-phase commit protocol.

[0053] The first phase consists of: the coordinator broadcasting the intention to switch and freezing gradient transmission; all nodes replying with ACK after confirming that the current gradient to be aggregated has been safely written to disk.

[0054] The second phase is as follows: the coordinator issues a unified switching command, and each node synchronously rebuilds the communication connection. During the communication connection rebuilding period, a forced cooling window is set, during which the switching action output by the decision network is masked.

[0055] Based on the same inventive concept, a second aspect of the embodiments of this application also provides a communication optimization device for distributed AI training, comprising:

[0056] The state vector unit is used to collect multi-dimensional environmental information at each distributed node of the distributed deep neural network, and to smooth the current observation vector and historical observation vector in the multi-dimensional environmental information to obtain a stable state vector.

[0057] The encoding representation unit is used to take the stable state vector as the input feature of the two-branch deep decision network, encode the stable state vector through a shared low-level feature extraction network, extract the representation data related to communication optimization, and feed the representation data to the two-branch deep decision network.

[0058] A dual-branch network unit is used to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology through two branch deep decision networks, respectively.

[0059] The interface definition unit is used to define the input interface of the local Actor network based on the determined value of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, as well as the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node.

[0060] The model training unit is used to construct a global quantized reward function, to train the cloud Critic network and the node Actor network in a collaborative manner, and to output the weight parameter results of the local Actor network of all nodes and the weight results of the cloud Critic value evaluation model.

[0061] The topology switching unit is used to determine the new topology to switch to based on the network parameter results and evaluation model weight results of all nodes. It adopts the method of coordinator broadcasting the switching intention and freezing gradient transmission, and coordinator issuing a unified switching command. Each node synchronously rebuilds the communication connection and submits the protocol to perform the switching.

[0062] Furthermore, the state vector unit is also used in distributed deep neural network training scenarios to collect the model training accuracy, gradient communication time, and available bandwidth and latency status of the inter-node communication link for each node after each distributed node completes the forward propagation and gradient calculation of the deep neural network model in the current round.

[0063] Multidimensional environmental information is generated based on the training accuracy, gradient communication time, and available bandwidth and latency status of inter-node communication links.

[0064] Furthermore, the state vector unit is also used to obtain the round of the current observation vector, and to perform exponential moving average smoothing on the multidimensional environmental information based on the round of the current observation vector and the smoothing factor.

[0065] The smoothed multidimensional environmental information is normalized in each dimension to generate a stable state vector that includes the input state's awareness of switching costs.

[0066] Furthermore, the encoding representation unit is also used to encode the model training accuracy, gradient communication time, and available bandwidth and delay status of the inter-node communication link for each node in the current round based on the shared underlying feature extraction network to obtain a state vector encoding sequence.

[0067] Characteristic data associated with inter-node communication links are extracted from the state vector encoding sequence.

[0068] Furthermore, the dual-branch network unit is also used to determine the adjustment range of the gradient sparsification retention ratio based on the current network state output by the first branch deep decision network.

[0069] The second branch deep decision network outputs switching decisions for the communication topology based on the same network state.

[0070] Furthermore, the two branches in the dual-branch network unit are respectively connected to the gated differentiation module, including: a dynamic weight network;

[0071] The gradient update magnitude of the two branches is automatically adjusted based on the current state.

[0072] For the first branch, a deterministic gradient update method is adopted to output a deterministic value of the sparsity adjustment range. The deterministic value of the sparsity adjustment range is superimposed on the current sparsity during subsequent execution to form a new sparsity retention ratio.

[0073] For the second branch, the Gumbel-Softmax reparameterization technique is used to relax the discrete topology selection process into a continuously differentiable sampling process, so that this branch is trained end-to-end through gradient descent and outputs the probability distribution of each candidate topology type in the current state. The node makes a topology switching decision based on this distribution.

[0074] Furthermore, the interface definition unit is also used to deploy a centralized Critic network in the cloud or on the parameter server, to obtain the global state splicing information of all nodes, as well as the joint actions and global reward signals of all nodes during the training phase.

[0075] During training, the centralized Critic evaluates the value of the current joint decision based on global information and transmits gradient information to the Actor network of each node for parameter updates.

[0076] Furthermore, the interface definition unit is also used to mount a local Actor network in a jointly trained image recognition model and deploy a centralized Critic network in the cloud.

[0077] The Actor network input interface quantization specification stipulates that the stable state vector of the network after single-node smoothing adopts a 32-bit floating-point array format and a fixed 18-dimensional feature dimension. It is sent to the local Actor to complete forward inference based on the gRPC lightweight communication protocol.

[0078] The cloud-based centralized Critic network interacts with the training interface of the Actor network at each node. Each node is trained to generate an 18-dimensional local state, a 1-dimensional sparse adjustment magnitude, and a 3-dimensional topology selection probability as a floating-point array of length 22 and upload it to the cloud.

[0079] The 10 sets of node data are vertically spliced ​​to obtain a 180-dimensional global state. The global gradient output by the cloud-centralized Critic network adopts a fixed 512-byte segmented communication format and is uniformly distributed to all node Actors every one iteration cycle to complete the synchronous update of network parameters.

[0080] Furthermore, the model training unit is also used to synchronously collect gradient sparsity statistics, model validation accuracy data, and topology switching log data after each round of distributed training iteration.

[0081] The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data.

[0082] Furthermore, a global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data, including:

[0083] The gradient sparsity statistics correspond to the communication time benefit, and the global communication benefit is determined based on the gradient sparsity retention ratio, bandwidth utilization and weight hyperparameters of the node.

[0084] The model validation accuracy data corresponds to the model penalty accuracy, and the model penalty accuracy is determined based on the model accuracy of the model validation set, the accuracy of the previous round, the accuracy decrease threshold, and the accuracy penalty hyperparameter.

[0085] The topology switching log statistics correspond to the topology switching penalty, which is determined based on the basic switching cost, exponential growth coefficient, cumulative number of topology switching within the iteration window, and transient loss coefficient.

[0086] The global reward signal is determined based on the benefits of communication time consumption, model penalty accuracy, and topology switching penalty.

[0087] Furthermore, the model training unit is also used for updating the value loss quantization of the Critic network in the cloud;

[0088] The global reward is calculated based on the global state concatenation vector, the coefficient adjustment magnitude of all nodes, and the node topology probability distribution.

[0089] The estimated value of the current joint action is obtained through forward reasoning using the Critic network based on the global state.

[0090] A temporal difference loss function is constructed to update network parameters, and the gradient loss of the Critic network is determined by controlling the weight of the historical iteration reward and the reward decay coefficient.

[0091] Furthermore, the model training unit is also used to calculate the global policy gradient in reverse after the Critic loss is calculated in the cloud.

[0092] Based on the centralized training distributed execution architecture, and following the agreed 512-byte segmented communication format, a unified gradient is sent to all nodes every one iteration.

[0093] Each node's local lightweight Actor network receives gradients and updates its own dual-branch decision network parameters, ensuring that all nodes' sparsity adjustments and topology selection actions are synchronized towards maximizing the global reward. The direction converges;

[0094] Set a training termination quantization threshold: if the global reward fluctuation amplitude is less than the set minimum value for a number of consecutive periods, the collaborative strategy is considered to have converged.

[0095] After the convergence condition is met, the results of the local Actor network weight parameters of all nodes and the weight results of the cloud-based Critic value assessment model are exported.

[0096] Furthermore, the topology switching unit is also used to introduce a coordinator arbitration mechanism: when more than two-thirds of the nodes propose to switch to the same new topology, the switching process is triggered; otherwise, the current topology is maintained.

[0097] The switching process employs a two-phase commit protocol.

[0098] The first phase consists of: the coordinator broadcasting the intention to switch and freezing gradient transmission; all nodes replying with ACK after confirming that the current gradient to be aggregated has been safely written to disk.

[0099] The second phase is as follows: the coordinator issues a unified switching command, and each node synchronously rebuilds the communication connection. During the communication connection rebuilding period, a forced cooling window is set, during which the switching action output by the decision network is masked.

[0100] Based on the same inventive concept, a third aspect of the present application also provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0101] Memory, which stores computer programs;

[0102] A communication optimization method for distributed AI training when the processor executes a program stored in memory.

[0103] Based on the same inventive concept, a fourth aspect of the present application also provides a computer-readable storage medium, characterized in that it stores a computer program, which, when executed by a processor, implements a communication optimization method for distributed AI training.

[0104] The beneficial effects of this application are as follows: Based on the above technical solution, a dual-branch deep decision network is used on the same shared underlying feature extraction network. The first branch outputs the adjustment range of the gradient sparsity retention ratio based on the current network state, and the second branch outputs the switching decision of the communication topology based on the same network state. A gated differentiation module composed of a learnable dynamic weight network is introduced. It can be seen that the gradient update range of the two branches can be automatically adjusted according to the current state, which effectively avoids the gradient conflict between continuous sparsity adjustment and discrete topology switching. This enables the two sub-tasks to achieve coordinated optimization in the shared representation space, overcomes the decision mismatch problem caused by the traditional scheme of handling compression ratio adjustment and topology switching separately, and significantly improves the overall effect of distributed training communication optimization.

[0105] By deploying a centralized Critic network in the cloud, the global state concatenation vector of all nodes, as well as the joint action and global reward signal of all nodes, are obtained during the training phase to evaluate the global synergy effect. The gradient information is then passed to the lightweight Actor network of each node for parameter updates, enabling each node's local policy to implicitly learn to cooperate with other nodes during the training process. This fundamentally reduces the risks of topology switching conflicts and sparsity inconsistencies caused by asynchronous decision-making among multiple nodes.

[0106] By constructing a global quantified reward function that includes three indicators: communication benefit, model accuracy penalty, and topology switching penalty, the communication benefit is calculated based on the gradient sparsity retention ratio and bandwidth utilization. The accuracy penalty is triggered only when the verification accuracy decreases and amplifies the negative penalty. The switching penalty uses an exponential nonlinear function to penalize the cumulative number of switching within a continuous iteration window. These three constraints jointly guide the decision network to learn a coordinated strategy that takes into account communication speed, model convergence effect, and topology stability. This effectively prevents each node from simply increasing the gradient sparsity, which could lead to model accuracy degradation or frequent topology switching requests that could cause system jitter, thus improving the accuracy and stability of the model.

[0107] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures pointed out in the description and the accompanying drawings. Attached Figure Description

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

[0109] Figure 1 A flowchart of a communication optimization method for distributed AI training is shown;

[0110] Figure 2 A schematic diagram of a communication optimization device for distributed AI training is shown.

[0111] Figure 3 A schematic diagram of the distributed communication optimization process based on gradient sparsity and dynamic communication topology is shown.

[0112] Figure 4 The diagram shows a dual-branch deep decision network architecture according to an embodiment of this application.

[0113] Figure 5 This application illustrates a cloud-based centralized model training diagram according to an embodiment of the present application.

[0114] Figure 6 This illustration shows a distributed autonomous decision-making process during inference in an embodiment of this application.

[0115] Figure 7 A schematic diagram of an electronic device to which the method of an embodiment of this application is applied is shown. Detailed Implementation

[0116] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0117] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. In this application, the terms "upper," "lower," "left," "right," "front," "rear," "top," "bottom," "inner," "outer," "middle," "vertical," "horizontal," "lateral," "longitudinal," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings.

[0118] One embodiment of this application provides a communication optimization method for distributed AI training, see [link to relevant documentation]. Figure 1 ,include:

[0119] S101: Collect multi-dimensional environmental information at each distributed node of the distributed deep neural network, and smooth the current observation vector and historical observation vector in the multi-dimensional environmental information to obtain a stable state vector.

[0120] S102: The stable state vector is used as the input feature of the dual-branch deep decision network. The stable state vector is encoded by the shared low-level feature extraction network to extract the representation data related to communication optimization. The representation data is then fed into the two-branch deep decision networks.

[0121] S103: Two branch deep decision networks are used to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology, respectively.

[0122] S104: Based on the determination of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, the input interface definition of the local Actor network and the training interaction interface definition between the cloud-based centralized Critic network and the Actor networks of each node are defined.

[0123] S105: Construct a global quantitative reward function, train the cloud-based Critic network and the node Actor network in a collaborative manner, and output the weight parameter results of the local Actor network of all nodes and the weight results of the cloud-based Critic value evaluation model.

[0124] S106: Based on the network parameter results and evaluation model weight results of all nodes, determine the same type of new topology to switch to. The coordinator broadcasts the switching intention and freezes gradient transmission. The coordinator issues a unified switching instruction. Each node synchronously rebuilds the communication connection and submits the protocol to switch.

[0125] The communication optimization method for distributed AI training in the embodiments of this specification is typically applied in a server, which can be a cloud server or a local server. The server can be an electronic device such as a laptop, desktop computer, tablet computer, or all-in-one computer.

[0126] Specifically, see Figure 4 This application constructs a dual-branch deep decision network. The first branch outputs the adjustment range of the gradient sparsity retention ratio based on the current network state, while the second branch outputs the communication topology switching decision based on the same network state. This enables end-to-end collaborative optimization of sparsity adjustment and topology switching within the same decision framework, overcoming the dual limitations of fixed sparsity and fixed topology in existing schemes. This scheme introduces a gated differentiation module composed of a learnable dynamic weight network, which automatically adjusts the gradient update range of the two branches according to the current state. This effectively avoids gradient conflicts between continuous sparsity adjustment and discrete topology switching, ensuring coordinated optimization of the two subtasks in a shared representation space.

[0127] In the distributed deep neural network training scenario addressed by this solution, after each distributed node completes the forward propagation and gradient calculation of the deep neural network model in the current round, each node collects the model training accuracy, gradient communication time, and available bandwidth and latency status of the communication link between nodes in the current round, and summarizes the above information to form the network state observation vector for this round. At the same time, each node records the gradient sparsity retention ratio and the current communication topology type.

[0128] Each distributed node inputs the obtained network state observation vector into a pre-deployed dual-branch deep decision network on each node. The first branch of this network outputs the adjustment range of the gradient sparsity retention ratio based on the current network state.

[0129] The second branch of the network outputs a switching decision for the communication topology based on the same network state.

[0130] The communication topology includes fully connected topology, hierarchical aggregation topology, and ring topology. The two branches share the underlying feature extraction network, and collaborative decision-making on compression ratio adjustment and topology switching is achieved through joint training.

[0131] Specifically, in step S101, the step of collecting multi-dimensional environmental information at each distributed node of the distributed deep neural network includes:

[0132] In a distributed deep neural network training scenario, after each distributed node completes the forward propagation and gradient calculation of the deep neural network model in the current round, it collects the model training accuracy, gradient communication time, and available bandwidth and latency status of the inter-node communication link for the current round.

[0133] Multidimensional environmental information is generated based on the training accuracy, gradient communication time, and available bandwidth and latency status of inter-node communication links.

[0134] In step S101, the smoothing process of the current observation vector and historical observation vector in the multidimensional environmental information to obtain a stable state vector includes:

[0135] Obtain the round number of the current observation vector, and perform exponential moving average smoothing on the multidimensional environmental information based on the round number of the current observation vector and the smoothing factor;

[0136] The smoothed multidimensional environmental information is normalized in each dimension to generate a stable state vector that includes the input state's awareness of switching costs.

[0137] Specifically, see Figure 3 and Figure 4 In the distributed deep neural network training scenario addressed by this solution, each distributed node, after completing forward propagation and gradient calculation in each iteration, needs to collect multi-dimensional environmental information for the current iteration as a basis for decision-making. The basic information collected by each node includes model training accuracy, gradient communication time, available bandwidth and latency status of inter-node communication links, as well as the currently used gradient sparsity retention ratio and the current communication topology type. In addition, each node also needs to collect topology switching transient overhead characteristics, mainly including historical switching frequency, average connection reconstruction time, and traffic load distribution under the current topology.

[0138] To avoid decision-making oscillations caused by network transients, each node smooths its current observation by performing an exponential moving average with historical observations from several previous rounds. Let the current round be denoted as . Smoothing factor is Smoothed stable state vector The recursive formula is:

[0139]

[0140] in, This is the original observation vector after concatenation in this round. After smoothing, each dimension is normalized to ensure that all features are on a uniform scale, forming a stable input state that includes awareness of switching costs.

[0141] Specifically, in step S102, encoding the stable state vector through a shared low-level feature extraction network to extract representational data related to communication optimization includes:

[0142] Based on the shared underlying feature extraction network, the model training accuracy, gradient communication time, and available bandwidth and delay status of the inter-node communication link in the current round of each node are encoded to obtain a state vector encoding sequence.

[0143] Characteristic data associated with inter-node communication links are extracted from the state vector encoding sequence.

[0144] Specifically, see Figure 3 and Figure 4 Complete the stable state vector After data collection, each node uses it as input features for a two-branch deep decision network. This network contains two functionally distinct output branches. The first branch adjusts the gradient sparsity retention ratio based on the current network state, while the second branch outputs a communication topology switching decision based on the same network state. The network first extracts network features by sharing underlying features. Encode the data, extract the characterization data related to communication optimization, and then feed the characterization data to both branch networks simultaneously.

[0145] Based on the same shared underlying feature extraction network, the compression ratio adjustment and topology switching are achieved by setting the adjustment range of the gradient sparsity retention ratio output by the first branch based on the network state, and the switching decision of the communication topology output by the second branch based on the same network state.

[0146] Specifically, in step S103, the determination of the output gradient sparsity adjustment magnitude and the switching decision of the communication topology through two branch deep decision networks respectively include:

[0147] The first branch deep decision network outputs a determined value for the adjustment range of the gradient sparsity retention ratio based on the current network state.

[0148] The second branch deep decision network outputs switching decisions for the communication topology based on the same network state.

[0149] The two branches are connected to the gated differentiation module, which includes a dynamic weight network;

[0150] The gradient update magnitude of the two branches is automatically adjusted based on the current state.

[0151] For the first branch, a deterministic gradient update method is adopted to output a deterministic value of the sparsity adjustment range. The deterministic value of the sparsity adjustment range is superimposed on the current sparsity during subsequent execution to form a new sparsity retention ratio.

[0152] For the second branch, the Gumbel-Softmax reparameterization technique is employed to relax the discrete topology selection process into a continuously differentiable sampling process. This allows the branch to be trained end-to-end via gradient descent, outputting the probability distribution of each candidate topology type in the current state. Nodes then make topology switching decisions based on this distribution. The gradient update magnitudes of both branches are automatically adjusted according to the current state to avoid gradient conflicts between continuous sparsity adjustment and discrete topology switching, ensuring coordinated optimization of the two subtasks in a shared representation space.

[0153] Specifically, see Figure 3 and Figure 4 The two branches are connected to the gated differentiation module, which consists of a learnable dynamic weight network. It can automatically adjust the gradient update magnitude of the two branches according to the current state, avoiding gradient conflicts between continuous sparsity adjustment and discrete topology switching, thereby ensuring coordinated optimization of the two subtasks in the shared representation space.

[0154] For the first branch, a deterministic gradient update method is adopted, which directly outputs a deterministic value of the sparsity adjustment range. This value is added to the current sparsity in subsequent executions to form a new sparsity retention ratio.

[0155] For the second branch, the Gumbel-Softmax reparameterization technique is employed to relax the discrete topology selection process into a continuously differentiable sampling process, enabling end-to-end training via gradient descent. The output of this branch is the current state. The probability distribution of each candidate topology type is used to inform node topology switching decisions.

[0156] The above processing only solves the action output problem of a single node, but relying entirely on independent decisions by each node will still lead to global inconsistency. Therefore, centralized training and distributed execution are introduced.

[0157] Specifically, in step S104, the determination of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, the definition of the input interface of the local Actor network, and the definition of the training interaction interface between the cloud-based centralized Critic network and each node Actor network include:

[0158] Deploy a centralized Critic network in the cloud or on a parameter server to acquire global state splicing information of all nodes, as well as joint actions and global reward signals of all nodes during the training phase.

[0159] During training, the centralized Critic evaluates the value of the current joint decision based on global information and transmits gradient information to the Actor network of each node for parameter updates.

[0160] Furthermore, the definition of the input interface for the local Actor network, based on the determination of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, as well as the definition of the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node, also includes:

[0161] A local Actor network is incorporated into the jointly trained image recognition model, while a centralized Critic network is deployed in the cloud.

[0162] The Actor network input interface quantization specification stipulates that the stable state vector of the network after single-node smoothing adopts a 32-bit floating-point array format and a fixed 18-dimensional feature dimension. It is sent to the local Actor to complete forward inference based on the gRPC lightweight communication protocol.

[0163] The cloud-based centralized Critic network interacts with the training interface of the Actor network at each node. Each node is trained to generate an 18-dimensional local state, a 1-dimensional sparse adjustment magnitude, and a 3-dimensional topology selection probability as a floating-point array of length 22 and upload it to the cloud.

[0164] The 10 sets of node data are vertically spliced ​​to obtain a 180-dimensional global state. The global gradient output by the cloud-centralized Critic network adopts a fixed 512-byte segmented communication format and is uniformly distributed to all node Actors every one iteration cycle to complete the synchronous update of network parameters.

[0165] Specifically, see Figure 3 and Figure 6 A centralized Critic network can be deployed in the cloud or on a parameter server. During the training phase, this network can acquire the global state splicing of all nodes, as well as the joint actions and global reward signals of all nodes, thereby enabling it to evaluate the global synergistic effect.

[0166] Global state concatenation information:

[0167]

[0168] Each distributed node only needs to deploy a lightweight Actor network for forward inference during the execution phase.

[0169] During training, the centralized Critic uses global information To conditionally evaluate the value of the current joint decision, gradient information is transmitted to the Actor network of each node for parameter updates, enabling each node's local policy to implicitly learn to cooperate with other nodes during training, thereby fundamentally avoiding the risks of topology switching conflicts and sparsity inconsistencies caused by asynchronous decision-making among multiple nodes.

[0170] Step 2 outputs: the input interface definition of the local Actor network of each node, and the training interaction interface between the centralized Critic network in the cloud and the Actor networks of each node.

[0171] In this embodiment, 10 existing training nodes are used to jointly train the image recognition model. Each node is equipped with a local Actor network, and a centralized Critic network is deployed in the cloud. The Actor input interface output in step two quantizes and defines the smoothed network state vector of a single node. The forward inference is performed by sending data to the local Actor using a 32-bit floating-point array format, a fixed 18-dimensional feature dimension, and a lightweight gRPC communication protocol. The training interaction interface between the centralized Critic network in the cloud and the Actor networks of each node is clearly defined. In each round of training, each node needs to package its 18-dimensional local state, 1-dimensional sparse adjustment magnitude, and 3-dimensional topology selection probability into a 22-dimensional floating-point array and upload it to the cloud. The cloud then vertically concatenates the 10 sets of node data to obtain a 180-dimensional global state. Meanwhile, it is stipulated that the global gradient output by the cloud Critic adopts a fixed 512-byte segmented communication format and is uniformly distributed to all Actor nodes every one iteration round to complete the synchronous update of network parameters. The two types of interfaces fully quantify and define the data interaction specifications between local inference input and cloud collaborative training.

[0172] Specifically, in step S105, a global quantization reward function is constructed, and the cloud-based Critic network and the node Actor network are trained collaboratively. The results of the weight parameters of all node-local Actor networks and the weight results of the cloud-based Critic value evaluation model are output, including:

[0173] After each round of distributed training iteration, gradient sparsity statistics, model validation accuracy data, and topology switching log data are collected synchronously.

[0174] The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data.

[0175] The determination of the global reward signal based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data includes:

[0176] The gradient sparsity statistics correspond to the communication time benefit, and the global communication benefit is determined based on the gradient sparsity retention ratio, bandwidth utilization and weight hyperparameters of the node.

[0177] The model validation accuracy data corresponds to the model penalty accuracy, and the model penalty accuracy is determined based on the model accuracy of the model validation set, the accuracy of the previous round, the accuracy decrease threshold, and the accuracy penalty hyperparameter.

[0178] The topology switching log statistics correspond to the topology switching penalty, which is determined based on the basic switching cost, exponential growth coefficient, cumulative number of topology switching within the iteration window, and transient loss coefficient.

[0179] The global reward signal is determined based on the benefits of communication time consumption, model penalty accuracy, and topology switching penalty.

[0180] The method also includes: cloud-based Critic network value loss quantification update;

[0181] The global reward is calculated based on the global state concatenation vector, the coefficient adjustment magnitude of all nodes, and the node topology probability distribution.

[0182] The estimated value of the current joint action is obtained through forward reasoning using the Critic network based on the global state.

[0183] A temporal difference loss function is constructed to update network parameters, and the gradient loss of the Critic network is determined by controlling the weight of the historical iteration reward and the reward decay coefficient.

[0184] Furthermore, the method also includes: after calculating the Critic loss in the cloud, solving the global policy gradient in reverse;

[0185] Based on the centralized training distributed execution architecture, and following the agreed 512-byte segmented communication format, a unified gradient is sent to all nodes every one iteration.

[0186] Each node's local lightweight Actor network receives gradients and updates its own bi-branch decision network parameters, so that all nodes' sparsity adjustment and topology selection actions converge synchronously in the direction of maximizing global reward.

[0187] Set a training termination quantization threshold: if the global reward fluctuation amplitude is less than the set minimum value for a number of consecutive periods, the collaborative strategy is considered to have converged.

[0188] After the convergence condition is met, the results of the local Actor network weight parameters of all nodes and the weight results of the cloud-based Critic value assessment model are exported.

[0189] Specifically, see Figure 5 and Figure 6 After each round of distributed training iteration, the cloud synchronously collects three types of data: gradient sparsity statistics, model validation accuracy, and topology switching logs, for use in calculating the sub-items of rewards.

[0190] The benefit of communication time consumption corresponding to gradient sparse statistics: Let the total number of nodes be... ,node No. The gradient sparsity retention ratio of the round is Bandwidth utilization Weight hyperparameter Used to adjust the proportion of communication revenue, defining the communication revenue of a single node, and taking the average of all nodes for the global communication revenue:

[0191]

[0192] Gradient retention ratio The smaller the value, the more gradient clipping compression occurs. The larger the value, the higher the bandwidth utilization, and the more significant the speedup benefit from compression. Multiplying these two factors amplifies the positive benefits of communication optimization. For manually adjustable hyperparameters, a uniformly defined value range is provided. Parameters can be adjusted according to the cluster bandwidth scale.

[0193] Model validation accuracy statistics and corresponding model accuracy penalty :set up For the first The accuracy of the model on the validation set. The accuracy rate from the previous round, and the precision decrease threshold. Precision penalty hyperparameter A penalty is only incurred when the accuracy of the current round is lower than that of the previous round; otherwise, the penalty is zero.

[0194]

[0195] By amplifying the negative penalty for accuracy loss, we can prevent each node from excessively increasing gradient sparsity and over-reducing gradients, which would disrupt model convergence.

[0196] Topology switch log statistics correspond to topology switch penalties Set the base cost for switching. Exponential growth coefficient Record the cumulative number of topology switches within a continuous iteration window. Transient loss coefficient Switch the penalty to an exponential nonlinear function:

[0197]

[0198] Switching times The larger the value, the exponentially higher the penalty. This represents the fixed additional loss caused by connection reconstruction and gradient synchronization jitter after topology switching. The dual constraint avoids nodes frequently initiating topology switching requests.

[0199] The cloud integrates three sub-indicators to calculate the overall reward signal for this round:

[0200]

[0201] Sparse compression improves communication efficiency and increases the total reward; model precision loss and frequent topology switching reduce the total reward. This guides the network to learn a collaborative strategy that balances communication speed, model performance, and topology stability.

[0202] The cloud-based Critic network value loss quantification and update process is as follows:

[0203] 1) Cloud input: The global state concatenation vector output from step two The combined actions of all nodes (sparse adjustment magnitude, topological probability distribution), and the global reward calculated in this round. ;

[0204] 2) Critic Network Forward Inference: Based on the global state, output the estimated value of the current joint action. ;

[0205] 3) Construct a temporal difference loss function to update network parameters. The loss formula is:

[0206] In the formula The reward decay coefficient controls the weight of rewards from previous iterations; the cloud minimizes this through gradient descent. Optimize the global value assessment capability of the Critic network.

[0207] After the Critic loss is calculated in the cloud, the global policy gradient is solved in reverse. Based on the centralized training and distributed execution architecture, and following the 512-byte segmented communication format agreed upon in step two, a unified gradient is sent to all nodes every one iteration. Each node's local lightweight Actor network receives the gradient and updates its own dual-branch decision network parameters, ensuring that all nodes' sparsity adjustments and topology selection actions are synchronized towards maximizing the global reward. The direction converges, eliminating action conflicts caused by independent decision-making at a single node.

[0208] Set the training termination quantization threshold: continuous Round global rewards The fluctuation range is less than the set minimum value Once the convergence condition is met, the local Actor network weight parameter files of all nodes and the cloud-based Critic value assessment model weight files are exported as the final output of step three, and then the distributed online deployment process of step four begins.

[0209] Specifically, in step S106, the process of determining the same type of new topology to switch to based on the network parameter results and evaluation model weight results of all nodes, employing a coordinator broadcasting the switching intention and freezing gradient transmission, and a coordinator uniformly issuing switching instructions, with each node synchronously rebuilding communication connections and submitting the protocol for switching, includes:

[0210] Introducing a coordinator arbitration mechanism: When more than two-thirds of the nodes propose to switch to the same new topology, the switching process is triggered; otherwise, the current topology is maintained.

[0211] The switching process employs a two-phase commit protocol.

[0212] The first phase consists of: the coordinator broadcasting the intention to switch and freezing gradient transmission; all nodes replying with ACK after confirming that the current gradient to be aggregated has been safely written to disk.

[0213] The second phase is as follows: the coordinator issues a unified switching command, and each node synchronously rebuilds the communication connection. During the communication connection rebuilding period, a forced cooling window is set, during which the switching action output by the decision network is masked.

[0214] Specifically, see Figure 3 In the actual distributed deployment phase, each node runs the trained local Actor network and outputs its own local sparsity adjustment suggestions and topology switching preferences.

[0215] To avoid topology conflicts, a coordinator arbitration mechanism is introduced: when a majority of nodes (e.g., more than 2 / 3) propose switching to the same new topology, the switching process is triggered; otherwise, the current topology is maintained. The switching process uses a two-phase commit protocol.

[0216] In the first phase, the coordinator broadcasts the intention to switch and freezes gradient transmission. All nodes reply with ACK after confirming that the current gradient to be aggregated has been safely written to disk.

[0217] In the second phase, the coordinator issues a unified switching command, and each node synchronously rebuilds the communication connection. During this period, a forced cooling window is set (e.g., a fixed 50 iterations). Within this window, regardless of how the network state changes, the switching action output by the decision network is masked, and only the sparsity rate is allowed to be adjusted to ensure that the transient jitter of the topology switching is completely dissipated and the system throughput is restored to stability before the next round of topology evaluation is started.

[0218] This protocol ensures the consistency of the global topology and eliminates the risk of high-frequency "ping-pong switching" through a cooling mechanism, enabling the overall communication optimization to achieve steady benefits in long-term iterations.

[0219] Based on the same inventive concept, a second aspect of the embodiments of this application also provides a communication optimization device for distributed AI training, see [link to relevant documentation]. Figure 2 ,include:

[0220] The state vector unit 201 is used to collect multi-dimensional environmental information at each distributed node of the distributed deep neural network, and to smooth the current observation vector and the historical observation vector in the multi-dimensional environmental information to obtain a stable state vector.

[0221] The encoding representation unit 202 is used to take the stable state vector as the input feature of the two-branch deep decision network, encode the stable state vector through a shared low-level feature extraction network, extract the representation data related to communication optimization, and feed the representation data to the two-branch deep decision network.

[0222] The dual-branch network unit 203 is used to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology through two branch depth decision networks, respectively.

[0223] Interface definition unit 204 is used for defining the input interface of the local Actor network based on the determined value of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, as well as defining the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node.

[0224] Model training unit 205 is used to construct a global quantized reward function, to train the cloud Critic network and the node Actor network in a collaborative manner, and to output the weight parameter results of the local Actor network of all nodes and the weight results of the cloud Critic value evaluation model.

[0225] The topology switching unit 206 is used to determine the same type of new topology to switch to based on the network parameter results and evaluation model weight results of all nodes. It adopts the method of coordinator broadcasting the switching intention and freezing gradient transmission, and coordinator uniformly issuing switching instructions. Each node synchronously rebuilds the communication connection and submits the protocol to switch.

[0226] Furthermore, the state vector unit is also used in distributed deep neural network training scenarios to collect the model training accuracy, gradient communication time, and available bandwidth and latency status of the inter-node communication link for each node after each distributed node completes the forward propagation and gradient calculation of the deep neural network model in the current round.

[0227] Multidimensional environmental information is generated based on the training accuracy, gradient communication time, and available bandwidth and latency status of inter-node communication links.

[0228] Furthermore, the state vector unit is also used to obtain the round of the current observation vector, and to perform exponential moving average smoothing on the multidimensional environmental information based on the round of the current observation vector and the smoothing factor.

[0229] The smoothed multidimensional environmental information is normalized in each dimension to generate a stable state vector that includes the input state's awareness of switching costs.

[0230] Furthermore, the encoding representation unit is also used to encode the model training accuracy, gradient communication time, and available bandwidth and delay status of the inter-node communication link for each node in the current round based on the shared underlying feature extraction network to obtain a state vector encoding sequence.

[0231] Characteristic data associated with inter-node communication links are extracted from the state vector encoding sequence.

[0232] Furthermore, the dual-branch network unit is also used to determine the adjustment range of the gradient sparsification retention ratio based on the current network state output by the first branch deep decision network.

[0233] The second branch deep decision network outputs switching decisions for the communication topology based on the same network state.

[0234] Furthermore, the two branches in the dual-branch network unit are respectively connected to the gated differentiation module, including: a dynamic weight network;

[0235] The gradient update magnitude of the two branches is automatically adjusted based on the current state.

[0236] For the first branch, a deterministic gradient update method is adopted to output a deterministic value of the sparsity adjustment range. The deterministic value of the sparsity adjustment range is superimposed on the current sparsity during subsequent execution to form a new sparsity retention ratio.

[0237] For the second branch, the Gumbel-Softmax reparameterization technique is used to relax the discrete topology selection process into a continuously differentiable sampling process, so that this branch is trained end-to-end through gradient descent and outputs the probability distribution of each candidate topology type in the current state. The node makes a topology switching decision based on this distribution.

[0238] Furthermore, the interface definition unit is also used to deploy a centralized Critic network in the cloud or on the parameter server, to obtain the global state splicing information of all nodes, as well as the joint actions and global reward signals of all nodes during the training phase.

[0239] During training, the centralized Critic evaluates the value of the current joint decision based on global information and transmits gradient information to the Actor network of each node for parameter updates.

[0240] Furthermore, the interface definition unit is also used to mount a local Actor network in a jointly trained image recognition model and deploy a centralized Critic network in the cloud.

[0241] The Actor network input interface quantization specification stipulates that the stable state vector of the network after single-node smoothing adopts a 32-bit floating-point array format and a fixed 18-dimensional feature dimension. It is sent to the local Actor to complete forward inference based on the gRPC lightweight communication protocol.

[0242] The cloud-based centralized Critic network interacts with the training interface of the Actor network at each node. Each node is trained to generate an 18-dimensional local state, a 1-dimensional sparse adjustment magnitude, and a 3-dimensional topology selection probability as a floating-point array of length 22 and upload it to the cloud.

[0243] The 10 sets of node data are vertically spliced ​​to obtain a 180-dimensional global state. The global gradient output by the cloud-centralized Critic network adopts a fixed 512-byte segmented communication format and is uniformly distributed to all node Actors every one iteration cycle to complete the synchronous update of network parameters.

[0244] Furthermore, the model training unit is also used to synchronously collect gradient sparsity statistics, model validation accuracy data, and topology switching log data after each round of distributed training iteration.

[0245] The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data.

[0246] Furthermore, a global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data, including:

[0247] The gradient sparsity statistics correspond to the communication time benefit, and the global communication benefit is determined based on the gradient sparsity retention ratio, bandwidth utilization and weight hyperparameters of the node.

[0248] The model validation accuracy data corresponds to the model penalty accuracy, and the model penalty accuracy is determined based on the model accuracy of the model validation set, the accuracy of the previous round, the accuracy decrease threshold, and the accuracy penalty hyperparameter.

[0249] The topology switching log statistics correspond to the topology switching penalty, which is determined based on the basic switching cost, exponential growth coefficient, cumulative number of topology switching within the iteration window, and transient loss coefficient.

[0250] The global reward signal is determined based on the benefits of communication time consumption, model penalty accuracy, and topology switching penalty.

[0251] Furthermore, the model training unit is also used for updating the value loss quantization of the Critic network in the cloud.

[0252] The global reward is calculated based on the global state concatenation vector, the coefficient adjustment magnitude of all nodes, and the node topology probability distribution.

[0253] The estimated value of the current joint action is obtained through forward reasoning using the Critic network based on the global state.

[0254] A temporal difference loss function is constructed to update network parameters, and the gradient loss of the Critic network is determined by controlling the weight of the historical iteration reward and the reward decay coefficient.

[0255] Furthermore, the model training unit is also used to calculate the global policy gradient in reverse after the Critic loss is calculated in the cloud.

[0256] Based on the centralized training distributed execution architecture, and following the agreed 512-byte segmented communication format, a unified gradient is sent to all nodes every one iteration.

[0257] Each node's local lightweight Actor network receives gradients and updates its own dual-branch decision network parameters, ensuring that all nodes' sparsity adjustments and topology selection actions are synchronized towards maximizing the global reward. The direction converges;

[0258] Set a training termination quantization threshold: if the global reward fluctuation amplitude is less than the set minimum value for a number of consecutive periods, the collaborative strategy is considered to have converged.

[0259] After the convergence condition is met, the results of the local Actor network weight parameters of all nodes and the weight results of the cloud-based Critic value assessment model are exported.

[0260] Furthermore, the topology switching unit is also used to introduce a coordinator arbitration mechanism: when more than two-thirds of the nodes propose to switch to the same new topology, the switching process is triggered; otherwise, the current topology is maintained.

[0261] The switching process employs a two-phase commit protocol.

[0262] The first phase consists of: the coordinator broadcasting the intention to switch and freezing gradient transmission; all nodes replying with ACK after confirming that the current gradient to be aggregated has been safely written to disk.

[0263] The second phase is as follows: the coordinator issues a unified switching command, and each node synchronously rebuilds the communication connection. During the communication connection rebuilding period, a forced cooling window is set, during which the switching action output by the decision network is masked.

[0264] It should be noted that the communication optimization device for distributed AI training in this application embodiment should be understood as a modular architecture for implementing the communication optimization method for distributed AI training, and not as a limitation thereof; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand this.

[0265] Based on the same inventive concept, a third aspect of the embodiments of this application also provides an electronic device 161, see [link to relevant documentation]. Figure 7 It includes a processor 164, a communication interface 165, a memory 162, and a communication bus, wherein the processor 164, the communication interface 165, and the memory 162 communicate with each other through the communication bus;

[0266] Memory 162 stores computer program 163;

[0267] When processor 164 executes the program stored in memory 162, it implements a communication optimization method for distributed AI training.

[0268] The aforementioned communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc.

[0269] The communication interface 165 is used for communication between the aforementioned electronic device 161 and other devices.

[0270] The memory 162 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 162 may also be at least one storage device located remotely from the aforementioned processor 164.

[0271] The processor 164 mentioned above can be a general-purpose processor 164, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0272] Based on the same inventive concept, the fourth aspect of the present application also provides a computer-readable storage medium storing a computer program 163, which, when executed by a processor 164, implements a communication optimization method for distributed AI training.

[0273] The computer-readable storage medium may be included in the device / apparatus described in the above embodiments; or it may exist independently and not assembled into the device / apparatus. The computer-readable storage medium carries one or more programs that, when executed, implement the communication optimization method for distributed AI training according to embodiments of this disclosure.

[0274] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A communication optimization method for distributed AI training, characterized in that, include: Multidimensional environmental information is collected at each distributed node of the distributed deep neural network, and the current observation vector and historical observation vector in the multidimensional environmental information are smoothed to obtain a stable state vector. The stable state vector is used as the input feature of the two-branch deep decision network. The stable state vector is encoded by a shared low-level feature extraction network to extract the representation data related to communication optimization. The representation data is then fed into the two-branch deep decision network. Two branch deep decision networks are used to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology, respectively. Based on the determined value of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, the input interface of the local Actor network and the training interaction interface between the cloud-centralized Critic network and the Actor networks of each node are defined. Construct a global quantitative reward function, co-train the cloud-based Critic network and the node Actor network, and output the weight parameter results of the local Actor network of all nodes and the weight results of the cloud-based Critic value evaluation model. Based on the network parameter results and evaluation model weight results of all nodes, the same type of new topology is determined to switch to. The coordinator broadcasts the switching intention and freezes gradient transmission, and the coordinator uniformly issues the switching command. Each node synchronously rebuilds the communication connection and submits the protocol to switch.

2. The method according to claim 1, characterized in that, The process of collecting multi-dimensional environmental information at each distributed node of a distributed deep neural network includes: In a distributed deep neural network training scenario, after each distributed node completes the forward propagation and gradient calculation of the deep neural network model in the current round, it collects the model training accuracy, gradient communication time, and available bandwidth and latency status of the inter-node communication link for the current round. Multidimensional environmental information is generated based on the training accuracy, gradient communication time, and available bandwidth and latency status of inter-node communication links.

3. The method according to claim 2, characterized in that, The step of smoothing the current observation vector and historical observation vector in the multidimensional environmental information to obtain a stable state vector includes: Obtain the round number of the current observation vector, and perform exponential moving average smoothing on the multidimensional environmental information based on the round number of the current observation vector and the smoothing factor; The smoothed multidimensional environmental information is normalized in each dimension to generate a stable state vector that includes the input state's awareness of switching costs.

4. The method according to claim 1 or 2, characterized in that, The step of encoding the stable state vector through a shared low-level feature extraction network to extract representational data related to communication optimization includes: Based on the shared underlying feature extraction network, the model training accuracy, gradient communication time, and available bandwidth and delay status of the inter-node communication link in the current round of each node are encoded to obtain a state vector encoding sequence. Characteristic data associated with inter-node communication links are extracted from the state vector encoding sequence.

5. The method according to claim 4, characterized in that, The process of using two branch deep decision networks to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology includes: The first branch deep decision network outputs a determined value for the adjustment range of the gradient sparsity retention ratio based on the current network state. The second branch deep decision network outputs switching decisions for the communication topology based on the same network state.

6. The method according to claim 5, characterized in that, The process of using two branch deep decision networks to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology includes: The two branches are connected to the gated differentiation module, which includes a dynamic weight network; The gradient update magnitude of the two branches is automatically adjusted based on the current state. For the first branch, a deterministic gradient update method is adopted to output a deterministic value of the sparsity adjustment range. The deterministic value of the sparsity adjustment range is superimposed on the current sparsity during subsequent execution to form a new sparsity retention ratio. For the second branch, the Gumbel-Softmax reparameterization technique is used to relax the discrete topology selection process into a continuously differentiable sampling process, so that this branch is trained end-to-end through gradient descent and outputs the probability distribution of each candidate topology type in the current state. The node makes a topology switching decision based on this distribution.

7. The method according to claim 6, characterized in that, The determination of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, the definition of the input interface of the local Actor network, and the definition of the training interaction interface between the centralized cloud Critic network and the Actor networks of each node include: Deploy a centralized Critic network in the cloud or on a parameter server to acquire global state splicing information of all nodes, as well as joint actions and global reward signals of all nodes during the training phase. During training, the centralized Critic evaluates the value of the current joint decision based on global information and transmits gradient information to the Actor network of each node for parameter updates.

8. The method according to claim 7, characterized in that, The determination of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, the definition of the input interface of the local Actor network, and the definition of the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node, also include: A local Actor network is incorporated into the jointly trained image recognition model, while a centralized Critic network is deployed in the cloud. The Actor network input interface quantization specification stipulates that the stable state vector of the network after single-node smoothing adopts a 32-bit floating-point array format and a fixed 18-dimensional feature dimension. It is sent to the local Actor to complete forward inference based on the gRPC lightweight communication protocol. The cloud-based centralized Critic network interacts with the training interface of the Actor network at each node. Each node is trained to generate an 18-dimensional local state, a 1-dimensional sparse adjustment magnitude, and a 3-dimensional topology selection probability as a floating-point array of length 22 and upload it to the cloud. The 10 sets of node data are vertically spliced ​​to obtain a 180-dimensional global state. The global gradient output by the cloud-centralized Critic network adopts a fixed 512-byte segmented communication format and is uniformly distributed to all node Actors every one iteration cycle to complete the synchronous update of network parameters.

9. The method according to claim 1, characterized in that, Construct a global quantized reward function, co-train the cloud-based Critic network and the node Actor network, and output the weight parameters of all node-local Actor networks and the weight results of the cloud-based Critic value evaluation model, including: After each round of distributed training iteration, gradient sparsity statistics, model validation accuracy data, and topology switching log data are collected synchronously. The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data.

10. The method according to claim 9, characterized in that, The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data, including: The gradient sparsity statistics correspond to the communication time benefit, and the global communication benefit is determined based on the gradient sparsity retention ratio, bandwidth utilization and weight hyperparameters of the node. The model validation accuracy data corresponds to the model penalty accuracy, and the model penalty accuracy is determined based on the model accuracy of the model validation set, the accuracy of the previous round, the accuracy decrease threshold, and the accuracy penalty hyperparameter. The topology switching log statistics correspond to the topology switching penalty, which is determined based on the basic switching cost, exponential growth coefficient, cumulative number of topology switching within the iteration window, and transient loss coefficient. The global reward signal is determined based on the benefits of communication time consumption, model penalty accuracy, and topology switching penalty.

11. The method according to claim 10, characterized in that, The method further includes: Cloud-based Critic network value loss quantification update; The global reward is calculated based on the global state concatenation vector, the coefficient adjustment magnitude of all nodes, and the node topology probability distribution. The estimated value of the current joint action is obtained through forward reasoning using the Critic network based on the global state. A temporal difference loss function is constructed to update network parameters, and the gradient loss of the Critic network is determined by controlling the weight of the historical iteration reward and the reward decay coefficient.

12. The method according to claim 11, characterized in that, The method further includes: After the Critic loss is calculated in the cloud, the global policy gradient is solved in reverse. Based on the centralized training distributed execution architecture, and following the agreed 512-byte segmented communication format, a unified gradient is sent to all nodes every one iteration. Each node's local lightweight Actor network receives gradients and updates its own bi-branch decision network parameters, so that all nodes' sparsity adjustment and topology selection actions converge synchronously in the direction of maximizing global reward. Set a training termination quantization threshold: if the global reward fluctuation amplitude is less than the set minimum value for a number of consecutive periods, the collaborative strategy is considered to have converged. After the convergence condition is met, the results of the local Actor network weight parameters of all nodes and the weight results of the cloud-based Critic value assessment model are exported.

13. The method according to claim 1, characterized in that, The process involves determining the new topology based on network parameter results and evaluation model weights across all nodes, employing a coordinator broadcasting the switching intention and freezing gradient transmission, and a coordinator issuing unified switching commands. Each node then synchronously rebuilds its communication connection and submits the protocol for switching, including: Introducing a coordinator arbitration mechanism: When more than two-thirds of the nodes propose to switch to the same new topology, the switching process is triggered; otherwise, the current topology is maintained. The switching process employs a two-phase commit protocol. The first phase consists of: the coordinator broadcasting the intention to switch and freezing gradient transmission; all nodes replying with ACK after confirming that the current gradient to be aggregated has been safely written to disk. The second phase is as follows: the coordinator issues a unified switching command, and each node synchronously rebuilds the communication connection. During the communication connection rebuilding period, a forced cooling window is set, during which the switching action output by the decision network is masked.

14. A communication optimization device for distributed AI training, characterized in that, include: The state vector unit is used to collect multi-dimensional environmental information at each distributed node of the distributed deep neural network, and to smooth the current observation vector and historical observation vector in the multi-dimensional environmental information to obtain a stable state vector. The encoding representation unit is used to take the stable state vector as the input feature of the two-branch deep decision network, encode the stable state vector through a shared low-level feature extraction network, extract the representation data related to communication optimization, and feed the representation data to the two-branch deep decision network. A dual-branch network unit is used to determine the magnitude of the output gradient sparsity adjustment and the switching decision of the communication topology through two branch deep decision networks, respectively. The interface definition unit is used to define the input interface of the local Actor network based on the determined value of the gradient sparsity adjustment magnitude and the switching decision of the communication topology, as well as the training interaction interface between the cloud-based centralized Critic network and the Actor networks of each node. The model training unit is used to construct a global quantized reward function, to train the cloud Critic network and the node Actor network in a collaborative manner, and to output the weight parameter results of the local Actor network of all nodes and the weight results of the cloud Critic value evaluation model. The topology switching unit is used to determine the new topology to switch to based on the network parameter results and evaluation model weight results of all nodes. It adopts the method of coordinator broadcasting the switching intention and freezing gradient transmission, and coordinator issuing a unified switching command. Each node synchronously rebuilds the communication connection and submits the protocol to perform the switching.

15. The apparatus according to claim 14, characterized in that: The state vector unit is also used in distributed deep neural network training scenarios to collect the model training accuracy, gradient communication time, and available bandwidth and latency status of the inter-node communication link for each node after each distributed node completes the forward propagation and gradient calculation of the deep neural network model in the current round. Multidimensional environmental information is generated based on the training accuracy, gradient communication time, and available bandwidth and latency status of inter-node communication links.

16. The apparatus according to claim 15, characterized in that: The state vector unit is also used to obtain the round of the current observation vector, and to perform exponential moving average smoothing on the multidimensional environmental information based on the round of the current observation vector and the smoothing factor. The smoothed multidimensional environmental information is normalized in each dimension to generate a stable state vector that includes the input state's awareness of switching costs.

17. The apparatus according to claim 14 or 15, characterized in that: The encoding representation unit is also used to encode the model training accuracy, gradient communication time, and available bandwidth and delay status of the inter-node communication link for each node in the current round based on the shared underlying feature extraction network to obtain a state vector encoding sequence. Characteristic data associated with inter-node communication links are extracted from the state vector encoding sequence.

18. The apparatus according to claim 17, characterized in that: The dual-branch network unit is also used to determine the adjustment range of the gradient sparsification retention ratio based on the current network state output by the first branch deep decision network. The second branch deep decision network outputs switching decisions for the communication topology based on the same network state.

19. The apparatus according to claim 18, characterized in that: The two branches in the dual-branch network unit are respectively connected to the gated differentiation module, including: a dynamic weight network; The gradient update magnitude of the two branches is automatically adjusted based on the current state. For the first branch, a deterministic gradient update method is adopted to output a deterministic value of the sparsity adjustment range. The deterministic value of the sparsity adjustment range is superimposed on the current sparsity during subsequent execution to form a new sparsity retention ratio. For the second branch, the Gumbel-Softmax reparameterization technique is used to relax the discrete topology selection process into a continuously differentiable sampling process, so that this branch is trained end-to-end through gradient descent and outputs the probability distribution of each candidate topology type in the current state. The node makes a topology switching decision based on this distribution.

20. The apparatus according to claim 14, characterized in that: The interface definition unit is also used to deploy a centralized Critic network in the cloud or on a parameter server, to obtain the global state splicing information of all nodes, as well as the joint actions and global reward signals of all nodes during the training phase. During training, the centralized Critic evaluates the value of the current joint decision based on global information and transmits gradient information to the Actor network of each node for parameter updates.

21. The apparatus according to claim 20, characterized in that: The interface definition unit is also used to mount a local Actor network in a jointly trained image recognition model and deploy a centralized Critic network in the cloud. The Actor network input interface quantization specification stipulates that the stable state vector of the network after single-node smoothing adopts a 32-bit floating-point array format and a fixed 18-dimensional feature dimension. It is sent to the local Actor to complete forward inference based on the gRPC lightweight communication protocol. The cloud-based centralized Critic network interacts with the training interface of the Actor network at each node. Each node is trained to generate an 18-dimensional local state, a 1-dimensional sparse adjustment magnitude, and a 3-dimensional topology selection probability as a floating-point array of length 22 and upload it to the cloud. The 10 sets of node data are vertically spliced ​​to obtain a 180-dimensional global state. The global gradient output by the cloud-centralized Critic network adopts a fixed 512-byte segmented communication format and is uniformly distributed to all node Actors every one iteration cycle to complete the synchronous update of network parameters.

22. The apparatus according to claim 14, characterized in that: The model training unit is also used to synchronously collect gradient sparsity statistics, model validation accuracy data, and topology switching log data after each round of distributed training iteration. The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data.

23. The apparatus according to claim 22, characterized in that, The global reward signal is determined based on the gradient sparsity statistics, model validation accuracy data, and topology switching log data, including: The gradient sparsity statistics correspond to the communication time benefit, and the global communication benefit is determined based on the gradient sparsity retention ratio, bandwidth utilization and weight hyperparameters of the node. The model validation accuracy data corresponds to the model penalty accuracy, and the model penalty accuracy is determined based on the model accuracy of the model validation set, the accuracy of the previous round, the accuracy decrease threshold, and the accuracy penalty hyperparameter. The topology switching log statistics correspond to the topology switching penalty, which is determined based on the basic switching cost, exponential growth coefficient, cumulative number of topology switching within the iteration window, and transient loss coefficient. The global reward signal is determined based on the benefits of communication time consumption, model penalty accuracy, and topology switching penalty.

24. The apparatus according to claim 23, characterized in that: The model training unit is also used for updating the value loss quantization of the Critic network in the cloud; The global reward is calculated based on the global state concatenation vector, the coefficient adjustment magnitude of all nodes, and the node topology probability distribution. The estimated value of the current joint action is obtained through forward reasoning using the Critic network based on the global state. A temporal difference loss function is constructed to update network parameters, and the gradient loss of the Critic network is determined by controlling the weight of the historical iteration reward and the reward decay coefficient.

25. The apparatus according to claim 24, characterized in that: The model training unit is also used to calculate the global policy gradient in reverse after the Critic loss is calculated in the cloud. Based on the centralized training distributed execution architecture, and following the agreed 512-byte segmented communication format, a unified gradient is sent to all nodes every one iteration. Each node's local lightweight Actor network receives gradients and updates its own dual-branch decision network parameters, ensuring that all nodes' sparsity adjustments and topology selection actions are synchronized towards maximizing the global reward. The direction converges; Set a training termination quantization threshold: if the global reward fluctuation amplitude is less than the set minimum value for a number of consecutive periods, the collaborative strategy is considered to have converged. After the convergence condition is met, the results of the local Actor network weight parameters of all nodes and the weight results of the cloud-based Critic value assessment model are exported.

26. The apparatus according to claim 14, characterized in that: The topology switching unit is also used to introduce a coordinator arbitration mechanism: when more than two-thirds of the nodes propose to switch to the same new topology, the switching process is triggered; otherwise, the current topology is maintained. The switching process employs a two-phase commit protocol. The first phase consists of: the coordinator broadcasting the intention to switch and freezing gradient transmission; all nodes replying with ACK after confirming that the current gradient to be aggregated has been safely written to disk. The second phase is as follows: the coordinator issues a unified switching command, and each node synchronously rebuilds the communication connection. During the communication connection rebuilding period, a forced cooling window is set, during which the switching action output by the decision network is masked.

27. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. Memory, which stores computer programs; When a processor executes a program stored in memory, it implements the communication optimization method for distributed AI training as described in any one of claims 1 to 13.

28. A computer-readable storage medium, characterized in that, The system contains a computer program that, when executed by a processor, implements the communication optimization method for distributed AI training as described in any one of claims 1 to 13.