[PR #10639] [MERGED] feat: handle ml.DumpOptions better #18577

Closed
opened 2026-04-16 06:39:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10639
Author: @mxyng
Created: 5/9/2025
Status: Merged
Merged: 5/10/2025
Merged by: @mxyng

Base: mainHead: mxyng/dump-options


📝 Commits (1)

  • 2b2a0d2 feat: add threshold to dump options

📊 Changes

1 file changed (+40 additions, -16 deletions)

View changed files

📝 ml/backend.go (+40 -16)

📄 Description

ml.Dump will preserve default values if not specified. previously, if you provide any value for opts, it will override the defaults

Example:

Dump(ctx, t) // => precision=4, edgeitems=3

Example: set precision

Dump(ctx, t, DumpWithPrecision(6)) // => precision=6, edgeitems=3

Example: set edgeitems

Dump(ctx, t, DumpWithEdgeItems(4)) // => precision=4, edgeitems=3

Example: set both precision and edgeitems

Dump(ctx, t, DumpWithPrecision(6), DumpWithEdgeItems(4)) // => precision=6, edgeitems=4

This change also adds a Threshold field where the full tensor will be dumped if the total number of items is less than or equal to Threshold


🔄 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/10639 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 5/9/2025 **Status:** ✅ Merged **Merged:** 5/10/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/dump-options` --- ### 📝 Commits (1) - [`2b2a0d2`](https://github.com/ollama/ollama/commit/2b2a0d2308fdfba626cc65e844be43c29e1ba440) feat: add threshold to dump options ### 📊 Changes **1 file changed** (+40 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `ml/backend.go` (+40 -16) </details> ### 📄 Description `ml.Dump` will preserve default values if not specified. previously, if you provide any value for `opts`, it will override the defaults Example: ```go Dump(ctx, t) // => precision=4, edgeitems=3 ``` Example: set precision ```go Dump(ctx, t, DumpWithPrecision(6)) // => precision=6, edgeitems=3 ``` Example: set edgeitems ```go Dump(ctx, t, DumpWithEdgeItems(4)) // => precision=4, edgeitems=3 ``` Example: set both precision and edgeitems ```go Dump(ctx, t, DumpWithPrecision(6), DumpWithEdgeItems(4)) // => precision=6, edgeitems=4 ``` This change also adds a `Threshold` field where the full tensor will be dumped if the total number of items is less than or equal to `Threshold` --- <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-16 06:39:47 -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#18577