awslabs / awslabs/keys_values

Support different cache types for each layer. Gradient computations when all or some caches are of type `DenseKVCache`

Open
#10 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
18
Forks
8
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

Currently, `DenseKVCache` cannot be used. This is because we need a fixed cache length and assume the buffers will be of this size most of the time. Also, it is unclear whether different cache types per layer are supported.

**Describe the solution you'd like**

I can use `DenseKVCache` for some or all layers. At any given point, memory only scales with the current cache size. Updates of the cache are of the `cat` type only.

This may be simple. We also want to make sure that different cache types per layer are supported.

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the cache implementation and the gradient-computation path, then determine how cache types are selected per layer. Done means DenseKVCache works for some or all layers, memory follows the current cache size, and cache updates use concatenation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.