Skip to content

opencl: add coopmat GEMM for Adreno 850 (Q4_0, Q5_0, Q8_0, Q4_K, Q5_K, Q6_K) - #32686

Merged
lhez merged 6 commits into
ggml-org:masterfrom
qualcomm:shaoqi/opencl-coopmat-gemm
Nov 22, 2026
Merged

lhez merged 6 commits into
ggml-org:masterfrom
qualcomm:shaoqi/opencl-coopmat-gemm

Conversation

@shaofeiqi

Copy link
Copy Markdown
Contributor

Overview

Adds coopmat GEMM (cl_qcom_kernel_cooperative_matrix) for Q4_0, Q5_0, Q8_0, Q4_K, Q5_K and Q6_K on Adreno 850.

Additional information

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, Claude was used for the initial draft and for on-device testing.

@shaofeiqi
shaofeiqi requested a review from a team as a code owner November 20, 2026 18:36
@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning OpenCL Issues specific to the OpenCL backend labels Nov 20, 2026
@lhez
lhez force-pushed the shaoqi/opencl-coopmat-gemm branch from 5537d6a to 83680f5 Compare November 22, 2026 05:25
@lhez

lhez commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

CI failures are irrelevant to this PR

@lhez
lhez merged commit 1fb8a26 into ggml-org:master Nov 22, 2026
33 of 37 checks passed
Annieren pushed a commit to Annieren/llama.cpp-upstream that referenced this pull request Nov 23, 2026
…, Q6_K) (ggml-org#32686)

* opencl: add Q4_0 coopmat GEMM for Adreno 850

Assisted-by: Claude Opus 5.5

* opencl: add Q5_0 coopmat GEMM for Adreno 850

* opencl: add Q8_0 coopmat GEMM for Adreno 850

* opencl: add Q4_K coopmat GEMM for Adreno 850

* opencl: add Q5_K coopmat GEMM for Adreno 850

* opencl: add Q6_K coopmat GEMM for Adreno 850
Kidplayer666 pushed a commit to Kidplayer666/llama.cpp that referenced this pull request Nov 23, 2026
…, Q6_K) (ggml-org#32686)

* opencl: add Q4_0 coopmat GEMM for Adreno 850

Assisted-by: Claude Opus 5.5

* opencl: add Q5_0 coopmat GEMM for Adreno 850

* opencl: add Q8_0 coopmat GEMM for Adreno 850

* opencl: add Q4_K coopmat GEMM for Adreno 850

* opencl: add Q5_K coopmat GEMM for Adreno 850

* opencl: add Q6_K coopmat GEMM for Adreno 850
wanghqc added a commit to qualcomm/llama.cpp that referenced this pull request Nov 25, 2026
Port of shaofeiqi's cl_qcom_kernel_cooperative_matrix GEMMs for Q4_0,
Q5_0, Q8_0, Q4_K, Q5_K and Q6_K onto x2ue, squashed from the six PR
commits. Differences from the PR, all from x2ue's own structure:

- the bin weight layout is on by default where the coopmat kernels
  loaded, since the 850 is not an X2E and has no ILA bin GEMM;
- the kernels build non-fatally, so a driver without the extension
  falls back to the existing paths;
- GGML_OPENCL_COOPMAT=0 skips loading them, which also keeps the
  weight layout used without them.
Mr-J-369 pushed a commit to Mr-J-369/llama.cpp-Android that referenced this pull request Nov 25, 2026
…, Q6_K) (ggml-org#32686)

* opencl: add Q4_0 coopmat GEMM for Adreno 850

Assisted-by: Claude Opus 5.5

* opencl: add Q5_0 coopmat GEMM for Adreno 850

* opencl: add Q8_0 coopmat GEMM for Adreno 850

* opencl: add Q4_K coopmat GEMM for Adreno 850

* opencl: add Q5_K coopmat GEMM for Adreno 850

* opencl: add Q6_K coopmat GEMM for Adreno 850

(cherry picked from commit 1fb8a26)
wanghqc added a commit to qualcomm/llama.cpp that referenced this pull request Nov 26, 2026
OpenCL: x2ue's gated_delta_net kernel takes upstream's replay
(ggml_gated_delta_net_ext, ggml-org#31669) as a -DREPLAY build, on top of its
cache-fused state input/output and chunked prefill (which is not used with
replay). xielu, compact FA bias (indexed bias declined), softplus and async
input copies come from upstream. Upstream's coop-k c8 verify GEMMs
(ggml-org#32716, ggml-org#32909) are not taken: x2ue keeps its cok8 GEMMs. ggml-org#33013 (E17
quirks off by default) does not apply to x2ue's E17 handling. The coopmat
GEMM and MoE kernels (ggml-org#32686, ggml-org#32971) and the GDN QK offset fix (ggml-org#32747)
were already in x2ue.
speculative.cpp keeps x2ue's single DFlash implementation. GDN tests follow
upstream (no snapshot K); x2ue's verify-width perf cases now compare replay
and plain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning OpenCL Issues specific to the OpenCL backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants