Skip to content

sycl: add Q2_K to DMMV reorder path - #25064

Merged
ggerganov merged 1 commit into
ggml-org:masterfrom
aicss-genai:q2-k-dmmv-reorder
Jul 13, 2026
Merged

sycl: add Q2_K to DMMV reorder path#25064
ggerganov merged 1 commit into
ggml-org:masterfrom
aicss-genai:q2-k-dmmv-reorder

Conversation

@malsbat

@malsbat malsbat commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Overview

Add Q2_K to DMMV reorder path.

Additional information

The measured results are on top of #25063.

export GGML_SYCL_PRIORITIZE_DMMV=1
./build/bin/llama-bench -p 64 -n 16 -r 1 -ngl 999 -dev SYCL0 -m /models/Qwen3.5-27B-Q2.gguf
model test baseline t/s KQPI=1 t/s KQPI=1 reordered t/s
qwen35 27B Q2_K - Medium pp64 155.74 ± 0.00 157.79 ± 0.00 160.27 ± 0.00 1.028
qwen35 27B Q2_K - Medium tg16 14.60 ± 0.00 11.34 ± 0.00 18.31 ± 0.00 1.254

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, used to author the new functions based on the existing reorder paths.

@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels Jun 26, 2026

@arthw arthw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good job!
It could increase the perf on LLM Qwen3.5-27B-UD-Q2_K_XL.gguf.

Will you change it from draft to open status?
Or have you any plan to update this PR later?

Thank you!

@malsbat

malsbat commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, I did not realize you would review the draft PR. The performance improvement builds upon #25063, so I was waiting for that to merge before changing this one to open.

I will mark it open now. I think there will be a merge conflict in either this or 25063 depending on which is merged first.

@malsbat
malsbat marked this pull request as ready for review June 29, 2026 16:33
@malsbat
malsbat requested a review from a team as a code owner June 29, 2026 16:33
@arthw

arthw commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

OK, I will enable to merge #25063 as soon.

@arthw

arthw commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@malsbat
#25063 is merged.
Could you rebase the code?

Thank you!

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
@malsbat
malsbat force-pushed the q2-k-dmmv-reorder branch from 2dd185f to ba90945 Compare July 7, 2026 18:51
@malsbat

malsbat commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Rebased against current master branch

@arthw arthw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good job!

Thank you!

@arthw arthw added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Jul 9, 2026
@ggerganov
ggerganov merged commit e474bba into ggml-org:master Jul 13, 2026
27 of 28 checks passed
CowboyTim pushed a commit to aardbeiplantje/llama.cpp that referenced this pull request Jul 21, 2026
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
smalinin pushed a commit to smalinin/llama.cpp that referenced this pull request Aug 4, 2026
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
satindergrewal pushed a commit to satindergrewal/llama.cpp that referenced this pull request Aug 12, 2026
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
mndodd added a commit to mndodd/llama.cpp that referenced this pull request Aug 12, 2026
100 commits, 8 SYCL. Conflicts in 6 files, 10 hunks. 7 union-merged
(independent globals/switch-cases: our reorder_in_gemm + NVFP4 alongside
their fa_onednn + Q2_K ggml-org#25064). 3 needed a call:

- fattn.cpp: keep our env-gated MMA override FIRST, then upstream's oneDNN
  SDPA prefill FA (ggml-org#25222), then our decode VEC/TILE doors. Our decode +
  quantized-KV path stays ours; oneDNN takes prefill-shaped only.
  WARN: ggml-org#25222 has the RIG-HYGIENE ggml-org#26 pool_alloc use-after-free -- needs
  multi-turn 2-GPU garbage-token validation before trust.
- fattn-vec.hpp: take upstream ggml-org#25205 Battlemage nthreads=256, preserve our
  is_vec_kernel=true arg (selects nsm geometry in launch_fattn).
- dequantize.hpp q2_K: keep our f32-arithmetic dequant (NMSE 2.5e-7).

test-backend-ops.cpp: v=4 was overloaded -- upstream ggml-org#25064 uses it for
non-cont-a-last-2-dim, ours for transposed-b. Moved our transposed-b to
bit 1<<4 so both coverages survive.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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. SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants