Skip to content

opencl: add clc coopmat moe kernel for q4_0/q4_1/q4_k/q5_0/q5_1/q5_k/q6_k/mxfp4 - #32971

Merged
max-krasnyansky merged 1 commit into
ggml-org:masterfrom
qualcomm:sg/moe-clc-upstream-fp16-coopmat
Nov 25, 2026
Merged

max-krasnyansky merged 1 commit into
ggml-org:masterfrom
qualcomm:sg/moe-clc-upstream-fp16-coopmat

Conversation

@shawngu-quic

@shawngu-quic shawngu-quic commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Multiple quantization of MoE for Adreno OpenCL backend using coopmat extension.

Additional information

Requirements

@shawngu-quic
shawngu-quic requested a review from a team as a code owner November 24, 2026 17:35
@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 24, 2026
@max-krasnyansky max-krasnyansky changed the title opencl: add clc coopmat moe kernel for q4_0/q4_1/q4_k/q5_0/q5_1/q5_k/… opencl: add clc coopmat moe kernel for q4_0/q4_1/q4_k/q5_0/q5_1/q5_k/q6_k/mxfp4 Nov 25, 2026
@max-krasnyansky
max-krasnyansky merged commit e6443bd into ggml-org:master Nov 25, 2026
35 of 39 checks passed
wanghqc pushed a commit to qualcomm/llama.cpp that referenced this pull request Nov 25, 2026
wanghqc added a commit to qualcomm/llama.cpp that referenced this pull request Nov 25, 2026
Each coopmat MoE GEMM of ggml-org#32971 (q4_0, q4_1, q5_0, q5_1, q4_K, q5_K, q6_K)
is built a second time with -DMOE_RP, which takes A straight from registers
into the A operand (no local memory or barrier in the K loop) and reads B
from the packed blocks of kernel_moe_reorder_b_f16_packed. Same values,
same results.
ggml_cl_moe_gemm_coopmat runs that build where there is one;
GGML_OPENCL_MOE_COOPMAT_RP=0 keeps the original.

With it, q4_K and q6_K take the coopmat GEMM before dp4a by default on the
Adreno 850: granite-3.0-3b-a800m Q4_K_M pp512 1562 -> 1818 t/s (the
original coopmat GEMM: 1289), PPL 10.91 -> 10.85. q4_0 keeps dp4a for now.
abeloin added a commit to abeloin/llama.cpp-mix that referenced this pull request Nov 25, 2026
…owner 2026-11-25)

Base b12723 (merge a940ab9), pin ggml-org#401 removed (80211b4), RoPE
multi-section fusion from upstream ggml-org#32500 (owner's decision), MIX.md
(3563400). Build gate: test-backend-ops ROCm 21878/21878, bench r17
(llama-mix-notes, mesures/2026.md): Inkling tg +4.5 % [bon], Qwen3.6 and
Gemma 4 without regression.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QBjnvFCJ83vkmygsLNv5cu

* mix/wip-b12723: (55 commits)
  mix: MIX.md — base b12723 (branche wip), retrait du pin ggml-org#401, conflit RoPE tranché (amont ggml-org#32500)
  revert: pin: CUDA: fuse the row L2 clip chain (unslothai#401, commit 6c0e84d)
  model : inkling2 graph with fewer ops in mix() and control() (ggml-org#32948)
  opencl: add clc coopmat moe kernel for q4_0/q4_1/q4_k/q5_0/q5_1/q5_k/q6_k/mxfp4 (ggml-org#32971)
  tests : fix MSVC static build of test-batch-alloc and test-server-component (ggml-org#32870)
  feat: Inkling 2 DSpark support (ggml-org#32218)
  cuda : fix int overflow of the MMVF matrix offsets (ggml-org#32965)
  docs : describe SpacemiT runtime environment variables (ggml-org#32452)
  ggml : fix SpacemiT flash attention null mask, ALiBi and softcap (ggml-org#32182)
  cmake : include the llguidance header from the source tree (ggml-org#32928)
  ci : move some jobs to gb10 runners (ggml-org#32968)
  ui: run Llama Chat apart from llama-server, named in config.json or npx --server (ggml-org#32945)
  ui: fix prebuilt UI download in shallow clones (ggml-org#32952)
  convert : fix qwen3-omni conversion (ggml-org#32941)
  ggml-cpu: repack kernels for targets without dotprod (ARMv8.0 64-bit) for Q4_0/Q8_0 (ggml-org#32142)
  ui: expect the Llama Chat name in the PWA manifest e2e test (ggml-org#32959)
  ggml-cpu: add SVE-optimized q5_0 and q5_1 dot-product kernels (ggml-org#30867)
  server : include MCP image and audio data in tool results (ggml-org#32064)
  context : prevent excessive CPU polling without OpenMP (ggml-org#32378)
  metal : reserve the top-k scratch only for short rows (ggml-org#32942)
  ...
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.
Mr-J-369 pushed a commit to Mr-J-369/llama.cpp-Android that referenced this pull request Nov 26, 2026
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.

4 participants