ML Interview Notes
29 min read7 sections
The Inference Engineering Course

Progress log

Current correction and validation scope

Reviewed locally on 2026-09-07. The correction pass repairs instructional arithmetic, assumptions, source-summary contradictions and selected lab parsers. It does not certify every pinned upstream quotation or mark the GPU labs executed. The older narrative below is retained as an archive.

Evidence classLocal evidenceWhat closes the remaining work
Instructional correctionsWorked equations, diagrams, answers and reference sheets reconciled; CPU reference suites supplied.Keep owning chapters and reference checks in agreement as material changes.
Unexecuted hardware labsAll 13 scripts start with --help; selected arithmetic and parser paths tested without an engine.Run each protocol on declared hardware with exact environment/model pins and retain raw logs, traces, failures and repeated timing results.
External source unavailableSource pins retained; wrappers distinguished from external kernel/transport implementations.Obtain matching dependency sources and inspect the specific behavior. A wrapper citation alone is insufficient.
Unresolved runtime behaviorUnverified callouts remain beside version-sensitive or untested paths.Reproduce the path with a minimal fixture, actual backend selection and observable outputs.
Documentation discrepancyConfirmed internal inconsistencies repaired; historical flags retained as historical evidence.Compare documentation, source and behavior at the same version; record the exact resolution rather than silently assuming one is authoritative.

The historical count of 48 flags below has not been recertified as a current issue count. The categories above explain different closure requirements; they do not assert those 48 items are resolved.

python site/build.py
python site/test_build.py
python site/test_presentation.py
python site/test_inference_references.py
python content/courses/inference/html/labs/cpu_checks.py
python content/courses/inference/html/labs/quant_parallel_checks.py
python site/check_inference_citations.py

Commands run from the repository root. The citation inventory reports missing checkouts and unresolved engine ownership explicitly. Range existence is not quotation or semantic verification.

The resumable-pipeline state file. This book is too large for one context window, so every session starts by reading this page and the Outline, and ends by appending to the log below.

70 / 70
Chapters drafted
13 / 13
Labs written
70
Chapters with pinned citations
14
Parts
48
Historical unresolved flags
7
Original-project checkers
Imported historical snapshot, not live verification

The counts and session narrative below were imported from the original course project. Its manifest and seven-check toolchain are not included here and these counts are not regenerated by this site's build. Source-pinned means a citation names an edition, not that every claim or lab was independently executed. The current checkout uses site/build.py, site/test_build.py, site/test_presentation.py, and labs/cpu_checks.py. GPU measurements and complete upstream quotation verification remain outstanding.

§1

Archived authoring protocol

Followed at the start and end of every session. Deviating from it is how a book ends up describing three different versions of the scheduler.

At the start of a phase

  1. Read this page and OUTLINE to reload state. Do not rely on memory of code from a previous session.
  2. Confirm both repos are still at the pinned SHAs. tools/verify_citations.py checks this first and refuses to run if either has moved.
  3. Pick up at the first chapter whose status is TODO.

Per chapter

  1. Read tools/AUTHORING.md — the citation contract, fragment format, allowed CSS, mandatory chapter shape, diagram markup, and forbidden patterns.
  2. Re-read the relevant source files in this session. Every citation must come from a file actually opened now, quoted from sed -n output rather than retyped.
  3. Write the fragment into src/<part>/<chapter>.html.
  4. Set status in tools/manifest.json: TODODRAFTVERIFIED.
  5. Add new terms to GLOSSARY and new formulas to FORMULAS in the same session — never defer these to the end.

The seven checks — all must pass before a part is closed

from the book rootshell
python3 tools/build_book.py         # regenerate every page from src/ + manifest
python3 tools/verify_citations.py   # every cited path exists, every line range is in range
python3 tools/check_links.py        # cross-chapter links and anchors resolve
python3 tools/check_symbols.py      # named flags and env vars still exist in the pinned source
MERMAID_MODULES=<scratch>/node_modules node tools/check_diagrams.mjs   # every diagram renders

check_diagrams.mjs needs a scratch npm i mermaid@11 @mermaid-js/layout-elk puppeteer; it renders every diagram through headless Chrome with the book's own theme and also warns when one exceeds fifteen nodes. A Mermaid parse error is otherwise invisible until a reader opens the page.

At the end of a part

  1. Run all seven checks.
  2. Run a contradiction pass. The mechanical checks cannot catch two chapters describing the same subsystem differently — read the part's chapters against each other and against their neighbours. This has caught real defects twice.
  3. Append a log entry below, and add every raised Unverified flag to the table at the bottom.
  4. Stop and summarise. Do not continue silently into the next part.
§2

Session log

Newest first
DatePhase What happenedLeft open
2026-08-24 Phase 2
book drafted end to end

Parts 5–13 finished, taking the book to 70 of 70 chapters. The labs were wired into the build — a lab fragment at src/labs/<slug>.html now builds to labs/<slug>/README.html beside its run.py — and written.

The citation audit. A chapter author found a fabricated citation in its own draft — a code block assembled from HTML line numbers rather than from source — and recommended folding a text diff into the checkers. That became check_quotes.py, and its first run over the finished book found 156 quoted blocks that did not match the lines they cited. Most were ranges one or two lines short of the passage. The tail was not: an invented comment inserted into quoted code, a command with <number-of-GPUs> silently replaced by 8, a reworded docstring, and a line asserting a variable (expert_start_loc) that appears nowhere near the lines it was attributed to. Every one had passed verify_citations.py, which only ever proved the range existed. All 156 are resolved.

Checkers gained or hardened: check_quotes.py (new), check_structure.py (new — per-chapter diagram, exercises, answers, takeaways, per-engine citations), check_forward_refs.py (new, advisory). Three false-positive classes were fixed: the citation verifier read internal hrefs as source paths, the symbol checker read ALL-CAPS filenames as environment variables, and both resolvers sent every docs/ and examples/ path to vLLM, which had made SGLang's docs uncitable.

Made self-maintaining: the counts on this page, and the table of every Unverified flag in the book, are now generated from the manifest and from src/ at build time. The counts had drifted to “25 / 70” while the book passed sixty chapters, and the flag table listed four of what are now forty.

Corrections that crossed chapters: 02-04 gained a liveness callout — it reads radix_cache.py, but SGLang instantiates UnifiedRadixCache, a sibling class rather than a subclass. 11-05 gained the cross-engine registry inversion: vLLM's model registry overwrites a duplicate behind a logger.debug where SGLang's raises — the opposite of how the two projects treat their connector and attention registries. 10-03 named an environment variable and a benchmark flag that no longer exist at the pinned SHA.

One reported defect was not real: an author reported that 08-02 understated a claim about SGLang's compile path, but 08-02 already made the stronger claim, with the citation. Subagent findings get verified before they are acted on.

Then the VERIFIED pass. Seven auditors, two parts each, none auditing a chapter it had written. Every chapter re-read against the pinned source; every derived figure recomputed; every “this is what runs” claim checked against the real default. All 70 chapters passed, after roughly 200 fixes. The three recurring classes were liveness (the legacy vLLM model runner presented as live in eight chapters, and once listed among the dead branches), unit mixing (GiB against decimal GB, which produced four different KV pools for one machine), and one derivation that assumed its own conclusion (§10.3's 25 req/s, actually 14.2). Two chapters described features that do not exist. Three agent reports were checked and rejected as false positives before anything was changed on them.

Nothing blocking. The VERIFIED pass completed in the same session: seven auditors, one per pair of parts, none reviewing a chapter they wrote. ~200 defects fixed. Remaining softness is named on this page: the labs are written but were never executed, and 48 Unverified flags stand, each naming what was searched.
2026-08-21 Phase 1
Parts 0–1 drafted

All eleven chapters of Part 0 (Foundations) and Part 1 (The core serving loop) drafted from source, in parallel, each by an agent working against tools/AUTHORING.md. Roughly 450 citations, all resolving at the pinned SHAs; every diagram render-checked.

Outline expanded 67 → 70 chapters on the owner's instruction to cover contested topics in full rather than in passing: 01-06 (P/D disaggregation), 06-06 (the speculative decoding zoo), 10-04 (batch invariance) are new; 01-05 narrowed to chunked prefill alone.

Reference hardware fixed book-wide by 00-04 and adopted by every later chapter: H100 SXM, 989.4 TFLOP/s dense bf16, 3.35 TB/s HBM, ridge I* = 295 FLOP/byte. Llama-3-8B KV is 128 KiB/token, agreed independently by 00-01, 00-02 and 02-03.

Tooling added: tools/check_diagrams.mjs (headless render of every diagram); tools/verify_citations.py scoped to chapter fragments only, after it produced false positives against prose on the meta pages.

Part 2 drafting. Glossary and formula sheet to be topped up from Part 2's reports. Four unverified flags open (table below).
2026-08-21 Phase 0
recon and plan
Cloned and pinned both repositories; recorded SHAs, commit dates, and distance from the nearest release tag in SOURCES. Mapped both trees and verified 57 candidate source paths existed before putting any of them in the outline. Wrote the build system (manifest + fragment builder + shared stylesheet) and the front-door, outline, sources, glossary, formulas and labs pages. Outline approved with three expansions; drafting authorised.
§3

Archived source-project audit

Historical claim, not current execution evidence

All 70 of 70 chapters are VERIFIED, and all 13 of 13 labs are drafted. Every chapter has been re-read against the pinned source by an auditor who did not write it, with each claim checked against the code beside it, every derived figure recomputed, and every “this is what runs” claim tested against the actual default.

The audit found roughly 200 substantive defects across the fourteen parts and fixed them. None of them were things a checker could catch: arithmetic that was wrong beside a citation that resolved, prose that described code correctly quoted next to it, and dead or non-default code presented as the live path. Two chapters described features that do not exist — a watchdog fault injector, and a variable asserted at lines where it never appears.

What the audit changed, in one paragraph

Three defect classes recurred often enough to be worth naming. Liveness was the worst: eight chapters presented vLLM's legacy model runner as the live path when V2 is the default for every dense model, and one listed the V2 branch among the dead ones — the exact inversion. Unit mixing was the most insidious: an “80 GB” H100 is 79.65 GiB, and expressions that mixed GiB with decimal GB produced four different KV-pool figures for the same machine across four chapters, each internally plausible. Assuming the conclusion was the subtlest: §10.3 derived serving capacity by charging a batch of 64 requests one request's prefill, then used Little's Law to recover a throughput that the assumed residence time already implied — 25 req/s where the honest figure is 14.2.

What the citation audit changed

A checker that only proves a cited range exists proves much less than it appears to. check_quotes.py was added to re-read every cited range and diff it against the quoted text, and the first full run over the finished chapters found 156 blocks whose quote did not match its citation. Most were ranges one or two lines short of the passage. The tail was not: a comment invented and inserted into quoted code; a command with <number-of-GPUs> silently replaced by 8; a docstring reworded; and a line asserting a variable (expert_start_loc) that appears nowhere near the lines it was attributed to. Every one of those passed verify_citations.py.

All 156 are resolved — 93 ranges corrected automatically, the rest by hand — and the checker now understands the book's legitimate conventions (descriptive elisions, shorthand second ranges, composite blocks quoting two files, re-wrapped markdown prose, ASCII-folded typography). The rule that prevents the whole class: generate quotes from sed output; never type them.

Original-project commands (not available in this checkout)

reload state and confirm nothing has driftedshell
cd ~/Documents/knowledge/inference_vllm_sglang
python3 tools/verify_citations.py    # also refuses to run if either repo has moved off its pin
python3 tools/check_quotes.py        # quoted text vs the lines it cites
python3 tools/check_links.py
python3 tools/check_structure.py     # per-chapter diagram/exercise/citation contract
python3 tools/check_symbols.py       # slow: greps both trees

The seven checks

ToolWhat it catches that the others cannot
build_book.pyRegenerates every page from src/ + the manifest. Fragments are the source; generated pages are overwritten.
verify_citations.pyCited path exists and the line range is inside the file, at the pinned SHA. Refuses to run if either checkout has moved.
check_links.pyCross-chapter links resolved against the page's built location, and anchors that do not exist.
check_diagrams.mjsEvery Mermaid diagram actually renders in headless Chrome. Needs a scratch npm i mermaid@11 @mermaid-js/layout-elk puppeteer and MERMAID_MODULES=….
check_quotes.pyThat the quoted text actually matches the lines cited. This is the check verify_citations.py cannot do, and the one that found real fabrication. Understands elisions, multi-range and composite citations, markdown re-wrapping, and typographic folding; --fix repairs a range that is merely too narrow.
check_structure.pyThat every chapter still carries at least one diagram, three exercises with answers, a key-takeaways section, and a citation into each engine it covers. These are the first things a late trim silently removes.
check_symbols.pyCLI flags and env vars named in the book that no longer exist in either repo. Advisory — the book legitimately names removed symbols when describing history.

Known cleanup, not yet done

  • Fourteen flowcharts exceed the fifteen-node guideline, the largest at 21. All were checked: each is a vertical decision flow with a maximum out-degree of 2, not a dense graph, so they read top-to-bottom without trouble. Left as they are deliberately — the guideline targets undifferentiated blobs, and redrawing working figures to satisfy it in letter would be churn.
  • This older TODO predated the source project's later review described above. It is retained as history, not a current assertion that all chapters are drafts. The local correction pass must still distinguish source inspection, CPU tests and GPU execution.
  • Several chapters ran long (4,500–6,100 words against a 4,000 guideline). Each author flagged it and named what to cut; none padded. Decide whether to trim or to raise the guideline.
  • Unclaimed subtrees noted by chapter authors: SGLang's disaggregation/encoder/ (~8k lines) → 07-04; disaggregation/ascend/05-05 or 13-01; vLLM's RSWASpec / ChunkedLocalAttentionSpec / SlidingWindowMLASpec → a Part 7 chapter.

Cross-chapter contradiction is the real risk

Chapters are written in parallel by separate agents, so the failure mode is not a bad citation — the checks catch those — but two chapters describing the same subsystem differently. It has happened twice and both times a sibling chapter caught it: 03-03 used an environment variable 03-04 had proven was deleted, and 02-06 documented a class 02-04 showed is never constructed. Budget a contradiction pass at the end of every part, not just the mechanical checks.

§4

Where the code has moved away from its own documentation

Findings from Parts 0–1 that invalidate widely-repeated descriptions of these systems. Each was read at the pinned SHA this session. They are recorded here because later parts must not contradict them, and because they are the clearest evidence that this book had to be written from source rather than from papers and blog posts.

FindingEvidence at the pinned SHA Chapters affected
vLLM has deleted the PagedAttention CUDA kernel csrc/attention/ now holds only dtype headers. The kernel moved to csrc/libtorch_stable/attention/ in PR #43717 and was removed in commit d715b3aa1e, "Delete PagedAttention (#47361)". On CUDA, attention dispatches to FlashAttention / FlashInfer / Triton; only csrc/rocm/attention.cu survives. PagedAttention endures as a memory-management design — block table, block pool, slot mapping — not a kernel. 00-03, 02-02, 03-01, 03-03, 11-04
vLLM V1 has dropped KV swapping entirely No PreemptionMode, no swap_out, no swap_space anywhere under vllm/v1/. _preempt_request is unconditionally recompute. SGLang keeps host offload for exactly one case — disaggregation_mode == "decode", where recompute is structurally impossible. 01-04, 02-06
Both benchmark entry points are deprecation shims benchmarks/benchmark_serving.py is 17 lines and exits 1; python/sglang/bench_serving.py is 22 lines and warns. The implementations are vllm/benchmarks/serve.py (2,368 lines) and python/sglang/benchmark/serving.py (2,752). Same for benchmark_latency.pyvllm/benchmarks/latency.py and bench_one_batch.pypython/sglang/benchmark/one_batch.py. 00-04, 01-02, 10-02, 10-03
The two harnesses do not measure the same ITL vLLM records one ITL sample per streamed chunk; SGLang one per token (chunk_gap / num_new_tokens). Under speculative decoding with acceptance length 3–4, vLLM's ITL looks 3–4× worse for identical engine behaviour. SGLang's E2EL also includes the terminal SSE frame; since both derive TPOT from E2EL, TPOT is likewise not comparable. Goodput is implemented in vLLM only. 01-02, 06-*, 10-02, 10-03, 13-01
Layer-wise KV transfer is mostly unimplemented vLLM wires save_kv_layer into every attention layer, but both headline connectors — NIXL and Mooncake — implement it as a literal pass. Only MoRIIO in WRITE mode transfers layer-by-layer. SGLang overlaps per prefill chunk instead. 01-06, 05-*, 11-*
Preemption asymmetry neither project documents vLLM returns freed victim blocks to the free-queue tail with hashes intact, so a preempted request resumes on a near-total prefix-cache hit; hashes clear only in _maybe_evict_cached_block at reallocation. SGLang calls release_kv_cache(..., is_insert=False) and drops the victim's KV from the radix tree, with a live TODO (csy) acknowledging it. Derived gap: ~3.7 ms vs ~372 ms of redundant prefill per preemption for an 8k Llama-3-8B request. Confirmed independently by 02-03. 01-04, 02-03, 02-04, 13-01
SGLang silently changes scheduling policy under load _determine_active_policy downgrades LPM → FCFS above 128 queued requests, without logging it. Any concurrency sweep therefore changes scheduling policy mid-run. 01-04, 10-03
Chunked prefill ramps ITL, it does not flatten it Chunk 17 of a 32k prompt attends to 32k keys and costs ~134 ms against chunk 1's ~70 ms. And the dominant cost of shrinking chunk size is re-streaming the weights, not the KV re-read — the KV term is 13% of the weight term at 32k on Llama-3-8B and does not overtake it until ~245k tokens. 01-05
TurboQuant is not in any published survey vllm/model_executor/layers/quantization/turboquant/ plus turboquant_* cache dtypes and nvfp4_4over6 — Hadamard-rotated Lloyd-Max KV quantization. A new axis, not a variant of anything the original curriculum planned. 02-05, 04-01
A fully cached prompt cannot report a 100% hit rate max_cache_hit_length = num_tokens - 1, so a fully cached prompt reports B·⌊(S−1)/B⌋. Hit-rate dashboards and Lab 04 must not treat 100% as reachable. 02-03, 10-*
§5

Open questions

#Question ResolutionStatus
Q1 V0 is gone — how should 11-01 treat it? Keep as motivation: what V0 cost and why the rewrite happened, sourced from design docs and PRs and clearly labelled history. There is no V0 code left to cite. Resolved
Q2 How much weight for disaggregation? Given its own chapter, 01-06, covering the bootstrap handshake, the transfer state machine, all transport backends, and the viability arithmetic. Resolved
Q3 Batch invariance — fold in or give a chapter? Its own chapter, 10-04. Resolved
Q4 How much of the speculative-decoding surface? All of it. 06-04 covers EAGLE/Medusa/MTP/tree attention; 06-06 covers DFlash, DSpark, frozen-KV MTP, multi-layer EAGLE, standalone draft workers and adaptive speculation. Resolved
Q5 Where does the Rust gateway go? 09-04, covering design and routing policy without requiring the reader to read Rust. mini_lb.py's dual-dispatch behaviour belongs there too. Resolved
Q6 Chapter count No compression. 70 chapters. Resolved
Q7 Hardware for the labs None needed for the prose. Every chapter is written under a no-GPU constraint with strict three-way labelling — cited, derived, or measured — and nothing is labelled measured. Labs are written to be run later on rented hardware; the measurement environment table in SOURCES stays empty until then. Resolved
Q8 Who owns SGLang's disaggregation/encoder/ (~8k lines) and disaggregation/ascend/? Encode–prefill disaggregation for multimodal assigned to 07-04; the Ascend NPU backend to be mentioned in 05-05 or 13-01. Neither is yet drafted. Assigned
§6

Outstanding unverified flags

Every Unverified callout raised anywhere in the book is mirrored here so it can be resolved in one pass. The table is generated at build time by scanning src/, so a flag cannot be raised in a chapter and quietly forgotten here.

Each is a genuine gap — a fact that could not be established from the pinned checkouts without network access or hardware — rather than a claim that was guessed at. Every one names what was searched. That is the standard: when the source does not answer a question, the book says so and says where it looked, and never fills the hole with something plausible.

Historical snapshot of 48 unverified flags; not a live inventory
ChapterWhat could not be verified
01-02I did not locate any place at these SHAs where either engine exports a maximum ITL as a Prometheus series, only histograms. The straggler helper check_time_to_first_token_straggler at python/sglang/srt/observability/metrics_collector.py:L1807-L1820 reads the TTFT histogram's own buckets to decide …
01-04I did not find a published measurement of the actual prefix-cache survival fraction $f$ for preemption victims under production traffic in either repo's benchmark suite. The 0.99 figure in §6's table is an upper-bound illustration derived from the block-free ordering in vllm/v1/core/block_pool.py , …
01-06I did not verify at which layer Mooncake's Transfer Engine chooses between RDMA verbs, TCP, and NVLink at run time — that decision lives in the external mooncake Python/C++ package, not in either engine's tree. The SGLang side only ever calls batch_register / batch_transfer_sync . Reader should …
02-05The docstring's “~3.5×” for turboquant_k3v4_nc disagrees with the slot arithmetic the same file implements: at $d_h = 128$, key_packed_size is $\lceil 128\cdot3/8\rceil + 2 = 50$ and value_packed_size is $\lceil 128\cdot4/8\rceil + 4 = 68$, giving 118 bytes against bf16's 512, i.e. 4.34×. …
03-01SGLang's compiled merge_state_v2 is imported from sgl_kernel , which is not vendored into the SGLang checkout at 7d89325 — there is no sgl-kernel/ directory in the tree. I could therefore read only the Triton fallback and the dispatch wrapper, not the CUDA source. The reader should check the …
03-04I could not read FA4's kernel internals at this SHA: the cute/ subdirectory of vllm_flash_attn does not exist in the source checkout (it is populated from the vllm-flash-attn build, which is why FA4_AVAILABLE is a path check). Everything above is the dispatch and packaging story, read from …
04-03DeepGEMM's kernels are not in either repository. Claims about its internal tiling, its FP32 promotion scheme for block-wise scales, or its measured throughput cannot be checked here. The likely location is the external deep-gemm package that deep_gemm_wrapper/configurer.py:L27-L31 imports. …
05-01I did not find, at either SHA, an engine-side assertion that the sampler's RNG state is identical across TP ranks — the redundant-sampling correctness argument rests on all ranks receiving bitwise-identical logits from the all-gather, which is itself a property of the reduction order in the …
05-03The actual data-plane reconfiguration — how a Mooncake or NIXL all-to-all communicator is rebuilt to include a new peer mid-flight, and what pause in serving that causes — lives in the external mooncake and nixl packages, not in either tree at these SHAs. In-tree I found only the state machine that …
05-04The CUDA for the fused GEMM+AR lives in kimi_k3/comm/gemm_ar.cuh under the external sgl_kernel CUDA tree, which is not present at this SHA; the JIT loader in python/sglang/kernels/ops/kimi_k3/gemm_ar.py:L56-L60 references it by name only. I read the Python contract and the dispatch, not the …
05-05I could not find an explicit engine-version compatibility check exchanged between nodes at startup in either repo. I looked in vllm/distributed/parallel_state.py , vllm/v1/executor/multiproc_executor.py , and python/sglang/srt/distributed/bootstrap.py . If one exists it is likely to be added near …
06-03SuffixDecodingCache.speculate ships in the external arctic-inference package and is not in either pinned tree, so I cannot show you how the frequency estimate is computed or how max_spec_factor interacts with min_token_prob . Everything above comes from vLLM's wrapper and config docstrings. The …
06-04EAGLE-3's two headline training changes — dropping the feature-prediction loss in favour of direct token prediction, and the "training-time test" procedure that lets the draft learn from its own multi-step rollouts — leave no trace in either serving tree, by construction: they change the loss, not …
06-06Neither repository cites a paper for DFlash. I grepped both trees case-insensitively for dflash and found no arXiv link, no author attribution, and no expansion of the name. The only provenance is an LMSYS blog URL in SGLang's top-level README.md , the phrase "the DFlash reference implementation …
06-06DSpark's training objective is not in either tree. The mask_token_id / dspark_noise_token_id naming and the parallel mask-block draft are suggestive of a masked-denoising formulation, but I read dspark_config.py , python/sglang/srt/models/dspark.py , dspark_draft.py and dspark_planner.py and found …
06-06I could not find anything at this SHA that consumes this protocol. Under python/sglang/ , the only file referencing decoupled_spec_io is python/sglang/srt/server_args.py (importing the config dataclass); the message types — DraftControlBatch , DraftTailStreamOutput , VerifierCommitSegment , …
07-03I did not find a published head-to-head throughput or TTFT comparison of vLLM's mamba_cache_mode="all" against SGLang's MambaRadixCache on the same hardware and workload, and I have no GPU to produce one. Every memory figure in this chapter is derived arithmetic from shapes read at the pinned SHAs; …
07-04I could not find, at either SHA, a memory-profiling pass that reserves headroom for encoder activations the way determine_available_memory does for the KV pool. Both engines appear to leave that spike unmodelled and rely on gpu_memory_utilization headroom. The likely locations to check are …
07-05I could not find any mechanism in either engine that invalidates prefix-cache blocks when an adapter is reloaded in place under the same name. vLLM's LoRARequest.load_inplace ( vllm/lora/request.py:L30 ) "replaces the existing adapter in-place", and the block-hash key is lora_request.lora_name — so …
08-03CUTLASS itself is not in either tree at these SHAs. vLLM fetches it at build time — set(CUTLASS_REVISION "v4.4.2") and a FetchContent_Declare from github.com/nvidia/cutlass at CMakeLists.txt:L485-L513 — so CollectiveBuilder , Sm90EVT , the warp-specialised mainloop and the exact wgmma atom the …
09-02I could not find an equivalent batched-encode path in vLLM at a556f3f . vllm/tokenizers/hf.py:L25-L57 builds a deep-copied tokenizer pool for thread-safety ( maybe_make_thread_pool ), which is a different optimisation — concurrency, not batching. If a batched encode exists it would be under …
10-02I could not find a warmup-request exclusion mechanism in either harness beyond running warmups before benchmark_start_time is taken — neither drops early measured requests from the statistics, so ramp-up effects inside the measured window are included in the percentiles. I looked in …
10-03I could not find any mechanism in either repo that records GPU clock, temperature, or power in the benchmark result JSON, nor any warning about thermal drift on long runs. I looked in vllm/benchmarks/serve.py , vllm/benchmarks/sweep/ , and python/sglang/benchmark/serving.py . SGLang's /server_info …
10-05I found no Nsight Compute ( ncu ) integration in either tree at these SHAs: grep -rni "ncu\|nsight" over both repositories returns only Nsight Systems references ( tools/profiler/nsys_profile_tools/ in vLLM, test/registered/profiling/test_start_profile.py in SGLang). If a per-kernel counter hook …
11-01I could not find a log statement that positively announces which model runner was selected. I searched vllm/config/vllm.py , vllm/v1/worker/gpu_worker.py and vllm/v1/worker/gpu/model_runner.py for logger.info calls mentioning the runner and found only the two negative fallback warnings. If one …
11-04I could not find any positive log line announcing the selected runner at this SHA. I grepped vllm/v1/worker/gpu_worker.py , vllm/config/vllm.py , and the whole vllm/v1/worker/ tree for a logger.info naming the runner and found only the two negative warning_once fallbacks quoted above. If a positive …
12-01I found no published benchmark comparing DWDP's weight-prefetch prefill against token all-to-all at this SHA, and I have no GPU to measure one. The tradeoff is arithmetically clear — you move experts × d × d_ff weight bytes instead of tokens × d activation bytes, so the crossover depends on prefill …
13-01I did not read TensorRT-LLM, TGI, or llama.cpp source at any pinned SHA for this book. Everything in this section is sourced to the public documentation linked inline, fetched while writing. Treat it as a pointer to where to look, not as the kind of claim the vLLM and SGLang sections make.
13-02The claim that MoE raises $\phi$ relative to a dense model of the same total size is arithmetic I did not complete for a specific checkpoint, and I found no per-model $\phi$ calculation in either tree to check it against (I looked in vllm/benchmarks/ , python/sglang/benchmark/ , and both profiling …
13-02I did not read TensorRT-LLM or llama.cpp source at any pinned SHA. Everything in this section is sourced to public documentation I fetched while writing, quoted inline. It is a pointer to where to look, not a claim of the kind the vLLM and SGLang sections make. §13.1 describes these projects; this …
13-03I looked for an age-tiered KV policy — recent tokens in bf16, distant ones demoted to fp8/int4 — the obvious pairing of long context with §2.5 . Searching vllm/v1/core/single_type_kv_cache_manager.py , vllm/config/cache.py , python/sglang/srt/mem_cache/ and both quantization trees found only …
13-03Searching both trees for mobile and phone-NPU targets ( jetson , android , coreml , qnn , hexagon ) found only the UMA notes quoted above, in vllm/platforms/interface.py , vllm/platforms/cuda.py and vllm/utils/mem_utils.py . SGLang's NPU support ( is_npu in …
lab 01Not executed here run.py was written against the timing and accounting idioms cited below, and its argument handling and arithmetic were exercised, but it has not been run on a GPU — none was available while writing. No number on this page is a measurement. Everything is either cited (a published …
lab 02Not executed here run.py was written against the config shapes and engine log lines cited below, and its argument handling and arithmetic were exercised, but it has not been run against a live engine — no GPU was available while writing. Treat the reconciliation output as a worked prediction, and …
lab 03Not executed here run.py was written against the API fields and metric definitions cited below, and its argument handling was exercised, but it has not been run against a live engine — no GPU was available while writing. Every number it prints is a measurement you make. Nothing on this page is one.
lab 04Not executed here run.py was written against the metric names, request schemas, and log lines cited below, and its argument handling and arithmetic were exercised, but it has not been run against a live engine — no GPU was available while writing. Every number the README shows is either cited to …
lab 05Not executed here run.py was written against the API fields, server flags and defaults cited below, and its argument handling was exercised, but it has not been run against a live engine — no GPU was available while writing. There is no measured figure anywhere on this page. Everything the script …
lab 06Not executed here run.py was written against the CLI surface, log lines, and eval harnesses cited below, and its argument handling and arithmetic were exercised, but it has not been run against a live engine or a GPU. Every accuracy cell in this README is a placeholder you fill in. There is no …
lab 07Not executed here run.py was written against the flags, config fields and result-file formats cited below, and its argument handling and arithmetic were exercised, but it has not been run against a live engine — no GPU was available while writing. Every number on this page is derived (arithmetic, …
lab 08Not executed here run.py was written against the config fields, metric names and harness output cited below, and its argument handling and arithmetic were exercised, but it has not been run against a live engine — no GPU was available while writing. Every acceptance figure on this page is either a …
lab 08I could not find, at either SHA, any per-position acceptance vector on the SGLang side comparable to vLLM's vllm:spec_decode_num_accepted_tokens_per_pos . SGLang exposes spec_correct_drafts_histogram per request ( python/sglang/srt/entrypoints/openai/protocol.py:L418-L427 ), which is a histogram …
lab 09Not executed here run.py was written against the backend names, request schemas, and mask code cited below, and its argument handling and arithmetic were exercised, but it has not been run against a live engine — no GPU was available while writing. There is no measured throughput number anywhere on …
lab 10Not executed here run.py was written against the profiler configuration, HTTP endpoints and trace annotations cited below, and its trace parser was exercised against a synthetic Chrome trace, but it has not been run against a live engine or a real capture — no GPU was available while writing. Every …
lab 11Not executed here No benchmark on this page was run. run.py was written against the flags and result keys cited below and its argument handling and arithmetic were exercised, but it has not been pointed at a live server — no GPU was available while writing. The result table in the Reporting section …
lab 11I could not find any mechanism in either repository that records GPU clock, temperature or power into the benchmark result. I looked in vllm/benchmarks/serve.py , vllm/benchmarks/sweep/ and python/sglang/benchmark/serving.py . Sustained decode holds a card near its power limit and clocks fall over …
lab 12Not executed here The hop table in run.py was built by reading the pinned source, not by matching it against a real capture — no engine was run while writing, because no GPU was available. Each regex was written against the format string in the cited file, so a line whose arguments render …
lab 12— SGLang has the tracer but not the wiring SGLang carries a byte-identical port of vLLM's tracer, down to the "Call to {func_name} in {filename}:{lineno} from ..." line format, at python/sglang/multimodal_gen/runtime/utils/logging_utils.py:L431-L451 . At 7d89325 it is unreachable from the serving …
lab 13Not executed here run.py was written against the request and response shapes cited below, and its comparison arithmetic — ULP distance, first-divergence index, the bucket-straddling batch ladder — was exercised offline, but it has not been run against a live engine; no GPU was available while …

The Inference Engineering Course · code read at vllm@a556f3fccb and sglang@7d893255c3, pinned 2026-08-21. See SOURCES for the full provenance record.

Explore the library

Reading preferences

Appearance
18 px