[PR #9384] [MERGED] ml/backend/ggml: fix debug logging #12939

Closed
opened 2026-04-13 00:13:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9384
Author: @mxyng
Created: 2/27/2025
Status: Merged
Merged: 2/27/2025
Merged by: @mxyng

Base: mainHead: mxyng/debug-logging


📝 Commits (1)

  • 3dedb3e ml/backend/ggml: fix debug logging

📊 Changes

3 files changed (+21 additions, -34 deletions)

View changed files

📝 llama/llama.go (+15 -22)
📝 ml/backend/ggml/ggml/src/ggml.go (+6 -11)
📝 runner/llamarunner/runner.go (+0 -1)

📄 Description

Debug logging was being set on init of both ./ml/backend/ggml/src and ./llama packages in that order. The new engine never calls llama.EnableDebug(), it means debug logging was never enabled regardless of OLLAMA_DEBUG. Since llama.cpp has its own logging, I've had to duplicate the log sink instead of removing it completely.

This change also reverts to using fmt.Fprintf rather than structured logging since some log statements, particularly in debug scenarios, assumes an unstructured log.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/9384 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 2/27/2025 **Status:** ✅ Merged **Merged:** 2/27/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/debug-logging` --- ### 📝 Commits (1) - [`3dedb3e`](https://github.com/ollama/ollama/commit/3dedb3e7a2f4dcfd3ab439e3dc8464cd789b7ed3) ml/backend/ggml: fix debug logging ### 📊 Changes **3 files changed** (+21 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `llama/llama.go` (+15 -22) 📝 `ml/backend/ggml/ggml/src/ggml.go` (+6 -11) 📝 `runner/llamarunner/runner.go` (+0 -1) </details> ### 📄 Description Debug logging was being set on `init` of both `./ml/backend/ggml/src` and `./llama` packages in that order. The new engine never calls `llama.EnableDebug()`, it means debug logging was never enabled regardless of `OLLAMA_DEBUG`. Since llama.cpp has its own logging, I've had to duplicate the log sink instead of removing it completely. This change also reverts to using `fmt.Fprintf` rather than structured logging since some log statements, particularly in debug scenarios, assumes an unstructured log. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:13:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#12939