Chris Collins

Tools · ai

AI hardware calculator

How much GPU memory an LLM needs and how many accelerators that takes; the roofline model with a batch slider and overlaid chips; training compute, MFU, isoFLOP loss valleys and the EU AI Act line; inference speed, batching, KV hand-off, energy and cost per token; and a sourced table of accelerators from H100 to Groq, Cerebras, Apple silicon and Jetson.

Added · updated 14 October 2026

How to use it
  • LLM memory — pick a model (Llama 3 8B/70B, Llama 3.1 405B, Llama 4 Scout and Maverick, gpt-oss-120b, DeepSeek-V3 and R1, the book’s 70B worked example, and more — or your own numbers) and an accelerator. For serving it adds up the weights (parameters × bits per value, with block scales for MXFP4 and NVFP4; As released uses the checkpoint’s own mix, such as gpt-oss’s MXFP4 experts or DeepSeek’s FP8) and the KV cache (2 × layers × KV heads × head dimension × bytes, per token of context, per sequence — DeepSeek’s multi-head latent attention stores a compressed latent instead, and gpt-oss’s sliding-window layers keep only 128 tokens), shows whether it fits, how many GPUs it needs, and the memory per GPU with tensor parallelism. For training it uses mixed-precision Adam (16 bytes per parameter) plus activations.

  • Roofline — attainable throughput = min(peak, arithmetic intensity × bandwidth), plotted for the accelerator and precision you choose, with a matrix multiply, one attention decode step, or an elementwise operation marked on it. The batch slider grows the matrix multiply’s M from 1 to 8,192 — the dot climbs the slope as batching does — and Overlay other accelerators draws up to five more roofs (H100 against B200, MI355X, Ironwood, the Apple M1 Neural Engine …).

  • Training compute — C ≈ 6·N·D FLOPs on a log scale against GPT-3, Chinchilla, Llama 3.1 405B and the EU AI Act’s 1025 FLOP line; time, GPU-hours and cost at a given MFU and hourly price; MFU from one measured step (tokens per step and step time) or from a run’s reported GPU-hours; isoFLOP loss valleys and the compute-optimal frontier; and, given the tokens a model will serve in its lifetime, the smaller, over-trained model that reaches the same loss for the least training + inference compute.

  • Inference speed & cost — time to first token (prefill, compute-bound), time per output token (decode, usually bandwidth-bound), a chart of tokens/s per sequence and in total against the batch with the largest batch the KV cache allows, the single-stream bandwidth ceiling, the time to hand a prompt’s KV cache from a prefill GPU to a decode GPU over NVLink or a 400 Gb/s NIC, requests per second, dollars per million tokens, and energy per token (watts ÷ tokens/s) and per answer. Measured tokens/s per GPU replaces the estimate for cost, energy and request rate.

  • Accelerators — one table of every chip the tool knows: memory, bandwidth, dense peaks by precision (marked where the vendor’s headline is 2:4 sparse), power, ridge point, the bandwidth-bound decode ceiling for a model, the chips needed just to hold it (the question that decides SRAM machines such as Groq and Cerebras), and a source and as-of date for every row.

Every result is an estimate from first principles and the vendors' peak numbers — real kernels and serving stacks reach a fraction of them. Throughput figures are dense: NVIDIA’s headline tensor-core numbers (and AMD’s, Jetson’s and DGX Spark’s “with sparsity” figures) assume 2:4 sparsity and are twice these. The number formats are explained bit by bit in the floating-point inspector.

Limits

  • Peaks are datasheet ceilings; delivered performance is typically a half to a third of them (MFU). The decode model reads weights and KV cache once per step and ignores kernel launch, communication and scheduling overheads; tensor-parallel figures assume a perfect split.

  • MoE routing is assumed uniform. Llama 4’s chunked-attention layers are treated as full attention (an overestimate of their KV cache).

  • The loss curves use one published fit of the Chinchilla data (Besiroglu et al. 2024); the absolute loss values belong to that dataset and tokenizer, not to any model you name.

  • Energy counts accelerator board power only — not the host, networking or cooling (multiply by the facility’s PUE).

  • Groq LP30 figures come from NVIDIA’s GTC 2026 disclosure as quoted in the book; Cerebras publishes no dense peak, and Apple publishes no GPU TFLOPS.

Related: floating-point inspector (FP8, MXFP4 and NVFP4 bit by bit), latency numbers.

Sources

Sharing

Share link copies a URL that opens this tool with your current settings — every value it remembers between visits, packed into ?s=. Opening a link replaces your saved settings for this tool. Share links made with earlier versions of the tool still open as they did.

Linking to an example

Links can be written by hand. Add the tab after #: memory, roofline, training, inference or chips. The first group of parameters sets the same setting on every tab that has it (gpu=b200 picks the B200 on all four calculators).

Parameter Meaning Example

model

Model id: llama3-8b, llama3-70b, llama31-405b, llama2-70b, book-70b, mistral-7b, mixtral-8x7b, qwen25-72b, gemma2-27b, gpt-oss-120b, llama4-scout, llama4-maverick, deepseek-v3, deepseek-r1, or custom

model=book-70b

params, active, layers, hidden, heads, kvh, hd

A custom model (with model=custom): parameters and active parameters in billions, layers, hidden size, attention heads, KV heads, head dimension. params is also the Training tab’s parameter count

model=custom&params=70&kvh=64

gpu

Accelerator id, as in the Accelerators table: h100, h200, b200, b200_192, gb200, b300, gb300, a100_80, a100_40, v100, l40s, rtx4090, rtx5090, mi300x, mi325x, mi355x, tpu6e, tpu7, trn2, trn3, gaudi3, groq, lp30, wse3, m1, ane_m1, m1max, m1ultra, m2pro, m2max, m2ultra, m3max, m3ultra, m4, m4pro, m4max, m5, m5pro, m5max, spark, thor, orin64, orinnano, hailo10h

gpu=mi355x

w

Weight format: fp32, bf16, fp8, int8, int4, mxfp4, nvfp4, fp4 (0.5 byte, no scales), native (as released)

w=fp8

kv

KV-cache format (same ids)

kv=fp8

prec

Compute precision: fp32, tf32, bf16, fp8, int8, fp4, int4

prec=fp8

ctx

Context length in tokens (memory) or attention context (roofline)

ctx=128000

batch

Concurrent sequences

batch=64

gpus

Number of accelerators (training and inference)

gpus=8

price

Dollars per GPU-hour

price=3

mode, over, usable, rec

Memory tab: infer or train; overhead %; usable memory %; activation recomputation none, selective or full

mode=train&rec=full

op, m, n, k, elems, ops

Roofline: operation gemm, attn or elem; GEMM sizes M (the batch slider), N, K; elementwise values and FLOPs per value

op=gemm&m=64

cmp

Roofline overlays: accelerator ids separated by commas

cmp=b200,mi355x,tpu7

tokens, mfu, budget

Training: tokens in billions (blank = 20 per parameter), MFU %, or a FLOP budget

tokens=15600&mfu=40

steptok, step, gpuh, life

Training: tokens in one measured step and its seconds (gives MFU), reported GPU-hours (gives MFU), lifetime inference tokens (over-training)

steptok=4e6&step=7

prompt, out, eff

Inference: prompt and output tokens, prefill efficiency %

prompt=8000&out=500

tps, watts

Inference: measured tokens/s per GPU and power per GPU in watts (blank = the table’s board power)

tps=10&watts=5

kind

Accelerators tab filter: all, gpu, asic, sram, apple, edge

kind=sram

example

One of the presets below; parameters given with it override the preset’s

example=p04-decode-ceiling

Numbers may be written as 4e6 or 4000000. In a URL + means a space: write 1e24 (or 1e%2B24); a 1e+24 typed straight into the address bar also works, because the number fields ignore the space it becomes.

Presets (names carry the book’s part number):

example= Shows

p04-70b-fp16

70B dense weights in FP16: 140 GB, more than one 80 GB H100 holds (open)

p04-70b-fp8

The same weights in FP8: 70 GB (open)

p04-70b-fp4

In FP4 (0.5 byte each): 35 GB, on one 80 GB GPU (open)

p03-kv-70b-8k

KV cache of one 8,000-token conversation on the 70B model: 320 KiB/token, 2.6 GB (open)

p03-kv-70b-128k

The same at 128,000 tokens: 42 GB for one sequence (open)

p03-mha-vs-gqa

The 70B model with 64 KV heads (full multi-head attention) instead of GQA’s 8: 8× the cache, 21 GB at 8,000 tokens (open)

p17-training-state

Training the 70B model with mixed-precision Adam: 16 bytes/parameter, 1.12 TB before activations (open)

p04-decode-ceiling

Decode ceiling: 3.35 TB/s ÷ 140 GB ≈ 24 tok/s per H100 of bandwidth; the 140 GB model is split over 4 H100s (tensor parallel), whose combined bandwidth gives ≈ 96 tok/s (open)

p04-batching

Batching: total tokens/s climbs with the batch while each sequence slows a little, until the KV cache fills memory (open)

p15-kv-handoff

Prefill → decode hand-off: an 8,000-token prompt’s 2.6 GB KV cache over NVLink vs a 400 Gb/s NIC (open)

p19-cost-per-token

$3 per GPU-hour at 2,000 tokens/s: $0.42 per million tokens (open)

p24-rack-chat

A 72-GPU rack at 3,000 tok/s per GPU: ≈ 720 requests/s on 300-token answers (open)

p24-rack-reasoning

The same rack on 10,000-token reasoning turns: ≈ 22 requests/s (open)

p06-apple-m5

An 8B model in 4 bits on an M5 (153 GB/s): bandwidth-bound decode; switch to the M4 (120 GB/s) for the 1.27× gap (open)

p22-hailo-energy

Hailo-10H: a 7B model at the claimed 10 tok/s under 5 W is 0.5 J per token — and above its ≈17 GB/s bandwidth ceiling (open)

p22-thor-energy

Jetson AGX Thor: an 8B model in NVFP4 at 130 W — tokens/s, joules per token and Wh per answer (open)

p01-ridge-h100

H100 roofline: 989.5 TFLOPS ÷ 3.35 TB/s = a ridge at ≈ 295 FLOP/byte; one decoding token (M = 1) sits at ≈ 1 (open)

p04-batching-roofline

Batching climbs the roofline: drag the batch slider from M = 1 towards the ridge (open)

p05-roofline-compare

H100, B200, MI355X and TPU Ironwood rooflines overlaid (BF16, dense) (open)

p06-ane-roofline

The Apple M1 Neural Engine’s roofline (11 TFLOPS FP16 over 68 GB/s), against an H100 (open)

p04-mfu-worked

MFU of one step: 70B model, 4M tokens, 512 H100s, 7 s → 47.4% (open)

p17-gpt3

GPT-3: 175B parameters × 300B tokens × 6 ≈ 3.15 × 10²³ FLOPs (open)

p17-chinchilla

Chinchilla: 70B on 1.4T tokens (20 per parameter), 5.9 × 10²³ FLOPs (open)

p17-llama405b

Llama 3.1 405B on 15.6T tokens: 3.8 × 10²⁵ FLOPs on 16,384 H100s, over the EU AI Act line (open)

p19-training-cost

Llama 3.1 405B’s reported 30.84M GPU-hours imply ≈ 35% MFU; $92M at $3 per GPU-hour ($62–123M at $2–4) (open)

p17-overtrain

Over-training: an 8B model on 15T tokens, and the size that minimises training + 10¹⁴ lifetime inference tokens (open)

add-eu-ai-act

EU AI Act: 400B parameters on 4T tokens is 9.6 × 10²⁴ FLOPs, just under the 10²⁵ presumption (open)

p05-accelerators

Every accelerator, with dense peaks, bandwidth, power, ridge and sources; chips to hold the 70B model in FP8 (open)

p06-sram-chips

SRAM machines: Groq chips (230 MB each) and Cerebras wafers (44 GB) needed to hold the 70B model in FP16 (open)

p06-apple-bandwidth

Apple silicon M1–M5: unified-memory capacity and bandwidth, and decode ceilings (open)

p22-edge

Edge modules (Jetson Thor and Orin, DGX Spark, Hailo-10H) with dense peaks and power (open)

p20-gpt-oss

gpt-oss-120b as released (MXFP4 experts): 65 GB of weights, on one 80 GB H100 (open)

Runs entirely in your browser; nothing you type leaves this page.