Skip to content

opencl: improve q2_0 GEMV for Adreno - #31577

Merged
ggerganov merged 2 commits into
ggml-org:masterfrom
qualcomm:lh/q2_0-improve
Nov 4, 2026
Merged

ggerganov merged 2 commits into
ggml-org:masterfrom
qualcomm:lh/q2_0-improve

Conversation

@lhez

@lhez lhez commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

This PR improves q2_0 GEMV kernel for Adreno by producing more results per thread (4 rows or 8 rows). It also added another f32f32 mv variant that outputs 2 rows.

Additional information

Details

On X2-90,

master

model size params backend ngl fa lm test t/s
qwen35 2B Q2_0 510.87 MiB 1.88 B OpenCL 99 1 none pp4096 1077.13 ± 0.95
qwen35 2B Q2_0 510.87 MiB 1.88 B OpenCL 99 1 none tg512 68.19 ± 0.21

PR

model size params backend ngl fa lm test t/s
qwen35 2B Q2_0 510.87 MiB 1.88 B OpenCL 99 1 none pp4096 1072.68 ± 0.58
qwen35 2B Q2_0 510.87 MiB 1.88 B OpenCL 99 1 none tg512 102.39 ± 0.26

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, Codex did the exploration and rebased several times.

@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 3, 2026
@lhez
lhez marked this pull request as ready for review November 4, 2026 02:21
@lhez
lhez requested a review from a team as a code owner November 4, 2026 02:21
@lhez

lhez commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@lhez lhez added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Nov 4, 2026
@ggerganov
ggerganov merged commit 6900fb5 into ggml-org:master Nov 4, 2026
23 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Nov 6, 2026
* opencl: improve q2_0 decoding and small f32 matmuls

Assisted-by: Codex

* opencl: optimize small f32 matmuls on Adreno 8xx

Assisted-by: Codex
(cherry picked from commit 6900fb5)
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 merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. OpenCL Issues specific to the OpenCL backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants