Repository navigation
Conversation
96e1d22 to
d21082b
Compare
d21082b to
22e3b62
Compare
22e3b62 to
077c71f
Compare
|
Hi @ngxson, could you take a look at this |
…saves-for-cache_prompt=false-tasks
|
So it looks like the merge of master in 208449a dropped the |
|
Good catch. The merge in |
Overview
This PR clears a slot when a
cache_prompt = falsetask ends and skips its prompt-reuse checkpoints. This prevents automatic RAM-cache saves of that task's own state and avoids checkpoint work on recurrent, hybrid and SWA models.This extends the clear-on-release approach used for stateless tasks in #30498, without adding per-slot state.
Before overwriting the slot, a no-cache task saves the displaced conversation when RAM caching is available. It also skips loading cached prompts it cannot use.
Policy change: later requests cannot reuse a no-cache task's state, even on full-attention models, and a subsequent explicit slot save finds an empty slot. With
--cache-ram 0, even a failed no-cache request can discard the previous conversation. The new behavior is documented intools/server/README.md.Benchmark Summary
gfx1100/ RDNA3); Vulkan, RADV / Mesa26.0.8-1ubuntu0.3, kernel7.0.0-38-generic--ctx-size 32768 --cache-ram 20480 -b 2048 -ub 2048 --parallel 1-ctk f16 -ctv f16 --flash-attn on --spec-type draft-mtp --spec-draft-n-max 30ce8cd114versus22e3b6236(tested tree9342ff0d);A-B-B-An_predict = 1) and 12 following cache-enabled requests with unique 1.4-1.9k-token prompts; no cache hitsFollowing-request prompt evaluation stayed similar: 2663.1 -> 2664.1 ms. A separate conversation follow-up after a probe reused 8400 tokens with identical output on both builds.
The policy has a measured cost: continuing a 2.9k-token no-cache prompt reprocessed 2880 tokens instead of reusing 2879; prompt time increased from 148 to 4496 ms in that check.
Testing: 28/28 CPU cases pass across
test_kv_keep_only_active.pyandtest_slot_save.py. Four new tests fail on master; the checkpoint test also catches removal of the checkpoint gate. On GPU, a 2.9k-token no-cache request created 0 checkpoints versus 2 on master.Requirements