Compute Planning for On-Premises Deployment of Large-Scale MoE Multimodal Models

    This guide explains how to plan compute for on-premises deployment of large mixture-of-experts (MoE) multimodal models. It shows why active parameter count does not determine GPU memory needs and how to build a memory budget from model weights, KV cache, runtime overhead, and a safety margin. It also covers how to define context length, concurrency, workload type, and acceptance criteria before choosing hardware, how to benchmark inference frameworks with real prompts, common engineering pitfalls, and a phased rollout plan.

    Introduction: A New Deployment Challenge from MoE Multimodal Models

    A new generation of natively multimodal models built on large-scale mixture-of-experts (MoE) architectures has emerged. These models have total parameter counts in the hundreds of billions, but each inference pass activates only about one-tenth of those parameters. They also support ultra-long context windows, reaching into the millions of tokens. The models offer significant gains in inference efficiency and capability, so many teams consider them strong candidates for private deployment.

    A common question follows: “Are eight mainstream GPU cards enough?” The question sounds simple, but it is framed the wrong way. This article starts from the technical principles and lays out a decision framework for deploying these models.

    1. Why Active Parameter Count Cannot Be Used to Estimate GPU Memory

    This is the most common misconception when deploying MoE models.

    Active parameters are not the parameters that stay resident in GPU memory. The core idea of MoE is that a model contains many expert subnetworks, and a routing mechanism selects only some of them for each forward pass. Active parameters describe the parameters involved in a single computation. They determine compute cost (FLOPs), but they do not determine memory usage.

    GPU memory must be calculated from the full set of weights. When an inference server loads the model, all expert weights (that is, the total parameter count) must fit in GPU memory, or be offloaded with a suitable strategy. The next token may activate any combination of experts. For example, a model with roughly 300 billion total parameters stored in FP8 (about 1 byte per parameter) needs more than 300 GB for weights alone. In BF16, it needs more than 600 GB.

    A complete GPU memory budget includes:

    • Full model weights (total parameters × bytes per parameter)
    • KV cache, which scales with context length, concurrency, number of layers, and attention head dimensions
    • Runtime intermediate activations and framework overhead
    • A safety margin, typically 10% to 20%

    The KV cache is often underestimated. When the context grows from 32K to 128K or even 1M tokens, the KV cache can grow from tens of gigabytes to hundreds of gigabytes. That size determines whether long-context workloads need accelerators with more memory.

    2. The Right Way to Configure: Define the Workload First, Then Size the Hardware

    Hardware should not be chosen by starting from a GPU model and fitting the workload to it. Define the workload first, then work backward to the server. Answer these four questions before selecting hardware.

    1. Context length: what window do you actually need?

    • Everyday chat and short documents: 32K is usually enough
    • Code understanding and retrieval-augmented generation (RAG): 128K is a comfortable range
    • Very long contract analysis or whole-repository code understanding: 256K or even 1M may be needed

    Context length is one of the largest drivers of GPU memory demand. At short contexts, a mid-sized multi-GPU node can be sufficient. A hard requirement for million-token contexts points directly to high-memory, high-end accelerators, because otherwise the KV cache has nowhere to fit.

    2. Concurrency: how many users will you serve?

    Single-user validation, a small team sharing a lab environment, and an enterprise API service have very different throughput and memory requirements. High concurrency requires a larger KV cache pool and an inference framework with efficient continuous batching.

    3. Workload type: what is the primary scenario?

    • Chat: focus on time to first token (TTFT) and interaction smoothness
    • Coding assistants and agents: long prompts and multi-turn calls, so focus on TTFT and stability
    • Long-document analysis: very long inputs, so focus on prefill throughput
    • High-concurrency APIs: focus on sustained decode throughput (tokens per second)

    4. Acceptance criteria: is “it runs” enough, or do you have a formal SLA?

    “The model starts” and “TTFT under 2 seconds, node throughput meets the target, and stable 24/7 operation” are very different acceptance criteria. They require very different redundancy designs.

    3. Benchmarking Multi-GPU Inference: Don’t Pick a Framework Too Early

    Popular open-source inference frameworks perform differently on multi-GPU MoE models. A typical controlled comparison, based on common industry benchmarking practice, uses an 8-way tensor parallel setup (TP=8) with a uniform context length baseline. Optimizations such as speculative decoding and prefix caching are turned off first, and then each framework is measured.

    Common observations include:

    • Short requests: some frameworks lead in TTFT and output throughput.
    • Long prompts: other frameworks achieve better TTFT, but their sustained output throughput may be slightly lower.

    No framework is absolutely faster. Each suits certain workloads better than others. The right approach is to run an A/B test with your own prompt distribution and concurrency model, rather than relying on someone else’s leaderboard. A minimal load-testing script might look like this:

    1. # Illustrative: fix the concurrency and measure TTFT and throughput
    2. # for short and long inputs separately
    3. benchmark_tool \
    4. --model-path /path/to/model \
    5. --num-prompts 200 \
    6. --concurrency 16 \
    7. --input-len 4096 --output-len 512 \
    8. --metrics ttft,tpot,throughput

    Tests should cover the typical input length distribution, peak concurrency, and mixed workloads that alternate long and short requests. Record P50, P95, and P99 latency, not just averages.

    4. Common Engineering Pitfalls

    (1) Don’t start with the full context window. First run the service stably at a common business window, such as 32K. Verify functionality and latency, then increase to 128K and beyond. Jumping straight to the maximum context often triggers several problems at once, including out-of-memory errors and sharp performance drops, which makes root causes hard to find.

    (2) Lock versions across the full stack. Model weights, the inference framework, CUDA, drivers, and low-level kernel libraries form one coupled system. A change to any one of them can introduce compatibility issues. Use container images to fix the entire runtime environment, and do not focus troubleshooting on a single parameter.

    (3) An 8-GPU deployment is not simply adding up memory. Effective multi-GPU bandwidth depends on the whole server topology. How GPUs interconnect (NVLink or PCIe), the configuration of P2P and collective communication libraries, CPU and PCIe lane count, system memory capacity, and NVMe loading speed all affect real performance. On weakly connected topologies, tensor-parallel communication overhead can cancel out the gains from additional GPUs.

    (4) Enable optimizations one at a time. Speculative decoding, prefix caching, and quantized KV cache each have their own limits, and each can introduce accuracy or stability issues. The correct order is to establish a performance baseline with no optimizations, enable them one by one, and validate each one’s benefit and side effects separately. That way, when something breaks, you can identify the cause quickly.

    (5) Don’t overlook separating prefill and decode. In very long-context workloads, prefill is compute-intensive, while decode is memory-access-intensive. Some deployment approaches split the two stages across separate resource pools to