LLM Training Essentials: Fault Tolerance, Parallelism, Long Context, and Data

    Large-scale model training has shifted from "can it start" to "can it run stably and efficiently to completion." This article walks through four stages in order: calculating your failure budget, choosing a parallelism strategy, evaluating memory and compute for long context, and defining data and evaluation criteria. Each section provides ready-to-use formulas, comparison tables, and checklists. All numbers are example assumptions—replace them with measured values from your own cluster before use.

    Introduction: Budget First, Then Optimize

    The challenge of large model training has shifted from “can it start” to “can it run stably and efficiently to completion.” The recommended order of operations is: first calculate the failure budget, then choose a parallelism strategy, then evaluate the memory and compute implications of long context, and finally settle on data and evaluation criteria. Each stage below includes directly computable formulas, comparison tables, and checklists. All figures are example assumptions—replace them with measured values from your own cluster before use.

    1. Node Failures and Checkpoint-Restart

    How Failure Rate Scales with GPU Count

    Assume the mean time between failures (MTBF) of a single accelerator card is 50,000 hours, and that card failures are independent and follow an exponential distribution. MTBF refers to the average uptime between failures, which is different from mean time to repair (MTTR). MTTR describes how long repair takes after a failure; together they determine availability.

    Over a time window T = 1 hour, the failure probability of a single card is p ≈ T / MTBF = 2 × 10⁻⁵. The probability of at least one failure in the cluster is 1 − (1 − p)^N, where N is the number of cards. When p is small, this is approximately N·p. With N = 1000, the probability of a failure within one hour is about 2%.

    Cluster-level mean time between failures is MTBF_cluster = MTBF / N. With N = 1000, MTBF_cluster = 50 hours. The table below shows results at different scales, assuming a 100-hour training run.

    Cards (N) Cluster MTBF (hours) Probability of ≥1 failure in 100 hours
    256 195 ~40%
    1000 50 ~86%
    4096 12.2 ~99.97%

    Probabilities are computed as 1 − e^(−N·T/MTBF), again assuming independent, exponentially distributed failures.

    The real concern is cumulative risk. The expected number of interruptions per training run is: training duration × N ÷ MTBF. For 30 days (720 hours) on 1000 cards, the expected number of interruptions is 720 × 1000 ÷ 50,000 = 14.4. The more cards and the longer the run, the more interruptions—and the more important your recovery strategy becomes.

    The independence assumption often breaks down in real clusters. A shared rack power supply, the same switch, the same hardware batch, or the same driver version can all cause common-mode failures, where a single event takes out many cards at once. Therefore, multiplying single-card MTBF by the card count is only suitable for rough estimates. A formal budget should use the measured job-level interruption rate.

    How to Set the Checkpoint Interval

    Checkpoint writing consumes training time. Too short an interval wastes compute on writes; too long an interval means more progress is rolled back after a failure. Young proposed an approximate optimal interval formula in 1974: τ ≈ √(2CM), where C is the time to write a single checkpoint and M is the job’s mean time between failures.

    The formula applies when failures occur uniformly and independently (approximating a Poisson process), write time is constant, and τ is much smaller than M. Daly provided a higher-order refinement in 2006 for cases where τ and M are close in magnitude.

    For example, with C = 60 seconds and M = 50 hours (180,000 seconds), τ ≈ √(2 × 60 × 180,000) ≈ 4,650 seconds, or about 77 minutes. At this interval, write overhead is roughly C/τ ≈ 1.3%, and the average rollback loss after failures is about τ/(2M) ≈ 1.3%, totaling roughly 2.6% of effective compute lost. Adding a per-recovery time R, total loss can be written as C/τ + (R + τ/2)/M. With R = 10 minutes, R/M adds about 0.3 percentage points.

    The table below explains how each parameter is measured.

    Parameter Meaning How to measure Example assumption
    C Time to write one checkpoint Wall-clock time from write start to completion across all ranks; take P50 and P90 60 s
    M Job-level MTBF Total runtime ÷ number of non-manual interruptions, over the last 30 days 50 h
    R Recovery time after failure Time from failure to resuming stable iterations 10 min
    τ Checkpoint interval Computed from the formula, then calibrated with measurements ~77 min

    Checklist:

    • Is checkpoint writing asynchronous, and is write time included in statistics?
    • Is the P90 write time used when computing τ, to avoid bias during storage jitter?
    • Are storage write bandwidth, write failure rate, and recovery time monitored?
    • After recovery, is the loss curve checked for continuity, confirming the checkpoint and data loader position are consistent?
    • Is τ re-estimated after cluster size changes?

    Effective Compute Loss

    MTBF describes how often failures occur; MTTR and recovery time describe how much downtime each failure causes. Both affect effective compute. A job-level estimate is:

    Effective compute fraction ≈ 1 − C/τ − (R + τ/2)/M

    The three terms correspond to checkpoint overhead, post-failure recovery time, and rollback loss, respectively. Reducing R is usually more direct than tuning τ—for example, by pre-warming the startup environment, keeping spare nodes, and shortening process launch time.

    2. Parallelism Strategies

    Partitioning Schemes and Communication Costs

    Total training cards equal the product of the parallelism dimensions: world size = DP × TP × PP, where DP is data parallelism, TP is tensor parallelism, and PP is pipeline parallelism.

    With 1F1B scheduling, the pipeline bubble fraction is (p − 1) / (m + p − 1), where p is the number of pipeline stages and m is the number of microbatches per step. With p = 8 and m = 32, the bubble fraction is about 17.9%. Increasing m to 64 reduces it to about 9.9%. More microbatches shrink the bubble but increase memory usage.

    The global batch size per step is: microbatch size × DP × gradient accumulation steps.

    The table below compares common strategies.

    Strategy What is partitioned Main communication Recommended placement Main cost
    DP Data Gradient all-reduce Across nodes Each card still holds the full model state
    TP Intra-layer matrices All-reduce per layer Within a node (NVLink) Frequent communication; high latency across nodes
    PP Between layers Point-to-point between adjacent stages Across nodes Pipeline bubbles
    ZeRO / FSDP Optimizer states, gradients, parameters All-gather, reduce-scatter Same group as DP Increased communication volume

    Memory Estimation

    With mixed-precision Adam training, model state occupies about 16 bytes per parameter, covering bf16 parameters and gradients, fp32 master weights, and two optimizer states. Estimating on this basis:

    Model state memory (per card) ≈ 16 × Ψ ÷ S

    where Ψ is the parameter count and S is the shard count. This excludes activations. For a 70B-parameter model, total model state is about 1.12 TB. Sharded with ZeRO-3 across 64 cards, that is about 17.5 GB per card, with activations estimated separately.

    Measuring Throughput

    Throughput should be measured with MFU (model FLOPs utilization). The training compute per token for a dense Transformer is approximately 6 ×