FP8 Single-Node Deployment of Large Models and Memory Planning for Ultra-Long Contexts
This article explains how to plan GPU memory for deploying large language models with FP8 quantization on a single node. It covers why memory capacity—not accuracy—is usually the first blocker, how FP8 weights and 8-way tensor parallelism fit into a 8×141GB GPU node, why KV Cache becomes the dominant cost at 1M-token contexts, and how to build a memory budget table and apply optimization techniques such as KV quantization, paged memory management, prefix caching, and offloading.
Why Memory Capacity Is the First Bottleneck in LLM Deployment
When teams bring a large model inference service online, the first problem they encounter is usually not accuracy but memory capacity. A complete deployment assessment is essentially the process of answering three questions:
- Can the model weights fit?
- How much memory does the KV Cache need at the target context length?
- How do the two coexist and get scheduled when serving concurrent requests?
For dense or mixture-of-experts models with hundreds of billions of parameters, even at FP8 precision the raw weight size alone can reach hundreds of gigabytes. This makes multi-GPU parallelism mandatory rather than a nice-to-have.
FP8 Weights and Single-Node Tensor Parallel Configuration
Memory Savings from FP8 Quantization
For a model with N total parameters, the weight memory at FP8 precision is roughly:
Weight memory ≈ N × 1 Byte
Compared with FP16 (about N × 2 Bytes) or BF16, FP8 cuts the memory required for weights in half. Most modern inference frameworks already offer mature FP8 compute kernels, and with proper calibration the accuracy loss is manageable.
8 GPUs per Node Is the Standard Starting Point
The common single-node reference configuration from inference engines today is eight high-end data center GPUs with 141GB-class memory each, running 8-way tensor parallelism (TP=8). The reasoning behind this setup:
- 8 × 141GB ≈ 1.1TB of total memory, enough to fully hold hundreds of GB of FP8 weights;
- Tensor parallelism shards each layer’s weight matrices across 8 GPUs, with all cards collaborating synchronously during forward passes; communication overhead mainly comes from per-layer AllReduce operations;
- High-bandwidth interconnects (NVLink-class buses) are a prerequisite for smooth multi-GPU tensor parallelism—cross-node tensor parallelism carries communication costs that significantly reduce throughput.
Before deployment, use your framework’s built-in configuration checks to confirm the weights can be fully loaded. A typical workflow:
1. Confirm the model is an FP8-quantized version2. Set tensor_parallel_size = 83. Check per-GPU headroom: weight_per_gpu + kv_cache_per_gpu + activation < 141GB4. Reserve KV Cache space via the framework's memory utilization parameter
Key Misconception: Weights That Fit ≠ Long Contexts That Run
KV Cache Dominates Memory at Long Contexts
A common mistake is looking only at weight size. In practice, when the context length reaches the million-token scale, KV Cache overhead overtakes the weights. KV Cache memory can be roughly estimated as:
KV Cache ≈ 2 × layers × hidden_size × kv-head-related factor × context_length × batch × bytes_per_token
For architectures using grouped-query attention (GQA), a reduced number of KV heads significantly lowers this value. But at the 1M-context level, a single request’s KV Cache can still reach tens of GB or more.
Why 1M-Context Deployments Need Larger Per-GPU Memory
On an 8×141GB node, the weights load fully, but reserving a complete 1M-context KV Cache for even a single request leaves memory extremely tight—there must also be room for activations, the CUDA context, framework runtime overhead, and more. This is why industry reference solutions supporting the full million-token context typically move to 8×180GB-class GPUs with larger per-card memory:
- The weight footprint is unchanged (FP8 weight size is the same), but the extra ~40GB per card goes almost entirely to KV Cache;
- A single request’s KV Cache can stay fully resident, avoiding frequent swapping in and out;
- Concurrency and context length can be traded off more flexibly.
An Engineering Approach to Memory Budgeting
Before deployment, build a memory budget table and account for each item:
| Item | Estimation | Notes |
|---|---|---|
| Weights | Parameter count × 1 Byte (FP8) | Divided across TP ranks |
| KV Cache | Context length × KV bytes per token × concurrency | Most sensitive item |
| Activations | Depends on batch size and sequence length | Non-negligible for long contexts |
| Runtime overhead | Fixed framework overhead + communication buffers | Typically reserve a few GB |
A practical validation rule: weight share + peak KV Cache + activations + overhead ≤ per-GPU memory × memory utilization. Start with the memory utilization parameter at around 90% and tune it down based on observed OOM events.
Optimization Techniques for Ultra-Long Contexts
When the memory budget cannot directly support the target context length, consider these general approaches:
- KV Cache quantization: Reduce KV Cache precision from FP16 to FP8 or lower, directly halving its footprint—evaluate the accuracy impact first;
- Paged memory management: Manage KV Cache in blocks to reduce fragmentation and improve utilization, allocating on demand;
- Prefix caching: Store only one copy of the KV for shared prefixes such as common system prompts, reused across requests;
- Offloading and sparsification: Swap cold KV entries to host memory, or use attention sparsification to keep only the KV of critical tokens—trading compute for memory.
Conclusion
The evaluation framework for FP8 single-node deployment can be distilled into one sentence: first check whether the weights fit when sharded across GPUs, then check whether the KV Cache for the target context fits fully and efficiently in the remaining memory, and finally use a memory budget table to balance concurrency and context length. When an 8×141GB node is sufficient for native FP8 weights but the business requires the full million-token context, upgrading to nodes with larger per-GPU memory (such as 8×180GB-class cards) or combining optimizations like KV quantization and prefix caching is the safer engineering choice today. Deployment is not a one-shot decision: run load tests with real production traffic, and keep tuning memory utilization and concurrency parameters to find the best balance between throughput and stability.
