You just spent $300,000 on a rack of H100s. Your weights are loaded, your CUDA kernels are compiled, and you’re ready to serve Llama-3 405B to the world. You hit the endpoint with a request and... the latency is abysmal. You look at your telemetry and see your GPUs are sitting idle for 40% of the execution time, waiting for data that’s stuck in transit.
Welcome to the Communication Wall.
In the world of Large Language Models (LLMs), we have reached a bizarre inflection point: Compute is essentially free; communication is everything. When you are sharding a model across multiple GPUs—a necessity for anything larger than 70B parameters—the speed of your "interconnect" (the wires and protocols connecting your chips) becomes the primary determinant of your profit margins.
If you shard your model poorly across an InfiniBand fabric when it should have lived on an NVLink domain, you aren't just losing milliseconds; you are burning capital. Today, we’re going deep into the hardware-software co-design of LLM serving, benchmarking the raw physics of NVLink Sharding against InfiniBand-Connected Clusters.
The Physics of the "Memory Wall" and Why We Shard
To understand why the interconnect matters, we have to look at the anatomy of an LLM inference request. Inference is split into two distinct phases:
- The Prefill Phase: The model processes the input tokens. This is compute-bound. The GPU loves this because it can saturate its Tensor Cores.
- The Decoding Phase: The model generates tokens one by one. This is memory-bandwidth bound. The GPU has to load every single weight of the model from VRAM just to generate one token.
For a model like Llama-3 405B (FP16), the weights alone take up ~810GB. An H100 has 80GB of VRAM. You literally cannot fit the model on one chip. You must shard it.
But here is the catch: when you split a weight matrix across two GPUs (Tensor Parallelism), those GPUs must talk to each other multiple times during a single forward pass of a single layer. If that "talk" happens over a slow pipe, your $30,000 GPU is just a very expensive space heater while it waits for a packet to arrive.
Architecture I: The NVLink "Super-GPU" Strategy
NVLink is NVIDIA’s proprietary, high-speed interconnect designed to make a cluster of GPUs behave like one giant, monolithic processor.
The NVSwitch Fabric
In a standard HGX H100 board (the "Delta-Next" architecture), 8 GPUs are connected via an NVSwitch fabric. This isn't a simple point-to-point connection. It’s a non-blocking switch that allows every GPU to talk to every other GPU at a staggering 900 GB/s of bidirectional bandwidth.
Compare that to PCIe Gen5, which tops out at around 64 GB/s. NVLink is over 14 times faster.
Software Co-Design: Tensor Parallelism (TP)
When serving on an NVLink-enabled node, we primarily use Tensor Parallelism.
- The Workflow: We split the Linear layers (Attention and MLP) across the 8 GPUs. Each GPU computes a partial result.
- The Sync Point: To get the final result, the GPUs perform an
All-Reduceoperation. - The NVLink Advantage: Because NVLink supports Direct Memory Access (DMA) and hardware-accelerated collectives through the NCCL (NVIDIA Collective Communications Library), this
All-Reducehappens almost instantaneously.
In an NVLink domain, the "communication tax" is so low that you can scale to 8 GPUs with near-linear efficiency.
Architecture II: The InfiniBand "Distributed Brain" Strategy
What happens when 8 GPUs aren't enough? Or what if you’re building a cost-effective DIY cluster using PCIe-based H100s or older A100s connected via network cards? You move to InfiniBand (IB).
InfiniBand is the gold standard for High-Performance Computing (HPC) networking. Unlike Ethernet, which is chatty and has high overhead, InfiniBand uses Remote Direct Memory Access (RDMA). This allows one GPU to pull data directly from the memory of a GPU in another server without involving the CPU or the OS kernel.
The Bottleneck: Bandwidth Disparity
Even a top-tier 400G (NDR) InfiniBand link provides roughly 50 GB/s of bandwidth.
- NVLink: 900 GB/s
- InfiniBand: 50 GB/s
We are looking at an 18x difference in speed. If you try to run fine-grained Tensor Parallelism over InfiniBand, your performance will fall off a cliff. The GPUs will spend 80% of their time waiting for the network.
Software Co-Design: Pipeline Parallelism (PP)
Because of the bandwidth constraint, we change our software strategy when moving to InfiniBand-connected clusters. Instead of splitting every single layer (TP), we use Pipeline Parallelism.
- The Workflow: We put layers 1–20 on Server A and layers 21–40 on Server B.
- The Sync Point: Server A processes its chunk and sends only the activations (the output of the last layer) to Server B.
- The Advantage: We only send data over the slow InfiniBand link once per forward pass, rather than dozens of times per layer.
The Great Benchmark: NVLink Sharding vs. InfiniBand
Let’s look at some hypothetical but representative numbers when serving a 175B parameter model (like GPT-3 architecture) across two different infrastructures.
| Metric | 8x H100 (Single Node, NVLink) | 8x H100 (2 Nodes, 400G InfiniBand) |
|---|---|---|
| Parallelism Strategy | Tensor Parallel (TP8) | Pipeline Parallel (PP2) + TP4 |
| Interconnect Bandwidth | 900 GB/s (NVSwitch) | 50 GB/s (NDR IB) |
| All-Reduce Latency | ~2-5 microseconds | ~20-50 microseconds |
| Tokens/Sec (Throughput) | 1,200 | 850 |
| Time to First Token (TTFT) | 180ms | 310ms |
Analysis: Why the Gap?
The InfiniBand setup suffers from "Bubble Latency." In Pipeline Parallelism, while Server B is working on the second half of the model, Server A is often idle unless you use advanced micro-batching. Micro-batching helps throughput but kills latency.
Furthermore, the NCCL tuning for InfiniBand is significantly more complex. You have to account for network topology (Clos networks), hop counts, and potential congestion. NVLink, being a "closed" system inside the chassis, has deterministic, jitter-free performance.
Engineering Deep Dive: The Software Stack
Hardware is just silicon until you write the code to orchestrate it. Let’s look at how we actually implement this co-design using vLLM and TensorRT-LLM.
1. The NCCL Environment Variables
To get the most out of an NVLink setup, you have to ensure NCCL knows how to use the hardware. Engineers often overlook these tunables:
# Force NCCL to use NVLink for all-reduce
export NCCL_P2P_LEVEL=NVL
# Disable shared memory transport if NVLink is available to reduce CPU overhead
export NCCL_SHM_DISABLE=1
# Enable CUDA Graph to reduce kernel launch overhead during communication
export VLLM_USE_CUDA_GRAPH=1
2. Custom All-Reduce Kernels
In high-performance serving, we don't just use standard NCCL. Teams at Meta and NVIDIA have developed Custom All-Reduce Kernels that bypass some of the NCCL state machine overhead. These kernels are written in CUDA and utilize the fact that in an 8-GPU NVLink domain, the memory is physically addressable across the fabric.
// Pseudo-code for a cross-GPU pointer access in NVLink
__global__ void nvlink_all_reduce_kernel(float* local_data, float** remote_ptrs) {
int tid = threadIdx.x;
float sum = local_data[tid];
// Direct access to other GPU memory via NVLink
#pragma unroll
for (int i = 0; i < 7; i++) {
sum += remote_ptrs[i][tid];
}
local_data[tid] = sum;
}
This "Direct Access" is impossible over InfiniBand, where you must go through the network stack.
The "Hype" Context: Why Everyone is Talking about "Clusters"
If NVLink is so much better, why is there so much hype around InfiniBand (and its rival, RoCE v2 / Ultra Ethernet)?
It comes down to Scaling Limits. NVLink currently caps out at a "pod" level. In the H100 generation, that's typically 256 GPUs using NVLink Switch Systems (external racks of switches). If you want to train or serve a model across 10,000 GPUs (the scale of frontier models), you simply cannot do it with NVLink alone.
The industry hype is focused on bridging the gap. This is why NVIDIA acquired Mellanox (the leaders in InfiniBand). They are trying to make InfiniBand feel as much like NVLink as possible.
The RoCE v2 Challenger
There is also a massive push for RoCE v2 (RDMA over Converged Ethernet). Companies like Meta are building massive clusters (like their 24k H100 cluster) using high-speed Ethernet instead of InfiniBand.
- The Hype: Ethernet is cheaper and more "standard."
- The Reality: The tail latency in Ethernet is a nightmare for LLM serving. If one packet gets dropped and triggers a retransmission, the entire inference request stalls. This is the "Incast" problem, and solving it requires specialized switches (like Broadcom’s Jericho3-AI).
When to Choose What: The Engineering Decision Matrix
As an infrastructure engineer, how do you decide where to deploy your model?
Scenario A: High-Throughput API Serving (e.g., Llama-3 70B)
- Strategy: NVLink Single Node (8x GPUs).
- Why: 70B fits comfortably across 2 or 4 GPUs with enough room for a massive KV-cache. You can run 2-4 instances of the model on a single 8-GPU node. NVLink allows you to maximize the number of concurrent requests (QPS) without the network becoming a bottleneck.
Scenario B: Ultra-Large Model Research (e.g., Llama-3 405B or Grok-1)
- Strategy: Multi-node InfiniBand Cluster.
- Why: You have no choice. The model won't fit on 8 GPUs once you account for the KV-Cache (the memory used to store the context of the conversation).
- The Optimization: Use Tensor Parallelism (TP8) within the NVLink nodes and Pipeline Parallelism (PP2 or PP4) between the nodes. This is the "Hybrid" approach.
Scenario C: The "Budget" GPU Cloud (RTX 4090s or PCIe L40S)
- Strategy: High-speed Ethernet (100G+).
- Why: You don't have NVLink (Consumer cards have it disabled/removed).
- The Trade-off: You will be forced to use Pipeline Parallelism even for smaller models, which will drastically increase your latency. This is fine for offline batch processing but terrible for a real-time chatbot.
The Hidden Variable: KV-Cache Management
We cannot talk about hardware-software co-design without mentioning the KV-Cache. Every token the model generates needs to be stored in memory so it can be used to generate the next token.
In a sharded environment, where does the KV-cache live?
- In Tensor Parallelism, the KV-cache is also sharded. Each GPU only stores a portion of the "heads" of the attention mechanism.
- The communication requirement for the KV-cache is relatively low during generation, but the memory pressure is high.
If your interconnect is slow (InfiniBand), you are incentivized to use larger batch sizes to keep the GPUs busy. But larger batch sizes consume more KV-cache memory. Eventually, you run out of VRAM, and you have to start "evicting" or "swapping" the cache to the CPU (OOM - Out of Memory).
This is why vLLM's PagedAttention was such a breakthrough. It treats GPU memory like virtual RAM in an OS, allowing for non-contiguous storage. When combined with NVLink, PagedAttention allows you to push the GPU to 95%+ memory utilization without a catastrophic drop in throughput.
The Future: Blackwell and the NVLink Expansion
NVIDIA’s upcoming Blackwell (GB200) architecture is an admission that NVLink is the winner. The new NVLink Switch allows for 72 GPUs to be connected in a single NVLink domain with 130 TB/s of aggregate bandwidth.
In this world, the "InfiniBand vs. NVLink" debate for inference mostly disappears for everything except the most massive frontier models. We are moving toward a "Rack is the Unit of Compute" model, where the entire 72-GPU rack is treated as one single, liquid-cooled, monster GPU.
Pro-Tips for Infrastructure Engineers
- Don't over-shard: If your model fits on 2 GPUs, don't shard it across 8 just because you can. The communication overhead (even on NVLink) can sometimes outweigh the compute gains.
- Monitor NCCL health: Use
NCCL_DEBUG=INFOto check if your GPUs are actually using NVLink. You’d be surprised how many "misconfigured" clusters are actually falling back to PCIe without the admin knowing. - Mind the NUMA: Ensure your InfiniBand cards are physically connected to the same CPU socket as the GPUs they are serving. Crossing the CPU's QPI/UPI link adds 50-100ns of latency that can kill your performance.
- Quantization is your friend: Using FP8 or INT4 quantization doesn't just save memory; it reduces the amount of data that needs to be sent across NVLink/InfiniBand, effectively doubling your interconnect bandwidth.
The Bottom Line
Building a high-performance LLM serving stack is an exercise in balancing the laws of physics against the cost of hardware. NVLink is a surgical tool—precise, incredibly fast, but limited in scale. InfiniBand is the heavy machinery—powerful, expansive, but requiring significant logistical effort to operate efficiently.
If you are building for the next generation of AI applications, your focus shouldn't just be on the TFLOPS of the GPU. It should be on the topology of the wire. In the race to 1,000 tokens per second, the winner won't be the one with the fastest chips, but the one with the least amount of waiting.
Stop looking at the compute. Start looking at the interconnect. Your latency (and your cloud bill) will thank you.