Memory
KV bytes per token = 2 x L x n_kv x d_head x bytes
per GPU = 2 x ceil(L / PP) x ceil(n_kv / TP) x d_head x bytes
weights = non-embedding params x bytes + embeddings x 2
budget = HBM x gpu-memory-utilization
KV pool = budget - weights/(TP x PP) - activations - runtime
sequences = floor(pool blocks / blocks per sequence)
Embeddings and the output head stay at 16 bit when the rest is quantized. Blocks are 16 tokens, as in vLLM. Parameter counts are derived from layers, hidden size, heads and FFN width, then checked against the published totals in the test suite.