Repository navigation
Detect the Apple GPU as an integrated GPU - #5
Merged
Merged
Conversation
Lemonade reports an Apple GPU under devices.metal, which LemonMatrix did not read. A Mac therefore looked like a CPU-only machine, so every llamacpp-metal run was refused, and a forced run was always marked invalid. 1) available_compute_engines counts an available metal device as igpu, since Apple silicon shares memory with the CPU; 2) profile discovery records the metal device as the profile's igpu and takes its driver version; 3) both changes sit in the shared checks, so every modality that validates its engine and backend (model, speech, image, audio, embeddings, rerank, classify, 3D, omni) accepts a -metal backend; 4) the README describes the Apple silicon case, and CI runs the tests on macOS as well as Linux. Tested with the real devices block of an Apple M5 running Lemonade 2026.47.1, and with live runs on that machine (model, embeddings, speech and text-to-speech), whose results pass validate-submission. Fixes #4.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Detects an Apple GPU as an integrated GPU, so a Mac can run LemonMatrix with
--engine igpu --backend llamacpp-metaland the other-metalbackends.Why
Lemonade reports an Apple GPU under
devices.metal, and LemonMatrix only readamd_gpuandnvidia_gpu.A Mac therefore looked like a CPU-only machine, so the run was refused, and a forced run is always marked invalid.
How
available_compute_enginescounts an availablemetaldevice asigpu, since Apple silicon shares memory with the CPU;_classify_gpusrecords themetaldevice as the profile'sigpuand takes its driver version;-metalbackend without per-command changes;macos-latest(Python 3.12).Testing
Unit tests use the real devices block from an Apple M5 running Lemonade 2026.47.1: 442 tests pass on macOS, including three new ones.
Live runs on that machine, with the patched code: Qwen3-1.7B (96.3 tok/s decode), Qwen3-Embedding-0.6B, Whisper-Tiny and kokoro-v1.
All four result files pass
lemonmatrix validate-submission.validate_combo_against_profilereturns no issues for the Metal combination of each recipe family (text generation, speech-to-text, text-to-speech, image generation) and foronnxruntime-cpu.What this does not cover
Lemonade reports kokoro on this Mac as running on the CPU, so
--engine igpu --backend kokoro-metalis still marked invalid by the existing device check; that is Lemonade's report, not detection.Only an Apple M5 was tested; no other Apple chip was run.
Fixes #4