[PR #10789] [MERGED] fix: qwen25vl assign samebatch in multimodal input #39240

Closed
opened 2026-04-22 23:54:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10789
Author: @mxyng
Created: 5/21/2025
Status: Merged
Merged: 5/21/2025
Merged by: @mxyng

Base: mainHead: mxyng/fix-qwen25vl


📝 Commits (1)

  • 64fbec4 fix: qwen25vl assign samebatch in multimodal input

📊 Changes

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

View changed files

📝 model/models/qwen25vl/model.go (+2 -1)

📄 Description

setting samebatch on the vision start token is problematic because it will be shared with other inputs that also use images. this will cause the input to be cached and the runner will not see SameBatch. SameBatch will also be incorrect since it may be for a different image.

assigning samebatch to the input tokens resolves this by ensure it's assigned correctly to inputs corresponding to the image.

not setting same batch correctly may cause panics during inference since images are no longer guaranteed to be in the same batch.


🔄 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/10789 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 5/21/2025 **Status:** ✅ Merged **Merged:** 5/21/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/fix-qwen25vl` --- ### 📝 Commits (1) - [`64fbec4`](https://github.com/ollama/ollama/commit/64fbec4bd85fd30f991fcf23d8e5a7b44d5f1c36) fix: qwen25vl assign samebatch in multimodal input ### 📊 Changes **1 file changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `model/models/qwen25vl/model.go` (+2 -1) </details> ### 📄 Description setting samebatch on the vision start token is problematic because it will be shared with other inputs that also use images. this will cause the input to be cached and the runner will not see SameBatch. SameBatch will also be incorrect since it may be for a different image. assigning samebatch to the input tokens resolves this by ensure it's assigned correctly to inputs corresponding to the image. not setting same batch correctly may cause panics during inference since images are no longer guaranteed to be in the same batch. --- <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-22 23:54:15 -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#39240