Implement the cluster sizing formula
CodingBeginner⏱ 30 minAI Systemscapacity planningsizingkv cachebottleneck
Problem
Turn the sizing arithmetic into code that cannot be fudged.
concurrency_ceiling(kv_bytes, per_seq_bytes, efficiency)— how many sequences fit, rounding down.compute_ceiling(machine_intensity, bytes_per_param)— the batch at which weight-bound decode reaches the machine's compute-to-bandwidth ratio.replicas_needed(lam, W, rho_target, concurrency)— rounding up.binding_constraint(memory_ceiling, compute_ceiling_value)—'memory','compute'or'balanced'.
Then run the worked example: an 80 GB device with 28 GB of weights and 6 GB of workspace, 92% allocator efficiency, 640 MB per sequence, 900 requests per second, 5 s latency, 65% target utilisation.
Implement it, then check the implementation against something you can verify independently.
Write it
Solve it here7 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 30s · draft saved in this browser
7 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.
Hints
Hints — 0 of 2 revealed
Solution
Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.
Related problems
All problems| Solved | Problem | Field | Type | Difficulty | Time |
|---|---|---|---|---|---|
| KV cache sizing with MHA and GQA | LLM Ops | Numerical | 30 min | ||
| Size a serving cluster and find the binding constraint | AI Systems | Numerical | 1 hour | ||
| Build a serving capacity calculator run | LLM Ops | Coding | 3 hours |