NCCL collectives without GPU peer-to-peer: eight RTX 4090s at 2, 4 and 8 cards, within and across sockets
The server from the first post has eight RTX 4090s, four behind each CPU socket’s PCIe switch, and no GPU peer-to-peer on the stock driver. NCCL’s only transport between two cards there is shared host memory: the sender writes into a buffer in RAM, the receiver reads it back, and every byte crosses PCIe twice. The 72B post measured what that does to a whole model. This post measures the collectives themselves: how fast is an all-reduce, an all-gather or a point-to-point send on 2, 4 and 8 cards, inside one socket or across both, at the sizes vLLM actually issues for 32B- and 72B-class models?
The short answer is a map with one coordinate. For large messages the bus bandwidth of an all-reduce depends on k, the largest number of participating cards behind one socket’s PCIe path: 12.4 GB/s at k = 1 (two cards, one per socket), 7.5 or 8.5 GB/s at k = 2, 4.4 or 4.5 GB/s at k = 4. Eight cards are not slower than four on one socket, because each socket path carries four cards either way. Six of the seven predictions I wrote down before the run to test this account held in all five rounds; the seventh, about point-to-point sends across sockets, landed between the lines I had set, so the account is reported here as a map and not as a law.
Setup
| Set | GPUs | Cards | k (cards sharing one socket path) |
|---|---|---|---|
| S2a | 0, 1 | 2 | 2 |
| X2 | 0, 4 | 2 | 1 |
| S4a | 0-3 | 4 | 4 |
| X4 | 0, 1, 4, 5 | 4 | 2 |
| A8 | 0-7 | 8 | 4 |
The operations are the ones vLLM v0.30.0 issues on such cards: its PyNcclCommunicator.all_reduce (the custom all-reduce and symmetric-memory paths switch themselves off without peer-to-peer), its all-gather for the logits, and torch.distributed send/receive on an NCCL group for pipeline hops. All-reduce sizes run from 4 KiB to 256 MiB, with the sizes a Qwen2.5-32B decode step issues at batch 1, 8, 32, 64 and 256 (10, 80, 320, 640 KiB, 2.5 MiB), the 15 and 24 MiB all-reduces of a 1,536-token prompt for the 32B and 72B models, and a 20 MiB prefill chunk. All-reduces run eagerly at every size and inside a CUDA graph up to 4 MiB, which is how vLLM runs them in decode.
Each cell is 10 warm-up batches, then 20 timed batches of M back-to-back calls between CUDA events, with M chosen so that a batch lasts at least 2 ms and the ranks aligned by a 4-byte all-reduce before each batch. The batch time is the slowest rank’s; the round value is the median of the 20 batches. Bus bandwidth follows the nccl-tests definition: for all-reduce, bytes per second times 2(n-1)/n. Every set gets a fresh launch of its rank processes, so fresh NCCL communicators, and the five sets run in a random order in each of five rounds. In the same rounds, before the collectives, the same GPU sets copy to and from host memory at the same time, which gives each set’s share of its socket path for comparison (the method of the first post, now with a 99% window-overlap check on every cell).
NCCL is 2.29.7, the one in vLLM’s wheel, with every setting at its default. A transport check with NCCL_DEBUG=INFO ran once for every configuration measured: every connection reports via SHM/direct/direct, none P2P or NET, and every staging buffer is mmap-allocated host memory. At 64 MiB and above every set uses the ring algorithm with the simple protocol on two channels, so the large-message ratios below compare like with like.
The map
Large-message bus bandwidth L, the median of the values at 64, 128 and 256 MiB, per set and round, with the per-card copy share from the concurrent calibration of the same round:
| Set | k | L all-reduce (GB/s), rounds 1-5 | copy share per card (GB/s) | L / share |
|---|---|---|---|---|
| X2 | 1 | 12.36, 12.34, 12.34, 12.39, 12.37 | 16.27 | 0.76 |
| X4 | 2 | 8.48, 8.48, 8.48, 8.48, 8.49 | 8.94 | 0.95 |
| S2a | 2 | 7.48, 7.44, 7.51, 7.50, 7.44 | 8.94 | 0.84 |
| A8 | 4 | 4.46, 4.46, 4.46, 4.46, 4.46 | 4.58 | 0.97 |
| S4a | 4 | 4.35, 4.35, 4.34, 4.34, 4.35 | 4.58 | 0.95 |
The copy share is the smaller of the set’s two concurrent copy aggregates (host to GPU and GPU to host, both directions at once) divided by the number of cards; a ring loads both directions. In absolute terms: a 256 MiB all-reduce takes 21.6 ms on X2, 35.7 ms on S2a, 47.4 ms on X4, 92.0 ms on S4a and 105.2 ms on A8. The round-to-round spread of every L is under 1%.
Two things the table shows directly. Cards on one socket path share it: four cards on socket 0 (S4a) get 58% of the bandwidth of two (S2a), and two cards on one socket (S2a) get 60% of two cards on two sockets (X2). And the eight-card set is not worse than the four-card set on one socket: A8 and S4a both have four cards behind each path and land within 3% of each other.
The calibration behind the “copy share” column is the first post’s concurrent copy measurement rerun in every round. One card alone moves 25.3 GB/s host to GPU, and 16.3 + 19.8 GB/s when it copies both ways at once; two or four cards on one socket together move 25.3-25.8 GB/s one way and about 18 + 18 GB/s both ways; sets spanning both sockets move 50.5-51.6 GB/s one way and 33-40 GB/s per direction both ways. Those numbers are within 2% of the published ones and are the per-socket ceiling the collectives are read against.
One account, seven predictions
Before the run I wrote the socket-path account as seven ratios, each with a range in which it holds and a range in which it fails, judged over five rounds (holds only if every round is in the holds range). The point of writing them down first is that a near miss cannot be talked into a hit afterwards.
| Id | Ratio | Predicted | Holds if | Fails if | Rounds 1-5 | Verdict |
|---|---|---|---|---|---|---|
| k1 | copy, four cards on one socket / one card | about 1 (one shared path) | ≤ 1.3 | ≥ 1.6 | 1.021, 1.022, 1.022, 1.022, 1.022 | holds |
| k2 | copy, two cards on two sockets / one card | 2 | ≥ 1.7 | ≤ 1.15 | 1.999, 2.001, 2.001, 2.000, 2.000 | holds |
| c1 | L(X2) / L(S2a) | 2 | ≥ 1.4 | ≤ 1.15 | 1.651, 1.658, 1.643, 1.653, 1.662 | holds |
| c2 | L(X4) / L(S4a) | 2 | ≥ 1.4 | ≤ 1.15 | 1.949, 1.950, 1.954, 1.954, 1.953 | holds |
| c3 | L(S4a) / L(S2a) | 0.5 | ≤ 0.7 | ≥ 0.9 | 0.581, 0.584, 0.578, 0.579, 0.584 | holds |
| c4 | L(A8) / L(S4a) | 1 | 0.8-1.2 | ≥ 1.4 or ≤ 0.65 | 1.024, 1.024, 1.026, 1.026, 1.025 | holds |
| c5 | send/receive, L(X2) / L(S2a) | 1 | 0.85-1.15 | ≥ 1.25 or ≤ 0.8 | 1.197, 1.207, 1.197, 1.191, 1.210 | unresolved |
The copy ratios k1 and k2 say the path model is right about copies: four cards on one socket get 2% more than one card, two cards on two sockets get exactly twice. The collective ratios c2, c3 and c4 say the same about all-reduce, and c1 says it less sharply: two cards across sockets get 1.65 times the bandwidth of two cards on one socket, not 2, because X2 reaches only 76% of its copy share where every other set reaches 83-97%.
The seventh prediction concerned a one-directional send from rank 0 to rank 1. Within a socket (S2a) the bytes go up the socket-0 path and back down it; across sockets (X2) they go up socket 0’s path and down socket 1’s. PCIe is full duplex, so I predicted the same rate, within 15%. Measured: 16.6 GB/s within a socket, 19.9 GB/s across, a ratio of 1.19 to 1.21 in every round. That is in neither the hold range nor the fail range, so this prediction is unresolved, and the post reports the map without claiming the account.
What the data does say about that gap: the premise “full duplex is free” is contradicted by the calibration itself. One card copying both ways at once gets 16.3 + 19.8 GB/s, not 25 + 25, and two cards on one socket get 17.9 + 18.7. A one-directional send through host memory loads the shared path both ways, up from the sender and down to the receiver, and 16.6 GB/s is 93% of that two-way rate. The gap also appears only where bandwidth matters: X2 and S2a sends are equal (ratio 0.98-1.00) from 4 KiB to 320 KiB, where a send costs a flat 32-34 µs whatever its size, 3-8% apart from 512 KiB to 4 MiB, and 20% apart from 8 MiB up. Why the cross-socket send stops at 19.9 GB/s rather than at the 25 GB/s a single card’s one-way copy reaches is unexplained by this measurement.
Small messages: what a decode step pays
For decode, vLLM captures the all-reduce in a CUDA graph. Per-call time of the graph-captured all-reduce at the Qwen2.5-32B decode sizes (batch × 5,120 × 2 bytes), median over rounds:
| Size (batch) | S2a | X2 | S4a | X4 | A8 |
|---|---|---|---|---|---|
| 10 KiB (1) | 10.3 µs | 10.8 µs | 18.7 µs | 20.8 µs | 39.7 µs |
| 80 KiB (8) | 24.5 µs | 20.1 µs | 59.4 µs | 36.7 µs | 70.6 µs |
| 640 KiB (64) | 106 µs | 74.8 µs | 240 µs | 150 µs | 288 µs |
| 2.5 MiB (256) | 366 µs | 228 µs | 922 µs | 479 µs | 1,041 µs |
At batch 1 the call is latency-bound and grows with the number of cards (two cards 10 µs, four 19-21 µs, eight 40 µs; NCCL uses its low-latency protocol there). From 80 KiB upward the socket-path order of the map takes over: X2 beats S2a and X4 beats S4a. Eager calls at these sizes cost 0.5-2 µs more than graph replays, so the graph saves almost nothing per call here.
The logits all-gather, which vLLM runs outside the graph, costs 75 µs on four cards and 94 µs on eight at batch 1 (297 KiB), and 1.8 / 2.0 ms at batch 32.
What this means for tensor parallelism
From the map, the communication a tensor-parallel forward pass pays per token and per prompt, using vLLM’s counts (2L+1 all-reduces per step, one logits all-gather):
| Model, cards | Per decode token, batch 1 | Per decode token, batch 32 | Per 1,536-token prompt |
|---|---|---|---|
| Qwen2.5-32B on S4a (4 cards, one socket) | 2.5 ms | 19.6 ms | 0.71 s |
| Qwen2.5-72B on A8 (8 cards) | 5.1 ms | 43.8 ms | 1.60 s |
Against the break-even derived from public peak numbers (tensor parallelism stops winning on the token gap when its communication reaches (n-1) memory-bound steps, about 49 ms for the 32B model on four cards and 126 ms for the 72B on eight; on prompts when it reaches (n-1) compute times, about 0.46 s and 1.18 s), the decode numbers are well below the line at both batch sizes, and the prompt numbers are above it: 0.71 s against 0.46 s for the 32B model, 1.60 s against 1.18 s for the 72B. The 72B post measured the whole thing rather than its communication, and found the same ordering: TP8 had the shortest gap between tokens, and PP8 the fastest first token.
For the 72B prompt: the 24 MiB all-reduce on eight cards runs at 4.45 GB/s of bus bandwidth, against the 6.0 GB/s at which the 161 all-reduces of a 1,536-token prompt would cost exactly the (n-1) compute times.
Scope. NCCL 2.29.7 as shipped in vLLM 0.30.0’s wheel with default settings, on eight RTX 4090s at PCIe 4.0 x16 behind two Xeon Gold 5320 sockets with no GPU peer-to-peer, message sizes 4 KiB to 256 MiB, ring algorithm throughout the large sizes. Cards with peer-to-peer or NVLink, tuned NCCL (NCCL_BUFFSIZE, NCCL_ALGO, NCCL_SHM_USE_CUDA_MEMCPY and the like) and host-staged replacements for NCCL are not covered.
Reproduce
The harness is at rockyshi-dev/collectives-no-p2p: python -m collbench run does the machine check, the transport check, the five rounds with their calibration cells and the telemetry, and python -m collbench report recomputes every gate, the seven ratios and the tables above from the saved records. Its README defines every quantity and gate. The numbers in this post were produced by that repository at commit e101ebd on this server.