advanced32 min studyLesson 593 in Engineering

Communication is hidden only when readiness and shared resources allow it

Calculate overlap from an actual schedule and separate asynchronous launch capability from communication removed from the step's critical path.

On this page

What you’ll understand

  • Locate gradient readiness and the last required communication completion.
  • Compute exposed communication from aligned execution intervals.
  • Test whether overlap changes operation durations through contention.

An asynchronous collective call creates an opportunity for overlap, not a guarantee of hidden communication. Its inputs must be ready, its launch must occur, the transport must make progress, and a later consumer must wait for completion. Compute and communication can also compete for memory bandwidth or device execution resources. The useful question is how much communication remains exposed at the required step boundary under the concurrent schedule, rather than whether two colored ranges appear on a trace.

Readiness determines the overlap window

During data-parallel backward execution, different gradient groups become ready at different times. A reduction cannot safely consume a group before its required contributions exist. Framework bucketing trades earlier readiness against per-collective launch and transfer costs: a large bucket may wait longer, while many small buckets can create substantial overhead. Collective ordering across ranks is another correctness constraint. A configured asynchronous path does not permit arbitrary reordering or early use of an unfinished reduced gradient by the optimizer.

Start with a timeline that marks the first valid launch of each communication operation, the compute that is independent of it, and the consumer that requires its completion. The final communication tail can dominate even if earlier buckets overlap well. An apparent empty region on one rank might reflect another rank's late readiness rather than a slow link. Correlate the same collective and relevant ranks before calling the entire interval network transfer. Readiness, transport progress, and completion waits are different components of the observed schedule.

T=a+C+G−O+z,0≤O≤min⁡(C,G)T=a+C+G-O+z,\qquad 0\le O\le\min(C,G)
This identity describes one compute interval of duration C and one communication interval of duration G with overlap O, a connected union and no intervening idle gap, preparation a, and required tail z. All quantities use time units and the durations come from the concurrent schedule. More complicated traces need interval unions and explicit dependencies rather than summed inclusive times.↔ Scroll wide equations horizontally.

A maximum formula needs strong assumptions

If independent compute and communication begin together, run at fixed durations, and can progress concurrently without interference, their joint duration is the larger of the two. This is the ideal fully overlapped case. It is not valid when communication begins near the end of compute, when a stream wait serializes the operations, or when either duration grows under contention. An isolated collective benchmark and an isolated matrix kernel do not establish their durations when both run simultaneously on the training device.

Measure concurrent durations and compare completed steps with and without the proposed overlap path. A shorter exposed tail can be offset by slower compute if communication consumes execution or memory resources. Likewise, a collective can report a longer duration while the whole step becomes faster because more of that duration is hidden. Avoid optimizing a percentage of overlapped trace area independently of end-to-end time. Preserve the same collective semantics and valid gradient updates so the comparison measures scheduling rather than a changed training algorithm.

Tideal=a+max⁡(C,G)+z,Gexposed=max⁡(0,G−C)T_{\rm ideal}=a+\max(C,G)+z,\qquad G_{\rm exposed}=\max(0,G-C)
The two intervals start together after preparation and have enough independent resources to retain their durations. Exposed communication is defined relative to the end of this compute interval before the common tail. These formulas are conditional ideals, not general predictions for bucketed, contended, or delayed-launch training.↔ Scroll wide equations horizontally.

Design an overlap experiment around the finish boundary

Change one bucket or overlap setting at a time and record readiness, launch, compute completion, collective completion, and final update. Compare multiple warm completed windows rather than one trace. Keep topology, rank placement, message sizes, accumulation, and input work fixed. If a setting improves only an isolated collective, test whether its launch schedule still fits the actual backward path. A valid explanation should identify which exposed interval disappeared, what new contention appeared, and why the end-to-end result follows under the observed dependencies.

The roofline lab makes one resource ceiling explicit but contains no collective. Reset, set both I=8 FLOP/byte and B=100 decimal GB/s, predict 800 GFLOP/s, then Play. Reset and set both I=16 and B=100 to predict the fixed 1000 GFLOP/s compute roof. Its memory bandwidth is a synthetic device-memory parameter, not network bandwidth; playback changes neither control. The activity reminds us that a shared resource can limit progress, but it cannot simulate overlapping kernels, rank readiness, transport, or the slowdown caused by running communication beside compute.

Identical operation durations can produce different exposed tails

Preparation lasts 4 ms and a required update lasts 2 ms. Compute occupies [4,24] ms. Communication takes 12 ms after its inputs are ready. Compare a serialized schedule, a launch at 12 ms, and a later launch at 20 ms. Assume fixed durations and no contention.

  1. With serialization, communication starts after compute at 24 ms and ends at 36 ms; the update finishes at 38 ms. The total is 4+20+12+2=38 ms.

  2. Launching communication at 12 ms makes it occupy [12,24] ms, entirely within compute. Their overlap is 12 ms and the update finishes at 26 ms, saving 12 ms relative to serialization.

  3. Launching instead at 20 ms gives communication interval [20,32] ms. Only 4 ms overlaps compute; the update finishes at 34 ms. The 8 ms tail after compute is exposed despite the same 12 ms collective duration.

The result

Launch readiness changed the completed schedule without changing the isolated work durations. Contention or additional dependencies would require a new model and measurement.

Explore the model

Interactive lab

Interactive lab · roofline

A shared-resource ceiling does not implement overlap

Reset, set both I=8 FLOP/byte and device-memory B=100 decimal GB/s, predict 800 GFLOP/s, then Play. Reset and re-enter both I=16 and B=100 for the 1000 GFLOP/s cap. The fixed min(1000,B×I) model has no network, collective readiness, concurrent kernels, or contention-induced duration change. It is a resource-ceiling analogy, not an overlap experiment.

A shared-resource ceiling does not implement overlapSynthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. Current readings: Attainable ceiling: 640 GFLOP/s; Ridge intensity: 12.5 FLOP/byte; Ceiling regime: Memory-bound ceiling. All parameters are adjustable with the labeled controls below.Hypothetical roofline upper bound: 640 GFLOP per second at operational intensity 8 FLOP per byte and bandwidth 80 gigabytes per second.0.1110641101001000Operational intensity · FLOP/byte · log scaleCeiling · GFLOP/s · log scalePeak: 1000
Attainable ceiling / kernelBandwidth roof / traceCompute ceiling
Attainable ceiling
640 GFLOP/s
Ridge intensity
12.5 FLOP/byte
Ceiling regime
Memory-bound ceiling
t = 0 s

Synthetic roofline ceiling min(1000, B·I), in GFLOP/s, with B in decimal GB/s and I in FLOP/byte. Playback traces the roof without changing the selected kernel. This upper-bound model is not a measured throughput prediction, hardware comparison or price model. 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 forUse actual concurrent timelines and completed work to determine whether communication is hidden.

Check your understanding

An asynchronous all-reduce overlaps backward kernels on a trace but the completed step is slower. Which explanation needs direct testing?

Try it yourself

Independent compute and communication start together and take 18 ms and 11 ms, followed by a 3 ms common tail. Under the ideal no-contention assumptions, find completion and exposed communication. Then find completion if communication cannot start until 15 ms after compute begins.

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

Give me a hint

For the delayed case, compare absolute finish times rather than applying max to durations from different starts.

Compare with the solution

The simultaneous-start case completes in max(18,11)+3=21 ms, with no communication tail after compute. In the delayed case, communication ends at 15+11=26 ms after compute began, so completion is max(18,26)+3=29 ms. The exposed communication tail is 8 ms; asynchrony alone does not remove that dependency.

Take it with you

  • Input readiness and collective ordering bound when communication can begin.
  • Use max-duration overlap formulas only with their simultaneous-start and no-contention assumptions.
  • Judge overlap by equivalent completed-step time, including changed compute durations and final tails.

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.