llama_fit_params: return enum for fail vs. error#18374
Merged
JohannesGaessler merged 1 commit intoggml-org:masterfrom Dec 27, 2025
Merged
llama_fit_params: return enum for fail vs. error#18374JohannesGaessler merged 1 commit intoggml-org:masterfrom
JohannesGaessler merged 1 commit intoggml-org:masterfrom
Conversation
ngxson
approved these changes
Dec 26, 2025
732351d to
9bd5942
Compare
ggerganov
approved these changes
Dec 27, 2025
| mparams.tensor_buft_overrides = tensor_buft_overrides; | ||
| throw std::runtime_error("llama_params_fit_n_tensor_buft_overrides() == " | ||
| throw llama_params_fit_exception("llama_params_fit_n_tensor_buft_overrides() == " | ||
| + std::to_string(ntbo) + " is insufficient for model\n"); |
Member
There was a problem hiding this comment.
Suggested change
| + std::to_string(ntbo) + " is insufficient for model\n"); | |
| + std::to_string(ntbo) + " is insufficient for model"); |
| itbo++; | ||
| mparams.tensor_buft_overrides = tensor_buft_overrides; | ||
| throw std::runtime_error("llama_params_fit_n_tensor_buft_overrides() == " | ||
| throw llama_params_fit_exception("llama_params_fit_n_tensor_buft_overrides() == " |
Member
There was a problem hiding this comment.
The llama_params_fit_n_tensor_buft_overrides() symbol seems outdated?
Contributor
Author
|
Sorry, I was just a little bit too early. I'll add the changes to another, related PR. (Also I'll update the libllama changelog.) |
blime4
referenced
this pull request
in blime4/llama.cpp
Feb 5, 2026
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.
See discussion in #18236 .
This PR makes it so that
llama_params_fitreturns an enum rather than a boolean in order to differentiate between success, failure of the algorithm, and hard errors due to e.g. the model file not being found.