Repository navigation
helios: retain measured snapshot cost after expiry and discover unmeasured cost once - #655
Conversation
|
A case file has been opened for 655. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedLean, well-scoped (~20 net production lines) fix for three genuine upstream terminal
Walkthrough
Merge Risk: Low · up to
|
2d9454f to
f7f4d25
Compare
|
Replaced the 30 s TTL probe with retained measured
@flare-autobot please re-review. Discord: D-Rock |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeHead
Walkthrough
Merge Risk: Low · up to
|
|
@flare-autobot please do a a full review. |
|
+1 confirming this behavior on 2× GB10 (SM121) TP2 with We observed warm multi-turn system-message prefix requests (32k and 64k shared system documents) skipping message-boundary checkpoints with |
…sured cost once Prefill estimates already retain measured durations after TTL expiry and reset their rolling window on the next execution, whereas snapshot-copy cost used ActionCosts::fresh_duration and reverted to None after estimate_ttl_ns (30 s). Any decode longer than 30 s or any idle gap longer than 30 s caused terminal Endpoint captures and prefill Message extras to skip with unknown_cost even though a measured snapshot duration was already recorded. Separately, a warm restart against a persistent host prefix cache (--prefix-cache-disk or --prefix-cache-pool) starts with unmeasured Snapshot costs (nanos == 0); when incoming prompts hit cached anchors, no Anchor snapshot executes and terminal captures remained permanently stuck at unknown_cost. Replace fresh_duration (whose only callers were the three snapshot checks in checkpoints.rs) with ActionCosts::measured_duration, which scans declared batches in ascending order and returns the smallest declared batch with nanos != 0, retaining measured estimates across TTL expiry with parity to prefill pricing while ActionCosts::observe still resets the rolling window on the next run after expiry. For the remaining cold-start case where no Snapshot batch has been measured yet (nanos == 0), track at most one in-flight terminal discovery request via RequestScheduler::snapshot_discovery: Option<RequestHandle>. When checkpoint_extra_work_fraction > 0 and no discovery is in flight, allocate_terminal_capture prices that single capture at zero and records the handle only if snapshot storage is obtained; snapshot completion, status-3 fallback, finish, and cancel all clear the handle so subsequent requests recover immediately. Update docs/scheduling-runtime-design.md, docs/core-design.md, docs/cli-design.md, and helios/README.md, and add unit tests covering ascending-batch fallback and post-TTL retention, long decode/idle retention, single-flight cold discovery with cancel/storage/zero-fraction recovery, and end-to-end plan -> commit -> complete observation unblocking prefill extras. Related to NVIDIA#534 Signed-off-by: yatesdr <6937857+yatesdr@users.noreply.github.com> Design-Signed-Off-By: yatesdr; design-review=2e5b
f7f4d25 to
f8e4945
Compare
Summary
Related to #534
Replaces the earlier 30 s probe approach with two cleaner changes that bring
GraphKind::Snapshotpricing into parity withPrefill(PR #285):ActionCosts::measured_duration):Prefillestimates already retain measured durations afterestimate_ttl_ns(30 s) and reset their rollingReplayTimeswindow on the next execution (ActionCosts::observe).Snapshotwas the only remaining caller ofActionCosts::fresh_duration, which reverted toNoneafter 30 s and caused terminalEndpointcaptures and prefillMessageextras to skip withunknown_costafter any >30 s decode or idle pause.fresh_durationwithActionCosts::measured_duration, scanning declared batches in ascending order and returning the smallest declared batch withnanos != 0. Once anySnapshotbatch has been observed, both prefill extras and terminal captures stay available across long decodes and idle pauses, andActionCosts::observestill resets the 9-sample rolling window on the next execution after expiry.Snapshot(nanos == 0):--prefix-cache-diskor--prefix-cache-pool),Snapshotstarts unmeasured (nanos == 0). Requests whoseAnchoris already cached executeRestore -> Resume -> Decodewithout anAnchorsnapshot, previously leavingSnapshotpermanently unmeasured.RequestScheduler::snapshot_discovery: Option<RequestHandle>. Whenmeasured_durationisNone,checkpoint_extra_work_fraction > 0, and no discovery is in flight,allocate_terminal_captureprices that single capture at zero and records the handle only if snapshot storage is obtained.complete_inner(normal completion and status-3 fallback) andretire(cancel/finish) clearsnapshot_discoveryimmediately so cancellations or batch coalescing cannot leave discovery locked out.docs/scheduling-runtime-design.md,docs/core-design.md,docs/cli-design.md, andhelios/README.md.Validation
RUSTFLAGS="-D warnings" cargo check --locked --manifest-path helios/Cargo.toml --features runtime-core,server --all-targets: passed.helios(--release --features runtime-core,server):scheduler::cost::tests::measured_duration_uses_smallest_measured_batch_and_retains_after_ttlscheduler::checkpoints::tests::unknown_prefill_or_unmeasured_snapshot_cost_disables_extrasscheduler::checkpoints::tests::measured_prefill_and_snapshot_costs_keep_extras_available_after_idlescheduler::checkpoints::tests::measured_snapshot_cost_retains_terminal_captures_after_long_decode_or_idlescheduler::checkpoints::tests::unmeasured_snapshot_cost_allows_one_inflight_terminal_discovery_and_recovers_on_cancelscheduler::checkpoints::tests::terminal_snapshot_discovery_end_to_end_plan_commit_complete_unblocks_subsequent_captureshelios::scheduler::suite (--release --features runtime-core,server): 409 passed, 0 failed (4 ignored).flarecrate suite (--release): 246 passed, 0 failed (4 ignored).Qwen3.8-Flash-NextTP1,--prefix-cache-memory 4G --prefix-cache-disk ...):Snapshotunmeasured) + cached-anchor hit:host_cache_hits=+1(2917tokens),endpoint=+1via single cold discovery, and immediate follow-upunknown_cost=0,anchor=+1,endpoint=+2.scripts/scheduling_simdoes not model checkpointActionCostsexpiry/discovery (N/A);CheckpointReservation.tlareservation invariants are unchanged (CIlifecycle/kani/pytestwill also verify).Discord: D-Rock