Pidoku

Scheduling and Systems Research

Module 24 Lesson 24.h 1h Difficulty 4/5

Prerequisites 12.j, 14.j, 20.c, 20.k, 24.a


Before you start: words you need#

WordPlain meaning
SchedulerThe part of an engine that decides, every step, which requests run and how many tokens each gets (17.a).
Continuous batchingAdding and removing requests from the running batch at every step instead of waiting for a whole batch to finish (12.j).
DisaggregationRunning prefill and decode on separate GPU pools and moving the KV cache between them (14.j).
GoodputRequests per second that meet their latency targets. The number a scheduler should maximise.
SLOService-level objective: a latency target such as “time to first token under 1 s for 99% of requests” (23.a).
Session / agent workflowA chain of related model calls from one agent task, often with tool calls in between.
RolloutIn reinforcement learning, the model generating answers that are then scored and used to update it.
TraceA recording of real request timings and lengths, used to replay realistic load.

1. What is it?#

Systems research is about how inference is scheduled, stored and moved, not about the model’s maths. It has had the highest hit rate of any area for reaching production, because most of it is exact: it changes when and where work runs, never the output.

Technique (first paper)Status, November 2026
Continuous batching (Orca, 2022)ESTABLISHED, universal
Paged KV cache (PagedAttention, 2023)ESTABLISHED, universal
Chunked prefill (Sarathi, 2023–24)ESTABLISHED, default
Prefix caching with radix trees (SGLang, 2024)ESTABLISHED
Prefill/decode disaggregation (DistServe, Splitwise, Mooncake, 2024)ESTABLISHED at scale (Dynamo, llm-d, 21.j)
KV-aware routingESTABLISHED (21.h)
Agent- and session-aware schedulingEMERGING
Encoder and attention–FFN disaggregationEMERGING
Serving RL rolloutsEMERGING as a distinct workload
Accurate output-length predictionSPECULATIVE: still not good enough to rely on

Facts checked on 12 November 2026.


2. Why does it matter?#

The workload changed under the schedulers. SemiAnalysis’s AgentX benchmark, built from real agentic coding traces, has sessions with a median of 43 turns, median inputs of 142k tokens, median outputs of only 444 tokens, and over 96% prefix-cache hits. That is nothing like the “chat request in, answer out” workload the 2022–24 papers designed for. Most systems research in 2026 is about catching up with it.


3. Simple analogy#

An airport. 2022–24 research built the runways and the gates: planes land and leave continuously (continuous batching), gates are assigned flexibly (paging), passengers on the same route share a bus (prefix caching), arrivals and departures got separate runways (disaggregation). The 2026 problem is connecting flights: one traveller (an agent) takes forty short hops, each with a stop in between (tool calls). Do you hold their gate while they are away?


4. Tiny example: a 30k-token agent pauses for a tool call#

The agent’s KV cache is 2.75 GiB. On return, you can:

  • Keep it in GPU memory: no delay, but 2.75 GiB is blocked for the whole pause.
  • Park it in CPU memory: about 0.06 s to bring back.
  • Drop it and recompute: about 1.5 s.

For a 0.5 s tool call, recomputing triples the wait. For a 60 s tool call, it adds 2.5%. Section 6 computes the table. The research question is how to choose automatically, per session.


5. Technical explanation#

What is settled#

Continuous batching, paging, chunked prefill, prefix caching and fused kernels with CUDA graphs together account for most of the 10–30x between naive PyTorch serving and a production engine. Prefill/decode disaggregation, once the “emerging” item, is now routine for large deployments; the open question moved to when it pays at small scale (vLLM published a single-node case for it in April 2026).

Agent-aware scheduling (EMERGING)#

  • Keep or drop during tool calls. Continuum (ICLR 2026) pins a paused agent’s KV with a time-to-live chosen from reload cost and predicted tool time. MARS (2026) decides per session whether resuming warm shortens the critical path. SAGA (HPDC 2026) schedules a whole agent workflow as one unit; it measured coding agents spending about 38% of their time regenerating KV discarded during tool calls.
  • Conversation-level scheduling. ConServe (June 2026) treats the whole conversation, not the single turn, as the unit, and argues for observing sessions rather than predicting them.
  • Moving KV back. vLLM’s bi-directional KV transfer (October 2026) lets the prefill side pull the previous turn’s KV from the decode side; push-based transfer with NIXL starts sending KV before the decode side asks. Both cut time to first token for multi-turn traffic.
  • Engine features from the AgentX work (September 2026): session-sticky routing, session-aware cache retention with Mooncake offload, a cap on long prefills per step so they do not stall decodes, and aligned prefill timing across expert-parallel ranks.

Splitting the work further (EMERGING)#

  • Encoder disaggregation. Multimodal requests have an encoder stage (images, audio, video) before prefill. vLLM’s EPD (November 2026) runs it as its own pool. Reported results vary with load: on DeepSeek-V4.1-Flash on GB200, 6.6–9.5% more throughput per GPU and 44–47% lower p90 time to first token at concurrency 64–128, but worse at concurrency 16 and break-even at 32.
  • Attention–FFN disaggregation (24.f): ratio-sensitive, mixed results.
  • Specialised decode engines paired with a general prefill engine (vLLM with TileRT, July 2026), and different hardware for each phase (Groq 3 LPX beside Rubin, 7.k).

The pattern: every split helps at high load and hurts at low load, because the transfer cost is fixed and the gain grows with traffic.

RL rollouts as a workload (EMERGING)#

A large share of inference capacity at model labs generates rollouts for reinforcement learning. Requirements differ from user serving: very high throughput, fast weight updates pushed into running engines, and bitwise agreement between inference and training probabilities. vLLM, SGLang and RL frameworks shipped “zero-mismatch” and asynchronous RL modes in 2026 (24.j).

Multi-model serving#

OSDI 2026’s Prism shares GPU memory between several models by “ballooning” each one’s memory up and down with demand. Semantic routers that pick a model per request are in production (21.k).

What is open#

  1. Scheduling without knowing lengths. Output length is unknown at admission. A good predictor would improve admission, ordering, memory reservation and SLO attainment. None is accurate enough on real traffic; reasoning models made it worse.
  2. Goodput as the objective. DistServe framed it; most production schedulers still optimise simpler proxies. OSDI 2026’s “Simple Is Better” (Alibaba, deployed) argues for simple policies that are robust, a useful counterweight.
  3. Fairness with very unequal requests. Fair queueing assumes similar work units; LLM requests differ by 1,000x (21.f).
  4. Search-aware scheduling. When one user request fans out into many parallel reasoning branches, the scheduler should know they belong together and stop losers early (24.e).

How to judge a systems paper#

GoodWarning sign
Several tuned baselines at a stated engine versionUntuned or year-old vLLM
Real traces or realistic replays (AgentX, production logs)Fixed lengths, synthetic only
Open-loop arrivals with a rate sweepClosed-loop load generator
Goodput at stated SLOsThroughput with no latency
Ablations per componentOne end-to-end number

Engineering beats research more often here#

vLLM’s V1 rewrite and Model Runner V2, TensorRT-LLM’s kernel selection, small-message all-reduce (9.f) and CUDA-graph integration are not papers, and each delivered large gains. In 2026, coding agents also write and tune kernels for each new model, with correctness tests as guard rails. An engineer who profiles a real system and fixes what they find (13.a, 22.a) often delivers more than one who implements the newest paper.


6. Under the hood: keep, park or recompute#

Go
// toolpause.go — an agent pauses for a tool call. Keep its KV cache, park it, or drop it?
package main

import "fmt"

func main() {
	const (
		contextTokens = 30_000
		kvKiB         = 96.0     // per token (GQA-8, FP8)
		prefillTokS   = 20_000.0 // recompute speed on this replica
		hostGBs       = 50.0     // GPU↔CPU copy speed (PCIe Gen5, realistic)
	)
	kvGiB := contextTokens * kvKiB / (1 << 20)
	reload := kvGiB * 1.074 / hostGBs // GiB → GB
	recompute := contextTokens / prefillTokS
	fmt.Printf("KV cache %.2f GiB | resume delay: keep 0 s, park in CPU %.2f s, recompute %.2f s\n\n",
		kvGiB, reload, recompute)
	fmt.Println("tool pause   HBM held if kept   wait added by park   wait added by recompute")
	for _, pause := range []float64{0.5, 2, 10, 60} {
		fmt.Printf("%7.1f s   %10.1f GiB·s   %17.0f%%   %21.0f%%\n",
			pause, kvGiB*pause, 100*reload/pause, 100*recompute/pause)
	}
}

Output:

KV cache 2.75 GiB | resume delay: keep 0 s, park in CPU 0.06 s, recompute 1.50 s

tool pause   HBM held if kept   wait added by park   wait added by recompute
    0.5 s          1.4 GiB·s                  12%                     300%
    2.0 s          5.5 GiB·s                   3%                      75%
   10.0 s         27.5 GiB·s                   1%                      15%
   60.0 s        164.8 GiB·s                   0%                       2%

How to read it:

  • Short pauses: keep the KV on the GPU. Parking costs little but is not free; recomputing is terrible.
  • Medium pauses: park in CPU memory. This is what TTL policies and session-aware offload automate.
  • Long pauses: dropping is acceptable for this one request, but every recompute also burns 1.5 s of the replica’s prefill capacity that other users needed.
  • Real policies also need CPU memory to be free, and must guess the pause length before it ends.

7. Performance implications#

  • For agent traffic, time to first token is set mostly by where the previous turn’s KV is.
  • Every split of the pipeline adds a transfer; it pays only above some load.
  • Long reasoning outputs occupy decode slots for minutes; Little’s law (2.c, 23.b) with a large service time means fewer, longer-lived requests and less room to absorb bursts.

8. Production implications#

  • Measure your own traffic: turns per session, tool-call durations, prefix-hit rate, input/output length distributions. Pick policies from that, not from chat-era defaults.
  • Use session-sticky or KV-aware routing for agents (21.h).
  • Enable disaggregation, encoder pools or AFD only after measuring at your concurrency; all three have published break-even points.
  • If you serve RL rollouts, treat them as a separate tenant with throughput SLOs and pinned kernels.

9. Common mistakes#

  1. Benchmarking an agent platform with single-turn chat prompts.
  2. Dropping KV the moment a request pauses.
  3. Adding a disaggregation layer at low traffic and getting slower.
  4. Trusting a length predictor without checking its error on your own logs.
  5. Comparing against an untuned baseline engine.
  6. Reporting throughput without the latency it was measured at.

10. Hands-on exercise#

  1. Run toolpause.go. Change hostGBs to 450 (NVLink-C2C on Grace Hopper). At what pause length does parking stop mattering at all?
  2. Ablate a production engine one feature at a time (continuous batching, prefix caching, chunked prefill, CUDA graphs) on a realistic trace. Rank the features by goodput gained.
  3. Replay a multi-turn agent trace with and without session-sticky routing. Compare p90 time to first token.
  4. Build an output-length predictor from your logs. What is its median error, and would it help a shortest-job-first scheduler?
  5. Apply the systems-paper table in section 5 to one OSDI 2026 serving paper.

11. Interview questions#

  1. Why have systems papers reached production more often than approximation papers?
  2. How does agent traffic differ from chat traffic, and what does that change in the scheduler?
  3. Should a server keep an agent’s KV cache during a tool call? How would you decide?
  4. Why do disaggregation, encoder pools and AFD each have a break-even load?
  5. What makes output-length prediction hard, and why do reasoning models make it harder?
  6. What is different about serving RL rollouts compared with user traffic?

12. Further reading#

Checked on 12 November 2026.

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in