Disabling NCCL P2P Increased NVLink Traffic on Two H100s

On the slowest path I tried, two H100s delivered about 6,600 output tokens a second. One of those cards running the whole model by itself delivered about 8,800. I had added the second card, given it half the model, and ended up with three quarters of the output. That is the result the last post ended on.

The same pair had done about 13,000 tok/s on the path vLLM chose for it. The cards stayed in the same machine, joined by the same NVLink, through every run. I changed how they combined their results. I thought I knew which setting would take that work off the link. The clue that I had it wrong was in the byte counters on the cards. They went up.

GPU · two NVIDIA H100 80 GB in one machine, joined by NVLink

Engine · vLLM 0.31.0, NCCL 2.29.7

Model · Qwen/Qwen3-8B, BF16

Workload · 512-token prompt, 256-token output, prefix caching off

Load generator · closed loop, each client keeps one request in flight; 16, 64 and 256 clients

Runs · four paths between the cards, the default one twice and the others once; one card alone as the baseline

Data · raw data and scripts will be published in a public repository after this series; this post will link to it then

Both cards need the sum before they can go on

I ran one copy of the model across the pair, with vLLM’s tensor parallelism. When a layer computes a result in parts, each card holds a partial answer for every token the engine put in that step. The next operation needs the sum. The cards add the corresponding values and both get the result back. That exchange is an all-reduce. A client waiting for a word sees none of it, but the model has to get through it before that word can go out.

A call carries the results for the whole batch. Adding another token to a step adds another row of values to the same message. The exchange happens repeatedly as the batch goes through the model, including when the engine reads a prompt. Counting bytes per output token would charge the prompt’s share of the traffic to the answer, so I count per processed token.

I had a rough number to check against the cards. The model has 36 layers and a hidden width of 4,096 values. Allow for two exchanges per layer, with each value stored in two bytes, and the expected payload comes to about 590 kB per processed token. That is a calculation from the shape of the model. The profiler capture agrees with that count: it has 73 all-reduce calls for every all-gather call, and two per layer over 36 layers is 72.

Three names carry the rest of this post.

NVLink is the direct connection between the cards. On this machine nvidia-smi reports the pair as NV18, a bonded set of 18 links, each at 26.562 GB/s. NCCL’s log shows the two cards linked to each other and to an NVSwitch.

NCCL is NVIDIA’s library for operations like all-reduce. It chooses how the data travels, and its documentation names the three ways that matter here. With peer-to-peer, one card reads the other’s memory directly, over NVLink. Without it, NCCL falls back to shared memory on the host. The third is NVLink SHARP, NVLS for short, which lets NCCL hand collective work to the NVSwitch.

vLLM’s default on these cards is not NCCL. It tries FlashInfer’s all-reduce kernels first, and it can combine an all-reduce with RMSNorm, the normalization that follows it, into one call. vLLM calls that a fusion. Not every call is fused: my capture of this path has fused calls and separate ones.

I started with vLLM default. The startup log listed FlashInfer first among the all-reduce backends, with the fusion enabled. A startup list tells me what the engine can choose. Later I would check what actually ran.

To get NCCL, I had to do more than set --disable-custom-all-reduce. On the version I ran, that flag disables one backend and leaves the others available, as an open issue and its pull request on the vLLM tracker describe. I disabled the FlashInfer and symmetric-memory backends as well, and turned off the fusion. On restart the backend list read ['PYNCCL'] and the fusion setting read false.

Both NCCL workers reported a route marked NVL to the other card and channels connected via P2P/CUMEM. At the heaviest load each card sent about 651 kB per processed token over NVLink and received the same. That put the counter in the neighborhood of the model calculation.

For NCCL, P2P off, I set NCCL_P2P_DISABLE=1. I expected to have my run without NVLink. Both workers acknowledged the setting. The route to the other card now read PHB, through the host bridge. Every channel connection in that part of the log said via SHM/direct/direct, through shared host memory. If I had stopped reading there, that run would have been the bottom row of my table.

Then I read the counters for the same load. With P2P off, each card sent about 898 kB per processed token and received about 897 kB. I had taken away direct peer access and measured more traffic on the link, in both directions. Calling the run “without NVLink” was my mistake. The flag had done what its name said.

I had already seen a clue in a test I ran before the serving rounds. NCCL’s own benchmark, nccl-tests, had reported about 337 GB/s of bus bandwidth at a message size of 1 GiB with ordinary settings and about 207 GB/s with P2P off. That is more than a path through the host could carry: each card’s link to the host is PCIe Gen5 x16, about 64 GB/s in one direction by the specification. With P2P off it had also logged an NVLS communicator, and the NVLink counters on both cards had advanced farther than with P2P on. I ran the serving round under the name “without NVLink” with that record already on disk.

I went back to the serving logs. A few lines above the shared-memory channels, both workers had reported multicast support, 16 NVLS channels and an NVLS communicator there too.

NCCL gives NVLS its own setting. I left P2P off and added NCCL_NVLS_ENABLE=0. In NCCL, P2P and NVLS off, both workers acknowledged the new setting and reported zero NVLS channels. The shared-memory connections and the host-bridge route were still there. This time the transmit and receive counters stayed at zero on both cards through the heaviest load.

At 256 clients, NVLink bytes per processed token rose when I disabled P2P and fell to zero when I disabled NVLS as well.
At 256 clients, NVLink bytes per processed token rose when I disabled P2P and fell to zero when I disabled NVLS as well.

The records do not show which operation put those extra bytes on NVLink. The channel lines describe connections, and the counters cover everything that crossed the link during the load. Neither has a call identifier I can match to the other. I can say which setting made the traffic disappear on this pair. I cannot take one all-reduce from the earlier run and say how its bytes travelled.

The result also belongs to this kind of machine. NVLS needs the NVSwitch. On a pair where it does not start, turning P2P off alone would leave only the host path. The count of NVLS channels in NCCL’s startup log says which case you have.

On the slowest path, one card beat the pair

Here is steady-state output in generated tokens per second, rounded to the nearest ten. The single-card row uses the same baseline as the previous post.

path 16 clients 64 clients 256 clients
vLLM default 3,070 8,390 13,010
NCCL 2,750 7,900 12,800
NCCL, P2P off 2,250 6,520 11,300
NCCL, P2P and NVLS off 2,080 4,500 6,610
one card 2,000 5,440 8,770
At the heaviest load the pair stayed above the single-card line with P2P off and fell below it with NVLS off as well.
At the heaviest load the pair stayed above the single-card line with P2P off and fell below it with NVLS off as well.

At 16 and 64 clients, every move down the two-card rows cost more output than I saw move in a repeat at that load. At 16 clients NCCL delivered about 90% of vLLM default’s output. At 64 it delivered about 94%.

I cannot draw the same conclusion at 256 clients. There the API server process from the last two posts limited both vLLM default and NCCL, so their order is unresolved, and without that limit the gap between NCCL and the P2P-off run could be wider than it looks.

The last step is clean at the heaviest load. With P2P already off, disabling NVLS left the pair at about 59% of its previous output.

Where the single card crosses the pair depends on the load. At the lightest load the pair on the slowest path came out a little ahead, within the spread of the repeats. At the middle load it delivered about 83% of one card’s output. At the heaviest it delivered about 75%. Either card run alone beat the pair at those two loads.

I could see it at the client as well. On one card a request at the heaviest load finished in a median of 7.6 seconds. With the model split across the pair and both settings off, that went to 10.1 seconds. The clients kept their requests in flight, the container recorded no CPU throttling during the load, and the engine recorded no preemptions. I went back to the exchange itself.

The same NCCL kernel took longer on each path

After the measured phase I put a shorter load on each configuration and captured the GPU kernels. On vLLM default I found the FlashInfer names oneshotAllreduceFusionKernel and twoshotAllreduceKernel. The fused call averaged about 8 microseconds on one card. The two-shot call on that card averaged about 86. A separate normalization kernel also appears in the trace, so even on the default path the calls are not interchangeable.

All three NCCL captures gave me the same name, ncclDevKernel_AllReduce_Sum_bf16_RING_LL. On the same card it averaged about 25 microseconds with NCCL, 46 with P2P off, and 179 with both settings off. I counted the same number of calls on that card in each capture, and none on one card alone.

The name distinguished FlashInfer from NCCL. If someone handed me that NCCL name by itself, I could not tell which of the three paths I was looking at. For that I needed the connection log and the link counters. Nor can I multiply those durations into an explanation of the serving rate. I timed the kernels on the shorter load after the sweep.

The cards drew less power at full clock

Back in the measured load, with both settings off, the cards drew a median of 417 W and 412 W. Both reached a median clock of 1,980 MHz, and neither reported a reason to lower it in any sample at that level.

Both cards drew their lowest median board power on the path that delivered the fewest tokens.
Both cards drew their lowest median board power on the path that delivered the fewest tokens.

What would I have seen if I had watched GPU utilization? A median of 100% on both cards. A card can have a kernel running while the next piece of model work still needs a result from its partner. Longer exchanges fit the lower power and full clocks I saw here. Waiting for each other is my reading of those measurements. The power samples do not tell me how long either card spent waiting, and the profiler was recording at a different time.

What I changed in how I measure

  • Before I label a run “without NVLink”, I read the transmit and receive counters on both cards over the load. A shared-memory channel in a startup log was enough to give my run the wrong name.
  • I save the worker logs with the counters. A zero on the link tells me the traffic disappeared. The change from allocated NVLS channels to none tells me what changed at startup.
  • I read the log of the library’s benchmark before I plan the rounds that depend on it, not only its bandwidth numbers.
  • I keep a profiler duration attached to the load that produced it. The trace tells me which calls got longer. The sweep tells me what a client paid.

In the next post I follow the card that ran hotter than its partner, even when I gave each the whole model to run alone.

Appendix: How I measured

  • Output. The increase in the engine’s generated-token counter from the end of the opening wave to the last request sent, divided by elapsed time. That leaves out the simultaneous start and the drain. Each client sent 16 measured requests. Time to the last token includes all measured requests.
  • Repeats. I repeated vLLM default and a single-card run. At each load I used the larger departure from the original rate as the scale for comparing neighboring rows. Each NCCL configuration ran once, so its own run-to-run spread is unknown.
  • NCCL setup. Alongside --disable-custom-all-reduce, I set VLLM_ALLREDUCE_USE_FLASHINFER=0, VLLM_ALLREDUCE_USE_SYMM_MEM=0 and fuse_allreduce_rms=false, and kept those settings across the NCCL runs. The worker logs recorded connection setup and topology. They did not record the algorithm and protocol selected for each call during serving.
  • Link traffic. The change in each card’s NVLink data counters over the load phase, divided by prompt plus generated tokens. I used the KiB unit given in NVIDIA’s Python binding and decimal kB in the chart; I did not verify that unit independently. On vLLM default each card received about 951 kB per processed token and sent 651 kB. The records do not explain that excess.
  • Expected payload. 36 layers, two exchanges per layer, 4,096 values, two bytes each. The capture has 73 all-reduce calls for every all-gather call. I did not check the count in the model’s source.
  • Profiler. The separate capture used 64 clients, two requests per client and up to 64 output tokens per request. For each kernel on each card I divided its summed duration by its call count. The single-card captures, including the one with a separate worker process, contained no all-reduce kernel.
  • Benchmark. Bus bandwidth from the out-of-place column of all_reduce_perf, with counter readings around the whole test, run with ordinary settings and with P2P disabled. At 16 MiB messages it reported about 211 and 139 GB/s. There is no run with both P2P and NVLS disabled.
  • Power and clock. Medians per card over the load phase at 256 clients.