7/11
Part 5 of 7 · ServingLearn and do
Serving splits a model for memory, and tensor parallelism for speed
Serving has no gradients or optimizer states, only weights and the KV cache. The latency lesson showed that each decode step reads all the weights, so splitting them with tensor parallelism also cuts what each GPU reads per step.
# bf16
weights = 70e9 * 2
for tp in (2, 4, 8):
per_gpu = weights / tp
print(f"TP {tp}: {per_gpu / 1e9:4.1f} GB of weights a GPU, {80 - per_gpu / 1e9:4.1f} GB left, {per_gpu / 3.35e12 * 1000:4.1f} ms to read them")
TP 2 already fits the 140 GB of weights on two GPUs. Why serve on 4 or 8?
Pick one to see what it prints.
Pick an answer above to see the rest