You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hexagon selection currently emits ['HTP*'], which requests every discovered HTP session. On devices exposing several sessions, this substantially increases native compute-buffer allocation. Select the first exact runtime HTP name instead, and resolve existing saved wildcard, stale, or multiple HTP selections before normal model initialization.
Resolution preserves saved preferences and the GPU-layer setting. If discovery fails or no HTP device is available, that load uses CPU with zero GPU layers; a later load can recover Hexagon. Settings and benchmarks share the same device choice, while unavailable benchmark backends still fail their cell rather than measure CPU. CPU/OpenCL/iOS selection and flash policy are unchanged.
Fixes#904. Based on main after #901 merged; the diff contains only the HTP selection fix and its tests.
Validation
Full lint and typecheck pass. Full Jest coverage run: 275 suites, 4,418 tests, 310 snapshots pass; two tests skipped. Coverage is 77.08% statements, 72.06% branches, 73.13% functions and 77.14% lines.
Native-boundary tests cover legacy preferences, unavailable/rejected discovery, CPU fallback and recovery, exact runtime ordering, zero GPU layers, coherent settings during asynchronous discovery, and benchmark isolation.
Myron and Galaxy S23: baseline/candidate benchmark matrices, CPU/OpenCL controls, and flash-OFF Qwen chat before visiting Settings and after selection/restart. The candidate saves one exact HTP name, retains flash OFF and produces the correct answer on both phones.
Paired Android measurements
Benchmarks use identical per-model configs: pp256/tg64, three repetitions, context2048, six threads, mmap off; Hexagon/CPU flash ON and OpenCL flash OFF. These are individual matrix trials, not statistical performance guarantees. All before/after thermal snapshots report status 0, but temperature and OS memory/cache state differ; Myron candidate runs occurred the following day.
Myron case
Baseline
Candidate
Qwen3 1.7B Q4_K_M HTP
201.39 pp / 18.64 tg tok/s
213.33 pp / 19.86 tg tok/s
Qwen native buffers
5,118.39 MiB across six HTP sessions
1,764.11 MiB with HTP0
Phi4 mini Q4_K_M
Android LOW_MEMORY
Passed: 91.30 pp / 13.67 tg
Phi4 mini Q6_K
Android LOW_MEMORY
Passed: 66.80 pp / 11.01 tg
Gemma4 E2B Q4_K_M
Android LOW_MEMORY
Passed: 134.22 pp / 13.45 tg
Gemma4 E2B Q6_K
Passed: 64.85 pp / 2.49 tg
Passed: 114.98 pp / 13.59 tg
Gemma4 E2B Q8_0
Passed: 382.06 pp / 9.10 tg
Passed: 801.00 pp / 20.95 tg
All eight Myron candidate cells passed, including CPU/OpenCL controls whose native allocations remain unchanged. Native buffer totals are allocation-log measurements, not process PSS or total system memory. Qwen reported peak memory was 1,681.10 → 1,548.58 MiB.
S23 already uses one HTP session in the baseline: Qwen native buffers remain 1,764.11 MiB; prefill/decode measured 95.30/12.72 → 90.09/14.38 tok/s. Known Phi Q4_0 native abort, Phi Q8_0 allocation failure and Gemma Q6_K/Q8_0 memory kills remain. Phi Q6_K initially passed only on baseline; a reversed-order repeat passed only on candidate, leaving each build with one pass and one confirmed memory kill. This does not establish a repeatable candidate-specific regression or workload reliability.
With flash OFF, Myron Phi Q4_K_M and Gemma Q4_K_M both completed correct Paris answers on candidate; baseline attempts ended in confirmed LOW_MEMORY without a complete answer. S23 Phi Q4_0 still aborts after loading and Gemma Q6_K still dies during load on both builds. Qwen completed correct answers before Settings and after selection/restart on both phones.
Artifact provenance and limits
Paired measurements use preserved PR #901 CI build 6408291 (runtime-equivalent to base 986f402a) and a controlled comparison APK with only its Hermes JavaScript bundle replaced by the freshly compiled candidate bundle. Every other non-signing APK entry, including native libraries/assets, is byte-identical. Installed APK hashes and model hashes were verified. The independent complete Gradle build uses package native prebuilts and passes; it is a separate artifact from the controlled measurement APK. Candidate runtime source 175a7016 is unchanged by test-only commit 47a26875. After rebasing onto merged #901, current head d50f9646 has the identical complete Git tree as the reviewed and tested 47a26875; all four patches are unchanged.
Myron E2E data had to be recreated after an installation problem, so its legacy selection was reseeded; S23 retained its E2E datastore across replacement installs. UI text/captures establish actual generation; full native arguments and allocation evidence come from benchmark traces and complementary native-boundary tests. These results do not claim that all Hexagon model failures are fixed.
Visual captures are complete; uploading them is pending GitHub browser-session authentication.
The reason will be displayed to describe this comment to others. Learn more.
Independent review of 47a26875 is complete across architecture, QA, security, performance, mobile, data, UX and local invariants. No source-code findings were identified. Independent lint, typecheck, full tests and coverage pass; the paired device and actual-generation evidence was reviewed with its documented artifact and experimental limits.
Approval remains pending the required visual evidence: all eight captures exist and were inspected, but uploading them failed because the GitHub browser session expired (HTTP 302). Refreshing that authentication and posting the captures resolves this prerequisite; no code change or new device run is requested for it.
This draft targets the pinned base for #901. GitHub currently lists no status checks for this temporary base; retarget after #901 merges and run the applicable checks on the resulting branch.
203 planned; 185 passed; 18 not passed (#901: 182 passed); Klee supports CPU only
Device
Backend
Tier
Planned
Passed
Of passed: rerun
Not passed
poco-myron
cpu
smoke
9
9
0
0
poco-myron
cpu
focused
20
20
0
0
poco-myron
hexagon
smoke
9
9
0
0
poco-myron
hexagon
focused
20
20
0
0
poco-myron
gpu
smoke
9
9
0
0
poco-myron
gpu
focused
20
20
0
0
samsung-s23
cpu
smoke
9
9
0
0
samsung-s23
cpu
focused
20
16
3
4
samsung-s23
hexagon
smoke
9
9
0
0
samsung-s23
hexagon
focused
20
14
2
6
samsung-s23
gpu
smoke
9
9
0
0
samsung-s23
gpu
focused
20
14
0
6
poco-x7-klee
cpu
smoke
9
9
0
0
poco-x7-klee
cpu
focused
20
18
3
2
Reading the tables
Meaning
Prefill / Decode
tok/s; higher is faster
Weights / KV / Compute / Total
Allocated buffers, MiB; not process RSS
Parentheses
Δ versus the stated reference, matched settings; + means increase
—
No measurement or no matched reference; never zero
Pass / Pass (rerun)
Completed on requested backend / selected measurement from a rerun
Not passed
Failures, timeouts and interruptions remain in coverage
Note
Detail
Fix (Myron Hexagon)
Every Hexagon cell requests HTP0 and allocates 1 HTP session (#901: HTP* → 6 sessions). Allocated total median −19.2% smoke / −24.0% focused (range −8.7% to −75.1%). The 5 #901 non-passes (Phi-4-mini Q4_K_M, Q6_K; Gemma-4-E2B Q4_K_M, Q6_K, Q8_0) pass.
Myron coverage
87/87 in the uninterrupted matrix, 0 reruns. #901: 82/87, 33 of them from reruns.
Myron Hexagon throughput
Matched cells vs #901: prefill median +6.0% smoke (n=9) / +5.4% focused (n=15); decode +11.3% / +12.0%.
Myron CPU Δ
CPU path and native libraries unchanged. Deltas run both ways (−23.8% to +41.2% prefill) because #901 CPU references mix an interrupted original matrix with fresh-process reruns. #907 smoke vs focused on shared cells: median −1.2% prefill, −0.7% decode.
S23
Already 1 HTP session on #901; allocated memory identical in every matched cell. Known Phi-4-mini Q4_0 Hexagon native crash and Q8_0 Hexagon load failure (effective CPU) remain.
S23 status changes
Phi-4-mini Q6_K CPU, Gemma-4-E2B Q4_K_M Hexagon and Gemma-4-E2B Q4_0 GPU passed on #901 rerun, LMK on #907 rerun. Same-device A/B afterwards (fresh process each, order 901/907/907/901): Phi Q6_K CPU 1/2 vs 1/2, Gemma Q4_K_M Hexagon 2/2 vs 2/2, Gemma Q4_0 GPU 0/2 vs 0/2. No APK difference.
Klee
CPU only. Gemma-4-E2B CPU reruns ran directly after the focused matrix (CPU 41 °C). Cool repeat (31.8 °C) vs #901 prefill/decode: Q4_0 92.2/13.7 (−5.1%/−1.2%), Q4_K_M 69.2/13.5 (+6.8%/+0.5%), Q6_K 51.0/10.3 (+11.8%/+5.0%). Table keeps the first rerun.
Klee non-passes
Phi-4-mini Q8_0: app died under memory thrashing in the matrix; rerun timed out while thrashing. Gemma-4-E2B Q8_0: LMK (also LMK on #901).
Myron only; v1.17.2 was not benched on S23 or Klee
Workload / settings
Same standard configs: pp256 / tg64 / 3 reps / 30 s settle; CPU + Hexagon flash on, GPU flash off; mmap off. Initialization settings identical in every matched cell
Scope
The delta includes the llama.rn rc.1 → rc.3 bump from #901 plus the single-HTP fix from this PR
Gains come from both changes. Example, Qwen3.5-0.8B Q8_0 smoke decode: 25.5 (v1.17.2) → 37.7 (#901) → 46.9 tok/s (#907).
CPU focused
Do not read the +28.8% as a gain. v1.17.2's own focused-vs-smoke prefill on 6 shared CPU cells is −25.3% [−30.2%, −10.9%], so its focused CPU reference is confounded. #907 on the same cells: −1.2%. Use the smoke row for CPU.
GPU
Three cells regress with the rc.3 engine and are unchanged between #901 and #907. See below.
130–157 tok/s prefill through v1.16; about 6× faster on 0.13.0-rc.0/rc.1; back to the old level on rc.3. Q4_K_M on the Qwen models keeps the rc.0 gain; Gemma-3-1B Q4_0 and Q8_0 are unaffected.
Model file
Gemma-3-1B Q4_K_M stores 117 tensors as Q5_0, 299.1 MiB in total; its hidden size is 1152, likely not divisible into the 256-element K-quant blocks. The Qwen Q4_K_M files contain no Q5_0. The 306 MiB kept on CPU in every build is the Q8_0 token embedding, also on CPU for Q4_0.
Placement
On rc.3, CPU weights grow by 299.13 MiB (605.13 − 306.00), matching the Q5_0 total.
Code change
llama.cpp 95ef7fc16 (#26477, "opencl: quant lm_head / decode GEMV and medium-batch GEMM optimizations"), between b10588 (rc.1) and b10829 (rc.3), makes OpenCL supports_op decline MUL_MAT when src1->ne[1] >= 512 for quant types without an Adreno GEMM kernel. Q5_0 has none. Present in the rc.3 package source, absent in rc.1.
Mechanism
llama.cpp tests weight placement (weight_buft_supported, llama-model-loader.cpp) with a 512-row MUL_MAT. The OpenCL device declines Q5_0, so those weights load on CPU and every layer crosses CPU/GPU, as on 0.12.4.
Confidence
Established from source and matching allocation sizes. Not yet confirmed with a patched build.
Gemma-4-E2B
GPU decode vs v1.17.2 (focused): Q4_K_M −25.7%, Q6_K −24.4%, Q4_0 +9.3%. On rc.3, 29.24 / 25.84 MiB of weights move from OpenCL to a new CPU_REPACK buffer in those two files only. Tensors not traced.
This PR
No effect. #901 and #907 match for all three cells.
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
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.
Hexagon selection currently emits
['HTP*'], which requests every discovered HTP session. On devices exposing several sessions, this substantially increases native compute-buffer allocation. Select the first exact runtime HTP name instead, and resolve existing saved wildcard, stale, or multiple HTP selections before normal model initialization.Resolution preserves saved preferences and the GPU-layer setting. If discovery fails or no HTP device is available, that load uses CPU with zero GPU layers; a later load can recover Hexagon. Settings and benchmarks share the same device choice, while unavailable benchmark backends still fail their cell rather than measure CPU. CPU/OpenCL/iOS selection and flash policy are unchanged.
Fixes #904. Based on
mainafter #901 merged; the diff contains only the HTP selection fix and its tests.Validation
Paired Android measurements
Benchmarks use identical per-model configs: pp256/tg64, three repetitions, context2048, six threads, mmap off; Hexagon/CPU flash ON and OpenCL flash OFF. These are individual matrix trials, not statistical performance guarantees. All before/after thermal snapshots report status 0, but temperature and OS memory/cache state differ; Myron candidate runs occurred the following day.
All eight Myron candidate cells passed, including CPU/OpenCL controls whose native allocations remain unchanged. Native buffer totals are allocation-log measurements, not process PSS or total system memory. Qwen reported peak memory was 1,681.10 → 1,548.58 MiB.
S23 already uses one HTP session in the baseline: Qwen native buffers remain 1,764.11 MiB; prefill/decode measured 95.30/12.72 → 90.09/14.38 tok/s. Known Phi Q4_0 native abort, Phi Q8_0 allocation failure and Gemma Q6_K/Q8_0 memory kills remain. Phi Q6_K initially passed only on baseline; a reversed-order repeat passed only on candidate, leaving each build with one pass and one confirmed memory kill. This does not establish a repeatable candidate-specific regression or workload reliability.
With flash OFF, Myron Phi Q4_K_M and Gemma Q4_K_M both completed correct Paris answers on candidate; baseline attempts ended in confirmed LOW_MEMORY without a complete answer. S23 Phi Q4_0 still aborts after loading and Gemma Q6_K still dies during load on both builds. Qwen completed correct answers before Settings and after selection/restart on both phones.
Artifact provenance and limits
Paired measurements use preserved PR #901 CI build
6408291(runtime-equivalent to base986f402a) and a controlled comparison APK with only its Hermes JavaScript bundle replaced by the freshly compiled candidate bundle. Every other non-signing APK entry, including native libraries/assets, is byte-identical. Installed APK hashes and model hashes were verified. The independent complete Gradle build uses package native prebuilts and passes; it is a separate artifact from the controlled measurement APK. Candidate runtime source175a7016is unchanged by test-only commit47a26875. After rebasing onto merged #901, current headd50f9646has the identical complete Git tree as the reviewed and tested47a26875; all four patches are unchanged.Myron E2E data had to be recreated after an installation problem, so its legacy selection was reseeded; S23 retained its E2E datastore across replacement installs. UI text/captures establish actual generation; full native arguments and allocation evidence come from benchmark traces and complementary native-boundary tests. These results do not claim that all Hexagon model failures are fixed.
Visual captures are complete; uploading them is pending GitHub browser-session authentication.
Generated by PocketPal Dev Team