Local LLM Inference on Unified Memory APUs: Decode Bandwidth, Prefill Bottlenecks, and Two-Node Tensor Parallelism
This article examines how unified-memory APUs fit local LLM inference, why memory capacity alone does not guarantee speed, how to estimate decode throughput from memory bandwidth, how to choose an inference backend and configure GPU-accessible memory, and what to consider before splitting a model across two machines with tensor parallelism.
Unified-memory APUs—processors where the CPU and GPU share the same physical memory—have been entering the personal workstation and mini-PC market over the past year or two. Their main value is memory capacity. The operating system can allocate most system memory for use by the integrated GPU, so a single machine can hold the weights of a relatively large model. For developers who want to experiment with local LLMs without investing in multiple discrete GPUs, this class of platform is a cost-controlled option.
But being able to fit a model is not the same as running it fast. To judge whether such a platform is suitable, it helps to separate inference into two phases and examine the hardware bottleneck in each.
1. Inference Phases and Bottlenecks
LLM inference is typically divided into prefill and decode.
- Prefill: the entire user prompt is sent through the model at once, and the key-value cache for each token is computed. This phase is dominated by large matrix multiplications and is mainly limited by compute. The longer the input, the longer prefill takes, and the more noticeable the time to first token becomes.
- Decode: each new token requires reading model weights and cache. This phase is mainly limited by memory bandwidth, and compute units are often left idle waiting for data.
A rough conclusion follows: on a unified-memory platform, the capacity advantage mainly ensures that the decode phase can run, while prefill speed depends on the compute ceiling of the integrated GPU. Long-input scenarios such as long-document question answering and codebase retrieval are most sensitive to prefill speed.
2. Estimating Decode Speed from Bandwidth
In bandwidth-bound scenarios, decode speed can be estimated with a simple upper-bound formula. For each generated token, the amount of data read from memory is approximately the number of active parameters multiplied by the number of bytes per parameter. For sparse-activation Mixture-of-Experts (MoE) models, only a small number of experts participate in each step, so the active parameter count is much smaller than the total parameter count.
Illustrative code:
def decode_upper_bound(active_params_b: float, bits_per_weight: float, mem_bw_gbs: float) -> float:"""Estimate decode upper bound (tokens/s), ignoring KV cache reads and scheduling overhead."""bytes_per_token = active_params_b * 1e9 * bits_per_weight / 8return mem_bw_gbs * 1e9 / bytes_per_token# Example: 6B active parameters, 4-bit quantization, assumed effective bandwidth 200 GB/s (illustrative)print(round(decode_upper_bound(6, 4, 200), 1)) # about 66.7 tokens/s
The theoretical upper bound is only a starting point. Actual speed is also affected by KV cache reads, kernel launch overhead, expert routing computation, and other factors, and is usually lower than the bound. But the formula shows one point: reducing the amount of data read per token—through quantization or sparse activation—can improve decode speed more than simply adding compute.
3. Choosing an Inference Backend
The inference backend determines how much capability the hardware can actually deliver. Common options include the following:
- General-purpose graphics API backend: broad compatibility and a low deployment barrier. In matrix-heavy workloads, performance depends on the quality of the driver implementation.
- Vendor heterogeneous compute backend: ecosystem maturity depends on the driver version. Before adoption, confirm support for the target chip and check whether the matrix computation libraries have optimized kernels enabled for that architecture.
- CPU backend: simple to implement and usable as a fallback, but prefill speed is usually significantly slower.
When selecting a backend, it is advisable to complete three tasks. First, confirm that the driver and kernel versions meet the requirements. Second, test the same model and the same prompts on different backends, recording prefill and decode speed separately. Third, observe stability during long-running operation, including GPU memory fragmentation accumulation and thermal throttling.
4. Configuring the GPU-Accessible Memory Limit
On a unified-memory platform, “VRAM” is not independent physical storage; it is dynamically mapped from system memory. The upper limit of GPU-accessible memory is usually determined jointly by firmware settings and the kernel memory management module. Before making adjustments, note the following:
- Reserve enough system memory for the operating system, desktop environment, and other services; otherwise, frequent paging or process termination may occur.
- It is not recommended to allocate all memory to the GPU. Leaving headroom helps improve system stability.
- After adjustment, stress-test with a model close to the limit and observe whether memory allocation failures occur in long-context scenarios.
Specific parameter names and values depend on the kernel version and driver implementation. Refer to the official documentation for the relevant distribution and hardware vendor rather than applying empirical values directly.
5. Two-Node Tensor Parallelism: Interconnect Is Critical
For models that do not fit on a single machine, weights can be split across multiple machines and computed cooperatively through tensor parallelism. Tensor parallelism requires frequent collective communication at every layer, so interconnect latency and bandwidth directly determine the scaling benefit.
Common interconnect approaches fall roughly into three tiers by latency:
- TCP over standard Ethernet: high protocol stack overhead, with single-message latency typically in the hundreds of microseconds. Small-message-intensive tensor parallelism is easily slowed by communication.
- RDMA-capable network: bypasses the kernel protocol stack and can reduce latency to single-digit microseconds. It requires network cards and a switching environment that support the relevant protocol.
- Point-to-point high-speed interface: some platforms can be directly interconnected through a general high-speed interface. If RDMA semantics can be implemented over it, latency close to that of a dedicated network card can be achieved at lower cost.
Note that some platforms have limited hardware expansion capability, and not every machine can add a high-speed network card. Before selecting hardware, confirm whether it supports the required expansion method.
6. Practical Considerations
- Measure latency before starting the model. Use microbenchmark tools to measure one-way and round-trip latency between the two machines, and deploy the inference service only after confirming that the results meet expectations.
- Evaluate small and large messages separately. Synchronization operations in tensor parallelism are mostly small messages, where latency matters more than bandwidth.
- Monitor the share of communication time. If communication accounts for too high a proportion of runtime, increasing parallelism will not bring further benefit.
- Check divisibility for splitting. The number of attention heads, hidden dimensions, and similar values must be divisible by the parallelism degree; otherwise, the model cannot be split evenly.
- Prepare a failure-recovery plan. Failure of either machine will interrupt the inference service, so restart and degradation plans are needed.
7. Is This Approach Right for You?
Three questions can provide an initial assessment:
- Is your primary workload long-input or short-conversation? Long-input workloads require particular attention to prefill speed.
- What time to first token and generation speed are acceptable to you?
- Do your budget and operational capabilities support multi-machine deployment?
If most answers point to lightweight use, a single-machine setup is usually sufficient. Only when the model size exceeds single-machine capacity and the team has the operational capability for networking and distributed systems is two-node tensor parallelism worth the investment.
