Repository navigation
help please?!!! #2067
Replies: 3 comments
|
I originally thought that the disk was only used for persistence, and that upon startup, the KV cache would be paged back into memory or GPU memory. Isn't that how it works? |
|
Good question — the confusion is understandable, but 1. What So no, nothing "bypasses GPU memory and system RAM". The disk only stores past results so identical prompts can be served without re-running the model — and it persists across restarts, which is its whole point vs 2. Where the real KV cache lives 3. About performance 4. Your mental model, corrected Rule of thumb: repeated prompts -> keep disk cache; unique prompts every time -> disable it. |
|
The lookup does not mean inference reads its active state directly from disk. An important correction to the earlier answer: this cache stores In the current source, the completion path retrieves a state for a matching token prefix, compares it with the state already in memory, and calls
Disk I/O and state-copy overhead can matter; whether caching helps depends on the prefix computation saved and the state size. Seeing This is a source-level check of the linked revision, not a GPU performance measurement; your installed version may differ. |
Uh oh!
There was an error while loading. Please reload this page.
need some clarification. When using llama-cpp-python to start the server API with options --cache true --cache_type disk, I noticed that every time I query the model, it triggers

LlamaDiskCache.getitem. Does this mean that when using LlamaDiskCache in this way, the KV cache read/write completely bypasses GPU memory and system RAM, directly accessing the KV cache on disk? Wouldn't that be much slower?
All reactions