[PR #6467] [MERGED] Fix embeddings memory corruption #12119

Closed
opened 2026-04-12 23:50:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/6467
Author: @dhiltgen
Created: 8/22/2024
Status: Merged
Merged: 8/22/2024
Merged by: @dhiltgen

Base: mainHead: embeddings


📝 Commits (2)

  • 8972fd2 Fix embeddings memory corruption
  • 9c33cd1 Fix embed integration test assumption

📊 Changes

4 files changed (+16 additions, -65 deletions)

View changed files

📝 integration/embed_test.go (+4 -4)
📝 llm/ext_server/server.cpp (+7 -1)
llm/patches/08-pooling.diff (+0 -60)
📝 server/sched.go (+5 -0)

📄 Description

The patch was leading to a buffer overrun corruption. Once removed though, parallism in server.cpp lead to hitting an assert due to slot/seq IDs being >= token count. To work around this, only use slot 0 for embeddings.

Fixes #6435


🔄 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/6467 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 8/22/2024 **Status:** ✅ Merged **Merged:** 8/22/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `embeddings` --- ### 📝 Commits (2) - [`8972fd2`](https://github.com/ollama/ollama/commit/8972fd221e25b7191ae26ffe24a39daf3fecb6b2) Fix embeddings memory corruption - [`9c33cd1`](https://github.com/ollama/ollama/commit/9c33cd14ce074a3889eca1aed4c730b04f39af93) Fix embed integration test assumption ### 📊 Changes **4 files changed** (+16 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `integration/embed_test.go` (+4 -4) 📝 `llm/ext_server/server.cpp` (+7 -1) ➖ `llm/patches/08-pooling.diff` (+0 -60) 📝 `server/sched.go` (+5 -0) </details> ### 📄 Description The patch was leading to a buffer overrun corruption. Once removed though, parallism in server.cpp lead to hitting an assert due to slot/seq IDs being >= token count. To work around this, only use slot 0 for embeddings. Fixes #6435 --- <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-12 23:50:01 -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#12119