DeepSeek-V3 & R1 VRAM & GPU Cluster Calculator

Last updated

Estimates the GPU memory DeepSeek models need for inference as weights plus KV cache plus a 20% overhead allowance. Weights are parameters × bits ÷ 8, with FP8 and INT4 keeping embeddings at 16-bit. MLA caches 576 values per layer for each token, and V3.2's indexer adds 132 bytes. Tensor parallelism copies that cache and the down-projections to a server's 8 GPUs, while data-parallel attention copies every attention weight. The 671B models are sized in whole 8-GPU servers.

KV cache precision
Total VRAM, all GPUs –
Model weights –
KV cache –
Duplicated across GPUs –
Runtime overhead –
KV cache per token –
GPUs needed by card

Choose a DeepSeek model, the format its weights are stored in, the context each request holds and how many requests run at once. The calculator adds the weights, the KV cache, the part of either that a multi-GPU layout copies to every GPU, and an allowance for the runtime. It sizes the 671-billion-parameter models in whole 8-GPU servers and the R1 distills in single cards and, like this site's LLM VRAM calculator, reads each card's GB as GiB. The math runs in your browser and nothing you type is sent anywhere.

How the estimate works

total = weights × (1 + overhead) + cache + 7 × copied part

Weights are parameters × bits ÷ 8, except that FP8 and INT4 keep the embeddings and output layer at 16 bits. DeepSeek's FP8 framework does the same: the V3 report keeps the embedding module and the output head, among other parts, in their original precision, and DeepSeek published V3 only as FP8 weights. The 671 billion parameters counted here are what DeepSeek calls the main model. Its model card puts the Hugging Face total at 685B, the rest being a 14B multi-token prediction module that the V3 report says can be discarded at inference or reused for speculative decoding.

The cache is where DeepSeek differs. Multi-head latent attention, or MLA, keeps one compressed 512-value vector and a 64-value positional key per token and layer, the only vectors V3's report says "need to be cached during generation". At 16 bits that is 1,152 bytes a layer, or 70,272 bytes a token over 61 layers, the "70.272 KB" in DeepSeek's ISCA 2025 paper against 516.096 KB for Llama 3.1 405B. DeepSeek's own FP8 cache, which the 8-bit setting follows for these models, stores the 512 latent values in FP8 with four 4-byte scales and keeps the 64 positional values at 16 bits: 656 bytes a layer, 40,016 a token. V3.2 adds an indexer key that DeepSeek's inference code stores as 128 FP8 values and one 4-byte scale: 132 bytes a layer at either cache precision.

The last term depends on how a server's 8 GPUs share the attention. Under tensor parallelism each GPU runs 16 of the 128 attention heads, but every head reads the same latent vector, so all eight keep the whole cache. DeepSeek's inference code also keeps whole on every GPU the down-projections that produce the latent vectors and V3.2's indexer: 0.92 billion parameters in V3 and 1.78 billion in V3.2. SGLang's developers wrote in December 2024 that tensor parallelism on 8 GPUs "will lead to duplicated KV cache and unwanted memory usage." Data-parallel attention gives each GPU its own requests and stores each sequence's cache once, but data parallelism replicates weights, as vLLM's documentation puts it, and every GPU then holds the attention weights: 11.41 billion parameters in V3 and 12.27 billion in V3.2. The experts stay divided either way. The calculator adds seven extra copies of whichever part the layout duplicates, and the overhead is 20% of the weights unless you change it.

The defaults, worked through

The defaults run DeepSeek-V3, V3.1 or R1 in FP8 with tensor parallelism, a 32,768-token context and one sequence. The weights take 672,879,777,280 bytes, 626.67 GiB. One copy of the cache is 70,272 × 32,768 bytes, 2.14 GiB. The other seven GPUs' copies of the cache and of the 0.86 GiB of down-projections add 21.03 GiB. With 125.33 GiB of overhead the total is 775.18 GiB, after rounding: two 8-GPU H100 servers filled to 61%, or one server of H200s at 69%, B200s at 54%, MI300Xs at 50%, MI325Xs at 38% or MI355Xs at 34%. Eight 96 GB RTX PRO 6000 cards hold 768 GiB, too little, but an 8-bit cache brings the total to 767.79 GiB, which just fits.

From latent attention to sparse attention

DeepSeek introduced MLA with DeepSeek-V2 in May 2024, a mixture-of-experts model of 236 billion parameters with 21 billion active per token, whose paper reported a KV cache 93.3% smaller than DeepSeek 67B's. DeepSeek-V3 followed on December 26, 2024 with 671 billion parameters, 37 billion active, pre-trained on 14.8 trillion tokens. Its full training took 2.788 million H800 GPU hours, and DeepSeek called it the first validation of FP8 training on an extremely large-scale model. R1 arrived on January 20, 2025 under the MIT license, trained from DeepSeek-V3-Base, and its paper ran in Nature in 2025.

The updates kept the shape. R1-0528, released on May 28, 2025, and V3.1, on August 21, keep V3's configuration, so one preset covers them all. V3.2-Exp, on September 29, 2025, was built on V3.1-Terminus and debuted DeepSeek Sparse Attention: an indexer scores every earlier token and each query attends to the top 2,048. V3.2 followed on December 1 with the same structure. Sparse attention saves compute rather than memory. In DeepSeek's code every token's latent vector stays cached, since any of them may be picked, and the indexer adds its own keys: 78,324 bytes a token against 70,272.

DeepSeek-V4, previewed on April 24, 2026, compresses the cache itself. Its model card describes a hybrid of compressed sparse and heavily compressed attention, with V4-Pro needing 10% of V3.2's KV cache at a one-million-token context. V4-Pro has 1.6 trillion parameters with 49 billion active, and V4-Flash 284 billion with 13 billion active. V4.1-Flash, released on September 10, 2026, puts its global KV cache at 890 bytes a token with an FP4 cache, against V3's 70,272 at 16 bits. DeepSeek describes V4's design as token-wise compression plus sparse attention, so the per-token formula here does not fit, and neither generation is a preset.

Tensor parallel or data-parallel attention

DeepSeek serves V3 with a mix of both. Its report gives the decoding stage a minimum unit of 40 nodes with 320 GPUs, where "the attention part employs TP4 with SP, combined with DP80" and the experts are spread across all 320. vLLM's documentation suggests data parallelism for the attention layers of mixture-of-experts models that use MLA, and when a model outgrows one node it advises setting the tensor parallel size to the GPUs per node and the pipeline parallel size to the number of nodes. That is the layout the table assumes when it asks for more than one server.

Which layout uses less memory depends on how much is cached. Tensor parallelism costs seven more copies of the cache and the down-projections, data-parallel attention seven more copies of all the attention weights, which take 10.63 GiB in FP8. The difference is the 9.77 GiB that tensor parallelism splits, so the two break even when one copy of the cache reaches that size, about 149,280 tokens of V3's cache at 16 bits. Four 32,768-token sequences need 826.65 GiB with tensor parallelism and 834.99 GiB with data-parallel attention; five need 843.80 and 837.13. At 64 sequences it is 1,856.02 GiB against 963.66: two H200 servers or one. What those servers cost to rent is a job for the GPU cloud cost calculator.

The R1 distills on one GPU

With R1, DeepSeek released six dense models fine-tuned on samples R1 generated, built on Qwen2.5-Math 1.5B and 7B, Llama 3.1 8B, Qwen2.5 14B and 32B, and Llama 3.3 70B Instruct. R1-0528's model card adds a seventh on Qwen3 8B and says its architecture "is identical to that of Qwen3-8B". The Llama-based pair have the same shape and parameter count as Meta's models, so they need what those do on the Llama VRAM calculator, and the Qwen3-based one matches Qwen3 8B on the Qwen3 VRAM calculator. All seven use grouped-query attention, caching 2 × layers × KV heads × 128 values a token.

Model Base KV cache per token Q4_K_M weights Ollama download Q4_K_M total at 32,768 tokens
R1-Distill-Qwen-1.5B Qwen2.5-Math-1.5B 28 KiB 1.087 GB 1.1 GB 2.09 GiB
R1-Distill-Qwen-7B Qwen2.5-Math-7B 56 KiB 4.659 GB 4.7 GB 6.96 GiB
R1-Distill-Llama-8B Llama 3.1 8B 128 KiB 4.913 GB 4.9 GB 9.49 GiB
R1-0528-Qwen3-8B Qwen3 8B 144 KiB 5.011 GB 5.2 GB 10.1 GiB
R1-Distill-Qwen-14B Qwen2.5-14B 192 KiB 9.036 GB 9.0 GB 16.1 GiB
R1-Distill-Qwen-32B Qwen2.5-32B 256 KiB 20.045 GB 20 GB 30.4 GiB
R1-Distill-Llama-70B Llama 3.3 70B Instruct 320 KiB 43.165 GB 43 GB 58.24 GiB

Ollama's plain deepseek-r1 size tags point to the same files as its q4_K_M tags. This page's Q4_K_M weights, in decimal gigabytes, round to Ollama's listed size for six of the seven; the Qwen3-based 8B comes to 5.011 GB against 5.2. When a distill needs two or three cards, the table assumes pipeline parallelism, which vLLM's documentation says splits the model along layers, so nothing is copied. In Q4_K_M with a 32,768-token context and one sequence, the 14B needs 16.1 GiB, 67% of a 24 GB card. The 32B needs 30.4 GiB, two 24 GB cards or one 32 GB card at 95%, and the 70B needs 58.24 GiB, three 24 GB cards.

Figures are planning estimates, not guarantees: real memory use depends on the inference engine, its parallel layout and settings, and the driver. This site is not affiliated with DeepSeek or any engine or hardware maker named above. See the site disclaimer.

Frequently asked questions

How many GPUs does DeepSeek-R1 671B need?

In its native FP8 with a 32,768-token context, one sequence and tensor parallelism, 775.18 GiB including the 20% overhead allowance. That is two 8-GPU H100 servers, or one server of H200, B200, MI300X, MI325X or MI355X cards. In GGUF Q4_K_M the total falls to 479.65 GiB, which one H100 server holds at 75%.

Why does tensor parallelism copy DeepSeek's KV cache to every GPU?

MLA caches one compressed vector and one positional key per token and layer, both shared by every attention head. Tensor parallelism splits the heads across a server's 8 GPUs but not that cache, so each GPU keeps all of it. At 64 sequences of 32,768 tokens the seven extra copies of the cache take 960.75 GiB and the total reaches 1,856.02 GiB, two H200 servers, where data-parallel attention needs 963.66 GiB on one.

Which DeepSeek R1 distill fits a 24 GB GPU?

At a 32,768-token context in GGUF Q4_K_M, every distill up to the 14B. R1-Distill-Qwen-14B needs 16.1 GiB, 67% of a 24 GB card, and the Qwen3-based 8B needs 10.1 GiB. The 32B needs 30.4 GiB, two 24 GB cards or one 32 GB card, and the 70B needs 58.24 GiB, three 24 GB cards.

Does DeepSeek-V3.2's sparse attention need less memory?

No. Its indexer picks 2,048 earlier tokens for each query to attend to, which saves compute, but every token's latent vector stays cached and the indexer's own keys add 132 bytes a layer. The cache grows from 70,272 to 78,324 bytes a token, and with the indexer's weights, which tensor parallelism keeps whole on every GPU, the default total rises from 775.18 to 783.65 GiB.

Can this page size DeepSeek-V4?

No. V4, previewed in April 2026, compresses its cache token-wise, and its model card says V4-Pro needs 10% of V3.2's KV cache at a one-million-token context, so the per-token formula used here does not apply. V4-Pro has 1.6 trillion parameters with 49 billion active, and V4-Flash 284 billion with 13 billion active.

Sources

  1. DeepSeek-V3 Technical Report, arXiv, 2024
  2. DeepSeek-V3 model card, DeepSeek on Hugging Face, 2024
  3. DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model, arXiv, 2024
  4. Insights into DeepSeek-V3: Scaling Challenges and Reflections on Hardware for AI Architectures, arXiv, 2025
  5. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning, arXiv, 2025
  6. DeepSeek-R1 model card, DeepSeek on Hugging Face, 2025
  7. DeepSeek-R1-0528 model card, DeepSeek on Hugging Face, 2025
  8. DeepSeek-V3.1 Release, DeepSeek API Docs, 2025
  9. Introducing DeepSeek-V3.2-Exp, DeepSeek API Docs, 2025
  10. DeepSeek-V3.2 Release, DeepSeek API Docs, 2025
  11. DeepSeek-V3.2 inference code (model.py), DeepSeek on Hugging Face, 2025
  12. A Deep Dive Into The Flash MLA FP8 Decoding Kernel on Hopper, DeepSeek on GitHub, 2025
  13. DeepSeek V4 Preview Release, DeepSeek API Docs, 2026
  14. DeepSeek-V4-Pro model card, DeepSeek on Hugging Face, 2026
  15. DeepSeek-V4.1-Flash Release, DeepSeek API Docs, 2026
  16. DeepSeek-V4.1-Flash model card, DeepSeek on Hugging Face, 2026
  17. SGLang v0.4: Zero-Overhead Batch Scheduler, Cache-Aware Load Balancer, Faster Structured Outputs, LMSYS Org, 2024
  18. Data Parallel Deployment, vLLM documentation
  19. Parallelism and Scaling, vLLM documentation
  20. deepseek-r1 tags, Ollama