The surprising truth about GPU clusters is that their performance is often less about raw GPU power and more about how those GPUs can talk to each other without waiting.

Imagine you have a bunch of powerful GPUs, each capable of crunching numbers at lightning speed. But if they can’t share their intermediate results quickly, they end up waiting for data, turning your super-fast cluster into a bottlenecked mess. This is where interconnects and topology become critical.

Let’s see it in action. Consider a deep learning training job that uses distributed data parallelism. Here, the same model is replicated across multiple GPUs, and each GPU processes a different mini-batch of data. After computing gradients, these gradients need to be averaged across all GPUs to update the model weights. This averaging is a communication-heavy operation.

Here’s a simplified look at how torch.distributed.all_reduce might work conceptually in PyTorch:

import torch
import torch.distributed as dist

# Assume ranks and world_size are initialized
dist.init_process_group("nccl", rank=rank, world_size=world_size)

# 'tensor' is a tensor of gradients computed on this GPU
tensor = torch.randn(1000).cuda()

# Perform the all-reduce operation
dist.all_reduce(tensor, op=dist.ReduceOp.SUM)

# Now 'tensor' contains the sum of gradients from all GPUs

In this snippet, dist.all_reduce is the core communication primitive. The speed and efficiency of this operation depend entirely on the underlying network. If the interconnect is slow or the topology forces data to travel through many hops, this all_reduce will take a significant amount of time, dwarfing the actual computation time on the GPUs.

The system revolves around two main communication patterns: point-to-point (one GPU sending to another) and collective (operations involving multiple GPUs like all-reduce, broadcast, gather). The network fabric connecting the GPUs is designed to accelerate these patterns.

Interconnects: This is the physical network connecting the GPUs. The most common high-performance interconnects are:

  • NVIDIA NVLink: A high-speed, direct GPU-to-GPU connection. NVLink offers significantly higher bandwidth and lower latency than PCIe, crucial for direct GPU communication.
  • InfiniBand: A high-speed network fabric designed for high-throughput, low-latency data transfer, often used to connect multiple nodes (servers) in a cluster.
  • Ethernet (with RoCE - RDMA over Converged Ethernet): High-speed Ethernet can also be used, especially with RDMA capabilities, to achieve low-latency communication between nodes.

Topology: This describes how the GPUs (and nodes) are connected. The arrangement drastically impacts communication paths and potential bottlenecks. Common topologies include:

  • All-to-All (or Fully Connected): Every GPU can directly communicate with every other GPU. This is ideal but becomes impractical and expensive at scale.
  • Torus/Mesh: GPUs are arranged in a grid-like structure. Communication paths are more structured, with data potentially traversing multiple hops.
  • Fat-Tree: A hierarchical network that aims to provide high bandwidth to all endpoints, even under heavy load. It’s a common choice for large clusters.
  • Ring: GPUs are connected in a circular fashion. Data might need to travel around the ring to reach its destination.

Scheduling: The job scheduler (like Slurm, Kubernetes with GPU operators, or custom schedulers) plays a vital role. It must be topology-aware. A smart scheduler will try to place processes for a distributed job onto GPUs that have the fastest interconnects between them, minimizing communication latency. For instance, if a job requires frequent all-reduce operations, the scheduler should ideally co-locate the communicating GPUs on the same node (if using NVLink) or in a low-latency network segment.

The core problem this system solves is efficiently scaling parallel computation. Modern AI models are too large to fit on a single GPU and take too long to train on one. Distributing the workload across many GPUs is essential. However, the inherent communication overhead of distributed algorithms can easily negate the benefits of more GPUs if the interconnect and topology are not optimized.

The exact levers you control are primarily in how you configure your cluster hardware (which interconnects and how they are cabled for the topology) and how you instruct your scheduler to place jobs. For instance, when requesting resources, you might specify that a job needs to run on GPUs within the same node or on a specific set of nodes known to have high-speed interconnects between them.

The most surprising aspect for many is how much a carefully chosen topology can mask the limitations of even slower interconnects, or conversely, how a poor topology can cripple even the fastest NVLink or InfiniBand. For example, in a large cluster, a well-designed fat-tree topology ensures that the aggregate bandwidth between any two groups of GPUs remains high, preventing the network from becoming a bottleneck even when many GPUs are communicating simultaneously. This is achieved by oversubscribing links closer to the core of the network, ensuring that more bandwidth is available where the most traffic converges.

The next challenge you’ll encounter is understanding how different communication patterns (like scatter, gather, reduce-scatter) map to specific network topologies and how to optimize your distributed training code for the hardware you have.

Want structured learning?

Take the full AI Infrastructure course →