Skip to content
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

llama_decode lock #595

Merged
merged 2 commits into from
Mar 13, 2024
Merged

Conversation

martindevans
Copy link
Member

Added a lock object into SafeLlamaModelHandle which all calls to llama_decode (in the SafeLLamaContextHandle) lock first.

This prevents two contexts from running inference on the same model at the same time, which seems to be unsafe in llama.cpp. We may need an even wider lock (preventing inference on any two models simultaneously). Testing required.

…lama_decode` (in the `SafeLLamaContextHandle`) lock first. This prevents two contexts from running inference on the same model at the same time, which seems to be unsafe in llama.cpp.
…e necessary (at least with the CUDA backend).
@martindevans martindevans merged commit ce4de7d into SciSharp:master Mar 13, 2024
3 checks passed
@martindevans martindevans deleted the llama_decode_lock branch March 13, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant