VRAM Planning and Sparse MoE Deployment on Consumer Dual GPUs
This article provides a practical guide to estimating VRAM requirements for deploying sparse Mixture-of-Experts (MoE) models on dual 32GB consumer GPUs. It breaks down memory allocation into model weights, KV Cache, and operational overheads, while evaluating the impact of Q8_0 quantization and multi-slot concurrency on system performance.
Deploying a sparse MoE model across two 32GB GPUs requires a clear understanding of memory allocation. This article breaks down which reported metrics hold up under scrutiny and which require hands-on testing, providing a clear method for calculating your VRAM budget before deployment.
1. Differentiating Verified and Unverified Metrics
The original practice report provided several key metrics: a context of nearly 800,000 tokens, 3 concurrent slots, about 260,000 tokens per slot, a decoding speed of roughly 50 tokens per second, and an additional auxiliary model with around 20 billion parameters. However, the measurement conditions for these figures were not fully disclosed—lacking details on batch size, input/output lengths, quantization specifics, and GPU power or temperature states. Therefore, these should be treated as reported values rather than guaranteed benchmarks, requiring independent verification before reuse.
There is also an inconsistency in the report: the dual cards have a combined VRAM of 64GB, yet the author claimed total usage per card was kept under 60GB. This discrepancy means the memory allocation strategy and component footprints need to be re-evaluated. Below is an estimation method you can apply to your own setup.
2. Estimating the VRAM Budget
VRAM consumption can be divided into four main components: model weights, KV Cache, temporary compute buffers, and the inference framework’s own overhead.
Model weights are the easiest to estimate. In Q8_0 format, each parameter occupies roughly 1 byte. A 26-billion parameter model therefore requires approximately 26GB of VRAM for its weights. The actual file size may be slightly larger due to quantization block metadata and any unquantized layers. The author’s estimate of about 25GB aligns with this scale, but weights are only one part of the equation.
In a dual-GPU environment, you must also determine how the weights are distributed. If using layer splitting, each card holds a portion of the weights. If you place a complete copy of the weights on each card, you will need two full replicas. The VRAM budget differs drastically between these two approaches, so the deployment strategy must be finalized beforehand.
3. KV Cache: The Real Bottleneck for Long Contexts
For long context lengths, the primary VRAM pressure comes from the KV Cache. Its footprint can be estimated using the following formula:
KV Cache bytes = 2 * num_attention_layers * num_kv_heads * head_dim * context_tokens * bytes_per_element
The coefficient of 2 accounts for storing both K and V. The bytes per element depend on the KV Cache precision: 2 bytes for FP16 and 1 byte for Q8_0.
Using a hypothetical set of architecture parameters as an example: 48 layers, 8 KV heads, and a head dimension of 128. Under FP16, a single token occupies 2 * 48 * 8 * 128 * 2 = 196,608 bytes (about 192KB). For 786,432 tokens, this totals roughly 154GB. Even if Q8_0 is used for the KV Cache, it still requires about 77GB. Both scenarios exceed the combined 64GB of the dual cards.
This example illustrates that to support nearly 800,000 tokens, the model must have significantly fewer full attention layers than the example, or it must employ mechanisms like sliding window attention or mixed attention. Alternatively, the target context might not be fully loaded into the KV Cache. All of these factors depend on the model’s actual configuration file. Always read the model’s config parameters and run them through the formula before starting.
4. Q8_0 Quantization: Alleviating Bandwidth Pressure
Q8_0 is a common 8-bit quantization type in the GGUF format. Compared to 16-bit floating point, it halves the storage required per weight, which in turn halves the number of weight bytes read during each decoding step. Theoretically, this halves the memory bandwidth pressure.
However, actual throughput will not necessarily double. Decoding speed is influenced by kernel efficiency, the overlap between compute and memory access, and the volume of KV Cache reads. To confirm the actual speed improvement, you should run comparative tests against an FP16 or other quantized version of the same model.
A frequently overlooked risk with quantization is the distribution of calibration data. If the calibration set differs significantly from your production data, the output of certain expert networks may degrade. It is recommended to retain a small set of real business samples and compare the outputs of long-tail inputs before and after quantization.
5. Multi-Slot Concurrency: Triple Capacity vs. Single-Request Bandwidth
In llama.cpp’s llama-server, the -c parameter sets the total context length shared by all slots, while the -np parameter defines the number of parallel slots. If 3 slots equally share 786,432 tokens, each slot gets roughly 260,000 tokens. This configuration allows simultaneous servicing of three sessions, but the bandwidth and compute power allocated to each session will be reduced. Note that parameter names and behaviors should be verified against the --help output of the specific version you are using.
The benefit of multi-slot deployment comes from staggering request phases. The prefill phase is compute-intensive, while the decode phase continuously reads weights and the KV Cache. By staggering the phases of different sessions, GPU utilization becomes smoother. However, whether this staggering actually occurs depends on request arrival patterns. If three sessions enter a long prefill phase simultaneously, multi-slotting will lead to resource contention.
The author reported that the prefill speed during initialization (filling tens of thousands of tokens) approached 1,000 tokens per second, while steady-state decoding was about 50 tokens per second. When measuring such metrics, three things must be recorded: the respective lengths of the prefill and decode phases, the number of simultaneously active slots, and the GPU power and temperature during the measurement period.
6. Dual-Model Coexistence: Calculate Budget Before Assuming Feasibility
The author mentioned that alongside the main model and three long-context slots, a roughly 20-billion parameter auxiliary model was loaded for tasks like heartbeat detection. While this concept is feasible, the report did not provide the specific VRAM figures for each component, so it cannot be listed as a verified conclusion.
If you wish to attempt this, it is recommended to follow this sequence: First, record the weight footprint of both models in an idle state. Second, run a fully loaded long-context request on the target number of slots and record the peak VRAM usage. Finally, confirm whether the remaining space can accommodate the temporary buffers of the auxiliary model. The auxiliary model can be hosted on an independent runtime or allocated to the spare capacity of the existing GPUs, provided the budget allows.
