2.8T Open-Source Model Deployment: VRAM and Deployment Guide

    This article explains how to estimate VRAM for a 2.8-trillion-parameter open-source model, including weight memory, KV cache, and training overhead. It compares tensor, pipeline, expert, and data parallelism, and outlines inference optimization and fine-tuning paths such as quantization, paged KV cache, continuous batching, speculative sampling, full fine-tuning, and LoRA.

    1. Calculate the VRAM Budget First

    The first step in determining whether a model can run is to estimate the VRAM occupied by its weights. The formula is simple: weight VRAM = number of parameters × bytes per parameter.

    For a 2.8-trillion-parameter model:

    • FP16/BF16 (2 bytes per parameter): approximately 5.6 TB
    • INT8 (1 byte per parameter): approximately 2.8 TB
    • INT4 (0.5 bytes per parameter): approximately 1.4 TB

    The figures above cover only the weights. With 80 GB GPUs, FP16 weights require at least about 70 GPUs, and INT4 weights require at least about 18 GPUs. This is a theoretical lower bound and is useful only for judging the order of magnitude.

    Actual deployment must also account for the following:

    • KV cache: stores key-value vectors for historical tokens, and its usage grows with concurrency and context length.
    • Activations and temporary buffers: intermediate results produced during inference computation.
    • Communication buffers and redundancy: communication regions for multi-GPU parallelism, plus reserved capacity for failover.

    KV cache size can be estimated with the following formula:

    KV cache bytes = 2 × layers × KV heads × head dimension × context length × concurrent requests × bytes per element

    The “2” in the formula represents the two caches for K and V. Specific values must be read from the target model’s configuration file. Different architectures, such as grouped-query attention, vary widely in the number of KV heads, so the same number cannot be applied universally.

    Training has higher VRAM requirements. Under mixed-precision training, each parameter typically also requires gradients and optimizer states, totaling about 16 bytes. Therefore, training VRAM is often several times that of inference.

    2. Choosing a Deployment Strategy

    Very large models usually cannot complete inference on a single GPU or a single machine, so parallel strategies must be combined.

    Method Applicable precondition Main bottleneck Tuning focus
    Tensor parallelism Dense models, insufficient VRAM on a single machine, high-speed interconnects such as NVLink between GPUs within the same node Every layer requires cross-GPU synchronization, and cross-node latency is noticeable Keep tensor parallelism within a single machine as much as possible
    Pipeline parallelism Models with many layers that can be split by layer across different nodes Pipeline bubbles cause idle devices Increase the number of micro-batches and balance computation across stages
    Expert parallelism Models with a mixture-of-experts (MoE) architecture Imbalanced routing and overloaded experts Use load-balancing strategies and place experts reasonably
    Data parallelism A single replica can fit entirely into available VRAM Each replica must store the full weights Increase the number of replicas and let the scheduler distribute requests

    MoE models activate only a small number of experts at a time, which significantly reduces computation, but the weights of all experts must remain resident in VRAM. Sparsity reduces computation, not storage.

    For a 2.8-trillion-parameter MoE model with INT4 quantization, the weights are about 1.4 TB. If each node has 8 × 80 GB GPUs, totaling 640 GB, the weights require at least 3 nodes. After adding KV cache and redundancy capacity, the actual node count is usually higher. A common approach is to use tensor parallelism within a node and pipeline or expert parallelism across nodes.

    3. Key Inference Optimizations

    • Quantization: INT8 or INT4 can significantly reduce VRAM usage but introduces accuracy loss. Before launch, compare pre- and post-quantization results on your own evaluation set; do not rely only on public leaderboards.
    • Paged KV cache: split the KV cache into fixed-size blocks and allocate them on demand to reduce VRAM fragmentation and over-reservation. Inference engines such as vLLM use this approach.
    • Continuous batching: dynamically add or remove requests at each decoding step so that short requests do not wait for long requests to finish, improving GPU utilization.
    • Speculative sampling: a smaller model first generates multiple candidate tokens, which the larger model then verifies in one pass. The benefit depends on the acceptance rate; a low acceptance rate can increase overhead instead, so it must be measured with real workloads.

    4. Fine-Tuning and Adaptation Paths

    Full-parameter fine-tuning: updates all weights and has the highest effect ceiling. Training VRAM requirements are as described in Section 1, usually requiring a multi-node training cluster together with checkpointing and recovery mechanisms.

    LoRA and other parameter-efficient fine-tuning methods: freeze the original weights and train only low-rank matrices. Trainable parameters usually account for only a small proportion of the original model. The rank is often set between 8 and 64, and the specific value must be determined through comparative experiments. The base weights still need to be fully loaded, so the savings are mainly in gradients and optimizer states.

    A common troubleshooting sequence for LoRA training is as follows:

    1. Validation loss keeps rising: usually overfitting; reduce the number of training epochs or add data.