Simulate colocated versus disaggregated serving and compute goodput
CPU · your Macnotebook150 minrequiredGoal · A discrete-event simulator that serves the same request trace on 4 colocated GPUs and on 2 prefill plus 2 decode GPUs, and reports goodput under a TTFT and an ITL SLO.
- 1Model one GPU step as prefill_time = 0.04 ms per prompt token (chunked to at most 2048 tokens per step) plus decode_time = 15 ms plus 0.3 ms per running sequence; a colocated step runs both, a decode-pool step runs only decode.
- 2Generate 4000 requests with Poisson arrivals, log-normal prompt lengths (median 1500, p99 8000) and output lengths uniform in 64 to 512.
- 3Implement the colocated engine with continuous batching and chunked prefill, and the disaggregated engine where prefill GPUs finish a prompt, add a transfer delay of prompt_tokens multiplied by 320 KB divided by 50 GB/s, then hand the request to the least-loaded decode GPU.
- 4Record TTFT and every inter-token interval per request; define SLOs TTFT under 500 ms and ITL p99 under 50 ms per request.
- 5Sweep arrival rate from 1 to 12 requests per second; compute goodput (requests meeting both SLOs per second) and total throughput for both layouts.
- 6Plot goodput versus arrival rate for both, and ITL p99 versus arrival rate; mark the first rate at which each layout violates each SLO.
- 7Change the split to 1 prefill plus 3 decode and 3 prefill plus 1 decode; record how the best ratio depends on the prompt length distribution.
- Deliverable
- pd_sim.ipynb with the goodput plot, the ITL plot and a table of best prefill-to-decode ratio for median prompt lengths 500, 1500 and 4000.
- Check
- In the colocated layout the ITL SLO is violated at a lower arrival rate than the TTFT SLO; at the highest arrival rate where disaggregated still meets both SLOs, its goodput is at least 20 percent higher than colocated goodput at that rate; the best ratio shifts toward more prefill GPUs as median prompt length grows.