Fault recovery method and device
By adopting a hierarchical checkpoint saving strategy in large model training, the problem of fault recovery during large model pre-training and fine-tuning is solved, enabling rapid recovery of training and reducing interference in the training process.
Patent Information
- Application Number
- CN202410935588.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-15
AI Technical Summary
During the pre-training and fine-tuning process of large models, the training process is interrupted and progress is lost due to multi-dimensional heterogeneous computing resource failures, and it is difficult to effectively recover from the failures with existing technology.
A hierarchical checkpoint saving strategy is adopted to save the model state in GPU memory, and checkpoints are transmitted and saved through CPU memory and remote persistent storage devices. Checkpoints are loaded from different storage locations according to the fault level to recover faults.
It realizes the rapid recovery training of large models after multi-dimensional heterogeneous computing resource failures, reduces the interference in the training process, and provides a recovery method for catastrophic failures.
Smart Images

Figure CN118779155A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a fault recovery method and device. Background Art
[0002] The rapid development of large models has promoted the further development of deep learning and further improved production efficiency. When pre-training and fine-tuning large models, the required multi-dimensional heterogeneous computing resources are numerous and large in scale, but the probability of failure of multi-dimensional heterogeneous computing resources increases exponentially with the increase in their scale, including node downtime or silent data errors.
[0003] Therefore, during the pre-training and fine-tuning of large models, various failures may often occur, resulting in interruptions in the training process or even loss of training progress. In addition, during the pre-training and fine-tuning of large models, due to the huge number of parameters and the amount of data required, a single GPU memory often cannot meet its training needs. Therefore, data parallelism, tensor parallelism, pipeline parallelism, or a combination of these methods are usually used to train large models.
[0004] Therefore, during the pre-training and fine-tuning process of large models, how to recover from failures in a timely and effective manner when a failure occurs becomes an urgent problem that needs to be solved. Summary of the invention
[0005] In view of this, the present disclosure provides a fault recovery method to solve the problem of how to recover from a fault in a timely and effective manner when a fault occurs during the training process of a large model.
[0006] In a first aspect, the present disclosure provides a fault recovery method, the method comprising:
[0007] When the model state of the model trained by the pipeline stage of the GPU of the node meets the checkpoint saving frequency of the fault recovery strategy, the model state is used as the current checkpoint, and the current checkpoint is saved in the GPU memory of the node, and according to the checkpoint transmission mode and checkpoint saving position in the fault recovery strategy, the current checkpoint in the GPU memory of the node is transmitted to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device for storage;
[0008] When a model trained in the pipeline stage fails during training, if the failure is a node failure but not a crash, the most recently saved checkpoint is loaded from the node's CPU memory to recover from the failure. If the failure is a node crash, the most recently saved checkpoint is loaded from the CPU memory of the next adjacent node to recover from the failure. If the failure is a crash of multiple machines, the most recently saved checkpoint is loaded from a remote persistent storage device to recover from the failure.
[0009] In a second aspect, the present disclosure provides a fault recovery device, the device comprising:
[0010] A checkpoint saving module is used to use the model state as the current checkpoint when the model state of the model trained by the GPU of the node in the pipeline stage meets the checkpoint saving frequency of the fault recovery strategy, save the current checkpoint in the GPU memory of the node, and transmit the current checkpoint in the GPU memory of the node to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device for storage according to the checkpoint transmission mode and checkpoint saving location in the fault recovery strategy;
[0011] The fault recovery module is used to load the most recently saved checkpoint from the CPU memory of the node to recover from the fault when the model trained in the pipeline stage fails during the training process. If the fault is a node fault but not a crash, the most recently saved checkpoint is loaded from the CPU memory of the node to recover from the fault. If the fault is a node crash, the most recently saved checkpoint is loaded from the CPU memory of the next adjacent node to recover from the fault. If the fault is a crash of multiple machines, the most recently saved checkpoint is loaded from the remote persistent storage device to recover from the fault.
[0012] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the fault recovery method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0013] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the fault recovery method of the first aspect or any corresponding embodiment thereof.
[0014] The fault recovery method disclosed in the present invention saves the current checkpoint in the GPU memory of the node according to the checkpoint saving frequency of the fault recovery strategy, and transmits the current checkpoint in the GPU memory of the node to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device for storage according to the checkpoint transmission method and checkpoint saving location in the fault recovery strategy. Since a hierarchical checkpoint saving strategy is adopted, when a fault occurs during training, the most recently saved checkpoint can be loaded from different storage locations according to the fault level to recover the fault, thereby recovering the fault in a timely and effective manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1a is a flowchart of a fault recovery method according to an embodiment of the present disclosure;
[0017] Figure 1b This is an exemplary application scenario of the fault recovery method according to an embodiment of the present disclosure;
[0018] Figure 1c is a schematic diagram of mutual communication between four nodes using pipeline parallel training according to an embodiment of the present disclosure;
[0019] Figure 1d According to the embodiment of the present disclosure, the checkpoint is Figure 1c The four nodes in the diagram are a schematic diagram of all nodes participating in the training model forming a ring propagation link and transmitting checkpoints along the propagation direction;
[0020] Figure 1e It is a schematic diagram of transferring a shard checkpoint to a CPU memory for storage when the GPU of a node receives the shard checkpoint according to an embodiment of the present disclosure;
[0021] Figure 2 It is a schematic diagram of a flow chart of determining the checkpoint saving frequency of a fault recovery method according to an embodiment of the present disclosure;
[0022] Figure 3 is a schematic structural block diagram of a fault recovery device according to an embodiment of the present disclosure;
[0023] Figure 4 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0025] A large model refers to a machine learning model with ultra-large-scale parameters (usually more than one billion) and super-powerful computing resources. It can process massive amounts of data and complete various complex tasks, such as natural language processing and image recognition.
[0026] The rapid development of large models has promoted the further development of deep learning and further improved production efficiency. The multi-dimensional heterogeneous computing resources required for large model training are numerous and large in scale, but the probability of failure of multi-dimensional heterogeneous computing resources increases exponentially with the increase in their scale, including node downtime or silent data errors, etc. Therefore, during the training of large models, various failures may often occur, causing the interruption of the training process or even the loss of training progress. In addition, during the training of large models, due to the huge amount of parameters and data required, a single GPU memory often cannot meet its training needs. Therefore, data parallelism, tensor parallelism, pipeline parallelism or a combination of them are usually used to train large models.
[0027] In the related technology, taking the training of OPT-175B using a cluster of 992 A100 GPUs with a memory size of 80GB as an example, during the entire training process, due to hardware and software failures such as overheating, power failure, and MPI, 60 GPUs were restarted more than 105 times in one day, and the longest healthy training time was only 2.8 days. Therefore, it is very important to develop a mechanism that can support fault tolerance in large model training.
[0028] The present disclosure proposes a fault-tolerant method for large model training technology to help large models quickly resume training after a failure of multi-dimensional heterogeneous computing resources, while reducing interference with the large model training process. The present disclosure uses a hierarchical checkpoint preservation strategy to save large model training checkpoints using CPU memory and remote persistent storage devices. In CPU memory preservation, in order to further increase fault tolerance, the present disclosure also saves large model training checkpoints in adjacent CPU memories, so that when a local node fails, training can be quickly resumed by scheduling data in other nodes, and other checkpoints can be transferred to persistent storage such as remote hard disks or cloud services to provide recovery methods in the event of catastrophic failures. At the same time, these historical checkpoints can be used for other research such as migration learning or model debugging.
[0029] According to an embodiment of the present disclosure, a fault recovery method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Specifically, each pipeline stage is configured with a controller to control the transmission and storage of the checkpoints of the current pipeline stage. The controller will renumber the current training device according to the different training devices contained in each stage of the corresponding pipeline to facilitate the management of the corresponding pipeline stage, where the current pipeline stage is renumbered and the order is based on the current device number.
[0031] In this embodiment, a fault recovery method is provided, which can be used for the controller of the pipeline stage of the multi-dimensional heterogeneous computing resources mentioned above. Figure 1a is a flowchart of a fault recovery method according to an embodiment of the present disclosure, such as Figure 1a As shown, the process includes the following steps:
[0032] Step S101, when the model state of the model trained by the pipeline stage of the node's GPU meets the checkpoint saving frequency of the fault recovery strategy, the model state is used as the current checkpoint, and the current checkpoint is saved in the node's GPU memory, and according to the checkpoint transmission method and checkpoint saving location in the fault recovery strategy, the current checkpoint in the node's GPU memory is transmitted to the node's CPU memory, the CPU memory of the next adjacent node, and the remote persistent storage device for storage.
[0033] In this embodiment, large-scale model training often uses pipeline parallel training to distribute different parts of the model (usually divided by layer) to different computing devices (such as GPUs) to reduce the memory pressure of a single device and improve the overall training efficiency. The pipeline stage refers to the calculation of the corresponding part of the model on each device during the model training process.
[0034] The model state of the model trained by the controller refers to the state information related to fault recovery of the model during the training process. For example, in a specific example, the model state may include weights, model parameters, optimizer parameters, random seed state, training progress information, etc.
[0035] Fault recovery strategies usually include checkpoint preservation strategies, fault tolerance mechanisms in distributed training, storage and backup system strategies, fault recovery algorithms and processes, optimization of backup and recovery algorithms, logging and monitoring, etc.
[0036] Among them, the checkpoint saving strategy includes the checkpoint saving frequency, the checkpoint saving location, the checkpoint transmission method, etc. The checkpoint saving frequency here can be a checkpoint saving frequency preset based on experience or application scenarios, or a checkpoint saving frequency calculated using tools, models, rules, etc., and this application does not limit this.
[0037] In order to improve the rapid preservation of checkpoints and rapid recovery of failures, the checkpoint preservation location in this embodiment adopts a multi-level checkpoint preservation strategy, placing the checkpoints in the node CPU memory, the next adjacent node CPU memory and the remote persistent storage device.
[0038] In the multi-dimensional heterogeneous computing resources commonly used for training large deep learning models, CPU memory is often much larger than GPU memory, and CPU memory utilization is much lower than GPU memory utilization. Therefore, the checkpoint information can be placed in the CPU memory of the node and the next adjacent node. However, the CPU memory cannot accommodate all historical checkpoints. Some historical checkpoints can be transferred to remote persistent storage devices through the CPU memory for storage. This can achieve disaster recovery-level fault tolerance. At this time, the checkpoint transmission is mainly transmitted in the background through the node's CPU memory.
[0039] Here, considering that the pipeline parallelism needs to be back-propagated from the last node in sequence, and the model layer whose parameters have been updated can be saved as a checkpoint, in order to avoid overlapping with the transmission traffic during back-propagation and affecting the progress, all nodes involved in the training model can be formed into a ring propagation link, and the next adjacent node is the adjacent node in the propagation direction. That is, the checkpoint data of the current i-th node needs to be deployed to the i+1-th node, and the first node needs to save the last node checkpoint data. This is because the checkpoint usually saves the model parameters after the back-propagation is completed, and tries to ensure the consistency of the model data, that is, in the training process using the pipeline parallel method, after each node parameter is updated, it is necessary to continue to pass the parameters required for back-propagation such as gradients backward.
[0040] Step S102, when the model trained in the pipeline stage fails during the training process, if the failure is a node failure but not a crash, load the most recently saved checkpoint from the node's CPU memory to recover the failure; if the failure is a node crash, load the most recently saved checkpoint from the next adjacent node's CPU memory to recover the failure; if the failure is a multiple machine crash, load the most recently saved checkpoint from a remote persistent storage device to recover the failure.
[0041] In this embodiment, when a software or hardware failure of a node is detected but the node is not down, the checkpoint can be directly retrieved from the node CPU memory to resume training. When a node is down, the checkpoint in the CPU of the next adjacent node can be called to resume training, and when a catastrophic failure such as multiple machine downtime occurs, the most recently saved checkpoint is loaded from a remote persistent storage device to recover from the failure.
[0042] It is understandable that data parallelism and pipeline parallelism can be used simultaneously in large model training.
[0043] Data parallelism usually involves dividing the training data into multiple parts, that is, each batch of training data is divided into mini-batches, and each mini-batch is used to train a complete model.
[0044] Pipeline parallelism usually deploys multi-layer slices of the model to different GPUs. For example, if a model has three layers, A, B, and C, but a single GPU cannot deploy them, they can be deployed to separate GPUs according to the three layers A, B, and C.
[0045] The pipeline parallelism in this embodiment may be the pipeline parallelism under single data parallelism, and may also be extended to the case of pipeline parallelism under multiple data parallelism.
[0046] For example, Figure 1b As shown, Figure 1b An exemplary application scenario of the fault recovery method disclosed in the present invention is shown. The fault recovery method may include the following steps:
[0047] First, the user submits a training task to the controller;
[0048] After that, the controller initializes the training settings;
[0049] Afterwards, the controller mobilizes the training host for training;
[0050] Afterwards, the controller implements the preservation of training checkpoints during the training process, including: dynamically adjusting the checkpoint preservation frequency according to the checkpoint placement and transmission strategy;
[0051] Afterwards, the controller determines that the training task is finished.
[0052] Afterwards, when the training host is training and a fault occurs, the controller determines the type of fault;
[0053] Afterwards, the controller determines the fault type as a soft error, a hardware fault, or a disaster recovery level fault;
[0054] Afterwards, the controller adopts the corresponding fault tolerance method for the corresponding fault type and resumes model training.
[0055] The fault recovery method provided in this embodiment saves the current checkpoint in the GPU memory of the node according to the checkpoint saving frequency of the fault recovery strategy, and transmits the current checkpoint in the GPU memory of the node to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device for storage according to the checkpoint transmission method and checkpoint saving location in the fault recovery strategy. Since a hierarchical checkpoint saving strategy is adopted, when a fault occurs during training, the most recently saved checkpoint can be loaded from different storage locations according to the fault level to recover the fault, thereby recovering the fault in a timely and effective manner.
[0056] In some optional implementations of this embodiment, according to the checkpoint transmission mode and checkpoint storage location in the fault recovery strategy, the current checkpoint in the GPU memory of the node is transmitted to the CPU memory of the next adjacent node, including:
[0057] Using a communication link between the GPU of the node and the GPU of the next adjacent node, the current checkpoint in the GPU memory of the node is transferred to the GPU memory of the next adjacent node, so that the GPU of the adjacent node saves the current checkpoint to the CPU of the adjacent node; and
[0058] When the GPU of a node receives a checkpoint transmitted by the GPU of the previous adjacent node, the received checkpoint is transmitted to the CPU memory of the node for storage.
[0059] In this implementation, the communication link can be determined according to the device. It can be a communication link using bus interface standards such as the peripheral component interconnect standard PCIe, NVIDIA link NVLink, etc., or it can be a shared memory between the GPU and the CPU, that is, the parameter update is performed in the shared memory. When the parameter update is completed, this part of the data is copied to another block in the shared memory for protection to prevent it from being contaminated.
[0060] In order to transfer the current checkpoint in the GPU memory of the node to the GPU memory of the next adjacent node, when the number of GPUs of the node is the same as the number of GPUs of the next adjacent node, the current checkpoint in the GPU memory of the node is transferred to the GPU memory of the next adjacent node according to the corresponding numbers in the transmission correspondence between the node GPU and the adjacent GPU.
[0061] When the number of GPUs of the node is different from the number of GPUs of the next adjacent node, the current checkpoint in the GPU memory of the node is transferred to the GPU memory of the next adjacent node according to the corresponding number in the transmission mapping relationship between the node GPU and the adjacent GPU. The transmission mapping relationship can determine the mapping ratio based on the ratio of the number of GPUs contained in the node and the next adjacent node.
[0062] In some specific examples, for the transmission correspondence between the node GPU and the next adjacent node GPU, that is, transmission from one pipeline stage to another pipeline stage, if the number of GPU devices in each stage is the same, they are transmitted in sequence according to the corresponding numbers. If they are not the same, the number of GPUs contained in the two stages is divided, and the transmission is carried out according to the quotient after the division as the mapping ratio. For example, if there are 6 stages in stage A and 3 stages in stage B, and transmission in the AB direction is required, the first two numbers of stage A correspond to the first one of stage B, and so on; if there are 7 stages in stage A and 3 stages in stage B, the first 3 stages in stage A correspond to the first one of stage B, and the subsequent ones are consistent with the above.
[0063] When the GPU of a node receives a checkpoint transmitted by the GPU of the previous adjacent node, it transfers it to the CPU memory for storage, and deletes the checkpoint in the GPU memory after the transfer is completed.
[0064] by Figure 1c , Figure 1d and Figure 1e For example, Figure 1c A schematic diagram showing mutual communication between four nodes using pipeline parallel training according to an embodiment of the present disclosure is shown. Figure 1d The checkpoints of the present disclosure embodiment are shown in Figure 1c Schematic diagram of the four nodes in the training model forming a ring propagation link and transmitting checkpoints along the propagation direction. Figure 1e A schematic diagram showing how the GPU of a node in an embodiment of the present disclosure transfers a shard checkpoint to the CPU memory for storage when receiving the shard checkpoint.
[0065] In this implementation method, the method of transmitting the current checkpoint in the GPU memory of the node to the CPU memory of the adjacent node is clarified, so that the checkpoint transmission between the node and the next adjacent node can be realized through the GPU communication link, and then within each node, when the checkpoint transmitted by the GPU of the previous adjacent node is received, it is saved to the CPU, thereby realizing fast transmission between the node GPU-the next adjacent node GPU and the node GPU-the node CPU, thereby improving the efficiency of saving the current checkpoint in the CPU memory of the next adjacent node.
[0066] In some specific examples, the CPU memory may not be able to save all checkpoints, so we only save the latest checkpoint in the CPU memory.
[0067] The current checkpoint in the GPU memory of the node is transferred to the CPU memory of the node, including: if the CPU memory of the node has stored the two most recent checkpoints, then after deleting the checkpoint with the earlier timestamp in the two most recent checkpoints, the current checkpoint is written to the CPU memory of the node. And
[0068] When the GPU of a node receives a checkpoint transmitted by the GPU of the previous adjacent node, the received checkpoint is transmitted to the CPU memory of the node for storage, including: if the CPU memory of the node has stored the two most recent checkpoints of the previous adjacent node, then after deleting the checkpoint with an earlier timestamp among the two most recent checkpoints of the previous adjacent node, the received checkpoint is written into the CPU memory of the node.
[0069] In some optional implementations of this embodiment, taking the model state as the current checkpoint includes: slicing the model state according to the target data volume to obtain the current slice of the current checkpoint, and attaching a number to the current slice; transmitting the current checkpoint in the GPU memory of the node to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device, including:
[0070] The current slice with an additional number in the node's GPU memory is saved to the checkpoint receiving area with a corresponding number in the node's CPU memory, the checkpoint receiving area with a corresponding number in the CPU memory of the next adjacent node, and the checkpoint receiving area with a corresponding number in the remote persistent storage device.
[0071] In this implementation, the checkpoint can be transmitted in segments, that is, by slicing the model state on the node GPU according to the target data volume, the slices are transmitted to the GPU of the next adjacent node, and then the GPU of the next adjacent node saves it to the CPU memory of the next adjacent node.
[0072] At the same time, checkpoint receiving areas are set in the node CPU memory, the CPU memory of the next adjacent node and the remote persistent storage device, so that when the current slice with an additional number is received, the current slice is saved in the checkpoint receiving area with the corresponding number.
[0073] It is understandable that in order to better utilize idle resources, the size of the current slice does not exceed the size of the checkpoint receiving area.
[0074] Thus, after each checkpoint receiving area receives the current slice of the checkpoint, it is immediately saved to the checkpoint receiving areas with corresponding numbers in the CPU memory, the CPU memory of the next adjacent node, and the remote persistent storage device, while the remaining checkpoint receiving areas continue to receive slices of the checkpoint.
[0075] During the transmission process, when it is saved to the CPU memory of the next adjacent node, the checkpoint slices can be used to achieve continuous transmission of GPUs between nodes. When the GPU of the next adjacent node receives the checkpoint slices of the node and transfers them to the CPU memory of the next adjacent node, the checkpoint slices transferred in its GPU memory can be deleted.
[0076] When saving to a remote persistent storage device, the checkpoint slices may be transferred by the node CPU via pipeline bubbles during pipeline parallelism.
[0077] During the checkpoint saving process, compared with the related art which usually requires pausing the corresponding training to prevent the gradient parameters from being updated, which causes the consistency of the checkpoint data state to be destroyed, this embodiment transmits the corresponding checkpoints during the equipment training gaps by combining pipeline parallelism, checkpoint slicing, etc., to minimize interference with the training process.
[0078] The fault recovery method in this implementation can reduce the communication overhead of the node, improve the fault tolerance during the transmission process, and transmit the checkpoint fragments in parallel, thereby improving the resource utilization and transmission efficiency during the transmission process.
[0079] In some optional implementations of this embodiment, when the model state is sliced according to the target data volume, the target data volume is determined based on the following steps:
[0080] Based on each of the multiple hierarchical training strategies of the model, the model is hierarchized into multiple sub-models, and an average of the absolute values of the differences between the sizes of every two sub-models in the multiple sub-models is determined as the candidate data amount of the target data amount;
[0081] The minimum value among multiple candidate data amounts corresponding to multiple hierarchical training strategies is used as the target data amount.
[0082] In this implementation, since the model usually includes multiple layers, the training of multiple layers can be divided according to different layered training strategies. For example, if the model has a total of 5 layers and each sub-model has a maximum of two layers, there can be 5 1-layer sub-models, 2 2-layer sub-models + 1 1-layer sub-model, 3 1-layer sub-models + 1 2-layer sub-model. There are generally 3 types of layered training strategies. However, the actual layered training strategy will be different depending on the continuous layers.
[0083] The average can be an indicator that describes the trend in the data set, such as the arithmetic mean, geometric mean, harmonic mean, weighted mean, median, mode, percentile, quartile, truncated mean, etc.
[0084] The target data volume can be achieved using the following formula:
[0085]
[0086] in, is the target data volume to be determined; It is the candidate data volume of the target data volume corresponding to a single hierarchical training strategy, that is, the arithmetic mean of the absolute values of the differences between the sizes of each two sub-models in the multiple sub-models corresponding to a single hierarchical training strategy; is the size of the ith sub-model, is the size of the jth submodel, and n is the number of submodels.
[0087] The fault recovery method in this implementation method can dynamically change the target data amount for slicing in response to changes in the hierarchical training strategy by clarifying the target data amount for slicing and dynamically adjusting it based on the division of sub-models, thereby changing the size of the slice at the checkpoint, improving the ability of the slice to adapt to different hierarchical training strategies, thereby improving the rationality of the slice, and further reducing communication overhead, and improving resource utilization and transmission efficiency during the transmission process.
[0088] In some optional implementations of this embodiment, the capacity of the checkpoint receiving area is determined based on the following steps:
[0089] The first predicted capacity is obtained by multiplying the sum of the bandwidth between adjacent nodes and the bandwidth between GPU and CPU in the same node by the preset load quota and dividing it by the expected parameter update time. The expected parameter update time is the average update time of each host in each iteration of the training model.
[0090] The capacity of the preset checkpoint receiving area is divided by the expected time of parameter update to obtain a second predicted capacity;
[0091] The minimum value between the first predicted capacity and the second predicted capacity is used as the capacity of the checkpoint receiving area.
[0092] In this implementation, the bandwidth between adjacent nodes is usually a preset bandwidth value. The bandwidth between the GPU and the CPU in the same node is a preset bandwidth value. The capacity of the checkpoint receiving area can be a preset capacity at the initial time.
[0093] When transferring checkpoint slices, the capacity of the checkpoint receiving area of each storage location can be determined based on the following formula:
[0094]
[0095] Among them, m chunk is the capacity of the checkpoint receiving area, host bd is the bandwidth between adjacent nodes, GC bd is the bandwidth between GPU and CPU in the same node, p1 is the preset load quota, p2 is the capacity of the preset checkpoint receiving area, and t update is the expected time of parameter update, is the first predicted capacity, is the second predicted capacity, The minimum value between the first predicted capacity and the second predicted capacity is taken.
[0096] The fault recovery method in this implementation can accurately calculate the capacity of the checkpoint receiving area by clarifying the method for determining the capacity of the checkpoint receiving area, thereby reducing the communication overhead in the shard transmission of the checkpoint and improving the resource utilization and transmission efficiency during the transmission process.
[0097] For example, Figure 2 The present invention provides a flowchart of a method for recovering from a fault and determining a checkpoint saving frequency.
[0098] The fault recovery method in this embodiment may include: step S201, step S202 and step S203.
[0099] Step S201, when the target time for transferring the checkpoint to the CPU memory is less than or equal to the additional overhead time of the expected iteration time, an iteration target time is generated based on the expected time additional overhead ratio and the expected iteration time.
[0100] The target time for checkpoint transfer to CPU memory is the expected transfer time for checkpoint transfer to CPU memory, and the expected iteration time is the average iteration time of each host in each round of iteration of the training model.
[0101] The meaning of the average in this embodiment is the same as that of the average in the above embodiment, and can be obtained by using the same calculation method as in the above embodiment or a different technical method. This application does not impose any limitation on this and will not be repeated here.
[0102] The iteration target time is generated based on the expected time overhead ratio and the iteration expected time. The iteration target time can be obtained by multiplying the expected iteration time by the sum of the expected time overhead ratio and 1.
[0103] Step S202 : taking the quotient of the expected time for transmitting the checkpoint to the remote persistent storage device divided by the iteration target time as the first candidate saving frequency.
[0104] The expected time for transferring the checkpoint to the remote persistent storage device is the average time for transferring the checkpoint to the remote persistent storage device for each iteration of each host training the model.
[0105] Step S203, rounding down the first candidate saving frequency to obtain the checkpoint saving frequency.
[0106] Alternatively or additionally, the fault recovery method in this embodiment may include: step S204, step S205 and step S206.
[0107] Step S204, when the target time for checkpoint transmission to CPU memory is greater than the additional overhead time of the expected iteration time, the sum of the target time for checkpoint transmission to CPU memory, the expected time for checkpoint transmission to remote persistent storage device and the target time for back propagation excluding parameter update is calculated as the time overhead for checkpoint transmission.
[0108] The target time for back propagation excluding parameter update is the difference between the expected time for iteration and the expected time for parameter update, where the expected time for parameter update is the average update time per iteration for each host in the training model.
[0109] Step S205 : The quotient of the time overhead of the checkpoint transmission divided by the iteration target time is used as the second candidate storage frequency.
[0110] Step S206, rounding down the second candidate saving frequency to obtain the checkpoint saving frequency.
[0111] In this embodiment, the checkpoint saving frequency can be dynamically adjusted according to the actual existing resource conditions.
[0112] It is understandable that in the process of large model training, the relevant technology usually saves the training progress by regularly saving checkpoints, which will also affect the training progress to a certain extent. This embodiment integrates resources, determines the current training speed, and calculates the current checkpoint saving frequency to minimize the impact on the checkpoint saving progress.
[0113] In a specific example, the checkpoint saving frequency can be determined using the following formula:
[0114]
[0115]
[0116]
[0117] Among them, the expected time of iteration and the expected time of parameter update are t epoch and t update , the target time for checkpoint transfer to CPU memory is T CPU The expected time for a checkpoint to be transferred to a remote persistent storage device is t remote_persist , the expected time overhead ratio is p, p>0, the first candidate save frequency is The second candidate save frequency is k1 is the value of the checkpoint saving frequency when the target time for checkpoint transfer to CPU memory is less than or equal to the additional overhead time of the expected iteration time, and k2 is the value of the checkpoint saving frequency when the target time for checkpoint transfer to CPU memory is greater than the additional overhead time of the expected iteration time.
[0118] Among them, the target time for checkpoint transmission to CPU memory is T CPU , may be a preset value or a calculated value predetermined according to the actual application scenario or the experience of those skilled in the art, and this application does not limit this.
[0119] The fault recovery method provided in this embodiment clarifies the calculation method of the checkpoint saving frequency, so that the checkpoint saving frequency can be accurately and dynamically determined, and the adaptability of the checkpoint saving frequency is improved, thereby improving the efficiency of determining checkpoints in the fault recovery method, and further improving the efficiency of recovering from faults.
[0120] In some optional implementations of this embodiment, the target time for transferring the above checkpoint to the CPU memory may be generated based on the following steps:
[0121] The maximum value of the expected time for transferring the checkpoint to the CPU memory of the adjacent node and the expected time for transferring the checkpoint to the CPU memory of the node is used as the first prediction value for transferring the checkpoint to the CPU memory;
[0122] The second predicted value of the checkpoint transferred to the CPU memory is obtained by taking the sum of the first predicted value of the checkpoint transferred to the CPU memory and the expected time of the checkpoint transferred to the GPU memory of the adjacent node, and subtracting the back propagation target time excluding the parameter update;
[0123] The maximum value between the second predicted value and zero is used as the target time for transferring the checkpoint to the CPU memory.
[0124] In this optional implementation, the expected time for the checkpoint to be transferred to the CPU memory of the adjacent node is the average time for the checkpoint to be transferred to the CPU memory of the adjacent node for each iteration of each host of the training model.
[0125] The expected time to transfer a checkpoint to the node's CPU memory is the average time it takes to transfer a checkpoint to the node's CPU memory for each iteration of each host training the model.
[0126] The expected time to transfer a checkpoint to the GPU memory of a neighboring node is the average time it takes to transfer a checkpoint to the GPU memory of a neighboring node for each iteration of each host training the model.
[0127] A typical checkpoint is transferred from the GPU to the CPU. Locally on a node, it is copied from the GPU to the CPU memory and then transferred to the next adjacent node. The checkpoint can first be transferred from the node GPU to the GPU memory of the next adjacent node, and then from the GPU of the next adjacent node to the CPU memory of the next adjacent node.
[0128] Here, T CPUThe first predicted value of is the respective longest time for transmission to the CPU memory of the adjacent node and the node CPU memory. Since the copying from the node GPU to the node CPU and the transmission to the next adjacent node GPU can be performed in parallel, the maximum value is taken when calculating the first predicted value of the checkpoint transmission to the CPU memory.
[0129] T CPU It can be understood as the difference between the total time required to save the first prediction value to the GPU memory of the adjacent node and the checkpoint transferred to the CPU memory minus the back propagation target time excluding parameter update. If it is 0, it means that the time for the checkpoint to be transmitted to the remote end and the node CPU is less than one training time, and the impact is small. The main impact is the performance degradation caused by transmission to the remote persistent storage device.
[0130] In a specific example, the target time for transferring the checkpoint to the CPU memory can be determined using the following formula:
[0131]
[0132] Among them, T CPU is the target time for checkpoint transfer to CPU memory, t remote_CPU is the expected time for the checkpoint to be transferred to the CPU memory of the neighboring node, t local_CPU is the expected time for the checkpoint to be transferred to the node CPU memory, t remote_GPU is the expected time for checkpoint transfer to the GPU memory of the neighboring node, t epoch -t update is the target time for back propagation excluding parameter updates, t epoch is the expected time of iteration, t update is the expected time of parameter update.
[0133] The method for determining the target time for checkpoint transmission to CPU memory in this implementation clarifies the method for calculating the target time for checkpoint transmission to CPU memory, improves the accuracy of calculating the target time for checkpoint transmission to CPU memory, and thus improves the accuracy of calculating the checkpoint saving frequency.
[0134] In the present embodiment, a fault recovery device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.
[0135] This embodiment provides a fault recovery device, such as Figure 3 As shown, Figure 3is a schematic structural block diagram of a fault recovery device according to an embodiment of the present disclosure, the device comprising:
[0136] A checkpoint saving module 301 is used to use the model state as the current checkpoint when the model state of the model trained by the GPU of the node in the pipeline stage meets the checkpoint saving frequency of the fault recovery strategy, save the current checkpoint in the GPU memory of the node, and transmit the current checkpoint in the GPU memory of the node to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device for storage according to the checkpoint transmission mode and checkpoint saving location in the fault recovery strategy;
[0137] The fault recovery module 302 is used to load the most recently saved checkpoint from the CPU memory of the node to recover the fault when a fault occurs in the training process of the model trained in the pipeline stage. If the fault is a node fault but not a crash, the most recently saved checkpoint is loaded from the CPU memory of the node to recover the fault. If the fault is a node crash, the most recently saved checkpoint is loaded from the CPU memory of the next adjacent node to recover the fault. If the fault is a crash of multiple machines, the most recently saved checkpoint is loaded from a remote persistent storage device to recover the fault.
[0138] In some optional implementations of this embodiment, the checkpoint saving module is further used to:
[0139] Using a communication link between the GPU of the node and the GPU of the next adjacent node, the current checkpoint in the GPU memory of the node is transferred to the GPU memory of the next adjacent node, so that the GPU of the adjacent node saves the current checkpoint to the CPU of the adjacent node; and
[0140] When the GPU of a node receives a checkpoint transmitted by the GPU of the previous adjacent node, the received checkpoint is transmitted to the CPU memory of the node for storage.
[0141] In some optional implementations of this embodiment, the checkpoint saving module is further used to: slice the model state according to the target data volume to obtain the current slice of this checkpoint, and add a number to the current slice; and
[0142] The current slice with an additional number in the node's GPU memory is saved to the checkpoint receiving area with a corresponding number in the node's CPU memory, the checkpoint receiving area with a corresponding number in the CPU memory of the next adjacent node, and the checkpoint receiving area with a corresponding number in the remote persistent storage device.
[0143] In some optional implementations of this embodiment, the target data volume in the checkpoint saving module is determined based on the following steps:
[0144] Based on each of the multiple hierarchical training strategies of the model, the model is hierarchized into multiple sub-models, and an average of the absolute values of the differences between the sizes of every two sub-models in the multiple sub-models is determined as the candidate data amount of the target data amount;
[0145] The minimum value among multiple candidate data amounts corresponding to multiple hierarchical training strategies is used as the target data amount.
[0146] In some optional implementations of this embodiment, the capacity of the checkpoint receiving area in the checkpoint saving module is determined based on the following steps:
[0147] The first predicted capacity is obtained by multiplying the sum of the bandwidth between adjacent nodes and the bandwidth between GPU and CPU in the same node by the preset load quota and dividing it by the expected parameter update time. The expected parameter update time is the average update time of each host in each iteration of the training model.
[0148] The capacity of the preset checkpoint receiving area is divided by the expected time of parameter update to obtain a second predicted capacity;
[0149] The minimum value between the first predicted capacity and the second predicted capacity is used as the capacity of the checkpoint receiving area.
[0150] In some optional implementations of this embodiment, the checkpoint saving frequency in the checkpoint saving module is determined based on the following steps:
[0151] When the target time for transferring the checkpoint to the CPU memory is less than or equal to the additional overhead time of the expected iteration time, the iteration target time is generated based on the expected time additional overhead ratio and the expected iteration time. The target time for transferring the checkpoint to the CPU memory is the expected transfer time for transferring the checkpoint to the CPU memory, and the expected iteration time is the average iteration time of each host in each round of iteration of the training model.
[0152] The quotient of the expected time of transferring the checkpoint to the remote persistent storage device divided by the iteration target time is taken as the first candidate saving frequency. The expected time of transferring the checkpoint to the remote persistent storage device is the average time of transferring the checkpoint to the remote persistent storage device for each iteration of each host of the training model;
[0153] Round down the first candidate save frequency to obtain a checkpoint save frequency; and / or
[0154] When the target time for checkpoint transfer to CPU memory is greater than the additional overhead time of the expected time for iteration, the sum of the target time for checkpoint transfer to CPU memory, the expected time for checkpoint transfer to remote persistent storage device, and the target time for back propagation excluding parameter update is calculated as the time overhead for checkpoint transfer. The target time for back propagation excluding parameter update is the difference between the expected time for iteration and the expected time for parameter update. The expected time for parameter update is the average update time for each iteration of each host of the training model.
[0155] The quotient of the checkpoint transmission time overhead divided by the iteration target time is used as the second candidate preservation frequency;
[0156] The second candidate save frequency is rounded down to obtain the checkpoint save frequency.
[0157] In some optional implementations of this embodiment, the target time for transferring the checkpoint in the checkpoint saving module to the CPU memory is generated based on the following steps:
[0158] The maximum value of the statistical time of checkpoint transmission to the CPU memory of the adjacent node and the statistical time of checkpoint transmission to the CPU memory of the node is used as the first prediction value of checkpoint transmission to the CPU memory, the statistical time of checkpoint transmission to the CPU memory of the adjacent node is the average time of checkpoint transmission to the CPU memory of the adjacent node for each round of iteration of each host of the training model, and the statistical time of checkpoint transmission to the CPU memory of the node is the average time of checkpoint transmission to the CPU memory of the node for each round of iteration of each host of the training model;
[0159] The second predicted value of the checkpoint transferred to the CPU memory is obtained by taking the sum of the first predicted value of the checkpoint transferred to the CPU memory and the statistical time of the checkpoint transferred to the GPU memory of the adjacent node, and subtracting the statistical time of the back propagation excluding the parameter update. The statistical time of the checkpoint transferred to the GPU memory of the adjacent node is the average time of the checkpoint transferred to the GPU memory of the adjacent node for each iteration of each host of the training model.
[0160] The maximum value between the second predicted value and zero is used as the target time for transferring the checkpoint to the CPU memory.
[0161] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0162] The fault recovery device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0163] See also Figure 4 , Figure 4 1 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present disclosure, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0164] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0165] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0166] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0167] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0168] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.
[0169] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0170] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0171] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A fault recovery method, characterized in that: The method comprises: When the model state of the model trained by the pipeline stage of the GPU of the node meets the checkpoint saving frequency of the fault recovery strategy, the model state is used as the current checkpoint, and the current checkpoint is saved in the GPU memory of the node, and according to the checkpoint transmission mode and checkpoint saving position in the fault recovery strategy, the current checkpoint in the GPU memory of the node is transmitted to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device for storage; When the model trained in the pipeline stage fails during the training process, if the failure is a node failure but not a crash, the most recently saved checkpoint is loaded from the CPU memory of the node to recover the failure; if the failure is a node crash, the most recently saved checkpoint is loaded from the CPU memory of the next adjacent node to recover the failure; if the failure is a crash of multiple machines, the most recently saved checkpoint is loaded from the remote persistent storage device to recover the failure.
2. The method according to claim 1, characterized in that The step of transmitting the current checkpoint in the GPU memory of the node to the CPU memory of the next adjacent node according to the checkpoint transmission mode and the checkpoint storage location in the fault recovery strategy includes: Using a communication link between the GPU of the node and the GPU of the next adjacent node, the current checkpoint in the GPU memory of the node is transmitted to the GPU memory of the next adjacent node, so that the GPU of the adjacent node saves the current checkpoint to the CPU of the adjacent node; and When the GPU of a node receives a checkpoint transmitted by the GPU of the previous adjacent node, the received checkpoint is transmitted to the CPU memory of the node for storage.
3. The method according to claim 1, characterized in that The taking the model state as the current checkpoint includes: slicing the model state according to the target data volume to obtain a current slice of the current checkpoint, and adding a number to the current slice; The method of transmitting the current checkpoint in the GPU memory of the node to the CPU memory of the node, the CPU memory of the next adjacent node, and the remote persistent storage device includes: saving the current slice with an additional number in the GPU memory of the node to the checkpoint receiving area with a corresponding number in the CPU memory of the node, the checkpoint receiving area with a corresponding number in the CPU memory of the next adjacent node, and the checkpoint receiving area with a corresponding number in the remote persistent storage device.
4. The method according to claim 3, characterized in that The target data volume is determined based on the following steps: Based on each of the multiple hierarchical training strategies of the model, the model is hierarchized into multiple sub-models, and an average of the absolute values of the differences between the sizes of every two sub-models in the multiple sub-models is determined as the candidate data amount of the target data amount; The minimum value among the multiple candidate data amounts corresponding to the multiple hierarchical training strategies is used as the target data amount.
5. The method according to claim 3, characterized in that: The capacity of the checkpoint receiving area is determined based on the following steps: The first predicted capacity is obtained by multiplying the sum of the bandwidth between adjacent nodes and the bandwidth between the GPU and the CPU in the same node by the preset load quota and dividing it by the expected parameter update time, where the expected parameter update time is the average update time of each host per iteration for training the model; The capacity of the preset checkpoint receiving area is divided by the expected time of parameter update to obtain a second predicted capacity; The minimum value between the first predicted capacity and the second predicted capacity is used as the capacity of the checkpoint receiving area.
6. The method according to claim 1, characterized in that The checkpoint saving frequency is determined based on the following steps: When the target time for transferring the checkpoint to the CPU memory is less than or equal to the additional overhead time of the expected iteration time, generating an iteration target time based on the expected time additional overhead ratio and the expected iteration time, the target time for transferring the checkpoint to the CPU memory is the expected transfer time for transferring the checkpoint to the CPU memory, and the expected iteration time is the average of the iteration time of each round of iteration of each host for training the model; The quotient of the expected time of transferring the checkpoint to the remote persistent storage device divided by the iteration target time is taken as the first candidate saving frequency, wherein the expected time of transferring the checkpoint to the remote persistent storage device is the average time of transferring the checkpoint to the remote persistent storage device in each iteration of each host for training the model; Rounding down the first candidate save frequency to obtain the checkpoint save frequency; and / or When the target time for the checkpoint to be transmitted to the CPU memory is greater than the additional overhead time of the expected time for the iteration, the sum of the target time for the checkpoint to be transmitted to the CPU memory, the expected time for the checkpoint to be transmitted to the remote persistent storage device, and the target time for back propagation excluding parameter update is calculated as the time overhead for the checkpoint transmission, wherein the target time for back propagation excluding parameter update is the difference between the expected time for the iteration and the expected time for parameter update, wherein the expected time for parameter update is the average update time for each round of iteration of each host for training the model; The quotient of the time overhead of the checkpoint transmission divided by the iteration target time is used as the second candidate saving frequency; The second candidate save frequency is rounded down to obtain the checkpoint save frequency.
7. The method according to claim 6, characterized in that The target time for the checkpoint to be transferred to the CPU memory is generated based on the following steps: The maximum value of the statistical time of checkpoint transmission to the CPU memory of the adjacent node and the statistical time of checkpoint transmission to the CPU memory of the node is used as the first prediction value of the checkpoint transmission to the CPU memory, wherein the statistical time of checkpoint transmission to the CPU memory of the adjacent node is the average time of checkpoint transmission to the CPU memory of the adjacent node for each round of iteration of each host for training the model, and the statistical time of checkpoint transmission to the CPU memory of the node is the average time of checkpoint transmission to the CPU memory of the node for each round of iteration of each host for training the model; The second prediction value of the checkpoint transmitted to the CPU memory is obtained by taking the sum of the first prediction value of the checkpoint transmitted to the CPU memory and the statistical time of the checkpoint transmitted to the GPU memory of the adjacent node, and subtracting the statistical time of the back propagation except the parameter update, wherein the statistical time of the checkpoint transmitted to the GPU memory of the adjacent node is the average time of the checkpoint transmitted to the GPU memory of the adjacent node for each round of iteration of each host for training the model; The maximum value between the second predicted value and zero is used as the target time for transferring the checkpoint to the CPU memory.
8. A fault recovery device, characterized in that: The device comprises: A checkpoint saving module, for when the model state of the model trained by the GPU of the node in the pipeline stage meets the checkpoint saving frequency of the fault recovery strategy, using the model state as the current checkpoint, saving the current checkpoint in the GPU memory of the node, and transmitting the current checkpoint in the GPU memory of the node to the CPU memory of the node, the CPU memory of the next adjacent node, and a remote persistent storage device for saving according to the checkpoint transmission mode and checkpoint saving location in the fault recovery strategy; A fault recovery module is used to load the most recently saved checkpoint from the CPU memory of the node to recover the fault when a fault occurs in the training process of the model trained in the pipeline stage. If the fault is a node fault but not a crash, the most recently saved checkpoint is loaded from the CPU memory of the node to recover the fault; if the fault is a node crash, the most recently saved checkpoint is loaded from the CPU memory of the next adjacent node to recover the fault; if the fault is a crash of multiple machines, the most recently saved checkpoint is loaded from the remote persistent storage device to recover the fault.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the fault recovery method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the fault recovery method according to any one of claims 1 to 7.
Citation Information
Cited By
Distributed training fault recovery method and device, medium and computer program product
CN119201553A
Distributed training fault recovery method and device, medium and computer program product
CN119201553B
Large model training fault recovery method and device based on distributed memory management
CN119473732A
Large model training fault recovery method and device based on distributed memory management
CN119473732B
Fault-tolerant recovery method and system for training and reasoning tasks exceeding ten thousand cards
CN120066839A
