, ,

How to network GPU nodes for multi-node training

Multi-node training swaps gradients after every step, so the slowest link sets the pace for every GPU. InfiniBand vs RoCE vs TCP, rail-optimised topology, GPUDirect RDMA, the Kubernetes pieces and how to prove it with nccl-tests. With a live demo.

How to network GPU nodes: four 8-GPU nodes in a ring with one degraded red link

AI infrastructure · Kubernetes · InfiniBand · RoCE · NCCL

One 8-GPU server can train a lot, but not everything. Once a job spans several servers, the network between them decides how fast it runs. After every training step, every GPU swaps its gradients with every other GPU, and nobody starts the next step until that is done. This post explains why one slow cable slows the whole job, how InfiniBand, RoCE and plain Ethernet compare, and how to set it up and prove it on Kubernetes. The live demo lets you break each part.

Try it: GPU Fabric Lab

Run a training job over TCP, RoCE or InfiniBand on 1 to 16 nodes. Then halve one cable, slow one node or switch off GPUDirect RDMA, and see the commands that would find each fault.

Open the demo →

The ruleThe slowest link sets the pace for everyone

The usual way GPUs share gradients is a ring all-reduce, run by NVIDIA’s NCCL library. Each node passes a slice of data to the next node, round and round, until every GPU has the sum. Inside a node the data moves over NVLink at hundreds of GB/s. Between nodes it moves over the network, and the ring can only go as fast as its slowest hop.

node 1 node 2 node 3 node 4 200 Gb/s · DIRTY OPTIC 400 Gb/s400 Gb/s400 Gb/s every packet in the ring waits on the red link

Three links at 400 Gb/s and one at 200 Gb/s give you a 200 Gb/s ring. No error is raised; the job just runs slower.

What that costs

From the demo, a 70B model training job. Step time in seconds, lower is better:

4 nodes, InfiniBand, healthy96% scaling efficiency
2.49
One slow GPU in one nodeeveryone waits for it
3.24
GPUDirect RDMA offcopies through host memory
3.38
One cable at half speed53% slower, no error
3.82
16 nodes, RoCE, PFC missing on one switch34% efficiency
7.04

Over plain TCP the same 16-node job takes about 70 seconds a step, 3% efficiency, which is why nobody trains across nodes without RDMA.

The choicesThree kinds of network

Avoid for trainingEthernet, TCP

The normal data centre network. Data goes through the CPU and the kernel network stack. Fine for inference and for storage, far too slow for gradients between nodes.

Typical: 25 to 100 Gb/s per node, shared by 8 GPUs.
Ethernet with RDMARoCE v2

RDMA over Ethernet you already know how to run. Needs a “lossless” setup: PFC and ECN configured the same way on every NIC and switch. Get one hop wrong and performance collapses.

Typical: one 400 Gb/s NIC per GPU.
Built for thisInfiniBand

Lossless by design, with its own subnet manager and very low latency. The usual choice for large training clusters. A separate network with its own skills and tools.

Typical: one 400 Gb/s NDR NIC per GPU.

Rail-optimised: one switch per GPU position

Big GPU clusters wire every GPU 0 to one leaf switch, every GPU 1 to the next, and so on. Each set is called a rail. Traffic between the same GPU on different nodes stays on one switch, one hop away.

8 leaf switches, one per rail node 1 node 2 node 3 node 4 RAIL 0

GPU 0 of every node (red) shares one switch. Rails 1 to 7 are wired the same way; only rails 0 and 1 are drawn.

GPUDirect RDMA: let the NIC read GPU memory

With GPUDirect RDMA
GPU memory→NIC→network→NIC→GPU memory
Without it
GPU memory→copy to host RAM→NIC→network→NIC→copy from host RAM→GPU memory

It needs the nvidia-peermem kernel module and NICs on the same PCIe switch as their GPUs. When it silently fails to load, NCCL quietly falls back to the slower path.

On KubernetesThe pieces you need

NVIDIA Network Operator

Installs the NIC drivers and the device plugin that exposes RDMA devices to pods, the network equivalent of the GPU Operator.

A second pod network

Multus gives each training pod an extra interface on the RDMA network, next to its normal Kubernetes network.

GPU Operator with RDMA on

Loads nvidia-peermem for GPUDirect RDMA, for example with driver.rdma.enabled=true.

A gang-scheduled job

All workers start together, using the MPI Operator, a JobSet or a PyTorchJob, queued by Kueue from part 5.

# a training pod that can use RDMA
metadata:
  annotations:
    k8s.v1.cni.cncf.io/networks: rdma-net
spec:
  containers:
  - name: trainer
    resources:
      limits:
        nvidia.com/gpu: 8
        rdma/rdma_shared_device_a: 1
    securityContext:
      capabilities:
        add: ["IPC_LOCK"]
    env:
    - name: NCCL_DEBUG
      value: INFO               # prints which transport NCCL picked

Prove itTest before you trust it

  1. Read the NCCL log

    With NCCL_DEBUG=INFO the first lines say which network it chose. You want NET/IB and “GPU Direct RDMA Enabled”. NET/Socket means it fell back to TCP.

  2. Run nccl-tests across every node

    # one rank per GPU across all nodes, launched with MPI
    all_reduce_perf -b 1G -e 8G -f 2 -g 1

    Record the bus bandwidth (busbw). Then test node pairs: a pair well below the rest points at a cable, NIC or switch port.

  3. Check the suspect link

    ibstat                 # is every port at full rate?
    perfquery -x           # symbol errors, link downs on the port
    ethtool -S eth2 | grep -E "pause|discard"   # RoCE: pause frames and drops
  4. Rule out a slow GPU

    If every link tests fine but the job is slow, look for one throttled GPU with the clock metric from part 1. In the demo, one slow GPU cost as much as a bad cable.

Before you call it done
  • Multi-node training runs on RDMA, InfiniBand or RoCE, never plain TCP.
  • NCCL logs show NET/IB and GPU Direct RDMA enabled on every node.
  • You have a baseline nccl-tests result for every node pair.
  • On RoCE, PFC and ECN settings are checked on every NIC and switch hop.
  • Link speed and error counters are in your monitoring, not checked by hand.
  • New and repaired nodes run nccl-tests before they rejoin the pool, as in part 3.
Find the bad cable

Open GPU Fabric Lab, set 16 nodes on InfiniBand, then halve one cable. Watch the step time and read the commands that would find it.

Open the demo →

The series so far: monitoring, logging, node lifecycle, sharing, scheduling, cost, autoscaling and this post on networking. Next: storage and checkpoints.

About The Author


Discover more from Journal of Intelligent Infrastructure

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Architect’s Toolkit

About the Author

Dr. Pranay Jha is a Cloud and AI Consultant with 18+ years of experience in hybrid cloud, virtualization, and enterprise infrastructure transformation. He specializes in VMware technologies, multi-cloud strategy, and Generative AI solutions. He holds a PhD in Computer Applications with research focused on Cloud and AI, has published multiple research papers, and has been a VMware vExpert since 2016 and a VMUG Community Leader.

Discover more from Journal of Intelligent Infrastructure

Subscribe now to keep reading and get access to the full archive.

Continue reading