fix(llama-cpp): consistently select fallback #3789
Merged
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.
Description
We didn't took in consideration the case where the host has the CPU flagset, but the binaries were not actually present in the asset dir. This problem was extended also to GPU detection, as it was relying on the fallback backend to be present and be compiled with GPU support.
This made possible for instance for models that specified the llama-cpp backend directly in the config to not eventually pick-up the fallback binary in case the optimized binaries were not present.
To reproduce: have a model specifying the backend "llama-cpp" manually, and have only the fallback binaries in the build assets ( neither AVX specific or GPU ones )
Notes for Reviewers
It does some refactoring around picking up the correct binary, and reduces complexity of the code.
Should fix #3727 and also fix #3673
Signed commits