Estimate Ring All-Reduce Time for Data-Parallel Training on InfiniBand
Last updated: November 29, 2026
Quick Overview
For a 7B parameter model trained with pure data parallelism on 64 GPUs connected by 400 Gb/s InfiniBand per GPU, estimate the time of one gradient all-reduce with a ring algorithm and explain how you would reduce it.
Nebius
November 29, 20260
0
0 solved
For a 7B parameter model trained with pure data parallelism on 64 GPUs connected by 400 Gb/s InfiniBand per GPU, estimate the time of one gradient all-reduce with a ring algorithm and explain how you would reduce it.
Nebius sells H100 and Blackwell clusters with a dedicated InfiniBand fabric per GPU, and customers often ask solutions and ML engineers why scaling is not linear. The interviewer checks that you know the bandwidth cost of ring all-reduce, can do the arithmetic quickly, and know the levers (overlap, sharding, compression, hierarchy).
What the Interviewer Expects
- States the ring all-reduce cost formula with bandwidth and latency terms
- Converts units correctly from gigabits to gigabytes
- Computes a reasonable order of magnitude
- Explains overlap of communication with backward pass
- Names hierarchical all-reduce, gradient bucketing, ZeRO or FSDP, and lower precision as levers
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- How does tree all-reduce compare at small message sizes?
- With FSDP, what collectives replace the all-reduce and how does the volume change?
- What changes when 8 GPUs per node share NVLink and only cross-node traffic goes over InfiniBand?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Gradients in bf16: bytes GB per step. 64 GPUs, each with its own 400 Gb/s NIC, so GB/s per GPU in each direction. Assume per-hop latency $\alpha \app...
Approach
Ring all-reduce is a reduce-scatter followed by an all-gather. Each GPU sends and receives bytes in each phase, so the total time is $T \approx 2(N-1)\alpha + 2\frac{N-1}{N}\frac{S}{...