Skip to content

Commit 22a7fdb

Browse files
committed
patch(logger): filter out verbose noisy CUDA Graph debug logs
Add a temporary patch in `ggml_log_callback` to suppress the noisy `CUDA Graph id %zu reused` messages generated by the underlying C++ backend. A complete logger refactoring is planned for better log control in the future. Signed-off-by: JamePeng <jame_peng@sina.com>
1 parent a63f60e commit 22a7fdb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

llama_cpp/_logger.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def ggml_log_callback(
3232
text: bytes,
3333
user_data: ctypes.c_void_p,
3434
):
35+
# Note(JamePeng): A temporary patch is used to filter out garbage debug information
36+
# output from the underlying C++ `CUDA Graph id %zu reused`.
37+
# The logger is planned to be refactored to meet control requirements.
38+
if text:
39+
if b"CUDA Graph" in text or b"CUDA graph" in text:
40+
return
3541
# TODO: Correctly implement continue previous log
3642
global _last_log_level
3743
log_level = GGML_LOG_LEVEL_TO_LOGGING_LEVEL[level] if level != 5 else _last_log_level

0 commit comments

Comments
 (0)