Skip to content

android : Calculate required KV cache size by summing up tokens size and response token length (#12211) #12212

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 1 commit into from
Mar 6, 2025

Conversation

hanyin-arm
Copy link
Contributor

Calculate required KV cache size by summing up tokens size and response token length.

previously:
auto n_kv_req = tokens_list.size() + (n_len - tokens_list.size());

now:
auto n_kv_req = tokens_list.size() + n_len;

@ggerganov ggerganov merged commit 57b6abf into ggml-org:master Mar 6, 2025
47 checks passed
@ggerganov
Copy link
Member

Looks like the n_kv_req is use just to print an error message, so this change should not affect the output of the example.

mglambda pushed a commit to mglambda/llama.cpp that referenced this pull request Mar 8, 2025
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issues specific to Android examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants