Skip to content
Open
2 changes: 1 addition & 1 deletion benchmarks/cdb_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def drive(engine):
if batch is not None:
steps.append(
dict(
stage=batch.phase.value,
works=sorted(work.name.lower() for work in batch.works),
effective_rows=batch.num_tokens,
submitted_rows=engine.model_runner.last_submitted_size,
)
Expand Down
4 changes: 3 additions & 1 deletion benchmarks/preemption.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def drive(engine, requests, state):
next_request = next(pending, None)
state["max_waiting"] = max(
state["max_waiting"],
sum(request.phase.value == "waiting" for request in engine.scheduler.requests.values()),
sum(
request.status.value == "waiting" for request in engine.scheduler.requests.values()
),
)
if engine.has_unfinished_requests():
for output in engine.step():
Expand Down
2 changes: 1 addition & 1 deletion docs/diagrams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ do not imply that every submission executes all three operations.

`scheduler-overview.svg` is the editable 1800 × 2600 source and
`scheduler-overview.png` its 2× export. The vertical A–F spine shows admission,
phase queues, policy/batch selection, execution, completion tracking and progress.
WorkKey queues, policy/batch selection, execution, completion tracking and progress.
Read top to bottom; one return arrow on the left leads from F to B. A includes waiting, safe preemption and
restoration; KV growth pressure in C returns to the same preemption logic. C
separates prefill granularity from batching and shows supported combinations.
Expand Down
2 changes: 1 addition & 1 deletion docs/diagrams/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<section class="panel card" id="overview" role="tabpanel" aria-labelledby="tab-overview" hidden>
<div class="bar"><div><h2>Scheduler overview</h2><p class="desc">Follow A–F from top to bottom, then return to B along the left edge. Admission includes waiting, preemption and restoration; C separates prefill granularity from batching.</p></div><div class="links"><a href="scheduler-overview.svg" target="_blank" rel="noopener">Open SVG</a><a href="scheduler-overview.png" target="_blank" rel="noopener">High-resolution PNG</a></div></div>
<div class="tools"><label>Zoom <input type="range" min="60" max="200" value="100" step="10" aria-label="Zoom scheduler overview"></label><output>100%</output><button class="fit">Fit width</button><a href="#scheduler" onclick="select('scheduler')">Expand Mixed: loop scheduling</a></div>
<div class="canvas"><img src="scheduler-overview.svg" alt="Complete scheduler paths: admission, phase queues, policy selection, ordinary/speculative execution, pending results, PD transfer and retirement."></div></section>
<div class="canvas"><img src="scheduler-overview.svg" alt="Complete scheduler paths: admission, WorkKey queues, policy selection, ordinary/speculative execution, pending results, PD transfer and retirement."></div></section>
<section class="panel card" id="scheduler" role="tabpanel" aria-labelledby="tab-scheduler" hidden>
<div class="bar"><div><h2>Loop-level scheduler</h2><p class="desc">Select individual loops, mix compatible requests, then regroup from independent progress.</p></div><div class="links"><a href="loop-scheduler.svg" target="_blank" rel="noopener">Open SVG</a><a href="loop-scheduler.png" target="_blank" rel="noopener">High-resolution PNG</a></div></div>
<div class="tools"><label>Zoom <input type="range" min="60" max="200" value="100" step="10" aria-label="Zoom scheduler diagram"></label><output>100%</output><button class="fit">Fit width</button></div>
Expand Down
Binary file modified docs/diagrams/loop-scheduler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/diagrams/loop-scheduler.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/diagrams/scheduler-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/diagrams/scheduler-overview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/diagrams/scheduler-preemption-detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/diagrams/scheduler-preemption-detail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/diagrams/scheduler-victim-selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/diagrams/scheduler-victim-selection.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/diagrams/stage-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/diagrams/stage-architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/diagrams/stage-components.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading