Unit 11 of 11 · about 6 hours · implement, measure

A topology and capacity simulator, evidence labels and cost comparison

A simulator can rank plans only within its assumptions. Plausible latency samples are not measured cluster evidence, and omitted queues or ownership constraints can make an infeasible placement look best.

You'll be able to

  • Implement deterministic replay with rank memory, phase queues, shared links and bounded KV handoff ownership.
  • Label analytical, simulated and measured evidence separately, and validate simulator predictions against independent oracles.
  • Compare colocated and disaggregated plans by SLO-qualified goodput, utilization, KV traffic and cost under the same arrivals and resource budget.

Covers

Topology and capacity simulatorMeasured versus simulated evidence labelsGoodput, utilization, KV traffic and cost comparison
1

Read

In this order, only the parts listed

0 of 2 done

  1. Audit a lightweight placement modelAI Systems Performance Engineering companion code - Chapters 15 and 17

    PlacementConfig, PlacementMetrics and PlacementSimulator: simulate, _prefill_latency_ms, _decode_latency_ms, _kv_transfer_ms and _allreduce_ms

    Read and exercise the CPU path only. Its returned TTFT excludes its computed prefill collective cost. Its KV formula omits layer/head geometry, and it has no arrival queues or local memory admission. Restore these terms in your model before comparing capacity; its bandwidth names and comments also need an explicit bits/s versus bytes/s and direction convention.

  2. Calibrated service models and placement evidenceDistServe: Disaggregating Prefill and Decoding for Goodput-Optimized LLM Serving

    arXiv:2401.09670v3, Appendix A.1 to A.3 Latency Model for LLM Inference; Section 4.1, Simulator building paragraph; Section 6.4 Ablation Studies, Simulator accuracy paragraph and Table 2

    Read how profiling fits phase coefficients and how prediction error is evaluated. Do not reuse its OPT/A100 coefficients or universalize its kernel-bound classifications. A fitted service model still needs queue, topology and memory validation for your workload.

2

Focus on

  • Build on A continuous-batching simulator with deterministic replay and event traces, and Communication measurement contracts and analytical or CPU simulation. Add rank ownership, topology links, phase transfer credits and attempt-fenced terminal events rather than reimplementing those foundations.
  • Replay an immutable arrival trace through equal-budget plans. Log offered, admitted, rejected, failed, retried and completed requests, phase waiting, TTFT, decode gaps and peak per-rank KV. Count one logical completion even when attempts repeat.
  • Use a declared observation window and completion policy. Goodput counts only accepted completions meeting the quality and latency contract per elapsed second. Utilization is resource busy time over available time, not a sum of request latencies; cost per good completion includes idle reserve, failed work and retries.
  • Label formula results analytical, event-model outputs simulated and actual device observations measured. A CPU simulator's wall-clock runtime is not GPU service latency. If you calibrate on your GPU, record the model, dtype, engine/version and shapes, validate on held-out shapes, and keep multi-device extrapolations simulated.
Common mistakes · 3
  • Calling synthetic percentile outputs measured tail latency. Independent length samples without arrival queues cannot reveal queueing tails or saturation.
  • Using the sum of request service times as elapsed benchmark time when requests overlap. Goodput and cost need a common observation window.
  • Removing rejected or failed work from the offered-load denominator, counting retries as new successes, or comparing plans with different warm reserve and device cost.
3

Try it yourself

Closed-book, before checking anything

On CPU, replay three requests arriving at 0, 1 and 2 ms through one FIFO synthetic server with fixed 2 ms service, no batching and unlimited memory. Recover completion times 2, 4 and 6 ms and response times 2, 3 and 4 ms. With a response-time SLO of at most 3 ms, a window from 0 to 6 ms including its endpoint, and all outputs accepted, goodput is two completions per 0.006 s and utilization is 100 percent. Repeat with an admission limit of one resident request, counting active plus waiting requests: reject the 1 ms arrival, process completion before arrival at 2 ms, and complete the others at 2 and 4 ms. Keep the same 6 ms window; goodput stays the same while utilization becomes two thirds. Charge both runs the same synthetic server price per elapsed second, including idle time. Then audit the companion model's missing prefill collective and KV geometry against the earlier hand ledgers.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Why does the admission-limited replay have the same goodput but lower utilization?Answer

    Both runs have two SLO-qualified completions in the same 6 ms window. The unlimited run spends 6 ms serving three requests, including one late completion; the limited run serves two requests for 4 ms and rejects the other.

  2. 2.Does matching one isolated-request latency validate capacity predictions?Answer

    No. Capacity also depends on batching, arrivals, shared resources, memory admission and ownership. Validate those constraints and held-out workload mixtures separately.

  3. 3.Can a fitted single-GPU service curve make a cross-node comparison measured evidence?Answer

    No. Only the calibration observations are measured. Unobserved collective, transfer and contention behavior remains analytical or simulated, with its assumptions stated.

  4. 4.What should happen when a placement violates one rank's KV budget?Answer

    Reject the placement or simulate its declared admission, eviction or preemption policy. Do not report its unconstrained latency as feasible capacity.

You're done when

Your replay matches the hand timelines and resource ledgers, infeasible plans cannot win, and your equal-budget comparison separates simulated predictions from measurements and includes a negative regime.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 11 more in the section

Also in this section