feat: Android per-arch CPU variants for ggml-speech + parakeet-cpp dependency pin#157
Merged
Conversation
Flip the Android backend mode from `GGML_CPU_STATIC=ON` to
`GGML_CPU_ALL_VARIANTS=ON` + `GGML_CPU_REPACK=ON`, switching the CPU
backend from a single statically-linked archive folded into the
consumer .bare module to a fan of per-arch MODULE .so files (one each
for ARMv8.0, 8.2, 8.6, 9.0, 9.2; with and without the int8mm/sme/...
repack variants).
Pairs with the speech-branch dlopen-fallback patch already shipped in
this port's REF (commit 9562ed04 -- "ggml-backend: android per-arch
CPU variant dlopen fallback"), which iterates the known variant names
when the consumer APK keeps native libs compressed
(AGP `useLegacyPackaging=false`, the default since AGP 3.6). Without
the dlopen fallback the variant lookup would silently fail because
`fs::directory_iterator` finds nothing inside the APK and the
existing bare-name `dlopen` fallback only composed
`lib<prefix>ggml-cpu.so` -- which doesn't exist in this build mode.
Selection logic at runtime is unchanged: `ggml_backend_load_best("cpu")`
runs each variant through `ggml_backend_cpu_aarch64_score` so the
device's HWCAP picks the highest-tier variant it supports
(ARMv9.2+SME on a Pixel 9, ARMv8.0 on older OnePlus 9, etc.). Matches
the equivalent shape on qvac-fabric-llm's ggml fork; the
`transcription-parakeet` addon's cmake install rules already pick up
all libqvac-speech-ggml-cpu-android_armv* .so files from the
buildtree's bin/ directory (no addon-side change needed).
Non-Android targets unchanged (`if(VCPKG_TARGET_IS_ANDROID)`).
REF stays at 9562ed04; this is portfile-only.
Co-authored-by: Cursor <cursoragent@cursor.com>
Tightens the `ggml-speech` constraint from `>= 2026-04-09#2` to `>= 2026-04-09#3` so consumers pin against the ggml-speech build that ships the Android per-arch CPU MODULE `.so` variants (`GGML_CPU_ALL_VARIANTS=ON` + `GGML_CPU_REPACK=ON`). Without the explicit pin the `>=` constraint already floats to pv3 via the baseline, but the explicit pin makes the requirement visible in manifest-mode resolutions and protects against accidental downgrades to the pre-flip pv2 (which only emits a single statically-linked ggml-cpu archive and would silently leave the per-arch variant selection unused). REF and source SHA512 stay at the upstream `2026-05-20#1` parakeet-cpp tarball; this is portfile-only. Co-authored-by: Cursor <cursoragent@cursor.com>
freddy311082
approved these changes
May 20, 2026
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 problem does this PR solve?
ggml-speechwas built withGGML_CPU_STATIC=ON, folding a single CPU backend archive into the consumer.baremodule. That prevented per-architecture CPU variant selection (ARMv8.0 / 8.2 / 8.6 / 9.0 / 9.2, with repack variants) and did not match the dynamic-backend packaging model already used for Vulkan and OpenCL.useLegacyPackaging=false, native.sofiles stay compressed inside the APK. Directory-based backend discovery fails silently, and the bare-namedlopenfallback only resolveslib<prefix>ggml-cpu.so— which does not exist once CPU is shipped as per-arch MODULE libraries.parakeet-cppconsumers had no explicit manifest constraint requiring the newggml-speechbuild, making accidental downgrades to the pre-flip port-version possible.How does it solve it?
ggml-speech→ port-version 39562ed04ontetherto/qvac-ext-ggml@speech, which includes theggml-backend: android per-arch CPU variant dlopen fallbackpatch. When directory iteration finds nothing inside a compressed APK, the loader iterates known variant names instead of composing a single barelibqvac-speech-ggml-cpu.so.GGML_CPU_STATIC=ONto:GGML_CPU_ALL_VARIANTS=ON— emit one MODULE.soper ARM feature tier (v8.0, 8.2, 8.6, 9.0, 9.2)GGML_CPU_REPACK=ON— include int8mm / SME repack variantsggml_backend_load_best("cpu")scores each variant viaggml_backend_cpu_aarch64_scoreagainst the device's HWCAPs (e.g. ARMv9.2+SME on Pixel 9, ARMv8.0 on older devices).if(VCPKG_TARGET_IS_ANDROID)..sofiles loaded viaGGML_BACKEND_DL=ON; the existing portfilefile(GLOB ...)install step picks them up from the buildtreebin/directory.parakeet-cpp→2026-05-20#2ggml-speech >= 2026-04-09#1to>= 2026-04-09#3, making the per-arch CPU variant requirement visible in manifest-mode resolutions and preventing silent downgrades to pv2.2026-05-20(AOSC v2.1, from #156) with REFef0f2ae.