Decode bandwidth with two 128K contexts
A retrieval system sends two very long sequences to a 70B Q4 model. FP16 KV and an adjustable workspace reserve consume most of the two-device allocation.
Jump to resultsInputs
Results
Runs in your browser- Required memory
- 140.689GB
- Minimum GPU count
- 2GPUs Aggregate memory lower bound
- Decode bandwidth ceiling
- 104.77tok/s Ideal aggregate across the batch
Compare measured decode speed with this bandwidth ceiling. Verify the model fits each rank individually.
| Model weights | 42 GB |
|---|---|
| Active KV cache | 85.899 GB |
| Activation and scratch reserve | 12.79 GB |
| Usable memory per GPU | 72 GB |
| Usable memory across GPUs | 144 GB |
| KV per cached token | 327.68 kB |
| Ceiling per sequence | 52.385 tok/s |
What to try
At 128K per sequence, context memory is about 85.9 GB. Compare a shorter retrieval prompt and measure actual decode rates independently from the prefill phase.
How the estimate works
KV bytes = 2 × layers × hidden width × KV-head ratio × bytes × tokens × sequences
The model assumes dense decoder-only attention. FP16 uses two bytes per parameter, FP8 and INT8 use one, and Q4_K_M uses a rough 0.60 bytes to include mixed precision and quantization metadata. Use the actual model file size to check this assumption.
Keys and values grow with the live context and batch. GQA reduces the cached width by the ratio of KV heads to query heads. Workspace is an adjustable percentage of weights plus KV, with a separate allowance for unavailable GPU memory.
The GPU count is a memory lower bound. The decode ceiling assumes perfect sharding and one sweep of weights and active KV per batch step at full bandwidth. Kernel overhead, compute, prefill, cache sharing, allocator fragmentation, and interconnect can lower measured output.
Frequently asked questions
Why is the 128K decode rate modeled separately from prompt prefill?
Decode repeatedly reads weights and active context, while prefill processes the prompt in bulk. Their compute intensity and latency characteristics differ.
Can prefix caching reduce the working KV set for both 128K requests?
A runtime that shares identical cached prefix blocks can save storage. The worksheet independently budgets the full context of each sequence.