Repository navigation
amv-runtime v2.9.0: renamed from ameva-runtime, licence change, OpenCL on Mali, resident runtime, GET_ROWS of repacked weights on the GPU
Release Notes - amv-runtime v2.9.0 (2026-11-19)
Release Tag: v2.9.0
Distribution Channels: PyPI (amv-runtime), NPM (amv-runtime), GitHub Releases (uno-km/amv-runtime-releases)
Status (2026-11-23): PyPI amv-runtime 2.9.0 is published. The npm package amv-runtime is not yet published (npm answered 403 "account temporarily suspended"); the npm tarball is attached to this release (amv-runtime-2.9.0.tgz).
Target Platform: Android ARM64 / Qualcomm Adreno, ARM Mali
License: PolyForm Noncommercial 1.0.0; commercial use under a separate licence (from this version; see below)
Summary
- Rename. The package is published as
amv-runtime(PyPI and npm) and the repositories areuno-km/amv-runtime
anduno-km/amv-runtime-releases; up to 2.8.1 the names wereameva-runtime,@ameva/runtimeand
uno-km/ameva-runtime(-releases). The import packageameva_runtimeand the commands are unchanged. The two PyPI
distributions ship the same import package, soameva-runtimemust be uninstalled beforeamv-runtimeis installed
(pip uninstall -y ameva-runtime). Old GitHub URLs redirect. The old PyPI project and the npm package@ameva/runtimeget no
further releases. - Licence change. Free for noncommercial use, a commercial licence for any commercial use (
LICENSE,
LICENSE-COMMERCIAL.md). Versions up to 2.8.1 keep the Apache-2.0 licence they were released under. - New GPU backend in the llama bundle (ameva-compute
40ce791, about 60 commits after 2.8.1's7e99154): the
backend chooses its GPU API per device (OpenCL on Mali-G68, Vulkan elsewhere), prompt kernels for K-quants in
16-row tiles, block-integer prompt kernels on Mali OpenCL, q5_0 and q8_0 prompt kernels written by hand in OpenCL C (Galaxy A35,
Qwen2.5-0.5B prompt 116 -> 182 t/s), the 2.8.1 attention kernel restored, runtime ABI 2.3.0. - Resident runtime (
ameva-run serve / call / resident) and a memory guard forameva-run exec. - The default route per device is unchanged (GPU: S25, S20, A35; CPU: S21, A53).
Changes
1. Licence
From 2.9.0 the package and its sources are offered under the PolyForm Noncommercial License 1.0.0 (LICENSE), with
a separate commercial licence for any commercial use (LICENSE-COMMERCIAL.md, contact amv.foundation.kr@gmail.com).
Noncommercial use (personal study, research, experiment, hobby projects; charitable, educational, public research and
government organisations) is free. Versions up to 2.8.1 keep the Apache-2.0 licence they were released under.
Third-party components keep their own licences (THIRD_PARTY_NOTICES.md).
2. llama bundle
llama-cli-vulkan-android-arm64.tar.gz: the 2.7.9 archive with every member unchanged plus the backend files built
from ameva-compute 40ce791 (branch release/stage2) on the Galaxy S25 (clang 21.1.8, the release convention):
AMEVA_QMM_CHECK=PASS (516/516), both batch KATs, AC_ABI_CHECK=PASS (16 checks), AMEVA0 registered by the bundle's
llama-completion. Pin f5f4394b24d4.... The four other bundles are those of 2.7.9.
What the backend does differently from 2.8.1's 7e99154:
- API per GPU. The same kernels run on Vulkan or on OpenCL (
ac_runtime's OpenCL backend, kernels translated
from the GLSL sources). Unset orAMEVA_BACKEND=auto: Mali-G68 (Galaxy A35, A53) runs OpenCL, every other GPU
Vulkan, and the choice is printed.AMEVA_BACKEND=vulkan|openclforces one. - Integer dot product on Mali-G78 (Galaxy S21) Vulkan: enabled after a known-answer test at start-up; the driver
executes it without offering the extension (outside the Vulkan specification).AC_VK_FORCE_INT_DOT=0turns it off. - Prompt processing: q4_K, q5_K and q6_K weights in 16-row tiles; block-integer prompt kernels on Mali OpenCL;
one submission per token graph on Turnip. - Attention: the 2.8.1 kernel is used again for one-row tiles.
- Operators: GET_ROWS for q8_0 and q6_K and for tables above one binding; batched MUL_MAT on repacked weights is
declined instead of failing at compute time. - Opt-in:
AMEVA_REPACK_CACHE=<dir>withAMEVA_REPACK_MODEL=<gguf>keeps a model's repacked weights in a file
(a later load copies them instead of converting on the CPU);AMEVA_LOAD_PROFILE=1prints the load phases. - Runtime ABI 2.3.0 (
libac_runtime.so.2): callers built for 2.1 or later are accepted.
3. Resident runtime and memory guard
ameva-run serve, call and resident keep a model loaded between requests (Galaxy S20, same request: 2954-3040 ms
per call against 1610-1625 ms resident, identical text). ameva-run exec refuses a run that would take available
memory below the floor and ends the engine, not the Termux app, when memory runs out during the run; AMEVA_GUARD=0
turns the guard off.
4. Fixes
python/tests/test_bitnet_adapter.pydid not parse (a byte-order mark inside the file);npm/lib/errors.jshad one too.npm testprinted a pass without testing anything; it now runsnpm/test/package.test.js.- The CPU route's diagnosis printed "UI freeze protection guaranteed"; removed.
Verification
Two builds of the backend were tested. Items 1-7 were measured on 2026-11-18 with the first candidate build (plugin
01bbdb76f785..., ameva-compute c0dbdca) on the Galaxy S20 (Adreno 650, Turnip), Galaxy A35 (Mali-G68 r38p1) and
Galaxy A53 (Mali-G68 r32p1). The bundle published here holds the final build (plugin b7c7badacd7f..., 40ce791,
built on the Galaxy S25). It differs from the first candidate by the q5_0 and q8_0 OpenCL prompt kernels written by
hand (Mali OpenCL only) and by GET_ROWS of repacked tables on the GPU, and was tested on 2026-11-19 on the Galaxy S25,
S21, S20 and A35 (item 8; the build before the GET_ROWS fix, 937fe49, plugin 6feecbb78574, was tested the same way). The
Galaxy A53 did not answer on 2026-11-19: the final build is not verified on it, and every A53 figure below is
that of c0dbdca. Files: docs/handover/evidence/20261118-stage2-rc290/ and 20261119-stage2-rc290-r2/.
On the A35 and A53 the ssh sessions ran on three little cores (0-2): their GPU figures are comparable with each other,
their CPU figures are not a reference.
1. Regression suite (ameva-compute scripts/fleet/regress_fleet.sh): runtime ABI check, batch KAT, 516 MUL_MAT
cases on the automatic backend, Qwen2.5-0.5B greedy text against the CPU: all pass on all three (S20 Vulkan,
A35 and A53 OpenCL; on the Mali phones 36 of the cases ran the block-integer kernels).
2. Conformance, ggml test-backend-ops (b8471) for AMEVA0, default / AMEVA_REPACK_ALL=1: S20 4426/4426,
4052/4052 (Vulkan); A35 4430/4430, 4054/4054 and A53 4430/4430, 4054/4054 (OpenCL). A mode counts only when AMEVA0 was
listed and ran a nonzero number of tests.
3. Against the CPU (KL divergence), tools/fleet/lab/parity_long.sh, gate kld_mean <= 0.01:
| kld_mean (gate 0.01) | S20 Adreno 650 (Vulkan) | A35 Mali-G68 r38 (OpenCL) | A53 Mali-G68 r32 (OpenCL) |
|---|---|---|---|
| context 256, batch, Qwen / Llama | 4.04e-3 / 2.34e-3 | 6.41e-3 / 3.51e-3 | 6.41e-3 / 3.51e-3 |
| context 256, one token per call, Qwen / Llama | 6.42e-3 / 3.15e-3 | 4.99e-3 / 3.81e-3 | 4.54e-3 / 3.78e-3 |
| after a context shift, Qwen / Llama (32 positions) | 8.73e-3 / 2.60e-3 | 9.66e-3 / 1.93e-3 | 6.67e-3 / 1.75e-3 |
| reuse of cells, both models (kld_max) | 0 | 0 | 0 |
| context 2048, batch / one token per call, Qwen (128 positions) | 1.72e-3 / 1.98e-3 | 1.90e-3 / 1.71e-3 | 1.90e-3 / 1.76e-3 |
The CPU's own distance between its two kernel paths is 4.76e-3 (Qwen) and 3.30e-3 (Llama) on 16 positions and
1.83e-3 on the 2048-token run. The Qwen shift figure of the Galaxy A35 (9.66e-3) is close to the gate.
After a context shift the comparison with the f16-cache CPU measures the rounding of the rotated f16 keys on both
sides: against a CPU with an f32 cache, the f16-cache CPU itself is at 1.40e-2 and the GPU at 1.48e-2 (S20), 1.38e-2 (A35), 1.55e-2 (A53) (Qwen, 32
positions). The gate is applied to the other rows; a redefinition of the shift gate is open (see Known issues).
4. Against release 2.8.1 (first candidate build c0dbdca; the A35 was measured again with the final build, item 8)
(median t/s, the same session, five rotated rounds per variant, temperature and clock-cap
gates; the 1500-byte prompt is about 370 tokens, 64 tokens generated):
a35 (cores 0-2)
| model | phase | 2.8.1 Vulkan | candidate Vulkan | change | candidate OpenCL | change | CPU | runs | same text as 2.8.1 |
|---|---|---|---|---|---|---|---|---|---|
| qwen2.5-0.5b-instruct-q4_k_m | prompt | 189.41 | 176.13 | -7 % | 115.61 | -39 % | 14.43 | 5/5/5/5 | no |
| qwen2.5-0.5b-instruct-q4_k_m | generation | 14.63 | 14.82 | +1 % | 17.86 | +22 % | 5.75 | 5/5/5/5 | no |
| Llama-3.2-1B-Instruct-Q4_K_M | prompt | 82.23 | 89.50 | +9 % | 91.04 | +11 % | 17.05 | 5/5/5/5 | no |
| Llama-3.2-1B-Instruct-Q4_K_M | generation | 9.07 | 9.93 | +9 % | 12.33 | +36 % | 4.19 | 5/5/5/5 | no |
a53 (cores 0-2)
| model | phase | 2.8.1 Vulkan | candidate Vulkan | change | candidate OpenCL | change | CPU | runs | same text as 2.8.1 |
|---|---|---|---|---|---|---|---|---|---|
| qwen2.5-0.5b-instruct-q4_k_m | prompt | 66.90 | 73.90 | +10 % | 75.46 | +13 % | 14.56 | 5/5/5/5 | yes |
| qwen2.5-0.5b-instruct-q4_k_m | generation | 10.79 | 11.04 | +2 % | 14.40 | +33 % | 4.63 | 5/5/5/5 | yes |
| Llama-3.2-1B-Instruct-Q4_K_M | prompt | 27.01 | 27.95 | +3 % | 50.62 | +87 % | 16.65 | 5/5/5/5 | yes |
| Llama-3.2-1B-Instruct-Q4_K_M | generation | 6.07 | 6.87 | +13 % | 9.68 | +59 % | 4.73 | 5/5/5/5 | yes |
s20 (cores 0-7)
| model | phase | 2.8.1 Vulkan | candidate Vulkan | change | candidate OpenCL | change | CPU | runs | same text as 2.8.1 |
|---|---|---|---|---|---|---|---|---|---|
| qwen2.5-0.5b-instruct-q4_k_m | prompt | 240.86 | 236.43 | -2 % | - | - | 86.22 | 5/5/0/5 | no |
| qwen2.5-0.5b-instruct-q4_k_m | generation | 24.26 | 22.97 | -5 % | - | - | 28.59 | 5/5/0/5 | no |
| Llama-3.2-1B-Instruct-Q4_K_M | prompt | 95.49 | 104.43 | +9 % | - | - | 78.12 | 5/5/0/5 | no |
| Llama-3.2-1B-Instruct-Q4_K_M | generation | 13.57 | 16.29 | +20 % | - | - | 16.80 | 5/5/0/5 | no |
5. Text past the end of a context (-c 256 -n 700 --context-shift, Qwen2.5-0.5B, two prompts, Galaxy S20):
the GPU route completes 699 tokens on both prompts, as the CPU does.
6. Installation (tools/fleet/lab/test_rel.sh, scratch trees): S20 fresh install from the local assets,
upgrade from the published 2.8.1 (only the llama bundle replaced, four bundles reused), ameva-run exec on the
default route (GPU), -b vulkan and -b cpu: the same text on all three routes. Repeated on 2026-11-19 with the
bundle of 937fe49 (pin f77bea2135c0...): same result (20261119-stage2-rc290-r2/test_rel_s20.txt). With the final
bundle (pin f5f4394b24d4..., wheel a0a422455b42..., plugin b7c7badacd7f from 40ce791) the fresh install and the
three execution routes pass on the S20; the upgrade from 2.8.1 was not repeated for it: the phone had no network
that evening (DNS failure while downloading 2.8.1), so the 2.8.1 tree could not be set up (test_rel_final_s20.txt). The same test was not run on the A35 and A53 (the other four bundles are not on the A53; not downloaded).
7. Python and npm tests: python/tests 231 passed, 23 skipped (Windows); on the Galaxy S20 the resident-runtime
tests 12/12. Four tests fail on the phone and also on 2.8.1's tree there (they read the host's real environment;
known, not changed by this release). npm test 5/5.
8. Final build (2026-11-19). The build 937fe49 (plugin 6feecbb78574...) was measured as listed below; the
final 40ce791 (plugin b7c7badacd7f...) differs from it by ameva_get_rows_q only: in the SPIR-V and in the OpenCL C
headers the four existing GET_ROWS kernels changed and four were added, every other kernel is byte-identical
(compared array by array). On 40ce791 the regression suite, test-backend-ops and the checks of the fix were
repeated (below). Results of 937fe49:
- On the Galaxy S25 (glslang 16.3.0)
scripts/build_ameva_kernels.pyreproducedggml_ameva_kernels_spv.hand
ggml_ameva_kernels_cl.hof the repository byte for byte; the backend was built there (build_runtime_backend.sh). - Regression suite (ABI, batch KAT, 516 MUL_MAT cases, Qwen2.5-0.5B greedy text against the CPU): pass on the S25 (Vulkan),
S20 (Vulkan) and A35 (OpenCL). On the Galaxy S21 (Vulkan, integer dot product) ABI, KAT and the 516 cases pass and the
greedy text differs from the CPU's from the 36th token (Known issues 6). test-backend-ops, default /AMEVA_REPACK_ALL=1: S25 4430/4430, 4054/4054; S21 4428/4428, 4053/4053; S20 4426/4426,
4052/4052 (all Vulkan); A35 4430/4430, 4054/4054 (OpenCL).- KL divergence against the CPU: A35 (context 256, Qwen) batch 6.41e-3, one token per call 4.99e-3 (the digits of
c0dbdca), greedy text equal to the CPU's for 64 of 64 tokens; S21 4.16e-3 and 4.33e-3 (gate 0.01); S25 on 2048
tokens 2.04e-3 and 1.73e-3 (2.8.1's backend, same run: 1.89e-3, 1.63e-3), greedy text 64 of 64. The S25 shift row is
in Known issues 7.
9. GET_ROWS of repacked weights on the GPU (40ce791): with AMEVA_REPACK_ALL=1 (or after another op repacked the
weight) GET_ROWS of a q4_0, q5_0, q8_0 or q6_K table no longer leaves the GPU. ameva_get_rows_q -DREPACKED reads the
Q, H and S regions (q6_K in 16-row tiles) of a whole 2-D table that fits one binding; a view of such a table, a batched
table and one above a binding stay declined and are reported.
test-backend-opsGET_ROWS on the S25 withAMEVA_REPACK_ALL=1: the four types run on AMEVA0 and match the CPU
(they were declined before); the view cases (v=1) and batched tables are still declined.test-backend-ops, default /AMEVA_REPACK_ALL=1, whole suite: S25 4430/4430, 4062/4062; S21 4428/4428, 4061/4061;
S20 4426/4426, 4060/4060 (all Vulkan); A35 4430/4430, 4062/4062 (OpenCL). The second figure was 4054, 4053, 4052 and
4054 before.- Regression suite: S25, S20, A35 pass; the S21's greedy text differs as before (Known issues 6).
- Galaxy A35, whisper large-v3-turbo q5_0,
AMEVA_REPACK_ALL=1(the case that ended with SIGILL): rc=0 in the normal
and in the strict mode (no declined operation), transcript equal to the CPU transcript of the S21 (sha prefix
5f648a931025), encode 30.8 s. - Qwen2.5-0.5B (tied q6_K embedding) with
AMEVA_REPACK_ALL=1on the S25: KL divergence 4.21e-3 (batch) and 4.21e-3 (one
token per call), greedy text equal to the CPU's for 64 of 64 tokens, no declined GET_ROWS. - Galaxy A35 against 2.8.1, grade A protocol (median of five rotated rounds, all valid, cores 0-2, same session):
| model | phase | 2.8.1 Vulkan | final Vulkan | change | final OpenCL | change | c0dbdca OpenCL |
CPU |
|---|---|---|---|---|---|---|---|---|
| qwen2.5-0.5b-instruct-q4_k_m | prompt | 189.19 | 176.14 | -7 % | 182.00 | -4 % | 116.15 (-39 %) | 14.47 |
| qwen2.5-0.5b-instruct-q4_k_m | generation | 14.63 | 14.83 | +1 % | 17.96 | +23 % | 17.94 | 5.62 |
| Llama-3.2-1B-Instruct-Q4_K_M | prompt | 82.39 | 87.92 | +7 % | 90.41 | +10 % | 91.94 | 16.58 |
| Llama-3.2-1B-Instruct-Q4_K_M | generation | 9.09 | 9.95 | +9 % | 12.30 | +35 % | 12.31 | 4.08 |
The greedy text of the final OpenCL route equals 2.8.1's on both models (sha256 prefix a9f4da20, a2dcfeae);
the Vulkan route's text does not. The Llama model has no q5_0 weights, so its OpenCL figures did not change.
- GPU time per dispatch of the Qwen q5_0 prompt products on the A35 (OpenCL
c0dbdca-> final / Vulkan): 4864x896
20.0-23.7 ms -> 9.5-9.8 ms / 7.8 ms; 896x896 3.5-4.2 ms -> 2.0 ms / 1.5 ms (q5_0_mmq_a35_profile.txt).
Known issues
- The shift comparison cannot separate the GPU from rounding. With a CPU that has an f32 KV cache as the
reference, the CPU with the default f16 cache is itself at 1.40e-2 (32 positions) after a context shift, above the
0.01 gate, and the GPU is at 1.38e-2 to 1.55e-2. The gate's other rows (batch, one token per call, 2048 tokens) are
far below it. A new definition of the shift gate is open (ameva-computedocs/design/opencl-prompt-path.md). - Greedy text is not identical across versions on every device. Against 2.8.1 the text is the same on the Galaxy
A53 and differs on the Galaxy A35 and S20 (K-quant weights are summed in a different order since the 16-row
tiles; the KL divergence is within the gate). On the Galaxy S20 Qwen2.5-0.5B the 2.8.1 backend itself produced three
different greedy texts in five runs of one session. - Measured losses against 2.8.1: Galaxy S20 Qwen2.5-0.5B prompt -2 % and generation -5 % (measured with
c0dbdca; the Vulkan kernels did not change since); Galaxy A35 Qwen2.5-0.5B prompt -7 % on Vulkan and -4 % on the
OpenCL route that is the default there (final build; generation +23 %; Llama-3.2-1B prompt +10 %, generation +35 %).
The q8_0 128-row product on the A35 is still 1.7 times slower on OpenCL than on Vulkan. - Verification gaps of the final build: the Galaxy A53 was not reachable (its figures are those of
c0dbdca;
the q5_0 and q8_0 kernels were measured there only as a prototype, 1.2 times faster); the S25 and S21 were not
compared with 2.8.1 on prompt and generation speed, and the install test (item 6) ran on the S20 only. - Quantized KV cache, Mali token-generation speed against the CPU and the other items of 2.8.1's Known issues still apply.
- Galaxy S21 greedy text differs from the CPU's. With the Vulkan integer dot product (enabled by this release) the
Qwen2.5-0.5B text equals the CPU's for 35 tokens and then takes another branch; the KL divergence is 4.2e-3 to 4.3e-3
(gate 0.01) and top-1 agreement 93.75 % on 16 positions. The S21's default route stays the CPU. - Galaxy S25 context-shift row is above the gate. Qwen, 2048 tokens, 32 positions: 1.28e-2 against the f16-cache
CPU; against an f32-cache CPU the GPU is at 2.07e-2 (2.8.1's backend, same run: 1.51e-2) and the f16-cache CPU itself
at 1.09e-2. The maximum of one position is 0.27 (2.8.1: 0.18). Not investigated further; the other rows are far
below the gate (batch 2.04e-3, one token per call 1.73e-3, reuse of cells 0). - Other modalities were checked with the final plugin on four phones (S25, S21, A35, S20; vision, TTS, STT,
diffusion, BitNet; table and raw lines indocs/handover/evidence/20261119-modalities/). Findings that matter:- Whisper large-v3-turbo on the Galaxy S21 gives the CPU's transcript but its encoder takes 129-175 s on AMEVA0
against 22-31 s on the CPU; on the S25 AMEVA0 is 3 times faster than the CPU. - (Fixed in the final build, item 9.) On the Galaxy A35 a q5_0 whisper model with
AMEVA_REPACK_ALL=1ended with SIGILL: ggml-ameva declinedGET_ROWSof
the repacked q5_0 embedding ("runs on another backend") and the bundle's CPU library (built with i8mm) cannot run on
that CPU. WithoutAMEVA_REPACK_ALLthe model runs (encode 33 s) and gives the same transcript. - The Galaxy A35 vision caption differs from the CPU's from the 4th token (a 0.02-0.04 logit lead); the numerical
gate passes on all four phones. - Diffusion: the whole UNet + VAE pipeline on AMEVA0 is 33.6-42.2 dB from the CPU image (report only, not gated;
the images were not inspected); on the S21 the GPU sampling time (30.0 s) equals the CPU's (28.5 s). - Not run: the Galaxy A53; STT and diffusion on the S20.
- Whisper large-v3-turbo on the Galaxy S21 gives the CPU's transcript but its encoder takes 129-175 s on AMEVA0
Addendum 2026-11-23 (after publication)
- Galaxy A53, final build verified. The A53 answered on 2026-11-23. With the final backend (kit
regkit-20261119-145645-40ce791) on the installed 2.9.0 bundle (f5f4394b24d4): runtime ABI check 16/16, batch KAT 0 failed,AMEVA_QMM_CHECK516/516 on OpenCL (171 cases throughameva_mmq, 36 throughameva_mmqb), Qwen2.5-0.5B greedy text equal to the CPU's. Speed rows of the A53 above remain those of the first candidate (cores 0-2; this run: prompt 80.8 t/s on OpenCL against 14.1 t/s on the CPU, generation 17.9 against 6.9 t/s). - Fleet upgrade 2.8.1 -> 2.9.0 (package
amv-runtime) withtools/fleet/migrate_device.shon Galaxy S20, S21 and A53, all phases completed, doctor passes, the default route runs (S20 GPU Vulkan, S21 and A53 CPU). Galaxy S25 and A35 did not answer ssh and were not upgraded. - The old distribution
ameva-runtimeis removed first on each phone (same import package asamv-runtime).