[PR #9918] [MERGED] kvcache: Account for source tensors in defrag operation count #13094

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9918
Author: @jessegross
Created: 3/20/2025
Status: Merged
Merged: 3/21/2025
Merged by: @jessegross

Base: mainHead: jessegross/defrag


📝 Commits (1)

  • a60fb13 kvcache: Account for source tensors in defrag operation count

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 kvcache/causal.go (+3 -2)

📄 Description

Defragging the KV cache can generate a lot of operations, so we need to be careful that we don't overflow the number that the graph can support. We currently account for all of the nodes that we add to the graph for each move but we also need to include the original cache tensors as well.

Fixes #9904


🔄 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/9918 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 3/20/2025 **Status:** ✅ Merged **Merged:** 3/21/2025 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/defrag` --- ### 📝 Commits (1) - [`a60fb13`](https://github.com/ollama/ollama/commit/a60fb13138dd8b8a46363b3389254c7cd19c0f14) kvcache: Account for source tensors in defrag operation count ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `kvcache/causal.go` (+3 -2) </details> ### 📄 Description Defragging the KV cache can generate a lot of operations, so we need to be careful that we don't overflow the number that the graph can support. We currently account for all of the nodes that we add to the graph for each move but we also need to include the original cache tensors as well. Fixes #9904 --- <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:17:58 -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#13094