Skip to content

Add DMMV ESIMD Q3_K kernel - #26251

Merged
ggerganov merged 8 commits into
ggml-org:masterfrom
aicss-genai:esimd-q3k
Aug 13, 2026
Merged

Add DMMV ESIMD Q3_K kernel#26251
ggerganov merged 8 commits into
ggml-org:masterfrom
aicss-genai:esimd-q3k

Conversation

@malsbat

@malsbat malsbat commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Overview

Continuing the work in #25942 to add the DMMV ESIMD Q3_K kernel.

Additional information

Note: all measurements were captured with #25741 applied locally as the parent PR does not include the newer upstream fix. This only affects pp numbers which are not the important part of this PR.

Performance on B70

export GGML_SYCL_PRIORITIZE_DMMV=0
export GGML_SYCL_ENABLE_ESIMD=0
./build/bin/llama-bench -m /models/Qwen3-14B-Q3_K_M.gguf -ngl 100

model size params backend ngl test t/s
qwen3 14B Q3_K - Medium 6.81 GiB 14.77 B SYCL 100 pp512 1305.08 ± 4.29
qwen3 14B Q3_K - Medium 6.81 GiB 14.77 B SYCL 100 tg128 28.62 ± 0.19

export GGML_SYCL_PRIORITIZE_DMMV=1
export GGML_SYCL_ENABLE_ESIMD=0
./build/bin/llama-bench -m /models/Qwen3-14B-Q3_K_M.gguf -ngl 100

model size params backend ngl test t/s
qwen3 14B Q3_K - Medium 6.81 GiB 14.77 B SYCL 100 pp512 1296.01 ± 5.29
qwen3 14B Q3_K - Medium 6.81 GiB 14.77 B SYCL 100 tg128 31.37 ± 0.27

export GGML_SYCL_PRIORITIZE_DMMV=0
export GGML_SYCL_ENABLE_ESIMD=1
./build/bin/llama-bench -m /models/Qwen3-14B-Q3_K_M.gguf -ngl 100

model size params backend ngl test t/s
qwen3 14B Q3_K - Medium 6.81 GiB 14.77 B SYCL 100 pp512 1296.22 ± 4.78
qwen3 14B Q3_K - Medium 6.81 GiB 14.77 B SYCL 100 tg128 53.61 ± 0.27

Perplexity

model=/models/Qwen3-14B-Q3_K_M.gguf

export GGML_SYCL_PRIORITIZE_DMMV=0
export GGML_SYCL_ENABLE_ESIMD=0
./build/bin/llama-perplexity -m ${model} -f wikitext-2-raw/wiki.test.raw
4.19.245.222 I Final estimate: PPL = 9.2916 +/- 0.07317
./build/bin/llama-perplexity --hellaswag -f hellaswag_val_full.txt -m ${model}
400     78.25000000%    [73.9487%, 82.0138%]
./build/bin/llama-perplexity -f winogrande-debiased-eval.csv --winogrande -m ${model}
2.39.277.933 I Final Winogrande score(1267 tasks): 72.8493 +/- 1.2499

export GGML_SYCL_PRIORITIZE_DMMV=0
export GGML_SYCL_ENABLE_ESIMD=1
./build/bin/llama-perplexity -m ${model} -f wikitext-2-raw/wiki.test.raw
4.19.304.028 I Final estimate: PPL = 9.2917 +/- 0.07317
./build/bin/llama-perplexity --hellaswag -f hellaswag_val_full.txt -m ${model}
400     78.25000000%    [73.9487%, 82.0138%]
./build/bin/llama-perplexity -f winogrande-debiased-eval.csv --winogrande -m ${model}
2.39.320.785 I Final Winogrande score(1267 tasks): 72.7703 +/- 1.2511

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES, used Claude to help author kernel based on existing patterns.

malsbat added 8 commits July 20, 2026 21:43
Configure cmake build with -DGGML_SYCL_ESIMD=ON to enable.

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
While not an issue in the current version, this will become an
issue when additional QK ESIMD kernels are added (such as Q2_K).

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
@malsbat

malsbat commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

This is currently a draft built upon #25942, I will rebase and mark ready for review when that PR is merged.

@github-actions github-actions Bot added documentation Improvements or additions to documentation ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels Jul 28, 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.

Qwen3-14B-Q3_K_M.gguf on B60:
export GGML_SYCL_PRIORITIZE_DMMV=0
export GGML_SYCL_ENABLE_ESIMD=1

Test fa Base t/s Primary t/s Increase Rate (Primary vs Base)
pp512 0 92.19 99.59 8.03%
pp512 1 75.33 81.65 8.39%
tg128 0 4.43 8.57 93.45%
tg128 1 4.56 9.08 99.12%

@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 30, 2026
@CISC CISC removed the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Aug 1, 2026
@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 Aug 4, 2026
@arthw

arthw commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@malsbat
Please change all ready PR status from "Draft" to "Open".

@malsbat
malsbat marked this pull request as ready for review August 4, 2026 16:36
@malsbat
malsbat requested a review from a team as a code owner August 4, 2026 16:36
@malsbat

malsbat commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@malsbat Please change all ready PR status from "Draft" to "Open".

I have reached the open pull request limit, I will mark the others as ready for review once these get merged.

@arthw

arthw commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@malsbat
OK, I see.
You have 2 PRs to be ready to merge and 2 PRs as Draft.

We will merge them as soon!

Thank you!

@ggerganov
ggerganov merged commit 8efbf65 into ggml-org:master Aug 13, 2026
24 of 29 checks passed
CowboyTim pushed a commit to aardbeiplantje/llama.cpp that referenced this pull request Aug 16, 2026
* Add DMMV Q4_K and Q6_K ESIMD kernels

Configure cmake build with -DGGML_SYCL_ESIMD=ON to enable.

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Refactor ESIMD kernels to share common code

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Move control of ESIMD from compile to runtime

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Use ESIMD by default when available

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Fix possible error when using ESIMD by default

While not an issue in the current version, this will become an
issue when additional QK ESIMD kernels are added (such as Q2_K).

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Add explicit unroll to ESIMD kernels

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Tidy up ESIMD kernels a bit

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Add DMMV Q3_K ESIMD kernel

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

---------

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
brittlewis12 pushed a commit to brittlewis12/llama.cpp that referenced this pull request Aug 17, 2026
* Add DMMV Q4_K and Q6_K ESIMD kernels

Configure cmake build with -DGGML_SYCL_ESIMD=ON to enable.

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Refactor ESIMD kernels to share common code

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Move control of ESIMD from compile to runtime

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Use ESIMD by default when available

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Fix possible error when using ESIMD by default

While not an issue in the current version, this will become an
issue when additional QK ESIMD kernels are added (such as Q2_K).

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Add explicit unroll to ESIMD kernels

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Tidy up ESIMD kernels a bit

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

* Add DMMV Q3_K ESIMD kernel

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>

---------

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation 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.

4 participants