kv : change structures in kv-cells for improve operations asymptotic - #27061
kv : change structures in kv-cells for improve operations asymptotic#27061lexasub wants to merge 4 commits into
Conversation
|
@ngxson, also may be your review may good) |
|
Hi @lexasub, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
Multiple open PRs from a new contributor: Drafts don't count toward the limit. ) now i have only old draft commits. |
|
this change is quite excessive tbh, I doubt if this code path is hot enough to be consider we can proceed if you can proof if this brings significant end-to-end perf improvement (pp or tg measure) most of the time is spent on ggml's graph sched IIRC, kv cache management is just too small |
|
please use proper |
|
I don't see any significant improvements here, the PR's result is already within master's error margin |
|
okay, i go the deeper, llama-bench on profiling didn't show kv-cells usage( but via llama server i see it in profile), i will notify when kv cache give improvement on llama-bench in my opinion - llama-bench doesn't test prefill, tokenization. this mr improve prefil! |












Overview
Change containers for llama-kv-cache for boost lookup and modify
replace std::bitset<LLAMA_MAX_SEQ> -> uint64_t w[N_SEQ_WORDS]
replace std::map<llama_pos, int> seq_pos[LLAMA_MAX_SEQ] -> seq_pos_t seq_pos[LLAMA_MAX_SEQ]
Additional information
May be filled later after discussion
Requirements