[PR #13490] cleanup attention #45483

Open
opened 2026-04-25 01:11:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13490
Author: @mxyng
Created: 12/16/2025
Status: 🔄 Open

Base: mainHead: mxyng/cleanup-attention


📝 Commits (4)

📊 Changes

30 files changed (+228 additions, -277 deletions)

View changed files

📝 fs/ggml/ggml.go (+0 -4)
📝 ml/backend.go (+1 -28)
📝 ml/backend/ggml/ggml.go (+89 -80)
📝 ml/nn/attention.go (+17 -36)
ml/nn/attention/options.go (+55 -0)
📝 model/models/bert/embed.go (+1 -2)
📝 model/models/deepseek2/model.go (+17 -15)
📝 model/models/deepseekocr/model_sam.go (+5 -15)
📝 model/models/deepseekocr/model_text.go (+1 -3)
📝 model/models/deepseekocr/model_vision.go (+1 -1)
📝 model/models/gemma2/model.go (+11 -24)
📝 model/models/gemma3/model_text.go (+2 -2)
📝 model/models/gemma3/model_vision.go (+1 -3)
📝 model/models/gemma3n/model_text.go (+4 -3)
📝 model/models/gptoss/model.go (+4 -4)
📝 model/models/llama/model.go (+1 -2)
📝 model/models/llama4/model_text.go (+1 -1)
📝 model/models/llama4/model_vision.go (+1 -1)
📝 model/models/mistral3/model_text.go (+1 -1)
📝 model/models/mistral3/model_vision.go (+1 -1)

...and 10 more files

📄 Description

this change updates the attention interface to be more extensible. specifically it moves most attention features like attention sinks, multi-latent attention, logit softcapping, to a functional options pattern to reduce function permutations. this allows additional features like custom masks without adding a new top-level function and feature mixing


🔄 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/13490 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 12/16/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `mxyng/cleanup-attention` --- ### 📝 Commits (4) - [`de82b1f`](https://github.com/ollama/ollama/commit/de82b1f9a3881987f658999382dbd764f4b0b538) cleanup attention interface - [`baae175`](https://github.com/ollama/ollama/commit/baae175ebe533fa61e79b405fbfe77ba5b553634) cleanup - [`f49797f`](https://github.com/ollama/ollama/commit/f49797fbdb154b797c180519a823aab4e9a427fa) generic pad - [`89637ae`](https://github.com/ollama/ollama/commit/89637ae43bd7c0873b109b76ed30ab59157fa3af) gemma2: enable flash attention ### 📊 Changes **30 files changed** (+228 additions, -277 deletions) <details> <summary>View changed files</summary> 📝 `fs/ggml/ggml.go` (+0 -4) 📝 `ml/backend.go` (+1 -28) 📝 `ml/backend/ggml/ggml.go` (+89 -80) 📝 `ml/nn/attention.go` (+17 -36) ➕ `ml/nn/attention/options.go` (+55 -0) 📝 `model/models/bert/embed.go` (+1 -2) 📝 `model/models/deepseek2/model.go` (+17 -15) 📝 `model/models/deepseekocr/model_sam.go` (+5 -15) 📝 `model/models/deepseekocr/model_text.go` (+1 -3) 📝 `model/models/deepseekocr/model_vision.go` (+1 -1) 📝 `model/models/gemma2/model.go` (+11 -24) 📝 `model/models/gemma3/model_text.go` (+2 -2) 📝 `model/models/gemma3/model_vision.go` (+1 -3) 📝 `model/models/gemma3n/model_text.go` (+4 -3) 📝 `model/models/gptoss/model.go` (+4 -4) 📝 `model/models/llama/model.go` (+1 -2) 📝 `model/models/llama4/model_text.go` (+1 -1) 📝 `model/models/llama4/model_vision.go` (+1 -1) 📝 `model/models/mistral3/model_text.go` (+1 -1) 📝 `model/models/mistral3/model_vision.go` (+1 -1) _...and 10 more files_ </details> ### 📄 Description this change updates the attention interface to be more extensible. specifically it moves most attention features like attention sinks, multi-latent attention, logit softcapping, to a functional options pattern to reduce function permutations. this allows additional features like custom masks without adding a new top-level function and feature mixing --- <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-25 01:11:04 -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#45483