IIntroduction to AI Systems Performance EngineeringTechnical textbook
Chapter 20

Production Inference Systems

Optimize goodput, reliability, energy use, and cost

Define useful service outcomes, connect them to causal telemetry, provision constrained goodput with reserve, and keep overload and rollout behavior bounded.

A model service normally receives 70 requests each second and can complete 95 under its measured workload. One GPU replica fails while a traffic burst raises arrivals to 110 requests each second. Queue length grows, first-token latency exceeds its limit, clients retry timed-out calls, and retry traffic increases the overload. A dashboard that reports only GPU utilization or total tokens per second can look healthy while the fraction of useful requests falls.

Production evidence must connect the user-visible request to internal work. Service logs count offered, admitted, rejected, canceled, failed, and completed requests. Histograms report first-token and inter-token latency by request class. Scheduler counters report queue length and KV-block reserve. GPU metrics report model work, memory use, and power. Cost records attach accelerator, host, network, and idle-reserve expense to the same measurement interval.

Chapter 20 defines goodput as completed work that satisfies declared constraints per unit time. For example, request goodput can mean the number of requests per second that finish successfully, preserve required model quality, deliver the first token within one second, and keep subsequent token gaps below 80 milliseconds. The numerator is deliberately narrower than raw throughput because late, incorrect, or failed output consumed resources without meeting the service objective.

Each replica contains host central processing unit (CPU) processes and one or more graphics processing units (GPUs). Scheduler counters include free key-value (KV) blocks. Request metrics include time to first token (TTFT) and time per output token (TPOT). A service-level objective (SLO) converts those metrics into explicit success criteria before the operator calculates goodput or cost.

The chapter connects service-level objectives, observability, capacity planning, overload control, and rollout review. Each calculation names the request population, time window, measurement location, and completion condition. The final investigation asks whether a kernel or scheduler improvement changes useful service outcomes after traffic variation, replica loss, warm-up, cache behavior, and operating cost are included.

Prerequisites

  • Chapters 16–19
  • Latency percentiles and request outcomes
  • Basic cost and capacity accounting

Learning objectives

  • Define serving SLOs
  • Compute cost per useful output
  • Design observability and overload behavior
Lessons

Study this chapter

  1. 20.1
    SLOs and goodput

    Calculate goodput from throughput and service constraints

    Begin lesson →
  2. 20.2
    Inference observability

    Design signals that support causal diagnosis

    Begin lesson →
  3. 20.3
    Capacity and unit economics

    Compute cost from real occupancy and headroom

    Begin lesson →
  4. 20.4
    Overload, failure, and graceful degradation

    Keep overload bounded and recovery predictable

    Begin lesson →
  5. 20.5
    End-to-end performance review

    Evaluate a proposed change before rollout

    Begin lesson →
Chapter projects

Extended exercises

Complete these projects after the lesson-level practice tasks. Each project combines several mechanisms from the chapter.

01
Check

SLO sheet

Define success for two workload classes sharing one service.

Evidence: Per-class quality, latency, availability, and overload behavior.

02
Practice

Cost model

Build a fleet-weighted useful-token cost model from an operating curve.

Evidence: Sensitivity to utilization, headroom, failures, and traffic mix.

03
Challenge

Production review

Write an end-to-end review for one kernel, scheduler, quantization, or topology change.

Evidence: A complete mechanism/evidence/correctness/economics/rollback document.

References

Sources and further reading

The lesson explanations synthesize primary papers and official references. Follow the originals for proofs, exact APIs, architecture details, and version-sensitive behavior.

  1. MLPerf Inference Rules
  2. PagedAttention / vLLM
  3. SGLang
  4. NCCL RAS
  5. NVIDIA Nsight Systems User Guide

    Official reference for capturing and reading CPU, CUDA API, GPU workload, and communication timelines.