[PR #14652] [MERGED] x/mlxrunner: replace sampler interface chain with single stateful Sampler #61464

Closed
opened 2026-04-29 16:33:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14652
Author: @pdevine
Created: 3/5/2026
Status: Merged
Merged: 3/8/2026
Merged by: @pdevine

Base: mainHead: pdevine/mlx-sampling


📝 Commits (3)

  • f87e63a x/mlxrunner: replace sampler interface chain with single stateful Sampler
  • 8962cac comments
  • 7f665e9 more comments

📊 Changes

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

View changed files

📝 x/mlxrunner/client.go (+14 -10)
📝 x/mlxrunner/mlx/ops.go (+12 -0)
📝 x/mlxrunner/pipeline.go (+7 -1)
📝 x/mlxrunner/runner.go (+8 -6)
📝 x/mlxrunner/sample/sample.go (+146 -32)
x/mlxrunner/sample/sample_test.go (+62 -0)
📝 x/mlxrunner/server.go (+2 -0)

📄 Description

  • Collapse MLX sampling state into a single sample.Sampler struct (options + history).
  • Replace interface-based sampler chain (TopP, TopK, penalty, etc.) with function-based transforms.
  • Update request/pipeline wiring to use *sample.Sampler, seed history from prompt tokens, and append generated tokens each step.
  • Implement top_p, repeat_penalty, and frequency_penalty

🔄 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/14652 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 3/5/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/mlx-sampling` --- ### 📝 Commits (3) - [`f87e63a`](https://github.com/ollama/ollama/commit/f87e63ace9ffea2d141ee75dc8f3f7f2070cdc5e) x/mlxrunner: replace sampler interface chain with single stateful Sampler - [`8962cac`](https://github.com/ollama/ollama/commit/8962cac2819c3699fbb1efdd094da807841c8168) comments - [`7f665e9`](https://github.com/ollama/ollama/commit/7f665e9bb6f386e2e2470c924bfc7f11f142b512) more comments ### 📊 Changes **7 files changed** (+251 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `x/mlxrunner/client.go` (+14 -10) 📝 `x/mlxrunner/mlx/ops.go` (+12 -0) 📝 `x/mlxrunner/pipeline.go` (+7 -1) 📝 `x/mlxrunner/runner.go` (+8 -6) 📝 `x/mlxrunner/sample/sample.go` (+146 -32) ➕ `x/mlxrunner/sample/sample_test.go` (+62 -0) 📝 `x/mlxrunner/server.go` (+2 -0) </details> ### 📄 Description - Collapse MLX sampling state into a single sample.Sampler struct (options + history). - Replace interface-based sampler chain (TopP, TopK, penalty, etc.) with function-based transforms. - Update request/pipeline wiring to use *sample.Sampler, seed history from prompt tokens, and append generated tokens each step. - Implement top_p, repeat_penalty, and frequency_penalty --- <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 16:33:04 -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#61464