Skip to content

UPSTREAM PR #18266: llama: fix magic number of 999 for GPU layers#653

Closed
loci-dev wants to merge 1 commit intomainfrom
upstream-PR18266-branch_JohannesGaessler-llama-fp-ngl-magic-number
Closed

UPSTREAM PR #18266: llama: fix magic number of 999 for GPU layers#653
loci-dev wants to merge 1 commit intomainfrom
upstream-PR18266-branch_JohannesGaessler-llama-fp-ngl-magic-number

Conversation

@loci-dev
Copy link

Mirrored from ggml-org/llama.cpp#18266

Fixes ggml-org/llama.cpp#18258 .

As of right now llama_params_fit is disabled if the user sets a values other than the default values. However, because the default value for the number of GPU layers is 999 this is a value that a user could feasibly set manually without this being recognized by the code. This PR makes it so that the llama API explicitly recognizes negative values for n_gpu_layers to mean all layers should be put on the GPU, the default is changed to -1. For CLI arguments a value of -1 means llama_params_fit, other negative values mean all layers on GPU.

Also this PR fixes a minor bug where a print in llama_params_fit where the sum of total memory rather than the sum of free memory is printed.

@loci-dev loci-dev force-pushed the main branch 5 times, most recently from 26a6f0f to cf53bc9 Compare December 22, 2025 14:09
@DajanaV DajanaV closed this Dec 22, 2025
@DajanaV DajanaV deleted the upstream-PR18266-branch_JohannesGaessler-llama-fp-ngl-magic-number branch December 22, 2025 14:36
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.

3 participants