ollama/x/mlxrunner
Patrick Devine 4860130f83
mlx: rework the MLX sampler (#16122)
* mlx: rework the MLX sampler

Replace the MLX sampler transform chain with an explicit distribution pipeline that applies:
  1. penalties
  2. top-k
  3. temperature/softmax
  4. top-p
  5. min-p
  6. normalize
  7. categorical

The common top_k path now keeps sparse [B,K] token ids/probabilities on GPU instead of carrying full-vocab
scores, and sampled MTP reuses those draft/target distributions for acceptance, bonus, and residual sampling.

This change also fixes the seed parameter so that temperature sampling and sampled MTP are reproducible.
2026-05-13 17:18:27 -07:00
..
batch mlxrunner: decouple models from attention cache storage layout 2026-04-27 20:04:46 -07:00
cache mlx: Gemma4 MTP speculative decoding (#15980) 2026-05-05 08:55:04 -07:00
mlx mlx: rework the MLX sampler (#16122) 2026-05-13 17:18:27 -07:00
model mlx: Gemma4 MTP speculative decoding (#15980) 2026-05-05 08:55:04 -07:00
sample mlx: rework the MLX sampler (#16122) 2026-05-13 17:18:27 -07:00
cache.go mlxrunner: schedule periodic snapshots during prefill 2026-03-26 13:32:11 -07:00
cache_test.go mlxrunner: schedule periodic snapshots during prefill 2026-03-26 13:32:11 -07:00
cache_trie.go mlxrunner: share KV cache across conversations with common prefixes 2026-03-18 16:06:33 -07:00
cache_trie_test.go mlxrunner: share KV cache across conversations with common prefixes 2026-03-18 16:06:33 -07:00
client.go Update MLX and MLX-C with threading fixes (#15845) 2026-05-03 10:03:14 -07:00
imports.go New models (#15861) 2026-04-28 11:50:12 -07:00
mtp.go mlx: rework the MLX sampler (#16122) 2026-05-13 17:18:27 -07:00
pipeline.go mlx: add memory trace logging (#16131) 2026-05-13 13:37:31 -07:00
runner.go mlx: Gemma4 MTP speculative decoding (#15980) 2026-05-05 08:55:04 -07:00
server.go mlx: rework the MLX sampler (#16122) 2026-05-13 17:18:27 -07:00
status_memory.go mlx: avoid status timeout during inference (#16086) 2026-05-11 16:03:38 -07:00
status_memory_test.go mlx: avoid status timeout during inference (#16086) 2026-05-11 16:03:38 -07:00
utf8_buffer.go consolidate the tokenizer (#14327) 2026-02-19 15:55:45 -08:00
utf8_buffer_test.go consolidate the tokenizer (#14327) 2026-02-19 15:55:45 -08:00