Eight-GPU MoE Deployment: A Practical Guide to GPU Memory Planning
Deploying a mixture-of-experts model across eight GPUs requires more than adding up their memory capacities. This guide explains how to budget weights, KV cache, workspaces, and communication buffers; evaluate tensor and expert parallelism; account for host-memory placement and server topology; and validate capacity, latency, and stability under realistic workloads. It provides a structured path from resource planning to production readiness.
1. Eight-GPU Deployment Starts with Resource Organization
When deploying a large mixture-of-experts (MoE) model, asking whether eight GPUs have enough total memory is only the beginning. You also need to establish how the model is distributed across devices, how data moves during request execution, and whether sufficient runtime headroom remains as concurrency increases.
Internal assistants, development tools, and model API services have different resource requirements. An internal assistant may need long context windows. Development tools often process large blocks of text and generate lengthy responses. Model API services place greater emphasis on multitenant concurrency, tail latency, and capacity isolation. The same model and hardware can encounter very different bottlenecks under these workloads.
Resource planning should therefore work backward from service requirements, rather than start with the number of GPUs. Define the following boundaries first:
- Typical and maximum input and output lengths.
- Normal and burst concurrency, along with acceptable queueing time.
- Time-to-first-token and subsequent generation-speed requirements.
- Whether capacity is needed for multiple model instances, failure recovery, or staged rollouts.
- Permitted weight quantization methods and acceptable changes in output quality.
These constraints determine how GPU memory should be allocated and whether the eight GPUs should form one large inference instance or several smaller instances. The right configuration depends on model size and measured results—not GPU count alone.
2. Understanding MoE: Active Parameters Are Not Resident Weights
MoE models typically contain shared computation modules, routing modules, and multiple expert networks. For each token, the router selects a subset of experts, so the number of parameters involved in that token’s computation can be substantially smaller than the model’s total parameter count.
This reduces some computational costs, but it does not automatically eliminate the storage requirements of unselected experts. If future requests may access those experts, their weights must remain available. They can reside in GPU memory or be supplied on demand from another storage tier, but the latter introduces additional data transfer and access latency.
Distinguish three metrics:
- Total parameter count: The basis for estimating storage requirements for the complete model weights.
- Active parameters per token: A measure of the computation path, not a substitute for memory requirements.
- Actual runtime memory usage: Weights, caches, temporary tensors, communication buffers, and framework management overhead.
Also distinguish input processing, commonly called prefill, from step-by-step generation, or decoding. Prefill can typically perform computation in larger batches, while decoding repeatedly executes small generation steps. Their compute intensity, cache-access patterns, and communication overhead differ, so a single throughput metric cannot describe overall performance.
If the implementation includes a separate conditional memory module, account for it independently. Such modules are not universal components of MoE models. Their storage format, access frequency, and placement must be evaluated against the actual implementation.
3. Build a Complete GPU Memory Budget
A per-GPU memory budget can be expressed as:
Per-GPU memory requirement = local weights + local conditional memory data + local KV cache + temporary workspaces + communication buffers + management overhead
The important point is to estimate each component at its per-GPU peak. An acceptable average does not guarantee that every GPU can operate reliably.
3.1 Weights: Account for Each Module and Precision
The ideal storage requirement for weights can be estimated by multiplying parameter count by bytes per parameter. Actual deployment may also require scaling factors, group metadata, alignment padding, and additional storage associated with modules using different precisions.
Do not treat a single precision multiplied by total parameter count as a final capacity estimate. A more reliable approach is to account separately for shared layers, expert layers, embeddings, and other modules, then aggregate their requirements according to the actual loading method.
Quantization can reduce some weight storage, but not every module necessarily supports the same quantization approach. Validate numerical stability, application-level quality, and whether the target hardware’s inference implementation supports the chosen data format.
3.2 KV Cache: The Main Incremental Cost of Context and Concurrency
In common attention implementations, the KV cache stores keys and values for previous tokens so that each generation step does not need to recompute the full history.
For a standard key-value cache layout, its size depends approximately on:
- The total number of cached tokens.
- The number of attention layers.
- The number of key-value heads and the dimension of each head.
- The bytes used per cache element.
An illustrative estimate is:
KV cache bytes ≈ 2 × layer count × total cached tokens × KV head count × head dimension × bytes per element
This formula applies only to the corresponding cache layout. Compressed representations, different attention architectures, or other cache organizations require implementation-specific calculations. In multi-GPU deployments, also verify whether the cache is sharded or replicated. Do not simply divide total cache size by the number of GPUs.
Long contexts and high concurrency jointly increase cache requirements. Successfully running one request does not establish that the system can handle peak service demand.
3.3 Workspaces and Buffers: Reserve Space for Peaks
Inference runtimes may allocate temporary memory for matrix operations, expert routing, token reordering, data exchange, and operator execution. Some of these allocations vary with batch size, input length, or execution mode.
Capacity validation should cover model loading, warm-up, long-input processing, and sustained generation. Production budgets need headroom; filling GPU memory before serving requests is not a viable planning strategy.
4. Eight GPUs Do Not Form One Unified Memory Pool
For an eight-GPU server with a nominal capacity of 96 GB or 72 GB per GPU, the arithmetic totals are 768 GB and 576 GB, respectively. These figures are useful for initial screening, but they are not directly equivalent to usable model capacity.
Each GPU has its own physical memory. Cross-GPU reads and exchanges travel over device interconnects or other data paths and do not have the same cost as local memory access. Planning should also use the available capacity reported by the devices and consistent units of measurement.
A GPU assigned more shared weights, experts, or communication buffers may exhaust its memory first. Spare memory on other GPUs does not necessarily mean they can automatically take over that data.
Check at least two conditions:
- Whether total resources can accommodate the complete deployment.
- Whether the busiest device’s peak memory usage remains within a safe limit.
Higher per-GPU memory capacity generally provides more room for caches and workspaces, but it does not guarantee higher throughput. Communication, compute capability, memory bandwidth, and software implementation can all affect the result.
5. How Tensor Parallelism and Expert Parallelism Divide the Work
5.1 Tensor Parallelism: Split Computation Within a Layer
Tensor parallelism (TP) partitions the weights and computation tensors of selected layers across multiple devices, which then collaborate to execute those layers.
TP reduces each GPU’s weight storage and computational burden, but requires intermediate results to be exchanged or combined across devices. A larger parallel group does not necessarily deliver greater gains. As local computation shrinks and communication becomes more prominent, adding devices may provide limited additional acceleration.
Decoding deserves particular attention. Because each generation step may involve relatively little computation, communication latency and synchronization overhead can have a greater impact on per-token generation time.
5.2 Expert Parallelism: Distribute Different Experts
Expert parallelism (EP) places different experts on different devices. After routing, tokens must be sent to the devices hosting their selected experts, and the results must return to the subsequent execution path.
Key EP challenges include:
- Cross-device communication for token dispatch and result aggregation.
- Hotspots caused by uneven expert access.
- Token reordering, packing, and buffering overhead.
- The effect of overloaded devices on completion time for an entire request batch.
An even distribution of expert counts indicates relatively balanced static storage, not necessarily balanced runtime load. Some application inputs may consistently favor particular experts. Use representative workload data to observe the actual expert-load distribution.
5.3 Combine TP and EP Based on Implementation, Not Just Numbers
Combined parallelism aims to balance weight capacity, computational efficiency, and communication cost. Device groups must match the model implementation, inference runtime, and server topology.
Do not assume that the product of the TP and EP degrees must equal the total device count. Implementations may use different process groups, shared-module sharding schemes, or expert organizations. Verify their semantics and limitations before comparing configurations by per-GPU peak memory, communication time, and application performance.
6. The Real Cost of Placing Conditional Memory in Host RAM
If the implementation supports placing conditional memory in host RAM, this can reduce its direct GPU memory footprint. However, it changes the storage tier rather than eliminating the resource cost.
Evaluate the following areas:
Capacity. Host RAM may also hold weight-loading buffers, request-processing data, cache-management structures, and runtime metadata. Reserve memory for the operating system and other services to avoid unpredictable performance under memory pressure.
Bandwidth and access patterns. Contiguous batch access behaves differently from fine-grained random access. Even with sufficient RAM capacity, random-access latency or data-transfer bandwidth may limit inference performance.
NUMA placement. In multisocket servers, memory-access cost depends on the NUMA node holding the data. A process associated with a GPU may incur additional overhead when accessing memory on a remote node.
Caching strategy. Whether frequently accessed memory data can be cached on the GPU, the resulting hit rate, and whether cache misses block generation all depend on the implementation and must be tested.
Host-memory placement therefore requires validation of both GPU memory savings and changes in tail latency.
7. Server Topology Is Part of the Deployment Design
An eight-GPU server specification should include more than device models and total memory. Deployment decisions also require topology information:
- The CPU or I/O root node connected to each GPU.
- The actual link width and speed available to each slot.
- Whether the required data-exchange paths are supported between devices.
- Measured communication bandwidth and latency between different device pairs.
- Host-memory capacity across NUMA nodes.
- Binding relationships among inference processes, GPUs, and host memory.
A useful principle is to place frequently collaborating GPUs on more efficient communication paths and keep processes that access host data close to the relevant memory node.
However, slot position alone is not enough to predict communication performance. Validate topology using the actual process layout and tests close to the target workload, so that nominal hardware specifications do not obscure the real execution paths.
8. Validate the Path from Successful Loading to Stable Production
Step 1: Inventory Static Requirements
Record actual weight sizes, module boundaries, supported precisions, parallelism options, conditional-memory placement restrictions, and context configuration. Capacity estimates with unclear provenance should not be used directly as purchasing criteria.
Step 2: Measure Loading and Warm-Up Peaks
Record memory usage after loading, during warm-up, and during long-input processing for every GPU. Where necessary, check for temporary copies during loading. A model whose final weights fit may still fail while being loaded.
Step 3: Increase Workload Pressure Gradually
Start with short inputs and low concurrency, then increase input length, output length, and concurrent requests. Test these scenarios separately:
- Long inputs, short outputs: Observe prefill behavior and cache pressure.
- Short inputs, long outputs: Evaluate sustained generation efficiency.
- Mixed lengths with concurrent requests: Examine scheduling and tail latency.
- Sustained load near the expected business peak: Verify stability.
Test data should be representative. Do not rely only on requests with uniform lengths or conveniently balanced workloads.
Step 4: Monitor Both Capacity and Performance
At minimum, monitor per-GPU peak memory, device utilization, host RAM usage, cross-device communication, request queueing time, time to first token, and tail latency.
If throughput stops increasing while GPU memory remains available, investigate compute, communication, host-data access, and scheduling bottlenecks rather than immediately raising concurrency.
Step 5: Establish Service Safeguards
Before production, define input and output limits, concurrency limits, queue capacity, and timeout policies. Verify that canceled requests release resources promptly and that abnormal requests do not continue occupying cache space.
For model API services, admission control is part of resource planning, not an optional addition. Without request boundaries, a few exceptionally long requests can consume even a large memory budget.
9. Conclusion: Evaluate the Complete Deployment Path
Plan an eight-GPU MoE deployment around a connected sequence:
Workload requirements → model architecture → resource budget → parallelism design → hardware topology → measured acceptance tests
Active parameter count describes the computation path, not the full weight footprint. Aggregate GPU memory describes an upper capacity bound, not a unified pool of usable memory. Host-memory placement can free GPU capacity while introducing new access costs. Greater parallelism can distribute computation while also increasing communication overhead.
A production-ready deployment does more than load the model successfully. Within clearly defined request limits, it keeps per-GPU peaks under control, maintains acceptable cross-device communication costs, meets latency and throughput targets, and remains stable under sustained load.
