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
41 changes: 29 additions & 12 deletions docs/core-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1533,16 +1533,31 @@ request publishes additional shared ancestors.
Track logical references separately from outstanding GPU use. A page or slot
becomes reusable only after both have ended.

GPU retention orders eligible checkpoints by logical-request demand epoch, then
role, then consumed-token count, then checkpoint identity. Prompt and terminal
endpoints have the lowest role, earlier message checkpoints follow, and the
conversation anchor has the highest role. Demand recency takes precedence over
role, so an idle conversation's anchor can be reclaimed before a recently used
endpoint. Each successfully admitted logical request receives a demand epoch;
its captures inherit that epoch. Cache reuse and promotion touch only the selected
GPU retention partitions eligible checkpoints into two tiers—probationary
(un-reused) entries before reuse-protected entries—and orders victims within
each tier by logical-request demand epoch, then role, then consumed-token count,
then checkpoint identity. Prompt and terminal endpoints have the lowest role,
earlier message checkpoints follow, and the conversation anchor has the highest
role. Within a tier, demand recency takes precedence over role, so an idle
conversation's anchor can be reclaimed before a recently used endpoint in the
same tier. Each successfully admitted logical request receives a demand epoch;
its captures inherit that epoch. Fresh cross-request admission hits, duplicate capture
publications, and host-store restores with a live fresh-admission waiter promote
the selected checkpoint into the reuse-protected tier. A newly published child
inherits reuse protection only when its parent is currently protected and the
parent covers at least one-third of the combined prefix (`parent_len * 2 >= tail_tokens`),
preserving linear multi-turn continuations while keeping low-reuse scans that
share a short boilerplate prefix probationary. Whenever a ready leaf or compacted
ready ancestor retires, cumulative retired ready pages and ready checkpoints
advance; any protected checkpoint whose elapsed retirements since its last reuse
hit reach either full dual turnover (both `ready_tail_pages.max(1)` pages and
`ready_checkpoints.max(1)` checkpoints) or `2x` `ready_checkpoints.max(1)`
checkpoints under snapshot-bound pressure permanently demotes to probationary
until a subsequent reuse hit. Cache reuse and promotion touch only the selected
checkpoint's snapshot. Successful completion refreshes a published terminal and
its direct parent with one completion-time epoch. The parent commonly holds the
prompt end or last captured message boundary, which remains useful when a follow-up
its direct parent with one completion-time epoch without promoting probationary
entries into the reuse-protected tier. The parent commonly holds the prompt end
or last captured message boundary, which remains useful when a follow-up
rewrites generated history. The parent comes from the published checkpoint's cache
record, including duplicate publication; it need not have been captured by the
completing request and may have been restored from a host tier.
Expand All @@ -1562,9 +1577,11 @@ The global allocator compares victims for both snapshot rows and physical page
backing. A removable checkpoint is an unpinned leaf or an ancestor with exactly
one child and no direct request pin. Fenced retirement and alias ownership still
control when its resources can be reused. Optional capture cannot displace an
equal or higher retention rank. Optional `Anchor` and `Message` captures reclaim lower-rank victims strictly by
demand-recency order. Optional `Endpoint` captures (prompt-end and ordinary
terminal endpoints) use the same demand-recency order while bounding cumulative
equal or higher retention rank. Optional `Anchor` and `Message` captures reclaim
lower-rank victims in the two-tier `(is_protected, RetentionRank, id)` order
(probationary victims first, ordered by demand recency, role, and token length
within each tier). Optional `Endpoint` captures (prompt-end and ordinary
terminal endpoints) use the same two-tier victim order while bounding cumulative
protected victim destruction by their marginal token gain beyond their
already-resident parent checkpoint (or full consumed length when no parent is
resident): role-preserving single-child interior compactions (`child.role >=
Expand Down
17 changes: 13 additions & 4 deletions docs/prefix-cache-offload.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,15 @@ requires a committed local copy. `Retry` accepts no copy. The worker retains onl
checkpoint IDs for retries after store progress and discards IDs that have left
the GPU cache. `Deferred` releases the copy pin and schedules the same retry when
a queued publication cannot obtain host capacity. A failed transfer releases its
pin without retrying. GPU eviction uses demand/role retention ranking with leaf removal or
ancestor compaction. `fetch` copies a looked-up chain into the ticket's page IDs and state slot.
pin without retrying. GPU eviction prefers probationary (un-reused) checkpoints
before reuse-protected checkpoints, ordering victims within each tier by
demand/role retention ranking with leaf removal or ancestor compaction;
host-store restores promote a GPU checkpoint (created or existing) into the
reuse-protected tier only when a live fresh-admission waiter is attached
(normal child inheritance from an already reuse-protected GPU parent still
applies on creation), while preempted re-admissions and waiterless restores
refresh demand recency only. `fetch` copies a looked-up chain into the ticket's
page IDs and state slot.
Submissions never wait; `poll` drains completions and failures.
A `PublishedCheckpoint` names the GPU checkpoint, its key and bucket digest,
its complete page chain, and the state slot of its row. It lists up to 256
Expand Down Expand Up @@ -367,8 +374,10 @@ The manager stores a root with the complete chain only when it holds none of the
chosen ancestor's chain is already half the lookup limit long, or when the
arena is under pressure.

GPU eviction ranks eligible checkpoints by logical-request demand epoch,
retention role, consumed-token count, and identity, as specified in
GPU eviction partitions eligible checkpoints into probationary (un-reused)
entries before reuse-protected entries, and ranks victims within each tier by
logical-request demand epoch, retention role, consumed-token count, and
identity, as specified in
[checkpoint lifetime](core-design.md#branching-and-lifetime). GPU demand recency
belongs to the selected snapshot, not every ancestor supplying its pages.
Successful terminal retirement also refreshes its direct parent, including a
Expand Down
7 changes: 5 additions & 2 deletions docs/scheduling-runtime-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,11 @@ 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
uses demand recency, checkpoint role, and endpoint length to compare eligible
victims; optional `Endpoint` captures additionally bound cumulative
orders probationary (un-reused) victims ahead of reuse-protected victims and
uses demand recency, checkpoint role, and endpoint length within each tier
(with continuation inheritance and sticky turnover demotion specified in
[checkpoint lifetime](core-design.md#branching-and-lifetime)); optional
`Endpoint` captures additionally bound cumulative
age-discounted protected victim cost (`leaf_tokens / (1 + age)` for
higher-role/root leaves and role-destroying compactions) by their marginal token
gain beyond their resident parent, while leaving role-preserving single-child
Expand Down
11 changes: 7 additions & 4 deletions helios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,10 +711,13 @@ fence before releasing resources.
Pinning increments the selected checkpoint and every ancestor. Direct pin
accounting prevents an ancestor unpin from consuming a descendant's reference.
The scheduler records GPU use through `mark_used` before submission; releasing
logical pins does not imply completion of that use. Leaf LRU eviction accepts
separate page and snapshot pressure targets and produces `RetiredResources`,
which explicitly carry their final-use fence. The cache continues reserving
those IDs. Only `advance_completed(...).reusable` grants permission to reuse
logical pins does not imply completion of that use. Two-tier scan-resistant
eviction (probationary before reuse-protected, ordered by demand recency and
role within each tier, via leaf removal or single-child ancestor compaction)
accepts separate page and snapshot pressure targets and produces
`RetiredResources`, which explicitly carry their final-use fence. The cache
continues reserving those IDs. Only `advance_completed(...).reusable` grants
permission to reuse
the corresponding storage.

Fences describe a single monotonic completion timeline covering model execution
Expand Down
Loading
Loading