[PR #14195] convert: enable safetensors import of qwen3 #76855

Open
opened 2026-05-05 09:33:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14195
Author: @rick-github
Created: 2/10/2026
Status: 🔄 Open

Base: mainHead: qwen3-convert


📝 Commits (2)

  • 077aae8 convert: enable safetensors import of qwen3/qwen3moe
  • afec900 qwen3moe import and quantize but fail to run, exclude.

📊 Changes

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

View changed files

📝 convert/convert.go (+2 -0)
📝 convert/convert_qwen3.go (+1 -1)

📄 Description

It looks like convert_qwen3.go was added but not hooked in to the convert flow.

On the subject of the change of Factor from ropeFactor to float32: as far as I can tell, rope_scaling is rarely set in qwen3 models, either not present in config.json or set to null. The one model that did have it set was deepseek-ai/DeepSeek-R1-0528-Qwen3-8B, where factor is defined as the single float 4.0. This is also the case in the metadata for the official ollama version of this model, so I think the type for Factor is incorrect. The convert routines for qwen2 and qwen3next also use the ropeFactor type so may need updating as well.

The following models were successfully imported and quantized:

  • deepseek-ai/DeepSeek-R1-0528-Qwen3-8B
  • Qwen/Qwen3-14B
  • Qwen/Qwen3-32B

qwen3moe models fail when run and so are not included.

Fixes: #11084


🔄 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/14195 **Author:** [@rick-github](https://github.com/rick-github) **Created:** 2/10/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `qwen3-convert` --- ### 📝 Commits (2) - [`077aae8`](https://github.com/ollama/ollama/commit/077aae8551f0f9abdfecfa96ea2648b8e235914b) convert: enable safetensors import of qwen3/qwen3moe - [`afec900`](https://github.com/ollama/ollama/commit/afec9004d980585dbd0f5a8814d1eb1e418b02b8) qwen3moe import and quantize but fail to run, exclude. ### 📊 Changes **2 files changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `convert/convert.go` (+2 -0) 📝 `convert/convert_qwen3.go` (+1 -1) </details> ### 📄 Description It looks like convert_qwen3.go was added but not hooked in to the convert flow. On the subject of the change of `Factor` from `ropeFactor` to `float32`: as far as I can tell, `rope_scaling` is rarely set in qwen3 models, either not present in config.json or set to `null`. The one model that did have it set was [deepseek-ai/DeepSeek-R1-0528-Qwen3-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528-Qwen3-8B/tree/main), where `factor` is defined as the single float 4.0. This is also the case in the [metadata](https://ollama.com/library/deepseek-r1:8b-0528-qwen3-q4_K_M/blobs/e6a7edc1a4d7#:~:text=qwen3.rope.scaling.factor) for the official ollama version of this model, so I think the type for `Factor` is incorrect. The convert routines for [qwen2](https://github.com/ollama/ollama/blob/9ec733e5279385006e2b8c302e24573bdd861049/convert/convert_qwen2.go#L16) and [qwen3next](https://github.com/ollama/ollama/blob/9ec733e5279385006e2b8c302e24573bdd861049/convert/convert_qwen3.go#L27) also use the `ropeFactor` type so may need updating as well. The following models were successfully imported and quantized: * deepseek-ai/DeepSeek-R1-0528-Qwen3-8B * Qwen/Qwen3-14B * Qwen/Qwen3-32B qwen3moe models fail when run and so are not included. Fixes: #11084 --- <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-05-05 09:33:23 -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#76855