Repository navigation
docs: explain shared Llama instance concurrency - #2394
Draft
karthiksenv wants to merge 1 commit into
Draft
karthiksenv wants to merge 1 commit into
karthiksenv wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Concurrent inference on one
Llamainstance shares mutable batch/context state and can abort in native code, as reported in #2392. The README currently does not explain this limitation.Add a shared-instance locking example for embeddings and a streaming example that holds the lock through iteration and closes the generator before releasing it. Link the section from Embeddings and note the synchronous-worker constraint. This addresses the documentation part of #2392; it does not add internal locking or parallel inference.
Validation:
llama_cppandtests(29 files formatted).git diff --checkpassed.python -m mkdocs build --cleanpassed, and the generated heading/navigation/embeddings links were checked. Existing relative-link, docstring and theme-deprecation warnings remain.Native model tests and independent reproduction of the reported crash were not run. Source inspection confirms shared
_batch/context mutation and the generator returned bycreate_completion(stream=True). Keeping this draft for review of the documentation scope and remaining validation.AI-assisted: Codex prepared the change and ran the checks above; the contributor authorized publication of this draft.