opencl: cluster-parallel decode FA for Adreno GPUs#25473
Merged
Conversation
lhez
approved these changes
Jul 9, 2026
Geminihaha
added a commit
to Geminihaha/llama.cpp
that referenced
this pull request
Jul 10, 2026
Keep this branch's OpenCL flash-attention subsystem; take upstream everywhere else. The only upstream OpenCL change in this merge is 049326a "opencl: cluster-parallel decode FA for Adreno (ggml-org#25473)" — it adds new decode-kernel variants (q1_vec_mq_split, _c8 cluster-parallel, _k_img, _g8, ...) that rely on sub_group_reduce_add/max. Those advanced subgroup-arithmetic ops miscompile on Adreno 6xx (Adreno 660) — clBuildProgram returns err=-6, then the empty kernel map aborts. That optimization targets newer Adreno (7xx/8xx); this branch keeps its Adreno-6xx-safe FA kernels (shuffle / local reductions, 0 sub_group_reduce). All 8 ggml-opencl.cpp conflict hunks and the 3 flash_attn_f32_{f16,q4_0,q8_0}.cl conflicts were purely these new-kernel additions (no non-FA changes), so the 4 OpenCL files are kept at this branch's version via checkout --ours; all other upstream changes (CUDA, Hexagon, CPU, common, tests, ...) are merged. Verified on gemma-4-E2B-it-qat: coherent output (-ngl 99 -fa on, f16 KV, no crash/abort); test-backend-ops FLASH_ATTN_EXT 2551/2571 (0 crashes; gemma GQA+quant-KV still routed to CPU; the 20 failures are the pre-existing hsk=40 dim-3-broadcast cases).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
Additional information
Requirements
Tested with Windows on Snapdragon (WoS) Adreno GPUs, X1 and X2.