Inference discussions tend to start with kernels. The course's view of the engine starts one level up: scheduling and memory ownership decide whether optimized kernels stay useful.
What the engine is made of
The request processor validates and tokenizes work. A scheduler selects prefills, decodes, preemptions and admissions under token and sequence budgets. A block manager allocates KV state. Model executors run kernels across local or distributed workers. Sampling and output processors turn logits into events, and metrics and health surfaces expose the lifecycle. Some engines combine these roles in one process, and production platforms may separate routers and worker pools.
One request, from start to finish
The course traces a request called r17:
request r17: VALIDATED -> QUEUED(class=interactive, prompt=2,048)
scheduler: ADMITTED(token_budget=4,096, kv_blocks=reserved)
executor: PREFILL -> DECODE(step=1..63)
client: CANCELLED(after token 23)
engine: STOP_SCHEDULING -> RELEASE_KV -> FINAL(cancelled)
Invariant: after FINAL, r17 owns no queue slot, KV block, adapter
reference, stream buffer, or billable generation reservation.
The client leaves after token 23. From that moment the engine has to stop scheduling the request and release its KV blocks, and only then reach its final state.
Mental Model
Every request borrows state from the engine: a queue slot, KV blocks, an adapter reference, a stream buffer and a billable reservation. A terminal event is the moment the loan must be repaid in full.
Test the exits, not only the happy path
A fast kernel cannot repair a lifecycle that leaks state after cancellation. So during evaluation, force every terminal path: completion, validation failure, timeout, worker loss and disconnect. For each one, verify the same ownership invariant.
The course also says to evaluate an engine on more than speed: supported models and hardware, correctness, scheduling policy, memory behavior, distributed execution, structured output, observability, upgrade stability and operational fit. Benchmark defaults are not architecture, and engine configuration should be pinned and treated as a release artifact, because scheduler or kernel changes can alter quality, latency and memory behavior.


