Skip to content

server : fix slot selection by lru#10126

Merged
ggerganov merged 2 commits into
ggml-org:masterfrom
sasha0552:sss-more-fixes
Nov 2, 2024
Merged

server : fix slot selection by lru#10126
ggerganov merged 2 commits into
ggml-org:masterfrom
sasha0552:sss-more-fixes

Conversation

@sasha0552

@sasha0552 sasha0552 commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

As a result of the refactoring, the value of t_last_used is now not updated when a slot is released, so it is always -1, which causes the first slot to always be selected by LRU. This PR fixes this.

That's how it used to be

https://github.com/ggerganov/llama.cpp/blob/7a16ce7db2a74a223f0f3b9cee66d4539c5bce8f/examples/server/server.cpp#L1868-L1883

Also this PR:

  • Migrates the use of int to size_t in the LCS function
  • Fixes the LCS debug log message (the selected slot's similarity is now printed, not the similarity of the last slot).

@sasha0552

Copy link
Copy Markdown
Contributor Author

@ngxson Could you please review this PR when you have a chance? Thank you!

@ggerganov ggerganov merged commit 42cadc7 into ggml-org:master Nov 2, 2024
@sasha0552 sasha0552 deleted the sss-more-fixes branch November 2, 2024 16:48
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
phibya pushed a commit to ziee-ai/llama.cpp that referenced this pull request May 29, 2026
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
* server : fix slot selection by lru, migrate lcs to `size_t`

* minor debug log fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants