Skip to content

llama : refactor kv cache guard #12695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 2, 2025
Merged

llama : refactor kv cache guard #12695

merged 8 commits into from
Apr 2, 2025

Conversation

ggerganov
Copy link
Member

@ggerganov ggerganov commented Apr 1, 2025

Simplify the KV cache guard mechanism. Prepare for separate recurrent cache implementation.

Also, llama_decode now correctly returns 1 when the batch cannot fit in the KV cache and the KV cache state is correctly restored upon failure to process the batch.

@ggerganov ggerganov merged commit a10b36c into master Apr 2, 2025
1 check passed
@ggerganov ggerganov deleted the gg/llama-kv-cache-v4 branch April 2, 2025 11:33
@LostRuins
Copy link
Collaborator

After this commit, it seems like RNN based models like RWKV don't work anymore, and asset at llama-kv-cache.cpp:594: GGML_ASSERT(empty_cell.is_empty()) failed. Reverting the early return line at

return true;
seems to allow RWKV to work again.

cc: @MollySophia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants