[PR #1810] [CLOSED] feat: persist conversation checkpoints with RAM and disk restore #3692

Closed
opened 2026-11-07 15:30:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1810
Author: @CC-David-CC
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: fix/mtp-cache-token-parity


📝 Commits (10+)

  • 34e2409 serve: keep evicted conversations on disk across restarts
  • d258f18 serve: restore a session file without holding its K/V in RAM
  • 0d846c1 Merge remote-tracking branch 'upstream/main' into conversation-spill-disk
  • 1904b8a serve: recompute the RAM conversation match after a failed disk attempt: make_room may have evicted the entry the stale index named
  • 1a9e8b9 Merge remote-tracking branch 'upstream/main' into conversation-spill-disk
  • 3a5daf6 Merge branch 'pr-1269' into disk-only-cache
  • dd146f4 serve: --conversation-cache-disk-only - the conversation cache on disk, no RAM budget
  • b189048 conversation_spill_test: disk-only checks; docs: --conversation-cache-disk-only, measured on Strix Halo
  • ff30368 docs: --conversation-cache-disk-only restores measured from a cold page cache
  • 2987ac4 serve: disk-only cache keeps each conversation's root as a persistent prefix entry

📊 Changes

40 files changed (+7562 additions, -124 deletions)

View changed files

📝 CMakeLists.txt (+6 -1)
➕ bench/results/2026-10-11-cache-refresh/README.md (+81 -0)
➕ bench/results/2026-10-11-cache-refresh/cache-parity-disk-temp0.7.json (+552 -0)
➕ bench/results/2026-10-11-cache-refresh/cache-parity-disk-temp0.json (+468 -0)
➕ bench/results/2026-10-11-cache-refresh/cache-parity-ram-fallback-temp0.7.json (+552 -0)
➕ bench/results/2026-10-11-cache-refresh/cache-parity-ram-fallback-temp0.json (+468 -0)
➕ bench/results/2026-10-11-cache-refresh/cache-parity-ram-temp0.7.json (+552 -0)
➕ bench/results/2026-10-11-cache-refresh/cache-parity-ram-temp0.json (+468 -0)
➕ bench/results/2026-10-11-cache-refresh/provenance.json (+16 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/hip-policy-version-status.json (+24 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/new-default.txt (+44 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/new-repro.txt (+47 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/old-default.txt (+43 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/old-repro.txt (+43 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-disk-results.json (+552 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-ram-fallback-results.json (+552 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-result.json (+46 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-status.json (+21 -0)
➕ bench/results/2026-10-11-cache-refresh/session-policy/sycl-policy-version-status.json (+36 -0)
📝 docs/DETAILS.md (+150 -4)

...and 20 more files

📄 Description

Adds opt-in automatic disk-only conversation caching and disk fallback when RAM caching cannot admit a snapshot. Saved native state includes the appropriate main/draft layers; absent-MTP save/restore is handled without assuming a draft layer exists. Reproducible comparisons can keep caching enabled while fixing adaptive/CPU placement choices.

Refreshed onto current main, preserving the active-layer guard, current session-reclaim/min-token/memory-cap options and diagnostics. Disk admission now uses the current host/cgroup memory sampler. #1489's native snapshot implementation is already preserved here; #1667 retains its live integration probe and API-history work. The two surviving PRs were validated together.

Configure --conversation-cache-spill-dir DIR and --conversation-cache-disk-mib N, optionally --conversation-cache-disk-only; keep disposable validation state separate from deployed caches. Disk-only execution remains single-device. Defaults stay unchanged. Usage and reproducible token checks.

Fresh validation: six native cache/file/memory/spill/session-reclaim tests, combined serving suite (750 tests, 12 skipped), and all six exact-token configurations: RAM, disk-only and RAM-to-disk fallback, each greedy or seeded sampling (temperature 0.7, seed 12345), MTP width 2. Fresh A, switched-away A-return and repeated A output IDs matched, and returned conversations confirmed saved-prefix reuse. Combined Responses lifecycle checks passed 33/33 with MTP disabled; #1667 records the 32K checkpoint/retention probe.

CUDA model measurements used RTX PRO 6000 Blackwell / ISTA IQ3_XXS. HIP gfx1012 builds/native cache tests and SYCL builds/host cache tests passed; those checks do not claim fresh model parity on those backends. Fresh report, complete token IDs, scope and reproduction. Historical timings retain their original source/settings.

The reproducible policy now also forces STRATA_ROUTE_TAIL_SKIP=0; normal routing defaults remain unchanged. Policy version 2 is included only in reproducible saved-state fingerprints. Native tests verify ordinary old snapshot compatibility, refusal of unversioned reproducible snapshots without terminating the engine, and a new-policy save/restore roundtrip. Seeded disk/fallback parity and HIP/SYCL checks passed again after versioning. Old reproducible snapshots must be regenerated.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1810 **Author:** [@CC-David-CC](https://github.com/CC-David-CC) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/mtp-cache-token-parity` --- ### 📝 Commits (10+) - [`34e2409`](https://github.com/Niko1221/Strata/commit/34e24094a2214eaa14cde6a08cebc36f62926c18) serve: keep evicted conversations on disk across restarts - [`d258f18`](https://github.com/Niko1221/Strata/commit/d258f18920daf7c85a1c5fe407bf907d1fb9639a) serve: restore a session file without holding its K/V in RAM - [`0d846c1`](https://github.com/Niko1221/Strata/commit/0d846c168fa6f400d409574507c5bcd32b6771ee) Merge remote-tracking branch 'upstream/main' into conversation-spill-disk - [`1904b8a`](https://github.com/Niko1221/Strata/commit/1904b8abf542bc3c8177d8d18a22aea5da3d49c2) serve: recompute the RAM conversation match after a failed disk attempt: make_room may have evicted the entry the stale index named - [`1a9e8b9`](https://github.com/Niko1221/Strata/commit/1a9e8b95a185cfa3939bb3fdf1d5487411dd229f) Merge remote-tracking branch 'upstream/main' into conversation-spill-disk - [`3a5daf6`](https://github.com/Niko1221/Strata/commit/3a5daf640d68576876767e5926ed25e9b9e5629b) Merge branch 'pr-1269' into disk-only-cache - [`dd146f4`](https://github.com/Niko1221/Strata/commit/dd146f495534f950847ba8dfff93d9ec9d9712d2) serve: --conversation-cache-disk-only - the conversation cache on disk, no RAM budget - [`b189048`](https://github.com/Niko1221/Strata/commit/b18904801395080df9a5c42190dd5f227200b974) conversation_spill_test: disk-only checks; docs: --conversation-cache-disk-only, measured on Strix Halo - [`ff30368`](https://github.com/Niko1221/Strata/commit/ff30368e4f7ecf0e315d1b2fd7e05cc9bdbf5a75) docs: --conversation-cache-disk-only restores measured from a cold page cache - [`2987ac4`](https://github.com/Niko1221/Strata/commit/2987ac4307543db2b674c6d438ad9377281d5bc8) serve: disk-only cache keeps each conversation's root as a persistent prefix entry ### 📊 Changes **40 files changed** (+7562 additions, -124 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+6 -1) ➕ `bench/results/2026-10-11-cache-refresh/README.md` (+81 -0) ➕ `bench/results/2026-10-11-cache-refresh/cache-parity-disk-temp0.7.json` (+552 -0) ➕ `bench/results/2026-10-11-cache-refresh/cache-parity-disk-temp0.json` (+468 -0) ➕ `bench/results/2026-10-11-cache-refresh/cache-parity-ram-fallback-temp0.7.json` (+552 -0) ➕ `bench/results/2026-10-11-cache-refresh/cache-parity-ram-fallback-temp0.json` (+468 -0) ➕ `bench/results/2026-10-11-cache-refresh/cache-parity-ram-temp0.7.json` (+552 -0) ➕ `bench/results/2026-10-11-cache-refresh/cache-parity-ram-temp0.json` (+468 -0) ➕ `bench/results/2026-10-11-cache-refresh/provenance.json` (+16 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/hip-policy-version-status.json` (+24 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/new-default.txt` (+44 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/new-repro.txt` (+47 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/old-default.txt` (+43 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/old-repro.txt` (+43 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-disk-results.json` (+552 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-ram-fallback-results.json` (+552 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-result.json` (+46 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/session-policy-verified-status.json` (+21 -0) ➕ `bench/results/2026-10-11-cache-refresh/session-policy/sycl-policy-version-status.json` (+36 -0) 📝 `docs/DETAILS.md` (+150 -4) _...and 20 more files_ </details> ### 📄 Description Adds opt-in automatic disk-only conversation caching and disk fallback when RAM caching cannot admit a snapshot. Saved native state includes the appropriate main/draft layers; absent-MTP save/restore is handled without assuming a draft layer exists. Reproducible comparisons can keep caching enabled while fixing adaptive/CPU placement choices. Refreshed onto current main, preserving the active-layer guard, current session-reclaim/min-token/memory-cap options and diagnostics. Disk admission now uses the current host/cgroup memory sampler. #1489's native snapshot implementation is already preserved here; #1667 retains its live integration probe and API-history work. The two surviving PRs were validated together. Configure `--conversation-cache-spill-dir DIR` and `--conversation-cache-disk-mib N`, optionally `--conversation-cache-disk-only`; keep disposable validation state separate from deployed caches. Disk-only execution remains single-device. Defaults stay unchanged. [Usage and reproducible token checks](https://github.com/CC-David-CC/Strata-a5500/blob/d01538ec/docs/DETAILS.md). Fresh validation: six native cache/file/memory/spill/session-reclaim tests, combined serving suite (750 tests, 12 skipped), and all six exact-token configurations: RAM, disk-only and RAM-to-disk fallback, each greedy or seeded sampling (temperature 0.7, seed 12345), MTP width 2. Fresh A, switched-away A-return and repeated A output IDs matched, and returned conversations confirmed saved-prefix reuse. Combined Responses lifecycle checks passed 33/33 with MTP disabled; #1667 records the 32K checkpoint/retention probe. CUDA model measurements used RTX PRO 6000 Blackwell / ISTA IQ3_XXS. HIP gfx1012 builds/native cache tests and SYCL builds/host cache tests passed; those checks do not claim fresh model parity on those backends. [Fresh report, complete token IDs, scope and reproduction](https://github.com/CC-David-CC/Strata-a5500/blob/d01538ec/bench/results/2026-10-11-cache-refresh/README.md). Historical timings retain their original source/settings. The reproducible policy now also forces `STRATA_ROUTE_TAIL_SKIP=0`; normal routing defaults remain unchanged. Policy version 2 is included only in reproducible saved-state fingerprints. Native tests verify ordinary old snapshot compatibility, refusal of unversioned reproducible snapshots without terminating the engine, and a new-policy save/restore roundtrip. Seeded disk/fallback parity and HIP/SYCL checks passed again after versioning. Old reproducible snapshots must be regenerated. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:05 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3692
No description provided.