feat:add support to invalidate KV cache via AllBlocksCleared event#437
feat:add support to invalidate KV cache via AllBlocksCleared event#437yash9263 wants to merge 14 commits intollm-d:mainfrom
Conversation
|
Unsigned commits detected! Please sign your commits. For instructions on how to set up GPG/SSH signing and verify your commits, please see GitHub Documentation. |
61fa5d4 to
f1691b7
Compare
f1691b7 to
ef9c002
Compare
…nvalidate-kv-cache
|
Hi @yash9263 - thank you for the contribution. One detail that may have not been clear from the issue: an event coming from a certain endpoint should only clear the latter's entries. E.g., if the index state maps |
Hi @vMaroon, apologies for the oversight and not clarifying this earlier. Given the indexes are structured engineKey -> requestKey -> podIdentifier, to remove all the blocks associated with a pod, it will require traversing each block to remove the pod mappings and remove the engineKey if the requestKey is empty or removed. For the Redis index, it may require multiple round-trips. Should we also consider deviceTier while evicting blocks for the given podIdentifier here as well? Since it was part of the original event struct:
Would it be viable to introduce a reverse index pod -> engineKey to make evicting all blocks for a pod more efficient? |
…nvalidate-kv-cache
… for pod-to-request key mappings Signed-off-by: yashwant <yashwant8530@gmail.com>
…nvalidate-kv-cache
5215b68 to
be894f6
Compare
…nvalidate-kv-cache
|
@vMaroon, ready for review. |
Signed-off-by: yashwant <yashwant8530@gmail.com>
|
@yash9263 I think you need rebase your PR to latest code to resolve conflict? |
Issue: #396
This PR adds support to Invalidate KV cache via the
AllBlocksClearedevent.AllBlocksClearedevent.Indexinterface and implemented it for all the index types (CostAwareMemoryIndex, InMemoryIndex, RedisIndex).Testing
pkg/kvcache/kvblock/index_test.goExamples:
kv_events/offlineandvalkey_exampleto simulate the Clear event.