﻿# llama.cpp Adreno attention: more kernels can reduce resource pressure

The b12314 Adreno attention path trades kernel organization for lower resource pressure; measure actual dispatch and total work, not kernel count alone.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-adreno-decomposed-attention-resource-pressure/
Language: en

llama.cpp b12314 adds decomposed Flash Attention for Adreno through OpenCL. Upstream distinguishes this from simply using separate graph operations: the implementation follows the fused flow across several kernels to reduce resource pressure. It is a reminder that minimizing kernel count is not the same objective as minimizing execution time.

## Fusion has a resource side

Keeping a large computation inside one kernel can increase its live state and resource requirements. The PR identifies configurations where this hurts Adreno and introduces a decomposed implementation. That does not invalidate fusion generally; it identifies a device-and-shape tradeoff. A performance explanation should therefore include the resource bottleneck and selected implementation rather than treating fewer launches as automatic evidence of the fastest possible path.

## Decomposed flow is not arbitrary graph expansion

Upstream explicitly distinguishes its multi-kernel flow from ordinary attention expressed as separate operations. The distinction matters when comparing memory traffic and intermediate state. A proposed benchmark should name which implementation is enabled and confirm dispatch, rather than calling every multi-kernel result “unfused attention.” Otherwise two experiments can compare different algorithms while appearing to test only one toggle in a backend configuration.

## Masking and warmup need explicit checks

The release history includes fully masked-row handling and first-call kernel-build work. Qualification should therefore include masked boundary cases and a separate first-use measurement, not only steady-state timing on ordinary rows. Compare numerical output with a trusted attention reference before assessing speed. A lower resource footprint is not a valid optimization if a special mask case produces invalid values or if compilation cost is silently excluded from a startup claim.

## End-to-end speculative runs add another variable

The PR includes example speculative-decoding logs whose accepted progress and generated lengths differ. Those observations should not be reduced to one universal kernel speed ratio. For a controlled local study, hold input and decoding policy fixed, report accepted output and separate prompt, draft and verification costs. This article describes the upstream resource-pressure mechanism and test boundaries; it does not add a new benchmark claim for every Adreno device or model.

## Sources

- [llama.cpp b12314 release](https://github.com/ggml-org/llama.cpp/releases/tag/b12314)
- [llama.cpp pull request #32046](https://github.com/ggml-org/llama.cpp/pull/32046)

## Related reading

- [SYCL versus Vulkan on Intel: the reported prefill and decode ordering reverses](/journal/intel-sycl-vulkan-gemma-mtp-prefill-decode-owner-report-boundary/)
- [CUDA events and request time: different measurement boundaries](/journal/gpu-cuda-events-wall-time/)
