Node adjustment method and apparatus based on distributed training, and electronic device, computer-readable storage medium and computer program product

By automatically establishing worker node connections based on shared communication configuration information in distributed training, the problem of low training efficiency and progress interruption caused by node adjustment in existing technologies is solved, achieving efficient and dynamic node adjustment and continuous training process.

WO2026242568A1PCT designated stage Publication Date: 2026-11-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/081666
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-19
Filing Date
2026-03-05
Publication Date
2026-11-26

AI Technical Summary

Technical Problem

When training models in a distributed cluster, existing technologies require stopping training tasks to adjust resources, resulting in low training efficiency and interrupted progress, making it difficult to achieve efficient and dynamic node adjustment.

Method used

By automatically establishing communication connections between worker nodes based on shared communication configuration information in distributed training, the online and consistent adjustment of nodes is achieved, ensuring the continuity and efficiency of the training process.

Benefits of technology

It enables node adjustment without interrupting the training task, improving the efficiency and continuity of the training process, reducing maintenance costs, and enhancing resource utilization and the continuity of large model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026081666_26112026_PF_FP_ABST
    Figure CN2026081666_26112026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a node adjustment method based on distributed training and a related device. The method in the present application comprises: deploying, into worker nodes of a distributed cluster, model parameters of a model to be trained, wherein communication connections are automatically established among the worker nodes on the basis of shared communication configuration information, and the shared communication configuration information is used for maintaining communication consistency among the worker nodes; using the worker nodes to perform distributed training on said model on the basis of the shared communication configuration information; during the distributed training of said model, when a node adjustment condition is met, performing online node adjustment to obtain adjusted worker nodes; and synchronizing the shared communication configuration information to the adjusted worker nodes, such that the adjusted worker nodes automatically establish communication connections with other worker nodes on the basis of the synchronized shared communication configuration information, so as to get involved in the distributed training.
Need to check novelty before this filing date? Find Prior Art

Description

Node adjustment methods, devices, electronic equipment, computer-readable storage media, and computer program products based on distributed training.

[0001] Cross-references to related applications

[0002] This application is based on and claims priority to Chinese Patent Application No. 202510645159.7, filed on May 19, 2025, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of computer technology, and in particular to a node adjustment method, apparatus, electronic device, computer-readable storage medium, and computer program product based on distributed training. Background Technology

[0004] In training large models using distributed clusters, the coordination and allocation of cluster resources remains a major challenge. As the model size continues to increase, the need to adjust the resources required for training also increases due to factors such as machine failures and version changes.

[0005] In existing technologies, adjusting the resources required for training often requires stopping the model training task and then adjusting and reconfiguring them. This process is cumbersome and can lead to interruptions in the training progress, resulting in low training efficiency and increased overall training time. Summary of the Invention

[0006] This application provides a node adjustment method, apparatus, electronic device, computer-readable storage medium, and computer program product based on distributed training, which can ensure that node adjustment is carried out efficiently, dynamically, and smoothly, and ensure the continuity and efficiency of the training process.

[0007] This application provides a node adjustment method based on distributed training, applied to an electronic device, comprising: deploying model parameters of a model to be trained on worker nodes of a distributed cluster; automatically establishing communication connections between the worker nodes based on shared communication configuration information, wherein the shared communication configuration information is used to maintain communication consistency between the worker nodes; using the worker nodes to perform distributed training on the model to be trained based on the shared communication configuration information; during the distributed training of the model to be trained, when node adjustment conditions are met, obtaining adjusted worker nodes through online node adjustment; synchronizing the shared communication configuration information to the adjusted worker nodes, enabling the adjusted worker nodes to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in the distributed training.

[0008] This application embodiment also provides a node adjustment device based on distributed training, comprising: a deployment unit configured to deploy model parameters of a model to be trained on worker nodes of a distributed cluster, wherein the worker nodes automatically establish communication connections based on shared communication configuration information, the shared communication configuration information being used to maintain communication consistency among the worker nodes; a training unit configured to perform distributed training on the model to be trained using the worker nodes based on the shared communication configuration information; an adjustment unit configured to, during the distributed training of the model to be trained, obtain adjusted worker nodes through online node adjustment when node adjustment conditions are met; and a synchronization unit configured to synchronize the shared communication configuration information to the adjusted worker nodes, enabling the adjusted worker nodes to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in the distributed training.

[0009] This application also provides an electronic device, including a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute steps in any of the node adjustment methods based on distributed training provided in this application.

[0010] This application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the node adjustment methods based on distributed training provided in this application.

[0011] This application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in any of the node adjustment methods based on distributed training provided in this application.

[0012] This application embodiment can deploy the model parameters of the model to be trained on worker nodes of a distributed cluster; using the worker nodes, the model to be trained is distributed trained based on shared communication configuration information, which is used to maintain communication consistency between the worker nodes so that the worker nodes can automatically establish communication connections based on the shared communication configuration information; in the distributed training, when the node adjustment conditions are met, the adjusted worker nodes are obtained through online node adjustment; the shared communication configuration information is synchronized to the adjusted worker nodes, so that the adjusted worker nodes can automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in the distributed training.

[0013] In this application, during the distributed training, communication consistency between worker nodes is maintained based on shared communication configuration information, enabling automatic establishment of communication connections between worker nodes and achieving unified management and automatic maintenance of worker nodes. Therefore, when facing node adjustment needs such as node failure, scaling up / down, or environmental changes (i.e., when node adjustment conditions are met), online node adjustments can be performed without interrupting distributed training. The adjusted worker nodes synchronously share communication configuration information, allowing them to automatically establish communication connections with other worker nodes based on consistent configuration information (such as global node information and communication verification information) and immediately join the training, ensuring communication consistency between the adjusted worker nodes and other worker nodes. Through this mechanism, adjusted worker nodes can automatically establish communication connections with other worker nodes based on synchronized shared communication configuration information, enabling them to immediately collaborate with other worker nodes in the distributed training process without downtime or stopping the training task. This ensures efficient, dynamic, and stable node adjustments, guarantees the continuity and efficiency of the training process, reduces maintenance costs, and significantly improves the resource utilization of the distributed cluster and the continuity and development efficiency of large model training tasks. Attached Figure Description

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

[0015] Figure 1a is a schematic diagram of a scenario for a node adjustment method based on distributed training provided in an embodiment of this application;

[0016] Figure 1b is a flowchart illustrating the node adjustment method based on distributed training provided in an embodiment of this application;

[0017] Figure 1c is a schematic diagram of the shared communication configuration information and the mounting of the working node provided in an embodiment of this application;

[0018] Figure 1d is a schematic diagram of another shared communication configuration information and worker node mounting provided in an embodiment of this application;

[0019] Figure 1e is a schematic diagram of the node change process provided in an embodiment of this application;

[0020] Figure 2a is a flowchart illustrating a node adjustment method based on distributed training provided in another embodiment of this application;

[0021] Figure 2b is a schematic diagram of node adjustment provided in an embodiment of this application;

[0022] Figure 3 is a schematic diagram of the structure of the node adjustment device based on distributed training provided in an embodiment of this application;

[0023] Figure 4 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. Detailed Implementation

[0024] 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, and 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.

[0025] This application provides a node adjustment method and related equipment based on distributed training.

[0026] The node adjustment device based on distributed training can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet, smart Bluetooth device, laptop, or personal computer (PC); the server can be a single server or a server cluster consisting of multiple servers.

[0027] In some embodiments, the node adjustment device based on distributed training can also be integrated into multiple electronic devices. For example, the node adjustment device based on distributed training can be integrated into multiple servers, and the node adjustment method based on distributed training of this application can be implemented by multiple servers.

[0028] In some embodiments, the terminal can also be used as a server to implement some or all of the functions of a server.

[0029] For example, referring to Figure 1a, the node adjustment method based on distributed training is implemented by the server as an example.

[0030] The server can be used to: deploy the model parameters of the model to be trained 100 on the worker nodes of a distributed cluster. In Figure 1a, the model to be trained 100 is deployed on worker nodes 200-1, 200-2, and 200-3; utilize worker nodes 200-1, 200-2, and 200-3 to perform distributed training on the model to be trained 100 based on shared communication configuration information. The shared communication configuration information is used to maintain communication consistency between worker nodes, enabling worker nodes to automatically establish communication connections based on the shared communication configuration information; during distributed training, when node adjustment conditions are met, an adjusted worker node 300 is obtained through online node adjustment; synchronize the shared communication configuration information to the adjusted worker node 300, enabling the adjusted worker node 300 to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in distributed training. The server can be a server cluster consisting of multiple physical servers or a distributed training system, or it can be a cloud server providing cloud computing services.

[0031] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0032] The following sections provide detailed descriptions. It should be noted that the order of the following embodiments is not intended to limit the preferred order of the embodiments. It is understood that in the specific embodiments of this application, data related to user information is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0033] In this embodiment, a node adjustment method based on distributed training is provided, as shown in Figure 1b. The implementation process of this node adjustment method based on distributed training can be as follows:

[0034] 110. Deploy the model parameters of the model to be trained on the worker nodes of the distributed cluster.

[0035] The "model to be trained" refers to the deep learning model that needs to be optimized and adjusted through distributed training. The "model parameters" refer to the internal parameters of the model that need to be optimized during distributed training, such as the weights and biases of the neural network model; these parameters determine the model's performance.

[0036] Distributed training refers to a training method that distributes the model's training tasks across multiple nodes for parallel computation. A distributed cluster refers to a network cluster composed of multiple computing nodes used for distributed task processing; these computing nodes can be physical machines or virtual machines. In this embodiment, the distributed cluster achieves distributed training of the model to be trained through the collaborative efforts of multiple computing nodes. A worker node is a computing node in the distributed cluster that executes the training task of the model to be trained. Worker nodes automatically establish communication connections based on shared communication configuration information, which is used to maintain communication consistency between worker nodes. This communication configuration information refers to the configuration information used for communication between worker nodes in distributed training, such as, but not limited to, one or more of the following: communication method configuration, communication verification information, and global worker node information. In this embodiment, the shared communication configuration information refers to the communication configuration information shared among worker nodes.

[0037] Communication consistency refers to maintaining a unified communication configuration among worker nodes. In this embodiment, by sharing the same communication configuration information across all worker nodes, the communication configuration among worker nodes can be unified, thus ensuring communication consistency.

[0038] For example, embodiments of this application can be applied to a server that can be equipped with a distributed training system based on a distributed cluster. This distributed training system can manage and coordinate the distributed cluster. The distributed training system may include a task server. When the task server receives a training task for a model to be trained, it can allocate the training task to different nodes according to the requirements of the training task and the available computing resources, based on the system load and available resources, so as to schedule multiple idle nodes in the distributed cluster to participate in the training task.

[0039] It should be noted that the embodiments of this application can be used for distributed training of various different models. For example, the model to be trained can be any deep learning model performing a prediction task. The prediction task can be one or more combinations of tasks such as classification, generation, and regression of input information. The input information can be one or more combinations of data of types such as images, text, audio, and video. Therefore, the embodiments of this application do not limit the model structure of the model to be trained. For example, the model to be trained can be one or more combinations of Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), Long Short-Term Memory Network (LSTM), Transformer model, Generative Adversarial Network (GAN), Deep Neural Network (DNN), Graph Neural Network (GNN), and Autoencoder.

[0040] In this embodiment, a node in the distributed cluster may contain one or more containers. In some implementations, a node in the distributed cluster may contain a service container, which is used to perform the actual computational tasks of distributed training, such as forward propagation, back propagation, and gradient calculation.

[0041] 120. Utilize worker nodes to perform distributed training of the model to be trained based on shared communication configuration information.

[0042] In some embodiments, when the task server receives a training task for the model to be trained, it can schedule n nodes from a distributed cluster as worker nodes for the training task. These n worker nodes can automatically establish communication connections based on shared communication configuration information to participate in the distributed training of the model. During distributed training, the worker nodes can exchange training data, computation results (such as gradients), and model parameters based on the established communication connections.

[0043] It should be noted that, by sharing communication configuration information among all working nodes, the embodiments of this application can make the communication configuration between working nodes consistent, thereby reducing the complexity of communication between nodes. This eliminates the need for repetitive and redundant communication configuration for multiple working nodes, allowing working nodes to automatically establish communication connections, thereby reducing the complexity of communication configuration and improving the communication efficiency between nodes.

[0044] Distributed training involves a large amount of node communication and data exchange. Requiring password input for each communication would significantly increase training latency. Automated authentication and passwordless login improve the speed and efficiency of data transmission between nodes. Therefore, in some implementations, shared communication configuration information includes communication verification information. In distributed training, worker nodes can perform passwordless login based on this verification information to automatically establish a communication connection. This communication verification information refers to the information used to verify the identity of worker nodes during communication in distributed training. This information may include a communication key. Login between worker nodes refers to establishing a communication connection; that is, the login is an authentication process between worker nodes. Therefore, passwordless login means that worker nodes verify their identity through communication verification information without entering a password. This passwordless login can also be called automatic authentication between worker nodes based on communication verification information to automatically establish a communication connection.

[0045] For example, in distributed training, nodes can use public and private keys for authentication. Each node stores a key pair: the public key is used to encrypt data, and the private key is used to decrypt data. In this way, worker nodes can perform secure, passwordless interaction based on a unified communication key. In this embodiment, by sharing the communication key in the communication configuration information, a unified key is configured for each worker node, enabling worker nodes to log in automatically and passwordlessly based on this communication key. This achieves unified passwordless adaptation among worker nodes, thereby enabling passwordless communication between them.

[0046] In some implementations, the communication verification information also includes communication method configuration information. In distributed training, worker nodes can automatically initiate passwordless login based on the communication method configuration information to automatically establish a communication connection. The communication method configuration information refers to the configuration information of the communication method between worker nodes in distributed training. This communication method configuration information can be one or more combinations of, but not limited to, data transmission methods and communication protocols. For example, the communication method configuration information can be SSH (Secure Shell) configuration. In distributed training, worker nodes can establish consistent passwordless login (i.e., passwordless adaptation) based on the SSH service and a unified communication key, automatically starting the sshd service and enabling automatic passwordless interaction between nodes to automatically establish a communication connection.

[0047] In some implementations, shared communication configuration information includes global worker node information. In distributed training, worker nodes can automatically establish communication connections based on this global worker node information. This global worker node information refers to the node information of all worker nodes participating in the training task of the model to be trained. This node information may include, but is not limited to, one or more combinations of node identifiers, node types, node states, and node locations. For example, in distributed training, any worker node can instantly perceive other worker nodes based on the global worker node information, thereby promoting synchronization and coordination among nodes.

[0048] For example, in some implementations, the node information in the global worker node information can be a node identifier, such as a network identifier. This node identifier ensures that each worker node can be independently accessed and identified to locate the node and automatically establish communication connections with other nodes. For instance, the global worker node information may include network identifiers, such as node IPs, for all worker nodes participating in the training task of the model to be trained. This allows worker nodes to share unified global node information, enabling any worker node to access and identify (i.e., locate) another worker node based on its node information within this global worker node information, thus allowing any two worker nodes to automatically establish communication connections.

[0049] For example, in some embodiments, the shared communication configuration information includes communication verification information and global worker node information. Distributed training of the model to be trained is performed using worker nodes based on the shared communication configuration information, including: using worker nodes to locate other worker nodes based on the global worker node information; and using worker nodes to perform passwordless login with the located other worker nodes based on the communication verification information, so that worker nodes automatically establish communication connections with other worker nodes based on the shared communication configuration information for distributed training of the model to be trained. Thus, in this embodiment, the global worker node information can be used to locate worker nodes that automatically establish communication connections, and the communication verification information can be used to perform passwordless login with the located worker nodes, so that communication connections are automatically established between worker nodes.

[0050] In some implementations, shared communication configuration information can be generated and synchronized to each worker node before distributed training. This ensures that each worker node has synchronized configuration information when distributed training begins, guaranteeing that all worker nodes use a consistent configuration and avoiding potential configuration conflicts or inconsistencies during training. For example, before performing distributed training on the model to be trained based on the shared communication configuration information using worker nodes, the following steps are also included:

[0051] In response to receiving a training task for the model to be trained, the worker node corresponding to the training task is determined from the distributed cluster;

[0052] Determine the shared communication configuration information corresponding to the training task;

[0053] The shared communication configuration information is synchronized to the worker nodes so that the worker nodes can automatically establish communication connections based on the shared configuration information.

[0054] In some embodiments, after receiving a training task for the model to be trained, the task server first parses the resource requirement description of the training task, which includes the type of computing resources (such as GPU model), the number of computing resources, the memory size, and the network bandwidth requirements required to execute the training task; then it traverses the real-time resource status of each computing node in the distributed cluster and filters out computing nodes that meet the resource requirement description; finally, according to the load balancing strategy or the resource utilization maximization strategy, it locks and allocates the target node from the filtered computing nodes and marks it as the working node corresponding to the training task.

[0055] For example, when the task server receives a BERT model training task that requires 4 GPUs, the system checks the cluster and finds that compute node A has 2 idle GPUs and compute node B has 2 idle GPUs, and that the two are located in the same network region. Therefore, compute node A and compute node B are identified as working nodes.

[0056] In some embodiments, when determining the shared communication configuration information corresponding to the training task, a unique identifier for authentication is generated according to the communication protocol requirements of the training task (such as SSH, MPI, or NCCL), such as generating an RSA key pair as communication authentication information; at the same time, the network topology of the working nodes is planned, the IP address, port number, and hostname mapping relationship of each working node are allocated, and these network addressing information are integrated into communication mode configuration information; finally, the communication authentication information and communication mode configuration information are encapsulated into a configuration object independent of the image, that is, the shared communication configuration information is obtained.

[0057] For example, when the task server receives the training task of the model to be trained, it can first determine the shared communication configuration information of the training task and actively synchronize the determined shared communication configuration information to each working node, so that in distributed training, each working node can communicate with other working nodes based on the shared configuration information.

[0058] In some implementations, shared communication configuration information can be stored in a preset storage space for synchronization to each worker node. This allows for centralized management and updating of the shared communication configuration information using the preset storage space. When the shared communication configuration information in the preset storage space is updated, all worker nodes automatically synchronize and update their shared communication configuration information, simplifying the management of shared communication configuration information and improving the convenience and consistency of synchronizing shared communication configuration information to worker nodes. For example, synchronizing shared communication configuration information to worker nodes can include: storing the generated shared communication configuration information in the preset storage space; and using worker nodes to copy and store the shared communication configuration information from the preset storage space.

[0059] For example, the task server can store the determined shared communication configuration information in a preset storage space (hereinafter referred to as the configuration storage space) in the distributed training system. The configuration storage space can be one or more of persistent storage, file system, cloud storage service, etc., so that each worker node of the distributed cluster can access and copy the shared communication configuration information stored in the preset storage space through the network, and store the copied shared communication configuration information locally on the worker node, so as to synchronize the shared communication configuration information to each worker node, and automatically establish communication connection between each worker node based on the shared configuration information.

[0060] In this embodiment, by dynamically determining the worker nodes and generating shared communication configurations before the training task starts, the automated construction of the training environment is achieved, eliminating the tedious process of manually configuring the network environment and significantly improving the startup efficiency of distributed training tasks. By decoupling communication configuration information (such as keys and IP lists) from model code and runtime environment images, the same set of training code and images can be seamlessly migrated to distributed clusters of different sizes or network environments, enhancing the system's flexibility and portability. Through centralized management and synchronized sharing of communication configuration information, it is ensured that all worker nodes participating in training have consistent authentication credentials and network views, effectively solving the common problems of node silos or communication authentication failures caused by inconsistent configurations in distributed systems, and ensuring the stability and security of the distributed training communication link.

[0061] In some implementations, each worker node can be attached to the same shared communication configuration information. This allows all worker nodes to instantly update their configurations when the shared communication configuration information changes, ensuring that all worker nodes are currently using the latest and most consistent configuration. This avoids configuration conflicts or inconsistencies that may occur during training, making communication between worker nodes more convenient and efficient. For example, synchronizing the shared communication configuration information to the worker nodes includes:

[0062] Attach the shared communication configuration information to the worker node;

[0063] Worker nodes can acquire shared communication configuration information by mounting, so that worker nodes can synchronously share the communication configuration information.

[0064] In this embodiment, mounting refers to the process of connecting a worker node to the storage location of the corresponding information. Before synchronizing the shared communication configuration information to the worker node, the shared communication configuration information can be stored in a preset storage space, which can be a persistent storage space or a file system. When mounting the shared communication configuration information to the worker node, the storage path of the shared communication configuration information in the preset storage space is associated with the worker node. The worker node then obtains the shared communication configuration information through mounting; that is, the worker node obtains the shared communication configuration information from the preset storage space through the storage path (which can also be understood as the storage location).

[0065] For example, shared communication configuration information can be stored as a configuration file in a configuration storage space (such as persistent storage or a file system). The storage location of this configuration file can be its access path within the configuration storage space (such as a directory path). Each worker node in the distributed cluster can be associated with this storage location, allowing each worker node to access and use the configuration text of the shared communication configuration information through this storage location.

[0066] For example, as shown in Figure 1c, which illustrates the mounting of shared communication configuration information to worker nodes, the shared communication configuration information may include communication verification information and communication method configuration information. Taking the communication verification information as a communication key as an example, when the task server receives the training task of the model to be trained, the task server can generate a key configuration file (such as a Secret file) for the communication verification information based on the training task, and store the communication method configuration information in a resource object (such as a ConfigMap). The key configuration file and the corresponding configuration file in the resource object can be mounted to each worker node, such as node A and node B, for example, by associating the access path of the key configuration file and the access path of the communication method configuration information in the resource object with each worker node. The key configuration file may include a private key file (such as access path / root.sshid_rsa), a public key file (such as access path / root / .ssh / id_rsa.pub), and a public key authorization file (such as access path / root / .ssh / authorized_keys). Resource objects can store SSH client configuration files (e.g., access path / etc / ssh / ssh_config) and SSH server configuration files (e.g., access path / etc / ssh / sshd_config). These two configuration files are used to enable SSH connections between worker nodes. Thus, any worker node can access and use the corresponding configuration files based on the access path of these mounted configuration files, enabling passwordless SSH login to other worker nodes and automatic passwordless communication with them.

[0067] For example, passwordless login between worker nodes is achieved through SSH key pairs. Each worker node's (e.g., node A) SSH client authenticates using its associated private key, while the SSH server of the worker node being logged into (e.g., node B) verifies identity using its public key. By adding the public key of the key pair to node B's public key authorization file, node A is allowed to log in to node B passwordlessly, ensuring automated passwordless communication between worker nodes.

[0068] For example, as shown in Figure 1d, which illustrates the shared communication configuration information and worker node mounting, the shared communication configuration information can include global worker node information. When the task server receives a training task for the model to be trained, it can generate a node information configuration file (such as a hostfile) containing global worker node information based on the training task, and store the node information configuration file in a resource object (such as a ConfigMap). The node information configuration file in the resource object can be mounted to each worker node, such as node A and node B. For example, the access path of the node information configuration file in the resource object (such as / etc / hostfile) can be associated with each worker node. The / etc / hostfile is a standard OpenMPI format file that contains the IP information of all worker nodes and can be updated in real time according to the current node running status.

[0069] In this embodiment, the distributed training system may further include a controller module (Operator). This controller module can collect the node identifiers (such as Pod IPs) of each worker node in real time to manage the worker nodes participating in distributed training based on the collected node identifiers. For example, the collected node identifiers can be written into the node information configuration file in the resource object to dynamically update the node information configuration file. For instance, when adjusting a worker node, the controller module can collect the node identifiers of the adjusted worker node in real time to dynamically update the node information configuration file, enabling all worker nodes to synchronize and update their configuration information instantly through mounting.

[0070] In some implementations, distributed training can update the model parameters of the model to be trained using synchronous or asynchronous updates among worker nodes. For example, in synchronous updates, all worker nodes calculate the gradients, aggregate them, and then update the model parameters synchronously; or in asynchronous updates, each worker node independently updates its corresponding portion of the model parameters without waiting for the calculation results from other worker nodes. This fully utilizes the computing resources of multiple worker nodes, improving the training efficiency of the model.

[0071] For example, in distributed training of the model to be trained, each worker node is usually responsible for processing the computation of different data parts. Each worker node can pass its own computation results (such as gradients) to other worker nodes based on shared communication configuration information to achieve gradient synchronization and realize distributed training of the model to be trained.

[0072] In some implementations, distributed training can be data-parallel training, deploying the model parameters of the model to be trained across worker nodes in a distributed cluster. This includes copying the model parameters of the model to be trained to each worker node in the distributed cluster. For example, the model parameters of the entire model can be copied to multiple computing nodes (devices), and then the training data can be divided into multiple mini-batches, each trained on a separate node. Each node calculates the gradient of its own portion of the data, and finally, based on shared communication configuration information, the gradients calculated by each node are merged and synchronized so that the merged gradient is used to update the model parameters.

[0073] In some implementations, distributed training can be used for parallel training of the model, deploying the model parameters of the model to be trained across worker nodes in a distributed cluster. This includes splitting the model parameters of the model to be trained into multiple parameter groups and assigning each parameter group to a corresponding worker node. For example, the model parameters of the model to be trained can be split and deployed across a distributed cluster. In this case, the model parameters of different parts of the model (i.e., different parameter groups) are assigned to different worker nodes, and each node is responsible for calculating and updating the model parameters of its own part. Data is transferred between nodes based on shared communication configuration information to complete the training of the entire model.

[0074] In some implementations, when deploying the model parameters of the model to be trained on the worker nodes of a distributed cluster, the model parameters can be stored in a preset storage space (hereinafter referred to as the parameter storage space) within the distributed training system. This parameter storage space can be one or more combinations of persistent storage, a file system, or cloud storage services. This allows each worker node in the distributed cluster to access the corresponding model parameters (such as the entire model's parameters or the corresponding parameter group) stored in the parameter storage space via the network, enabling the worker nodes to copy / be assigned the corresponding model parameters.

[0075] 130. During the distributed training of the model to be trained, when the node adjustment conditions are met, the adjusted working nodes are obtained through online node adjustment.

[0076] In this context, node adjustment conditions refer to the conditions that trigger node adjustments in distributed training. These conditions determine when node adjustments are necessary.

[0077] Online node adjustment refers to the process of adjusting nodes in distributed training without stopping or interrupting the training task. In this embodiment, online adjustment can dynamically adjust the worker nodes participating in distributed training in real time without stopping or interrupting the training task.

[0078] For example, in this embodiment, node adjustment conditions may include, but are not limited to, conditions related to one or more triggering factors such as node anomalies, scaling up or down requests, and changes in the task environment. Node adjustment conditions may include one or more of node change conditions and task environment update conditions, where node change conditions may include one or more of node anomaly conditions, node addition conditions, and node removal conditions. Correspondingly, online node adjustment may include, but is not limited to, a combination of one or more of the following: online addition, replacement, or removal of worker nodes, and online updates of the task environment of worker nodes. For example, in distributed training, when any triggering factor is detected / received, the corresponding node adjustment condition is met, and thus the corresponding online node adjustment process can be executed.

[0079] In some implementations, idle nodes can be used to dynamically add or replace worker nodes in real time during distributed training, making distributed training more flexible, efficient, and fault-tolerant. For example, node adjustment conditions include node change conditions, and the adjusted worker node includes the changed worker node. In distributed training, when the node adjustment conditions are met, the adjusted worker node is obtained through online node adjustment, including:

[0080] In distributed training, when the node change conditions are met, online node changes are performed based on the idle nodes of the distributed cluster to obtain the changed working node.

[0081] In this context, node change conditions refer to the conditions that trigger node changes in distributed training. Node change refers to adding, deleting, or replacing worker nodes participating in distributed training. Online node change refers to the process of performing node changes in distributed training without stopping or interrupting the training task. For example, node change conditions may include, but are not limited to, conditions related to one or more triggering factors such as node anomalies or scaling requests. Correspondingly, online node changes may include, but are not limited to, one or more combinations of online addition or replacement of worker nodes.

[0082] Idle nodes refer to nodes in a distributed cluster that are not undertaking computing tasks.

[0083] For example, in distributed training, when an abnormal worker node is detected or a scaling request is received, the corresponding node change conditions are met. The controller module (operator) can then call one or more idle nodes to add or replace worker nodes online. The scaling request could be to add new worker nodes based on resource requirements or to increase the number of worker nodes to a preset number.

[0084] During model training, the time consumed by replacing a single node cannot be ignored when absolute efficiency is required. Therefore, in some implementations, in order to pursue ultimate efficiency and avoid the problem of insufficient resources during replacement, a preset number of nodes can be reserved as idle nodes for distributed training, which can be used to add or replace working nodes.

[0085] For example, ultra-high optimization tasks can use reserved buffer machines (buffer roles, i.e., idle nodes) to allow asynchronous task restarts for node replacement or addition, thus ensuring that the recovery time is minimized in the event of a training task interruption. For tasks at scales of 1000 calories or higher, 1-2 additional machines are requested as backups when allocating resources. Tasks are started using a subset of nodes through the hostfile provided by the partitioning platform. When a node fails, the buffer machine is immediately used to replace and restart the task. Simultaneously, the failed node initiates a replacement process, and the replaced node is reassigned as a buffer machine for future replacements. This approach minimizes the time required for node changes during training tasks, playing a crucial role in large-scale training scenarios.

[0086] In some implementations, during distributed training, when a worker node anomaly is detected, a fault tolerance mechanism can be triggered to replace the anomaly with an idle node. This migrates the computational tasks being executed by the anomaly to the idle node, ensuring training stability and efficiency. Node change conditions include node anomaly conditions, and changing a worker node includes replacing it. In distributed training, when the node change conditions are met, online node changes are performed based on the idle nodes of the distributed cluster to obtain the changed worker node, including:

[0087] In distributed training, when any worker node meets the node abnormality condition, the idle node of the distributed cluster is used to replace the abnormal worker node online, so that the idle node is used as the replacement worker node for the abnormal worker node, and the abnormal worker node is the worker node that meets the node abnormality condition.

[0088] Node anomaly conditions refer to conditions related to node anomalies. Online replacement refers to the process of replacing worker nodes in distributed training without stopping or interrupting the training task.

[0089] For example, a node anomaly condition could be the detection of an abnormal exit of a worker node, such as detecting a non-zero exit code for any worker node. When a worker node anomaly is detected, a fault tolerance mechanism can be triggered. The controller module can delete the worker node and, based on its resource usage, schedule an idle node that matches that resource usage to replace it. This idle node can take over the computational tasks being executed by the abnormal worker node, dynamically replacing the abnormal worker node and ensuring that the training task continues.

[0090] In this embodiment of the application, node abnormalities can be caused by a variety of factors, including machine failure, user program abnormalities, or user-initiated process termination, which in turn lead to node abnormalities.

[0091] For example, in some implementations, the process of any worker node can be terminated by a user's termination operation, resulting in a non-zero exit code for the node (i.e., abnormal node exit). For instance, the startup command for the computing task of a worker node can be encapsulated into an executable encapsulated command such as `run`, where the main process within the business container of the worker node is `run`. This main process can receive a termination signal (such as the `kill TERM` signal) triggered by a user's termination operation to release the process, triggering abnormal container exit, thereby triggering node abnormality, and releasing the container to trigger fault tolerance mechanisms.

[0092] In this embodiment, users can perform termination operations in various ways. For example, they can directly log in to the container of the worker node via SSH and execute a termination command (such as `kill`) or send a termination command (such as `kill`) remotely from any machine to trigger a container exception, which in turn triggers a node exception. Alternatively, when a process is stuck on the worker node, users can first execute `ps -ef` to view all currently running process information, find the process corresponding to the start command (`start_cmd`), and terminate the found process using a termination command (such as `kill`), which will trigger a node exception. If the worker node is already inaccessible, users can perform a node deletion operation (such as `delete pod`) to trigger fault-tolerant rebuilding of the node, thus triggering a node exception.

[0093] In some implementations, abnormal worker nodes can be identified to prevent them from participating in training again, thereby ensuring the stability and efficiency of training. In distributed training, when node change conditions are met, online node changes are performed based on idle nodes in the distributed cluster to obtain the changed worker node, which also includes:

[0094] Perform node release processing on abnormal working nodes;

[0095] Add a masking flag to abnormal worker nodes after release processing. The masking flag is used to indicate that the abnormal worker nodes after release processing are in a state where they cannot be used to replace worker nodes online.

[0096] Node release processing refers to removing abnormal worker nodes from distributed training so that they no longer participate in subsequent distributed training. For example, release processing may include pausing nodes, retiring nodes, and so on. The masking flag can represent a specific status or label, indicating that the node has been marked as "released" or "unavailable".

[0097] For example, after releasing an abnormal worker node, it can be added to the distributed cluster's resource pool as an idle node. To prevent this worker node from being rescheduled for the current distributed training, a blocking operation can be initiated after determining that the worker node is faulty. A blocking flag, such as "unavailable," can be added to the worker node to indicate that it cannot be used for online replacement, thus preventing it from being rescheduled as a worker node. In this way, by releasing abnormal worker nodes, the computing resources and communication ports occupied by faulty nodes are promptly reclaimed, avoiding interference from invalid resource occupation or residual processes on cluster management. More importantly, by adding a blocking flag to the released abnormal node, the possibility of the faulty node being mistakenly judged as a healthy idle node and reassigned to training tasks is logically eliminated. This effectively prevents the reproduction of faults or infinite loop restarts caused by repeatedly calling nodes with potential hardware damage or environmental problems, significantly improving the accuracy of resource scheduling and the long-term stability of the system in distributed training.

[0098] In some implementations, during distributed training, dynamic scaling can be triggered when a request for a new worker node is made. Idle nodes are added as new worker nodes to the distributed training process, thus dynamically scaling up to ensure training stability and efficiency. Node change conditions include node addition conditions, and changing worker nodes includes adding new worker nodes. During the distributed training of the model to be trained, when the node change conditions are met, online node changes are performed based on the idle nodes of the distributed cluster to obtain the changed worker nodes, including:

[0099] During the distributed training of the model to be trained, when the conditions for adding nodes are met, the idle nodes of the distributed cluster are added online as new working nodes.

[0100] Among these, "node addition conditions" refers to the conditions related to adding a node. Online addition refers to the process of adding a worker node in distributed training without stopping or interrupting the training task.

[0101] For example, a node addition condition could be receiving a scaling request for distributed training. As shown in Figure 1e, in the node change process, after receiving a scaling request, the Task Server 101 can first verify through the Scale Manager 102 whether there are sufficient quotas and underlying resources (i.e., idle nodes, such as idle GPUs) to meet the resource requirements of the scaling request (i.e., the scaling configuration). After successful verification, the Task Server 101 sends the resource requirements (i.e., the scaling configuration) to the Controller Module 103. The Controller Module 103, based on the resource requirements of the computational tasks in the scaling request, schedules and manages the resource objects (such as Job declarations) of the worker nodes, using these resource objects to schedule one or more idle nodes matching the resource requirements to join the distributed training as new worker nodes. Based on the load of the new worker node, some computational tasks in the training task can be scheduled to that new worker node, enabling rapid scaling of the distributed training's computational capacity and effectively handling excessive or increased computational demands, thereby ensuring the efficient execution of the entire training task. In the above embodiments, by responding to the addition of nodes during the distributed training process and adding idle nodes in the cluster online as worker nodes, the online elastic expansion of training computing power is realized. Parallel computing units can be dynamically added without interrupting the training task, effectively utilizing the surplus resources of the cluster to accelerate model training convergence and shorten the overall training time.

[0102] In some implementations, the shared communication configuration information can be synchronized to the changed worker nodes only after ensuring that the online node changes. This ensures that the changed worker nodes are ready to participate in distributed training based on the shared communication configuration information, thus guaranteeing the continuity of the training task. For example, the step of synchronizing the shared communication configuration information to the adjusted worker nodes can be performed only after confirming that the online node changes have been completed.

[0103] In some implementations, during distributed training, dynamic scaling can be triggered when a worker node is requested to be removed, thereby reducing the workload and ensuring training stability and efficiency. The node change conditions also include node removal conditions. During distributed training, when these conditions are met, online node changes are performed based on idle nodes in the distributed cluster to obtain the changed worker node. Furthermore, during the distributed training of the model to be trained, when a node removal condition is met, the worker node corresponding to the node removal condition is removed online.

[0104] Node removal conditions refer to conditions related to node removal. For example, a node removal condition could be receiving a scaling-down request for distributed training, such as removing a specific worker node or reducing the number of worker nodes to a preset number. Online removal refers to the process of removing worker nodes without stopping or interrupting the training task in distributed training. As shown in Figure 1e, after receiving a scaling-down request, the task server's controller module can schedule and manage the worker node's resource object (such as a Job declaration) to remove the corresponding worker node in distributed training according to the scaling-down request. This releases the worker node's resources from the training task and schedules the distributed training computation tasks on the removed worker node to other worker nodes for processing, ensuring that training continues. It should be noted that since there is no changed worker node after deleting the worker node corresponding to the node removal condition, there is no need to synchronize shared communication configuration information.

[0105] In some implementations, a node change detection task can be used to automatically detect whether online node changes are complete, making node change detection more efficient and accurate, improving its stability and efficiency, and ensuring the continuity of training. In some embodiments, during the distributed training of the model to be trained, when the node adjustment conditions are met, the adjusted working nodes are obtained through online node adjustment, further including:

[0106] When the node change conditions are met, a node change detection task is triggered. The node change detection task includes node information variables and is used to detect the completion status of online node changes based on the node information variables.

[0107] Set the value of the node information variable to empty, so as to wait for the node information variable to be assigned a value based on the node information of the changed working node;

[0108] When the value of the node information variable is not empty, the node change detection task ends, confirming that the online node change has been completed.

[0109] The node change detection task refers to the task of detecting whether online node changes have been completed. The node information variable records the node information of the working node corresponding to the online node change; this node information variable can also be an environment variable.

[0110] For example, node change detection tasks can be performed using automated scripts. In practical applications, based on Linux principles, in-process environment variables are not automatically updated. Therefore, the `source / etc / environ` command can be actively executed to update the values ​​of the current session's environment variables (i.e., node information variables).

[0111] When node change conditions are met, an automated script for the node change detection task can be triggered. This script first sets the value of node information variables (such as the CHIEF_IP variable) to empty and waits for a new value to be assigned. When the node information variable is assigned a new value—that is, when the node information (such as the node identifier) ​​of the changed working node is assigned a value—it indicates that the online node change is complete, and the node change detection task can be terminated. In this way, relying on the execution of the automated script for the node change detection task makes node change detection more efficient and accurate, and enables functions such as automatic response, improving the stability and efficiency of node change detection.

[0112] For example, in the case of replacing abnormal worker nodes online, when any worker node meets the node abnormality condition, the initial value of the node information variable can be the node information of the abnormal worker node (such as the node identifier). The initial value can be removed first to set the value of the node information variable to empty and wait for the assignment. When the node information variable is assigned a new value, it means that the idle node has replaced the abnormal worker node, indicating that the online replacement of abnormal worker nodes has been completed.

[0113] For example, in the case of adding a new worker node online, the initial value of the node information variable can be empty when the node addition conditions are met. It can wait for an assignment; when the node information variable is assigned a new value, it indicates that a new worker node has been added, signifying that the online addition of a worker node has been completed.

[0114] In some implementations, the steps to synchronize shared communication configuration information to the adjusted working node can be performed only after confirming that the online node change has been completed.

[0115] In some implementations, when multiple worker nodes need to be changed online (such as replaced and / or updated), a corresponding node change detection task can be triggered for each worker node's online node change to detect the completion status of each worker node's online node change process. This allows for real-time synchronization and sharing of communication configuration information to each changed worker node based on the real-time change status of each online node change, without waiting for all changes to complete. This improves the response speed and efficiency of changing worker nodes, avoids delays caused by waiting for all node changes to complete, and ensures the continuity of training tasks.

[0116] In some implementations, shared task environment information can be generated and synchronized to each worker node before distributed training, so that each worker node already has synchronized task environment information when distributed training begins, ensuring that all worker nodes use consistent training methods to avoid conflicts. Before distributive training of the model to be trained using worker nodes based on shared communication configuration information, the process also includes:

[0117] Determine the task environment information corresponding to the distributed training of the model to be trained;

[0118] Synchronize the task environment information to the working nodes.

[0119] In this context, "task environment information" refers to the environmental information upon which the training task process relies when executing the distributed training computational tasks. This environmental information can include, but is not limited to, one or more combinations of system software, training tools, and training frameworks. "Training task process" refers to the process on the worker node that actually executes the distributed training computational tasks. For example, the training task process on each worker node can be responsible for executing a specific part of the distributed training tasks, such as data processing, gradient calculation, and updating model parameters.

[0120] For example, when the task server receives the training task of the model to be trained, it can first determine the task environment information of the training task and actively synchronize the determined task environment information to each worker node, so that in distributed training, each worker node can participate in training based on the task environment information.

[0121] In some implementations, task environment information can be stored in an environment storage space for synchronization to each worker node. The environment storage space refers to a pre-defined storage space for storing task environment information, such as an environment repository or a mirror repository. This allows for centralized management and updating of task environment information using the environment storage space. Once the task environment information in the environment storage space is updated, all worker nodes automatically synchronize and update their task environment information, simplifying task environment information management and improving the convenience and consistency of synchronizing task environment information to worker nodes.

[0122] In some implementations, when the task environment corresponding to a worker node is updated, the training task process in the worker node can be restarted online based on the updated task environment to dynamically replace the task environment without stopping or interrupting the training task; the training task process can be restarted in place. For example, before performing distributed training of the model to be trained using worker nodes based on shared communication configuration information, the following steps are also included:

[0123] The task environment information for distributed training is stored in the environment storage space. The task environment information is the information of the running environment of the training task process in the worker node.

[0124] Node adjustment conditions include task environment update conditions, and the adjusted worker nodes include environment-updated worker nodes. In distributed training, when the node adjustment conditions are met, the adjusted worker nodes are obtained through online node adjustment, including:

[0125] In distributed training, when the conditions for updating the task environment are met, the worker nodes retrieve the updated task environment information from the environment storage space.

[0126] Based on the obtained updated task environment information, the training task process in the worker node is restarted online to obtain the environment-updated worker node.

[0127] Among them, the task environment update condition refers to the condition that triggers the update of the task environment corresponding to the node in distributed training.

[0128] Online restart refers to the process of restarting the training task in distributed training without stopping or interrupting the training process. For example, in this embodiment, online restart can be a hot restart. Unlike a cold restart, a hot restart is not limited to shutting down the application in the worker node; it can update the task environment corresponding to the worker node at runtime.

[0129] For example, when the task server receives a training task for a model to be trained, it can store the task environment information corresponding to the training task process of each worker node in the training task as a task image in a preset storage space (such as an image repository). Each worker node can contain a business container, which can be used to run the worker node's training task process (i.e., the business process). After the task environment information in the image repository changes, the business container of each worker node can mount the configuration file of the changed task image (i.e., the updated task environment information) obtained from the image repository and perform a hot restart, thus restarting the training task process in the new task image. The worker node after restarting the training task process depends on the new task image to participate in distributed training, and can be regarded as an environment-updated worker node.

[0130] Therefore, when the task environment information is updated, unlike the method of resubmitting the training task, this embodiment of the application releases the process memory by actively hot-restarting the training task process, thereby avoiding memory overflow (OOM) of the worker node. This method can support hot updates of the process, has a fast recovery speed, and can ensure the continuity and efficiency of the training process. It can be applied to online services and other scenarios with strict requirements for recovery speed.

[0131] In some implementations, modifications to the image environment in the environment storage space can trigger an update of the task environment to meet the task environment update conditions. For example, users can modify the task images corresponding to each business container stored in the image repository through an Application Programming Interface (API) or the task page. After the modified task image (i.e., the updated task environment information) passes verification, the updated task image information can be submitted to the resource object (such as a Job declaration) of the management worker node. When the controller module detects a change in the resource object (i.e., detects an update to the task image information), it triggers each worker node to restart online based on the updated task environment. That is, each worker node retrieves the updated task environment information from the environment storage space and restarts the training task process in each worker node online based on the retrieved updated task environment information, thus obtaining the environment-updated worker node. Thus, by constructing a task environment information sharing mechanism based on environment storage space, centralized management and real-time distribution of training environment configurations (such as code version, dependency libraries, hyperparameters, etc.) are achieved, ensuring the consistency of environment versions across nodes in the distributed cluster. More importantly, by allowing worker nodes to pull the new configuration and restarting the training task process online only when update conditions are met, lightweight hot updates at the software runtime environment level are achieved. This approach eliminates the need to restart or reschedule underlying computing nodes (such as physical machines or containers), greatly reducing the time overhead and resource consumption of environment iterations (such as bug fixing and parameter fine-tuning), thereby efficiently completing smooth upgrades of training logic or environment while maintaining the unchanged underlying computing resource occupancy state.

[0132] 140. Synchronize the shared communication configuration information to the adjusted working nodes, enabling the adjusted working nodes to automatically establish communication connections with other working nodes based on the synchronized shared communication configuration information, so as to participate in distributed training.

[0133] For example, when adjusting online nodes to obtain the adjusted worker nodes, the adjusted worker nodes can synchronize and share communication configuration information in real time to maintain communication consistency with other worker nodes. This allows the adjusted worker nodes to automatically establish communication connections with other worker nodes based on the shared communication configuration information, enabling them to immediately participate in the distributed training of the model to be trained. Part of the training tasks can be assigned to the adjusted worker nodes. It should be noted that by synchronizing and sharing communication configuration information to the adjusted worker nodes, the communication configuration between the adjusted worker nodes and other worker nodes is made consistent. This eliminates the need for repetitive and redundant communication configurations for each worker node separately, allowing worker nodes to automatically establish communication connections. Therefore, the node adjustment process is real-time and efficient, allowing the adjusted worker nodes to directly participate in training without downtime or stopping training tasks.

[0134] Therefore, in this embodiment, online node adjustment is performed when the node adjustment conditions are met, and the adjusted worker nodes synchronously share communication configuration information to ensure that the adjusted worker nodes can maintain communication consistency with other worker nodes. Through this mechanism, the adjusted worker nodes can automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information, enabling the adjusted worker nodes to instantly collaborate with other worker nodes in the distributed training process without downtime or stopping the training task. This ensures that node adjustment is efficient, dynamic, and stable, guaranteeing the continuity and efficiency of the training process.

[0135] In some implementations, the adjusted working node can be mounted to the shared configuration information so that the adjusted working node can obtain the shared communication configuration information through the mounting, thereby enabling the adjusted working node to synchronously share the communication configuration information.

[0136] In some implementations, after an online node change, the global worker node information can be updated based on the adjusted worker node to synchronize the latest global worker node information to all current worker nodes in real time. This ensures that all worker nodes participating in distributed training are using the latest and unified configuration, avoiding configuration conflicts or inconsistencies that may occur during training, and making communication between worker nodes more convenient and efficient. In some embodiments, the shared communication configuration information includes global worker node information. Synchronizing the shared communication configuration information to the adjusted worker node allows the adjusted worker node to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in distributed training, including:

[0137] Based on the node information of the changed worker nodes, update the global worker node information to obtain the updated global worker node information;

[0138] After synchronizing and updating the global worker node information, the changed worker node and other worker nodes are automatically connected to establish communication connections based on the synchronized and updated global worker node information, so as to participate in distributed training.

[0139] In some embodiments, when making online node changes to worker nodes, the controller module can collect the node identifiers of the adjusted worker nodes (such as replacing or adding worker nodes) in real time to dynamically update the node information configuration file (i.e., the global worker node information configuration file) in the resource object in real time. This enables all worker nodes (including changed worker nodes and other worker nodes) to update their node information configuration files instantly and dynamically when a node change occurs. This achieves unified dynamic global node information (hostfile) updates for all worker nodes, allowing changed worker nodes and other worker nodes to be aware of each other based on the updated node information configuration file. This effectively eliminates information silos between existing and newly added nodes. Communication connections are automatically established based on the synchronized updated global worker node information, achieving automated reconstruction of the underlying communication links. This significantly shortens the handshake and networking time after a node joins the cluster, improves the response speed and overall computational efficiency of the distributed training system when facing resource fluctuations, and enhances the immediacy of changed worker nodes participating in distributed training, enabling changed worker nodes to collaborate with other worker nodes in training without downtime or stopping training tasks.

[0140] For example, in the case of replacing abnormal worker nodes online, the updated global worker node information includes first node information. Based on the node information of the candidate nodes, the global worker node information is updated to obtain the updated global worker node information, including: replacing the node information of the abnormal worker node in the global worker node information with the node information of the replacement worker node to obtain the first node information. For example, the controller module can collect the node identifier of the replacement worker node in real time and replace the node identifier of the abnormal worker node in the node information configuration file of the resource object with the node identifier of the replacement worker node.

[0141] For example, in the case of adding new worker nodes online, the updated global worker node information includes second node information. Based on the node information of the candidate nodes, the global worker node information is updated to obtain the updated global worker node information, including: adding the node information of the new worker node to the global worker node information to obtain the second node information. For example, the controller module (Operator) can collect the node identifiers of the newly added worker nodes in real time and add the node identifiers of the newly added worker nodes sequentially to the node information configuration file of the resource object.

[0142] For example, in the case of removing a worker node, the updated global worker node information includes third-party node information. Based on the node information of the candidate nodes, the global worker node information is updated to obtain the updated global worker node information, including: removing the node information of the removed worker node from the global worker node information to obtain the third-party node information. For example, the controller module (Operator) can delete the node identifier of the removed worker node from the node information configuration file of the resource object. For example, when the scaling-down operation reduces the number of worker nodes to a preset number, the controller module can delete the node identifiers of the remaining worker nodes after the preset number in the node information configuration file to release the resources of these worker nodes.

[0143] In some implementations, after an online node change, communication verification information can be synchronized to the changed worker node in real time. This allows the changed worker node to immediately obtain shared communication configuration information consistent with other worker nodes, ensuring that it can participate in distributed training based on the communication verification information without downtime or stopping the training task. In some embodiments, the shared communication configuration information further includes communication verification information. Synchronizing the shared communication configuration information to the adjusted worker node enables the adjusted worker node to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in distributed training. It also includes: synchronizing communication verification information to the changed worker node, enabling the changed worker node to automatically establish communication connections with other worker nodes based on the synchronized communication verification information and the updated global worker node information to participate in distributed training.

[0144] For example, after making an online node change to a worker node, the changed worker node can attach real-time, dynamic synchronization communication verification information, so that the changed worker node can automatically communicate with other worker nodes without password, thereby improving the immediacy of the changed worker node's participation in distributed training, so that the changed worker node can directly participate in training without stopping the system or stopping the training task.

[0145] For example, after an online node change, the new worker node will re-execute the initialization command (such as `init_cmd`) and user command (such as `start_cmd`) upon startup. The initialization command will be executed immediately after the business container of the new worker node starts, enabling the new worker node to verify information and global worker node information through real-time, dynamic synchronization communication. The user command will be executed after confirming that other nodes are ready (i.e., initialization is complete) to begin distributed training. In practical applications, the environment initialization operation for the new worker node can also be placed in the initialization command to ensure that the newly added new worker node has a consistent task environment with the original worker nodes.

[0146] In some implementations, synchronous communication verification information is sent to the changed worker node, enabling the changed worker node to automatically establish communication connections with other worker nodes based on the synchronous communication verification information and the updated global worker node information to participate in distributed training. This includes: synchronously sending communication verification information to the changed worker node; using the changed worker node to locate other worker nodes based on the synchronous updated global worker node information; and using the changed worker node to perform passwordless login with the located other worker nodes based on the synchronous communication verification information, so that the changed worker node can automatically establish communication connections with other worker nodes based on the synchronous shared communication configuration information to participate in distributed training.

[0147] In some embodiments, the shared communication configuration information further includes communication method configuration information; the communication verification information includes a key configuration file, which includes a private key file, a public key file, and a public key authorization file; synchronizing the communication verification information to the changed working node, enabling the changed working node to automatically establish communication connections with other working nodes based on the synchronized communication verification information and the updated global working node information, includes: mounting the key configuration file and communication method configuration information to the changed working node to associate the access path of the key configuration file and the access path of the communication method configuration information with the changed working node; determining other working nodes besides the changed working node based on the updated global working node information; using the changed working node to obtain the private key file based on the access path of the key configuration file for authentication, and using other working nodes to authenticate the changed working node based on the public key in the public key authorization file, and automatically establishing a passwordless login communication connection based on the communication method configuration information.

[0148] In some embodiments, storage volume mapping rules for the change worker node can be predefined to map the key configuration files (including private key files, public key files, and public key authorization files) and communication configuration information (such as SSH client configuration) stored in the configuration center or key management system to the storage directory of the file system inside the change worker node container. During the startup initialization phase of the change worker node, the key configuration files and communication configuration information are projected to the specified directory through the file system mount operation, thereby establishing the absolute access path of the key configuration files (such as / root / .ssh / id_rsa) and the absolute access path of the communication configuration information (such as / etc / ssh / ssh_config) within the change worker node, so that the running process of the change worker node can directly read these configurations through the standard file I / O interface.

[0149] For example, when creating a Pod definition that changes the worker node, a Secret volume containing id_rsa and authorized_keys is declared and mounted to the / root / .ssh / directory, allowing programs to directly read the private key through this path.

[0150] When determining other worker nodes besides the changed worker node based on the updated global worker node information, the changed worker node reads the updated global worker node information injected into its runtime environment. This updated global worker node information contains the network identifiers of each worker node in the distributed cluster used to execute training tasks. The changed worker node obtains its own network identifier (such as its local IP address or hostname), traverses the updated global worker node information, and eliminates network identifiers that match its own network identifier through string matching or address comparison logic, thereby filtering out all remaining network identifiers. The worker nodes corresponding to these remaining network identifiers are marked as other worker nodes that need to establish connections.

[0151] For example, when a worker node reads the updated global worker node information as IP1, IP2, and IP3, and recognizes its own IP as IP3, it determines that IP1 and IP2 are other worker nodes.

[0152] The changed worker node invokes the SSH client program, reads the communication configuration information to load connection parameters (such as port and timeout), and loads the private key file as identity credentials through the access path of the key configuration file. The changed worker node initiates a connection request to the other determined worker nodes, sending authentication information signed by the private key during the handshake phase. After receiving the request, the other worker nodes access the locally mounted public key authorization file, retrieve the public key contained therein, and decrypt and verify the signature. After successful verification, both parties negotiate the session key and formally establish an encrypted communication channel (SSH Tunnel) that does not require manual password input, thus completing the establishment of the communication connection. In this way, by mounting the key configuration file and communication method configuration information to the changed worker node, the configuration data and node runtime are decoupled, ensuring that the changed worker node can obtain the latest authentication credentials without rebuilding the image when dynamically added. Asymmetric encryption authentication is performed using the private key file and public key authorization file, combined with the communication method configuration information, achieving fully automated passwordless login while ensuring high security of the communication link, eliminating the risks of manual intervention and plaintext password transmission. By combining the updated global worker node information for connection target screening, it is ensured that the changed worker node can accurately identify cluster topology changes and quickly integrate into the existing distributed network environment, improving the network reorganization efficiency and stability when the distributed training cluster is scaled up or down.

[0153] In this embodiment of the application, when the task environment information is updated, each working node itself will not change, that is, no new, replacement or deletion of working nodes will be added, and the shared communication configuration information will not be changed.

[0154] Therefore, in some implementations, when the task environment information is updated, the shared communication configuration information can be directly synchronized to the environment update worker node in real time. This allows the environment update worker node to immediately obtain the same shared communication configuration information as other worker nodes, ensuring that the environment update worker node can directly participate in training without downtime or stopping the training task. In some embodiments, the shared communication configuration information includes communication verification information and global worker node information. Synchronizing the shared communication configuration information to the adjusted worker node enables the adjusted worker node to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in distributed training, including:

[0155] Synchronize communication verification information and global worker node information to the environment update worker node, enabling the environment update worker node to automatically establish communication connections with other worker nodes based on the synchronized communication verification information and global worker node information, so as to participate in distributed training.

[0156] For example, when restarting the training task process in a worker node online, the environment update worker node can mount real-time, dynamic, and synchronized shared communication configuration information, so that the environment update worker node can automatically communicate with other worker nodes without passwords. This improves the immediacy of the change worker node participating in distributed training, allowing the change worker node to directly participate in training without downtime or stopping the training task.

[0157] In some implementations, synchronizing communication verification information and global worker node information to the environment update worker node enables the environment update worker node to automatically establish communication connections with other worker nodes based on the synchronized communication verification information and global worker node information to participate in distributed training. This includes: synchronizing communication verification information and global worker node information to the environment update worker node; using the environment update worker node to locate other worker nodes based on the synchronized updated global worker node information; and using the environment update worker node to perform passwordless login with the located other worker nodes based on the synchronized communication verification information, so that the environment update worker node can automatically establish communication connections with other worker nodes based on synchronized shared communication configuration information to participate in distributed training.

[0158] In some embodiments, when synchronizing communication verification information and global worker node information to the environment update worker node, the communication verification information and global worker node information can be mounted to the environment update worker node to associate the access paths of the communication verification information and global worker node information with the environment update worker node. Then, the environment update worker node reads the updated global worker node information injected into its runtime environment. This updated global worker node information contains the network identifiers of each worker node in the distributed cluster used to execute training tasks. The environment update worker node obtains its own network identifier (such as its local IP address or hostname), traverses the updated global worker node information, and eliminates network identifiers that match its own network identifier through string matching or address comparison logic, thereby filtering out all remaining network identifiers. The worker nodes corresponding to these remaining network identifiers are marked as other worker nodes that need to establish connections. Finally, the environment update worker node authenticates with other worker nodes based on the communication verification information. After successful authentication, both parties negotiate a session key and formally establish an encrypted communication channel that does not require manual password input, thus completing the establishment of the communication connection.

[0159] In the above embodiments, by synchronizing communication verification information and global worker node information to the worker nodes after the environment update, dual protection of identity authentication and communication addressing is achieved during node reconnection: the communication verification information ensures the security and legitimacy of the updated node when reconnecting to the distributed network, preventing unauthorized access; the global worker node information ensures that the node can accurately know the latest network topology and peer address of the current cluster. This mechanism enables nodes that have undergone environment updates (such as process restarts) to automatically establish communication connections with other worker nodes without relying on complex external configuration distribution or manual intervention. This achieves a rapid and smooth switch from the environment change state to the training state, ensuring seamless reorganization and task continuation of the distributed training cluster after environment iteration.

[0160] The node adjustment scheme based on distributed training provided in this application can be applied to various distributed training scenarios. The model parameters of the model to be trained are deployed on worker nodes in a distributed cluster. Using these worker nodes, distributed training of the model to be trained is performed based on shared communication configuration information. This shared communication configuration information is used to maintain communication consistency between worker nodes, enabling them to automatically establish communication connections. During distributed training, when node adjustment conditions are met, adjusted worker nodes are obtained through online node adjustment. The shared communication configuration information is synchronized to the adjusted worker nodes, allowing them to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in distributed training.

[0161] As can be seen from the above, in distributed training, this embodiment of the application maintains communication consistency among worker nodes based on shared communication configuration information, enabling worker nodes to automatically establish communication connections. Thus, when node adjustment conditions are met, online node adjustment is performed, and the adjusted worker nodes synchronously share communication configuration information, ensuring that the adjusted worker nodes can maintain communication consistency with other worker nodes. Through this mechanism, the adjusted worker nodes can automatically establish communication connections with other worker nodes based on synchronized shared communication configuration information, enabling the adjusted worker nodes to instantly collaborate with other worker nodes in the distributed training process without downtime or stopping the training task. This ensures efficient, dynamic, and stable node adjustment, guaranteeing the continuity and efficiency of the training process.

[0162] The method described in the above embodiments will be further described in detail below.

[0163] In this embodiment, the method of this application embodiment will be described in detail using an application to a distributed training system as an example.

[0164] As shown in Figure 2a, the implementation process of a node adjustment method based on distributed training is as follows:

[0165] 210. Deploy the model parameters of the model to be trained on the worker nodes of the distributed cluster.

[0166] 220. Using worker nodes, perform distributed training on the model to be trained based on shared communication configuration information. The shared communication configuration information includes communication verification information and global worker node information. The shared communication configuration information is used to maintain communication consistency between worker nodes so that communication connections can be automatically established between worker nodes based on the shared communication configuration information.

[0167] For example, embodiments of this application can be applied to distributed training systems, whose underlying layer can be a multi-cluster container orchestration service based on an open-source container orchestration platform (such as Kubernetes). This distributed training system can have three node adjustment functions (i.e., three efficiency-enhancing tools): node fault tolerance, dynamic scaling, and dynamic image replacement. The distributed training system, in conjunction with the AngelPTM framework, achieves fully automated implementation of these three functions, minimizing the time required for online node adjustment in training tasks and playing a crucial role in large-scale training scenarios.

[0168] Figure 2b illustrates node adjustment during the training lifecycle of the model to be trained. In a buffered machine scenario, this distributed training system uses nodes 0, 1, 2, and 3 for distributed training of the model. Afterward, node 2 becomes an abnormal worker node, which is replaced online. When the node addition condition is met, nodes 5 and 6 are added online to participate in distributed training. When the node removal condition is met, nodes 4, 5, and 6 are removed, leaving nodes 0, 1, and 2 as the worker nodes participating in distributed training. When the task environment update condition is met, the training task processes in nodes 0, 1, and 2 are restarted online to update the task environment information, resulting in an updated worker node. Throughout the large model training cycle, efficiency-enhancing tools such as online replacement, online addition, and online removal are used. In actual training, these tools can be used alternately multiple times to achieve a fully automated, flexible training process for large models.

[0169] Specifically, unified passwordless adaptation and unified dynamic global node information (hostfile) updates are achieved through communication verification information and global worker node information, respectively, so that worker nodes can automatically communicate and connect.

[0170] 231. In distributed training, when the node change conditions are met, online node change is performed based on the idle nodes of the distributed cluster to obtain the changed working node.

[0171] 232. Based on the node information of the changed working nodes, update the global working node information to obtain the updated global working node information.

[0172] 233. Synchronize and update the global worker node information to the changed worker node and other worker nodes, and synchronize the communication verification information to the changed worker node, so that the changed worker node can automatically establish communication connections with other worker nodes based on the synchronized communication verification information and the updated global worker node information to participate in distributed training.

[0173] For example, online node changes can include online replacement (i.e., node fault tolerance) and online addition / removal (i.e., dynamic scaling up and down). As shown in the node adjustment diagram in Figure 2b, if node 2 fails, it can be replaced online by an idle node, or an idle node 5 can be added as a new working node according to the scaling up request, or nodes 4 to 6 can be removed online according to the scaling down request.

[0174] Node fault tolerance refers to dynamically replacing a faulty worker node when it fails, while leaving other worker nodes unaffected. For example, in a distributed training system, if fault tolerance is enabled when submitting a task, it will be triggered when the main process of a node in the task exits abnormally (exit code non-zero). The platform will then delete the node and reschedule a new one. After fault tolerance is triggered and the node is replaced online, the node IP address in the node information configuration file ( / etc / hostfile) can be replaced accordingly. Once the node replacement is complete, the above configuration files for all nodes will be automatically updated. When node fault tolerance occurs, unaffected nodes (i.e., other worker nodes) can read the file / etc / hostfile to obtain the latest node information. If environment variables are needed, the environment variables for the current session need to be updated by executing `source / etc / environ`.

[0175] Dynamic scaling refers to dynamically adjusting the number of worker nodes in distributed training, adding or removing new worker nodes from the existing set. In dynamic scaling, based on unified passwordless adaptation and unified dynamic global node information updates, newly replaced nodes can seamlessly collaborate with other nodes in the task. Based on the same principle, dynamic scaling also becomes possible. In scaling scenarios, newly added nodes can interact with other nodes without passwords, and dynamic global node information allows other nodes to perceive the new nodes. In scaling scenarios, although passwordless adaptation is not required, dynamic global node information allows the remaining nodes to perceive the node changes.

[0176] 241. In distributed training, when the conditions for updating the task environment are met, the worker nodes are used to retrieve the updated task environment information from the environment storage space.

[0177] 242. Based on the obtained updated task environment information, restart the training task process in the worker node online to obtain the environment update worker node.

[0178] 243. Synchronize communication verification information and global worker node information to the environment update worker node, enabling the environment update worker node to automatically establish communication connections with other worker nodes based on the synchronized communication verification information and global worker node information, so as to participate in distributed training.

[0179] For example, as shown in Figure 2b, when updating the training task environment, the task environment of all current working nodes (nodes 0 to 3) can be updated to achieve dynamic image replacement. Dynamic image replacement refers to replacing the image with a new one in distributed training, with the process restarting in place.

[0180] In the distributed training system of this application embodiment, the basic unit of task scheduling, i.e., a node, is called a pod, and a pod contains a business container. Based on the principles of container technology, when the image corresponding to the business container in a running pod is modified, the pod itself will not be rescheduled, i.e., the network configuration such as IP remains unchanged. The business container will be restarted after pulling the new container, which is equivalent to restarting the business process in the new environment. Using this capability, the business side can realize dynamic environment updates and in-situ restarts of tasks. Environment updates are generally used in scenarios where libraries used by task execution are updated, similar to replacing the tires of a high-speed race car with better ones. The ability to actively hot-restart tasks can be used to release process memory, avoid node OOM (Out of Memory) errors, and perform hot service updates. Unlike resubmitting tasks, this method has the characteristics of fast recovery speed and unchanged node IP, which can meet the requirements of demanding online service scenarios.

[0181] It should be noted that since images with the same name do not trigger container updates, in scenarios where only a process restart or environment refresh is desired, different tag versions of the same image (i.e., marked with different version numbers) can be used to perform the image replacement process. Container restarts implemented through image replacement will stop the currently running program; users need to ensure that the process can be terminated. Meanwhile, the startup parameters and configuration information of the newly started process will not change. If logic involving state saving and restoration is required, the business logic needs to be adapted through development. Furthermore, since the image has been replaced, the runtime environment is theoretically updated; some data and operations requiring persistence need to be implemented using persistent storage methods.

[0182] As can be seen from the above, the embodiments of this application rely on unified passwordless adaptation and unified dynamic global node information updates, enabling adjusted worker nodes to automatically communicate and connect with other worker nodes to seamlessly adjust / enable new containers, allowing all worker nodes in distributed training to collaborate seamlessly. In some embodiments, the embodiments of this application maintain communication consistency between worker nodes based on shared communication configuration information during distributed training, enabling worker nodes to automatically establish communication connections. Thus, online node adjustment is performed when node adjustment conditions are met, and the adjusted worker nodes synchronously share communication configuration information to ensure that the adjusted worker nodes can maintain communication consistency with other worker nodes. Through this mechanism, adjusted worker nodes can automatically establish communication connections with other worker nodes based on synchronized shared communication configuration information, enabling the adjusted worker nodes to instantly collaborate with other worker nodes in the distributed training process without downtime or stopping the training task. This ensures efficient, dynamic, and stable node adjustment, guaranteeing the continuity and efficiency of the training process.

[0183] To better implement the above methods, this application also provides a node adjustment device based on distributed training. This node adjustment device can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, or personal computer; the server can be a single server or a server cluster composed of multiple servers.

[0184] For example, in this embodiment, the method of this application embodiment will be described by taking the integration of a node adjustment device based on distributed training into a server as an example.

[0185] For example, as shown in Figure 3, the node adjustment device based on distributed training may include a deployment unit 310, a training unit 320, an adjustment unit 330, and a synchronization unit 340, as follows:

[0186] Deployment unit 310 is configured to deploy the model parameters of the model to be trained on the worker nodes of a distributed cluster. The worker nodes automatically establish communication connections based on shared communication configuration information, which is used to maintain communication consistency between the worker nodes. Training unit 320 is configured to use the worker nodes to perform distributed training on the model to be trained based on the shared communication configuration information, which is used to maintain communication consistency between the worker nodes, enabling the worker nodes to automatically establish communication connections based on the shared communication configuration information. Adjustment unit 330 is configured to, during the distributed training of the model to be trained, obtain adjusted worker nodes through online node adjustment when node adjustment conditions are met.

[0187] In some implementations, the node adjustment conditions include node change conditions, the adjusted working node includes the changed working node, and the adjustment unit includes a first adjustment subunit, which is configured to perform online node change based on the idle nodes of the distributed cluster when the node change conditions are met during the distributed training of the model to be trained, thereby obtaining the changed working node.

[0188] In some implementations, node change conditions include node abnormality conditions, and changing a worker node includes replacing a worker node. The first adjustment subunit is configured as follows: in distributed training, when any worker node meets the node abnormality condition, an idle node of the distributed cluster is used to replace the abnormal worker node online, so that the idle node is used as the replacement worker node for the abnormal worker node, and the abnormal worker node is a worker node that meets the node abnormality condition.

[0189] In some implementations, the node adjustment device based on distributed training further includes a shielding unit, which is configured to: perform node release processing on abnormal working nodes; and add a shielding flag to the abnormal working nodes after the release processing, the shielding flag being used to indicate that the abnormal working nodes after the release processing are in a state that cannot be used to replace abnormal working nodes online.

[0190] In some implementations, node change conditions include node addition conditions, and changing a working node includes adding a new working node. The first adjustment subunit is configured as follows: in distributed training, when the node addition conditions are met, the idle nodes of the distributed cluster are added online as new working nodes.

[0191] In some implementations, the node adjustment device based on distributed training further includes a change detection unit. The change detection unit is configured to: trigger a node change detection task when the node change conditions are met; the node change detection task includes node information variables; the node change detection task is used to detect the completion status of online node changes based on the node information variables; set the value of the node information variables to empty to wait for the node information variables to be assigned a value based on the node information of the changed working node; when the value of the node information variables has a value, end the node change detection task and confirm that the online node change has been completed.

[0192] In some implementations, the node adjustment device based on distributed training further includes an environment storage unit, which is configured to store the task environment information of distributed training in the environment storage space. The task environment information is the information of the running environment of the training task process in the worker node.

[0193] In some implementations, the node adjustment conditions include task environment update conditions, the adjusted working node includes an environment-updated working node, and the adjustment unit includes a second adjustment subunit, which is configured to, in distributed training, when the task environment update conditions are met, use the working node to obtain updated task environment information from the environment storage space; and restart the training task process in the working node online based on the obtained updated task environment information to obtain the environment-updated working node.

[0194] In some implementations, the synchronization unit 340 is configured to synchronize shared communication configuration information to the adjusted working node, so that the adjusted working node can automatically establish communication connections with other working nodes based on the synchronized shared communication configuration information to participate in distributed training.

[0195] In some implementations, the shared communication configuration information includes global worker node information, and the synchronization unit includes an update subunit and a synchronization subunit. The update subunit is configured to update the global worker node information based on the node information of the changed worker node to obtain the updated global worker node information. The synchronization subunit is configured to synchronize the updated global worker node information to the changed worker node and other worker nodes, so that the changed worker node and other worker nodes automatically establish communication connections based on the synchronized updated global worker node information to participate in distributed training.

[0196] In some implementations, the updated global working node information includes first node information, and the updating subunit includes a replacement subunit, which is configured to use the node information of the replacement working node to replace the node information of the abnormal working node in the global working node information to obtain the first node information.

[0197] In some implementations, the updated global working node information includes second node information, and the updated sub-unit includes a newly added sub-unit, which adds node information of the working node to the global working node information to obtain the second node information.

[0198] In some implementations, the synchronization subunit is further configured to: synchronize communication verification information to the changed worker node, enabling the changed worker node to automatically establish communication connections with other worker nodes based on the synchronized communication verification information and the updated global worker node information, so as to participate in distributed training.

[0199] In some implementations, the shared communication configuration information further includes communication method configuration information; the communication verification information includes a key configuration file, which includes a private key file, a public key file, and a public key authorization file; the synchronization subunit is further configured to: mount the key configuration file and the communication method configuration information to the changed working node, so as to associate the access path of the key configuration file and the access path of the communication method configuration information with the changed working node; determine other working nodes besides the changed working node based on the updated global working node information; use the changed working node to obtain the private key file based on the access path of the key configuration file for authentication, and use other working nodes to authenticate the changed working node based on the public key in the public key authorization file, and automatically establish a passwordless login communication connection based on the communication method configuration information.

[0200] In some implementations, the shared communication configuration information includes communication verification information and global worker node information. The synchronization subunit is configured to synchronize the communication verification information and global worker node information to the environment update worker node, so that the environment update worker node can automatically establish communication connections with other worker nodes based on the synchronized communication verification information and global worker node information to participate in distributed training.

[0201] In some implementations, the synchronization unit 340 is further configured to: in response to receiving a training task for the model to be trained, determine the working node corresponding to the training task from the distributed cluster; determine the shared communication configuration information corresponding to the training task; and synchronize the shared communication configuration information to the working node.

[0202] In some implementations, the synchronization unit 340 is further configured to: mount the shared communication configuration information to the working node; and use the working node to obtain the shared communication configuration information through mounting, so that the working node can synchronize the shared communication configuration information.

[0203] In some implementations, the node adjustment device based on distributed training also includes a storage unit configured to store shared communication configuration information in a preset storage space.

[0204] In some real-time modes, the synchronization unit 340 is also configured to: associate the storage path of the shared communication configuration information in the preset storage space with the working node; and use the working node to obtain the shared communication configuration information from the preset storage space through the storage path.

[0205] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For specific implementation of each of the above units, please refer to the previous method embodiments.

[0206] As can be seen from the above, the node adjustment device based on distributed training in this embodiment may include a deployment unit, a training unit, an adjustment unit, and a synchronization unit. The deployment unit is configured to deploy the model parameters of the model to be trained on the worker nodes of the distributed cluster; the training unit is configured to use the worker nodes to perform distributed training on the model to be trained based on shared communication configuration information, which is used to maintain communication consistency between worker nodes so that worker nodes can automatically establish communication connections based on the shared communication configuration information; the adjustment unit is configured to obtain adjusted worker nodes through online node adjustment when node adjustment conditions are met during distributed training; and the synchronization unit is configured to synchronize the shared communication configuration information to the adjusted worker nodes, so that the adjusted worker nodes can automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in distributed training.

[0207] Therefore, in this embodiment of the application, during distributed training, communication consistency among worker nodes is maintained based on shared communication configuration information, enabling automatic establishment of communication connections between worker nodes. Thus, online node adjustment is performed when node adjustment conditions are met, and the adjusted worker nodes synchronously share the same communication configuration information, ensuring that the adjusted worker nodes can maintain communication consistency with other worker nodes. Through this mechanism, the adjusted worker nodes can automatically establish communication connections with other worker nodes based on synchronized shared communication configuration information, enabling them to immediately collaborate with other worker nodes in the distributed training process without downtime or stopping the training task. This ensures efficient, dynamic, and stable node adjustment, guaranteeing the continuity and efficiency of the training process.

[0208] This application also provides an electronic device, which can be a terminal, a server, or other similar device. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers, etc.

[0209] In some embodiments, the node adjustment device based on distributed training can also be integrated into multiple electronic devices. For example, the node adjustment device based on distributed training can be integrated into multiple servers, and the node adjustment method based on distributed training of this application can be implemented by multiple servers.

[0210] In this embodiment, a server will be used as an example for detailed description. For instance, as shown in Figure 4, a schematic diagram of the server structure involved in this application embodiment is presented:

[0211] The server may include components such as a processor 410 with one or more processing cores, a memory 420 with one or more computer-readable storage media, a power supply 430, an input module 440, and a communication module 450. Those skilled in the art will understand that the server structure shown in Figure 4 does not constitute a limitation on the server, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0212] Processor 410 is the control center of the server, connecting various parts of the server via various interfaces and lines. It performs various server functions and processes data by running or executing software programs and / or modules stored in memory 420, and by calling data stored in memory 420. In some embodiments, processor 410 may include one or more processing cores; in some embodiments, processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 410.

[0213] The memory 420 can be used to store software programs and modules. The processor 410 executes various functional applications and data processing by running the software programs and modules stored in the memory 420. The memory 420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 420 may also include a memory controller to provide the processor 410 with access to the memory 420.

[0214] The server also includes a power supply 430 that supplies power to the various components. In some embodiments, the power supply 430 can be logically connected to the processor 410 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 430 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0215] The server may also include an input module 440, which can be used to receive input numeric or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0216] The server may also include a communication module 450. In some embodiments, the communication module 450 may include a wireless module, through which the server can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication module 450 can be used to help users send and receive emails, browse web pages, and access streaming media.

[0217] Although not shown, the server may also include a display unit, etc. In this embodiment, the processor 410 in the server loads the executable files corresponding to the processes of one or more applications into the memory 420 according to the following instructions, and the processor 410 runs the applications stored in the memory 420 to realize various functions, as follows:

[0218] The model parameters of the model to be trained are deployed on worker nodes of a distributed cluster. Worker nodes automatically establish communication connections based on shared communication configuration information, which is used to maintain communication consistency among worker nodes. Using worker nodes, the model to be trained is trained in a distributed manner based on the shared communication configuration information. During the distributed training of the model to be trained, when the node adjustment conditions are met, the adjusted worker nodes are obtained through online node adjustment. The shared communication configuration information is synchronized to the adjusted worker nodes, enabling the adjusted worker nodes to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information in order to participate in distributed training.

[0219] For details on the implementation of each of the above operations, please refer to the preceding examples.

[0220] As can be seen from the above, in this embodiment of the application, during distributed training, communication consistency between worker nodes is maintained based on shared communication configuration information, enabling worker nodes to automatically establish communication connections. Thus, when node adjustment conditions are met, online node adjustment is performed, and the adjusted worker nodes synchronously share communication configuration information to ensure that the adjusted worker nodes can maintain communication consistency with other worker nodes. Through this mechanism, the adjusted worker nodes can automatically establish communication connections with other worker nodes based on synchronized shared communication configuration information, enabling the adjusted worker nodes to instantly collaborate with other worker nodes in the distributed training process without downtime or stopping the training task. This ensures that node adjustment is efficient, dynamic, and stable, guaranteeing the continuity and efficiency of the training process.

[0221] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0222] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the node adjustment methods based on distributed training provided in embodiments of this application. For example, the instructions can execute the following steps:

[0223] The model parameters of the model to be trained are deployed on worker nodes of a distributed cluster. Using these worker nodes, distributed training of the model is performed based on shared communication configuration information. This shared communication configuration information is used to maintain communication consistency between worker nodes, enabling them to automatically establish communication connections. During distributed training, when node adjustment conditions are met, adjusted worker nodes are obtained through online node adjustment. The shared communication configuration information is synchronized to the adjusted worker nodes, allowing them to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in distributed training.

[0224] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0225] According to one aspect of this application, a computer program product or computer program is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the methods provided in the various optional implementations of the above embodiments. The computer program / instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer program / instructions from the computer-readable storage medium and executes the computer program / instructions, causing the electronic device to perform the methods provided in the various optional implementations of the above embodiments.

[0226] Since the instructions stored in the storage medium can execute the steps of any of the node adjustment methods based on distributed training provided in the embodiments of this application, the beneficial effects that any of the node adjustment methods based on distributed training provided in the embodiments of this application can achieve can be realized, as detailed in the foregoing embodiments.

[0227] The above provides a detailed description of a node adjustment method and related equipment based on distributed training provided in the embodiments of this application. Specific examples are used in the embodiments of this application to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A node adjustment method based on distributed training, applied to electronic devices, comprising: The model parameters of the model to be trained are deployed on the worker nodes of a distributed cluster. The worker nodes automatically establish communication connections based on shared communication configuration information, which is used to maintain communication consistency between the worker nodes. Using the working nodes, the model to be trained is trained in a distributed manner based on the shared communication configuration information; During the distributed training of the model to be trained, when the node adjustment conditions are met, the adjusted working nodes are obtained through online node adjustment. The shared communication configuration information is synchronized to the adjusted working node, enabling the adjusted working node to automatically establish communication connections with other working nodes based on the synchronized shared communication configuration information, so as to participate in the distributed training.

2. The method of claim 1, wherein, Before performing distributed training of the model to be trained using the working node based on shared communication configuration information, the method further includes: In response to receiving a training task for the model to be trained, the worker node corresponding to the training task is determined from the distributed cluster; Determine the shared communication configuration information corresponding to the training task; The shared communication configuration information is synchronized to the working nodes, and the working nodes automatically establish communication connections based on the shared configuration information.

3. The method of claim 1 or 2, wherein, The step of synchronizing the shared communication configuration information to the working node includes: The shared communication configuration information is attached to the working node; The shared communication configuration information is obtained by mounting the working node, so that the working node can synchronize the shared communication configuration information.

4. The method of claim 1 to 3, wherein, Before synchronizing the shared communication configuration information to the working node, the method further includes: storing the shared communication configuration information in a preset storage space; The step of attaching the shared communication configuration information to the working node includes: Associate the storage path of the shared communication configuration information in the preset storage space with the working node; The step of obtaining the shared communication configuration information by mounting the working node includes: The shared communication configuration information is obtained from the preset storage space through the storage path using the working node.

5. The method of claim 1 to 4, wherein, The node adjustment conditions include node change conditions, and the adjusted working nodes include changed working nodes. During the distributed training of the model to be trained, when the node adjustment conditions are met, the adjusted working nodes are obtained through online node adjustment, including: During the distributed training of the model to be trained, when the node change condition is met, online node change is performed based on the idle nodes of the distributed cluster to obtain the changed working node; The shared communication configuration information includes global worker node information. Synchronizing the shared communication configuration information to the adjusted worker nodes, enabling the adjusted worker nodes to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in the distributed training, includes: Based on the node information of the changed working node, the global working node information is updated to obtain the updated global working node information; The updated global worker node information is synchronized to the changed worker node and other worker nodes, enabling the changed worker node and other worker nodes to automatically establish communication connections based on the synchronized updated global worker node information in order to participate in the distributed training.

6. The method of claim 1 to 5, wherein, The node change conditions include node anomaly conditions, and the changed worker node includes replacing the worker node. In the distributed training, when the node change conditions are met, online node change is performed based on the idle nodes of the distributed cluster to obtain the changed worker node, including: During the distributed training of the model to be trained, when any of the worker nodes meets the node abnormality condition, the idle node of the distributed cluster is used to replace the abnormal worker node online, so that the idle node is used as the replacement worker node of the abnormal worker node, and the abnormal worker node is the worker node that meets the node abnormality condition. The updated global worker node information includes first node information. The step of updating the global worker node information based on the node information of the changed worker node to obtain the updated global worker node information includes: The node information of the abnormal working node in the global working node information is replaced by the node information of the replacement working node to obtain the first node information.

7. The method of claim 1 to 6, wherein, During the distributed training of the model to be trained, when the node change condition is met, online node change is performed based on the idle nodes of the distributed cluster to obtain the changed working node, which further includes: Perform node release processing on the abnormal working node; A masking identifier is added to the abnormal working node after the release process. The masking identifier is used to indicate that the abnormal working node after the release process is in a state that cannot be used to replace the working node online.

8. The method of claim 1 to 7, wherein, The node change conditions include node addition conditions, and the changed working node includes adding a new working node. During the distributed training of the model to be trained, when the node change conditions are met, online node changes are performed based on the idle nodes of the distributed cluster to obtain the changed working node, including: During the distributed training of the model to be trained, when the node addition condition is met, the idle nodes of the distributed cluster are added online as the new working nodes. The updated global working node information includes second node information. The step of updating the global working node information based on the node information of the candidate nodes to obtain the updated global working node information includes: The node information of the newly added working node is added to the global working node information to obtain the second node information.

9. The method of claim 1 to 8, wherein, The process of distributed training of the model to be trained, when the node adjustment conditions are met, involves obtaining adjusted working nodes through online node adjustment, and further includes: When the node change conditions are met, a node change detection task is triggered. The node change detection task includes node information variables and is used to detect the completion status of the online node change based on the node information variables. The value of the node information variable is set to empty in order to wait for the node information variable to be assigned a value based on the node information of the changed working node; When the value of the node information variable is not empty, the node change detection task ends, confirming that the online node change has been completed.

10. The method of claim 1 to 9, wherein, The shared communication configuration information also includes communication verification information. Synchronizing the shared communication configuration information to the adjusted working nodes, enabling the adjusted working nodes to automatically establish communication connections with other working nodes based on the synchronized shared communication configuration information to participate in the distributed training, further includes: The communication verification information is synchronized to the changed worker node, enabling the changed worker node to automatically establish communication connections with other worker nodes based on the synchronized communication verification information and the updated global worker node information, so as to participate in the distributed training.

11. The method of claim 1 to 10, wherein, The shared communication configuration information also includes communication method configuration information; the communication verification information includes a key configuration file, which includes a private key file, a public key file, and a public key authorization file. The step of synchronizing the communication verification information to the changed working node, enabling the changed working node to automatically establish communication connections with other working nodes based on the synchronized communication verification information and the updated global working node information, includes: The key configuration file and the communication method configuration information are mounted to the change working node to associate the access path of the key configuration file and the access path of the communication method configuration information with the change working node; Based on the updated global working node information, determine the other working nodes besides the changed working node; The changed working node uses the access path of the key configuration file to obtain the private key file for authentication, and other working nodes use the public key in the public key authorization file to authenticate the changed working node, and automatically establish the communication connection for passwordless login based on the communication method configuration information.

12. The method of claim 1 to 11, wherein, Before performing distributed training of the model to be trained using the working node based on shared communication configuration information, the method further includes: The task environment information of the distributed training is stored in the environment storage space, and the task environment information is the running environment information of the training task process in the worker node; The node adjustment conditions include task environment update conditions, and the adjusted working nodes include environment-updated working nodes. During the distributed training of the model to be trained, when the node adjustment conditions are met, the adjusted working nodes are obtained through online node adjustment, including: During the distributed training of the model to be trained, when the task environment update condition is met, the updated task environment information is obtained from the environment storage space using the working node. Based on the obtained updated task environment information, the training task process in the working node is restarted online to obtain the environment update working node.

13. The method of claim 1 to 12, wherein, The shared communication configuration information includes communication verification information and global worker node information. Synchronizing the shared communication configuration information to the adjusted worker nodes, enabling the adjusted worker nodes to automatically establish communication connections with other worker nodes based on the synchronized shared communication configuration information to participate in the distributed training, includes: The communication verification information and the global worker node information are synchronized to the environment update worker node, enabling the environment update worker node to automatically establish communication connections with other worker nodes based on the synchronized communication verification information and the global worker node information, so as to participate in the distributed training.

14. A node adjustment device based on distributed training, comprising: The deployment unit is configured to deploy the model parameters of the model to be trained on the worker nodes of a distributed cluster. The worker nodes automatically establish communication connections based on shared communication configuration information, which is used to maintain communication consistency between the worker nodes. The training unit is configured to use the working node to perform distributed training on the model to be trained based on the shared communication configuration information. The adjustment unit is configured to, during the distributed training of the model to be trained, obtain the adjusted working node through online node adjustment when the node adjustment conditions are met. The synchronization unit is configured to synchronize the shared communication configuration information to the adjusted working node, so that the adjusted working node can automatically establish communication connections with other working nodes based on the synchronized shared communication configuration information to participate in the distributed training.

15. An electronic device comprising a processor and a memory, the memory storing a plurality of instructions; the processor loading instructions from the memory to perform steps in the node adjustment method based on distributed training as claimed in any one of claims 1 to 13.

16. A computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps of the node adjustment method based on distributed training according to any one of claims 1 to 13.

17. A computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of the node adjustment method based on distributed training as described in any one of claims 1 to 13.