Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion docs/cli-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,9 @@ message endpoint as a best-effort anchor while zero falls back to the prompt end
Zero snapshot capacity disables all checkpoint cuts. Any retained interior anchor
split, earlier messages, and a distinct prompt end share 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
completed productive decode (allowing at most one in-flight zero-priced discovery
copy when no snapshot cost has been measured yet and the fraction is positive).
Extra work includes snapshot copies and additional prefill caused by
splitting chunks. Snapshot storage remains globally shared and reclaimable for
mandatory execution. This option requires no core re-export.

Expand Down
15 changes: 9 additions & 6 deletions docs/core-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1455,12 +1455,15 @@ fixed snapshot share to each request.

Extra captures share this request-local work allowance, 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
selected anchor; under a nonzero fraction unknown prefill costs retain the last
eligible interior message boundary as a best-effort anchor, whereas under a zero
fraction unknown prefill costs fall back to the prompt-end anchor. Productive completed decode
splitting its enclosing interval, plus its snapshot-copy time. Prefill and
snapshot-copy estimates retain measured costs after expiry, as ordinary dispatch
does. Unknown prefill costs or unmeasured snapshot-copy costs exclude prefill
extras without excluding the selected anchor; under a nonzero fraction unknown
prefill costs retain the last eligible interior message boundary as a best-effort
anchor, whereas under a zero fraction unknown prefill costs fall back to the
prompt-end anchor. When the fraction is positive and snapshot-copy cost has not
been measured yet, terminal capture allows at most one in-flight discovery copy
(priced at zero) to observe it. 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
15 changes: 12 additions & 3 deletions docs/scheduling-runtime-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,23 @@ the natural-fit exploration limits in [Duration estimates](#duration-estimates),
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, applying the unknown-cost anchor and extra-cut rules in
[exact endpoint capture](core-design.md#exact-endpoint-capture). Productive
[exact endpoint capture](core-design.md#exact-endpoint-capture). Both prefill
and snapshot-copy predictions retain measured costs after expiry (using the
smallest measured snapshot batch until the smallest declared batch is observed,
and resetting the rolling window on the next execution). Unknown prefill costs
or unmeasured snapshot-copy costs disable prefill extras while preserving the
selected anchor; when the fraction is positive and no snapshot-copy cost has
been measured yet, terminal capture allows at most one in-flight discovery
capture (priced at zero) so requests whose anchor is already cached can observe
the snapshot cost. 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.

An extra prefill cut is selected only with an obtainable snapshot destination.
If its cost expires after dispatch, its copy can be skipped after the split has
already executed. A row guarded for the later anchor protects it from earlier
If its work allowance is exceeded by the time prefill completes, its copy can be
skipped after the split has already executed. A row guarded for the later anchor
protects it from earlier
optional captures; mandatory execution
may revoke an unused guard. Armed destinations and in-flight copies retain their
rows through GPU completion and cancellation. The alias-aware global allocator
Expand Down
10 changes: 7 additions & 3 deletions helios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,13 @@ allowance (charging the split while leaving the anchor snapshot copy
uncharged), falling back to the prompt end when it does not, and earlier
messages plus a distinct prompt end compete for the remaining headroom.
Productive completed decode earns the same fraction of measured time for a
distinct terminal capture. There is no capture-count cap or per-request share of
snapshot rows; the global allocator accounts for snapshot aliases, guards a later
anchor against earlier optional captures, and reclaims unused guards for
distinct terminal capture. Both prefill and snapshot-copy estimates retain
measured costs after expiry; unknown prefill or unmeasured snapshot costs
exclude prefill extras while preserving best-effort anchor retention, and a
positive fraction allows at most one in-flight terminal discovery copy when
snapshot cost is unmeasured. There is no capture-count cap or per-request share
of snapshot rows; the global allocator accounts for snapshot aliases, guards a
later anchor against earlier optional captures, and reclaims unused guards for
mandatory execution. Only obtainable capture destinations introduce prefill cuts.
See [checkpoint ownership](../docs/core-design.md#exact-endpoint-capture). `prefill_chunk_size` must be 64-aligned, at least 64, and within the
context capacity. Batched graphs declare batch capacities in `1..=request_slots`
Expand Down
12 changes: 11 additions & 1 deletion helios/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ pub struct RequestScheduler {
mixed_catalog: Vec<(usize, usize, usize)>,
forecasts: rounds::Forecasts,
costs: cost::ActionCosts,
snapshot_discovery: Option<RequestHandle>,
refresh: refresh::RefreshState,
tickets: HashMap<PrefixKey, Ticket>,
track_publications: bool,
Expand Down Expand Up @@ -763,6 +764,7 @@ impl RequestScheduler {
mixed_catalog: Vec::new(),
forecasts,
costs: cost::ActionCosts::default(),
snapshot_discovery: None,
refresh: refresh::RefreshState::default(),
tickets: HashMap::new(),
track_publications: false,
Expand Down Expand Up @@ -2790,14 +2792,19 @@ impl RequestScheduler {
request.error_code = Some(record.error_code);
request.terminal_snapshot_ready = false;
request.phase = RequestPhase::Finishing;

if self.snapshot_discovery == Some(lane.request) {
self.snapshot_discovery = None;
}
} else if kind == GraphKind::Snapshot {
if request.boundary_capture.is_some() {
boundaries.push(lane.request);
} else {
request.terminal_snapshot_ready = true;
request.phase = RequestPhase::Finishing;
self.stats.checkpoint_endpoint_captures += 1;
if self.snapshot_discovery == Some(lane.request) {
self.snapshot_discovery = None;
}
}
} else {
if kind == GraphKind::Vision {
Expand Down Expand Up @@ -3181,6 +3188,9 @@ impl RequestScheduler {
}

fn retire(&mut self, handle: RequestHandle, publish: bool) -> Result<Option<CheckpointId>> {
if self.snapshot_discovery == Some(handle) {
self.snapshot_discovery = None;
}
if self.request(handle)?.phase == RequestPhase::Inbound {
for ticket in self.tickets.values_mut() {
ticket.waiters.retain(|(waiter, _)| *waiter != handle);
Expand Down
Loading
Loading