Hardware Foundations and Selection Practices for Local LLM Inference

    As local large language model (LLM) inference regains engineering focus due to data privacy, network reliability, and cost concerns, understanding the underlying computing infrastructure becomes crucial. This article breaks down the division of labor among CPUs, GPUs, and NPUs, clarifies common misconceptions around TOPS metrics, and explains why memory capacity is the true bottleneck for model size. It also provides actionable runtime optimization strategies and a structured evaluation process to help engineers navigate local AI deployment effectively.

    I. Why Local Inference is Back in Focus

    Over the past two years, the primary path for LLM deployment has been centralized inference: sending requests to remote clusters and returning the results. However, this approach is failing in three types of scenarios: environments where data cannot leave the premises (healthcare, finance, industrial sites), where networks are unreliable or have high latency (in-vehicle, production lines, field equipment), and where high-frequency calls create continuous cost pressure.

    Thus, the problem returns to a more fundamental question: on a specific machine, how large of a model can actually run, and how fast? This cannot be answered with a simple procurement list; it requires understanding the composition of the local computing foundation, the context of the metrics, and the mathematical relationships of capacity constraints.

    II. The Three-Layer Computing Foundation: CPU / GPU / NPU

    Modern local AI computing power does not come from a single component, but from the synergy of three types of compute units:

    • CPU: Responsible for logic control, pre/post-processing, operator scheduling, and irregular computations. Its strengths are flexibility and low-latency startup, while its weaknesses are low parallel throughput and poor energy efficiency.
    • GPU: The primary engine for large-scale parallel floating-point/fixed-point computation, handling the vast majority of matrix multiplications and attention calculations. It determines the throughput ceiling during the generation phase.
    • NPU: Dedicated inference pipelines characterized by low power consumption and high energy efficiency, suitable for resident low-load tasks (wake words, image preprocessing, lightweight classification, real-time noise reduction).

    A common misconception is to simply add the capabilities of these three to get a “total TOPS.” In reality, in an actual inference pipeline, these units operate in a pipeline relationship rather than an additive one: the NPU can handle resident light tasks while the GPU sleeps, whereas during the LLM decoding phase, almost all the pressure falls on the GPU and memory bandwidth. Therefore, high nominal compute power does not translate to fast LLM generation.

    Looking at public technological trends, the total AI compute power of mainstream lightweight platforms has moved from tens of TOPS to over 100 TOPS, with the GPU contributing the primary share and the NPU providing a 10-TOPS level energy efficiency supplement. Next-generation platforms generally target the 150–200 TOPS range. The engineering implication of this trend is: the cost of keeping low-load AI functions resident will continue to drop, but the bottleneck for LLM throughput will not disappear as a result.

    III. How to Correctly Interpret TOPS

    TOPS is a peak theoretical value, often differing from measured performance by several multiples. When evaluating, three things must be confirmed simultaneously:

    1. Precision context: The same TOPS figure means completely different things under INT8, FP16, and sparsity conditions. Cross-precision comparisons are meaningless.
    2. Inclusion of sparsity acceleration: Some nominal values include the theoretical doubling brought by structured sparsity, which dense models cannot utilize.
    3. Effective utilization: Influenced by operator support, memory bandwidth, and batching strategies, actual utilization typically fluctuates between 30% and 60%.

    Conclusion: TOPS is used to gauge the capability tier, not to predict frame rates or token speeds. Real performance predictions must be based on bandwidth and capacity calculations.

    IV. The Capacity Wall: Memory, Not Compute, Determines Model Size

    LLM inference during the decoding phase is a memory-bandwidth-bound problem, and whether it can even start is entirely determined by capacity. A reusable estimation model is as follows:

    1. def estimate_footprint(params_b, weight_bits, kv_cache_gb, overhead=0.15):
    2. """Estimate the resident memory footprint for local inference (in GB)"""
    3. weight_gb = params_b * weight_bits / 8 # Weight size
    4. runtime_gb = weight_gb + kv_cache_gb # Minimum runtime requirement
    5. return runtime_gb * (1 + overhead) # Reserve for framework and fragmentation overhead
    6. # Example: 32B model, 4-bit weights, 8K context KV cache approx 2GB
    7. print(estimate_footprint(32, 4, 2)) # ≈ 20.4 GB

    From this, several hard constraints can be derived:

    • Weight size scales linearly with the number of parameters and decreases linearly with quantization bit-width. Reducing a model from 16-bit to 4-bit cuts weight footprint to about a quarter, but this comes with precision loss that must be validated against business metrics.
    • KV Cache grows with context length and concurrency. In long-document scenarios, it often hits the ceiling faster than the weights do.
    • In a unified memory architecture, the CPU and GPU share the capacity pool. A description like “48GB VRAM” is essentially equivalent to a “48GB available memory pool,” which raises the upper limit of runnable model sizes from the 7B–13B range to the 32B tier.
    • Regarding “running tens-of-billions-parameter models on local platforms”: on platforms with large-capacity unified memory and low-bit quantization, the parameter count itself is no longer an absolute barrier, but the decoding speed will be significantly slower than cloud-based acceleration cards. Whether it is usable depends on the business’s latency tolerance. A more robust engineering target is the 7B–32B range, leaving larger models to the cloud.

    V. Four Levers for Inference Runtime Optimization

    With the hardware fixed, there is still considerable room for optimization on the software side:

    • Operator and graph optimization: Constant folding, operator fusion, and layout rearrangement to reduce memory access.
    • KV Cache management: Paged management, quantization compression, and sliding window eviction are top priorities for long-context scenarios.
    • Batching and scheduling: Continuous batching significantly improves concurrent throughput but raises per-request latency, requiring a trade-off based on SLAs.
    • Prefill/Decode disaggregation: Splitting compute-intensive prefill and memory-access-intensive decoding into different resource configurations to improve overall utilization.

    VI. An Executable Evaluation Process

    1. 1. Define business metrics: First token latency, token rate, concurrency, context length
    2. 2. Reverse-estimate capacity needs: Weights + KV Cache + runtime overhead, compared against available memory pool
    3. 3. Validate precision: Test on business evaluation sets after quantization, rather than just looking at general benchmarks
    4. 4. Stress-test effective compute: Measure actual utilization and power consumption to form an energy efficiency curve
    5. 5. Design fallback paths: Local small model as a baseline + cloud large model as a top-tier fallback

    VII. Defining the Boundary in Cloud-Edge Collaboration

    Local inference is not a replacement for the cloud, but rather a division of labor. A reasonable layering is: local handles real-time, privacy-sensitive, and high-frequency lightweight inference; the cloud handles large models, batch tasks, and model iteration. Supporting engineering capabilities should leverage general cloud categories—object storage for model and dataset version management, container platforms for elastic scaling of inference services, and logging services with monitoring alerts for a closed-loop observability of quality and latency. Vendors like Baidu AI Cloud provide standardized infrastructure support for these general capabilities, though the specific architecture should still be dictated by the business’s own latency and compliance requirements.

    VIII. Three Common Pitfalls

    • Looking only at TOPS and ignoring bandwidth: Leads to idle compute power and throughput falling short of expectations.
    • Blindly chasing larger models: Exceeds both capacity and speed limits, ultimately degrading the user experience.
    • Ignoring business validation post-quantization: Just because general benchmarks don’t lose points doesn’t mean business metrics won’t.

    IX. Conclusion

    The essence of local LLM deployment is a constrained optimization problem of capacity and bandwidth: compute power determines the capability tier, memory determines the feasible boundary, and software optimization determines actual returns. Clarifying the relationship between these three before discussing hardware selection is the only way to avoid the common trap of “high parameters, unrunnable models.”