How models are made training pipeline · stage 8
GPU facts and cost math: the hardware bill for running a modelpractitioner-perspective methodology · key facts carry official sources
Separate resident weights, context cache, concurrency and runtime; distinguish idealized bandwidth arithmetic from actual throughput, with an editable budget and no stored prices or purchase advice.
What this guide covers
Split memory into resident weights, cache, runtime and reserve, then compare with task-available memory. Downloading is not loading; a lower estimate does not establish runtime support or output quality.
This site stores no card/rental prices or purchase recommendations. Original hardware-source dates remain 2026-10-21. The 2026-11-04 addition covers cache methodology and browser-local arithmetic, not a fresh hardware-spec check.
Check capacity, bandwidth and available memory
Official hardware pages establish published capacity, bandwidth and SKU, not task speed or available memory. Check drivers, backend, sharing, system use and loaded model layout separately.
Sources retain original snapshot dates. Nominal device capacity is not task-available memory, and two cards are not automatically one contiguous pool. Enter checked available GiB in the budget tool, converting decimal GB first.
Assumptions and limits of bandwidth arithmetic
For a simplified single-request dense-model decode, peak memory bandwidth divided by bytes read per step gives an idealized estimate. Weight size belongs in that denominator only if each step reads all weights from that memory level. Active MoE experts, cache reuse, batching and offload change the assumptions.
For example, assumed reads of 16 GB per step at 3.35 TB/s give about 209 reads/second before other overhead. This is teaching arithmetic, not measured tokens/second. Smaller files do not guarantee proportionally higher speed.
Prefill/decode bottlenecks vary with batch, sequence length, kernels and hardware; neither can universally be reduced to compute-only or bandwidth-only.
Cost math: composition, not unit prices
Allocated hardware cost per token equals included hardware cost divided by actual tokens produced in the same period. Define input/output, caching, idle time, failed retries and service volume; theoretical peak throughput is not delivered output.
A capacity budget estimates memory under assumptions, not hourly production. Observe throughput only in your own authorized fixed-task environment; this site ran no model benchmark and stores no prices. Record cost components with the cost calculator.
How this fits the rest of the site
Series-page block B filters candidates by published file size × 1.15. That fixed illustration neither estimates KV cache nor guarantees execution. Use the tool below to separate cached length, concurrency and runtime reserve; encoders, MLA, hybrid and sliding-window models require architecture-specific methods.
How this differs from the Learn site
The Learn site's VRAM and
quantisation pages are user-perspective explainers;
this guide gives the hardware fact table and the composition method for the cost math.
Same concept, different depth on each side, cross-linked without duplication.
For the KV cache and batching mechanics see the previous guide, “Serving deep dive”.
Worked example: allocating a 10 GiB budget
This hypothetical capacity exercise is not a named model or a measured site result. A GiB is 2^30 bytes; decimal GB and GiB are not numerically interchangeable.
Assume a 10 GiB available budget and 6 GiB of weights. With assumed cache use of 2 GiB and runtime use of 1 GiB, the estimate is 9 GiB, leaving 1 GiB headroom. Cache/runtime figures are exercise assumptions; actual use depends on model, precision, context and concurrency.
Check file size, runtime support and available memory. Start with short input, record use, then increase context. If cache exceeds budget, assess shorter input, different concurrency or other tiers. Check runtime documentation for offload support.
Capacity does not predict speed or establish quality. Compare equal tasks for latency, errors and usage. This example makes no performance guarantee or purchase recommendation.
Continue to the local-model workflow, or revisit quantization to separate bit width from quality.
Context and concurrency: capacity budget
A simplified budget for standard full-attention MHA/GQA decoders. It does not inspect hardware, download models or predict speed. Inputs are assumptions to check; resident weights are not download-file size.
C includes prompt and generated content. N assumes equal lengths and no cache sharing. Add 8-bit scaling/metadata to reserve. Read architecture from model config and cache precision from runtime config; do not infer them from parameter count.
KV bytes = 2 × L × Hkv × D × B × C × N
KV GiB = KV bytes / 1,073,741,824
Total = resident weights + KV + runtime/reserve
Fill inputs and confirm the scope to calculate.
GB and GiB conversion (units only)
1 GB = 1,000,000,000 bytes; 1 GiB = 1,073,741,824 bytes.
The conversion is not copied into resident weights: loaded layout, precision conversion and runtime allocation may differ.
Missing overhead, wrong residency estimates, multi-device allocation, prefix sharing, paging and multimodal encoders can change the result. This formula is not universal: MLA, hybrid state-space models and differing per-layer caches need separate calculations.
Transformers: cache tensors · vLLM: memory controls · Memory troubleshooting
Sources
- NVIDIA H100 official spec page (SXM 80GB / NVL 94GB and bandwidth figures; fetched directly 2026-10-21):https://www.nvidia.com/en-us/data-center/h100/
- NVIDIA A100 official spec page (80GB HBM2e and bandwidth figures; fetched directly 2026-10-21):https://www.nvidia.com/en-us/data-center/a100/
- NVIDIA RTX 4090 official spec page (24GB GDDR6X; fetched directly 2026-10-21):https://www.nvidia.com/en-us/geforce/graphics-cards/40-series/rtx-4090/
- Apple MacBook Pro official spec page (unified-memory capacity figures; fetched directly 2026-10-21):https://www.apple.com/macbook-pro/specs/
- PagedAttention paper (arXiv 2309.06180, KV-cache memory versus throughput; abstract page fetched directly 2026-10-21):https://arxiv.org/abs/2309.06180
- llama.cpp official repository (the GGUF local-inference implementation; fetched directly, HTTP 200, 2026-10-21):https://github.com/ggml-org/llama.cpp
- Transformers: cache tensor structure (item checked 2026-11-04):https://huggingface.co/docs/transformers/cache_explanation
- vLLM: memory controls (item checked 2026-11-04):https://docs.vllm.ai/en/latest/configuration/conserving_memory/
Base source snapshot: 2026-10-21; item-specific additions and check scope appear in the text and source labels. Check original specifications, methods and conditions.
This page appears in: Make games with AI