Running a 27B LLM on Two 16GB GPUs: Inference Speed Benchmarks and Tuning Log

    This article documents benchmarks and tuning steps for running a 27B-parameter open-source language model on a low-cost setup with two 16GB GPUs. It compares driver, backend, and tensor or layer split configurations, reports speeds at 8K, 28K, and 192K context lengths, and explains why prefill and decode degrade at different rates. It also covers the effects of system memory and multi-token prediction, and ends with a checklist for tuning similar setups.

    1. Why I Recorded These Benchmarks

    Many open-source discussions cover running 27B-class models on inexpensive GPUs. Most posts, however, report only a final number, such as “48 tok/s,” without the process, a baseline, or an analysis of the bottleneck. Such figures are of limited use to others. Without the context length, a reader cannot tell what the number measures. Without a driver comparison, a reader cannot tell whether a different driver would perform better. Without a bottleneck analysis, a reader cannot tell whether memory bandwidth, PCIe, or the CPU is the limit.

    This record takes a different approach. Each tuning change was compared against the previous state on the same machine, and each gain is tied to the specific bottleneck it affected. Readers can compare these results with their own hardware and judge which optimizations apply to them.

    2. Hardware and Software Environment

    Hardware:

    • Motherboard and six-core desktop CPU, with 32 GB of dual-channel DDR4 memory
    • Two domestically produced, modified professional compute cards, each with 16 GB of VRAM. The cards have no stock fans, so external fans provide cooling.
    • Total system cost under 2,500 CNY, or about 650 CNY per card

    Software:

    • Mainstream Linux distribution, with deployment in rootless user space
    • GPU compute platform driver: an older stable branch first, then upgraded to a newer mainline branch
    • Inference engine: a mainstream open-source hybrid CPU/GPU inference framework, with three kernel patches for the compute capabilities of older GPUs
    • Model: the 4-bit quantized version of an open-source 27B model (about 15 GB), which includes a multi-token prediction (MTP) head

    Load configuration: The context length was set for each test tier. MTP ran in draft-3 mode. The weights were split across the two cards by tensor dimension.

    3. Final Benchmark Results

    In short: at 8K context, output reached 62.9 tok/s and input reached 367 tok/s. Compared with public figures of 48.3 tok/s from community dual-card setups of a similar type, this result is higher under the same measurement conditions. The main advantages, however, are stability at long context lengths and end-to-end time to first token, not peak single-generation speed.

    End-to-end production-style tests used an 866-token prompt, 256 generated tokens, temperature 0, and MTP draft 3:

    Backend / split method Prefill (tok/s) Decode (tok/s) MTP acceptance rate
    Older driver · tensor split 304.5 50.16 0.573
    Newer driver · tensor split 286.4 57.17 0.573
    Older driver · layer split 310.5 39.80 0.595
    General-purpose backend · layer split 235.7 32.27 0.581

    4. How Speed Degrades with Context Length

    After five rounds of tuning, input and output speed were measured at three context length tiers:

    Context tier Prefill (tok/s) Decode (tok/s)
    8K 366.76 62.17
    28K 348.35 49.70
    192K 202.35 40.30

    Two patterns stand out:

    1. Prefill drops off sharply. From 8K to 28K, prefill falls by only 5.0%. From 28K to 192K, it falls by 41.9%. From 8K to 192K, the cumulative drop is 44.8%. Prefill is compute-intensive, so GPU compute is the bottleneck at short context lengths. As the context grows, the quadratic cost of attention and the memory pressure from the KV cache rise together. Memory bandwidth then takes over from compute as the bottleneck.

    2. Decode drops steeply at first, then levels off. From 8K to 28K, decode falls by 20.1%. From 28K onward, it falls about 15 more percentage points, for roughly 35% in total from 8K to 192K, but the curve flattens. Decode generates one token per step, so it is limited by memory bandwidth. A larger KV cache means more cache data is read and written at each step. That growth is linear, so the decline is gentler.

    The practical takeaway: if your workload is mostly short conversations, this low-cost platform’s peak performance is sufficient. For long-document analysis, reserve at least 30% performance headroom, or consider optimizations such as KV cache quantization or sparse attention.

    5. Quad-Channel Memory Is Not the Answer: A Counterintuitive Variable

    The community machine that reached 48.3 tok/s used a server-class CPU with quad-channel DDR4 memory. Intuitively, higher memory bandwidth should be better. This machine, however, uses a six-core desktop CPU, dual-channel memory, and an asymmetric PCIe topology, and it still reached a higher number.

    This points to an often-overlooked issue. In layered inference, where model weights stay in VRAM, system memory bandwidth is not the main decode bottleneck. During inference, the CPU barely takes part in reading weights. The GPU-side software stack has the greater effect. In this test, upgrading the compute driver from an older version to a newer one raised decode from 50.16 to 57.17 tok/s, a gain of about 14%. The hardware did not change.

    The conclusion: rather than spending on an X99 platform with quad-channel memory, focus on choosing driver and backend versions and applying kernel patches. This holds only when the weights fit fully in VRAM. If VRAM is insufficient and CPU offloading is required, memory bandwidth becomes the bottleneck again, and quad-channel memory becomes worthwhile.

    6. Gains from Multi-Token Prediction

    MTP lets the model predict several candidate tokens at each step. When a candidate is accepted, the computation for those tokens is skipped in later steps. With draft-3 mode in this setup, the acceptance rate stayed between 0.57 and 0.60, which means each verification pass yields about 1.7 to 1.8 tokens on average.

    MTP helps clearly with deterministic tasks at temperature 0 or low temperature, such as code completion and summary extraction. For high-temperature, highly random creative tasks, the acceptance rate drops and the gain shrinks. Before enabling MTP, measure the acceptance rate on your own prompt distribution.

    7. Reusable Tuning Checklist

    1. Choose a Q4-level quantization first. The Q4 quantization of the 27B model is about 15 GB, which fits in the dual 16GB VRAM setup without CPU offloading.
    2. Choose the split method by workload. Tensor splitting favors decode because it computes a single token in parallel. Layer splitting favors prefill, so it is worth considering for long-input workloads.
    3. Driver and backend versions offer the largest free gain. Retest under the same conditions before and after each upgrade. In this case, the gain exceeded 10%.
    4. Watch kernel patches for older cards. Older GPU architectures often lack optimized kernels for newer operators. Community patches, or building your own, can unlock additional performance.
    5. Benchmark each context tier separately instead of reporting one peak number. The degradation curves at 8K, 28K, and long context lengths differ greatly, so a single data point can mislead hardware selection.

    8. Final Thoughts

    This dual-card setup, which cost less than 3,000 CNY, shows that a 27B-class model can deliver smooth interactive performance on a consumer budget. Low-cost inference depends less on adding memory channels or chasing a single peak number. It depends on understanding which layer limits performance, whether compute, VRAM bandwidth, or system memory, and then optimizing the software stack for that layer. I hope this record, with its comparisons, helps more developers reproduce these results on their own hardware and go further.