Unit 11 of 12 · about 5 hours · implement, measure

Policy ablation, a negative regime and a bounded real-engine change

A policy that only ever wins in reports is untested. Ablations separate the mechanism from the hype, and a bounded engine change proves the simulator result transfers.

You'll be able to

  • Isolate one scheduling mechanism with ablations that freeze everything else, including the corpus.
  • Preserve a negative regime where the change loses and explain the shifted bottleneck from traces.
  • Implement one bounded policy change in a real engine with fallback and regression tests.

Covers

Policy ablation and negative regimeReal-engine bounded policy change
1

Read

In this order, only the parts listed

0 of 3 done

  1. Sarathi-Serve ablation of chunking and hybrid batchingSarathi-Serve: Tackling Throughput-Latency Tradeoffs in LLM Inference

    Section 5.4 (arXiv:2403.02310v3): Fig 14 chunked-prefill overhead against no chunking for Yi-34B, and Table 4 with hybrid-batching-only, chunked-prefills-only and combined TTFT and TBT over 128 requests at token budget 1024

  2. Continuous-batching baseline against optimized pairAI Systems Performance Engineering - Continuous Batching Lab

    baseline_continuous_batching.py against optimized_continuous_batching.py with the shared harness in compare.py, run as python -m ch15.compare under CPU-safe or single-GPU settings

    Skip the multigpu pair and the disaggregation and MoE targets in this unit. Re-measure on your hardware; the repo's bundled number is its result on its hardware, not your target.

  3. Bounded scheduler change in Nano-vLLMNano-vLLM - Scheduler, Block Manager and Engine Loop

    Fork nanovllm/engine/scheduler.py with llm_engine.py and block_manager.py: add event logging that explains every admit, chunk, preempt and finish transition, then implement one bounded admission or chunking change with regression tests

2

Focus on

  • Ablate one mechanism at a time with the corpus, seed, budgets and hardware frozen. The paper's three-way split of hybrid-only, chunked-only and combined is the template: each run differs by exactly one rule.
  • The negative regime is a deliverable, not an embarrassment. Name the workload where the change loses, show the trace, and explain the shifted bottleneck in overhead, memory pressure or tail cost.
  • Bound the engine change to one policy with a reference fallback and a versioned flag. Reviewers must be able to turn it off and get the old behavior with no stale state.
  • Diagnose transfer explicitly when the simulator and the engine disagree. Execution times, kernel shapes, cache reuse and host overhead are the usual suspects, and each one is checkable.
Common mistakes · 3
  • Sweeping every flag combination instead of isolating mechanisms. Combinatorial tuning attributes nothing; three runs that differ by one rule attribute everything.
  • Promoting a simulator win without an engine check. The simulator ranks policies under a coarse cost model, so the bounded engine run is the result, not a formality.
  • Dropping the negative regime from the write-up. A missing losing workload reads as an untested boundary, and the section checkpoint explicitly requires one win and one regression.
3

Try it yourself

Closed-book, before checking anything

Closed-book, write the three-run ablation plan for chunked prefill on a frozen mixed corpus: hybrid-batching-only, chunked-prefills-only, and combined. Predict the paper's direction on its hardware: hybrid-only has the lowest TTFT but keeps TBT stalls, chunked-only cuts TBT but stretches TTFT, and combined has the lowest TBT with TTFT between the two (Table 4). Then state your engine-change checklist: one flag, fallback to reference, regression tests, and per-request traces for both positions.
4

Quiz yourself

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

0 got · 0 missed

  1. 1.What makes Table 4 an ablation rather than a benchmark?Answer

    Same model, hardware, requests and budget across three runs that differ by exactly one mechanism each. The TTFT and TBT movements attribute to hybrid batching and chunking separately and combined.

  2. 2.Your chunking change wins in simulation and ties on the real engine. What do you check first?Answer

    Transfer gaps in order: real iteration times against modeled ones, kernel shapes in mixed batches, prefix-cache hit differences, and host and scheduling overhead per step.

  3. 3.What bounds a real-engine policy change?Answer

    One mechanism behind one flag with a reference fallback, regression tests that pin old behavior, and no stale state when toggled. Anything wider is a rewrite, not an experiment.

  4. 4.Why keep tuning traces separate from final traces?Answer

    Tuning on the final numbers overfits the policy to one corpus and hides variance. Tuning traces choose the setting; fresh final traces with the invariant checks report the result.

5

Practice

  • AI Systems Performance Engineering: continuous-batching pair

    Run baseline_continuous_batching.py against optimized_continuous_batching.py through python -m ch15.compare under CPU-safe or single-GPU settings

    Inspect the shared comparison contract first, re-measure rather than quoting the bundled number, and keep one workload where the optimized path does not win.

You're done when

Your ablation attributes a win and a regression to named mechanisms, and your bounded engine change toggles cleanly with regression tests green.

Only when you can do this without notes.

Leads to

Notes

Resources · 3 for this unit, 15 more in the section

Also in this section

  • Hands-On LLM Serving and Optimization - Chapter 6, batching and schedulingChi Wang and Peiheng Hu (O'Reilly) · primary

    Read "Request Batching and Scheduling-Level Optimizations" in Chapter 6: dynamic, continuous and chunked-prefill batching. Rebuild each policy in a small event simulator and state the user-visible metric it can improve or harm.

  • Orca: A Distributed Serving System for Transformer-Based Generative ModelsUSENIX OSDI · required

    Study iteration-level scheduling and selective batching, including the workload assumptions. Reproduce one scheduling timeline by hand and use it as the correctness baseline for the simulator.

  • AI Systems Performance Engineering - Chapters 16 and 18, scheduling and admissionChris Fregly (O'Reilly) · required

    Read "Dynamic Batching, Scheduling, and Routing" in Chapter 16 and "SLO-Aware Request Management and Fault Tolerance" in Chapter 18 (early rejection, quality of service).

  • Mini-SGLang - Scheduler and Overlap SchedulingSGLang Project · required

    Read docs/structures.md, scheduler implementation and tests/core/test_scheduler.py, then compare overlap scheduling with the Nano-vLLM loop. Use the online benchmark only after fixing the same workload and hardware contract.

  • TensorTonic Language Modeling from Scratch - Simulate Continuous Decode BatchingTensorTonic · support

    Solve after the continuous-batching unit, then compare its admission rule with your own simulator.

  • LLM Inference: From scratch, one token at a time - Module 05Tushar Amrit · support

    Work the Batching module's arithmetic and checkpoint before the static and continuous batching units.

  • LLM Inference Systems Laboratory - SchedulerRoadmap-Final · support

    Add token and memory admission, chunking, priority, cancellation, overload and fairness to the simulator, then carry one policy through the real engine path with a reference fallback.

  • vLLM v0.31.0 serve CLI and scheduler argumentsvLLM Project · reference

    Look up scheduler flags and defaults: --max-num-seqs, --max-num-batched-tokens, --max-num-active-seqs, --enable-chunked-prefill, --long-prefill-token-threshold and --scheduling-policy. Runtime defaults vary by GPU class, so check them against the installed v0.31.0 behavior.

  • vLLM v0.31.0 metrics designvLLM Project · reference

    Read the WAITING, RUNNING and PREEMPTED request states and the queue, inference, prefill and decode interval definitions. Swapped-preemption metrics are legacy in v1. The exported counters, including vllm:num_requests_waiting_by_reason and vllm:num_preemptions, are listed on the Production Metrics page, https://docs.vllm.ai/en/v0.31.0/usage/metrics/

  • vLLM v0.31.0 benchmark CLIvLLM Project · support

    Use vllm bench serve with --request-rate for offered-load sweeps, and vllm bench throughput and vllm bench latency for offline endpoint and phase baselines. Fix the dataset, lengths, request rate, warmup and sampling, and keep raw per-request results; do not copy example rates as targets.

  • vLLM v0.31.0 online servingvLLM Project · reference

    Read the /abort_requests endpoint and the Responses cancel API for request cancellation. Verify client-disconnect aborts on your engine; the page does not cover them.

  • vLLM v0.31.0 LoRA adaptersvLLM Project · reference

    Read per-request LoRARequest serving, server-wide --lora-modules with max_loras and max_lora_rank, and why adapter-slot pressure rewards grouping same-adapter requests.

  • vLLM v0.31.0 structured outputsvLLM Project · reference

    Read the xgrammar and guidance backends, the choice, regex, json, grammar and structural_tag options in StructuredOutputsParams, and the --structured-outputs-config.backend flag.

  • vLLM v0.31.0 multimodal inputsvLLM Project · reference

    Read limit_mm_per_prompt, content hashing with multi_modal_uuids in Cached Inputs, and the video pruning flags as examples of encoder-side scheduling cost.

  • TensorTonic Language Modeling from Scratch - Route Cache-Aware Prefill RequestsTensorTonic · support

    Solve after the affinity unit: assign each request to a feasible worker by longest cached prefix, lowest projected uncached load, greatest remaining capacity, then lowest worker id, with -1 when infeasible.