[PR #12015] [MERGED] convert: fix tensor sorting #60382

Closed
opened 2026-04-29 15:19:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12015
Author: @mxyng
Created: 8/21/2025
Status: Merged
Merged: 8/26/2025
Merged by: @mxyng

Base: mainHead: mxyng/fix-convert


📝 Commits (1)

  • d154f0e convert: fix tensor sorting

📊 Changes

3 files changed (+29 additions, -25 deletions)

View changed files

📝 fs/ggml/ggml.go (+2 -1)
📝 fs/ggml/gguf.go (+9 -6)
📝 fs/ggml/gguf_test.go (+18 -18)

📄 Description

there's two bugs here.

  1. the check for a layer id is incorrect and should be >= 0 since layer 0 is valid
  2. if both tensors have an layer identifier, it will only compare the layer id which will return 0 if the tensors are in the same layer. instead it should fallback to comparing the full tensor name

🔄 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/12015 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 8/21/2025 **Status:** ✅ Merged **Merged:** 8/26/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/fix-convert` --- ### 📝 Commits (1) - [`d154f0e`](https://github.com/ollama/ollama/commit/d154f0ee1ed5307d2387270be757f715fd303e52) convert: fix tensor sorting ### 📊 Changes **3 files changed** (+29 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `fs/ggml/ggml.go` (+2 -1) 📝 `fs/ggml/gguf.go` (+9 -6) 📝 `fs/ggml/gguf_test.go` (+18 -18) </details> ### 📄 Description there's two bugs here. 1. the check for a layer id is incorrect and should be >= 0 since layer 0 is valid 2. if both tensors have an layer identifier, it will only compare the layer id which will return 0 if the tensors are in the same layer. instead it should fallback to comparing the full tensor name --- <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-29 15:19:38 -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#60382