[PR #5409] [CLOSED] convert: only extract large files #37642

Closed
opened 2026-04-22 22:19:07 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5409
Author: @mxyng
Created: 7/1/2024
Status: Closed

Base: mxyng/convert2Head: mxyng/convert-fs


📝 Commits (1)

  • 3ff2b70 convert: only extract large files

📊 Changes

10 files changed (+117 additions, -197 deletions)

View changed files

📝 convert/convert.go (+5 -6)
📝 convert/convert_test.go (+4 -3)
convert/fs.go (+58 -0)
📝 convert/reader.go (+5 -5)
📝 convert/reader_safetensors.go (+14 -6)
📝 convert/reader_torch.go (+2 -1)
📝 convert/tokenizer.go (+11 -11)
📝 convert/tokenizer_spm.go (+4 -4)
📝 server/model.go (+14 -59)
📝 server/model_test.go (+0 -102)

📄 Description

many of the files needed during conversion don't need to be extracted and can be read directly from the zip. the only exception are the model weights. while it's possible to read these directly from the zip, the impact on performance is unacceptable (2m30s vs. 30s for gemma 2b). for these files, extract them when needed

anything larger than the limit (default 32 MiB) will be extracted to disk

the performance difference of this change (Mistral 7B ~= 53.828s) is negligible compared to the baseline (~= 54.23s) (n=1)

a follow up would be to remove the extracted file once they're no longer used so only one large file exists on disk at any given time


🔄 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/5409 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 7/1/2024 **Status:** ❌ Closed **Base:** `mxyng/convert2` ← **Head:** `mxyng/convert-fs` --- ### 📝 Commits (1) - [`3ff2b70`](https://github.com/ollama/ollama/commit/3ff2b70af21413bc57397bfad45038419c9bebe8) convert: only extract large files ### 📊 Changes **10 files changed** (+117 additions, -197 deletions) <details> <summary>View changed files</summary> 📝 `convert/convert.go` (+5 -6) 📝 `convert/convert_test.go` (+4 -3) ➕ `convert/fs.go` (+58 -0) 📝 `convert/reader.go` (+5 -5) 📝 `convert/reader_safetensors.go` (+14 -6) 📝 `convert/reader_torch.go` (+2 -1) 📝 `convert/tokenizer.go` (+11 -11) 📝 `convert/tokenizer_spm.go` (+4 -4) 📝 `server/model.go` (+14 -59) 📝 `server/model_test.go` (+0 -102) </details> ### 📄 Description many of the files needed during conversion don't need to be extracted and can be read directly from the zip. the only exception are the model weights. while it's possible to read these directly from the zip, the impact on performance is unacceptable (2m30s vs. 30s for gemma 2b). for these files, extract them when needed anything larger than the limit (default 32 MiB) will be extracted to disk the performance difference of this change (Mistral 7B \~= 53.828s) is negligible compared to the baseline (\~= 54.23s) (n=1) a follow up would be to remove the extracted file once they're no longer used so only one large file exists on disk at any given time --- <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-22 22:19:07 -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#37642