Skip to content

opencl: add q6_k coopk c8 GEMM for up to n=8 spec verify - #32909

Merged
max-krasnyansky merged 1 commit into
ggml-org:masterfrom
qualcomm:lh/coopk-q6_k-c8
Nov 24, 2026
Merged

max-krasnyansky merged 1 commit into
ggml-org:masterfrom
qualcomm:lh/coopk-q6_k-c8

Conversation

@lhez

@lhez lhez commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR adds c8 Q4_K coop-k GEMM that handles up to 8 tokens. This kernel is dispatched for verification with tokens of 2 ~ 8.

Additional information

Details

gemma-4-E4B-it-Q4_K_M

With --spec-draft-n-max 3,

master

I encoded 32099 tokens in   34.818 seconds, speed:  921.901 t/s
I decoded  258 tokens in    8.553 seconds, speed:   30.165 t/s
I
I n_draft   = 3
I n_predict = 258
I n_drafted = 288
I n_accept  = 162
I accept    = 56.250%

PR

I encoded 32099 tokens in   35.934 seconds, speed:  893.281 t/s
I decoded  259 tokens in    8.009 seconds, speed:   32.341 t/s
I
I n_draft   = 3
I n_predict = 259
I n_drafted = 291
I n_accept  = 162
I accept    = 55.670%

With --spec-draft-n-max 7,

master

I encoded 32099 tokens in   34.868 seconds, speed:  920.588 t/s
I decoded  259 tokens in    8.072 seconds, speed:   32.085 t/s
I
I n_draft   = 7
I n_predict = 259
I n_drafted = 446
I n_accept  = 194
I accept    = 43.498%

PR

I encoded 32099 tokens in   35.611 seconds, speed:  901.379 t/s
I decoded  261 tokens in    7.884 seconds, speed:   33.104 t/s
I
I n_draft   = 7
I n_predict = 261
I n_drafted = 465
I n_accept  = 194
I accept    = 41.720%

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, Codex did guided implementation and refactoring.

Co-authored-by: Hongqiang Wang <[email protected]>
Assisted-by: Codex
@lhez
lhez marked this pull request as ready for review November 23, 2026 22:00
@lhez
lhez requested a review from a team as a code owner November 23, 2026 22:00
@lhez

lhez commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@max-krasnyansky @wanghqc please review/ack when you get a chance

@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 23, 2026
@lhez

lhez commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

The editor failure is not introduced by this PR. It was introduced by 2392423

@max-krasnyansky
max-krasnyansky merged commit af5c583 into ggml-org:master Nov 24, 2026
33 of 38 checks passed
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.

3 participants