Building Ring All-Reduce over TCP Sockets from First Principles
Decentralized distributed gradient aggregation without MPI or InfiniBand dependencies.
TCP socket buffering (Nagle algorithm) was batching tiny chunk packets, introducing 40ms transmission latency spikes.
Setting TCP_NODELAY immediately restored line-rate ring transmission throughput.
Building Ring All-Reduce over TCP Sockets from First Principles
TCP socket buffering (Nagle algorithm) was batching tiny chunk packets, introducing 40ms transmission latency spikes.
Setting TCP_NODELAY immediately restored line-rate ring transmission throughput.
Many distributed ML frameworks assume you have an InfiniBand fabric with RoCE and complex NCCL drivers. We wanted Dark Forest to support distributed training over ordinary Gigabit and 10GbE network switches using pure TCP sockets.
The Ring Topology
We split gradient tensors into $N$ equal chunks across $N$ ring workers:
- Scatter-Reduce: Workers transmit partial sums in a closed circle.
- All-Gather: Workers transmit finalized sums until all nodes hold identical weights.