[PR #13848] [MERGED] x/imagegen: replace memory estimation with actual weight size #14416

Closed
opened 2026-04-13 00:53:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13848
Author: @jmorganca
Created: 1/22/2026
Status: Merged
Merged: 1/23/2026
Merged by: @jmorganca

Base: mainHead: ollama-memory-requirement-macos


📝 Commits (1)

  • 61ddb00 x/imagegen: replace memory estimation with actual weight size

📊 Changes

7 files changed (+49 additions, -136 deletions)

View changed files

📝 x/imagegen/manifest.go (+11 -0)
📝 x/imagegen/manifest_test.go (+31 -0)
📝 x/imagegen/memory.go (+0 -30)
📝 x/imagegen/memory_test.go (+0 -63)
📝 x/imagegen/runner/runner.go (+0 -8)
📝 x/imagegen/server.go (+7 -1)
📝 x/imagegen/server_test.go (+0 -34)

📄 Description

Remove static VRAM estimation (EstimateVRAM, CheckMemoryRequirements) which wasn't helpful. Instead, report the actual tensor weight size from the manifest for ollama ps.

  • Remove memory estimation check from runner startup
  • Remove EstimateVRAM, CheckMemoryRequirements, modelVRAMEstimates
  • Add TotalTensorSize() to get actual weight size from manifest
  • Use weight size for Server.vramSize instead of estimates

Note: This is better than showing 0 or arbitrary estimates, but the weight size is a drastic underestimation of actual memory usage since it doesn't account for activations, intermediate tensors, or MLX overhead. Future work should query real-time memory from MLX (e.g., MetalGetActiveMemory) for accurate reporting.


🔄 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/13848 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 1/22/2026 **Status:** ✅ Merged **Merged:** 1/23/2026 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `ollama-memory-requirement-macos` --- ### 📝 Commits (1) - [`61ddb00`](https://github.com/ollama/ollama/commit/61ddb00542313aa28e4842bef98db531f2852e50) x/imagegen: replace memory estimation with actual weight size ### 📊 Changes **7 files changed** (+49 additions, -136 deletions) <details> <summary>View changed files</summary> 📝 `x/imagegen/manifest.go` (+11 -0) 📝 `x/imagegen/manifest_test.go` (+31 -0) 📝 `x/imagegen/memory.go` (+0 -30) 📝 `x/imagegen/memory_test.go` (+0 -63) 📝 `x/imagegen/runner/runner.go` (+0 -8) 📝 `x/imagegen/server.go` (+7 -1) 📝 `x/imagegen/server_test.go` (+0 -34) </details> ### 📄 Description Remove static VRAM estimation (EstimateVRAM, CheckMemoryRequirements) which wasn't helpful. Instead, report the actual tensor weight size from the manifest for ollama ps. - Remove memory estimation check from runner startup - Remove EstimateVRAM, CheckMemoryRequirements, modelVRAMEstimates - Add TotalTensorSize() to get actual weight size from manifest - Use weight size for Server.vramSize instead of estimates Note: This is better than showing 0 or arbitrary estimates, but the weight size is a drastic underestimation of actual memory usage since it doesn't account for activations, intermediate tensors, or MLX overhead. Future work should query real-time memory from MLX (e.g., MetalGetActiveMemory) for accurate reporting. --- <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-13 00:53:26 -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#14416