huggingface / huggingface/nanoVLM

KV Cache getting prefilled and emptied during training phase

Open
#92 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5k
Forks
510
PR merge metrics
No merged PRs in 30d

Description

Although the KV cache implementation for inference looks good, the block_kv_cache is getting prefilled in the training phase leading to increase in compute and memory consumption.

https://github.com/huggingface/nanoVLM/blob/098db57e18b867aee604d8e8b2923b6bff1e6657/models/vision_language_model.py#L51

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in models/vision_language_model.py around line 51 and trace how block_kv_cache is populated during training. Confirm the training path avoids unnecessary cache prefill and that compute and memory consumption no longer increase; validate the behavior with a training run or the repository’s existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.