A fault-tolerant optimization method and device based on multiple GPUs

By using a hierarchical state transition mechanism and comprehensive cost scoring to select target GPUs, the problem of long interruption time during fault recovery in distributed computing clusters is solved. This enables proactive migration and smooth migration with low awareness, thereby improving system stability and fault tolerance.

CN123178144APending Publication Date: 2026-11-27ZHONGCHENG HUALONG COMPUTER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611354636.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing distributed computing clusters lack the ability to detect and prevent computing node failures in advance, resulting in long fault recovery interruptions and low load rebalancing efficiency in heterogeneous environments.

Method used

By acquiring telemetry data to predict the probability of failure, a hierarchical state transition mechanism is adopted, including three stages: environment preparation, static synchronization, and dynamic synchronization. The target GPU is selected using a comprehensive cost score to achieve active migration and low-perception smooth migration, avoiding long-term interruptions.

Benefits of technology

It enables proactive migration before a failure occurs, reduces training interruption time, improves system stability and fault tolerance agility, and adapts to performance optimization in heterogeneous environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178144A_ABST
    Figure CN123178144A_ABST
Patent Text Reader

Abstract

The application provides a multi-GPU-based fault-tolerant optimization method and device, the method comprising: obtaining telemetry data of a running GPU, and determining a fault prediction probability according to the telemetry data; in response to the fault prediction probability being greater than a first probability threshold and less than a second probability threshold, determining a target GPU based on a comprehensive cost score of an idle GPU, and performing static migration on the running GPU to enable the target GPU to complete an environment preparation operation and a static synchronization operation; wherein the comprehensive cost score comprises a topology transmission cost, a display memory matching cost, a computing power matching cost, a health degree cost and a communication cost; the second probability threshold is greater than the first probability threshold; and in response to the fault prediction probability being not less than the second probability threshold, performing a dynamic synchronization operation on the running GPU to migrate a computing task of the running GPU to the target GPU. The application actively migrates the computing task by prediction, thereby avoiding most foreseeable training interruptions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a fault-tolerant optimization method and apparatus based on multi-GPUs. Background Technology

[0002] In distributed computing clusters, the core challenge of fault tolerance lies in the significant differences in computing power, storage capacity, and communication bandwidth among different computing nodes. When a computing node in the cluster fails, it is not only necessary to quickly restore computing tasks but also to rebalance the load of each node; otherwise, performance mismatch will severely slow down the overall efficiency. Existing mainstream fault tolerance mechanisms typically follow a process of fault detection and reporting, state preservation, node changes and communication reorganization, task redistribution, and load rebalancing. However, in practical applications, existing fault tolerance mechanisms generally adopt a passive response mode, that is, the recovery process is only initiated after the fault actually occurs. This lacks the ability to detect and prevent computing node failures in advance, and for state transitions, existing solutions usually use a one-time full synchronization method, resulting in a long training interruption.

[0003] Therefore, there is an urgent need for a fault-tolerant optimization method and device based on multi-GPUs. Summary of the Invention

[0004] This invention provides a fault-tolerant optimization method and apparatus based on multi-GPUs, which realizes low-aware active migration of predictable faults and optimal overall cluster performance in heterogeneous environments, fundamentally solving the problem of long fault recovery interruption time.

[0005] In a first aspect, the present invention provides a fault-tolerant optimization method based on multiple GPUs, comprising: Acquire telemetry data from the running GPU and determine the fault prediction probability based on the telemetry data; In response to the fault prediction probability being greater than a first probability threshold and less than a second probability threshold, a target GPU is determined based on the comprehensive cost score of the idle GPU, and a static migration is performed on the running GPU to enable the target GPU to complete environment preparation and static synchronization operations; wherein, the comprehensive cost score includes topology transfer cost, memory matching cost, computing power matching cost, health cost, and communication cost; the second probability threshold is greater than the first probability threshold; In response to the failure prediction probability being not less than the second probability threshold, a dynamic synchronization operation is performed on the running GPU to migrate the computing tasks of the running GPU to the target GPU.

[0006] Secondly, the present invention provides a fault-tolerant optimization device based on multiple GPUs, comprising: The prediction module is used to acquire telemetry data of the running GPU and determine the fault prediction probability based on the telemetry data. The migration module, in response to the fault prediction probability being greater than a first probability threshold and less than a second probability threshold, determines the target GPU based on the comprehensive cost score of the idle GPU, and performs static migration for the running GPU to enable the target GPU to complete environment preparation and static synchronization operations; wherein, the comprehensive cost score includes topology transfer cost, memory matching cost, computing power matching cost, health cost, and communication cost; the second probability threshold is greater than the first probability threshold; The migration module also performs a dynamic synchronization operation on the running GPU in response to the fault prediction probability being not less than the second probability threshold, so as to migrate the computing tasks of the running GPU to the target GPU.

[0007] Thirdly, embodiments of the present invention also provide a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any of the first aspects of this specification.

[0008] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods described in any of the first aspects of this specification.

[0009] Fifthly, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the steps of the method described in any of the first aspects of this specification.

[0010] This invention provides a fault-tolerant optimization method and apparatus based on multiple GPUs. By constructing a hierarchical state transition mechanism based on fault prediction probability, traditional centralized fault recovery is decomposed into three ordered stages: environment preparation, static synchronization, and dynamic synchronization. When the fault prediction probability of a running node is greater than a first probability threshold but less than a second probability threshold, an early warning state is triggered. An idle GPU is selected as the target GPU, and then, through static synchronization, the background asynchronously completes the transmission of full and incremental data during the normal operation of the running node, overlapping with the training computation pipeline, thereby masking most of the data transmission time. When the fault prediction probability is not less than the second probability threshold, a transition state is triggered. At this time, dynamic synchronization only briefly pauses the original running node at the last moment to transmit a very small amount of state difference. In this way, through this step-by-step decoupling design, the inherent mode of fault recovery requiring long-term interruption of training is fundamentally changed, realizing low-aware or even zero-aware smooth transition of distributed computing tasks in foreseeable fault scenarios. Active transition is achieved before the running GPU actually fails, thus achieving fault tolerance. Attached Figure Description

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

[0012] Figure 1 This is a flowchart of a fault-tolerant optimization method based on multiple GPUs provided in an embodiment of the present invention; Figure 2 This is a hardware architecture diagram of a computing device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a fault-tolerant optimization device based on multiple GPUs provided in an embodiment of the present invention. Detailed Implementation

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

[0014] The inventors of this application have noted that existing fault-tolerance mechanisms in distributed computing clusters only initiate the recovery process after a failure actually occurs, and they employ indiscriminate treatment for computing failure nodes of different risk levels, thus prolonging downtime. The inventors of this application adopt a fault-tolerance optimization method that not only enables early detection and preventative intervention for computing node failures, but also establishes an effective gradient coordination between early warning preparation and emergency migration based on a tiered response strategy according to prediction results.

[0015] The following describes the specific implementation of the concept in this application.

[0016] Please refer to Figure 1 This invention provides a fault-tolerant optimization method based on multiple GPUs, comprising: Step 100: Obtain telemetry data from the running GPU and determine the fault prediction probability based on the telemetry data; Step 102: In response to the fault prediction probability being greater than a first probability threshold and less than a second probability threshold, the target GPU is determined based on the comprehensive cost score of the idle GPU, and a static migration is performed for the running GPU to enable the target GPU to complete environment preparation and static synchronization operations; wherein, the comprehensive cost score includes topology transfer cost, memory matching cost, computing power matching cost, health cost and communication cost; the second probability threshold is greater than the first probability threshold; Step 104: In response to the fault prediction probability being no less than the second probability threshold, perform a dynamic synchronization operation for the running GPU to migrate the computing tasks of the running GPU to the target GPU.

[0017] It should be noted that in practical applications, the first probability threshold and the second probability threshold can be dynamically adjusted based on the hardware reliability curve and business tolerance.

[0018] In this embodiment of the invention, a hierarchical state transition mechanism based on fault prediction probability is constructed. Traditional centralized fault recovery is decomposed into three ordered stages: environment preparation, static synchronization, and dynamic synchronization. When the fault prediction probability of a running node is greater than a first probability threshold but less than a second probability threshold, an early warning state is triggered. An idle GPU is selected as the target GPU. Then, during the normal operation of the running node, static synchronization asynchronously completes the transmission of full and incremental data in the background, overlapping with the training pipeline, thereby reducing data transmission time. When the fault prediction probability is not less than the second probability threshold, a transition state is triggered. At this time, dynamic synchronization only briefly pauses the original running node at the last moment to transmit a very small amount of state difference. Thus, through this step-by-step decoupling design, the inherent mode of fault recovery requiring long-term interruption of training is fundamentally changed. This achieves low-awareness or even zero-awareness smooth migration of distributed computing tasks in foreseeable fault scenarios, realizing proactive migration before the running GPU actually fails, achieving a balance between system stability and fault tolerance agility.

[0019] This invention combines fault prediction with hierarchical state transition, using comprehensive cost scoring to accurately select the optimal migration GPU in a heterogeneous environment. The migration process is decoupled into three stages: environment preparation, static synchronization, and dynamic synchronization. This minimizes training interruption time while ensuring state consistency, avoiding the performance degradation caused by traditional one-size-fits-all recovery methods. This method is primarily applied to distributed large-scale model training or inference scenarios involving multiple heterogeneous or homogeneous GPUs, aiming to solve the problems of long fault recovery interruption times and poor adaptability to heterogeneous loads through proactive prediction and hierarchical migration mechanisms.

[0020] The following description Figure 1 The execution method of each step is shown.

[0021] First, in step 100, telemetry data of the running GPU is acquired, and the fault prediction probability is determined based on the telemetry data, including: Collect telemetry data of the running GPU. The telemetry data includes hardware health indicators, computing load indicators, and communication and energy consumption indicators. Feature extraction of telemetry data is performed based on a sliding time window to obtain original time-series features and statistically derived features. The original time-series features and statistically derived features are input into the pre-trained fault prediction model to obtain the probability value of hardware failure occurring in the running GPU within a preset time period in the future, which is used as the fault prediction probability.

[0022] It's important to note that the running GPU refers to any computing device unit within the cluster that is currently executing a task. For example, device register states can be directly read via low-level hardware probes (such as the NVML interface), application-layer runtime context can be captured through training framework hooks, and distributed interaction behavior can be recorded using a collection of communication libraries. All collected metrics are aligned to the same timeline using a unified timestamp to eliminate time-series biases in multi-source heterogeneous data. This comprehensive data acquisition strategy overcomes the limitations of traditional fault-tolerant solutions that rely solely on passive detection of lost heartbeats or hard errors, enabling the system to delve into the micro-level operational state of computing nodes to capture potential anomalies.

[0023] Specifically, hardware health metrics constitute the basic feature space for fault prediction, including but not limited to instantaneous system power consumption of computing nodes, computing core temperature, memory chip temperature, clock throttling ratio, and ECC correction history. Clock throttling ratio reflects the proportion of time per unit time that is reduced due to overheating or overcurrent, directly quantifying thermal stress accumulation. ECC correction history records the cumulative number of single-bit correctable errors and double-bit detectable errors, effectively characterizing the physical aging of the storage medium. These metrics are often considered explicit precursors to faults; abnormal fluctuations in these metrics often indicate that the hardware is in a sub-healthy state. Computational load metrics are used to correlate fault causes with operational pressure, including but not limited to computing unit utilization, memory bandwidth utilization, actual core operating frequency, actual memory operating frequency, used memory capacity, and effective computation per training iteration. By analyzing these metrics, fault prediction models can distinguish between normal business peaks and abnormal load surges, avoiding false alarms caused by instantaneous high load. Meanwhile, this invention also introduces communication and energy consumption indicators as latent fault characteristics, including but not limited to the total communication time and total energy consumption within a single training iteration. In distributed computing clusters, many progressive faults (such as capacitor aging in power modules or performance degradation of a certain module) do not initially trigger any hardware alarms, but cause nodes to consume more energy or spend longer communication times when processing the same task. By incorporating this indicator as an independent feature category into the monitoring system and combining it with time-series analysis, this slow degradation trend can be accurately captured, thereby significantly improving the prediction probability of non-sudden, progressive faults.

[0024] In one specific approach, considering that fault evolution is a dynamic process, isolated instantaneous values ​​often lack discriminative power. Therefore, this embodiment of the invention employs a fixed-length sliding time window (e.g., 30 seconds, corresponding to 60 acquisition steps) to slice continuously sampled telemetry data. Within each window, not only is the original time series retained as a feature, but statistically derived features are further calculated, including but not limited to window mean, rate of change, window peak value, and volatility. Through this fusion of the original time series and statistically derived features, the fault prediction model's ability to characterize fault precursor trends is enhanced, enabling the model to extract true degradation signals from noise.

[0025] In one specific approach, the fault prediction model can be constructed using a Lightweight Causal Temporal Convolutional Network (Lite-TCN). This network structure contains multiple layers of causal dilated convolutions, enabling it to capture long-range historical dependencies without introducing future information and handle hardware telemetry data with temporal causal characteristics. Specifically, the fault prediction model is deployed on the node's CPU side, without consuming GPU computing resources. The model's input is a feature tensor of [T, F], where T is the number of time steps, and F is the total number of features, including the original temporal features and statistically derived features; the output is a probability value representing the likelihood of the GPU experiencing a hard failure within a preset time period (e.g., 60 seconds). During the model training phase, in addition to using real historical fault data as positive samples, various hardware anomalies can be simulated through fault injection techniques to generate a large number of synthetic positive samples, thus addressing the class imbalance problem caused by the scarcity of fault samples in the production environment. It should be noted that although this embodiment uses Lite-TCN as an example for illustration, in practical applications, LSTM, Transformer or other time series prediction models can also be selected according to computing power constraints and accuracy requirements. As long as the probability output function based on multidimensional telemetry data can be realized, they all fall within the protection scope of this application.

[0026] In this invention, through the above-mentioned multi-dimensional telemetry data acquisition, refined feature engineering, and targeted time series modeling, not only can explicit hardware errors be identified, but also implicit indicators such as communication duration and iterative energy consumption can be used to understand progressive performance degradation. This provides accurate and reliable decision-making basis for the graded state transition in the aforementioned embodiments, ensuring that the proactive fault tolerance strategy can be correctly triggered within the optimal window before the fault actually occurs.

[0027] In step 102, during the environment preparation operation, the basic environment initialization for running the GPU computing task is completed on the target GPU, and the target GPU is connected to the GPU cluster's collective communication domain in a non-computational participation state. In static synchronization operations, while the running GPU is in normal operation, the full state data and incremental state data of the running GPU are asynchronously transmitted to the target GPU.

[0028] Specifically, in the environment preparation process, the target GPU is connected to the aggregate communication domain of the distributed computing cluster in a non-computational participation state, and the computational load weight of the running GPU is reduced. Specifically, a non-computational participation state means that although the target GPU has joined the communication group and can receive broadcast or multicast messages, it does not participate in actual aggregate operations, acting only as a passive data receiver or listener. This allows for the initialization of the runtime environment and the loading of dependent libraries without disrupting the existing training schedule. Simultaneously, reducing the computational load weight of the running GPU can be achieved by reducing its micro-batch size or lowering the computing frequency, reducing the thermal stress accumulation and power consumption of the original running GPU, and lowering the probability of physical damage before the migration is complete.

[0029] In a preferred embodiment, asynchronously transferring full state data and incremental state data of the running GPU to the target GPU includes: Allocate video memory space on the target GPU and construct a computation graph; The full state data of the running GPU is transferred to the memory space of the target GPU via a point-to-point transmission channel. After the baseline transfer is completed, the incremental state data updated in this iteration is asynchronously transferred to the target GPU after each training iteration is completed. The transfer process overlaps with the forward and backward computation pipelines of the next iteration.

[0030] Specifically, in the static synchronization operation, pre-allocating video memory and constructing a computation graph on the target GPU eliminates the additional latency caused by memory allocation and kernel compilation during the dynamic synchronization phase, ensuring that the target GPU is in a warm-start state when taking over computation tasks. The transmission of full state data is performed using low-priority background tasks, utilizing only idle bandwidth to avoid preempting main training communication resources. More importantly, after the Nth iteration computation is completed, the incremental state data transmission generated by that iteration immediately begins. Simultaneously, the running GPU seamlessly starts the forward computation and backward propagation of the N+1th iteration. Since the incremental data volume is much smaller than the full data volume, and the transmission and computation are completely parallel on the timeline, the data transmission time is masked by the computation time, resulting in almost no loss in training throughput perceived by the user.

[0031] In this embodiment of the invention, the execution details of synchronization are further refined. The initialization overhead of the dynamic stage is eliminated by pre-constructing the computation graph and pre-allocating the video memory. The pipeline overlap technique is used to enable the incremental data transmission and the computation of the next iteration to be executed in parallel, thus masking the transmission delay.

[0032] In step 104, during the dynamic synchronization operation, after the running GPU completes the parameter update for the current iteration, the running GPU is controlled to pause submitting new data processing batches, and the final state difference data of the running GPU is transmitted to the target GPU.

[0033] In this embodiment of the invention, controlling the running GPU to pause the submission of new data processing batches and transmitting the final state difference data of the running GPU to the target GPU is the only stage in the entire migration process that causes service interruption. Specifically, after the running GPU completes the parameter update of the current iteration and locks the state, the submission of new batches is paused, and only a very small amount of final state difference (usually only the increment of 1 to 2 iterations) and runtime context data are transmitted.

[0034] In a preferred embodiment, after transmitting the final state difference data of the running GPU to the target GPU, the method further includes: performing a sharded parallel hash check on the state data of the running GPU and the target GPU to verify data consistency.

[0035] Specifically, each state tensor data is divided into contiguous memory slices of a fixed size. A lightweight hash kernel on the GPU is used to compute the digest information (such as SHA-256) of each slice in parallel. Finally, the hash values ​​of all slices are concatenated to form the complete state fingerprint. In this way, the parallel computing power of the GPU is fully utilized, which not only ensures data consistency but also reduces the verification time from seconds to milliseconds, significantly shortening the effective training interruption time.

[0036] In one specific implementation, after the dynamic synchronization operation is completed and data consistency is confirmed, a seamless switch of the communication domain is required to restore the full cluster computing power. For example, through the dynamic member change interface of the aggregate communication, the running GPU is removed from the aggregate communication domain, and the target GPU is switched from a non-computational participant state to a formal member state; the communication route of the aggregate communication domain is reconstructed based on the pre-stored topology template; after performing connectivity verification, the target GPU is added to the set of running compute nodes. Specifically, this process utilizes the native member management API provided by the distributed communication library, rather than the traditional method of destroying and rebuilding the entire communication group. Since the target GPU has already connected to the communication domain and kept listening during the environment preparation stage, it is only necessary to modify its role flag in the communication group to enable it to participate in aggregate operations such as AllReduce or AllGather, which can instantly complete the identity change. At the same time, the running GPU is logically isolated from the communication group and no longer receives or sends any training-related communication data packets. This switching mechanism based on dynamic GPU state changes avoids the additional overhead of hundreds of milliseconds or even seconds caused by re-initializing the communication context, exchanging keys, and establishing new connections, ensuring the atomicity and immediacy of traffic switching. The pre-stored topology template is a set of configurations pre-generated and persistently stored during cluster deployment or idle periods, covering various possible node combination scenarios. For example, the topology template may include physical topology connection information, such as the connection medium type (NVLink, PCIe, RoCE, etc.) between all computing nodes in the cluster, single-link effective bandwidth, fixed transmission latency, cross-machine hop count, and the NUMA node or rack number to which it belongs. It may also include pre-calculated optimal communication domain configurations for common node numbers and combinations, such as grouping strategies for data parallelism, tensor parallelism, or pipelined parallelism, the optimal topology of the communication ring, routing algorithms for aggregated communication, and channel priority configurations. When a failover occurs, the corresponding template configuration is directly indexed and loaded based on the current GPU set, eliminating the need for time-consuming bandwidth testing, latency measurement, or route negotiation calculations on-site. This reduces communication recovery time from traditional second-level probing to millisecond-level loading, significantly shortening the effective training interruption time.

[0037] To further ensure the successful participation of the migrated target GPU in distributed computing tasks, connectivity verification is required. This verification typically employs lightweight empty set communication operations to check the link health and synchronization correctness under the new topology. After successful verification, the global training state is updated, officially marking the target GPU as running, and new data processing batches are distributed to it, allowing it to fully take over the training tasks of the original running GPU. This step constitutes the final safety line of fault tolerance, preventing silent errors caused by inconsistencies between template configuration and actual physical state, thus ensuring high availability and high throughput for distributed training tasks even in the face of node failures.

[0038] In step 102, the target GPU is determined based on the comprehensive cost score of the idle GPU, including: Idle GPUs with available video memory capacity and standard computing power not lower than the running GPU are identified as candidate GPUs; For each candidate GPU, execute: The topology transmission cost is determined based on the relative duration of static synchronization in static migration, the relative duration of interruption in dynamic synchronization operation, and the topology weight coefficient of the candidate GPU. The memory matching degree is determined based on the available memory capacity of the candidate GPU and the memory usage of the running GPU. The memory matching degree is normalized and then multiplied by the memory weight coefficient to obtain the memory matching cost. The computing power matching degree is determined based on the standard computing power of the candidate GPU and the standard computing power of the running GPU. The computing power matching degree is normalized and then multiplied by the computing power weight coefficient to obtain the computing power matching cost. The health cost is obtained based on the failure prediction probability and health weight coefficient of the candidate GPU. The communication cost is obtained based on the increase in communication time and communication weight coefficient before and after the migration. The comprehensive cost score is obtained by summing the topology transmission cost, memory matching cost, computing power matching cost, health cost, and communication cost. The candidate GPU corresponding to the minimum comprehensive cost score is determined as the target GPU.

[0039] Specifically, topology transfer cost measures the time loss of the migration process on computational tasks; memory matching cost reflects the compatibility between the target GPU's memory capacity and the current memory usage of the original running GPU, aiming to avoid secondary overflow due to memory fragmentation or insufficient capacity after migration; computing power matching cost measures the difference in standard computing power between the target GPU and the original running GPU, which is also normalized to prevent the overall cluster bottleneck caused by computing power mismatch; health cost measures the expected risk of the target GPU itself failing; communication cost characterizes the continuous loss of long-term computational tasks caused by changes in communication topology after the target GPU joins the running cluster. Specifically, communication latency with GPUs on the same physical node is low, so this cost is minimal, but communication across GPUs on different physical nodes increases global communication overhead and continues to affect all remaining computational tasks, resulting in a significant cost. Thus, this invention constructs a refined target selection mechanism for heterogeneous environments based on a multi-dimensional comprehensive cost score.

[0040] In one specific implementation, the topology transmission cost is determined by the following formula: in, For the first g Topology transfer cost for each candidate GPU; The relative duration of static synchronization is , and the total duration of static synchronization is . t static Average wall clock duration per training iteration T iter The ratio; The relative duration of the interruption is the effective interruption duration during training. t suspend Average wall clock duration per training iteration T iter The ratio; ε It is a constant, a numerically stable minimum quantity, to avoid the denominator being 0; , These are the first and second weighting coefficients in the topological weighting coefficients, respectively.

[0041] Specifically, the total duration of static synchronization t static Total warm-up time for the target GPU environment t w Transmission duration with full baseline t base The sum; full baseline transmission time t base Size of the persistent state to be migrated M total With effective bandwidth for cross-GPU data transfer B linkThe ratio of the fixed startup delay of a single transmission t latency (i.e., the sum of the fixed latency of data transfer from the original running GPU to the target GPU) Furthermore, the total size of the persistent state to be migrated is the sum of the total size of the model's static parameters (weights and biases), the total size of the optimizer's dynamic state, and the size of the runtime state. Effective training interruption duration t suspend That is, the user-perceived training pause time is equal to the dynamic transmission duration. t dyn Communication domain switching time t switch (i.e., the sum of NCCL communication domain reconstruction and switching time); dynamic transmission time t dyn To dynamically track and synchronize data volume M dy With effective bandwidth for cross-GPU data transfer B link The ratio of the fixed startup delay of a single transmission t latency The sum of, The amount of data to dynamically synchronize is determined by the following formula: in, k The number of lag iterations for incremental catch-up is usually 1 or 2, etc. This represents the total size of the model's static parameters (weights and biases). This represents the total size of the optimizer's dynamic state. Size of the runtime state; To calculate the cumulative number of training iterations in the task, This is an estimate of the state increment for a single iteration. In this step, the total overhead of the entire migration process, the total static synchronization time, is the sum of the effective training interruption time.

[0042] In this embodiment of the invention, the topology transmission cost is not simply an accumulation of transmission time, but is characterized by specific nonlinear functions representing the static synchronization performance loss index and the dynamic interruption performance loss index, respectively. The static synchronization performance loss index is characterized by the first term in the formula, exhibiting a marginal decrease in performance as the relative duration of static synchronization increases: when the synchronization duration is short, each additional point of synchronization time results in a significant throughput loss; when the synchronization duration is long, the impact of the additional synchronization time on throughput gradually weakens. The dynamic interruption performance loss index is characterized by the second term in the formula, with a sharp increase in penalty as the relative interruption duration approaches a preset critical value: when the interruption duration approaches one complete iteration, training continuity is severely disrupted, and the service-perceived cost increases nonlinearly. During the hierarchical state transition process, static synchronization is executed asynchronously in the background during the normal operation of the running GPU, and its impact on training throughput is mainly reflected in the encroachment on communication bandwidth. The dynamic synchronization phase requires pausing the submission of new batches of running GPUs, directly leading to training interruption. Therefore, a function with a critically sharp increase characteristic must be used to impose a severe penalty, forcing the scheduler to prioritize topology paths that can guarantee a switch within a safe window.

[0043] In one specific implementation, the health cost is determined by the following formula: in, For the first g Fault prediction probability of each candidate GPU; This is the weighting coefficient for health status.

[0044] In this embodiment of the invention, the health cost uses a non-linear mapping to avoid the problem of insufficient discrimination caused by linear weighting in the high-risk interval, ensuring that when faced with multiple sub-healthy GPUs, the most dangerous one can be accurately identified and excluded, thereby improving the long-term stability after migration.

[0045] In one specific implementation, communication cost Determined by the following formula: in, For the first g The communication time increment of each candidate GPU before and after migration is the difference between the estimated average set communication time per iteration of the new cluster after the candidate GPU is added (which can be found from the pre-stored topology template and does not need to be calculated in real time) and the average set communication time per iteration of the original cluster before migration. T iter The average wall clock duration for a single training iteration; This is the communication weighting coefficient.

[0046] In one specific implementation, the memory matching cost Determined by the following formula: in, For the first g The memory matching degree of each candidate GPU; For the first g The available video memory capacity of each candidate GPU; The amount of video memory used by the running GPU; , These represent the minimum and maximum memory matching scores among all candidate GPUs, respectively. ε This is a constant, a stable and extremely small quantity, used to prevent the denominator from being zero. Similarly, the computing power matching cost is also obtained based on the same normalization method as the memory matching cost.

[0047] It should be noted that the weighting coefficients used for the above costs can be determined according to the actual application scenario and user needs.

[0048] In this embodiment of the invention, the final comprehensive cost score is the sum of the above five costs. The candidate GPU with the smallest score is selected as the target GPU. Through this multi-dimensional and non-linear evaluation mechanism, the abstract migration decision is transformed into a quantifiable and interpretable technical solution. This not only solves the problem of simple linear indicators failing in heterogeneous environments and ensures that the selected target GPU is optimal in terms of physical connectivity, but also ensures the maximization of the overall training throughput of the cluster after migration. This provides the optimal physical basis for the successful execution of subsequent hierarchical state migration and significantly improves the intelligence level and robustness of fault-tolerant processing.

[0049] Following step 104, the following is also included: In response to a sudden failure of a running GPU, the running GPU is removed from the running GPU cluster, and the available resources of the remaining running GPUs are acquired; The computation task is viewed as a directed acyclic graph, where each node is a computation block. The compute blocks on the running GPU are divided into fragments that do not exceed the available resources and allocated to different remaining running GPUs; Insert point-to-point transfer operations between the partitioned computational blocks.

[0050] In this embodiment of the invention, in addition to the aforementioned proactive prediction and hierarchical migration mechanisms, distributed computing clusters may also face unpredictable sudden hardware failures. To address such extreme scenarios, a passive recovery strategy is also provided. In response to the detection of a sudden failure, the faulty GPU is removed from the running cluster, and the available resource vector of the remaining computing GPUs is obtained. Specifically, a sudden failure here refers to hard anomalies that occur suddenly without meeting the aforementioned failure prediction probability threshold, such as heartbeat signal timeout loss, underlying driver errors, uncorrectable memory ECC errors, or physical link interruptions. Once such a situation occurs, the faulty GPU is immediately logically isolated from the current running cluster to prevent the error from spreading. Then, the available resources of all remaining healthy running GPUs are collected. For example, an available resource vector is constructed based on these available resources, including but not limited to the static specifications of each remaining running GPU node (such as total video memory capacity), dynamic runtime data (such as currently used video memory, distribution of free video memory fragmentation), and real-time topology bandwidth between running GPUs. Based on these available resources, an accurate data foundation is provided for subsequent fine-grained reorganization, avoiding secondary failures caused by decisions based on outdated or coarse information.

[0051] Specifically, traditional recovery schemes often maintain the original pipeline or tensor parallel partitioning granularity unchanged. This is highly susceptible to causing the entire recovery process to stall in heterogeneous environments due to insufficient memory on a single remaining running GPU. This invention breaks the limitation of fixed partitioning, treating the computational task as a directed acyclic graph (DAG), where nodes represent fine-grained computational blocks. For example, a standard Transformer layer is no longer considered an indivisible whole, but is further decomposed into multiple independent sub-blocks such as QKV linear projection, multi-head attention computation, output projection, and feedforward networks. When it is found that the remaining memory of a remaining running GPU cannot accommodate the complete layer from the original faulty GPU, the layer is automatically divided into multiple smaller fragments and placed on multiple remaining running GPUs. This granular partitioning mechanism fundamentally solves the problem of large models (i.e., computational tasks) being unable to be fully loaded under heterogeneous memory constraints.

[0052] It should be noted that the process iterates through all computational block boundaries and marks the split points, only running at the split points to split segments; and the split points must simultaneously meet the following conditions: there is only explicit input-output tensor interaction on both sides of the split point, with no shared intermediate states or shared caches; the model parameters and optimizer states can be completely separated along the split point, with no shared parameters across split points; the split computational blocks can be independently scheduled and executed, and the gradients can be completely backpropagated through the boundary tensors during backpropagation; the split points are not located inside the fusion operator, the state system operator, the execution range of the set communication operator, or the activation recomputation segment.

[0053] In a preferred embodiment, dividing the computation blocks on the running GPU into fragments that do not exceed available resources and allocating them to different remaining running GPUs further includes: Using a heuristic algorithm, the computation blocks on the running GPU are arranged in descending order of processing size, and then placed into the remaining computing GPUs with the most abundant video memory and the lowest communication cost. When the remaining GPU cannot accommodate the computation block, a portion of the optimizer state of the computation block is unloaded to external storage, or the target operator of the computation block is selected to be discarded and activated forward and recalculated during backpropagation to re-evaluate the allocation scheme.

[0054] In this embodiment of the invention, considering the extremely high real-time requirements of fault recovery, precise algorithms such as integer linear programming are often too time-consuming. Therefore, a heuristic algorithm is adopted: First, all computational blocks to be allocated are sorted from largest to smallest according to their memory usage, prioritizing the largest blocks that are most difficult to place. Then, the remaining running GPUs are traversed, and the running GPU with the largest current free memory and the highest communication bandwidth with upstream dependent nodes is selected as the target. In this way, the deadlock phenomenon of large blocks having nowhere to be placed due to small blocks occupying space first can be effectively avoided, while also taking into account data transmission efficiency. It should be noted that although this embodiment uses memory availability and communication cost as the sorting criteria, in practical applications, other indicators such as node computing power margin and NUMA affinity can also be combined for multi-dimensional weighted sorting. As long as the idea of ​​heuristic fast solution is followed, it is within the protection scope of this application. However, if the remaining running GPU computing nodes still cannot accommodate a certain computational block, a collaborative optimization strategy is triggered, such as unloading part of the optimizer state to external storage medium, or discarding the forward activation of the target operator in the selected computational block and recalculating it during backpropagation. For optimizer state unloading, priority is given to states with large data volumes but relatively low access frequency (such as the second-order moment estimation variance of the Adam optimizer), which are asynchronously swapped out to host memory, with GPU memory only prefetched during parameter updates. For activation recomputation, by analyzing the ratio of computational intensity to activation value in each operator within a computation block, operators with lightweight computation but large activations (such as intermediate tensors after certain nonlinear activation functions) are automatically selected. Their outputs are not saved during forward propagation, but are recomputed using the input during backpropagation. These two strategies can be used individually or in combination depending on the scarcity of remaining resources, thereby maximizing the utilization of available resources in the heterogeneous cluster while ensuring training convergence.

[0055] In this embodiment of the invention, to address unpredictable sudden failures, a granular model partitioning and reorganization strategy based on directed acyclic graphs, coupled with an adaptive offloading / recomputation collaborative strategy, breaks the constraints of fixed parallel partitioning. This strategy dynamically divides model computation blocks based on the memory fragmentation of remaining heterogeneous nodes and quickly solves feasible allocation schemes using heuristic algorithms. This fallback mechanism ensures that even under extreme failure conditions, large model training tasks remain recoverable, forming a comprehensive three-dimensional fault-tolerant system of prediction, prevention, and recovery, significantly improving the robustness and resource utilization efficiency of the distributed computing cluster.

[0056] In a preferred embodiment, it further includes: The running GPU that malfunctions is identified as a faulty GPU and moved to the faulty cluster; Start automated diagnostic scripts in the faulty cluster to perform hardware resets, stress tests, and health checks; When the health check passes, the faulty GPU is marked as healthy and transferred to the idle cluster; the idle cluster consists of several idle GPUs. When an idle GPU is performing a computing task, the idle GPU is transferred to a running cluster; the running cluster consists of several running GPUs that perform computing tasks.

[0057] In this embodiment of the invention, a heterogeneous GPU cluster is also constructed, which includes a faulty GPU cluster, an idle GPU cluster, and a running GPU cluster. Each GPU transitions between clusters through state transitions. When a running GPU fails, it is marked as a faulty GPU and moved to the faulty GPU cluster. After the fault is resolved, it is marked as healthy and transferred to the idle GPU cluster. When an idle GPU in the idle cluster is used to run a task, it is marked as running and transferred to the running GPU cluster. This forms a complete closed loop of fault-repair-standby-run-fault, ensuring a continuous supply of healthy GPUs.

[0058] like Figure 2 , Figure 3 As shown, this embodiment of the invention provides a fault-tolerant optimization device based on multiple GPUs. The device embodiment can be implemented in software, hardware, or a combination of both. From a hardware perspective, as... Figure 2 The diagram shown is a hardware architecture diagram of a computing device containing a multi-GPU-based fault-tolerant optimization device according to an embodiment of the present invention. (Except for...) Figure 2 In addition to the processor, memory, network interface, and non-volatile memory shown, the computing device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing packets. Taking software implementation as an example, such as... Figure 3As shown, a device, in a logical sense, is formed by the CPU of its computing device reading the corresponding computer program from non-volatile memory into memory for execution. This embodiment provides a fault-tolerant optimization device based on multiple GPUs, which includes: The prediction module 300 is used to acquire telemetry data of the running GPU and determine the fault prediction probability based on the telemetry data. Migration module 302, in response to the fault prediction probability being greater than a first probability threshold and less than a second probability threshold, determines the target GPU based on the comprehensive cost score of the idle GPU, and performs static migration for the running GPU, so that the target GPU completes environment preparation operations and static synchronization operations; wherein, the comprehensive cost score includes topology transmission cost, memory matching cost, computing power matching cost, health cost and communication cost; the second probability threshold is greater than the first probability threshold; The migration module 302 also performs a dynamic synchronization operation on the running GPU in response to the fault prediction probability being not less than the second probability threshold, so as to migrate the computing tasks of the running GPU to the target GPU.

[0059] In some specific implementations, the prediction module 300 can be used to perform the above step 100, and the migration module 302 can be used to perform the above steps 102 and 104.

[0060] Since the contents of the above-described apparatus are based on the same concept as the method embodiments of the present invention, the specific contents can be found in the descriptions in the method embodiments of the present invention, and will not be repeated here.

[0061] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on a multi-GPU-based fault-tolerant optimization device. In other embodiments of the present invention, a multi-GPU-based fault-tolerant optimization device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0062] The information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the method embodiment of the present invention, and the specific details can be found in the description of the method embodiment of the present invention, and will not be repeated here.

[0063] This invention also provides a computing device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements a multi-GPU-based fault-tolerant optimization method according to any embodiment of this invention.

[0064] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform a multi-GPU-based fault-tolerant optimization method according to any embodiment of this invention.

[0065] Embodiments of this application also provide a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium and executes the computer program, causing the computer device to perform any of the multi-GPU-based fault-tolerant optimization methods described in the above embodiments.

[0066] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0067] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0068] Storage media embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0069] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0070] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.

[0071] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0072] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A fault-tolerant optimization method based on multi-GPUs, characterized in that, include: Acquire telemetry data from the running GPU and determine the fault prediction probability based on the telemetry data; In response to the fault prediction probability being greater than a first probability threshold and less than a second probability threshold, a target GPU is determined based on the comprehensive cost score of the idle GPU, and a static migration is performed on the running GPU to enable the target GPU to complete environment preparation and static synchronization operations; wherein, the comprehensive cost score includes topology transfer cost, memory matching cost, computing power matching cost, health cost, and communication cost; the second probability threshold is greater than the first probability threshold; In response to the failure prediction probability being not less than the second probability threshold, a dynamic synchronization operation is performed on the running GPU to migrate the computing tasks of the running GPU to the target GPU.

2. The method according to claim 1, characterized in that, The step of acquiring telemetry data of the running GPU and determining the fault prediction probability based on the telemetry data includes: Collect telemetry data of the running GPU, including hardware health indicators, computing load indicators, and communication and energy consumption indicators; Based on a sliding time window, feature extraction is performed on the telemetry data to obtain original time-series features and statistically derived features; The original time-series features and the statistically derived features are input into a pre-trained fault prediction model to obtain the probability value of the running GPU occurring a hardware failure within a preset time period in the future, which is used as the fault prediction probability.

3. The method according to claim 1, characterized in that, The environmental preparation operations include: The basic environment initialization for the computing task of the running GPU is completed on the target GPU, and the target GPU is connected to the collective communication domain of the GPU cluster in a non-computational participation state; In the static synchronization operation, under the normal operating state of the running GPU, the full state data and incremental state data of the running GPU are asynchronously transmitted to the target GPU; and / or, In the dynamic synchronization operation, after the running GPU completes the parameter update for the current iteration, the running GPU is controlled to pause the submission of new data processing batches, and the final state difference data of the running GPU is transmitted to the target GPU.

4. The method according to claim 3, characterized in that, Asynchronously transmitting the full state data and incremental state data of the running GPU to the target GPU includes: Allocate video memory space and construct a computation graph on the target GPU; The full state data of the running GPU is transmitted to the memory space of the target GPU via a point-to-point transmission channel. After baseline transfer is completed, at the end of each training iteration, the incremental state data updated in this iteration is asynchronously transferred to the target GPU, and the transfer process overlaps with the forward and backward computation pipelines of the next iteration; and / or, After transmitting the final state difference data of the running GPU to the target GPU, the method further includes: performing a sharded parallel hash verification on the state data of the running GPU and the target GPU to verify data consistency.

5. The method according to claim 1, characterized in that, The determination of the target GPU based on the comprehensive cost score of the idle GPU includes: Idle GPUs with available video memory capacity and standard computing power not lower than the running GPU are identified as candidate GPUs; For each of the candidate GPUs, perform the following: The topology transmission cost is determined based on the relative duration of static synchronization in the static migration, the relative duration of interruption in the dynamic synchronization operation, and the topology weight coefficient of the candidate GPU. The memory matching degree is determined based on the available memory capacity of the candidate GPU and the memory usage of the running GPU. The memory matching degree is normalized and then multiplied by the memory weight coefficient to obtain the memory matching cost. The computing power matching degree is determined based on the standard computing power of the candidate GPU and the standard computing power of the running GPU. The computing power matching degree is normalized and then multiplied by the computing power weight coefficient to obtain the computing power matching cost. The health cost is obtained based on the failure prediction probability and health weight coefficient of the candidate GPU. The communication cost is obtained based on the increase in communication time and communication weight coefficient before and after the migration. The comprehensive cost score is obtained by summing the topology transmission cost, the memory matching cost, the computing power matching cost, the health cost, and the communication cost. The candidate GPU corresponding to the minimum comprehensive cost score is determined as the target GPU.

6. The method according to claim 5, characterized in that, The topology transmission cost is determined by the following formula: in, For the first g Topology transfer cost for each candidate GPU; This refers to the relative duration of static synchronization. This refers to the relative duration of the interruption. ε It is a constant; , These are the first weighting coefficient and the second weighting coefficient in the topological weighting coefficients, respectively; And / or, The health cost is determined by the following formula: in, For the first g Fault prediction probability of each candidate GPU; This is the weighting coefficient for health status.

7. The method according to claim 1, characterized in that, Also includes: In response to a sudden failure of the running GPU, the running GPU is removed from the running GPU cluster, and the available resources of the remaining running GPUs are obtained; The computation task is considered as a directed acyclic graph, where each node in the directed acyclic graph is a computation block. The computing blocks on the running GPU are divided into fragments that do not exceed the available resources and allocated to different remaining running GPUs; Insert point-to-point transfer operations between the partitioned computational blocks.

8. The method according to claim 7, characterized in that, The step of dividing the computation blocks on the running GPU into fragments that do not exceed the available resources and allocating them to different remaining running GPUs further includes: Using a heuristic algorithm, the computation blocks on the running GPU are arranged in descending order of processing size, and then placed into the remaining computing GPUs with the most abundant video memory and the lowest communication cost. When the remaining GPU cannot accommodate the computation block, a portion of the optimizer state of the computation block is unloaded to an external storage medium, or the target operator of the computation block is selected to be discarded and activated forward and recalculated during backpropagation to re-evaluate the allocation scheme.

9. The method according to any one of claims 1 to 8, characterized in that, Also includes: The running GPU that malfunctions is identified as a faulty GPU and moved to the faulty cluster; In the faulty cluster, start an automated diagnostic script to perform hardware reset, stress test and health check; When the health check passes, the faulty GPU is marked as healthy and transferred to the idle cluster; wherein, the idle cluster includes several idle GPUs; When the idle GPU is executing the computing task, the idle GPU is transferred to the running cluster; wherein, the running cluster includes several running GPUs that execute computing tasks.

10. A fault-tolerant optimization device based on multiple GPUs, characterized in that, include: The prediction module is used to acquire telemetry data of the running GPU and determine the fault prediction probability based on the telemetry data. The migration module, in response to the fault prediction probability being greater than a first probability threshold and less than a second probability threshold, determines the target GPU based on the comprehensive cost score of the idle GPU, and performs static migration for the running GPU to enable the target GPU to complete environment preparation and static synchronization operations; wherein, the comprehensive cost score includes topology transfer cost, memory matching cost, computing power matching cost, health cost, and communication cost; the second probability threshold is greater than the first probability threshold; The migration module also performs a dynamic synchronization operation on the running GPU in response to the fault prediction probability being not less than the second probability threshold, so as to migrate the computing tasks of the running GPU to the target GPU.

11. A computing device comprising a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, implements the method as described in any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-9.

13. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1-9.