Skip to content

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
@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