[PR #12324] [MERGED] convert: convert bf16 vision weights to fp16 #19055

Closed
opened 2026-04-16 06:55:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12324
Author: @pdevine
Created: 9/18/2025
Status: Merged
Merged: 9/18/2025
Merged by: @pdevine

Base: mainHead: pdevine/convert-multimodal-fix


📝 Commits (1)

  • 48e2fc9 convert: convert bf16 vision weights to fp16

📊 Changes

2 files changed (+63 additions, -1 deletions)

View changed files

📝 convert/reader_safetensors.go (+1 -1)
📝 convert/reader_test.go (+62 -0)

📄 Description

This change moves back to converting bf16 vision weights to fp16, specifically if they start with the name "v." (such as v.blk.0.attn_k.weight).

This fixes a bug where converted images are failing because they are trying to call im2col which doesn't have a bf16 kernel in ggml.


🔄 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/12324 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 9/18/2025 **Status:** ✅ Merged **Merged:** 9/18/2025 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/convert-multimodal-fix` --- ### 📝 Commits (1) - [`48e2fc9`](https://github.com/ollama/ollama/commit/48e2fc99db32fff7757beb2c654668eb6d376784) convert: convert bf16 vision weights to fp16 ### 📊 Changes **2 files changed** (+63 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `convert/reader_safetensors.go` (+1 -1) 📝 `convert/reader_test.go` (+62 -0) </details> ### 📄 Description This change moves back to converting bf16 vision weights to fp16, specifically if they start with the name "v." (such as v.blk.0.attn_k.weight). This fixes a bug where converted images are failing because they are trying to call `im2col` which doesn't have a bf16 kernel in ggml. --- <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-16 06:55:28 -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#19055