Skip to content

fix(cache): preserve message checkpoints for divergent continuations - #227

Closed
shadownetX wants to merge 2 commits into
NVIDIA:mainfrom
shadownetX:fix/warm-prefix-branch-resume
Closed

shadownetX wants to merge 2 commits into
NVIDIA:mainfrom
shadownetX:fix/warm-prefix-branch-resume

Conversation

@shadownetX

Copy link
Copy Markdown
Contributor

Prevent WARM prefix reuse loss after GPU eviction by publishing message checkpoints immediately and preserving nearby ancestor resume rows during eager thinning. Retained rows consume additional host-cache space.

CPU regressions pass and reproduce the failure without the fix. Validated under KV pressure on DGX Spark GB10, Qwen3.8 Flash Next FP4, TP1/DFlash2, up to eight concurrent requests. Other GPU/TP configurations are untested. Disk tests encounter the same io_uring permission failures on unmodified main.

Fixes #225

@original-el8 original-el8 added area:caching Prefix/KV reuse, cache retention, and model or payload cache behavior. area:scheduling Request scheduling, fairness, batching, and speculative-width selection. area:selene Selene shared prefix-cache pool, protocol, manager, and transfers. bug Something isn't working model:qwen3.8-flash-next Affected recipe or documented reproducer: qwen3.8-flash-next. Impact may be broader. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. priority:P2 Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround. triage:review Proposed change needs code review; this does not imply merge readiness. labels Nov 8, 2026
@original-el8

Copy link
Copy Markdown
Collaborator

Linked to #225 and categorized as a cache/Selene/scheduling regression fix (priority:P2, triage:review). The source changes both publication timing and ancestor-row retention, which explains why increasing SSD capacity alone did not restore reuse. The reported GB10 Qwen3.8 Flash Next TP1/DFlash2 pressure run supports the proposed fix. Review should retain the host-cache space tradeoff and check restore/eviction behavior across compatible cache schemes; disk tests remain blocked by the reported io_uring environment restriction.

Message checkpoints deferred behind a nearby prompt checkpoint can lose
their resume row, forcing divergent continuations to prefill again after
GPU eviction. Offer message checkpoints immediately and retain close
ancestor rows during eager thinning.

Normal capacity eviction still applies; retained rows use additional host
cache space. Document the in-memory marker's recovery behavior. Package
formats and model export requirements are unchanged.

Validation: 15 Selene index tests and 25 Helios boundary tests passed. The
divergent-branch regression fails without the fix. The full Selene suite
has the same 76 environment failures on main and this change (io_uring is
denied). Rustfmt findings are unchanged from main. On DGX Spark GB10,
Qwen3.8 Flash Next FP4 TP1 with DFlash2 retained 99.9% WARM reuse at 64K
with up to eight concurrent requests under KV pressure. Other GPU and TP
configurations have not been tested.

Fixes NVIDIA#225

Design-Signed-Off-By: Codex (GPT-6); design-review=4d3a
Signed-off-by: vonP <thomas@picollin.fr>
Co-authored-by: Codex <codex@openai.com>
@shadownetX
shadownetX force-pushed the fix/warm-prefix-branch-resume branch from 49b964b to 8a77bd0 Compare November 8, 2026 07:49
Resolve the prefix-cache documentation conflict by documenting immediate
message checkpoint publication, close-ancestor row protection, and the
upstream DRAM pressure-based redundant-row policy. The existing scheduler
fix applies unchanged to main, with no additional Rust modifications.

Validation: the scheduler patch applies without conflicts; the affected
documentation sections were reconciled. Rust and GPU tests were not rerun.

Design-Signed-Off-By: Codex (GPT-6); design-review=ed22
Signed-off-by: vonP <thomas@picollin.fr>
shadownetX added a commit to shadownetX/spark-local-inference that referenced this pull request Nov 11, 2026
Port the still-missing Selene half of NVIDIA PR NVIDIA#227 onto the new
checkpoint allocator. v0.1.0 already offers message checkpoints eagerly,
so do not restore the obsolete Helios scheduler modifications.

Protect a parent row when a child lies within one physical KV page;
keep that guard for the parent's lifetime. Cover divergent WARM resume,
child eviction, and index reconstruction in CPU tests.

Validation: GitHub CI pending; DGX Spark WARM benchmark pending.
Assisted-by: ChatGPT (OpenAI)
shadownetX added a commit to shadownetX/spark-local-inference that referenced this pull request Nov 11, 2026
Port the still-missing Selene half of NVIDIA PR NVIDIA#227 onto the new
checkpoint allocator. v0.1.0 already offers message checkpoints eagerly,
so do not restore the obsolete Helios scheduler modifications.

Protect a parent row when a child lies within one physical KV page;
keep that guard for the parent's lifetime. Cover divergent WARM resume,
child eviction, and index reconstruction in CPU tests.

Validation: GitHub CPU CI requested again after 2026-11-11 Actions outage;
DGX Spark WARM benchmark pending.
Assisted-by: ChatGPT (OpenAI)
@shadownetX

Copy link
Copy Markdown
Contributor Author

Quick update: I can no longer reproduce #225 with HyperFlare v0.1.0 without this patch.

All nine complete benchmark runs maintained reliable WARM prefix reuse, including the 64K × 8-request scenarios.

I have posted the detailed results in #225.

Given the recent upstream cache changes and the additional host-cache retention cost introduced by this PR, I would prefer to reassess whether these changes are still necessary before rebasing or merging.

Happy to follow your recommendation.

@original-el8 original-el8 added triage:verify-for-closure May already be fixed. Submitter: retest cited fix; close if resolved or report remaining symptoms. and removed triage:review Proposed change needs code review; this does not imply merge readiness. labels Nov 13, 2026
@original-el8

Copy link
Copy Markdown
Collaborator

Marked triage:verify-for-closure: the reporter now reproduces reliable warm prefix reuse on v0.1.0 without this patch, including the workload from #225. The proposed publication/retention changes need a remaining failure against main before their extra retained rows are justified.

Please close this proposal if no current reproducer remains, or provide the workload and evidence that still require it. The successful campaign establishes the tested configuration, not a universal proof that every cache scheme is unaffected.

@shadownetX GitHub reports merge conflicts with main, confirmed locally with git merge-tree for PR head d6f097597e4d against main 97cfeb0001f1. Conflicting paths:

  • docs/prefix-cache-offload.md
  • helios/src/scheduler.rs
  • helios/src/scheduler/boundary_tests.rs

Please reconcile the branch with main and rerun the checks affected by the resolution.

@shadownetX shadownetX closed this Nov 13, 2026
@shadownetX
shadownetX deleted the fix/warm-prefix-branch-resume branch November 15, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:caching Prefix/KV reuse, cache retention, and model or payload cache behavior. area:scheduling Request scheduling, fairness, batching, and speculative-width selection. area:selene Selene shared prefix-cache pool, protocol, manager, and transfers. bug Something isn't working model:qwen3.8-flash-next Affected recipe or documented reproducer: qwen3.8-flash-next. Impact may be broader. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. priority:P2 Normal bug priority: workflow failure or diagnosis with narrower impact or an available workaround. triage:verify-for-closure May already be fixed. Submitter: retest cited fix; close if resolved or report remaining symptoms.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WARM prefix-cache regression under KV pressure on DGX Spark (Qwen3.8 Flash Next, TP1)

2 participants