Compute in Transit — Presentation 02

Data Movement in LLM Training

What each kind of parallelism puts on the wire, how large a gradient sync is and where links bind; in-network aggregation, low-communication training, and frequency-domain compression of gradients and momentum; and a planned experiment to test whether a DCT-based compressor can run on a photonic link module.

Ring all-reduce In-network aggregation DiLoCo DeMo DCT compression Fixed band vs top-k
Local steps → Gradient or momentum → Transform + select → Link → Aggregate → Update
00

Topics We'll Cover

Concepts used here, and where they are explained. Each links to an entry in the series glossary, or in a sister series' glossary for concepts it already explains.

01

The Traffic Each Kind of Parallelism Creates

Large-model training splits work along several axes at once, and each axis puts a different kind of data on a different kind of link. What a compute-in-transit module could act on depends on which traffic it sees.

ParallelismWhat crosses the linkHow oftenTypical link
Data parallel (DDP)Gradients, summed across replicas (all-reduce)Every optimiser stepInfiniBand or Ethernet between nodes
FSDP / ZeRO-3Weight shards (all-gather) before use; gradients (reduce-scatter) after the backward passEvery layer, forward and backward, every stepNVLink in a node, InfiniBand between nodes
Tensor parallelActivations and their gradients, combined by all-reduceEvery layer, forward and backwardNVLink, inside one node
Pipeline parallelActivations forward, activation gradients backwardAt each stage boundary, per micro-batchInfiniBand between nodes
Sequence / context parallel (incl. ring attention)Key and value blocks passed round a ring of devicesEvery attention layerNVLink or InfiniBand
Expert parallel (MoE)Tokens to their experts and back (all-to-all)Every MoE layer, twiceNVLink or InfiniBand
02

How Big Is a Gradient Sync?

A BF16 gradient is 2 bytes per parameter. A ring all-reduce (slide 03) makes each worker send a little under twice that:

ModelParametersBF16 gradient (GB)Ring all-reduce bytes per worker, 8 workers (GB)64 workers (GB)
Llama-3-8B8,029,995,00816.0628.1031.62
Llama-3-70B70,552,387,584141.10246.93277.80

Source: results.md, section “3. Training”

70B, 64 w.
277.80 GB per worker
70B grad
141.10 GB
8B, 64 w.
31.62 GB
8B grad
16.06 GB
8B KV, 2k
268.4 MB (inference)
03

Ring All-Reduce Arithmetic

N workers each hold a buffer of B bytes and all need the sum. Split each buffer into N chunks and arrange the workers in a ring.

worker 0 worker 1 worker 2 worker 3 one chunk, B/N each step, every link carries one chunk 1. reduce-scatter N-1 steps: receive a chunk, add your own, pass the sum on. Each worker ends owning one fully summed chunk. 2. all-gather N-1 steps: pass the finished chunks round until everyone has all N. per worker sent: 2 (N-1) · B/N = 2(N-1)/N · B N = 8: 1.75 B; N = 64: 1.97 B adds: (N-1)/N · B/2 per worker (BF16)
04

Interactive: Where Links Bind

Time to move one model-sized BF16 update once over one link: latency + bytes / bandwidth, with the link presets of Disaggregated_Inference_Sim (milliseconds):

ModelLinkGB/snoneFP8 (2x)2-bit (8x)DeMo reported (85x)
Llama-3-8BNVLink 4 (one direction)450.035.717.84.50.4
Llama-3-8BInfiniBand NDR 400G50.0321.2160.640.23.8
Llama-3-8B100 GbE12.51,284.8642.4160.615.1
Llama-3-8B25 GbE3.15,139.22,569.6642.460.5
Llama-3-70BNVLink 4 (one direction)450.0313.6156.839.23.7
Llama-3-70BInfiniBand NDR 400G50.02,822.11,411.1352.833.2
Llama-3-70B100 GbE12.511,288.45,644.21,411.1132.8
Llama-3-70B25 GbE3.145,153.522,576.85,644.2531.2

Source: results.md, section “3. Training”. 2x = BF16 to FP8; 8x = BF16 to 2-bit (MuLoCo's setting); 85x = DeMo's reported reduction. The ratios are the papers' figures, used only to size transfers.

BF16 update
—
On the wire
—
Move once
—
Ring, per worker (bandwidth term)
—

05

In-Network Aggregation

If the network itself sums the workers' updates, each worker sends its gradient once and receives the sum once, instead of the 2(N−1)/N · B of a ring, and the switch does the adds.

worker 0 → slice of g0 worker 1 → slice of g1 … → switch: Σ in a slot of switch memory → sum multicast back to every worker

SwitchML (NSDI 2021)

  • Programmable switches (Barefoot Tofino, programmed in P4) aggregate model updates from many workers in the network (Sapio et al., “Scaling Distributed Machine Learning with In-Network Aggregation”, arXiv:1903.06701).
  • Reports up to 5.5× training speed-up on real-world benchmark models.
  • The switch pipeline does integer arithmetic, so workers convert floating-point updates to integers (with a scaling factor) before sending.
  • Limited switch memory and per-packet processing: the switch holds a small pool of aggregation slots that are reused as the update streams through, rather than the whole gradient.

NVIDIA SHARP

  • Performs reductions inside InfiniBand switches, offloading collective operations from the hosts to the network.
  • Same principle as SwitchML, in a fabric product rather than a research prototype.

The budget check

  • Summing two BF16 streams is 0.5 operations per byte (results.md section 2).
  • A QSFP56 module's budget is 0.40 to 3.96 operations per byte (section 1, on this series' reading of Kundu et al.'s “tens of GFLOPs” per link, arXiv:2608.21536): it fits at the high end, not the low.
The point for this series

Summing needs flows from many workers to meet. A pluggable module sees one link, one stream; the arithmetic would fit, but the operands are never in the same place. Aggregation belongs in a switch. What a link module could do to the data-parallel sync is transform or compress the single stream it carries, which is the rest of this deck.

06

Low-Communication Training: the DiLoCo Family

Instead of syncing every step, each worker (or island of accelerators) takes many local optimiser steps, then the workers exchange the pseudo-gradient, the change in their parameters, and apply one outer optimiser step to it.

DiLoCo, one outer step (after Douillard et al., Algorithm 1)
for each worker i, in parallel:
    θi ← θ                        # start from the shared parameters
    repeat H times: θi ← AdamW(θi, local data)   # inner steps, no communication
    Δi ← θ − θi                    # pseudo-gradient: one model-sized buffer
Δ ← all_reduce_mean(Δi)               # the only sync: once per H steps
θ ← Nesterov(θ, Δ)                  # outer step
MethodWhat it changesReported result
DiLoCo (Douillard et al., 2023, arXiv:2311.08105)Inner AdamW, outer Nesterov momentum; sync every H inner stepsOn C4 with 8 workers, matches fully synchronous training while communicating 500× less
Streaming DiLoCo (Google DeepMind, Jan 2025, arXiv:2501.18512)Syncs subsets of parameters in sequence, overlaps communication with training, quantises what is exchangedReduces required bandwidth by two orders of magnitude at similar quality
MuLoCo (May 2025, arXiv:2505.23725v1)Muon as the inner optimiser, plus error feedbackDelta compressed to 2 bits with next to no degradation; communicates 8× less than DiLoCo (figures from the v1 abstract)
SparseLoCo (Aug 2025, arXiv:2508.15706)Top-k sparsification of the pseudo-gradient (97–99% sparsity) with 2-bit quantisationLower final loss than dense DiLoCo, on models from 178M to 2B parameters
07

Frequency-Domain Gradient Compression

Sparsification usually keeps the largest gradient entries in their own domain. Wang et al. asked whether a transform first would keep more of the information at the same compression ratio (“FFT-based Gradient Sparsification for the Distributed Training of Deep Neural Networks”, HPDC 2020, doi:10.1145/3369583.3392681; preprint arXiv:1811.08596, titled “SuperNeurons: FFT-based Gradient Sparsification…”).

gradient, flattened to a 1-D signal → FFT → keep the largest coefficients (top-k) → range-based float encoding of the rest → send; inverse FFT at the receiver
What a transform does not guarantee

Whether frequency coefficients are sparser than the raw entries depends on the tensor. Flattening a weight matrix's gradient into one long signal imposes an ordering the network does not care about; results.md section 5 shows that on white noise or sparse spikes a transform concentrates nothing. The case for frequency-domain compression is empirical, tensor by tensor.

08

DeMo: Decoupled Momentum and the DCT

DeMo (Peng, Quesnelle and Kingma; the later version adds Chen, Su and Liu; ICLR 2026; arXiv:2411.19870) drops the per-step all-reduce of full gradients. Each worker's momentum evolves locally, and only its fast-moving components are shared.

DeMo, one step on worker i (simplified from the paper's algorithm)
mi ← β mi + gi                    # local momentum, never all-reduced
C ← DCT(chunks(mi))                  # transform each fixed-size chunk
qi ← top_k(C)                       # keep the k largest per chunk: values + indices
mi ← mi − IDCT(qi)                  # remove what was sent: momentum is the error feedback
Q ← all_gather(qi)                    # the only communication: small
θ ← θ − η · IDCT(Q)                   # same update on every worker (see the paper for its exact form)
Why DeMo is this series' test case

Its compressor is a transform followed by a selection, applied to a stream on its way to the network. The transform is in a photonic module's operation set; the selection is not. That gap is the subject of the next three slides.

09

Mapping DeMo onto a Photonic Link Module

The module's published operation set is FFT, NTT, MAC, and modular and floating-point arithmetic (Kundu et al., arXiv:2608.21536). Step by step:

DeMo stepIn the set?Substitute
Chunk the momentumData layout only—
DCT of each chunkyes (a real FFT variant)—
Top-k selectionno: needs comparisonsA fixed frequency band: a gather, no arithmetic; no indices to send
Subtract what was sent from the momentumNeeds the optimiser stateStays on the GPU, which must know which band was sent (with a fixed band, it always does)
KernelTransform / byteOther / byteIn setFits low budget (transform charged)Fits high budget (transform charged)Fits if transform free (low)
2-D DCT of 16x16 chunks, fixed band10.000.00yesnonoyes
2-D DCT of 64x64 chunks, fixed band15.000.00yesnonoyes
2-D DCT of 64x64 chunks + top-k (DeMo as published)15.001.00nononono

Source: results.md, section “2. Work per byte”. Top-k is costed at about 2 comparisons per value (illustrative).

The DCT costs 10 to 15 FLOPs per BF16 byte if charged against a budget of 0.40 to 3.96, so it fits only if the optics does the transform without charge. If it does, the fixed band adds no arithmetic and fits; top-k does not, being outside the set.

fixed band: same 4 low-frequency cells every chunk; nothing to compare, no indices top-k: the 4 largest, wherever they are illustrative pattern; differs chunk by chunk
SignalKept fractionTop-k energyFixed band energy
white noise0.06250.3250.062
2-D random walk (smooth)0.06250.9950.957
sparse spikes (1% non-zero)0.06250.3200.062

Source: results.md, section “5. A fixed frequency band against top-k”: share of each 64 × 64 chunk's energy kept after a 2-D DCT, keeping 1/16 of the coefficients. Synthetic signals, illustrative.

10

The Fixed-Band Experiment (Planned)

Status

This experiment is planned, not run. No results are shown, and none of the slides above depends on its outcome.

Train a small GPT, tens of millions of parameters (nanoGPT-style, on a small text corpus), four ways, at the same keep fraction in arms (b) to (d):

ArmOptimiser and compressionQuestion it answers
(a)AdamW with DDP, uncompressedThe baseline: loss with full communication
(b)DeMo as published: DCT + top-kReproduces the reference compressor at this scale
(c)DeMo with a fixed low-frequency band in place of top-kDoes a comparison-free selection keep the convergence?
(d)Fixed band with emulated optics: additive noise at a chosen ENOB, and the transform restricted to a native sizeDoes it survive analogue precision and a fixed transform length?

Which band?

Low frequencies within a chunk are the obvious choice, and section 5 shows they work for smooth signals. But DeMo's own premise is that the components worth synchronising are the fast-moving ones, and the NeurIPS 2025 workshop variant (Nedelkoski et al.) synchronises the high-frequency components of momentum (slide 08). Is momentum energy within a chunk concentrated at low frequencies at all? And if what matters is high-frequency content, does a fixed high band do as well as top-k? The experiment should test a low band, a high band and top-k side by side rather than assume the answer.

11

From Convergence to Wall-Clock

The experiment gives loss against bytes. Whether that saves time depends on the system: link rates, latencies, how much of each sync overlaps with compute, and whether the module adds delay or energy. That question belongs to a discrete-event simulation, which is the part of this work that falls to a simulation engineer.

workers: inner steps → in-transit module: budget, latency, energy → cross-data-centre link → aggregate + outer step

What the model holds

  • Workers with a time per inner step and a sync interval H.
  • Links with bandwidth and latency, from the same presets results.md uses.
  • An in-transit module with an operations-per-byte budget, an added latency and an energy per byte; a kernel that exceeds the budget slows the link to the rate the module can sustain.
  • Sync policy: blocking, or streamed in parameter subsets and overlapped with training, as in Streaming DiLoCo.

What it reports

  • Wall-clock per outer step, and the share spent waiting on the link.
  • Link utilisation and energy per sync.
  • Time to a target loss, combining the experiment's loss-against-bytes curves with the simulated time per byte.
12

Other Training Traffic

TrafficWhat a link module could doObstacleVerdict
Ring-attention KV blocksCompress each block in flight with a transform plus a fixed band; the FFT is in the setPer-layer, latency-critical; the attention result must stay accurate, and KV blocks need not be smoothpossible if blocks compress well; the same question as inference KV (deck 03)
Pipeline-parallel activationsCompress activations at stage boundariesLow tolerance to noise: an error in the forward pass compounds through every later stage, and the backward pass depends on itpoor fit
CheckpointsErasure-code the checkpoint as it is writtenErasure coding uses finite-field arithmetic, which is in the set (modular arithmetic, NTT), but checkpoints are infrequent and off the critical pathniche
Data-parallel sync (for comparison)Transform + fixed band on the pseudo-gradient or momentumSelection without comparisons; error feedback stays on the GPUbest candidate, pending slide 10
13

What to Take Away