Skip to content

llama : try to avoid context swap #2060

Closed
@ggerganov

Description

@ggerganov

Currently, when the context becomes full, we pick part of the tokens and recompute the KV cache.

Instead, try to either:

  • store non-RoPEd KV cache, "shift" it when the context is full and compute the RoPE over the entire cache for every new token taking into account the current positions
  • store RoPEd KV cache (as we do now), "shift" it when the context is full and apply extra shift-RoPE on it (assuming RoPE is "additive")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions