Skip to content

Roll back small number of KV cache updates #76

Description

@mseeger

Is your feature request related to a problem? Please describe.
I'd like to be able to roll back a small number of KV cache updates, without having to checkpoint the full cache. Arises in different situations:

  • Evaluation: Compute different metrics, given the same prompt. Or sample different responses
  • Speculative decoding

Describe the solution you'd like
This is essentially just a special case of the annotations used in autograd_hooks.py. We need to store index and delta for every update, so that cache buffers can be restored. Ideally, this is supposed by some methods in the KVCache base class.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions