Contents
Two RTX 3090 cards can serve a 26-billion-parameter mixture-of-experts model with tensor parallelism, but they have to talk to each other on every layer. On the rented host we use, that conversation is slow. This post covers one change that reduces how much they say, what it gained, and how little we can yet claim about its cost.
The link between the cards
The host has no NVLink bridge, and nvidia-smi topo -p2p r reports that the chipset does not support peer-to-peer between the GPUs. NCCL therefore moves data through host shared memory. In the notebook record for this host (the measurement harness was not archived, so this is not a dataset run), an all-reduce reached roughly 5.1 GB/s of algorithm bandwidth: 12.6 MB in bf16 took 2.45 ms and 25.2 MB in fp32 took 4.85 ms.
Those two numbers are almost exactly proportional to the bytes moved. With bandwidth fixed by the link, time is simply
and 12.6 MB at 5.1 GB/s is 2.5 ms. Changing NCCL algorithm, protocol, buffer size or channel count did not help in the notebook record, and more channels was 12% worse. When time is set by bytes, the lever is to move fewer of them.
Where the bytes are
A profile of one 2,048-token prefill pass (notebook record; the raw trace was not archived) put 27.6% of GPU time in the fp32 all-reduce that combines the expert outputs, and another 14.0% in the bf16 all-reduce of the attention output. The combine is the larger share, and it moves fp32 partial sums.
The change
Each rank’s partial sums are cast to bf16 for the all-reduce when more than 512 tokens are in flight, then cast back to fp32. The threshold is the one the engine’s NVLink multicast path already uses. For decode, the all-reduces are tiny, so the change does not apply there and inter-token latency is unchanged.
What it gained
The benchmark below is identical for both servers: random prompts of exactly 512 tokens, exactly 256 generated tokens, closed-loop concurrency, warm server, one run per point.
| Concurrency | Output tok/s baseline | Output tok/s treatment | Change treatment vs baseline | Total tok/s baseline | Total tok/s treatment | TTFT mean ms baseline | TTFT mean ms treatment | ITL mean ms baseline | ITL mean ms treatment | Requests |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 73.0 | 73.2 | +0.3% | 219.0 | 219.6 | 239 | 220 | 12.9 | 13.0 | 16 |
| 4 | 214.4 | 213.8 | −0.3% | 643.2 | 641.3 | 325 | 327 | 17.6 | 17.6 | 16 |
| 16 | 393.8 | 458.6 | +16.5% | 1,181.5 | 1,375.8 | 3,298 | 1,824 | 28.1 | 28.1 | 64 |
| 64 | 493.5 | 520.4 | +5.5% | 1,480.4 | 1,561.3 | 13,897 | 12,814 | 69.5 | 67.1 | 256 |
| Measure | Value | Unit |
|---|---|---|
| Prompt 1: prompt tokens | 2,061 | tokens |
| Prompt 1: mean absolute prompt-logprob difference | 0.053 | nats |
| Prompt 1: maximum absolute prompt-logprob difference | 1.444 | nats |
| Prompt 1: top-1 token agreement | 0.980 | fraction |
| Prompt 1: perplexity, fp32 combine | 2.499 | ppl |
| Prompt 1: perplexity, bf16 combine | 2.486 | ppl |
| Prompt 1: greedy continuation identical (1 = yes) | 0 | bool |
| Prompt 2: prompt tokens | 1,794 | tokens |
| Prompt 2: mean absolute prompt-logprob difference | 0.062 | nats |
| Prompt 2: maximum absolute prompt-logprob difference | 1.898 | nats |
| Prompt 2: top-1 token agreement | 0.966 | fraction |
| Prompt 2: perplexity, fp32 combine | 2.240 | ppl |
| Prompt 2: perplexity, bf16 combine | 2.247 | ppl |
| Prompt 2: greedy continuation identical (1 = yes) | 1 | bool |
| Prompt 3: prompt tokens | 607 | tokens |
| Prompt 3: mean absolute prompt-logprob difference | 0.010 | nats |
| Prompt 3: maximum absolute prompt-logprob difference | 0.522 | nats |
| Prompt 3: top-1 token agreement | 1 | fraction |
| Prompt 3: perplexity, fp32 combine | 1.171 | ppl |
| Prompt 3: perplexity, bf16 combine | 1.172 | ppl |
| Prompt 3: greedy continuation identical (1 = yes) | 1 | bool |
At 16 concurrent requests aggregate throughput rose by 16.5% and mean first-token latency fell from 3.3 s to 1.8 s. At 4 requests nothing changed. At 64 the gain was 5.5%, but see the limitation below. On a separate uncached-prefill measurement (notebook record, raw output not archived) prefill throughput rose from about 3.17 to about 3.6 thousand tokens per second.
What we can not say yet
Quality. The only check is a small numerical gate: three fixed texts of about 4.4 thousand prompt tokens run through both servers. Mean absolute prompt-logprob difference was between 0.01 and 0.06 nats and top-1 token agreement between 96.6% and 100%. One of three 48-token greedy continuations differs. Perplexity moved in both directions (2.499 to 2.486, 2.240 to 2.247, 1.171 to 1.172), so it is not a one-way degradation. A repeat of the bf16 server was bit-identical, so these differences are real numerical effects and not noise. That is a weak gate: it does not show the change is free, and a task-level evaluation is on the roadmap.
Large batches. Both servers used the default decode CUDA-graph cap of 48, which a later experiment (E04) showed makes decode at 64 concurrent requests run eagerly. The 64-request result may change when that is fixed; re-running with the cap raised is planned as G01.
Repeats. Each figure is one run. The dataset labels every run here preliminary, and the run pages list what was not recorded about the host.
The patch is part of the Ampere series that will be released under the open-source programme; it is not released yet.