[PR #7675] [MERGED] runner.go: Increase survivability of main processing loop #23024

Closed
opened 2026-04-19 16:43:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/7675
Author: @jessegross
Created: 11/15/2024
Status: Merged
Merged: 11/15/2024
Merged by: @jessegross

Base: mainHead: jessegross/hang


📝 Commits (1)

  • 41c5043 runner.go: Increase survivability of main processing loop

📊 Changes

1 file changed (+18 additions, -0 deletions)

View changed files

📝 llama/runner/runner.go (+18 -0)

📄 Description

Currently, if an error occurs during the prep stages (such as tokenizing) of a single request, it will only affect that request. However, if an error happens during decoding, it can take down the entire runner.

Instead, it's better to drop the tokens that triggered the error and try to keep going. However, we also need to stop when we run out of tokens, otherwise, this just causes an infinite loop. This is likely the cause of at least some of the hanging issues that have been reported.

Bug #7573


🔄 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/7675 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 11/15/2024 **Status:** ✅ Merged **Merged:** 11/15/2024 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/hang` --- ### 📝 Commits (1) - [`41c5043`](https://github.com/ollama/ollama/commit/41c504372202d75924ba1361f17bc287584fd02f) runner.go: Increase survivability of main processing loop ### 📊 Changes **1 file changed** (+18 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `llama/runner/runner.go` (+18 -0) </details> ### 📄 Description Currently, if an error occurs during the prep stages (such as tokenizing) of a single request, it will only affect that request. However, if an error happens during decoding, it can take down the entire runner. Instead, it's better to drop the tokens that triggered the error and try to keep going. However, we also need to stop when we run out of tokens, otherwise, this just causes an infinite loop. This is likely the cause of at least some of the hanging issues that have been reported. Bug #7573 --- <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-19 16:43:22 -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#23024