[PR #9851] fix: fixes a memory leak in bfloat16 package #59767

Open
opened 2026-04-29 14:42:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9851
Author: @pdevine
Created: 3/18/2025
Status: 🔄 Open

Base: mainHead: pdevine/bfloat16


📝 Commits (1)

  • c75b428 fix: fixes a memory leak in bfloat16 package

📊 Changes

6 files changed (+133 additions, -4 deletions)

View changed files

📝 convert/reader_safetensors.go (+2 -1)
📝 go.mod (+0 -1)
📝 go.sum (+0 -2)
types/bfloat16/LICENSE (+21 -0)
types/bfloat16/bfloat16.go (+57 -0)
types/bfloat16/bfloat16_test.go (+53 -0)

📄 Description

This change vendors in the bfloat16 package from github.com/d4l3k/go-bfloat16/ and fixes a memory leak which was being caused by using unsafe pointers instead of the math package.


🔄 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/9851 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 3/18/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pdevine/bfloat16` --- ### 📝 Commits (1) - [`c75b428`](https://github.com/ollama/ollama/commit/c75b428249af016a49d1bcea261945999202fd6c) fix: fixes a memory leak in bfloat16 package ### 📊 Changes **6 files changed** (+133 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `convert/reader_safetensors.go` (+2 -1) 📝 `go.mod` (+0 -1) 📝 `go.sum` (+0 -2) ➕ `types/bfloat16/LICENSE` (+21 -0) ➕ `types/bfloat16/bfloat16.go` (+57 -0) ➕ `types/bfloat16/bfloat16_test.go` (+53 -0) </details> ### 📄 Description This change vendors in the bfloat16 package from github.com/d4l3k/go-bfloat16/ and fixes a memory leak which was being caused by using unsafe pointers instead of the math package. --- <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 14:42: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#59767