ggml-cpu: document use of "free" memory [no ci]#15834
Merged
JohannesGaessler merged 1 commit intoggml-org:masterfrom Sep 6, 2025
Merged
ggml-cpu: document use of "free" memory [no ci]#15834JohannesGaessler merged 1 commit intoggml-org:masterfrom
JohannesGaessler merged 1 commit intoggml-org:masterfrom
Conversation
Contributor
Author
|
Okay, so since the CI has failed with |
Member
|
When talking about system memory, it's hard to even define free memory, because memory can be used in caches that can be freed at any moment, or swapped to disk. llama.cpp does not use the value of free memory for the CPU backend. For practical purposes, IMO it's better to treat system memory as unlimited, or at worst limited only by the amount of physical memory. |
c0c431c to
33f0b80
Compare
Contributor
Author
|
Fine by me, I just think this should be documented. |
slaren
approved these changes
Sep 6, 2025
walidbr
pushed a commit
to walidbr/llama.cpp
that referenced
this pull request
Sep 7, 2025
blime4
referenced
this pull request
in blime4/llama.cpp
Feb 5, 2026
Seunghhon
pushed a commit
to Seunghhon/llama.cpp
that referenced
this pull request
Apr 26, 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.
While working on code for retrieving and reporting the memory use of llama.cpp I've noticed that the CPU backend always reports all of its memory as being free. This was implemented in #13304 . This behavior doesn't seem correct to me and there is no documentation indicating why this is being done so my impression is that this is a bug. This PR fetches the number of available pages to calculate the "free" memory - this tends to be an underestimation due to file caches being considered allocated memory. But I did not see any other suitable property in the
sysconfmanual.