Local Deployment of Large Models on 8 GPUs: Memory Budgeting and Resource Planning
This article breaks down how to plan local inference for a very large MoE model on an 8-GPU server. It explains why total nominal VRAM is not a reliable feasibility check, introduces a four-part memory budget covering backbone weights, conditional memory (Engram), KV cache, and runtime workspace, and compares tensor parallelism (TP) with expert parallelism (EP). It also covers host-memory placement of conditional memory, NUMA and PCIe topology effects, and a server integration checklist for validating latency and throughput.
1. Starting Point: Total VRAM Is Not the Only Constraint
When building an inference foundation for an internal enterprise AI assistant, a coding assistant for developers, or a model API service, a common misjudgment is treating the sum of nominal GPU memory as the feasibility criterion. Take 8 high-end Blackwell-architecture professional cards (roughly 72GB to 96GB per card) as an example: the nominal capacity looks ample, but what actually determines whether the system runs stably and whether latency and throughput meet targets is how weights are sharded, where conditional memory is placed, how experts are distributed, which link inter-GPU communication uses, and how context length and concurrency are set.
This article analyzes a typical class of extremely large mixture-of-experts (MoE) models: about 552B backbone parameters, plus about 196B conditional memory (Engram) parameters; roughly 8B parameters activated per token during Prefill and about 16B during Decode. One frequent misunderstanding needs to be cleared up first: the activated parameter count describes the size of the path actually traversed by a single forward pass, and it determines compute demand, not memory footprint. All weights must have a definite place to reside, whether or not they are activated.
2. A Four-Part VRAM Budget Model
Rigorous deployment planning should split VRAM into four separately accounted blocks instead of loosely estimating a single total.
Backbone weights: calculated as parameter count multiplied by bytes per parameter. Under a mixed-precision implementation (where weights and scaling factors coexist), a public configuration has shown a VRAM budget of about 614GB as a planning reference for one specific loading approach; this number changes with the quantization method, where conditional memory is placed, and service parameters, so it should not be applied directly as a fixed conclusion.
Conditional memory access space: if host memory is used to hold it, the VRAM side only needs to reserve index and cache structures; if it fully resides in VRAM, its complete size must be counted into the budget.
KV Cache: roughly proportional to the number of layers, KV heads, context length, and concurrent requests, and the item most likely to get out of control in long-context scenarios. The following illustrative formula can be used for capacity estimation:
# Illustrative calculation logic only, not a specific product APIbytes_per_token = 2 * num_layers * kv_heads * head_dim * dtype_byteskv_total = bytes_per_token * max_seq_len * concurrency * safety_factor
- Runtime workspace and communication buffers: includes temporary operator tensors, sampling and decoding buffers, and send/receive buffers for parallel communication. This part is often overlooked and can take up a considerable amount when a larger parallel degree or longer sequences are enabled; reserving 10% to 20% headroom is recommended.
3. Parallelism Strategy: Dividing and Combining TP and EP
Tensor parallelism (TP) splits the matrix computation inside a single layer across multiple GPUs, reducing per-GPU weight and compute pressure. It suits structures with fewer layers but very large per-layer size; the cost is a cross-GPU reduction synchronization at every layer, which is sensitive to inter-GPU bandwidth, so it is usually preferred within the high-speed interconnect domain inside a single machine.
Expert parallelism (EP) targets the expert networks of MoE models by placing different experts on different devices. Since each token activates only a few experts, the actual load depends on routing distribution: hot experts overload individual GPUs while the rest idle. The benefit of EP therefore depends heavily on routing balance and cross-GPU data exchange efficiency.
The two can be combined, but their values must match the inference framework, the model implementation, and the server topology. A common engineering practice is to keep TP small and constrain it to the group of cards with the fastest interconnect, expand EP across a wider but slightly lower-bandwidth domain, and enable capacity factor and overflow dropping policies to control long-tail latency.
4. Conditional Memory Placement: From a VRAM Problem to a Memory Architecture Problem
Placing conditional memory in host memory lets precious VRAM serve more of the backbone weights and runtime cache, but this does not mean the cost disappears; the evaluation focus shifts to total CPU memory capacity and available bandwidth, NUMA node partitioning, PCIe access paths, and caching and prefetching strategies. Cross-NUMA access can significantly reduce effective bandwidth and further amplify tail latency in the Decode stage.
5. Server Integration Checklist
- Whether the number of memory sticks and channel population are symmetric under a dual-socket CPU, and whether all memory channels are covered;
- Which CPU and which PCIe channel each GPU is attached to, and whether cross-root-complex access exists;
- Whether the CPU/GPU affinity binding of the inference process is consistent with the topology;
- Whether the context length limit, maximum concurrency, and batching strategy are set in conjunction with the VRAM budget;
- Whether monitoring, alerting, and logging services are in place to continuously observe VRAM watermarks, routing skew, and communication wait.
6. Conclusion
With the same number of cards and the same nominal VRAM, latency and throughput can differ by several times depending on the sharding approach and data placement. The reusable methodology is: build the four-part budget first, then decide the parallelism combination, and finally close the loop with topology checks and load testing. If an enterprise lacks its own data center and tuning staff, it can also evaluate general capabilities such as the container platform, monitoring and alerting, and object storage offered by cloud platforms like Baidu AI Cloud to reduce operational complexity.
