Skip to content
ImagineWorld

Appendix D: Hardware and Cost Reference

node_idnode-book_building-frontier-llm-from-scratch_appendix-d-hardware-and-cost-reference
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_titleAppendix D: Hardware and Cost Reference
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Appendix D — Hardware and Cost Reference

Approximate figures for reasoning about memory, compute, and cost. Hardware specifications are order-of-magnitude and vary by exact model and precision; use them for estimation, not procurement.

GPUMemoryMem. bandwidthNote
A10040 / 80 GB~2.0 TB/sprior-generation workhorse
H100 / H80080 GB~3.4 TB/sH800 = bandwidth-limited H100
H200141 GB~4.8 TB/smore memory for long context
Blackwell (B200)~192 GB~8 TB/scurrent generation

Table D.1 — Data-center GPU snapshot (approximate)

Memory budgeting

For training, the dominant memory costs per parameter are: the weights, the gradients, and the optimizer state. With AdamW (two state tensors) and mixed precision, a rough rule is that training needs on the order of 16 bytes per parameter (FP32 master weights + FP32 Adam moments), before activations and the KV cache. This is why a model that runs for inference in a few bytes per parameter needs many times that to train, and why the parallelism of Chapter 19 is unavoidable at scale. For inference, memory is roughly the quantized weight size (e.g., ~0.5 byte/param at 4-bit) plus the KV cache, whose per-token size MLA exists to minimize.

Use~Bytes / paramComposition
Training (AdamW, mixed)~16FP32 weights + 2 FP32 moments (+ activations, cache)
Inference (FP16)2weights only (+ KV cache)
Inference (INT4)~0.54-bit weights (+ KV cache)

Table D.2 — Bytes per parameter, by use

Compute and cost

Training compute follows the rule from Chapter 20: about 6ND floating-point operations for N active parameters and d tokens. Dividing by the achieved throughput (peak FLOP/s × number of PUs × MFU, with MFU ~0.3–0.5) gives the GPU-time, and multiplying by the hourly price gives the cost. As a reference point, eepSeek-V3 reported roughly 2.79 million H800 GPU-hours 5.6Mat5.6M at 2/GPU-hour) for a 671B/37B-active model on 14.8T ens — a useful anchor for scaling estimates down to a smaller id.

Reference Tables: Hardware, Memory, and Cost

The numbers below let you size a run before committing to it. Accelerator specifications are approximate and move with each hardware generation; treat them as orders of magnitude, and confirm current figures against the vendor’s data sheet.

AcceleratorMemoryBF16 dense (approx.)
NVIDIA A10040 / 80 GB~312 TFLOP/s
NVIDIA H100 (SXM)80 GB~990 TFLOP/s
NVIDIA H200141 GB~990 TFLOP/s

Table D.1 — Common training accelerators (approximate)

ComponentBytes / paramWhy
Weights (BF16)2the model itself
Master weights (FP32)4absorb tiny updates (18.7)
Gradients (BF16)2one per parameter
Adam m (FP32)4first moment (17.9)
Adam v (FP32)4second moment (17.9)
Total~16before activations

Table D.2 — Training memory per parameter (AdamW, mixed precision)

The rule of thumb that falls out of Table D.2 is roughly 16 bytes per parameter to train, before activation memory. A 1-billion-parameter model therefore needs about 16 GB just for state — which is why even modest models are trained with the optimizer-state sharding of Chapter 19, and why activation checkpointing is used to trade compute for the memory the table does not even count.

ComponentFormula
Weightsparams × bytes (2 BF16, 1 INT8, 0.5 INT4)
KV cache2 × layers × kv_heads × head_dim × seq × batch × bytes

Table D.3 — Inference memory components

QuantityEstimate
Training FLOPs≈ 6 × params × tokens
Wall-clock timeFLOPs / (GPUs × peak × MFU)
Dollar costGPU-hours × hourly rate

Table D.4 — Back-of-envelope cost estimate

Size before you spend Two rules carry most budgeting: ~16 bytes per parameter to train, and ~6 × params × tokens FLOPs to do it. Divide the FLOPs by your cluster’s realistic throughput (peak × MFU) and you have the time and the bill before you launch a single step.

Reference: Parallelism Strategies

The forms of parallelism in Chapter 19 are easy to confuse because they all “split the model across devices” in different senses. This table fixes what each one actually splits, and what it costs.

StrategySplitsMain cost
Data parallel (DP)the batch (model replicated)gradient all-reduce each step
Tensor parallel (TP)individual layers, across hidden dimcommunication within each layer
Pipeline parallel (PP)layers into sequential stagesthe pipeline bubble
Expert parallel (EP)MoE experts across devicesall-to-all routing traffic
Sequence parallel (SP)replicated regions, across tokensextra layout conversions
ZeRO / FSDPoptimizer state, grads, paramsgather/scatter of shards

Table D.5 — The forms of parallelism at a glance

Real frontier training combines several of these at once — a model might be tensor- parallel within a node, pipeline-parallel across nodes, expert-parallel for its MoE layers, and data-parallel over the whole arrangement, with ZeRO sharding the optimizer state on top. This composition, “3D” (or more) parallelism, is what lets a model far larger than any single GPU’s memory train across a cluster, and orchestrating it well — balancing each form’s communication cost against the others — is among the central crafts of the systems work in Chapter 19.