Skip to main content

solvers.NetworkRooflineModel

solvers.NetworkRooflineModel()

Analyzes the Distributed Performance Bounds (The Network Wall).

This model elevates the single-node Roofline analysis to the fleet scale. It calculates the Communication Intensity (CI) of a workload and identifies if the fleet is Compute-Bound (Wall 1) or Network-Bound (Wall 2).

Literature Source: 1. Williams et al. (2009), “Roofline Model.” (Theoretical basis) 2. Ghose et al. (2019), “A Survey of Communication-Efficient Distributed Training.”

Methods

Name Description
solve Solve for the fleet-scale performance bound (network roofline).

solve

solvers.NetworkRooflineModel.solve(
    model,
    fleet,
    precision='fp16',
    efficiency=0.5,
)

Solve for the fleet-scale performance bound (network roofline).

Models one data-parallel training step as two independent ceilings — compute and gradient synchronization — and takes the slower as the binding latency (ideal overlap is assumed, so this is a lower-bound model). The conventions used:

  • communication intensity CI = training_ops / sync_bytes [FLOP/byte], with training_ops = 6 * P FLOPs per sample (Kaplan/Chinchilla forward+backward convention) and sync_bytes = 2 * P * bytes_per_param (ring all-reduce moves roughly 2x the gradient volume);
  • network ridge = fleet_peak_FLOPS / bisection_BW [FLOP/byte], the CI above which the fleet is compute-bound.

Parameters

Name Type Description Default
model Workload Workload with a parameter count (required). required
fleet Fleet The cluster; supplies total accelerators, per-accelerator FLOPS, and fabric bandwidth / oversubscription ratio. required
precision str Numerical precision; sets bytes per parameter and the FLOPS entry. 'fp16'
efficiency float Software efficiency factor in (0, 1] applied to fleet peak FLOPS. 0.5

Returns

Name Type Description
PerformanceProfile latency_compute holds the compute ceiling, latency_memory the network ceiling (both in ms); bottleneck is ‘Network’ or ‘Compute’; arithmetic_intensity carries CI.

Notes

Equation: T = max(6P / (eta * fleet_peak), 2P*b / bisection_BW), where P is parameter count and b is bytes per gradient element. CI = 6P / (2P*b); the reported ridge uses fleet peak without eta.

Assumptions: one normalized training sample, uniform data-parallel replicas, and ideal overlap between the two independent ceilings. Excludes: batch/sequence scaling, ring startup latency, optimizer state, capacity checks, and pipeline bubbles. feasible=True does not check whether training state fits; the stored footprint is sync traffic.

References

Williams, Waterman, and Patterson (2009), “Roofline.” https://doi.org/10.1145/1498765.1498785 (bibliography key: williams2009). Derivation: replace memory traffic and its rate by gradient traffic and fabric bisection rate; the 2P*b traffic is an approximate ring volume.

Examples

>>> from mlsysim import Models, Systems
>>> from mlsysim.solvers import NetworkRooflineModel
>>> r = NetworkRooflineModel().solve(Models.Language.Llama3_8B, Systems.Clusters.Research_256)
>>> bool(r.latency >= r.latency_compute and r.latency >= r.latency_memory)
True
Back to top