Skip to content

logs : reduce - #23021

Merged
ggerganov merged 7 commits into
masterfrom
gg/logs-reduce
May 14, 2026
Merged

ggerganov merged 7 commits into
masterfrom
gg/logs-reduce

Conversation

@ggerganov

@ggerganov ggerganov commented May 13, 2026 •

Copy link
Copy Markdown
Member

Overview

Reducing the amount of logs that we print by default. Feedback is welcome about what to remove further and what to keep.

Additional information

  • Add new log level for the llama tools and examples: LOG_LEVEL_TRACE = 4
  • Update LOG_LEVEL_DEBUG from 4 to 5
  • Change all INFO logs coming from libllama, libmtmd and libggml* to LOG_LEVEL_TRACE
  • Update some of the logs in libcommon accordingly
  • Enable timestamps by default
  • Print available devices on startup
  • Add periodic slot generation speed logs
  • Print the selected log verbosity on start
  • Print server tasks sampling parameters on start in the trace logs

The old level of logging can be enabled by adding -lv 4 to the CLI args.

Requirements

@ggerganov
ggerganov requested review from a team and JohannesGaessler as code owners May 13, 2026 19:08
Comment on lines -752 to -754
if (!is_resume) {
mtmd_helper_log_set(common_log_default_callback, nullptr);
}

@ggerganov ggerganov May 13, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ngxson Wasn't sure what is the intent here of gating this with is_resume. I just moved the mtmd log initialization to the constructor server_context_impl(). Please confirm this is OK.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason why it's gated was because mtmd_helper_log_set is not thread-safe, so it should only be called once when the program starts.

although, there is another way, you can call mtmd_helper_log_set unconditionally in server_context_impl::init() function

@github-actions github-actions Bot added examples server ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels May 13, 2026
@ggerganov

ggerganov commented May 14, 2026 •

Copy link
Copy Markdown
Member Author

@ggml-org/maintainers After this change the server logs will be quite reduced by default. You can easily go back to the old amount of logs if you are used to them by adding -lv 4 to your command.

@pwilkin pwilkin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change, I like the added verbosity levels. Previously it was really hard to find a balance between standard mode that hid a lot of things and verbose mode that spammed tons of info on every token generated.

Comment on lines +622 to +625
server_context_impl() {
mtmd_helper_log_set(common_log_default_callback, nullptr);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also be fine

@CISC CISC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice.

Comment thread common/log.h Resolved
Comment thread tools/mtmd/mtmd-helper.cpp Resolved
@ggerganov
ggerganov merged commit 67b2b7f into master May 14, 2026
19 checks passed
@ggerganov
ggerganov deleted the gg/logs-reduce branch May 14, 2026 10:05
Bikkies added a commit to Bikkies/llama.cpp that referenced this pull request May 17, 2026
- Opt-in flag that surfaces the per-device free-memory probe table (currently TRACE-only after ggml-org#23021) at INFO when set; default off.
baramofme pushed a commit to baramofme/llama-cpp-turboquant that referenced this pull request May 23, 2026
* logs : reduce

* args : fix envs

* server : fix build

* common : print verbosity level at start

* server : clean-up logs

* server : print prompt processing timings + sampling params

* minor : whitespaces
@ggerganov ggerganov mentioned this pull request Jun 27, 2026
kainlan added a commit to kainlan/llama.cpp-intel-optimizations that referenced this pull request Aug 1, 2026
ggml_check_sycl()'s "Running with Environment Variables:" block has produced
no output since 2026-05-14 and the cause is neither of the two obvious ones.
It IS called on the registry path (ggml_backend_dev_init ->
ggml_backend_sycl_device_init -> ggml_backend_sycl_init -> ggml_check_sycl),
and it runs after the log callback is installed. The block executes; the
output is then discarded.

ROOT CAUSE, AND IT IS NOT A SYCL BUG. Upstream 67b2b7f ("logs : reduce",
ggml-org#23021) made common_get_verbosity() in common/log.cpp map GGML_LOG_LEVEL_INFO
to LOG_LEVEL_TRACE (4), while common_log_verbosity_thold defaults to
LOG_DEFAULT_LLAMA = LOG_LEVEL_INFO (3). common_log_default_callback then tests
4 <= 3, which is false, so it drops EVERY library and backend GGML_LOG_INFO
line at default verbosity. This silently affects every backend's init output,
not just SYCL: "Found N SYCL devices:" went dark on the same commit, as did
llama.cpp's own llama_model_loader: and print_info: lines. Anyone debugging
"my backend prints nothing at startup" on CUDA, Vulkan or Metal is looking at
the same mechanism.

Verified by running the same Mistral gate twice. With default flags the run
shows 58 seconds of model loading with zero library output; adding -v to the
identical command brings all of it back, env block included. The one SYCL line
that survives (GGML_SYCL_F16 build:) carries no timestamp prefix because it is
a raw fprintf in fattn.cpp, bypassing the log system entirely.

This also explains why a `llama-bench -v` run showed nothing either: -v there
only suppresses llama-bench's own null log callback, it never raises
common_log_verbosity_thold, so common_log_default_callback still filters.

Adding a WARN line naming only the settings whose parsed value is non-default.
WARN (2) clears the default threshold; a stock run prints nothing extra, so
benchmark output and existing log captures are unchanged (diffed against a
pre-change capture: identical modulo timings). Values are read back from the
parsed g_ggml_sycl_* globals rather than getenv, so a misspelled variable is
correctly absent instead of being echoed back as if it had taken effect --
which would deepen the very ambiguity this fixes.

The INFO table is left alone. It is correct code, -v-only like the rest of the
backend banners; promoting 25 lines of SYCL-specific output above the
threshold while llama.cpp's own model info stays hidden would be noise and a
gratuitous divergence from upstream log policy.

The gate is a RUNTIME test, not a source assertion: the reporting code was
present and correct the whole time and only its output vanished, which no
source assertion can see. test-sycl-env-report installs a capturing
ggml_log_set callback before the first init (the static `initialized` guard
gives no second chance), drives the real registry -> dev_init path, and
asserts the report both names the variable that was set and does NOT name one
left at its default -- the negative half is what stops a report that printed
everything unconditionally from passing. Labelled sycl;env, deliberately not
cache/mem-handle/residency, which the throttled sweep excludes; pinned to
level_zero:1 so a bare ctest stays off the measurement card.

Refs: llama.cpp-5bd8

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EHYpYxXNwtkx2t8dQJNumx
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
* logs : reduce

* args : fix envs

* server : fix build

* common : print verbosity level at start

* server : clean-up logs

* server : print prompt processing timings + sampling params

* minor : whitespaces
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
* logs : reduce

* args : fix envs

* server : fix build

* common : print verbosity level at start

* server : clean-up logs

* server : print prompt processing timings + sampling params

* minor : whitespaces
Lightheartdevs added a commit to Osmantic/ODS that referenced this pull request Sep 25, 2026
Unverified placement now fails. From llama.cpp b9151 the "offloaded N/M
layers to GPU", buffer and fit lines are logged at verbosity 4 (trace),
not the default 3 (ggml-org/llama.cpp#23021). b9360+ reads the threshold
from LLAMA_ARG_LOG_VERBOSITY (#23778). A pin bump to b11146/v0.5.0 would
have turned every host's check into "unknown", which passed.

- ods doctor: a loaded ODS-managed GPU llama-server whose load log states
  no placement is "unverified": a blocker (ODS-LLM-GPU-PLACEMENT-UNVERIFIED),
  exit 1. Lemonade, external LLMs, CPU-only installs and a missing log are
  skipped. A rotated-out load section stays a warning, and so does a load
  still in progress.
- docker-compose.base.yml passes LLAMA_ARG_LOG_VERBOSITY=4. b9014 ignores
  the name and prints placement at its default. Captured on tower2: b11146
  at 4 prints placement and logs about as many lines per request as b9014
  does at its default.
- tests/contracts/test-llama-placement-log.py: every pinned llama.cpp build
  must have a captured load log that the doctor parser reads. The host
  agent's parser is checked too once it exists. Moving a pin fails CI until
  a log from the new build is captured and parsed; b9151+ also needs the
  verbosity wiring, and native pins need -lv 4. Wired into test-linux.yml
  with the residency tests, which CI did not run before.
- Dashboard: an unverified placement from a loaded container/native server
  is shown as "GPU placement unverified", drops "Fits GPU" and is not
  recorded as GPU speed.

Fix advice follows llama.cpp's own fit numbers. On the idle 8 GB laptop
(6492 MiB needed, 6860 MiB free, 1024 MiB default margin) doctor and the
Models page no longer say to close GPU apps. They say to reload the model
(ODS re-fits it) or set LLAMA_ARG_FIT_TARGET=512 / LLAMA_ARG_UBATCH=256.
"Free memory or shrink" advice is kept for a GPU that really is full.
"Reload on GPU" in the context dialog sends {"reload": true}, which
activates the running model again instead of returning already_active.

MoE expert overflow and CPU KV with every layer on the GPU no longer read
"Model partly on CPU (49/49 layers on GPU)".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lightheartdevs added a commit to Osmantic/ODS that referenced this pull request Sep 25, 2026
Unverified placement now fails. From llama.cpp b9151 the "offloaded N/M
layers to GPU", buffer and fit lines are logged at verbosity 4 (trace),
not the default 3 (ggml-org/llama.cpp#23021). b9360+ reads the threshold
from LLAMA_ARG_LOG_VERBOSITY (#23778). A pin bump to b11146/v0.5.0 would
have turned every host's check into "unknown", which passed.

- ods doctor: a loaded ODS-managed GPU llama-server whose load log states
  no placement is "unverified": a blocker (ODS-LLM-GPU-PLACEMENT-UNVERIFIED),
  exit 1. Lemonade, external LLMs, CPU-only installs and a missing log are
  skipped. A rotated-out load section stays a warning, and so does a load
  still in progress.
- docker-compose.base.yml passes LLAMA_ARG_LOG_VERBOSITY=4. b9014 ignores
  the name and prints placement at its default. Captured on tower2: b11146
  at 4 prints placement and logs about as many lines per request as b9014
  does at its default.
- tests/contracts/test-llama-placement-log.py: every pinned llama.cpp build
  must have a captured load log that the doctor parser reads. The host
  agent's parser is checked too once it exists. Moving a pin fails CI until
  a log from the new build is captured and parsed; b9151+ also needs the
  verbosity wiring, and native pins need -lv 4. Wired into test-linux.yml
  with the residency tests, which CI did not run before.
- Dashboard: an unverified placement from a loaded container/native server
  is shown as "GPU placement unverified", drops "Fits GPU" and is not
  recorded as GPU speed.

Fix advice follows llama.cpp's own fit numbers. On the idle 8 GB laptop
(6492 MiB needed, 6860 MiB free, 1024 MiB default margin) doctor and the
Models page no longer say to close GPU apps. They say to reload the model
(ODS re-fits it) or set LLAMA_ARG_FIT_TARGET=512 / LLAMA_ARG_UBATCH=256.
"Free memory or shrink" advice is kept for a GPU that really is full.
"Reload on GPU" in the context dialog sends {"reload": true}, which
activates the running model again instead of returning already_active.

MoE expert overflow and CPU KV with every layer on the GPU no longer read
"Model partly on CPU (49/49 layers on GPU)".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) examples ggml changes relating to the ggml tensor library for machine learning server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants