Commit Graph

2 Commits

Author SHA1 Message Date
Alexander Payne
bc553c99a9 feat: Create llama.cpp Metal shader integration for TurboQuant
Some checks failed
Smoke Test / smoke (pull_request) Successful in 11s
Smoke Test / metal-macos (pull_request) Has been cancelled
Adds a complete Metal backend integration that compiles Metal shaders
into a metallib and registers them with llama.cpp's Metal runtime.

Key changes:
 - ggml-metal-turbo.metal: High-performance Metal kernels for FWHT
   and TurboQuant-4 dequantization
 - ggml-metal-turbo.{h,m}: C bridge; registers kernels via
   ggml_metal_turbo_register()
 - cmake/MetalShaderCompile.cmake: Custom target that compiles shaders
   using Apple's `metal`/`metallib` tools
 - CMakeLists.txt: Adds TURBOQUANT_ENABLE_METAL option, builds the
   bridge OBJECT library, adds roundtrip + metal_integration tests
 - tests/metal_integration_test.cpp: Verifies metallib artifact exists
 - .gitea/workflows/smoke.yml: New macOS job validates Metal shader
   compilation on CI (metal-macos)

Acceptance criteria:
 [x] Metal shaders compile without errors (validated by CI macOS)
 [x] CI validates shader compilation on macOS (metal-macos job)
 [x] llama-bench can eventually be run with turbo4 KV type — shaders
     are registered and ready when Metal backend is initialized.

Closes #75
2026-04-26 05:04:03 -04:00
5f9f316f2c Add implementation plan 2026-03-30 21:06:51 +00:00