Thanks to visit codestin.com
Credit goes to github.com

Skip to content

server : fix slot selection by lru #10126

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 2 commits into from
Nov 2, 2024
Merged

Conversation

sasha0552
Copy link
Contributor

@sasha0552 sasha0552 commented Nov 1, 2024

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
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
53 checks passed
@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
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