Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/cli-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,12 @@ The controls use the core's captured snapshot graphs and require no re-export.
`--scheduler-checkpoint-extra-work-fraction FRACTION` bounds optional checkpoint
work relative to productive request work. The default is `0.05`; values must be
finite and in `[0,1]`. It overrides
`[server] scheduler_checkpoint_extra_work_fraction`. The scheduler always considers
the last eligible message endpoint as a best-effort conversation anchor, even
when timing estimates are unavailable or the fraction is zero. Earlier messages
`[server] scheduler_checkpoint_extra_work_fraction`. With a nonzero fraction, the
scheduler considers the last eligible message endpoint as a best-effort
conversation anchor even when timing estimates are unavailable; when the fraction
is zero, an interior message endpoint is used as the anchor only when splitting
prefill there adds zero predicted prefill work, and otherwise the prompt end acts
as the anchor. Zero snapshot capacity disables all checkpoint cuts. Earlier messages
and a distinct prompt end consume the fraction of estimated uncached prefill
work; a distinct terminal endpoint earns its allowance from completed productive
decode. Extra work includes snapshot copies and additional prefill caused by
Expand Down
16 changes: 11 additions & 5 deletions docs/core-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1435,18 +1435,24 @@ to earlier tokens cannot reuse a checkpoint for different tokens.

The scheduler chooses the last eligible complete-message boundary as the request's
conversation anchor. If no message boundary is eligible, the prompt end is the
anchor. Anchor retention is best effort and independent of duration estimates.
Earlier complete-message boundaries compete in reverse message order; a distinct
prompt end follows them. There is no capture-count limit or allocation of a fixed
snapshot share to each request.
anchor. When snapshot storage has zero capacity, the scheduler emits no checkpoint
cuts. Under a nonzero extra-work fraction, anchor retention is best effort and
independent of duration estimates; when `scheduler_checkpoint_extra_work_fraction`
is zero, an interior message boundary is retained as the anchor only if splitting
prefill there adds zero predicted prefill work, otherwise the prompt end serves as
the anchor. Earlier complete-message boundaries compete in reverse message order;
a distinct prompt end follows them. There is no capture-count limit or allocation
of a fixed snapshot share to each request.

Extra captures use a request-local work allowance. Its prefill component is
`scheduler_checkpoint_extra_work_fraction` times the estimated uncached prefill
work, with a default fraction of 0.05. An extra endpoint charges the additional
predicted prefill time caused by splitting its enclosing interval, plus its
snapshot-copy time. Prefill estimates retain measured costs after expiry, as
ordinary dispatch does. Unknown prefill costs or unknown or stale snapshot-copy
costs exclude extras without excluding the anchor. Productive completed decode
costs exclude extras without excluding the selected anchor; when the fraction is
zero, unknown prefill costs fall back from an interior message boundary to the
prompt-end anchor. Productive completed decode
earns the same fraction of measured decode time for a distinct terminal
endpoint. A coincident prompt and terminal endpoint uses one capture. Mandatory
conditioned-input state transfers do not consume this allowance. Preemption
Expand Down
12 changes: 8 additions & 4 deletions docs/scheduling-runtime-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,11 @@ program. A finishing prefill exposes its decoder and checkpoint operation only
after completion.

Checkpoint retention uses the exact token endpoints supplied by the native
frontend. The last eligible completed message is a best-effort conversation
anchor; the prompt end substitutes when there is no eligible message. Earlier
frontend. Zero snapshot capacity disables all checkpoint cuts. Otherwise, the last
eligible completed message is a best-effort conversation anchor, falling back to
the prompt end when no message is eligible or when
`scheduler_checkpoint_extra_work_fraction` is zero and splitting prefill at an
interior message boundary would add predicted prefill work. Earlier
messages are considered in reverse order, followed by a distinct prompt end.
Additional prefill splits and snapshot copies must fit a request-local allowance
of `scheduler_checkpoint_extra_work_fraction` times estimated uncached prefill
Expand All @@ -565,8 +568,9 @@ to the largest catalog capacity when none does. Pure prefill dispatch discovers
only the natural-fit capacity, and an atomic span can make the natural fit
smaller than the pricing capacity. An unmeasured pricing capacity that consumes
additional tokens leaves the prefill cost unknown. Unknown prefill costs and
unknown or stale snapshot-copy costs disable extras while preserving anchor
eligibility. Productive completed decode earns the same fraction of measured
unknown or stale snapshot-copy costs disable extras while preserving the
selected anchor; when the fraction is zero, unknown prefill costs fall back from
an interior message boundary to the prompt-end anchor. Productive completed decode earns the same fraction of measured
time for a distinct terminal capture. There is no fixed capture count or
concurrency-based snapshot share.

Expand Down
14 changes: 11 additions & 3 deletions helios/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1791,9 +1791,17 @@ impl RequestScheduler {
self.admissions += 1;
if let Some(inbound) = &inbound {
let request = self.request(handle)?;
let role = if request.checkpoint_anchor() as u64 == inbound.consumed_tokens { RetentionRole::Anchor }
else if request.message_boundaries.binary_search(&(inbound.consumed_tokens as usize)).is_ok() { RetentionRole::Message }
else { RetentionRole::Endpoint };
let role = if self.is_request_anchor_endpoint(request, inbound.consumed_tokens) {
RetentionRole::Anchor
} else if request
.message_boundaries
.binary_search(&(inbound.consumed_tokens as usize))
.is_ok()
{
RetentionRole::Message
} else {
RetentionRole::Endpoint
};
let ticket = self.tickets.get_mut(&inbound.key).unwrap();
ticket.demand_epoch = ticket.demand_epoch.max(demand_epoch);
ticket.role = ticket.role.max(role);
Expand Down
Loading