Dual-GPU LLM Inference: Performance Benchmarking and System Tuning Guide

    A practical guide to evaluating and tuning dual-GPU inference for a ~27B parameter model. Learn how to interpret tokens-per-second numbers correctly, distinguish prefill from decode throughput, weigh tensor vs. layer parallelism, evaluate speculative decoding, and build a reproducible benchmarking workflow.

    Dual-GPU LLM Inference: Performance Benchmarking and System Tuning Guide

    1. Start With the Right Question: What Does Tokens Per Second Actually Tell You?

    When discussing local LLM inference, the most common question is: “How many tokens per second can you get with a model of this size?” The question is easy to answer with a number, but the number is rarely useful for making decisions.

    The reason is that inference speed is not a single constant determined by the model and GPU alone. The same hardware can produce noticeably different results depending on input length, output length, quantization method, parallelism strategy, and runtime version. Add speculative decoding, and the final output speed also depends on draft acceptance.

    A meaningful performance record should therefore answer three questions:

    1. Which phase was measured — input processing (prefill) or token-by-token generation (decode)?
    2. Were the test conditions consistent and reproducible?
    3. Which bottleneck did the optimization improve, and at what cost?

    This article abstracts away the specific hardware and software identifiers from the original benchmark notes and focuses on the general scenario of “running a ~27B parameter model on two GPUs.” All numbers are individual results from the original record; they are not independently verified and do not constitute performance guarantees for other environments.

    2. Case Baseline: Fitting the Weights on Two GPUs Doesn’t Eliminate Memory Bottlenecks

    The original test used two compute cards with 16 GiB of VRAM each, a host with a six-core CPU, 32 GiB of dual-channel memory, and active external cooling. The model used 4-bit quantization, with weight files of roughly 14.94 GiB, and the runtime enabled a built-in draft prediction mechanism.

    These details explain the rough deployment boundary, but they are not enough to fully reproduce the results. A complete record should also include actual GPU clock speeds, power limits, interconnect topology, cache data types, batching settings, and the model’s context configuration.

    2.1 Weight Size Is Only Part of the VRAM Budget

    4-bit quantization significantly reduces weight storage requirements, but you cannot assume that a model file smaller than a single card’s VRAM will always fit and run stably on one card.

    Inference typically also requires allocating:

    • KV cache for stored attention keys and values;
    • Temporary compute buffers and intermediate activations;
    • Device communication and runtime management space;
    • Additional state for draft prediction;
    • Memory alignment and allocator reservations.

    A useful way to think about the VRAM budget:

    Total VRAM requirement ≈ weights + KV cache + compute workspace + runtime overhead.

    Moreover, the combined VRAM of two cards should not be treated as a fully transparent, communication-free contiguous memory pool. How the model is partitioned and which data must move across cards both affect usable capacity and speed.

    2.2 Long Contexts Change the Resource Profile

    With model architecture, cache precision, and concurrency held constant, KV cache usage grows roughly linearly with the number of retained tokens. The longer the context, the more likely cache capacity and access traffic become the dominant pressure.

    A configuration that performs well on short inputs may hit out-of-memory errors, slower cache access, or imbalanced load across devices once long contexts come into play. During deployment, you should verify both “does it start?” and “can it complete requests stably at the target context length?”

    3. Don’t Mix Up the Three Core Performance Metrics

    3.1 Prefill Throughput

    The prefill phase converts the prompt into model state. It can usually exploit large-scale parallelism, so its performance characteristics differ from token-by-token generation.

    Prefill throughput can be expressed as:

    Prefill throughput = input tokens actually processed ÷ prefill time.

    When measuring, you must state whether an existing cache was reused. If one test processes the full input while another hits a prefix cache, the two results are not comparable on the same basis.

    3.2 Decode Throughput

    The generation phase produces new tokens step by step based on existing state. It is typically more sensitive to weight reads, cache access, kernel launch overhead, and cross-card synchronization.

    Decode throughput can be expressed as:

    Decode throughput = newly generated tokens ÷ generation-phase time.

    With speculative decoding enabled, decode throughput should be computed from the finally accepted and delivered tokens — not from all draft tokens.

    3.3 Time to First Token and Total Request Latency

    User-perceived performance is not determined by generation speed alone.

    Time to first token (TTFT) typically includes queuing, input preparation, prefill, and the first generation step. Total request latency must also account for subsequent generation and any necessary data transfers.

    This means an optimization that raises decode throughput does not necessarily reduce total latency for long-input requests. If prefill regresses at the same time, its net benefit must be recalculated at the full-request level.

    4. What the Data Shows: The Same Optimization Can Move Different Phases in Opposite Directions

    The original record compared two runtime versions on the same machine, using identical parallelism settings and draft length. One set of results:

    Context tier Old version prefill New version prefill Old version decode New version decode
    ~8K 386.87 366.76 56.94 62.17
    ~28K 362.54 348.35 45.46 49.70
    ~192K 204.44 202.35 38.38 40.30

    All throughput figures are in tokens/second. Context tiers follow the original record; the actual number of input tokens processed does not necessarily match the tier label.

    The key takeaway from this data is not that one version is “faster across the board,” but that performance changes differ sharply by phase:

    • At short contexts, decode throughput improved by roughly 9.2%;
    • At medium contexts, decode throughput improved by roughly 9.3%;
    • At the longest tier, decode throughput improved by roughly 5.0%;
    • Prefill throughput, however, dropped by roughly 1% to 5%.

    This suggests the software update improved compute paths commonly used in the decode phase without similarly improving prefill. The exact cause requires profiling to confirm — you cannot conclude that a specific kernel or driver mechanism is effective based on aggregate throughput alone.

    For short-input, long-output workloads, decode speedups translate more directly into gains. For long-input, short-output workloads, the prefill regression deserves more attention.

    5. How to Interpret ~63 Tokens Per Second

    In an ~8K-context retest, the original record reported a decode throughput of 62.89 tokens/second, with prefill throughput of 375.90 tokens/second in the same run. Another test at a similar length reported prefill throughput of 366.76 tokens/second.

    A more rigorous statement would be:

    Under the recorded test configuration, the ~8K context tier achieved decode throughput of roughly 63 tokens/second, with prefill throughput of roughly 367–376 tokens/second.

    You should not stitch together the most favorable numbers from different runs into an “optimal configuration result” that was never actually measured.

    Similarly, the ~192K tier data only shows that the original record reported a test at that length. It does not substitute for validating the model’s effective context range, long-text quality, or configuration correctness. Being able to process a long input does not automatically mean the model can reliably use all of the information in it.

    6. Dual-GPU Parallelism: Capacity Gains and Communication Costs Must Be Evaluated Together

    6.1 Layer (Pipeline) Parallelism

    Layer parallelism assigns different network layers to different devices. Its advantage is relatively straightforward execution flow, but during single-request, token-by-token generation, the devices may struggle to stay fully parallel.

    If layer allocation, cache allocation, or device performance is unbalanced, one card may be busy while the other waits. You should therefore monitor per-card compute utilization, VRAM usage, and power draw — not just whether total VRAM is sufficient.

    6.2 Tensor Parallelism

    Tensor parallelism splits computation within a single layer across multiple devices, potentially increasing parallelism, but usually requiring more frequent data exchange and synchronization.

    Whether it is faster depends on:

    • Effective inter-device transfer bandwidth;
    • Communication latency and synchronization cost;
    • Partitioning granularity and allocation ratio;
    • Kernel implementation efficiency;
    • Input length and batch size.

    In the original record, tensor parallelism clearly outperformed layer parallelism in certain like-for-like tests. That supports trying it first in that environment, but it does not prove it is superior on all dual-GPU systems.

    7. Speculative Decoding: Draft Acceptance Rate Is Not the Only Goal

    Speculative decoding works by proposing several candidate tokens at low cost, then having the target model verify them, shortening some of the serial generation steps.

    When implemented correctly with an appropriate verification rule, such methods can preserve the target sampling distribution, but quality and behavior should still be checked against the specific implementation.

    The benefit depends on several factors together:

    • The cost of generating the draft itself;
    • The efficiency with which the target model verifies multiple candidates;
    • How many candidate tokens are accepted;
    • The rollback cost after rejections;
    • Extra cache and synchronization overhead.

    With a fixed 866 input tokens, 256 generated tokens, identical sampling settings, and the same draft length, the original record reported: identical draft acceptance rates, yet decode throughput rose from 50.16 to 57.17 tokens/second.

    This shows that acceptance rate is not a sufficient explanation for speed. Even with similar candidate behavior, underlying compute and scheduling efficiency can still produce significant differences.

    When tuning draft length, record final throughput, time to first token, VRAM usage, and output quality together. A longer draft is not always better, and a higher acceptance rate does not necessarily mean faster requests.

    8. Host Memory Channels Are Not the Only Deciding Factor

    Increasing host memory bandwidth can clearly help when large amounts of weights or computation depend on host-side resources. But if the main weights and computation live in device VRAM, host memory bandwidth may not be the primary bottleneck in the decode phase.

    The original material inferred from public results on different machines that runtime optimization mattered more than adding memory channels. The observation is insightful, but it cannot be treated as a strict causal conclusion.

    Different machines also differ in CPU, interconnect topology, cooling, power limits, model files, and test methodology. The safer conclusion: don’t predict inference speed from memory channel counts alone — identify the actual bottleneck first, then decide whether to upgrade hardware.

    9. Building a Reproducible Tuning Workflow

    Step 1: Fix a Baseline

    Record the model file checksum, quantization method, context length, cache precision, concurrency, parallelism strategy, runtime version, and sampling settings.

    Prepare a fixed set of inputs covering at least three scenarios: short inputs, typical business inputs, and long inputs.

    Step 2: Change One Variable at a Time

    A recommended comparison sequence:

    1. Verify that weights and cache fit stably;
    2. Compare parallelism strategies;
    3. Adjust load distribution across devices;
    4. Compare runtime versions;
    5. Validate kernel modifications in isolation;
    6. Enable speculative decoding and tune draft length;
    7. Scale up context length and concurrency.

    Changing only one major variable per round reduces attribution errors.

    Step 3: Distinguish Cold Start From Steady State

    Model loading, first-time memory allocation, and runtime initialization can significantly affect first-run results. Record cold-start costs separately and warm up before measuring steady-state performance.

    Repeat tests multiple times and report the median, variance range, and any anomalies — never publish only the best single run.

    Step 4: Add Reliability and Quality Checks

    After performance tuning, also check for output anomalies, repetitive degeneration, numerical errors, lost information in long texts, and stability under continuous operation.

    When quantization, cache precision, or kernel modifications are involved, verifying that the program runs is not enough. “It runs,” “it’s faster,” and “it’s correct” are three different requirements.

    Step 5: Return to Business Metrics

    For interactive services, prioritize time to first token and high-percentile response latency. For batch workloads, focus on total throughput, device utilization, and the cost of failed retries.

    Note that speculative decoding and multi-GPU parallelism can increase power consumption. Where feasible, add energy per 1,000 effective output tokens to make performance evaluations closer to real operating costs.

    10. Conclusion: Good Results Should Be Explainable and Reproducible

    Dual-GPU LLM inference is not simply adding up VRAM and compute. Quantization determines the capacity baseline, parallelism shapes the parallel gains, the runtime implementation determines execution efficiency, context length changes cache pressure, and speculative decoding further alters the generation path.

    The most valuable part of the original record is its same-machine comparisons and phase-by-phase measurements — not any isolated peak number. ~63 tokens/second can be the result of one test, but it should not be treated as a universal standard for similar models or dual-GPU systems of similar capacity.

    Reliable optimization conclusions rest on fixed test conditions, single-variable changes, repeated runs, and output quality checks. Only performance gains that can explain “why it’s faster, in which scenarios, and at what cost” are truly useful for deployment decisions.