Native Apple Metal GPU inference via mlx-c bindings
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> |
||
|---|---|---|
| cpp | ||
| docs/plans | ||
| internal/metal | ||
| .gitignore | ||
| CLAUDE.md | ||
| CMakeLists.txt | ||
| FINDINGS.md | ||
| go.mod | ||
| mlx.go | ||
| mlx_stub.go | ||
| mlx_test.go | ||
| register_metal.go | ||
| TODO.md | ||