Skip to content

Conversation

@rgerganov
Copy link
Collaborator

Use GGML_LOG_DEBUG() for debug messages and configure the logger to print them only when rpc-server is started with --verbose. Make sure we log a debug message for every server function.

@rgerganov rgerganov requested a review from slaren September 20, 2025 14:06
@github-actions github-actions bot added examples ggml changes relating to the ggml tensor library for machine learning labels Sep 20, 2025
Add --verbose to rpc-server and configure the ggml logger to print debug
messages only if set. Add helper macro LOG_DBG() which does an early
check of the verbose flag before calling GGML_LOG_DEBUG().
Make sure we log a debug message for every server function.
Comment on lines 23 to 25
GGML_BACKEND_API void ggml_backend_rpc_start_server(ggml_backend_t backend, const char * endpoint,
const char * cache_dir,
const char * cache_dir, bool verbose,
size_t free_mem, size_t total_mem);
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to keep this function as it is and read the verbosity level from an environment variable, for example GGML_RPC_DEBUG. The idea is to keep the API clean from verbosity/log related settings.

This way, in order to see the internal ggml-rpc debug logs, you can run:

GGML_RPC_DEBUG=1 rpc-server ... --verbose

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GGML_RPC_DEBUG=1 rpc-server ... --verbose

Why do we need both env variable and --verbose flag in this case? I am fine with using env variable but I don't see what --verbose is supposed to do in this case. Maybe set the environment variable?

Copy link
Member

Choose a reason for hiding this comment

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

Atm --verbose is redundant for rpc-server because the rpc-server has no verbose logging.

The convention in the rest of the tools is that --verbose enables verbosity for the tool-level logic. And if you additionally need extra debug logs from within libllama or libggml you control these with env variables. But these extra debug logs still require --verbose to be passed to the tool.

@rgerganov rgerganov merged commit c498fc8 into ggml-org:master Sep 25, 2025
62 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants