Home / Learn / AI Networking / Tail Latency in Distributed AI Training
On this page
Average and tailWhy training is governed by the tailThe effect of scaleWhere delays come fromJob completion timeReducing network tail latencyReducing tail latency elsewhereApproaches in the training methodTail latency in inferenceWhy predictability is the goalMeasuring itFor chip designersCommon questionsRelated guidesTail Latency in Distributed AI Training
In distributed training, the slowest message sets the pace. Tail latency is the delay experienced by the slowest small fraction of operations, as opposed to the average. When a model is trained across many accelerators, each step finishes only when every accelerator has received the data it needs. One late transfer holds up all of them. That makes the consistency of the network, and of everything else in the system, more important than its typical speed.
Average and tail
Suppose a network delivers most messages in 10 microseconds, and one in a thousand takes 1 millisecond. The average looks excellent. The tail, that one in a thousand, is a hundred times worse.
Tail latency is described using percentiles.
| Measure | Meaning |
|---|---|
| Median, or 50th percentile | Half of operations are faster than this |
| 99th percentile | One in a hundred is slower |
| 99.9th percentile | One in a thousand is slower |
| Maximum | The single slowest |
For many systems, the higher percentiles matter most.
Why training is governed by the tail
Large models are trained on many accelerators working in parallel. In the common synchronous approach, each training step goes like this:
- Every accelerator computes on its share of the data.
- They exchange results, typically gradients, so that all have a combined value.
- Each updates its copy of the model.
- The next step begins.
The exchange must complete for every accelerator before any can continue. The step’s communication time equals the time of the slowest transfer in it.
The effect of scale
The more transfers a step involves, the more likely at least one of them is slow.
If each individual transfer has a one in a thousand chance of being delayed, and a step involves a thousand transfers, then most steps will include at least one delayed transfer. The rare case becomes the usual case.
At the scale of today’s clusters, with thousands of accelerators and many transfers per step, what would be a negligible tail in a small system becomes the main determinant of performance. The whole cluster, representing a very large investment, runs at the speed of its worst link at any given moment.
Where delays come from
In the network
- Congestion. Queues build at a switch, and packets wait.
- Uneven load balancing. Two large flows hashed onto the same link.
- Packet loss and retransmission. A lost packet recovered by a timeout can add a delay thousands of times the normal transfer time.
- Flow control pauses that block unrelated traffic.
- Link errors causing retries.
- Degraded or failing links.
In the hosts
- Operating system interruptions. Scheduling and background tasks.
- Interrupt handling and other processor activity.
- Memory effects, such as page faults.
- Software pauses, including garbage collection.
- Contention with other workloads.
In the accelerators and storage
- Thermal throttling.
- A slower device in the group.
- Storage hiccups when loading data or writing checkpoints.
A slow participant of any kind is called a straggler.
Job completion time
Because of this, AI networks are judged less by throughput or average latency than by job completion time: how long the actual training job takes. Two networks with the same average latency can give very different completion times if one has a worse tail.
A related view is accelerator utilization. Time spent waiting for the slowest transfer is time the accelerators are idle.
Reducing network tail latency
Even load across paths. Per-packet spraying or adaptive routing prevents any flow from being stuck on a congested link.
Avoid loss, or recover immediately. Losslessness removes retransmission delays. Where loss is accepted, fast detection, through trimmed packets for example, and selective retransmission keep recovery short. What must be avoided is waiting for a timeout.
Responsive congestion control. Keep queues short and react within microseconds.
Non-blocking topology. Provide full bandwidth at every tier, so that congestion arises only from imperfect distribution and not from lack of capacity.
Reliable links. Strong error correction and, in some designs, retry at the link level, so that bit errors do not become end-to-end retransmissions.
Fast failure handling. Detect and route around a failed or degraded link quickly.
Hardware transport. Running the transport in the network adapter removes the variability of host software from the path.
Reducing tail latency elsewhere
- Bypassing the operating system for data transfers, as RDMA does.
- Dedicated processor cores for communication, isolated from other activity.
- Keeping infrastructure work off the host, so background networking and storage tasks do not interfere.
- Consistent hardware and attention to cooling.
- Monitoring to find and replace underperforming components.
Approaches in the training method
Software can reduce sensitivity to stragglers.
- Asynchronous training. Accelerators do not wait for each other. This avoids the problem and can affect how well the model learns.
- Backup workers. Extra participants are included, and the step proceeds when enough have responded.
- Bounded staleness. Slightly out-of-date values are tolerated.
- Communication-efficient algorithms. Exchanging less data, or less often.
- Topology-aware scheduling. Placing jobs so their communication stays local.
Most large-scale training remains synchronous, because it gives the most reliable results, which keeps the burden on the infrastructure.
Tail latency in inference
Inference has its own version. A user request may involve several accelerators, retrieval from storage and multiple model calls. The response is ready only when all parts are done.
For interactive services, response time targets are set at high percentiles. A service that is fast on average and occasionally very slow gives a poor experience. Agent workloads, which chain many model calls, are especially exposed: over a long sequence, hitting a slow call somewhere becomes likely.
Why predictability is the goal
The lesson for system design is that predictability can be worth more than peak speed. A network that always delivers in 20 microseconds will often outperform one that delivers in 10 microseconds most of the time and in a millisecond now and then.
This shapes many of the design choices in AI networking: lossless or fast-recovery transports, per-packet load balancing, non-blocking topologies and hardware implementation. All are aimed at narrowing the distribution of delay.
Measuring it
- Latency distributions, not just averages, including high percentiles.
- Job completion time on representative workloads.
- Per-step timing in training, to find which steps are slow and why.
- Network counters. Pause frames, drops, retransmissions and queue depths.
- Per-link and per-device monitoring to locate stragglers.
For chip designers
Hardware affects the tail directly.
- Deterministic processing. Fixed, short latency in the data path, with no variable software in the loop.
- Fast loss recovery implemented in hardware.
- Per-packet path selection and quick response to congestion feedback.
- Low-latency error correction choices.
- Precise timestamps for measuring delay.
- Telemetry that exposes where time is being spent.
Common questions
What is tail latency?
The delay experienced by the slowest portion of operations, usually expressed as a high percentile such as the 99th or 99.9th. It describes the worst cases, as opposed to the average.
Why does one slow message matter so much in AI training?
In synchronous training, every accelerator waits until all the data for a step has been exchanged. The step takes as long as its slowest transfer.
How is tail latency reduced?
By balancing load evenly across network paths, avoiding or quickly recovering from packet loss, keeping queues short, using hardware-based transports and removing sources of variation in the hosts.