Recommended resources
The freely available resources this lesson will direct you to.
Introduction
In our previous lesson, we examined the critical role of intra-node interconnects, comparing the universal PCIe standard with the high-performance, proprietary NVLink fabric for communication within a single server. We saw how creating a tightly-coupled, high-bandwidth communication domain among GPUs is essential for performance.
However, training today's largest AI models requires scaling far beyond the 8 or 16 GPUs that can fit in a single chassis. This means we must connect dozens or even hundreds of servers into a massive, cohesive cluster. As we move "outside the box," the network becomes the new frontier for optimization and a potential system-wide bottleneck.
This lesson directly addresses that challenge. We will explore how to build a high-performance network fabric that allows a cluster of GPUs to operate as a single, powerful computational entity. Our learning objective is to explain how inter-node technologies like InfiniBand and RDMA enable low-latency communication in a cluster.
To achieve this, we will:
- Analyze the limitations of traditional TCP/IP networking for high-performance computing.
- Dive into the core principles of Remote Direct Memory Access (RDMA).
- Examine InfiniBand as a network fabric designed from the ground up for RDMA.
- See how these technologies combine in the form of GPU-Direct RDMA to enable efficient, large-scale distributed training.
The Problem with Traditional Networking
In a standard network using the TCP/IP protocol suite, sending data from an application on one server to another is a process heavy with overhead. The typical data path looks like this:
- The sending application makes a system call, which triggers a context switch into the operating system kernel.
- Data is copied from the application's memory buffer into a kernel-owned socket buffer.
- The kernel's TCP/IP stack processes the data, breaking it into packets, adding headers, and managing connection states. This consumes significant CPU cycles.
- The data is copied again to the network interface card's (NIC) buffer for transmission.
- On the receiving end, this entire process happens in reverse: the NIC interrupts the CPU, data is copied from the NIC to a kernel buffer, processed by the TCP/IP stack, and finally copied to the receiving application's memory.
For distributed AI training, where GPUs must frequently synchronize small messages (like gradients) with minimal delay, these copies and kernel interventions introduce unacceptable latency and consume valuable CPU resources that could be used for other tasks, like data preprocessing.
RDMA: Bypassing the Bottleneck
Remote Direct Memory Access (RDMA) is a technology designed to solve precisely these problems. It allows the network adapters to transfer data directly between the application memory of two different machines, without involving the CPU or OS kernel on either side.
To understand the fundamentals and benefits of RDMA, the following video provides an excellent introduction.
Everything You Wanted to Know About RDMA But Were Too Proud to Ask
This video, from a presentation by SNIA, begins by defining Direct Memory Access (DMA) and then extends the concept to Remote DMA (RDMA). It highlights the key performance benefits that RDMA provides over traditional TCP networking.
Watch the segment from 03:17 to 07:21. Focus on understanding the three primary benefits of RDMA: zero-copy networking, low latency, and high throughput, achieved by freeing the CPU from data transfer tasks.
The core mechanisms that enable these benefits are:
- Kernel Bypass: Applications can post work requests directly to the network adapter's queues, completely avoiding system calls and context switches into the kernel for data path operations.
- Zero-Copy: Data is moved directly from the user-space memory of the sending application to the user-space memory of the receiving application. This eliminates the intermediate copies to and from kernel buffers that plague TCP/IP.
- CPU Offload: The entire transport protocol is handled by the hardware on the network adapter, freeing the host CPU from tasks like packet segmentation, reassembly, and reliability checks.
To visualize the profound difference in the data path, let's watch another segment from the same video.
Everything You Wanted to Know About RDMA But Were Too Proud to Ask
This next clip provides a clear, side-by-side comparison of the data flow in a traditional TCP/IP stack versus an RDMA-enabled one.
Watch from 10:35 to 13:26. Observe the number of layers and data copy operations involved in the TCP path and how RDMA streamlines this by creating a direct channel between the application memory and the RDMA-capable NIC (RNIC).
As you can see, RDMA fundamentally changes the networking paradigm from a software-centric, OS-mediated process to a hardware-accelerated, memory-centric one.
InfiniBand: A Fabric Built for RDMA
While RDMA defines the how of efficient data transfer, we also need a network fabric designed to support it. InfiniBand (IB) is a high-performance networking standard created specifically for this purpose. Unlike Ethernet, which is a general-purpose, best-effort network, InfiniBand was designed from the ground up for the demands of supercomputing and large-scale clusters.
The following reading and diagram explain the architecture of InfiniBand and compare it to its main rival, RDMA over Converged Ethernet (RoCE).
What is InfiniBand? Architecture, RDMA, and InfiniBand vs Ethernet ...
This article from Network-Switch.com provides a concise yet comprehensive overview of the InfiniBand architecture and its core principles.
Please read the sections 'How InfiniBand Works?' and 'InfiniBand vs Ethernet (RoCE): Which One Fits Your Workload?'. As you read, focus on these key concepts: Lossless Fabric: How InfiniBand's credit-based flow control prevents packet drops, which is crucial for deterministic, low-latency performance. Subnet Manager: The role of a centralized manager in configuring the network. Cut-through Switching: How IB switches reduce forwarding latency. Key Differences with RoCE: Note the fundamental distinction between InfiniBand's 'lossless by design' philosophy and Ethernet's need for additional mechanisms (PFC/ECN) to achieve a similar result.

In essence, while Ethernet can be adapted to run RDMA (via RoCE), InfiniBand was purpose-built for it. This native integration provides a more predictable and often lower-latency environment, which is why it has historically been the preferred choice for the most demanding HPC and AI training clusters.
Putting It All Together: GPU-Direct RDMA
We've now established that RDMA provides low-latency memory-to-memory transfers, and InfiniBand provides the ideal fabric for it. The final piece of the puzzle is to connect this directly to the GPUs.
This is accomplished through GPU-Direct RDMA. This technology allows the InfiniBand network adapter to transfer data directly to or from a GPU's memory, bypassing host system memory (CPU RAM) entirely.
The data path for a transfer between GPU 1 on Server A and GPU 2 on Server B looks like this:
- Data is read from GPU 1's memory over the PCIe bus to the InfiniBand adapter on Server A.
- The adapter sends the data over the InfiniBand network to the adapter on Server B.
- The adapter on Server B writes the data directly over its PCIe bus into the memory of GPU 2.
This process completely bypasses the CPUs and system memory on both servers, providing the lowest possible latency for inter-node GPU-to-GPU communication.
The following short clip explains this concept very clearly.
This segment from a talk by Lambda's CEO explains the practical impact of GPU-Direct RDMA over InfiniBand in a GPU cluster.
Watch the clip from 52:34 to 53:22. The key takeaway is the visual contrast between the old method (GPU -> CPU memory -> NIC) and the new method (GPU -> NIC), which dramatically improves node-to-node bandwidth.
This ability to directly link the memory spaces of GPUs across the network is the cornerstone of modern distributed training, enabling the massive AllReduce operations required for data parallelism to execute with maximum efficiency.
Conclusion
In this lesson, we have bridged the gap between single-server performance and cluster-scale computing. We've seen that scaling out requires a fundamental rethinking of networking, moving away from traditional, CPU-centric protocols to hardware-accelerated, memory-centric approaches.
Key Takeaways:
- TCP/IP Overhead: Traditional networking is ill-suited for high-performance distributed computing due to overhead from data copies, kernel context switches, and CPU involvement.
- RDMA as the Solution: RDMA enables low-latency, high-bandwidth communication by providing kernel bypass, zero-copy transfers, and CPU offload.
- InfiniBand as the Fabric: InfiniBand is a network architecture designed from the ground up for RDMA, featuring a lossless fabric with credit-based flow control that ensures deterministic performance.
- GPU-Direct RDMA: This technology is the final link in the chain, enabling direct data transfers between the memories of GPUs located in different nodes, bypassing host CPU and RAM entirely. This is a critical enabler for efficient large-scale AI training.
Preview of the Next Lesson:
We have just introduced a specific instance of a broader family of technologies: GPU-Direct. In our next lesson, we will step back and describe the role of GPU-Direct technologies in enabling data transfers that bypass the CPU more generally. We'll explore not only GPU-Direct RDMA for networking but also GPU-Direct Storage for I/O, providing a complete picture of how modern systems are designed to keep the data flowing directly to and from the GPU.