Contents
  1. Distribution goals and execution dependencies
  2. State ownership and per-device memory
  3. Workers, groups and collective communication
  4. Physical topology and communication cost
  5. Data-parallel updates and loss normalization
  6. Sharded training state and temporary materialization
  7. Tensor partitions and result reconstruction
  8. Pipeline schedules and bubbles
  9. Composed parallelism and device placement
  10. Overlap, readiness and the critical path
  11. Serving replicas, routing and request state
  12. Prefill–decode separation and handoff
  13. Correctness across partition boundaries
  14. Useful scaling and measurement boundaries
  15. Failure propagation and coordinated shutdown
  16. Coherent checkpoints and training restart
  17. Serving restoration and interrupted requests
  18. Check understanding
  19. Open questions
  20. Selected talks
  21. References
  22. Talk library
← All topics

Distributed Training and Inference

Distributed execution trades local memory and computation for communication, synchronization and coordinated recovery. More devices can make a workload fit without making it faster. The useful design depends on what each worker owns, which results it needs from others, and whether the complete system improves the intended workload under realistic operating conditions.

Distribution goals and execution dependencies

Distribution serves three distinct goals: fitting required state, finishing fixed work sooner, and processing more independent work. Communication and waiting can offset saved computation. A capacity improvement therefore need not improve request latency.

PartitionWork assigned to devicesRequired exchange
Data parallelismModel copies process different inputs.Training gradients coordinate updates.
Tensor parallelismDevices compute pieces of an operation.Partial results or output pieces.
Pipeline parallelismDevices execute successive layer groups.Intermediate results pass between stages.
Independent serving replicasComplete executable instances handle separate requests.No training-gradient synchronization between replicas.

A tensor is a multidimensional array. Parameters are learned values; activations are intermediate results. Forward computation produces predictions, backward computation produces gradients—the derivatives used for updates—and an optimizer changes parameters using those gradients and retained optimizer state. Distribution must preserve that chain. Training objectives and device execution supply the underlying context.

Prefill processes a known prompt; autoregressive decoding selects successive tokens conditioned on earlier selections. Processing a selected token produces new internal representations; the token itself is not a key or value vector. Distributing stages preserves these dependencies rather than removing them. Prefill and iterative decoding explains the local execution.

State ownership and per-device memory

A replica is a complete copy; sharding assigns separate portions to different owners. Distributed memory requires communication to access remote values: aggregate capacity is not automatically a shared address space.

AllocationOwnership and lifetime
ParametersOwned shards may coexist with temporary full-layer parameters.
Gradients and optimizer stateReplication or partitioning depends on the sharding stage.
ActivationsForward intermediates needed later can remain large after parameter sharding.
KV cacheContext-dependent attention keys and values consume request memory beyond weights.
Communication and runtime buffersCollectives, attention backends and temporary workspaces consume additional memory.
Mpeak,r=maxtcMr,c(t).M_{\mathrm{peak},r}=\max_t\sum_c M_{r,c}(t). Here Mr,c(t)M_{r,c}(t) is memory in disjoint allocation category cc, on device rr, at time tt. Fit depends on simultaneous residency, not average shard size or the sum of separately observed category peaks.

Activation recomputation, also called activation checkpointing, regenerates intermediates during backward computation instead of retaining all of them. It exchanges computation for memory; it does not save a durable restart point. Offloading selected intermediates to CPU memory adds another transfer-and-prefetch tradeoff.

In serving, profile non-cache demand before assigning remaining memory to request state. Weights fitting alone does not establish useful concurrency. KV state and the resident memory budget explains the cache; distributed placement adds ownership and transfer constraints.

Workers, groups and collective communication

A worker is an executing process. Its rank identifies it within a participating group; a communicator supplies that group's communication context. A collective involves the group under a shared operation contract. NCCL implements such communication for participating GPU devices.

For rank inputs [1,2] and [3,4]:
OperationResult ownership
Sum all-reduceBoth receive [4,6].
All-gatherBoth receive [1,2,3,4].
Sum reduce-scatterRank 0 receives [4]; rank 1 receives [6].
Broadcast from rank 0Both receive [1,2].

Reduction and concatenation differ

Example

Identical inputs yield different values and ownership.

Both ranks receive the selected operation's result. Operation nodes express mathematical transformations, not physical coordinators. Reduction combines corresponding entries; gathering preserves contributions in rank order.
Read the diagram as text
  • Rank 0: [1,2].
  • Rank 1: [3,4].
  • Sum all-reduce.
  • All-gather.
  • Each rank: [4,6].
  • Each rank: [1,2,3,4].
  • Rank 0: [1,2]Sum all-reduce: Sum contribution.
  • Rank 1: [3,4]Sum all-reduce: Sum contribution.
  • Rank 0: [1,2]All-gather: First piece.
  • Rank 1: [3,4]All-gather: Second piece.
  • Sum all-reduceEach rank: [4,6]: Reduced values.
  • All-gatherEach rank: [1,2,3,4]: Concatenated values.

NCCL participants must supply matching counts and datatypes. Violations can hang, crash or corrupt data. Collective definitions specify the ownership changes.

MPI's nonblocking contract separates initiation from local buffer-safe completion. Participants initiate collectives in matching order; local completion need not mean every peer finished. GPU frameworks require their own completion rules. A point-to-point transfer instead connects a particular sender and receiver.

Physical topology and communication cost

A node is a machine; an interconnect carries data between devices or machines. Latency measures startup delay, while bandwidth measures bytes transferred per time. Shared interfaces and competing traffic can reduce effective bandwidth.

Tnα+V/Beff.T\approx n\alpha+V/B_{\mathrm{eff}}. For serialized transfers without overlap, nn startups cost α\alpha each; VV critical-path bytes use effective bandwidth BeffB_{\mathrm{eff}}. Assume ten 5-microsecond startups and 1 MB at 10 GB/s: approximately 150 microseconds, before other delays.

Collective algorithms determine communication rounds and paths. Rings circulate pieces through participants and can use bandwidth efficiently, but startup costs grow with group size. Trees reduce communication depth. A hierarchy can reduce-scatter locally, all-reduce between corresponding shard owners across nodes, then all-gather locally. NVIDIA's historical NCCL report illustrates these choices; no algorithm is universally fastest.

Frequent small exchanges can dominate decoding even when aggregate memory increases. Alex Cheema describes this capacity-versus-speed problem in a local tensor-parallel cluster. Advertised link bandwidth alone cannot predict the accumulated synchronization delay.

Data-parallel updates and loss normalization

Synchronous data-parallel workers start from matching parameters, compute local gradients, aggregate them, then update. Matching optimizer state and synchronized gradients preserve matching replicas. DistributedDataParallel, or DDP, performs gradient synchronization; it does not make arbitrary input weighting correct.

B=bmd,L=rSrrNr.B=bmd,\qquad L=\frac{\sum_r S_r}{\sum_r N_r}. A microbatch is one local forward/backward batch, size bb. Gradient accumulation collects mm microbatches' gradients—the pseudocode's window—before one optimizer update. Equal work across dd replicas gives global batch BB. Token-mean loss LL uses each rank's window totals: summed loss SrS_r and actual scored-token count NrN_r.

Two tokens with mean loss 1 and six with mean loss 3 yield token mean 2.5, not worker mean 2. DDP averaging requires compensation.

Illustrative pseudocode Python-like pseudocode
# Equal iteration counts across ranks; no implicit loss scaling.
window = next_local_window()
N = sum_all_ranks(count_scored_tokens(window))
optimizer.zero_grad()
if N > 0:
    for i, batch in enumerate(window):
        with synchronize_gradients(i == len(window) - 1):
            loss_sum = model.summed_token_loss(batch)
            (world_size * loss_sum / N).backward()
    optimizer.step()

Use actual counts for partial windows. Framework accumulation scaling needs separate compensation. Sampling and loss contribution explains the objective.

Equal partition lengths do not ensure exactly-once coverage. PyTorch's DistributedSampler can pad with repeated indices or drop a tail. Shared shuffle seeds and set_epoch control coordinated reshuffling. Check sample identities, not just counts; a rank cannot simply stop participating while peers continue ordinary collectives.

Sharded training state and temporary materialization

ZeRO progressively removes replicated training state.
StagePartitioned state
ZeRO-1Optimizer state
ZeRO-2Optimizer state and reduced gradients
ZeRO-3Optimizer state, reduced gradients and parameters

Fully sharded data parallelism temporarily gathers parameters for computation. Layer-level grouping limits materialization; deeper prefetch can overlap communication with computation, but increases residency. Workers still execute model operations on different inputs.

Owned shards and temporary access

Sharded ownership does not imply shard-only residency.

1 / 4 · Forward access

Gather for local forward computation.

A layer gathers parameters for forward and backward use, then reduces gradients to owners. Full materializations are temporary; updated shards replace the old parameter version.
Read the diagram as text
  • Layer L.
  • Owned parameter shards.
  • Full parameters: forward.
  • Forward materialization released.
  • Full parameters: backward.
  • Reduced gradient shards.
  • Updated parameter shards.
  • Layer LOwned parameter shards: Owned state.
  • Owned parameter shardsFull parameters: forward: All-gather.
  • Owned parameter shardsForward materialization released: Retained ownership.
  • Owned parameter shardsFull parameters: backward: All-gather.
  • Full parameters: backwardReduced gradient shards: Backward; reduce-scatter.
  • Reduced gradient shardsUpdated parameter shards: Owner update.
  • Layer LUpdated parameter shards: New state.
  1. Forward access. Gather for local forward computation. Active: Layer L, Owned parameter shards, Full parameters: forward. New: Layer L, Owned parameter shards, Full parameters: forward.
  2. Release. Keep shards; release full parameters. Active: Layer L, Owned parameter shards, Forward materialization released. New: Forward materialization released.
  3. Backward access. Gather again; reduce computed gradients. Active: Layer L, Owned parameter shards, Full parameters: backward, Reduced gradient shards. New: Full parameters: backward, Reduced gradient shards.
  4. Update. Owners retain the new parameter version. Active: Layer L, Reduced gradient shards, Updated parameter shards. New: Updated parameter shards.

Partitioning persistent state does not eliminate activation pressure. Long-context training can still exhaust memory after parameter sharding. Smaller activation buffers or recomputation address a different allocation category; adding more parameter shards alone may leave the limiting peak unchanged.

Tensor partitions and result reconstruction

XRb×k,WRk×h,Y=XW.X\in\mathbb{R}^{b\times k},\quad W\in\mathbb{R}^{k\times h},\quad Y=XW. Output-column partitions give Y=[XW0  XW1]Y=[XW_0\;XW_1]. Splitting the contracted dimension—the summed index kk—instead gives Y=X0W0+X1W1Y=X_0W_0+X_1W_1. Independent features concatenate; contributions to the same features sum.

For X=[1,2] and W=[[1,−1],[2,1]], contracted partitions produce [1,−1] and [4,2]. Their sum is [5,1]. Applying ReLU, which replaces negative values with zero, before summing produces [5,2] instead: the reconstruction boundary matters.

Megatron pairs a column-partitioned first matrix with local elementwise activation and a row-partitioned second matrix. Intermediate features stay local; second-matrix partial outputs reduce. Backward likewise combines contributions to shared inputs. Its original MLP uses one forward and one backward all-reduce, not a universal count.

Smaller local work must repay repeated communication. In ordinary decoding, the next prediction waits for the current model execution, exposing collective latency along each token's path.

Pipeline schedules and bubbles

Pipeline stages exchange forward activations and backward gradients; microbatches overlap. Fill-drain runs all forwards, then all backwards, retaining activations until used. Synchronous one-forward-one-backward (1F1B) warms up with forwards, alternates forward/backward, then drains remaining backwards. Earlier backward completion releases activations, bounding outstanding microbatches by pipeline depth. Both retain dependency-induced idle intervals—pipeline bubbles—and update parameters only after all backwards, preserving consistent versions.

Tbubble/Tideal=(p1)/m.T_{\mathrm{bubble}}/T_{\mathrm{ideal}}=(p-1)/m. For balanced stages in this model, pp is stage count and mm microbatch count. Two stages and four microbatches give 25% overhead relative to ideal computation, not elapsed time.

Two microbatches occupy successive stages

Example timings

Different microbatches overlap; each retains stage dependencies.

Stage 0 window03 schedule slotsDuration 3 schedule slots
A forward01 schedule slotsDuration 1 schedule slotsWithin Stage 0 window
B forward12 schedule slotsDuration 1 schedule slotsWithin Stage 0 window
Stage 1 window03 schedule slotsDuration 3 schedule slots
A forward12 schedule slotsDuration 1 schedule slotsWithin Stage 1 window
B forward23 schedule slotsDuration 1 schedule slotsWithin Stage 1 window
Forward-only slice: A reaches stage 1 after stage 0; B overlaps A on different stages. Transfers are assumed negligible. Parents denote stage windows. Elapsed time is three slots, not four summed work slots.
Read the diagram as text
  • Stage 0 window. 0 to 3 schedule slots; duration 3 schedule slots.
  • A forward. 0 to 1 schedule slots; duration 1 schedule slots. Parent: Stage 0 window.
  • B forward. 1 to 2 schedule slots; duration 1 schedule slots. Parent: Stage 0 window.
  • Stage 1 window. 0 to 3 schedule slots; duration 3 schedule slots.
  • A forward. 1 to 2 schedule slots; duration 1 schedule slots. Parent: Stage 1 window.
  • B forward. 2 to 3 schedule slots; duration 1 schedule slots. Parent: Stage 1 window.

Unequal prompt lengths can unbalance stages. Increasing microbatch count cannot remove a persistently slow stage or transfer bottleneck. During inference, independent requests can overlap across stages, while each autoregressive request still depends on its preceding token.

Composed parallelism and device placement

A device mesh organizes logical groups; it does not certify physical links. This eight-device assignment uses two data replicas, two pipeline stages and two tensor workers per stage.

RanksData coordinatePipeline coordinateTensor coordinatesMachine
0,1000,1A
2,3010,1B
4,5100,1C
6,7110,1D

Tensor groups are {0,1}, {2,3}, {4,5}, {6,7}; pipeline groups are {0,2}, {1,3}, {4,6}, {5,7}; data groups are {0,4}, {1,5}, {2,6}, {3,7}. Each varies one coordinate while fixing the others.

Corresponding parameter slices repeat across data replicas unless further state sharding partitions them. A separate replicate-by-shard layout can shard within each host and replicate across hosts. State ownership follows the selected group, not the total device count.

First reject layouts whose peak state cannot fit. Then compare local computation, collective frequency and stage balance on the actual links. Keeping frequent exchanges within a node is a useful candidate, not a rule. In serving, fewer devices per executable instance may leave room for more independent replicas.

Overlap, readiness and the critical path

The critical path is the dependency chain determining completion. DDP groups gradients into buckets and starts reduction when a bucket is ready, preserving collective order. Independent backward work can continue before the optimizer consumes synchronized gradients.

Small buckets invite more startups; large buckets can become ready too late. Bucket contents that poorly match gradient readiness delay launch. Measure exposed waiting rather than treating every communication interval as added elapsed time.

Communication duration versus exposed waiting

Example timings

Only unfinished prerequisite work delays the consumer.

Execution interval012 msDuration 12 ms
Produce transfer input03 msDuration 3 msWithin Execution interval
Independent computation38 msDuration 5 msWithin Execution interval
Transfer to completion310 msDuration 7 msWithin Execution interval
Dependent computation1012 msDuration 2 msWithin Execution interval
Transfer begins after its input is ready. Independent computation overlaps it until 8 ms; the consumer needs both and waits until 10 ms. Only two transfer milliseconds remain exposed. Containment indicates parentage; overlapping spans must not be summed as elapsed time.
Read the diagram as text
  • Execution interval. 0 to 12 ms; duration 12 ms.
  • Produce transfer input. 0 to 3 ms; duration 3 ms. Parent: Execution interval.
  • Independent computation. 3 to 8 ms; duration 5 ms. Parent: Execution interval.
  • Transfer to completion. 3 to 10 ms; duration 7 ms. Parent: Execution interval.
  • Dependent computation. 10 to 12 ms; duration 2 ms. Parent: Execution interval.

A straggler is a participant that finishes later than its peers. Variable generation lengths make synchronous sampling wait for the longest response while completed requests leave capacity idle. Removing that barrier changes coordination semantics; asynchronous reinforcement learning additionally introduces policy-staleness constraints.

Aligned worker traces should separate readiness, transfer and dependent execution. A late collective completion can reflect a late producer, not merely a slow network. Timeline-led diagnosis and span boundaries explain how to preserve those distinctions.

Serving replicas, routing and request state

A serving replica is a complete executable model instance, possibly spread across a tensor-and-pipeline group. Routing chooses an instance; communication inside that instance executes the request. One shard cannot independently serve the whole model. KV capacity still limits concurrent state after weights fit; a logged concurrency estimate is not measured sustainable throughput.

Request affinity favors workers holding reusable state. Cache-aware routing balances that benefit against projected prefill and decode load: a colder but less busy destination can finish sooner. Cache creation and release events inform locality estimates. Destination selection and movement of KV state remain separate responsibilities.

Prefix reuse saves processing for compatible repeated token prefixes, not semantically similar text or future output tokens. Cache compatibility and local batching remain relevant inside every distributed instance.

Admission control bounds accepted work against available resources. Request count alone hides differences in computational cost. Preserve explicit rejection behavior when capacity is exhausted; queueing and sustainable capacity develops this boundary. Operational ownership belongs in AI Platform Engineering.

Prefill–decode separation and handoff

Separate prefill and decode pools can reduce scheduling interference and support different resource allocations. Short prompts offer less interference to remove; excessive prefill supply queues behind decode, while excess decode capacity waits idle. The operating point and request-length distribution determine whether separation helps.

DistServe transfers prompt KV state and the first generated token to decoding workers. Transfer demand depends on prompt length and arrival rate.

Separation adds a state handoff

Decode depends on usable transferred state.

The router selects a destination; transfer moves derived KV representations, not token identities. Decode requires usable state. Prefill or handoff failure exits the request in the documented routing behavior.
Read the diagram as text
  • Select workers.
  • Process prompt.
  • Transfer KV state.
  • Continue decoding.
  • Request failure.
  • Select workersProcess prompt: Control: dispatch.
  • Select workersTransfer KV state: Control: destination.
  • Process promptTransfer KV state: Success: derived KV data.
  • Process promptRequest failure: Prefill error.
  • Transfer KV stateContinue decoding: Usable state received.
  • Transfer KV stateRequest failure: Handoff error.

The network can erase phase-specific advantages. In a heterogeneous local demonstration, cache traffic accidentally used Wi-Fi, leaving transfer exposed before decode. The intended Ethernet connection was a setup choice, not a universal sufficient bandwidth threshold.

A usable handoff needs compatible model execution, cache layout, positions and destination storage. Matching registered service names does not establish those properties. Dynamo's documented route returns prefill or handoff failure after dispatch rather than automatically falling back to aggregated execution. Local scheduling supplies the colocated alternative.

Correctness across partition boundaries

A bounded reference comparison starts with cloned parameters and optimizer state, identical examples and masks, and one intended update. Compare intermediate quantities as well as final parameters. A matching scalar loss can conceal a different gradient or input allocation.

BoundaryDiscriminating evidence
Input assignmentCompare example identities, padding, dropped tails and epoch order.
Shared updateCompare synchronized gradients and updated replicas from matching starting state.
Numerical resultInspect error magnitude and structure under changed reduction order.
Request continuationCheck retained history and constraint state, not merely plausible output.

Floating-point operations are not associative, so reordered reductions can differ numerically. Choose tolerances from numerical type, value scale and a trusted reference; no universal threshold excuses arbitrary error. Compare fixed-context inference outputs separately from sampled text. Numerical correctness explains the testing discipline.

Useful scaling and measurement boundaries

Strong scaling increases devices for fixed total work. Weak scaling increases total work while holding work per device fixed. These answer different performance questions.

S=Tb/Tn,E=S/(n/b).S=T_b/T_n,\qquad E=S/(n/b). For the same workload, TbT_b and TnT_n are elapsed times on bb and nn devices. Speedup SS and efficiency EE need a feasible baseline; do not invent a one-device runtime for a workload that cannot fit.
Sn1(1f)+f/n.S_n\leq\frac{1}{(1-f)+f/n}. Amdahl's idealized bound assumes a fixed workload, parallelizable fraction ff, and no added overhead. Communication and imbalance can worsen it. With f=0.9f=0.9, even unlimited parallel resources leave a tenfold ceiling.

Training throughput does not determine time to useful quality when batch size or learning behavior changes. MLPerf Training measures wall-clock time to a specified quality target and repeats runs. Retain that distinction when comparing your own corpus, objective and training recipe.

Serving goodput counts completed requests meeting declared latency criteria per benchmark second. Report offered load, errors and latency distributions separately; timely output can still be incorrect. Define first-content and continuation timing precisely. Serving experiments explains workload controls; cost and performance engineering extends the economic comparison.

Busy devices need not perform useful arithmetic efficiently. Krea used tensor-core utilization as a diagnostic proxy beyond GPU busy time. Neither replaces end-to-end completion or quality measurements.

Failure propagation and coordinated shutdown

A failure domain contains components exposed to a common failure. Missing participants can prevent collective completion and disable a cooperating model group. Independent replicas can continue only if their required devices and links remain usable. NCCL documents asynchronous communication errors and communicator abort/recreation; recreating communication does not restore lost application state.

Separate slow progress from process or device loss, broken communication, exhausted memory and numerical corruption. An elapsed timeout identifies missing progress, not its cause. Krea's experience shows why device counters alone are insufficient: fabric errors exposed faults despite apparently healthy GPUs. Failure localization requires competing explanations and per-worker evidence.

Recovery policy is implementation-specific. Under torchrun's documented elastic policy, worker failure stops and restarts the worker group within its restart limit. Membership changes also form a new group with new ranks and world size. Surviving processes are not a substitute for checkpointed progress.

Gang scheduling admits cooperating workers together. It addresses resource availability before execution, not restoration after failure. Krea separated queued-workload priority from execution priority and encountered stale capacity quotas as nodes changed.

Coherent checkpoints and training restart

A distributed restart needs one coherent training state, not unrelated shard files. A checkpoint manifest identifies saved tensor pieces. Distributed Checkpoint coordinates planning, rank writes and coordinator completion; loading writes into destination-allocated storage and can reshard tensors. Training continuity defines the resumable state beyond weights.

Asynchronous saving separates staging into CPU memory from storage upload. Protect source parameters until staging completes, including before the next optimizer mutation; other mutable training state needs equivalent protection. Upload completion is a later boundary. Await it before another save or final cleanup. Background staging also consumes CPU capacity and memory.

Shard writes precede reader entry

Reported write success gates metadata publication.

For a fresh directory with synchronized single-thread writes, final metadata follows successful shard writes. Publication synchronizes temporary metadata then renames it. Missing final metadata prevents reader entry; visibility does not independently verify integrity or power-loss durability.
Read the diagram as text
  • Stable checkpoint K.
  • Write and synchronize shards.
  • Gather write results.
  • Publish final metadata.
  • Reader enters K.
  • Save failed.
  • Stable checkpoint KWrite and synchronize shards: Shard data.
  • Write and synchronize shardsGather write results: Results or exceptions.
  • Gather write resultsPublish final metadata: No reported failures.
  • Gather write resultsSave failed: Reported failure.
  • Publish final metadataReader enters K: Final metadata available.

In the inspected fresh-directory filesystem path, synchronized shard writes precede final metadata publication. The reader requires .metadata. Final metadata is not independent shard-integrity verification. Overwriting an existing checkpoint lacks an atomic old-or-new guarantee, and the path lacks parent-directory synchronization needed to establish stronger crash-durability claims.

Reported rank-write failures prevent coordinator finish. A vanished participant is outside that ordinary gathered-exception path.

Resharding changes storage ownership, not automatically the intended next update. Preserve effective batch size, loss weighting and input progress when worker count changes. Validate restoration through the next update, not merely successful tensor loading. Compare checkpoint overhead, lost work and actual restart time together.

Serving restoration and interrupted requests

Capacity restoration crosses distinct control boundaries.
ResponsibilityWhat it establishes
Discovery and routingRemoves unavailable endpoints; does not reconstruct interrupted requests.
Infrastructure reconciliationThe Dynamo Operator manages deployment resources; Grove represents configured worker groups and coordinated scaling.
Orchestration probesInspected worker readiness does not itself determine Dynamo traffic eligibility. Active health checks default off in that code.
Executable healthAn active canary exercises backend inference. Frontend HTTP 200 can coexist with no discovered workers.

A deployment can require whole-group replacement after losing a model shard. Its re-entry policy should explicitly require model loading, communication initialization, warmup, executable checks and routing registration. These are conditions to implement and test, not one universal Dynamo recovery sequence; configured grouping and controller policy determine replacement scope.

Retained output can exceed observed output

Example

Migration tracks backend responses, not client acknowledgements.

The migrator retains b before forwarding it. The client snapshot contains only a. A backend retry uses a,b without re-emitting that prefix; this does not recover an unacknowledged delivery gap.
Read the diagram as text
  • Request R.
  • Backend returns token b.
  • Migrator retains a,b.
  • Forward b upstream.
  • Client snapshot: a only.
  • Replacement attempt. Same request ID; reduced remaining generation budget.
  • New continuation.
  • Terminate request.
  • Request RBackend returns token b: Backend response.
  • Request RClient snapshot: a only: Separate observation.
  • Backend returns token bMigrator retains a,b: Record first.
  • Migrator retains a,bForward b upstream: Then forward.
  • Migrator retains a,bReplacement attempt: Migratable error; parent active.
  • Replacement attemptNew continuation: Replacement succeeds.
  • Replacement attemptTerminate request: Cannot continue.

Model artifacts, reconstructible KV state and client-observed output have different recovery boundaries. A service can fail an interrupted request or replay retained context. Planned shutdown first stops admission and can drain existing work. Replacing capacity does not by itself complete either policy for requests already underway.

The inspected migrator records returned token IDs before forwarding, adjusts remaining generation budget, and preserves request identity. That retained history is not a client acknowledgement cursor.

Replay support is bounded by tracking length and attempt limits. Multi-choice and structured-output requests need additional continuation state and are unsupported by the documented migration path. Replaying tokens does not advance a newly initialized constraint machine. Generation constraints explains why text history alone is insufficient.

Cancellation propagates through linked request contexts, but engines must observe it and stop computation. A received-signal metric does not confirm resource reclamation. Graceful stop does not retract already-streamed results; kill behavior depends on engine support. Streaming delivery separates generation, buffering and client observation.

A worker-loss test should record routing removal, restored executable capacity, interrupted-request outcome and client-visible output separately. Inject cancellation during recovery and observe actual engine termination. A passing minimal canary establishes executable reachability, not representative-load performance or seamless continuation.

Open questions

  1. Adaptive placement must respond to changing request lengths without spending its savings on cache movement. Progress requires workload-shift experiments that include transfer, queueing and latency compliance, rather than a fixed optimal worker ratio.

  2. Checkpoint publication still needs backend-specific integrity and power-loss guarantees. Metadata visibility alone cannot establish them; progress would include corrupted-shard, interrupted-write and concurrent-reader tests with explicit accepted restart states.

  3. Elastic restart must preserve the intended update after group membership changes. Tensor resharding is easier than preserving sample progress and weighting; a decisive test compares the next restored update with an uninterrupted reference using identical examples.

  4. Streaming recovery needs a delivery contract across frontend loss and reconnection. Backend replay lacks a client acknowledgement boundary; progress requires token-offset reconciliation plus cancellation tests that verify actual engine cleanup.

Follow the curated reading path through the speakers and demonstrations behind this entry.

Explore more talks

The rest of the library, beyond the curated path. Cited talks support this entry; reviewed transcripts were processed in full. Metadata candidates have not been reviewed as sources or verified as topic members.

3 matching talks

TalkSpeakerEventYear
Mark MoyouAI Engineer World's Fair 20242024
Walden, Carter, Tanay, Alex Atallah, NavAI Engineer World's Fair 20262026
Philip Kiely, Yineng ZhangAI Engineer World's Fair 20252025

References

Coverage and source review
Processed transcripts
8 processed in full · 5 in the curated path
Automated source review
Passed
Metadata candidates
0 unreviewed; not verified topic membership
Corpus version
1bd8e407b26a07b33815594e1b2db5f41827119a2b3cb6fbf240f9fc571fc767

Automated review checks source support; it is not publication approval.

A synthesis of selected conference talks and technical references. Citations link to the source material; they do not imply that every talk on this subject is included.

  1. LLNL: Introduction to Parallel Computing Tutorial

    Distributed Memory, Communications, Load Balancing, Granularity, and Scalability sections.

  2. PyTorch: Distributed Data Parallel

    Internal Design; synchronous data-parallel updates, gradient bucketing, ordering, and overlap opportunities.

  3. Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism

    Sections 2.3 and 3; equations 1–3 and Figures 3–4.

  4. Mastering LLM Inference Optimization: From Theory to Cost-Effective Deployment

    The speaker places tensor parallelism typically within a node and describes pipeline parallelism as sequential handoff across nodes.

  5. vLLM 0.22.0: Parallelism and Scaling

    Distributed serving guidance, capacity logs, and multi-node deployment; extends /topics/inference#section-6.

  6. PyTorch: Training a Classifier

    Training an image classifier, steps 1–5, especially Net.forward, CrossEntropyLoss, training loop, and test-set evaluation.

  7. Mastering LLM Inference Optimization: From Theory to Cost-Effective Deployment

    The illustrated inference loop has a prefill stage for the prompt followed by incremental decoding, with different computation shapes.

  8. PyTorch: Getting Started with Fully Sharded Data Parallel (FSDP2)

    How FSDP2 Works, Model Initialization, and Forward/Backward with Prefetching.

  9. DeepSpeed: Zero Redundancy Optimizer

    ZeRO Overview and the eight-V100 stage-1 example; persistent ownership and a bounded capacity illustration.

  10. Road to 5 Million Tokens: Breaking Barriers in Long Context Training — Max Ryabinin, Together AI

    Fully sharded data parallelism can reduce model memory while leaving attention activations as the limiting allocation.

  11. Mastering LLM Inference Optimization: From Theory to Cost-Effective Deployment

    Retaining key and value representations avoids repeating earlier prompt work during decoding, at the cost of GPU memory.

  12. vLLM memory profiling: allocations and transient peaks

    Official main-branch source: MemorySnapshot, MemoryProfilingResult and memory_profiling, including its worked allocation example.

  13. Road to 5 Million Tokens: Breaking Barriers in Long Context Training — Max Ryabinin, Together AI

    Activation checkpointing reduces stored activations by recomputing them during the backward pass, but its configuration must control added computation.

  14. Road to 5 Million Tokens: Breaking Barriers in Long Context Training — Max Ryabinin, Together AI

    Transformer-block inputs can be moved off the GPU while unused and prefetched for backpropagation to reduce GPU activation storage.

  15. vLLM GPU worker: profiling available KV capacity

    Official main-branch source, determine_available_memory and subsequent graph-memory accounting inspected.

  16. NCCL: Creating a Communicator

    Communicator creation and asynchronous-error handling; vocabulary for ranks, participating groups, and coordinated communication failure.

  17. NCCL: Collective Operations

    Definitions and ownership diagrams for the four core collectives; NCCL 2.31.2 documentation.

  18. MPI 4.1: Nonblocking Collective Operations

    MPI 4.1 section 7.12; participation, ordering, buffer ownership, and the distinction between collective completion and barrier synchronization.

  19. Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM

    Sections 2–3 and 5.4; synchronous schedules, composition, and historical placement experiments.

  20. NVIDIA: Massively Scale Your Deep Learning Training with NCCL 2.4

    Original NCCL 2.4 engineering report; algorithm paths, message-size tradeoffs, and topology-dependent behavior.

  21. Frontier AI at Home (literally)

    The speaker reports that low-latency RDMA made fine-grained parallel inference practical across Macs by reducing repeated synchronization costs.

  22. Accelerate: Performing Gradient Accumulation

    Variable-size samples, skeleton code, and self-contained causal-language-model example; supports normalization and bounded reference comparison.

  23. PyTorch 2.9: DistributedSampler

    DistributedSampler definition and parameters; distributed input coverage and epoch handling.

  24. DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving

    Sections 3.2–4; adds distributed-placement evidence beyond the supplied interference note.

  25. PyTorch: Getting Started with DeviceMesh

    DeviceMesh definitions, hybrid sharding example, and custom parallel compositions.

  26. Efficient Reinforcement Learning

    Waiting for every response before training makes synchronous step duration depend on the slowest response, while completed requests leave GPUs underutilized.

  27. Efficient Reinforcement Learning

    The described PipelineRL design separates sampling and training workers with a queue and updates sampling weights even during an unfinished response.

  28. Efficient Reinforcement Learning

    Greater staleness tolerance reduces worker stalls but can destabilize learning through higher-variance importance ratios.

  29. CUDA C++ Best Practices Guide

    Sections 4.1.3.1, 9.1–9.2, and 11.1–11.3.

  30. NVIDIA Dynamo: KV-Aware Routing

    Selection and Feedback Loop, Cache Locality and Load Work Together, and Relationship to Disaggregated Serving.

  31. Automatic prefix caching — vLLM

    Prefix reuse is distinct from within-request KV caching and is not a semantic answer cache.

  32. Google SRE: Handling Overload

    Handling Overload introduction; The Pitfalls of Queries per Second; Per-Customer Limits; Client-Side Throttling.

  33. Hacking the Inference Pareto Frontier

    Disaggregation lets prefill and decode use different resource allocations and avoids competition between their scheduling needs.

  34. Hacking the Inference Pareto Frontier

    Disaggregation is workload-sensitive: short inputs reduce its scheduling benefit, extreme operating points may favor aggregation, and a poor worker ratio can create idle capacity or queues.

  35. Frontier AI at Home (literally)

    KV-cache transfer must be fast enough to overlap computation; otherwise communication adds a serial delay before decode.

  36. NVIDIA Dynamo: Disaggregated Serving

    Automatic Prefill Router Activation and request-routing behavior.

  37. PyTorch: Numerical Accuracy

    Introduction, Batched Computations, and Extremal Values; numerical qualification for distributed reference comparisons.

  38. NVIDIA Dynamo: Request Migration

    Migration configuration, token-state memory limits, metrics, and Known Limitations.

  39. MLCommons: MLPerf Training Benchmark

    Scenarios and Metrics and Divisions; authoritative example of measuring training completion rather than step throughput alone.

  40. AIPerf Metrics Reference

    Streaming metrics, request latency, goodput and error definitions; clarifies tool-specific naming and client-observed boundaries.

  41. Infra behind Krea 2 - How to train and serve at scale

    Krea used tensor core utilization as a proxy for useful compute activity because GPU utilization alone only indicated time spent working.

  42. NVIDIA Dynamo 0.9.1: Fault Tolerance

    Version 0.9.1 lifecycle and failure scenarios; operational example separating routing removal, draining, and request recovery.

  43. Infra behind Krea 2 - How to train and serve at scale

    Collect communication-fabric telemetry beyond basic GPU metrics, covering both cross-node InfiniBand and intra-node NVLink failures.

  44. PyTorch: torchrun Elastic Launch

    Failure Modes, Membership Changes, and Important Notices; concrete coordinated training recovery behavior.

  45. Infra behind Krea 2 - How to train and serve at scale

    Krea combined Kueue gang scheduling and workload priority with Kubernetes pod priority, but manually maintained resource quotas could become stale.

  46. PyTorch: Distributed Checkpoint

    DCP introduction and StorageWriter lifecycle; shard writes versus coordinated checkpoint completion.

  47. PyTorch: Asynchronous Saving with Distributed Checkpoint

    Fully Asynchronous Staging with DefaultStager and its published training loop; snapshot isolation and completion boundaries.

  48. PyTorch DCP filesystem.py: FileSystemWriter and FileSystemReader

    Inspected main-branch local filesystem backend, coordinated saves, default single-thread writing and TORCH_SAVE serialization. Fresh checkpoint directories are an explicit implementation assumption.

  49. PyTorch DCP utils.py: coordinated exception handling

    The _DistWrapper.all_reduce implementation used by the inspected checkpoint save path; a gate on reported operation success.

  50. Infra behind Krea 2 - How to train and serve at scale

    Krea used frequent checkpoints on storage that could absorb checkpoint writes without materially delaying training.

  51. NVIDIA Dynamo: Overall Architecture

    Development architecture documentation; resilience loop and Kubernetes-native realization.

  52. Dynamo Operator: worker container defaults

    WorkerDefaults.GetBaseContainer on the retrieved main-branch source; distinguishes orchestration probes from Dynamo's routing boundary.

  53. NVIDIA Dynamo: Health Check Reference

    Development reference: frontend responses, worker system status and active canary configuration.

  54. Dynamo migration.rs: response tracking and stream recreation

    Retrieved main-branch implementation, MigratingRequestStream response tracking and new_stream paths; supported single-continuation requests.

  55. NVIDIA Dynamo: Request Cancellation Architecture

    Development cancellation architecture; applies to the linked child contexts created during migration.