advanced25 min studyLesson 489 in Engineering

Fabric congestion and collective tail latency

Connect shared-link demand, rank arrival skew, and distributed maxima to training-step tails while keeping independence and traffic assumptions explicit.

On this page

What you’ll understand

  • Distinguish sustained capacity from burst and tail behavior.
  • Calculate a distributed maximum probability under an explicit independence model.
  • Separate late rank readiness from slow communication after participation.

A training step can be held up by its slowest required dependency. Fast average point-to-point bandwidth therefore does not guarantee a short collective tail. A burst, a delayed rank, a shared uplink, or a contending memory path can determine when every required result becomes usable. Tail diagnosis needs aligned rank and resource evidence rather than one average throughput number.

Traffic demand must fit the resource it actually crosses

A shared link serves the aggregate traffic mapped onto it, including other jobs and protocol overhead. Sustained offered work near its usable capacity leaves little room for bursts or service variation. A long-term rate below capacity is a necessary stability-style condition in simple queue models, not a guarantee of a low percentile latency. Message size, congestion control, routing, backpressure, and head-of-line effects can change the observed tail. Count traffic at the selected boundary rather than adding logical tensor sizes and assuming they all traverse that link exactly once.

Rank mapping and collective algorithm determine which flows coincide. Moving ranks or changing a schedule can spread demand, but the change may also create more traffic across a constrained cut or reduce local reuse. Correlate fabric counters with the particular communicator, payload, and job timing where possible. NCCL's versioned diagnostic guidance separates system checks and transport evidence from tuning knobs. A parameter that improves one isolated benchmark may worsen contention when many jobs or layers communicate together.

ρ=λDB\rho=\frac{\lambda D}{B}
lambda is messages/s offered to a stipulated shared resource, D mean bytes crossing it per message, and B usable bytes/s for that traffic, so rho is dimensionless. This simplified load model requires matching directional and protocol accounting; rho<1 alone does not bound burst or tail delay.↔ Scroll wide equations horizontally.

Many required ranks turn local tails into step risk

Suppose each rank has a probability distribution for a readiness or completion time. If those times were independent and identically distributed, the probability that all p are below a threshold would be the single-rank probability raised to p. The maximum becomes more likely to exceed a high individual percentile as p grows. This is a teaching independence model, not a description of shared-fabric reality. Shared switches, common input storage, and synchronized workloads create correlations, so the actual joint distribution must be measured or modeled appropriately.

A late rank can hold peers at a collective even when its eventual transfer path is healthy. Measure when inputs become ready and calls are reached, not just when a waiting rank starts its own timer. CPU scheduling, data loading, previous kernels, or thermal and resource variation can create skew before network work. Conversely, aligned entries followed by long completion may point toward communication or shared-resource work. A collective includes dependencies on several ranks, so one local timing interval should not be interpreted as pure physical-link transit time.

P(max⁡rTr≤t)=F(t)p,P(at least one slow rank)=1−(1−q)pP(\max_r T_r\le t)=F(t)^p,\qquad P(\text{at least one slow rank})=1-(1-q)^p
The equal single-rank CDF F and slow probability q=1−F(t) are dimensionless. These identities require p independent identically distributed rank times. They are not valid automatically with correlated rank behavior, and they do not determine the duration of a slow event.↔ Scroll wide equations horizontally.

Preserve tail and correlation evidence

Report distributions and a clearly defined aggregation interval, not only one best or mean time. Compare synchronized workload phases and record whether measurements include rank readiness waits. An average of local p99 values is not the p99 of their maximum. Repeated iterations can also be correlated, so a large sample count does not necessarily give that many independent observations. A useful investigation combines rank timelines, transport errors, congestion indicators, memory activity, and useful step throughput before choosing a mitigation.

The probability lab makes the independent-count assumption inspectable. Reset, set both p=0.05 and n=20, predict one slow rank on average and probability of none equal to 0.95^20, then Play or Step. Separately Reset, set both p=0.05 and n=30, predict 1.5 and no-slow probability 0.95^30, then Play or Step. Exact binomial bars count hypothetical independent slow ranks; they contain no shared switches, latency durations, or real fabric traffic. Explain which observed correlations would invalidate using this distribution as a training-tail forecast.

An individual p99 is not a step p99

For a teaching model, thirty-two required rank times are independent with the same threshold t at their individual 99th percentile, so each rank exceeds t with probability 0.01. Ignore all other critical-path work.

  1. The probability that every rank is at or below t is 0.99^32≈0.72498 under the independence model.

  2. The probability that at least one exceeds t is 1−0.99^32≈0.27502, or about 27.50 percent. A threshold that is p99 individually is therefore far from p99 for this maximum.

  3. The calculation gives no extra duration after t and no correlated-fabric prediction. If a shared bottleneck couples ranks, the independent product must be replaced by an appropriate joint model or observed step distribution.

The result

Distributed tail claims need the maximum's actual scope and dependence structure, not a relabeled individual percentile.

Explore the model

Interactive lab

Interactive lab · probability

Count independent slow ranks, then question independence

Reset, set both p=0.05 and n=20, predict mean one and no-slow probability 0.95^20, then Play or Step. Separately Reset, set both p=0.05 and n=30, predict mean 1.5 and no-slow probability 0.95^30, then Play or Step. This exact binomial model has no latency durations, shared fabric, or correlated ranks.

Count independent slow ranks, then question independenceThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forIndependent rank tails compound at a distributed maximum, while real shared-resource dependence needs separate evidence.

Check your understanding

Why is the mean of per-rank p99 times not automatically the p99 of a training-step collective?

Try it yourself

Ten independent ranks each have a 0.02 chance of exceeding a fixed threshold. Compute the probability that at least one exceeds it. Name the assumption most likely to need checking on a shared fabric.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Compute one minus the probability that all ten stay below the threshold.

Compare with the solution

The probability is 1−0.98^10≈0.18293, or about 18.29 percent. Independence and a common marginal distribution need checking because shared congestion, synchronized traffic, or common input dependencies can couple rank times. The number still does not specify the size of the resulting delay.

Take it with you

  • Match aggregate traffic to its shared physical boundary.
  • Separate rank readiness skew from communication after entry.
  • Use the actual joint tail distribution instead of averaging individual percentiles.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.