Native Apple Metal GPU inference via mlx-c bindings
Find a file
Snider a44e9f5789 feat(metal): add inference metrics (timing, throughput, memory)
Instrument Generate, Classify, and BatchGenerate with:
- Prefill/decode timing (separate phases)
- Token counts (prompt + generated)
- Throughput (tok/s for each phase)
- Peak and active GPU memory via Metal allocator

Wire through metalAdapter.Metrics() to go-inference interface.
Test validates all fields populated after generation.

Gemma3-1B 4-bit on M3 Ultra: prefill 246 tok/s, decode 82 tok/s,
peak 6.2 GB GPU memory.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 23:34:40 +00:00
cpp fix(metal): address 4 minor code review items 2026-02-19 21:36:40 +00:00
docs/plans docs: batch inference API design (Phase 5) 2026-02-19 23:18:38 +00:00
internal/metal feat(metal): add inference metrics (timing, throughput, memory) 2026-02-19 23:34:40 +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 fix(metal): address 4 minor code review items 2026-02-19 21:36:40 +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(metal): add inference metrics (timing, throughput, memory) 2026-02-19 23:34:40 +00:00
register_metal.go feat(metal): add inference metrics (timing, throughput, memory) 2026-02-19 23:34:40 +00:00
TODO.md docs: mark batch inference API complete in TODO.md 2026-02-19 23:28:40 +00:00