[PR #12747] [MERGED] kvcache: Remove special case for reservation mask #60636

Closed
opened 2026-04-29 15:43:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12747
Author: @jessegross
Created: 10/22/2025
Status: Merged
Merged: 10/23/2025
Merged by: @jessegross

Base: mainHead: jessegross/cast


📝 Commits (1)

  • 917f07b kvcache: Remove special case for reservation mask

📊 Changes

1 file changed (+1 additions, -11 deletions)

View changed files

📝 kvcache/causal.go (+1 -11)

📄 Description

We currently short circuit generation of the cache mask and just generate an empty tensor of the correct size. However, in some cases, this can also skip a cast operation. This can result in the worst case graph being not fully worst case.

We don't actually need the fast path for mask generation, so it's better to just use the normal code path.


🔄 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/12747 **Author:** [@jessegross](https://github.com/jessegross) **Created:** 10/22/2025 **Status:** ✅ Merged **Merged:** 10/23/2025 **Merged by:** [@jessegross](https://github.com/jessegross) **Base:** `main` ← **Head:** `jessegross/cast` --- ### 📝 Commits (1) - [`917f07b`](https://github.com/ollama/ollama/commit/917f07bd442c4c05b7b3382afd2f2a55fe5525a2) kvcache: Remove special case for reservation mask ### 📊 Changes **1 file changed** (+1 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `kvcache/causal.go` (+1 -11) </details> ### 📄 Description We currently short circuit generation of the cache mask and just generate an empty tensor of the correct size. However, in some cases, this can also skip a cast operation. This can result in the worst case graph being not fully worst case. We don't actually need the fast path for mask generation, so it's better to just use the normal code path. --- <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-29 15:43:05 -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#60636