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
These compiler findings are useful explanatory context, but they should remain clearly distinguished from direct device measurements.
30. FastRPC / Mempool vs DSPQueue
The project experimented with both:
DSPQueue
and:
FastRPC / mempool
A mempool/graph-dispatch path reached:
n_splits = 1
in an experiment, showing the potential value of more consolidated dispatch.
However, at that stage it was not yet loading cleanly in the normal llama-bench path.
Therefore it should be classified as:
architecturally promising
but not yet a stable production baseline
The wider JZ multi-model data also showed that FastRPC did not win universally.
Across an 8-model comparison, it won TG on 5 models and lost on 3.
This reinforces:
RPC/memory architecture matters, but there is no universal backend winner.
31. 4 GiB / Mapping Interpretation
The campaign must avoid reducing memory behavior to a single statement such as:
HTP is 32-bit, therefore max model = 4 GiB
These are distinct concepts:
pointer width;
DSP virtual address space;
individual mapping size;
total mapped memory;
IOVA;
scatter-gather;
FastRPC mapping;
mempool design;
per-session memory;
multiple buffers;
model file size;
effective weight residency.
The observed >4 GiB behavior in FastRPC/JZ must therefore be interpreted as a mapping/design/runtime issue unless the underlying architectural limit is independently proven.
32. Thermal State — Methodology Correction
Earlier benchmark sweeps did not always control thermal state adequately.
Observed states included:
GPU ≈ 68–70°C
DDR ≈ 72°C
GPU utilization ≈ 93%
These runs cannot be treated as clean A/B comparisons against cold runs.
The project therefore introduced a strict distinction:
COLD
WARM
THERMALLY CONTAMINATED
33. Correct Thermal Signal
A thermal-trip threshold such as:
cpu-hw-trip = 95°C
is not an operating-temperature reading.
For GPU thermal control, the relevant signal was:
gpuss
The benchmark methodology should therefore use real thermal-zone measurements rather than trip-point metadata.
34. Cold-Start Benchmark Protocol
A comparable benchmark should:
stop the previous workload;
allow cooling;
verify the relevant thermal zone;
start only when GPU temperature is below ~55°C;
perform controlled warm-up if required;
record temperature before the run;
run the benchmark;
record temperature during and after the run;
record throughput;
cool before the next candidate.
Any run without this control should be labeled explicitly:
WARM
or:
THERMALLY CONTAMINATED
35. Thermal Effect on D2-A
Measured HTP0 performance:
~41°C → 8.90 t/s
warm → 8.22–8.37 t/s
Approximate degradation:
-6% to -8%
Therefore:
Thermal state is a performance variable, not merely a power-management variable.
36. Thermal Governor Concept
A practical hysteresis rule was developed:
GPU ≥ 60°C → move toward HTP-heavy mode
GPU ≤ 50°C → GPU may become preferred again
50–60°C → keep previous state
The key is to move large contiguous execution regions, not rapidly alternate individual operators.
38. Allocator Correctness Bug
A separate GGML investigation identified a real allocator correctness problem.
An adversarial test constructed:
graph A → reservation
graph B → allocation
with:
same number of nodes;
same number of leaves;
same tensor sizes;
but different:
topology;
tensor lifetimes.
The old allocator could accept the stale memory plan.
Observed corruption included:
m0.data == m1.data
while both tensors were simultaneously live.
This demonstrates:
Equal tensor sizes do not imply equal valid memory plans.
This finding is directly relevant to dynamic heterogeneous scheduling because changing backend placement changes graph topology and lifetime structure.
39. Allocator Fingerprint Diagnostic
A debug signature based on FNV-1a was added.
The signature included properties such as:
operation;
tensor dimensions;
view source;
buffer ID;
source tensors.
It was generated during reservation and checked during later allocation.
On mismatch, the system logs an error.
Important:
fingerprint mismatch
is only a detector.
It does not prove that a new memory plan has been generated or is valid.
40. Regression Tests for Allocator / Pass 4.5
Two regression-test directions were created.
40.1 Adversarial topology-change test
Validates:
stale graph plan → corruption detected
and checks a mismatch counter for the adversarial graph.
It also checks:
identical graph → mismatch_count == 0
40.2 Pass-4.5 determinism test
The test compares old vs new pass-4.5 behavior over approximately:
450 graphs
and checks:
topological validity;
deterministic reservation ordering;
deterministic compute ordering.
This matters because scheduler transforms and allocator reuse are coupled.
41. Why Allocator Correctness Matters to Heterogeneous Scheduling
When backend placement changes:
same model
does not necessarily mean:
same graph
because:
backend boundaries move;
views/buffers may change;
lifetimes change;
reservations change;
MTP draft/verify paths differ.
Therefore stale memory plans are especially dangerous for:
MTP;
HTP/GPU layer splitting;
dynamic scheduling;
thermal switching;
speculative draft/verify execution.
42. MTP — Chronology Must Be Preserved
The MTP history is one of the most important examples of why old conclusions must not be overwritten by new ones.
43. MTP Phase M0 — Source Support Exists
The source model inspection identified MTP-related metadata/support:
The final MTP speedup must be validated with repeated matched A/B runs.
Each run should record:
final committed tokens
drafted tokens
accepted tokens
acceptance ratio
mean accepted draft length
wall-clock duration
final committed tokens / wall-clock second
temperature start
temperature end
temperature peak
backend configuration
model hash
code commit
skel hash
Compare:
MTP OFF
vs
MTP ON
with:
same model;
same prompt;
same generated token count;
same backend;
same thread count;
same thermal window;
same code state;
at least 5 repeated runs.
The primary metric should be:
final committed tokens / wall-clock second
51. MTP and Long Context
The MTP draft path may pay a significant KV-cache cost.
For hybrid/linear-attention models, a full-attention draft can become increasingly expensive with context length.
A future optimization candidate is:
windowed draft attention
+
full target verification
This is currently an optimization hypothesis, not yet a proven device result.
52. Current Empirical Performance Map
Model / Configuration
Preferred path
Best observed
Qwen3-4B Q4_0
multi-HTP
18.86 t/s
Qwen3-8B Q4_K_M
GPU OpenCL
9.28 t/s
Qwen3.5-9B D2-A Q4_0/Q8_0
HTP0 cold
8.90 t/s
D2-A + MTP
HTP + speculative
~16.2 effective t/s
These are not directly comparable as one universal benchmark because the models differ.
They should be treated as workload-specific optima.
53. Results That Must Not Be Mixed
Do not combine:
cold
with:
warm
Do not combine:
single-run peak
with:
multi-run mean
Do not combine:
raw verification t/s
with:
MTP effective t/s
Do not compare two model families as if they were an A/B backend benchmark.
Do not compare:
same filename / different hash
as if the model were identical.
54. Current Evidence Levels
Strong / directly reproduced
deterministic old-skel hang on the tested v81 platform;
timestamp
device model
SoC
firmware fingerprint
kernel version
model filename
model SHA256
quantization
model size
runtime version
git commit
git diff status
skel SHA256
backend
HTP device count
GPU backend
CPU thread count
layer assignment
graph split counts
operator distribution
prompt tokens
generated tokens
PP t/s
TG t/s
temperature start
temperature end
temperature peak
GPU utilization
DDR temperature
warmup policy
cooldown policy
backend transitions
spill state
memory traffic estimate
The scheduler determines whether theoretical NPU offload becomes useful execution or fragmented fallback.
CPU fallback can dominate an apparently NPU-heavy configuration.
More HTP is workload-dependent, not universally beneficial.
Large contiguous backend regions are preferable to rapid backend alternation.
Memory traffic per token is a first-order decode variable.
The lm_head is a major traffic contributor, but moving it to HTP can be counterproductive.
Thermal state changes throughput enough to invalidate uncontrolled comparisons.
Dynamic thermal scheduling must include hysteresis and switching cost.
Allocator plans depend on graph topology and lifetimes, not only tensor sizes.
MTP changes the optimization target from raw verification throughput to effective committed tokens/s.
The MTP chronology itself is evidence: blocked → corrected → functional → accepted drafts → effective speedup.
The current ~16.2 effective t/s result is the strongest throughput result in the campaign, but its final speedup still needs a strict repeated A/B confirmation.
The optimization problem is therefore no longer:
"Which backend is fastest?"
It is:
Which backend should execute which large graph region, for which quantization and model structure, under which memory and thermal state, with which synchronization cost, while maximizing effective committed tokens per second?
That is the unified technical conclusion of the project as of 2026-08-30.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Unified Reproducible Technical Report
Qualcomm HTP v81 / GGML Scheduler / Quantization / Memory / Heterogeneous CPU-GPU-HTP / MTP
Platform: OnePlus 15 — Snapdragon 8 Elite Gen 5 (SM8850)
Consolidation date: 2026-08-30
Primary device: OnePlus 15 CPH2747
SoC: Qualcomm Snapdragon 8 Elite Gen 5, SM8850
NPU: Hexagon HTP v81
GPU: Qualcomm Adreno 840 via OpenCL
Primary model: Qwen3.5-9B D2-A family
Additional models: Qwen3-8B Q4_K_M, Qwen3-8B Q4_0, Qwen3-4B Q4_0
Runtime family: llama.cpp / GGML + Hexagon backend + OpenCL
Scope: HTP v81, skel reproduction, scheduler behavior, quantization, memory traffic, heterogeneous execution, thermal behavior, allocator correctness, and MTP/speculative decoding.
Excluded: APK integration/deployment path.
1. Executive Summary
This campaign moved beyond simple backend benchmarking and produced a coherent experimental model of LLM inference on Qualcomm HTP v81.
The central result is:
The observed performance is better described as:
The strongest experimentally supported findings are:
lm_headonto HTP can be much slower than leaving it on the previous path.eh_projidentified → corrected 442-tensor model → functional MTP → 52.9% draft acceptance → ~16.2 effective t/s observed.2. Reproducibility State
2.1 Validated commits
The main validated code states are:
859926e71248f04f505354edggml_cont_4d5291e12aopt_mm_rows/ lm-head row limit experiment2.2 Working tree caveat
At the time of consolidation, some work was not cleanly isolated into a single reproducible baseline.
Relevant modified/uncommitted areas included:
Therefore, every future benchmark intended as a reference result should store:
The project should not use "same branch" as a substitute for "same binary state."
3. HTP v81 / DSP Skel — Hang Reproduction and Resolution
3.1 Initial failure
The original HTP v81 path repeatedly stalled on a deterministic graph segment.
Observed scheduler state:
Instrumentation identified the first HTP-side operation as an
ADD, followed byRMS_NORMandMUL.The host process remained active rather than crashing outright, consuming roughly one CPU core while waiting for DSP progress.
This behavior was therefore consistent with an AP-side wait/spin around the DSP response path.
3.2 Response-size mismatch
Before the final hang diagnosis, another incompatibility was observed:
This was associated with the
htp_opbatch_rspresponse format.A compatibility path ("compat24o") was added so that the 24-byte response would no longer abort the execution immediately.
After this compatibility adjustment, execution progressed farther, but the deterministic HTP stall remained.
This distinction matters:
The first issue had to be removed before the second could be observed cleanly.
4. Pass 4.5 — Scheduler Reordering Was Not the Root Cause
A custom pass 4.5 topological ordering had been introduced to prefer HTP-friendly execution order.
Because it changed graph ordering, it was a reasonable suspect.
The key comparison was:
Therefore:
It may still alter graph placement and performance, but the hang itself cannot be explained solely by that scheduler transformation.
5. Rebuilding the v81 Skel
The DSPQueue skel was rebuilt specifically for v81 using:
The generated library was approximately:
A critical build detail was the manual definition of:
Without it, CMake could fail inside
hexagon_fun.cmake.A FastRPC/mempool variant was also buildable using:
with a slightly larger skel.
6. A/B Evidence for the Skel Fix
6.1 Old skel
6.2 Rebuilt v81 skel
This is one of the strongest causal results in the entire project:
What is not yet proven:
The correct scientific statement is therefore:
7. HTP v81 Hardware Characterization
The rebuilt skel exposed:
Therefore the tested SM8850 HTP v81 configuration exposes:
This is a direct device-side runtime observation and should be considered one of the highest-confidence hardware findings in the campaign.
8. GGML Scheduler — Why Placement Matters
GGML does not simply "run the model on the NPU."
It builds and partitions a graph:
Every backend transition may introduce:
Therefore:
does not imply:
and does not imply:
9. Direct Operation Distribution — D2-A HTP0
For D2-A on HTP0, scheduler logging showed:
This is important because it proves that the D2-A HTP result is not simply a requested
-ngl 99configuration.The graph logs show that the HTP actually performs the overwhelming majority of the heavy supported operations.
Therefore:
10. Qwen3.5-9B Source Anatomy
The source model inspection found:
Architecture:
blk.0is special and contains both branchesattn_output_gate=truetie_word_embeddings=falselm_headApproximate parameter distribution:
The BF16
lm_headalone is approximately:and the embedding is another approximately:
11. The blk.0 Hotspot
blk.0differs from a standard block because it contains:Approximate BF16 size:
This is roughly twice the size of many ordinary blocks.
Projected Q4_0 traffic:
versus roughly:
This makes
blk.0a natural target for:12. Layer-Wise Precision Planning
The precision planner does not use uniform quantization.
The proposed allocation is approximately:
Representative per-layer reductions:
The planner total is:
This is a theoretical traffic/precision allocation result.
The associated
ΣΔPPL = 223.20must not be interpreted as a measured final model perplexity.A proper validation still requires:
13. Multi-Backend Precision Planner
A second traffic-aware planner compared backend-specific precision policies.
Approximate planner outputs:
The planner therefore suggested that QAIRT could preserve more precision while still reducing traffic significantly.
However:
14. Quantization Determines Backend Suitability
One of the strongest empirical findings is that quantization format changes backend suitability.
14.1 Q4_K_M
For the tested Qwen3-8B Q4_K_M path:
GPU OpenCL performs much better.
14.2 Q4_0 / Q8_0
For D2-A:
the HTP path is much more effective.
The correct conclusion is not:
The correct conclusion is:
15. Qwen3-8B Q4_K_M — Backend Results
Measured decode results:
GPU-only is approximately:
better than the default automatic configuration.
16. The 3-HTP Collapse
The 3-HTP experiment initially looked like a simple capacity/spill failure.
Detailed scheduler logging provided a stronger explanation.
Observed split distribution:
Approximately:
were observed, while:
for the problematic Q4_K_M path.
This gives a much stronger causal chain:
Therefore:
Scheduler fragmentation is directly visible in the logs.
17. Large OpenCL Blocks vs Small HTP Blocks
A notable 3-HTP trace contained a large OpenCL region:
containing operations such as:
By contrast, HTP often received much smaller regions.
This matters because:
typically pays fewer boundary costs than:
18. Qwen3-4B — Positive Multi-HTP Scaling
A smaller Qwen3-4B Q4_0 model showed the opposite behavior:
Therefore:
The correct conclusion is workload-dependent:
19. D2-A — HTP-Favorable Configuration
D2-A uses approximately:
Measured decode:
Cold HTP0 therefore beats the automatic scheduler by approximately:
This is the inverse of the Q4_K_M result.
Thus:
is not a contradiction.
It is direct evidence that:
20. Layer-Split Experiments
The HTP/GPU split ratio alone did not predict performance.
Cold D2-A sweep:
Default:
The strongest stable split in this sweep was around:
but the important result is not the ratio.
The key result is:
A 50/50 split can be worse than both more HTP-heavy and more GPU-heavy placements.
21. Boundary Cost Model
A useful latency model is:
Therefore, a placement optimizer should not minimize:
or maximize:
It should optimize:
22. Large Contiguous Regions Are Preferable
Preferred:
Avoid:
because each transition can add:
This principle is important for both performance optimization and thermal scheduling.
23. Memory Traffic — 9B Decode
The safetensors-based model plus device measurements converge on:
An independent measured value was:
This is strong agreement between:
This supports using:
as a useful effective-memory-throughput metric.
24. Effective GGML Bandwidth
Measured values:
Therefore:
So:
This value is marked as measured in the planner.
25. QAIRT Bandwidth — Evidence Level
The planner also used:
but explicitly labeled it:
Therefore:
Measured
Not yet revalidated experimentally
The approximate 2.4× ratio must therefore not be presented as a definitive measured A/B result.
26. lm_head Traffic
The model source contains a separate BF16:
A Q4_0 projection gives approximately:
while runtime packing measurements suggested approximately:
depending on representation/path.
This makes the
lm_headone of the largest individual decode traffic contributors.27. lm_head HTP Offload Regression
An experiment increased the row limit to allow much more of the
lm_headonto HTP.Result:
This is a major counterexample to simplistic offload logic.
It demonstrates:
Possible causes include:
The measurement demonstrates the regression; it does not yet isolate one single root cause.
28. VTCM — What 8 MiB Means and Does Not Mean
The HTP reports:
This does not imply that multi-gigabyte model weights reside in VTCM.
The relevant model is:
Performance depends on:
The VTCM size is therefore only one variable.
Two SoCs with the same nominal VTCM size can still show different spill behavior because their interconnect and cost model differ.
29. Qualcomm HTP Compiler Reverse-Engineering Context
The reverse-engineering notes attribute several important mechanisms to the Qualcomm HTP preparation/compiler stack.
These include:
29.1 VTCM placement optimization
The compiler was described as using a MILP formulation solved with HiGHS to minimize transferred bytes:
29.2 Scheduling / lifetime optimization
The compiler analysis describes:
29.3 Hextimate
A hidden analytical performance model was described as evaluating best/worst overlap scenarios using a roofline-like memory model:
with additional cost tables for:
These compiler findings are useful explanatory context, but they should remain clearly distinguished from direct device measurements.
30. FastRPC / Mempool vs DSPQueue
The project experimented with both:
and:
A mempool/graph-dispatch path reached:
in an experiment, showing the potential value of more consolidated dispatch.
However, at that stage it was not yet loading cleanly in the normal
llama-benchpath.Therefore it should be classified as:
The wider JZ multi-model data also showed that FastRPC did not win universally.
Across an 8-model comparison, it won TG on 5 models and lost on 3.
This reinforces:
31. 4 GiB / Mapping Interpretation
The campaign must avoid reducing memory behavior to a single statement such as:
These are distinct concepts:
The observed >4 GiB behavior in FastRPC/JZ must therefore be interpreted as a mapping/design/runtime issue unless the underlying architectural limit is independently proven.
32. Thermal State — Methodology Correction
Earlier benchmark sweeps did not always control thermal state adequately.
Observed states included:
These runs cannot be treated as clean A/B comparisons against cold runs.
The project therefore introduced a strict distinction:
33. Correct Thermal Signal
A thermal-trip threshold such as:
is not an operating-temperature reading.
For GPU thermal control, the relevant signal was:
The benchmark methodology should therefore use real thermal-zone measurements rather than trip-point metadata.
34. Cold-Start Benchmark Protocol
A comparable benchmark should:
Any run without this control should be labeled explicitly:
or:
35. Thermal Effect on D2-A
Measured HTP0 performance:
Approximate degradation:
Therefore:
36. Thermal Governor Concept
A practical hysteresis rule was developed:
This avoids:
oscillation near a single threshold.
A more robust implementation should also include:
37. Thermal-Aware Layer Placement
The longer-term policy is not simply:
or:
A better strategy may be:
The key is to move large contiguous execution regions, not rapidly alternate individual operators.
38. Allocator Correctness Bug
A separate GGML investigation identified a real allocator correctness problem.
An adversarial test constructed:
with:
but different:
The old allocator could accept the stale memory plan.
Observed corruption included:
while both tensors were simultaneously live.
This demonstrates:
This finding is directly relevant to dynamic heterogeneous scheduling because changing backend placement changes graph topology and lifetime structure.
39. Allocator Fingerprint Diagnostic
A debug signature based on FNV-1a was added.
The signature included properties such as:
It was generated during reservation and checked during later allocation.
On mismatch, the system logs an error.
Important:
is only a detector.
It does not prove that a new memory plan has been generated or is valid.
40. Regression Tests for Allocator / Pass 4.5
Two regression-test directions were created.
40.1 Adversarial topology-change test
Validates:
and checks a mismatch counter for the adversarial graph.
It also checks:
40.2 Pass-4.5 determinism test
The test compares old vs new pass-4.5 behavior over approximately:
and checks:
This matters because scheduler transforms and allocator reuse are coupled.
41. Why Allocator Correctness Matters to Heterogeneous Scheduling
When backend placement changes:
does not necessarily mean:
because:
Therefore stale memory plans are especially dangerous for:
42. MTP — Chronology Must Be Preserved
The MTP history is one of the most important examples of why old conclusions must not be overwritten by new ones.
43. MTP Phase M0 — Source Support Exists
The source model inspection identified MTP-related metadata/support:
Therefore MTP existed conceptually/source-side.
This did not yet imply that the converted runtime model was valid.
44. MTP Phase M1 — Blocked
At an earlier stage:
The model was therefore considered unusable.
That conclusion was correct for that exact artifact.
It must remain in the history.
45. MTP Phase M2 — Corrected Model
A later correction produced:
The chronology becomes:
46. MTP Phase M3 — First Functional Speedup
An earlier working MTP campaign produced approximately:
Approximate gain:
This should remain documented as an intermediate validated stage.
47. MTP Phase M4 — Successful llama-server Path
The final functional path used:
rather than:
The CLI path could loop and produce extremely large logs, while the server path successfully executed MTP.
Therefore the current valid reproduction path is:
48. MTP Phase M5 — Acceptance Measurements
Observed:
These values demonstrate that speculative decoding is genuinely active.
The draft is not merely loading; it is proposing tokens that are being accepted.
49. Effective MTP Throughput
A current effective-throughput estimate is:
This is substantially above the non-MTP D2-A HTP0 baseline:
The current record is therefore approximately:
However, this value must be labeled:
and not confused with:
50. MTP — What Still Needs Strict Validation
The final MTP speedup must be validated with repeated matched A/B runs.
Each run should record:
Compare:
with:
The primary metric should be:
51. MTP and Long Context
The MTP draft path may pay a significant KV-cache cost.
For hybrid/linear-attention models, a full-attention draft can become increasingly expensive with context length.
A future optimization candidate is:
This is currently an optimization hypothesis, not yet a proven device result.
52. Current Empirical Performance Map
These are not directly comparable as one universal benchmark because the models differ.
They should be treated as workload-specific optima.
53. Results That Must Not Be Mixed
Do not combine:
with:
Do not combine:
with:
Do not combine:
with:
Do not compare two model families as if they were an A/B backend benchmark.
Do not compare:
as if the model were identical.
54. Current Evidence Levels
Strong / directly reproduced
Strong but platform/runtime specific
Promising but still requiring stronger validation
55. Key Counterexamples Established by the Campaign
The campaign produced several valuable counterexamples to common optimization assumptions.
Counterexample 1
Evidence:
while:
Counterexample 2
Evidence:
Counterexample 3
because backend support and repacking/fallback behavior dominate.
Counterexample 4
because quantization and operator compatibility can completely change placement.
Counterexample 5
because graph topology and tensor lifetimes matter.
56. Unified Performance Model
A better conceptual model is:
[
Perf =
f(
architecture,
quantization,
kernel\ support,
scheduler,
graph\ topology,
placement,
boundary\ cost,
RPC,
layout,
memory\ traffic,
VTCM,
thermal\ state,
speculative\ acceptance
)
]
rather than:
[
Perf \propto TOPS
]
or:
[
Perf \propto NPU\ offload\ percentage
]
or:
[
Perf \propto 1 / bitwidth
]
57. Recommended Benchmark Record
Every future benchmark should store:
For MTP additionally:
58. Priority Roadmap
P0 — Freeze reproducibility
P1 — Final MTP A/B
Repeat:
under matched thermal and runtime conditions.
Goal:
P2 — Layer cost model
Measure:
P3 — Contiguous dynamic boundary
Optimize:
instead of arbitrary per-layer assignments.
P4 — Thermal-aware placement
Use:
to move the boundary only when expected gains exceed switching overhead.
P5 — Quality validation
Measure:
relaxed_precision_casteffects.P6 — Memory path
Re-measure:
with identical device conditions.
59. Master Chronology
60. Final Conclusions
The campaign establishes that inference on Qualcomm HTP v81 is fundamentally a heterogeneous systems problem, not simply an accelerator benchmark.
The most important experimentally supported conclusions are:
The optimization problem is therefore no longer:
It is:
That is the unified technical conclusion of the project as of 2026-08-30.
All reactions