Skip to content

Revert "server : add --cache-disk for a persistent prompt cache" (#81) - #154

Merged
dzannotti merged 1 commit into
masterfrom
revert/prompt-cache-disk
Oct 8, 2026
Merged

dzannotti merged 1 commit into
masterfrom
revert/prompt-cache-disk

Conversation

@dzannotti

Copy link
Copy Markdown
Collaborator

Reverts #81 (persistent prompt cache on disk, --cache-dir / --cache-dir-max, by @storm1er). The feature is wearing out users' SSDs, so it comes out until it can return with bounded writes.

Why

Two user reports:

  • ~1.6 TB written to NVMe in about an hour with --cache-dir on the ROCm build (b1015). On a RAM disk, a single 750 MB save never finished and kept rewriting the same file: 40 GB in 4 minutes. The CPU-only build writes it once.
  • Decode slowed to almost zero during a Hermes session with a ~75k-token context, while the cache directory took 5+ GB/s of continuous writes from kernel writeback threads (ext4, default mount options, master 4e0d917). The writes continued after the client was killed and stopped only when llama-server exited.

Cause: saves and restores copy the slot state straight between the GPU and a MAP_SHARED cache file. The ROCm runtime pins the mapped pages for that copy. Writeback then keeps rewriting the file for as long as the server runs. Credit for the diagnosis goes to the first reporter.

Repro on a Ryzen AI Max+ 395 (gfx1151): Qwen3-1.7B Q8_0, -c 32768 -np 1 --cache-dir, ext4 on a RAM-backed loop device. One 4.5k-token prompt was saved (503 MiB), then the server was left idle. Writes reached 5.7 GB within 60 s and were still climbing at ~208 MiB/s.

#149 has a fix that stages the copy through RAM. With it, that entry is written once. Even so, an agent-style workload (a growing conversation plus one side request per turn) wrote 5.8 GB over 10 turns. Every turn saves the whole state again, and the older entries stay on disk until --cache-dir-max. A safe version needs bounded writes, not just the fix.

Effect

  • --cache-dir and --cache-dir-max are gone. A config that still passes them fails at startup with error: invalid argument: --cache-dir. Use --cache-ram instead.
  • The in-memory prompt cache (--cache-ram) is unchanged.

Checks

  • Clean revert of 0f36c46. The commits merged since (dashboard, --ple) touch the same files but don't depend on the feature, and no reference to it remains.
  • HIP build (gfx1151): OK.
  • Smoke test with --cache-ram 4096: re-sending a 4.6k-token prompt after a different one reuses 4573 of 4574 tokens, with output identical to the first run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G5NBdiBqRmGomhSRXBoucx

This reverts commit 0f36c46, reversing
changes made to 307c50d.

--cache-dir drives runaway disk writes on ROCm: the slot state is copied
straight between the GPU and a MAP_SHARED file, the runtime pins the
mapped pages, and writeback keeps rewriting the file until the server
exits. Users reported ~1.6 TB written to NVMe in an hour, and decode
stalling under 5+ GB/s of continuous writes with a 75k-token context.
Reproduced on gfx1151: one 503 MiB entry became 5.7 GB of writes within
60 s of idle. Even with that fixed (#149), an agent-style workload
rewrites the whole state on every turn. Remove the feature until it
can come back with bounded writes; --cache-ram is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5NBdiBqRmGomhSRXBoucx
@github-actions github-actions Bot added documentation Improvements or additions to documentation server labels Oct 8, 2026
@dzannotti
dzannotti merged commit 2e7bfc2 into master Oct 8, 2026
11 of 12 checks passed
@dzannotti
dzannotti deleted the revert/prompt-cache-disk branch October 8, 2026 00:21
dzannotti added a commit that referenced this pull request Oct 8, 2026
Brings back #81 by @storm1er (reverted in #154 after the ROCm write
storm reports), so the fixes that follow can land on top of it.

This reverts commit a3a9bb3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5NBdiBqRmGomhSRXBoucx
rcfa pushed a commit to rcfa/strix-llama.cpp that referenced this pull request Oct 23, 2026
…lo-box#81)

Brings back halo-box#81 by @storm1er (reverted in halo-box#154 after the ROCm write
storm reports), so the fixes that follow can land on top of it.

This reverts commit a3a9bb3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5NBdiBqRmGomhSRXBoucx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant