awslabs / awslabs/keys_values

Complete code for GPU memory estimation. Use for decision making

Open
#20 0 comments 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.**

LARGER PROJECT

`KVCache` classes have methods to estimate GPU memory a priori. We would like to extend this to capture all dominant sources of (1) baseline and (2) peak memory requirements. Based on this, we would like to optimize free parameters in order to optimally use the given GPU memory.

**Describe the solution you'd like**

This is simpler for inference. For gradient computation, we also need to take the computation graph into account.

The rationale is to make most hyperparameter choices automatically, in order to minimize running time subject to resource constraints.

**Describe alternatives you've considered**

Instead of an "exact" solution, we could also fit an ML model. This could be based on features for sizes of know memory blocks, and be fit on measurements of peak and baseline GPU memory.

Contributor guide

Open the contributing guide

Research direction

Start by locating the KVCache classes and their existing GPU-memory estimation methods. Read the inference and gradient-computation paths, then identify how baseline and peak GPU memory are measured or represented. Done means the project can account for dominant memory sources and use those estimates to guide hyperparameter choices under a GPU-memory constraint.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.