Native Apple Metal GPU inference via mlx-c bindings
Find a file
Snider f39126f6bd feat(metal): bind CumSum, implement TopP and MinP sampling
New ops: CumSum, Sort, Argsort, Greater, MaxAxis — all bound to mlx-c.

TopP (nucleus) sampling now fully implemented: sorts probabilities
descending, computes cumulative sum, masks tokens beyond the threshold,
and scatters the mask back to original positions via argsort.

MinP sampling now fully implemented: computes softmax, finds max
probability, masks tokens below min_p * max_prob.

Both were previously stubs that passed through logits unchanged.

10 new tests (CumSum variants, Sort, Argsort, Greater, MaxAxis,
TopP, MinP). 176 total tests passing.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 20:39:44 +00:00
cpp docs(design): backend abstraction with internal/metal reorganisation 2026-02-19 19:12:04 +00:00
docs/plans docs(plan): fold Virgil review into design and implementation plan 2026-02-19 19:25:05 +00:00
internal/metal feat(metal): bind CumSum, implement TopP and MinP sampling 2026-02-19 20:39:44 +00:00
.gitignore chore: gitignore dist/ (CMake install output) 2026-02-19 19:30:23 +00:00
CLAUDE.md feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
CMakeLists.txt feat: extract go-mlx from go-ai as standalone Metal inference package 2026-02-19 17:57:37 +00:00
FINDINGS.md feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
go.mod feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
mlx.go feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
mlx_stub.go feat: extract go-mlx from go-ai as standalone Metal inference package 2026-02-19 17:57:37 +00:00
mlx_test.go feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
register_metal.go feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00
TODO.md feat(api): migrate to go-inference shared interfaces 2026-02-19 20:15:42 +00:00