Skip to content

AMEVA-Runtime v2.7.9: Bundle Isolation (self-contained bundles, one Vulkan HAL shim)

Choose a tag to compare

@uno-km uno-km released this 04 Oct 07:29

Release Notes - AMEVA-Runtime v2.7.9

Release Tag: v2.7.9
Distribution Channels: PyPI (ameva-runtime), NPM (@ameva/runtime), GitHub Releases (uno-km/ameva-runtime-releases)
Target Platform: Android ARM64 / Qualcomm Adreno, ARM Mali, Linux & Edge
License: Apache-2.0


Summary

Each native engine bundle (LLM, STT, TTS, Diffusion, BitNet) is now installed as a unit of its own. Up to 2.7.8 the
installer copied the libraries of all five bundles into $PREFIX/lib, the directory that every bundle and every
Termux package shares, and the executables into $PREFIX/bin. Three defects followed from that:

  • the ggml libraries of llama.cpp (0.9.8) and whisper.cpp (0.25.1) have the same SONAME, so the bundle installed last
    decided which one the other engine's command loaded;
  • the STT bundle's libc++_shared.so replaced the file of the Termux libc++ package;
  • llama.cpp and TTS need libomp.so, which only the diffusion bundle shipped: they started only on devices where
    that bundle had been installed.

From 2.7.9 nothing of a bundle goes to $PREFIX/lib. A bundle stays in its release directory, its commands in
$PREFIX/bin are symbolic links into it, and each bundle carries the libraries it loads. The Vulkan HAL shim is one
build with its source in the repository and is used from inside the Python package. Three defects of the LLM routes
that the new layout made visible are fixed as well: ameva-run exec dropped the router's options, among them the one
that turns flash attention off; the CPU route ran prompt batches on the GPU backend; and the Mali Vulkan plan left
flash attention on, with which the bundle's Vulkan backend returns corrupt text. Under the earlier layout
ameva-run exec did not reach any of them on Galaxy S25 and A35: it failed to link.

No engine binary was rebuilt. The LLM and TTS bundles are repacked from the 2.7.8 assets; STT, Diffusion and BitNet
are the 2.7.8 archives.

This release is published as a non-latest GitHub release, for the reason given in the 2.7.8 notes: 2.7.4-2.7.7
fall back to the latest release when their own tag is missing, and their pins match the v2.7.3 bundles.

Changes

1. Installation layout

up to 2.7.8 2.7.9
Bundle libraries copied to $PREFIX/lib (29 files for the five bundles) stay in ~/.local/share/ameva/releases/<modality>/<release>
Commands in $PREFIX/bin copies; $ORIGIN/../lib resolved to $PREFIX/lib links to the bundle's executable through current/<modality>; $ORIGIN resolves inside the bundle
Links inside a bundle followed: every library stored once per name kept as links
Release store after installing all five 737 MB 244 MB

The Android linker expands $ORIGIN from the real path of an executable started through a link, also through a linked
directory and a PATH lookup (checked on Android 13, 15 and 16).

2. Bundles

Bundle Archive Change
LLM llama-cli-vulkan-android-arm64.tar.gz d759b98bb4138bc7... lib/libomp.so added; each library stored once with links for the short names (it was stored six times). Archive 125 MB -> 26 MB, installed 402 MB -> 84 MB
TTS sherpa-ncnn-offline-tts-vulkan-arm64.tar.gz 09185a17f1c9927d... libomp.so added beside the executable; the executable has the execute bit
STT whisper-cli-vulkan-android-arm64.tar.gz 09fa314e5203a119... unchanged
Diffusion sd-cli-vulkan-android-arm64.tar.gz 2d268255e84a37ec... unchanged
BitNet termux-bitnet-v1.4.0-android-aarch64.tar.gz 5b7f07e16fc45918... unchanged

Every regular file of the two repacked archives is byte-identical to a file of the 2.7.8 assets
(tools/packaging/repack_2_7_9.py, which also checks the result with tools/packaging/bundle_check.py). Outside
themselves the bundles need Android libraries and, from Termux packages, libc++_shared.so (libc++) and
libssl.so.3 / libcrypto.so.3 (openssl); the STT bundle carries its own libc++_shared.so.

3. Installer

  • A bundle that needs a library that neither the bundle, Android, nor a Termux package provides is refused
    (Bundle integrity error: ... is not self-contained). The check reads the ELF dynamic sections; it does not rely on
    the smoke test, which a stray copy in $PREFIX/lib would let pass.
  • The smoke test starts the staged executable without LD_LIBRARY_PATH, the way the installed command is started.
  • ameva-run install replaces an intact bundle of another release with the pinned one and prints [UPGRADE]. An
    installation that does not match its own manifest is reported as before and is not replaced.
  • Archives are extracted with the tarfile data filter on every Python version that has it (it is the default from
    Python 3.14).
  • The files of an installed release are read-only. A command in $PREFIX/bin is a link into the release; an installer
    that copies its own build onto that command would otherwise write through the link into the bundle. With read-only
    files cp -f replaces the link instead (the release keeps its content, and the next ameva-run install reports the
    foreign command), and shutil.copy fails. Checked on S20.

4. ameva-run migrate

For a device that 2.7.8 or an earlier version installed on. ameva-run migrate --dry-run lists; ameva-run migrate
acts:

  • a command in $PREFIX/bin that is a copy of a bundle executable becomes a link (ameva-run install does this too);
  • a library in $PREFIX/lib is moved to ~/.local/share/ameva/legacy-lib/<time>/ when its content is that of a
    library in the release store, no Termux package owns it, no installed bundle needs it, and no program or library
    directly in $PREFIX/bin, $PREFIX/lib or $PREFIX/libexec needs it (directly or through another copy that stays).
    It is moved, not deleted: a program elsewhere that loaded it from $PREFIX/lib gets it back by moving the file back;
  • libomp.so, libegl_shim.so and libtermux_bitnet.so stay, because termux-diffusion, termux-stt and
    termux-bitnet open them from that path;
  • a library that a Termux package owns is not touched. Where a bundle's copy replaced it (libc++_shared.so), the
    command prints apt install --reinstall <package> and exits with status 1.

5. Vulkan HAL shim

  • Source: native/vulkan_shim/libegl_shim.c; build script and the SHA-256 of the packaged binary beside it
    (6e1d201743c5067d..., clang 21.1.8, aarch64).
  • Compared with the shim that the diffusion bundle and the release page carried (8a6a2775...), the clamp of the
    reported subgroup size to 32 is removed. With the clamp, ggml-vulkan aborted on GPUs whose subgroup size is larger
    (Adreno 830: 64; Turnip on Adreno 650).
  • The runtime preloads the shim from inside the package. It no longer copies it to $PREFIX/lib or looks it up
    there, where installing the diffusion bundle used to replace it with the other build.
  • AMEVA_VULKAN_SHIM=<path> selects another shim; AMEVA_VULKAN_SHIM=off preloads none; a path that names no file
    is an error.

6. LLM routes

  • ameva-run exec passes the router's options. It built its own command and kept only the thread and layer
    counts of the plan. The router turns flash attention off on Adreno (-fa 0); exec dropped that, and with flash
    attention on the bundled Vulkan backend returns corrupt text (Known issues 1). On Galaxy S25 the default route now
    answers "The three primary colors are red, blue, and yellow." on Vulkan (prompt 31 t/s, generation 24 t/s) where
    it printed izable@@@@...; under the earlier layout the same command failed to link
    (cannot locate symbol Xzs_Construct).
  • CPU route: --device none is passed. With -ngl 0 alone a llama.cpp build that has a GPU backend still
    evaluates prompt batches on it. On Adreno 650 (Turnip) the route named CPU_NEON returned corrupt text for chat
    prompts; with --device none it returns the expected text (prompt 16 -> 64 t/s, generation 19 -> 29 t/s on S20;
    128 / 94 t/s on S25; Qwen2.5-0.5B Q4_K_M, 4 threads).
  • Mali Vulkan plan (Galaxy A35): -fa 0 is passed, as on Adreno; the adaptive route stays Vulkan. With it
    Qwen2.5-0.5B answers with the CPU's text on A35 (6.5 t/s; ameva-run exec, default route). Models with a larger
    attention (Llama-3.2-1B, Gemma-2-2B) abort on A35 with the descriptor-set assert of Known issues 1 instead of
    printing corrupt text. The routing decisions of 2.7.8 are unchanged.
  • Forced Vulkan on Mali-G78 and on Mali-G68 without integer dot product (-b vulkan on Galaxy S21 and A53):
    -fa 0 is passed there too. With flash attention the bundled backend returns corrupt text on these devices;
    without it these plans stop with the descriptor-set assert of Known issues 1 (the hazard warning of the Mali-G78
    plan names it), and ameva-run exec exits with status 1.

Verification

2026-10-04, scratch trees (HOME, PREFIX, XDG_CACHE_HOME in a scratch directory; the 2.7.9 wheel; bundles from a
file:// release base with the pins above). S25: Galaxy S25, Adreno 830, Python 3.13. S20: Galaxy S20, Adreno 650
with Mesa Turnip, Python 3.14. A35: Mali-G68 r38p1, Python 3.14. A53: Mali-G68 r32p1, Python 3.13. S21: Mali-G78
r38p0, Python 3.13.

Check S25 S20 A35 A53 S21
Fresh install of the five bundles; $PREFIX/lib stays empty; 7 commands are links PASS PASS PASS PASS PASS
Each command resolves its bundle's libraries inside the bundle (linker64 --list), started through its link without LD_LIBRARY_PATH PASS PASS PASS PASS PASS
Second install: five bundles verified and reused, no download PASS PASS PASS PASS PASS
Upgrade of a tree installed by the 2.7.8 wheel: LLM and TTS upgraded, STT / Diffusion / BitNet verified and their commands relinked PASS PASS PASS PASS PASS
migrate on that tree: 25 of 29 library copies moved out, 4 left with their reason PASS PASS PASS PASS PASS
Copying another file onto a linked command leaves the release unchanged not run PASS not run not run not run
ameva-run exec, default route: expected text (Qwen2.5-0.5B) PASS (Vulkan, 24 t/s) PASS (CPU, 29 t/s) PASS (Vulkan, 6.5 t/s) PASS (CPU, 22 t/s) PASS (CPU, 48 t/s)
ameva-run exec -b cpu: expected text PASS (94 t/s) PASS (31 t/s) PASS (39 t/s) PASS (23 t/s) PASS (47 t/s)
ameva-run exec -b vulkan (Vulkan forced) as the default route (24 t/s) stops (1) as the default route stops (3) stops (3)
llama.cpp on the CPU with the adapter's arguments and environment: expected text PASS PASS PASS PASS PASS
llama.cpp on Vulkan with the adapter's arguments (-fa 0) and the shim: expected text PASS (25 t/s) aborts (1) PASS (6.7 t/s) aborts (2) aborts (2)
whisper.cpp on Vulkan (ggml-tiny, 60 s sample) with the shim: correct transcript PASS (6.5 s) aborts (1) PASS (27.9 s) PASS (23.7 s) PASS (15.8 s)
stable-diffusion.cpp on Vulkan (SDXS, 512x512, 1 step) with the shim: image written PASS (10.9 s) PASS (11.6 s) no model no model PASS
BitNet CLI on the CPU with the bundle's own library: runs PASS PASS PASS PASS PASS
TTS starts (--help); no ncnn model on the devices same same same same

(1) The bundle's Vulkan backends abort on Turnip (llama.cpp: ErrorDeviceLost, with and without flash attention;
whisper.cpp: pipeline creation) with every shim and without one. Not introduced by this release; the adaptive routes
do not select them there.
(2) Descriptor-set assert of Known issues 1, measured with the same arguments outside the installation test. The
adaptive route on these two devices is the CPU, as in 2.7.8.
(3) The forced plan carries -fa 0; the backend stops with the descriptor-set assert of Known issues 1, and
ameva-run exec prints it and exits with status 1. With flash attention the backend returns corrupt text on these
devices (Known issues 1).

Vulkan HAL shim of this release against no shim, the shim packaged up to 2.7.8 (662be554...) and the shim of the
diffusion bundle (8a6a2775...), llama.cpp and whisper.cpp started from their bundle directory:

Device no shim 662be554... 8a6a2775... this release
S25 (Adreno 830) both run both run both abort (subgroup-size assert) both run
A53 (Mali-G68 r32p1) whisper crashes whisper crashes both run both run
A35, S21 (Mali) both run both run both run both run
S20 (Turnip) both abort (1) both abort both abort (subgroup-size assert) both abort (1)

Unit tests: 206 passed, 16 skipped on the build host (Windows); on S20 and S25 (Termux), before the last two tests
were added, 215 passed, 1 skipped, and 4 failed that read the device's own production installation and fail in the
same way with the 2.7.8 sources.

Correction to the 2.7.8 notes

The 2.7.8 notes list "llama.cpp generation through the runtime environment (Qwen2.5-0.5B Q4_K_M, Vulkan): PASS" for
S25 and A53. That check recorded that tokens were generated; it did not compare the text. With flash attention on,
the text is corrupt on both devices (Known issues 1).

Known issues (not introduced by this release)

  1. The LLM bundle's Vulkan backend (ggml-vulkan of llama.cpp b8471) has two defects. Measured 2026-10-04 with
    greedy decoding against the CPU's text, prompt "The three primary colors are", context 2048, 4 threads; models
    Qwen2.5-0.5B, Llama-3.2-1B and Gemma-2-2B, all Q4_K_M.

    • Flash attention returns corrupt text. llama.cpp turns flash attention on by itself for a GPU backend. With it
      the text is corrupt for all three models on Adreno 830 and on Mali-G68 r38p1, and for the 0.5B model on Mali-G68
      r32p1 and Mali-G78 (!!!!..., izable!!!!..., ilmiş...浓...). It does not depend on the shim, on
      GGML_VK_DISABLE_F16, on the KV cache type or on where the KV cache lives.
    • Without flash attention the backend aborts on Mali with
      GGML_ASSERT(ctx->descriptor_set_idx < ctx->descriptor_sets.size()): for the 0.5B model on Mali-G78 and
      Mali-G68 r32p1 (no integer dot product), and for the 1B and 2B models on Mali-G68 r38p1. Twelve further settings
      and options of the backend do not avoid it (S21). Keeping the KV cache on the CPU (--no-kv-offload) does, at 1
      to 5 tokens per second where the CPU alone reaches 8 to 51, and Gemma-2-2B then returns wrong text.
    -fa 0, all layers on the GPU Qwen2.5-0.5B Llama-3.2-1B Gemma-2-2B
    S25, Adreno 830 CPU's text, 17 t/s (CPU 41) coherent, 21 t/s (CPU 28) coherent, 10 t/s (CPU 9)
    A35, Mali-G68 r38p1 CPU's text, 6 t/s (CPU 37) aborts aborts
    A53, Mali-G68 r32p1 aborts not run not run
    S21, Mali-G78 aborts not run not run
    S20, Turnip aborts (ErrorDeviceLost) not run not run
    -fa 0 --no-kv-offload Qwen2.5-0.5B Llama-3.2-1B Gemma-2-2B
    A35 CPU's text, 3.0 t/s (CPU 37) coherent, 1.3 t/s (CPU 19) wrong text, 1.0 t/s (CPU 8)
    A53 CPU's text, 4.2 t/s (CPU 25) coherent, 4.6 t/s (CPU 15) wrong text, 0.7 t/s (CPU 6)
    S21 CPU's text, 5.4 t/s (CPU 51) coherent, 2.1 t/s (CPU 22) wrong text, 1.8 t/s (CPU 9)

    "Coherent": the first eight tokens are the CPU's, then the text continues differently; that Vulkan text is the
    same on every device.

    What this release does about it: the routes stay as in 2.7.8 and flash attention is turned off on every Adreno
    and Mali Vulkan plan of the router, which is what ameva-run exec and ameva_runtime.run() use. On Galaxy A35
    the adaptive route therefore answers correctly for Qwen2.5-0.5B and aborts with the assert for the larger models;
    ameva-run exec -b cpu runs them on the CPU. The backend itself is not changed. The planned replacement is the
    project's own Vulkan backend (ggml-ameva, in ameva-compute), which the LLM bundle does not contain yet.

    Not covered: LlamaCppAdapter (the binding API that termux-llamacpp calls) turns flash attention off only on
    Adreno and for llama-completion; for llama-cli on another GPU it leaves llama.cpp's default, and for an engine
    object it sets flash_attn on. On Mali that is the corrupt-text case above.

  2. GGML_VK_FORCE_MEDIUM_MATMUL has no effect. The router and the adapters set it for Mali, but neither bundled
    ggml-vulkan library reads a variable of that name (GGML_VK_DISABLE_F16 is read).

  3. BitnetAdapter.build_cli_args passes options that the bundled termux-bitnet-cli rejects (--simple-io;
    exit status 2). The CLI runs with the options its --help lists.

  4. Devices installed by earlier versions keep the files of the shared layout until ameva-run install and
    ameva-run migrate are run. Where the STT bundle replaced libc++_shared.so (seen on A35 and A53),
    apt install --reinstall libc++ restores the package's file.

  5. termux- packages* (termux-llamacpp, termux-stt, termux-tts, termux-diffusion, termux-vision, termux-bitnet)
    still install libraries into $PREFIX/lib and open libraries from it. They are not changed by this release.