Model file migration method, product, device and medium based on distributed system
By monitoring the migration status of computing nodes in a distributed system, the problem of asynchronous migration failure of multiple nodes in large model training is solved, and the consistency management of model files and the stability of training tasks are achieved.
Patent Information
- Application Number
- CN202410777175.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-17
AI Technical Summary
In large model training scenarios, when tensor parallelism or pipeline parallelism is used, when multiple computing nodes asynchronously move model files to shared storage, some nodes may be successfully moved and some may fail, causing the training framework to fail to load or infer. fail.
By establishing a communication connection between the first computing node and the second computing node in the distributed system, receiving and analyzing the relocation status information generated by the second computing node during the relocation process, determining whether all nodes have successfully completed the relocation, and setting the target model The file migration status is success or failure, and the shared storage is cleaned and the training task is terminated when necessary.
It achieves consistency management of model files, avoids loading failures and inference failures of the training framework, and ensures the integrity of model files and the stability of training tasks.
Smart Images

Figure CN118349534B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data migration, and in particular to a model file migration method based on a distributed system, a computer program product, an electronic device and a non-volatile computer-readable storage medium. Background Art
[0002] When algorithm personnel conduct AI (Artificial Intelligence) training, they usually put the model files in shared storage. However, there are many optimization measures currently, which are to save the model files to the local cache directory first, and then asynchronously move them to the shared storage, thereby reducing the time spent on saving the model files and reducing the GPU (Graphics Processing Unit) idle time. The existing optimization process includes the following steps:
[0003] a) Adjust the model code. The training framework writes the model file to the local disk directory. At this time, the training process is blocked in the writing stage.
[0004] b) Start an asynchronous process to move the model files in the local disk directory to the shared storage. At this time, the training process runs normally and a new round of iterative calculation is performed;
[0005] For AI training, a single GPU is usually sufficient to load the entire model for small model training tasks, so the model file only needs to be saved on one computing node and then asynchronously moved to shared storage. However, for large model training scenarios, tensor parallelism, pipeline parallelism, and data parallelism are usually used for multi-machine and multi-card training.
[0006] Among them, tensor parallelism is to split the tensors of each layer of the model and distribute them to different GPUs for asynchronous movement; pipeline parallelism is to put different layers of the model into different GPUs for asynchronous movement.
[0007] When using tensor parallelism or pipeline parallelism, there will be multiple data parallel groups; there are multiple computing nodes in a data parallel group, each computing node stores part of the model information. When persisting the model file, the computing node of the first data parallel group is usually selected for model persistence. Each computing node in the first data parallel group is responsible for writing the model file in its video memory to the storage, and then using the current optimization mechanism for local writing.
[0008] When asynchronously moving to shared storage, multiple computing nodes asynchronously write model files to the local disk directory. The training framework ensures that the model files written to the local by each computing node are the same version based on its own communication mechanism. However, when moving model files from the local disk directory to shared storage, since multiple independent asynchronous processes are used for the move, some computing nodes may succeed in the move while others may fail to do so due to reasons such as the move speed, storage network problems, and storage space. If the training framework directly retrieves model files from shared storage for training, problems such as loading failure and inference failure may occur. Summary of the invention
[0009] In view of the above problems, a model file migration method based on a distributed system, a computer program product, an electronic device and a non-volatile computer-readable storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:
[0010] A model file migration method based on a distributed system, the distributed system comprising a first computing node and at least one second computing node, the method being applied to the first computing node, the method comprising:
[0011] Establishing a communication connection with the second computing node, and receiving, through the communication connection, at least one piece of migration status information generated by the second computing node when migrating a subfile of the target model file;
[0012] Determining whether the second computing node has successfully completed the migration according to all the migration status information sent by the second computing node;
[0013] When it is determined that all the second computing nodes have successfully completed the migration, setting the migration of the target model file to be successful;
[0014] When it is determined that there is a second computing node whose migration fails, the migration of the target model file is set to fail.
[0015] Optionally, establishing a communication connection with the second computing node includes:
[0016] Determining first connection information of the first computing node;
[0017] The first connection information is written into the target shared storage path; the second computing node establishes the communication connection with the first computing node according to the first connection information in the target shared storage path.
[0018] Optionally, the first connection information includes at least one of the following information:
[0019] Internet Protocol address information of the first computing node and port information of the first computing node.
[0020] Optionally, the setting that the target model file is moved successfully includes:
[0021] The target file identifier of the target model file is stored in the shared storage.
[0022] Optionally, the first computing node and the second computing node are used to move the subfile of the target model file to a shared storage, the moving status information includes shared storage shortage information, and when the first computing node receives the shared storage shortage information, the method further includes:
[0023] Determine other model files stored in the shared storage whose versions are earlier than the target model file;
[0024] When the number of the other model files in the shared storage is greater than a first preset value, clearing the other model files of a second preset value;
[0025] When the number of the other model files in the shared storage is not greater than the first preset value, an instruction to stop the training task corresponding to the target model file is issued.
[0026] Optionally, the migration status information includes heartbeat information, and the method further includes:
[0027] If the heartbeat information of the second computing node is not received within the preset time period, it is determined that the migration of the second computing node has failed.
[0028] Optionally, the migration status information includes migration success information, and the method includes:
[0029] When the migration success information is received, it is determined that the migration of the second computing node is successfully completed.
[0030] Optionally, the moving status information includes moving abnormality information, and the method includes:
[0031] When the migration exception information is received, it is determined that the second computing node fails to migrate the sub-file.
[0032] Optionally, the distributed system is provided with a target queue, and the target queue is used to store the model file to be moved. The first computing node and the second computing node move the target model file according to the position of the target model file in the target queue.
[0033] The embodiment of the present invention further discloses a model file migration method based on a distributed system, wherein the distributed system includes a first computing node and at least one second computing node, and the method is applied to the second computing node, and the method includes:
[0034] Establishing a communication connection with the first computing node;
[0035] When moving a subfile of a target model file, at least one moving status information is generated, and all of the moving status information is sent to the first computing node; the first computing node determines whether the second computing node has successfully completed the move based on all of the moving status information; when the first computing node determines that all of the second computing nodes have successfully completed the move, it sets the moving of the target model file to be successful; when the first computing node determines that there is a second computing node that has failed to move, it sets the moving of the target model file to be failed.
[0036] Optionally, establishing a communication connection with the first computing node includes:
[0037] Obtaining, from the target shared storage path, first connection information written by the first computing node;
[0038] The communication connection is established with the first computing node according to the first connection information.
[0039] Optionally, the method further comprises:
[0040] When the communication connection with the first computing node fails to be established according to the first connection information, reacquiring second connection information from the target shared storage path;
[0041] The communication connection is established with the first computing node according to the second connection information.
[0042] Optionally, the migration status information includes migration success information, and when migrating a subfile of the target model file, generating at least one migration status information and sending all the migration status information to the first computing node includes:
[0043] When the sub-file is successfully moved to the shared storage, the successful move information is generated and sent to the first computing node; when the first computing node receives the successful move information, it determines that the second computing node has successfully completed the move.
[0044] Optionally, the migration status information includes heartbeat information, and when a subfile of the target model file is migrated, generating at least one migration status information and sending all the migration status information to the first computing node includes:
[0045] When the subfile is moved, the heartbeat information is generated at a preset time interval and sent to the first computing node.
[0046] Optionally, the migration status information includes shared storage insufficiency information, and when the sub-file of the target model file is migrated, at least one migration status information is generated, including:
[0047] When the sub-file is moved, if it is detected that the shared storage space is insufficient, the shared storage insufficient information is generated.
[0048] Optionally, the migration status information includes migration exception information, and when migrating a subfile of the target model file, generating at least one migration status information and sending all the migration status information to the first computing node includes:
[0049] When the moving of the sub-file fails, trying to move the sub-file again a preset number of times;
[0050] When the re-moval of the sub-file fails after the preset number of attempts, the migration exception information is generated;
[0051] The migration exception information is sent to the first computing node; when the first computing node receives the migration exception information, it is determined that there is a second computing node where the migration fails, and the migration of the target model file is set to fail.
[0052] Optionally, the method further comprises:
[0053] Obtaining the training iteration running time corresponding to the target model file and the historical migration time corresponding to the target model file;
[0054] The preset number of times is generated according to the training iteration running time and the history migration time.
[0055] The embodiment of the present invention further discloses a computer program product, including computer instructions, which, when executed by a processor, implement the model file migration method of the distributed system as described above.
[0056] An embodiment of the present invention further discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the model file migration method based on the distributed system as described above is implemented.
[0057] An embodiment of the present invention further discloses a non-volatile computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the distributed system-based model file migration method as described above is implemented.
[0058] In the embodiment of the present invention, the first computing node establishes a communication connection with the second computing node, and receives at least one migration status information generated by the second computing node when migrating a subfile of the target model file through the communication connection; based on all the migration status information sent by the second computing node, it is determined whether the second computing node has successfully completed the migration; when it is determined that all the second computing nodes have successfully completed the migration, the migration of the target model file is set to be successful; when it is determined that there is a second computing node that failed to migrate, the migration of the target model file is set to fail. Through the embodiment of the present invention, the first computing node can manage and control the consistency of the model file, thereby avoiding problems such as loading failure and reasoning failure in the training framework. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0060] Figure 1 It is a flowchart of the steps of a model file migration method based on a distributed system according to an embodiment of the present invention;
[0061] Figure 2a is a flowchart of another method for migrating model files based on a distributed system according to an embodiment of the present invention;
[0062] Figure 2b This is a schematic diagram of a target queue and target queue reading and writing according to an embodiment of the present invention;
[0063] Figure 3 It is a flowchart of the steps of another method for migrating model files based on a distributed system according to an embodiment of the present invention;
[0064] Figure 4 is a flowchart of the steps of another method for migrating model files based on a distributed system according to an embodiment of the present invention;
[0065] Figure 5 is a schematic diagram of asynchronous migration according to an embodiment of the present invention;
[0066] Figure 6 is a flowchart of the overall steps of an embodiment of the present invention;
[0067] Figure 7 is a flowchart of steps for a second computing node according to an embodiment of the present invention;
[0068] Figure 8 is a flowchart of steps for a first computing node according to an embodiment of the present invention;
[0069] Fig. 9 is a schematic diagram of the structure of a computer program product according to an embodiment of the present invention;
[0070] Fig.10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
[0071] Fig.11 It is a structural schematic diagram of a non-volatile computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0072] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] In order to ensure the availability of model files obtained by the training framework from shared storage, the present invention provides a method for moving model files of distributed training tasks, which can be applied to a distributed system; the distributed system may include multiple computing nodes, and these multiple computing nodes can be used to complete the asynchronous migration of model files; these multiple computing nodes may include a first computing node and at least one second computing node; exemplarily, the first computing node can be set to be identified as rank0; the second computing node can be set to be identified as rankn (where n is a positive integer greater than 0).
[0074] In the embodiment of the present invention, the first computing node can act as a master node to monitor the migration of each computing node; when the first computing node detects that the migration of each computing node is completed, it can set the model file migration success; at this time, the training framework can perform the next step based on the set information; through the embodiment of the present invention, the first computing node can manage and control the consistency of the model file, thereby avoiding problems such as loading failure and reasoning failure in the training framework. For details, please refer to Figure 1 , Figure 1 A flow chart showing the steps of a distributed system-based model file migration method according to an embodiment of the present invention.
[0075] like Figure 1 As shown, the method may include the following steps:
[0076] Step 101: Establish a communication connection with a second computing node, and receive, through the communication connection, at least one piece of migration status information generated by each second computing node when migrating a subfile of a target model file.
[0077] The target model file may be a model file of a training task, and the sub-files may be files obtained by dividing the target model file. Both the first computing node and the second computing node may be used to move the sub-files in the target model file.
[0078] In some feasible embodiments, when a distributed training task is started, each computing node starts an asynchronous process to move sub-files of the target model file; the first computing node synchronously starts a listening service to synchronize the migration status of each second computing node.
[0079] Specifically, the first computing node may first establish a communication connection with each second computing node respectively; then, each second computing node may synchronously move the sub-file to the first computing node through the communication connection during the process of moving the sub-file of the target model file; illustratively, a second computing node may move a sub-file in the target model file; during the process of moving the sub-file corresponding to it, the second computing node may generate movement status information corresponding to each event based on one or more events triggered by the movement process. In actual applications, during the process of moving the sub-file corresponding to it, a second computing node may generate at least one movement status information; the movement status information may be used to characterize the event triggered when the second computing node moves the sub-file corresponding to it, such as: a successful move event, a failed move event, a timed-out move event, an insufficient move memory event, etc.
[0080] Exemplarily, when the second computing node starts to move the sub-file corresponding to it, it can generate moving status information of the moving in progress; when the second computing node successfully moves the sub-file corresponding to it, it can generate moving status information of the moving completed; when the second computing node encounters a problem when moving the sub-file (for example, a moving error), it can generate moving status information of a moving abnormality; the embodiments of the present invention are not limited to this.
[0081] Step 102: Determine whether the second computing node has successfully completed the migration based on all the migration status information sent by the second computing node.
[0082] After receiving the migration status information sent by the second computing node, the first computing node can analyze the migration status information sent by the second computing node one by one to determine whether the second computing node has successfully migrated the corresponding subfile of the target model file.
[0083] Exemplarily, when the second computing node starts to move a sub-file, it can send migration status information of the ongoing migration to the first computing node; the first computing node analyzes the migration status information to determine that the second computing node is moving the sub-file; when the second computing node completes moving the sub-file, it can generate migration completion information; the first computing node analyzes the migration completion information to determine that the second computing node has successfully completed the migration of the sub-file.
[0084] In some feasible embodiments, after receiving the migration status information sent by the second computing node, if the first computing node identifies that the second computing node has not been successfully migrated or has not failed to migrate, the first computing node continues to detect the second computing node; when it is determined that the second computing node has been successfully migrated or has failed to migrate based on the received migration status information, step 103 or step 104 is executed again.
[0085] Step 103: When it is determined that all second computing nodes have successfully completed the migration, the target model file is set to be successfully migrated.
[0086] After analyzing the migration status information sent by each second computing node, the first computing node can determine whether each second computing node has successfully moved its corresponding sub-file to the shared storage; if the analysis determines that all second computing nodes have successfully moved the sub-files, the target model file can be set in the shared storage as having been successfully moved; at this point, the training framework can determine that the target model file has been completely moved successfully based on the setting, and can proceed to the next step.
[0087] Step 104: When it is determined that there is a second computing node whose migration fails, the migration of the target model file is set to fail.
[0088] On the contrary, if the analysis determines that the migration of the second computing node has failed, the migration failure of the target model file can be set in the shared storage; at this point, the training framework can not proceed to the next step, thereby avoiding the problem of loading failure and inference failure in the training framework.
[0089] In the embodiment of the present invention, the first computing node establishes a communication connection with the second computing node, and receives at least one migration status information generated by the second computing node when migrating a subfile of the target model file through the communication connection; based on all the migration status information sent by the second computing node, it is determined whether the second computing node has successfully completed the migration; when it is determined that all the second computing nodes have successfully completed the migration, the migration of the target model file is set to be successful; when it is determined that there is a second computing node that failed to migrate, the migration of the target model file is set to fail. Through the embodiment of the present invention, the first computing node can manage and control the consistency of the model file, thereby avoiding problems such as loading failure and reasoning failure in the training framework.
[0090] Reference Figure 2a , shows a flow chart of another method for migrating model files based on a distributed system according to an embodiment of the present invention. Figure 2a As shown, the method may include the following steps:
[0091] Step 201: Determine first connection information of a first computing node.
[0092] When the first computing node is started, the first connection information of the first computing node may be determined first; in one embodiment of the present invention, the first connection information of the first computing node may include at least one of the following information, so that the second computing node can establish a communication connection with the first computing node based on the first connection information:
[0093] Internet Protocol address information of the first computing node, and port information of the first computing node.
[0094] Step 202: write the first connection information into the target shared storage path; the second computing node establishes a communication connection with the first computing node according to the first connection information in the target shared storage path.
[0095] After determining the first connection information of the first computing node, the first computing node may write the first connection information into a target shared storage path of the shared storage, for example: / mnt / ckpt_common_info.
[0096] After starting up, the second computing node can first retrieve the target shared storage path of the shared storage to obtain the first connection information of the first computing node; after obtaining the first connection information of the first computing node, the second computing node can establish a communication connection with the first computing node based on the first connection information of the first computing node.
[0097] Step 203: Receive, through the communication connection, at least one piece of migration status information generated by the second computing node when migrating a sub-file of the target model file.
[0098] After the first computing node establishes a communication connection with each second computing node, the first computing node can receive, through the communication connection, information from each second computing node when moving subfiles of the target model file based on events triggered by the move, and generate corresponding move status information.
[0099] Step 204: Determine whether the second computing node has successfully completed the migration based on all the migration status information sent by the second computing node.
[0100] After receiving the migration status information sent by the second computing node, the first computing node can analyze the migration status information sent by the second computing node one by one to determine whether the second computing node has successfully migrated the corresponding subfile of the target model file.
[0101] In some feasible embodiments, when the first computing node determines that a second computing node has been successfully moved, it can mark the second computing node as moved in the database; by checking the database, the first computing node can determine whether all second computing nodes have been successfully moved, and the embodiments of the present invention are not limited to this.
[0102] Step 205: When it is determined that all second computing nodes have successfully completed the migration, the target file identifier of the target model file is stored in the shared storage.
[0103] In some feasible embodiments, when the first computing node determines that all the second computing nodes have successfully moved the sub-files of the target model file to the shared storage, the first computing node may persistently store the target file identifier of the target model file in the shared storage to indicate that the target model file corresponding to the target file identifier has been completely moved to the shared storage, which can be used for subsequent reasoning or reloading.
[0104] Step 206: When it is determined that there is a second computing node whose migration fails, the migration of the target model file is set to fail.
[0105] When the first computing node determines that the migration of the second computing node has failed, the first computing node can set the migration of the target model file to fail; exemplarily, the first computing node does not persistently store the target file identifier of the target model file in the shared storage, and the first computing node can also throw an exception to terminate the training task corresponding to the target model file.
[0106] In an embodiment of the present invention, the migration status information includes migration success information, and the above method may further include the following steps:
[0107] When the migration success information is received, it is determined that the second computing node has successfully completed the migration.
[0108] In some feasible embodiments, when the second computing node successfully moves the sub-file to be moved to the shared storage, the second computing node can generate a successful move message; after generating the successful move message, the second computing node can send the successful move message to the first computing node.
[0109] When the first computing node receives the migration success information sent by the second computing node, it can determine that the second computing node has successfully migrated the sub-file in the target model file corresponding to it.
[0110] In one embodiment of the present invention, the migration status information includes migration abnormality information, and the above method may further include the following steps:
[0111] When the migration exception information is received, it is determined that the second computing node fails to migrate the sub-file.
[0112] In some feasible embodiments, when an exception occurs in the process of the second computing node moving the sub-file to be moved to the shared storage, the second computing node may generate movement exception information and report the movement exception information to the first computing node.
[0113] When the first computing node receives the migration exception information sent by the second computing node, it can determine that the second computing node fails to migrate the corresponding sub-file of the target model file.
[0114] In an embodiment of the present invention, the first computing node and the second computing node may be used to move the sub-files of the target model file to the shared storage, and the moving status information may include the shared storage insufficient information. When the first computing node receives the shared storage insufficient information, the above method may further include the following steps:
[0115] Determine other model files stored in the shared storage whose versions are earlier than the target model file; when the number of other model files in the shared storage is greater than a first preset value, clean up other model files of a second preset value; when the number of other model files in the shared storage is not greater than the first preset value, issue an instruction to stop the training task corresponding to the target model file.
[0116] In some feasible embodiments, when the second computing node moves a sub-file to the shared storage, if the storage space in the shared storage is insufficient, the second computing node can generate shared storage shortage information; then, the second computing node can send the shared storage shortage information to the first computing node through a communication connection.
[0117] After receiving the information that the shared storage is insufficient, the first computing node can determine, from the files stored in the shared storage, other model files that correspond to the same training task as the target model file and whose file versions are earlier than the target model file.
[0118] Then, the first computing node may determine the number of other model files in the shared storage; if the number of other model files in the shared storage is greater than a preset first preset value, other model files of a second preset value in the shared storage may be cleaned up; illustratively, the first preset value may be 1, and the second preset value may be 1; that is, when the number of other model files in the shared storage is greater than 1, one other model file in a shared storage is deleted. The first preset value and the second preset value may be positive integers.
[0119] In some feasible embodiments, if the number of other model files in the shared storage is not greater than a first preset value, the first computing node may throw an exception to stop the training task corresponding to the target model file; specifically, the first computing node may generate an instruction to stop the training task corresponding to the target model file to control the stopping of the training task corresponding to the target model file.
[0120] In an embodiment of the present invention, the migration status information includes heartbeat information, and the method may further include the following steps:
[0121] If the heartbeat information of the second computing node is not received within the preset time period, it is determined that the migration of the second computing node has failed.
[0122] In some feasible embodiments, when moving a sub-file, the second computing node may generate heartbeat information according to a preset time interval and send the heartbeat information to the first computing node; the heartbeat information may include the rank number corresponding to the second computing node and the target file identification tag of the target model file corresponding to the moved sub-file.
[0123] After receiving the heartbeat information sent by the second computing node, the first computing node can determine that the second computing node is normally moving the sub-files of the target model file; if an abnormality occurs when the second computing node moves the sub-files, no heartbeat information will be generated and no heartbeat information will be sent to the first computing node.
[0124] If the first computing node does not receive the heartbeat information of the second computing node within a preset time period, it can be determined that the second computing node has failed to move the corresponding sub-file in the target model file.
[0125] In one embodiment of the present invention, the distributed system is provided with a target queue, which is used to store the model file to be moved, and the first computing node and the second computing node move the target model file according to the position of the target model file in the target queue.
[0126] In some feasible embodiments, due to the slow network bandwidth of shared storage, the migration time may be greater than the iteration time, which may result in a scenario where there are multiple unmigrated model files in the local cache. To ensure the consistency of model file generation, the embodiment of the present invention does not use multiple ready-made concurrent migrations, but creates a FIFO (First-In First-Out) queue to store the model files to be migrated.
[0127] Specifically, a FIFO target queue may be provided in the distributed system, and the target queue may be used to store various model files to be moved, which may include the target model file.
[0128] For example, Figure 2b As shown in the figure, in the target queue, the data written first is the model file with an earlier version (such as the iteration 1 model file), and the data written later is the model file with a newer version (such as the iteration N model file); when moving, you can first get the model file with the earliest version from the target queue; when writing, the model file written is the model file of the latest iteration
[0129] In actual applications, the first computing node and the second computing node can move the target model file according to the position of the target model file in the target queue. After the successful move is completed, the first computing node can persist the target file identifier of the target model file to the shared storage. Next, the distributed system can continue to perform the next move task (i.e., move the next model file of the target model file in the target queue), which is not limited in the embodiment of the present invention.
[0130] In some feasible embodiments, when moving model files in the target queue, the model files written into the target queue first can be moved first, and the model files written into the target queue later can be moved later; since only one thread is started for the move, the temporal continuity of the model files moved to the shared storage can be guaranteed.
[0131] In an embodiment of the present invention, the first connection information of the first computing node is determined; the first connection information is written into the target shared storage path; the second computing node establishes a communication connection with the first computing node according to the first connection information in the target shared storage path; at least one migration status information generated by the second computing node when migrating a subfile of the target model file is received through the communication connection; according to all the migration status information sent by the second computing node, it is determined whether the second computing node has successfully completed the migration; when it is determined that all the second computing nodes have successfully completed the migration, the target file identifier of the target model file is stored in the shared storage; when it is determined that there is a second computing node that failed to migrate, the migration failure of the target model file is set. Through the embodiment of the present invention, the first computing node can manage and control the consistency of the model file, thereby avoiding problems such as loading failure and reasoning failure in the training framework.
[0132] In addition, when the storage space is insufficient, the first computing node can automatically release the space in the shared storage so that the migration task can be completed smoothly; and a target queue is also defined so that only one thread is started for the migration task, ensuring the temporal continuity of the model file moved to the shared storage.
[0133] The above mainly describes the model file migration method based on the distributed system from the perspective of the first computing node; the following describes the model file migration method based on the distributed system from the perspective of the second computing node:
[0134] like Figure 3 , shows a flow chart of steps of another method for migrating model files based on a distributed system according to an embodiment of the present invention. Figure 3 As shown, the method may include the following steps:
[0135] Step 301: Establish a communication connection with a first computing node.
[0136] In some feasible embodiments, when the distributed training task is started, the second computing node can establish a communication connection with the first computing node so as to report events triggered during the migration process to the first computing node.
[0137] Step 302: When moving a subfile of the target model file, generate at least one moving status information, and send all the moving status information to the first computing node; the first computing node determines whether the moving is successfully completed based on all the moving status information; when the first computing node determines that all the second computing nodes have successfully completed the moving, it sets the moving of the target model file to be successful; when the first computing node determines that there is a second computing node that failed to move, it sets the moving of the target model file to be failed.
[0138] When moving the sub-files of the target model file, the second computing node may generate corresponding moving status information according to the events triggered during the moving process.
[0139] Each time the second computing node generates the migration status information, it may send the currently generated migration status information to the first computing node through the communication connection established in step 301 .
[0140] After receiving the migration status information sent by the second computing node, the first computing node may identify the migration status information and determine whether the second computing node has successfully migrated the subfile based on the identification result.
[0141] If it is determined that the second computing node has successfully moved the subfile, the first computing node may determine whether the corresponding subfile has been successfully moved according to the migration status information sent by another second computing node.
[0142] If it is determined that all the second computing nodes have successfully moved their corresponding sub-files, the first computing node can set the target model file to be moved successfully in the shared storage; at this point, the training framework can determine that the target model file has been completely moved successfully based on this setting, and can proceed to the next step. Conversely, if it is determined that at least one second computing node has not successfully moved the corresponding sub-file, the first computing node can set the target model file to be moved unsuccessfully in the shared storage; at this point, the training framework can not proceed to the next step, thereby avoiding the problem of loading failure and inference failure in the training framework.
[0143] In the embodiment of the present invention, the second computing node establishes a communication connection with the first computing node; when moving a subfile of the target model file, at least one moving status information is generated, and all the moving status information is sent to the first computing node; the first computing node determines whether the moving is successfully completed based on all the moving status information; when the first computing node determines that all the second computing nodes have successfully completed the moving, it sets the moving of the target model file to be successful; when the first computing node determines that there is a second computing node that failed to move, it sets the moving of the target model file to be failed. Through the embodiment of the present invention, the first computing node can manage and control the consistency of the model file, thereby avoiding problems such as loading failure and reasoning failure in the training framework.
[0144] Reference Figure 4 , shows a flow chart of steps of another method for migrating model files based on a distributed system according to an embodiment of the present invention. Figure 4 As shown, the method may include the following steps:
[0145] Step 401: Obtain first connection information written by a first computing node from a target shared storage path.
[0146] In practical applications, after starting, the first computing node may first write the first connection information into the target shared storage path of the shared storage; after starting, the second computing node may obtain the first connection information written by the first computing node from the target shared storage path.
[0147] Step 402: Establish a communication connection with the first computing node according to the first connection information.
[0148] After acquiring the first connection information from the target shared storage path, the second computing node may establish a communication connection with the first computing node according to the first connection information.
[0149] In one embodiment of the present invention, when establishing a communication connection with the first computing node, the following steps may also be included:
[0150] When the communication connection with the first computing node fails to be established according to the first connection information, the second connection information is re-acquired from the target shared storage path; and the communication connection with the first computing node is established according to the second connection information.
[0151] In some feasible embodiments, since the startup time of each computing node may be different, there may be a scenario where the first computing node has not yet written the first connection information to the target shared storage path of the shared storage, or the currently written first connection information does not match the migration task currently executed by the second computing node, resulting in a failure to establish a connection; therefore, when the connection fails, it is necessary to try to re-establish a communication connection; specifically, when the second computing node fails to establish a communication connection with the first computing node based on the first connection information, the second computing node can re-obtain the connection information written by the first computing node from the target shared storage path; the re-obtained connection information can be called second connection information.
[0152] After reacquiring the second connection information, the second computing node can re-establish a communication connection with the first computing node based on the second connection information; if the second computing node still fails to successfully establish a communication connection with the first computing node based on the second connection information, it can re-acquire the connection information written by the first computing node from the target shared storage path, and re-establish a communication connection with the first computing node based on the latest acquired connection information until a communication connection is successfully established.
[0153] Step 403: The migration status information includes migration success information. When the sub-file is successfully moved to the shared storage, migration success information is generated and sent to the first computing node. When the first computing node receives the migration status information including the migration success information, it determines that the second computing node has successfully completed the migration.
[0154] If the sub-file is successfully moved to the shared storage, the second computing node may generate migration status information including migration success information; after generating the migration success information, the second computing node may send the migration success information to the first computing node.
[0155] When the first computing node receives the successful migration information sent by the second computing node, it can determine that the second computing node has successfully moved the sub-file; at this time, the first computing node can set the target model file to be successfully moved in the shared storage; at this point, the training framework can determine that the target model file has been completely moved successfully based on the setting, and can proceed to the next step.
[0156] In one embodiment of the present invention, the migration status information may also include heartbeat information. When a subfile of a target model file is migrated, the step of generating the migration status information may be implemented in the following manner:
[0157] When the sub-file is moved, heartbeat information is generated at a preset time interval and sent to the first computing node.
[0158] In some feasible embodiments, the second computing node may generate heartbeat information according to a preset time interval during the process of moving the subfile, and send the generated heartbeat information to the first computing node. If the first computing node does not receive the heartbeat information sent by the second computing node within the preset duration, it can be determined that the second computing node has failed to move the corresponding subfile. The preset time interval and the preset duration are set according to actual conditions; illustratively, the preset time interval and the preset duration may be equal, or the preset time interval may be set to be less than the preset duration, and the embodiments of the present invention do not limit this.
[0159] In one embodiment of the present invention, the migration status information includes shared storage insufficiency information. When a sub-file of a target model file is migrated, the step of generating the migration status information can be implemented in the following manner:
[0160] When moving a sub-file, if it is detected that the shared storage space is insufficient, a shared storage insufficient information is generated.
[0161] In some feasible embodiments, when the second computing node moves a sub-file, if it is detected that there is insufficient space in the shared storage, it may generate insufficient shared storage information and send the insufficient shared storage information to the first computing node.
[0162] After receiving the information that the shared storage is insufficient, the first computing node can determine, from the files stored in the shared storage, other model files that correspond to the same training task as the target model file and whose file versions are earlier than the target model file.
[0163] Then, the first computing node can determine the number of other model files in the shared storage; if the number of other model files in the shared storage is greater than a preset first preset value, the other model files of the second preset value in the shared storage can be cleaned up. After the cleanup is completed, the first computing node can notify the second computing node to continue to perform the task of moving; or, the second computing node can also automatically re-execute the task of moving after a certain period of time, which is not limited in the embodiment of the present invention.
[0164] In some feasible embodiments, if the number of other model files in the shared storage is not greater than a first preset value, the first computing node may throw an exception to stop the training task corresponding to the target model file; specifically, the first computing node may generate an instruction to stop the training task corresponding to the target model file to control the stopping of the training task corresponding to the target model file.
[0165] In one embodiment of the present invention, the migration status information may include migration exception information. When a sub-file of a target model file is migrated, the step of generating at least one migration status information and sending all the migration status information to the first computing node may be implemented as follows:
[0166] When the migration of a sub-file fails, attempt to re-move the sub-file a preset number of times; when the preset number of attempts to re-move the sub-file fails, generate migration exception information; send the migration exception information to the first computing node; when the first computing node receives the migration exception information, it determines that there is a second computing node where the migration failed, and sets the target model file migration failure.
[0167] In some feasible embodiments, when the sub-file fails to be moved, the second computing node may first try to move the sub-file again. If the sub-file is moved again after a preset number of attempts and all attempts fail, the second computing node may generate a move exception message and then send the move exception message to the first computing node. When the first computing node receives the move exception message sent by the second computing node, it may determine that the second computing node that sent the move exception message did not successfully move the sub-file of the target model file corresponding to it.
[0168] In one embodiment of the present invention, the preset number of times can be determined by:
[0169] The training iteration running time corresponding to the target model file and the historical migration time corresponding to the target model file are obtained; and a preset number of times is generated according to the training iteration running time and the historical migration time.
[0170] In some feasible embodiments, based on the historical information of the target model file, the training iteration running time of the training task corresponding to the target model file and the historical moving time of each model file moving of the training task corresponding to the target model file can be obtained.
[0171] Then, the above-mentioned preset number of times can be generated according to the training iteration running time and the history migration time; specifically, the ratio of the training iteration running time to the history migration time can be calculated and then rounded down to obtain the preset number of times.
[0172] In some feasible embodiments, if there is no historical information, a preset number of times may be preset, which is not limited in the embodiment of the present invention.
[0173] In the embodiment of the present invention, the first connection information written by the first computing node is obtained from the target shared storage path; a communication connection is established with the first computing node according to the first connection information; the migration status information includes migration success information, and when the sub-file is successfully migrated to the shared storage, migration success information is generated and sent to the first computing node; when the first computing node receives the migration status information including the migration success information, it determines that the second computing node has successfully completed the migration. Through the embodiment of the present invention, the first computing node can manage and control the consistency of the model file, thereby avoiding problems such as loading failure and reasoning failure in the training framework.
[0174] In addition, by determining the number of attempts in the event of an exception based on the historical iteration duration and historical migration duration of the model file, it is possible to avoid affecting the overall training duration of the model due to too many attempts, or to avoid premature termination of model training due to too few attempts.
[0175] The following is a specific example to further illustrate the above-mentioned distributed system-based model file migration method:
[0176] In order to reduce the time spent on saving checkpoints (files that save model weight parameters, which, in the AI task training process, contain not only model weight parameters but also activation values, gradients, and loss values, and are usually used to resume training tasks when training tasks are interrupted), algorithm developers choose to save model files to the local directory of the task running node based on the existing optimization mechanism, and then asynchronously move them to the shared storage directory, where the model files are persistently stored. The example code reference is as follows:
[0177] torch.manual_seed(args.seed)# Set PyTorch's random seed to get reproducible results across different runs;
[0178] deepspeed.runtime.utils.set_random_seed(args.seed)# Set the random seed for DeepSpeed to get repeatable results in different runs;
[0179] net = AlexNet(num_classes=10)# Create an AlexNet model with 10 categories;
[0180] net = PipelineModule(layers=join_layers(net),
[0181] loss_fn=torch.nn.CrossEntropyLoss(),
[0182] num_stages=args.pipeline_parallel_size,
[0183] partition_method=part,
[0184] activation_checkpoint_interval=0)
[0185] # Use DeepSpeed's PipelineModule to parallelize the model and set the loss function, number of parallel layers, partitioning method, and activation checkpoint interval;
[0186] trainset = cifar_trainset(args.local_rank, dl_path=args.dataset)# Create a training set for the CIFAR-10 dataset;
[0187] engine, _, _, _ = deepspeed.initialize(
[0188] args=args,
[0189] model=net,
[0190] model_parameters=[p for p in net.parameters() if p.requires_grad],
[0191] training_data=trainset)# Initialize the DeepSpeed engine, including models, model parameters, training data, etc.;
[0192] pfsStorage=args.checkpoint_dir# Set the storage path for storage checkpoints;
[0193] client_sd={}# Create an empty dictionary to store client status;
[0194] step = 0 # Set the initial value of the training step;
[0195] import ckptMgt# Import ckptMgt module;
[0196] for step in range(step,args.steps):# Start the training loop until the specified number of steps is reached;
[0197] loss = engine.train_batch()# Execute a training batch and return the loss value;
[0198] #engine.module_state_dict()
[0199] client_sd['global_step']=step # Update the global step in the client state dictionary;
[0200] if step%10 == 0: # If the number of steps is a multiple of 10, save the checkpoint;
[0201] local_cache_dir=ckptMgt.getCacheDir(pfsStorage,tag=step)# Get the local cache directory;
[0202] engine.save_checkpoint(local_cache_dir,client_state = client_sd)# Save the checkpoint to the local cache directory and pass the client state;
[0203] When running multi-machine tasks using tensor parallelism and pipeline parallelism, there will be multiple data parallel groups (such as Figure 5 As shown, including data parallel group 1 and data parallel group 2) for data parallelism; wherein, in a data parallel group, different computing nodes (such as Figure 5 As shown, including a first computing node and at least one second computing node) respectively save part of the model file information (i.e., sub-files). The training task usually selects the computing node in the first data parallel group to save the model file. At this time, all the computing nodes in the data parallel group save the model file to generate a complete and usable model file; each folder saves the sub-files written by the computing node to the local directory; the computing nodes can asynchronously move the corresponding sub-files from the local to the shared storage.
[0204] like Figure 6 - Figure 8As shown, after the training task is started, the serial number of the computing node of the training process can be obtained. When the serial number of the computing node is rank0, the computing node is determined to be the first computing node; the IP (Internet Protocol) information of the first computing node can be obtained, and a free port that can be used by the first computing node can be queried, and the socket service is started based on the IP and port for the first computing node to communicate with the second computing node, and the port information of the IP and port is written into the shared storage.
[0205] When the second computing node is started, it may first search the shared storage to obtain the IP information and port information of the first computing node, and try to establish a connection with the first computing node; the connection may be a socket connection.
[0206] The target model file that needs to be moved is obtained from the target queue, and an asynchronous process is started to copy it. During the migration process, the first computing node and the second computing node can write their respective corresponding sub-files to the local directory and start a thread to move them to the shared storage.
[0207] Among them, the second computing node can report the events triggered during the migration process to the first computing node; specifically, the second computing node can report its own information (for example: its own rank number, the name of the model file to be asynchronously migrated, and the tag information of the model file) to the first computing node, and send heartbeat information to the first computing node at regular intervals.
[0208] The first computing node can count the migration status of different second computing nodes based on the information reported by different second computing nodes; if there is an abnormality in the migration, it will process it or terminate the task; if all second computing nodes are migrated, the identifier of the target model file will be persistently stored in the shared storage.
[0209] For the second computing node, after establishing a connection with the first computing node, it can obtain the sub-files of the target model file that needs to be moved from the target queue, and start an asynchronous thread to copy it; the migration process can be monitored during the migration process; specifically, it can report its own information to the first computing node, and send heartbeat information to the first computing node at regular intervals. If the migration is completed, the second computing node can notify the first computing node and perform the next migration task. If there is a problem of insufficient shared storage space during the migration process, it can be reported to the first computing node; if other abnormalities occur during the migration process, they can also be reported to the first computing node; if no other abnormalities occur during the migration process, the migration process can continue to be monitored.
[0210] If an exception occurs during the migration process, the second computing node can try to re-migrate a preset number of times; if the migration is still unsuccessful after trying the preset number of re-migrations, the current migration task is terminated and the first computing node is notified. If the migration has not been tried for the preset number of times, the re-migration will continue to be tried.
[0211] For the first computing node, after starting and establishing a connection with the second computing node, it can poll and process the information reported by each second computing node; specifically, when processing the information of the second computing node, it can obtain the migration status information sent by the second computing node, and based on the migration status information sent by the second computing node, determine whether the migration of the second computing node is completed.
[0212] If the migration of the second computing node is completed, the first computing node can determine whether all the second computing nodes have been migrated; if all the second computing nodes have been migrated, this round of asynchronous migration of the model file ends normally, and the first computing node can persist the identifier of the model file to the shared storage.
[0213] If there are still second computing nodes that have not been completely moved, the information reported by each second computing node can be continuously polled and processed.
[0214] If a second computing node has completed the migration, it can be determined whether there is a problem of insufficient storage space based on the migration status information sent by the second computing node; if so, it can be determined whether there are other model files with earlier versions of the model file currently being asynchronously migrated, and if so, other model files with earlier versions are cleaned up; if not, the training task ends abnormally. Specifically, when cleaning up other model files with earlier versions, it is necessary to first determine whether the number of other model files is not less than 2; if not, the cleaning step is performed; if less than 2, the training task ends abnormally.
[0215] If it is determined that there is no problem of insufficient storage space, it can be further determined whether there are other migration anomalies; if so, the training task ends abnormally; if not, it is further determined whether there is an abnormality in the heartbeat information of the second computing node (for example: the heartbeat information of the second computing node is not received within a preset time). If it is determined that there is an abnormality in the heartbeat information of the second computing node, the training task ends abnormally; if it is determined that there is no abnormality in the heartbeat information of the second computing node, the first computing node can continue to receive and process the migration status information sent by the second computing node.
[0216] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0217] The embodiment of the present invention also provides a computer program product, such as Fig. 9 As shown, the computer program product 9 includes computer instructions 901, and when the computer instructions 901 are executed by the processor, the above-mentioned model file migration method based on the distributed system is implemented.
[0218] The embodiment of the present invention further provides an electronic device, such as Fig.10 As shown, the electronic device 10 includes a processor 1001, a memory 1002, and a computer program stored in the memory 1002 and capable of running on the processor. When the computer program is executed by the processor, the above-mentioned model file migration method based on a distributed system is implemented.
[0219] The embodiment of the present invention also provides a non-volatile computer-readable storage medium, such as Fig.11 As shown, the non-volatile computer-readable storage medium 11 stores a computer program 1101, and when the computer program 1101 is executed by a processor, the above-mentioned model file migration method based on a distributed system is implemented.
[0220] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0221] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0222] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0223] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0224] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0225] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0226] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0227] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0228] The above provides a detailed introduction to a model file migration method based on a distributed system, a computer program product, an electronic device and a non-volatile computer-readable storage medium. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A model file migration method based on a distributed system, characterized in that: The distributed system includes a first computing node and at least one second computing node, the method is applied to the first computing node, and the method includes: Establishing a communication connection with the second computing node, and receiving, through the communication connection, at least one migration status information generated by the second computing node when migrating a subfile of the target model file; the first computing node is used to write the first connection information of the first computing node into the target shared storage path, and the second computing node is used to establish the communication connection with the first computing node according to the first connection information in the target shared storage path; Determining whether the second computing node has successfully completed the migration according to all the migration status information sent by the second computing node; When it is determined that all the second computing nodes have successfully completed the migration, setting the migration of the target model file to be successful; When it is determined that there is a second computing node whose migration fails, the migration of the target model file is set to fail.
2. The method according to claim 1, characterized in that The first connection information includes at least one of the following information: Internet Protocol address information of the first computing node and port information of the first computing node.
3. The method according to claim 1, characterized in that The setting of successfully moving the target model file includes: The target file identifier of the target model file is stored in the shared storage.
4. The method according to claim 1, characterized in that: The first computing node and the second computing node are used to move the sub-file of the target model file to a shared storage, the moving status information includes shared storage insufficiency information, and when the first computing node receives the shared storage insufficiency information, the method further includes: Determine other model files stored in the shared storage whose versions are earlier than the target model file; When the number of the other model files in the shared storage is greater than a first preset value, clearing the other model files of a second preset value; When the number of the other model files in the shared storage is not greater than the first preset value, an instruction to stop the training task corresponding to the target model file is issued.
5. The method according to claim 1, characterized in that The migration status information includes heartbeat information, and the method further includes: If the heartbeat information of the second computing node is not received within the preset time period, it is determined that the migration of the second computing node has failed.
6. The method according to claim 1, characterized in that The migration status information includes migration success information, and the method includes: When the migration success information is received, it is determined that the migration of the second computing node is successfully completed.
7. The method according to claim 1, characterized in that The moving state information includes moving abnormality information, and the method includes: When the migration exception information is received, it is determined that the second computing node fails to migrate the sub-file.
8. The method according to claim 1, characterized in that The distributed system is provided with a target queue, and the target queue is used to store the model file to be moved. The first computing node and the second computing node move the target model file according to the position of the target model file in the target queue.
9. A model file migration method based on a distributed system, characterized in that: The distributed system includes a first computing node and at least one second computing node, the method is applied to the second computing node, and the method includes: Establishing a communication connection with the first computing node; the first computing node is used to write the first connection information of the first computing node into the target shared storage path, and the second computing node is used to establish the communication connection with the first computing node according to the first connection information in the target shared storage path; When moving a subfile of a target model file, at least one moving status information is generated, and all of the moving status information is sent to the first computing node; the first computing node determines whether the second computing node has successfully completed the move based on all of the moving status information; when the first computing node determines that all of the second computing nodes have successfully completed the move, it sets the moving of the target model file to be successful; when the first computing node determines that there is a second computing node that has failed to move, it sets the moving of the target model file to be failed.
10. The method according to claim 9, characterized in that The method further comprises: When the communication connection with the first computing node fails to be established according to the first connection information, reacquiring second connection information from the target shared storage path; The communication connection is established with the first computing node according to the second connection information.
11. The method according to claim 9, characterized in that The migration status information includes migration success information. When the sub-file of the target model file is migrated, at least one migration status information is generated, and all the migration status information is sent to the first computing node, including: When the sub-file is successfully moved to the shared storage, the successful move information is generated and sent to the first computing node; when the first computing node receives the successful move information, it determines that the second computing node has successfully completed the move.
12. The method according to claim 9, characterized in that The migration status information includes heartbeat information. When a subfile of a target model file is migrated, at least one migration status information is generated, and all the migration status information is sent to the first computing node, including: When the subfile is moved, the heartbeat information is generated at a preset time interval and sent to the first computing node.
13. The method according to claim 9, characterized in that The migration status information includes shared storage insufficiency information. When the sub-file of the target model file is migrated, at least one migration status information is generated, including: When the sub-file is moved, if it is detected that the shared storage space is insufficient, the shared storage insufficient information is generated.
14. The method according to claim 9, characterized in that The migration status information includes migration exception information. When a subfile of a target model file is migrated, generating at least one migration status information and sending all the migration status information to the first computing node include: When the moving of the sub-file fails, trying to move the sub-file again a preset number of times; When the re-moval of the sub-file fails after the preset number of attempts, the migration exception information is generated; The migration exception information is sent to the first computing node; when the first computing node receives the migration exception information, it is determined that there is a second computing node where the migration fails, and the migration of the target model file is set to fail.
15. The method according to claim 14, characterized in that The method further comprises: Obtaining the training iteration running time corresponding to the target model file and the historical migration time corresponding to the target model file; The preset number of times is generated according to the training iteration running time and the history migration time.
16. A computer program product, characterized in that It includes computer instructions, which, when executed by a processor, implement the model file migration method of a distributed system as described in any one of claims 1 to 15.
17. An electronic device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, it implements the model file migration method based on a distributed system as described in any one of claims 1 to 15.
18. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the distributed system-based model file migration method as described in any one of claims 1 to 15 is implemented.
