Skip to content

sycl: IQ3 code reorder - #29107

Merged
Titaniumtown merged 5 commits into
ggml-org:masterfrom
anantshri:sycl-b70-iq3
Oct 14, 2026
Merged

Titaniumtown merged 5 commits into
ggml-org:masterfrom
anantshri:sycl-b70-iq3

Conversation

@anantshri

Copy link
Copy Markdown
Contributor

Overview

  • improve SYCL attention and decode paths on Intel Arc Pro B70
  • add persistent reordered layouts for IQ3_S and IQ3_XXS MMVQ
  • add reorder-aware dequantization for subsequent prefill operations
  • harden oneDNN detection and add focused backend tests

Performance

On Intel Arc Pro B70 with oneAPI 2026.1.1:

IQ3 workload master this PR
tg256 @ 9k context 12.30 tok/s 21.59 tok/s
tg256 @ 64k context 9.76 tok/s 14.92 tok/s
tg256 @ 126k context 7.88 tok/s 10.93 tok/s

Prefill remained effectively unchanged.

Requirements

This PR is created with the help of GPT5.6 Sol. (both in identification and fixing process.)

@github-actions github-actions Bot added testing Everything test related ggml changes relating to the ggml tensor library for machine learning SYCL https://en.wikipedia.org/wiki/SYCL - GPU programming language labels Sep 18, 2026
@ggml-gh-bot

ggml-gh-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

Hi @anantshri, thanks for your contribution!

Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:

  • Multiple open PRs from a new contributor: We limit new contributors (those without a previously merged PR) to 1 open PR at a time. You currently have 3 open PRs.

  • Large PR: Large changes require prior discussion (e.g. an issue or RFC) and maintainers may not be able to review this PR as-is. Consider splitting it into smaller, focused PRs.


Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below.

@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!

Qwen3.8-27B-UD-IQ3_XXS.gguf on B60:

Test fa Base t/s Primary t/s Increase Rate (Primary vs Base)
pp512 0 159.10 162.98 2.44%
pp512 1 159.70 159.65 -0.03%
tg128 0 7.67 14.94 94.78%
tg128 1 7.67 14.95 94.92%

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 Sep 20, 2026
@anantshri

Copy link
Copy Markdown
Contributor Author
  1. rebased to master current.
  2. removed a conflicting file.

@Nocturna22 Nocturna22 left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Flags used:
GGML_SYCL_ENABLE_DNN=1
GGML_SYCL_ENABLE_MKL_FA=0
GGML_SYCL_FA_ONEDNN=1
GGML_SYCL_FA_ONEDNN_MAX_KV=0
GGML_SYCL_GRAPH=0 \

everything here is tested without MTP

It is alot faster.

Double the speed vs unfixed.

Qwen3.8-27B-GSQ-RCO-IQ3_S-mtp.gguf
Before:
0.25.985.651 I slot print_timing: id 0 | task 0 | n_gen = 100, tg = 8.02 t/s, tg_3s = 8.10 t/s 0.29.103.753 I slot print_timing: id 0 | task 0 | n_gen = 125, tg = 8.02 t/s, tg_3s = 8.02 t/s 0.32.221.462 I slot print_timing: id 0 | task 0 | n_gen = 150, tg = 8.02 t/s, tg_3s = 8.02 t/s 0.35.338.813 I slot print_timing: id 0 | task 0 | n_gen = 175, tg = 8.02 t/s, tg_3s = 8.02 t/s 0.38.341.256 I slot print_timing: id 0 | task 0 | n_gen = 199, tg = 8.01 t/s, tg_3s = 7.99 t/s

After:
1.09.141.294 I slot print_timing: id 0 | task 426 | n_gen = 100, tg = 15.38 t/s, tg_3s = 15.54 t/s 1.12.195.428 I slot print_timing: id 0 | task 426 | n_gen = 147, tg = 15.38 t/s, tg_3s = 15.39 t/s 1.15.259.739 I slot print_timing: id 0 | task 426 | n_gen = 194, tg = 15.37 t/s, tg_3s = 15.34 t/s 1.18.269.887 I slot print_timing: id 0 | task 426 | n_gen = 240, tg = 15.35 t/s, tg_3s = 15.28 t/s

Q4_K_M is still faster without the fix.
Qwen3.8-27B-Q4_K_M.gguf:
0.30.634.696 I slot print_timing: id 0 | task 0 | n_gen = 100, tg = 19.74 t/s, tg_3s = 19.94 t/s 0.33.671.013 I slot print_timing: id 0 | task 0 | n_gen = 160, tg = 19.75 t/s, tg_3s = 19.76 t/s 0.36.677.059 I slot print_timing: id 0 | task 0 | n_gen = 219, tg = 19.71 t/s, tg_3s = 19.63 t/s 0.39.689.984 I slot print_timing: id 0 | task 0 | n_gen = 278, tg = 19.69 t/s, tg_3s = 19.58 t/s

@strtgbb

strtgbb commented Sep 23, 2026

Copy link
Copy Markdown

Great results on B580 for iq3, but q3/q4 appear to have gotten slightly slower.

./llama-bench -t 6  -ngl 99 -ctk q8_0 -ctv q8_0 -fa 1 -p 20000 -n 1000 -b 2048 -ub 2048 -m $M/archive/Qwen3.5-9B-Q4_K_M.gguf,$M/archive/Qwen3.5-9B-Q3_K_M.gguf,$M/archive/Qwen3.5-9B-UD-IQ3_XXS.gguf
Model Test b11073 PR (29107) Change
Qwen3.5-9B-Q4_K_M pp20000 2499.61 ± 2.03 2435.25 ± 21.72 0.97
Qwen3.5-9B-Q4_K_M tg1000 60.24 ± 0.09 56.37 ± 0.04 0.94
Qwen3.5-9B-Q3_K_M pp20000 2221.96 ± 6.88 2149.40 ± 79.19 0.97
Qwen3.5-9B-Q3_K_M tg1000 57.92 ± 0.06 55.75 ± 0.71 0.96
Qwen3.5-9B-UD-IQ3_XX pp20000 1946.68 ± 2.21 1948.17 ± 19.76 1.00
Qwen3.5-9B-UD-IQ3_XX tg1000 22.62 ± 0.01 52.24 ± 0.49 2.31

@ggerganov ggerganov removed the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Sep 23, 2026
Comment thread tests/test-backend-ops.cpp Resolved
@anantshri
anantshri force-pushed the sycl-b70-iq3 branch 2 times, most recently from 9a3d138 to b25268d Compare September 23, 2026 22:52
@anantshri

Copy link
Copy Markdown
Contributor Author
  • synced to upstream
  • test removed as suggested by @ggerganov

Regarding Q4 being slow, this specfic code chage was done keeping https://huggingface.co/ISTA-DASLab/Qwen3.8-27B-GSQ-RCO-GGUF in mind and not any other model. I tried some tests but he delta seems small.

image

@strtgbb

strtgbb commented Sep 24, 2026

Copy link
Copy Markdown

Nice

Model Test b11149 PR (29107) Change
Qwen3.5-9B-Q4_K_M pp20000 2396.55 ± 13.18 2387.32 ± 42.08 1.00
Qwen3.5-9B-Q4_K_M tg1000 54.53 ± 0.07 53.84 ± 1.22 0.99
Qwen3.5-9B-Q4_K_M pp8000 2356.15 ± 40.08 2549.75 ± 3.04 1.08
Qwen3.5-9B-Q4_K_M tg500 54.57 ± 0.87 56.66 ± 0.10 1.04
Qwen3.5-9B-IQ4_XS pp8000 2340.97 ± 4.76 2305.21 ± 5.67 0.98
Qwen3.5-9B-IQ4_XS tg500 38.85 ± 0.05 38.15 ± 1.04 0.98
Qwen3.5-9B-Q3_K_M pp8000 2354.63 ± 4.44 2314.38 ± 51.18 0.98
Qwen3.5-9B-Q3_K_M tg500 57.67 ± 0.17 57.54 ± 0.08 1.00
Qwen3.5-9B-UD-IQ3_XX pp8000 2044.94 ± 1.42 1982.60 ± 34.11 0.97
Qwen3.5-9B-UD-IQ3_XX tg500 22.47 ± 0.01 52.45 ± 0.22 2.33

@anantshri
anantshri marked this pull request as ready for review September 25, 2026 05:54
@anantshri
anantshri requested a review from a team as a code owner September 25, 2026 05:54
@anantshri

Copy link
Copy Markdown
Contributor Author

this is now ready for review. @arthw @ggerganov @Nocturna22

Comment thread ggml/src/ggml-sycl/fusion.cpp Resolved
@anantshri

Copy link
Copy Markdown
Contributor Author

rebased to origin and addressed @Titaniumtown comment.

Comment thread ggml/src/ggml-sycl/ggml-sycl.cpp Resolved
…fill

Add persistent reordered weight layouts for IQ3_S and IQ3_XXS. Weights
are reordered once at load time; the reordered MMVQ dot products then
walk dense super-blocks with dp4a and SWAR sign expansion instead of
gathering bits from the interleaved standard layout. Reorder-aware
dequantization feeds the batched prefill GEMMs so prompt processing
sees the same benefit.

Also harden the oneDNN build check: a missing DNNL package or a
CPU-only DNNL build now fails at configure time instead of silently
producing a degraded backend.

Measured on Intel Arc Pro B70 with Qwen3.8-27B-GSQ-RCO-IQ3_S (MTP),
-ngl 999 -b 4096 -ub 1024 -fa on:

tg256 @ 0 ctx      12.92 -> 23.54 tok/s (+82%)
tg256 @ 9,216      12.33 -> 21.69 tok/s (+76%)
tg256 @ 64,000      9.76 -> 14.91 tok/s (+53%)
pp8192             833.9  -> 833.6 tok/s (flat)

Qwen3.5-9B Q4_K_M / Q3_K_M are unchanged within noise (largest delta
-0.5% pp, tg flat), so standard quants are not affected.

The MMVQ GLU fusion widening and rms_norm+scale fusion are
intentionally not part of this change; master already carries them
via ggml-org#28931.
@Master-Nox

Copy link
Copy Markdown

Independent verification on Intel Arc Pro B70 (SYCL): speed win confirmed, quality neutral

AI usage disclosure: YES. This comment was drafted by an AI agent, and every measurement in it was collected by AI agents operating this machine unattended (with the owner's authorisation) over a single overnight session. All commands, raw JSONL result files and build hashes are retained and can be shared on request.

Hardware: Intel Arc Pro B70 (BMG G31, 32 GB, xe driver, /dev/dri/renderD128), Ubuntu 26.04,
oneAPI/SYCL (ONEAPI_DEVICE_SELECTOR=level_zero:0), build build-sycl with
GGML_SYCL_ENABLE_OPT=1, banner confirms SYCL Optimization Feature: ... Reorder Y.
Model: Qwen3.8-27B hybrid (16 full-attention + 48 GDN layers), Swift-1.5 GSQ-RCO GGUF, IQ3_S
(12.12 GB) and IQ3_XXS (10.44 GB), both carrying an unused NextN/MTP head at blk.64.

Speed (llama-server, ctx 122880, -ngl 99 -fa on -ctk f16 -ctv f16, 192-token generations,
temp 0 / seed 42, one build per cell, one server load per cell):

cell master 5fc4f3c8c this PR 5b61aee04 speedup
IQ3_S base 13.66 t/s 23.39 t/s 1.71x
IQ3_S + draft-mtp (n-max 1) 14.39 t/s 32.76 t/s 2.28x
IQ3_XXS + draft-mtp (n-max 1) 13.57 t/s 23.61 t/s 1.74x
Q4_K_M base (K-quant control) 25.46 t/s bit-identical output -

K-quant numerics are untouched: Q4_K_M greedy output is identical on both builds
(text sha16 5bb33bef98ccb545).

Quality — perplexity parity. llama-perplexity -m <IQ3_S-mtp> -f wikitext-2 test -c 2048 --chunks 40 --seed 42, same file and flags, one build per cell:

build Final estimate per-chunk values
master 5fc4f3c8c PPL 6.1507 +/- 0.07498 [1]5.6636 [2]6.5845 [3]6.6820 ... [40]6.1507
this PR 5b61aee04 PPL 6.1507 +/- 0.07498 byte-identical to master (cmp on the printed arrays)

So the PR's non-bit-preserving greedy divergence (same prompt, different completion than master,
reproducible across server loads) is floating-point non-associativity in the reordered
accumulation, not a quantisation error
. The reorder is quality-clean at 4 decimal places with
identical per-chunk values.

Negative result, so nobody repeats it. In the reordered IQ3_XXS layout the per-block d
lives in a separate trailing array (2 B per 256-weight block, ~89 MB for this model) read as a
scattered access, whereas IQ3_S packs {d, scales} contiguously. I implemented per-block
{d, gas[32]} grouping (34 B/block; 6 edits: get_d_offset, reorder_qw_iq3_xxs, a vecdotq
specialization, the dequantize prefill path) and measured head-to-head under identical geometry:

variant t/s (192 tok) t/s (768 tok steady)
IQ3_XXS reordered, contiguous 96 B + d array (PR as-is) 20.34 / 20.35 -
IQ3_XXS reordered, {d,gas} per block 20.36 / 20.38 20.17

+0.1% (run-to-run sd ~0.02) for +32 B/block of VRAM, with identical per-chunk perplexity — i.e.
value-equivalent, no speed win. The scattered d read is not the IQ3_XXS limiter on this
hardware
, so the cache-locality rationale is refuted. Happy to share the patch and raw logs.

Also of note for anyone testing on this card: --spec-type draft-mtp --spec-draft-n-max 2
gives +51% over reordered IQ3_S base (23.18 -> 34.99 t/s at ctx 122880, temp 1.0, 768-token
generation); n-max 3/4/6 are monotonically worse (32.81/30.00/24.64 t/s), so 2 is the optimum
for single-stream decode here. Note the llama.cpp default is 3, which is measurably worse.

Methodology note: the table cells above are single runs (temp 0, seed 42, 192 tokens, one server
load each). The master column was re-verified against its raw JSONL before posting. A second
independent re-measurement of the master baselines is queued and will be posted if it disagrees.

@arthw

arthw commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@anantshri
Could you handle the CI issue?
EditorConfig Checker / editorconfig (pull_request)Failing after 47s

Thank you!

Union-resolve the reorder-type switch in ggml_backend_sycl_buffer_init_tensor:
keep our IQ3_XXS/IQ3_S cases and take upstream's new MXFP4 case.
@anantshri

Copy link
Copy Markdown
Contributor Author

rebased

@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 Oct 14, 2026
@Titaniumtown
Titaniumtown merged commit 529ac89 into ggml-org:master Oct 14, 2026
36 checks passed
@AdamN1

AdamN1 commented Oct 14, 2026

Copy link
Copy Markdown

I have crash with model Qwen3.8-27B-GSQ-RCO-IQ3_S-mtp.gguf

llama-server: llama-sampler.cpp:1217: void llama_sampler_dist_apply(struct llama_sampler *, llama_token_data_array *): Assertion `found' failed.
./run-gpu1-single-8081.sh: linia 39: 290687 Przerwane                  ./${TREE}/build/bin/llama-server -m ${MODEL} --device ${DEVICE} -t 8 -fa 1 -ngl 999 -ngld 99 --no-mmproj --parallel 2 --ctx-size ${CTX} --cache-ram ${RAM} --kv-unified --cache-type-v ${CACHE_TYPE} --cache-type-k ${CACHE_TYPE} --jinja --reasoning off --temperature 0.6 --top-k 20 --top-p 0.80 --min-p 0.0 --repeat-penalty 1.0 --presence-penalty 1.5 --batch-size ${BSIZE} --ubatch-size ${UBSIZE} --spec-type draft-mtp --spec-draft-n-max 5 --spec-draft-p-min 0.8 --rope-scaling yarn --rope-scale 2 --yarn-orig-ctx 262144 --host ${IP} --port ${PORT}

ONEAPI_DEVICE_SELECTOR="level_zero:0";

PORT=8081
RAM=65536
CTX=262144
BSIZE=4096
UBSIZE=2048

@anantshri

anantshri commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@AdamN1 check #30604 in my tests this has sorted the issue.

Cause: the fused-dequant GEMM that serves prefill/large batches (ggml_sycl_fused_dequant_gemm) decoded weights with the standard block layout unconditionally. Once this PR's persistent IQ3 reorder is installed, every big-batch mul_mat through that path read the reordered SoA bytes as standard blocks → garbage logits (your dist assert is the NaN face of it under MTP).

Fix: the reorder flag is now passed through and types without a reordered A-stage decline the fused path, falling back to the reorder-aware conversion route. The reorder and its speedup are fully preserved.

Verified on B70 with your exact server command (minus --device/--host/--port): 42/42 clean responses over 5 minutes of concurrent load, no crash, 16.4 t/s per slot at --parallel 2; CLI repro 28 t/s; Q4_K_XL bench unchanged.

Immediate workaround on current master if you can't build the fix branch:

GGML_SYCL_ENABLE_OPT=0 llama-server ...   # disables the reorder (and its speedup)

anantshri added a commit to anantshri/llama.cpp that referenced this pull request Oct 15, 2026
ggml_sycl_fused_dequant_gemm (the dense >8-column mul_mat path taken by
prefill and large batches) decoded its A stage with the standard block
layout unconditionally: fg_fused_run hardcodes fg_visit_type(..., false).
After ggml-org#29107 made IQ3_S/IQ3_XXS reorderable, any already-installed tensor
routed here was decoded from the reordered SoA bytes as if they were
standard blocks -> confidently wrong logits (the upstream dist-sampler
assert is the NaN face under MTP). The plain path could never meet a
reordered tensor before ggml-org#29107: the only types with SoA decoders
(Q8_0/Q4_K/Q5_K/Q6_K) are exactly the ones fg_plain_ok() excludes.

Wire the tensor's reorder flag through and let fg_visit_layout decline:
for types without an SoA stage (IQ3_S/IQ3_XXS today) the fused path now
returns false and the caller falls through to the reorder-aware f16
conversion route, which decodes correctly. Non-reordered tensors and
SoA-capable types keep the fused fast path unchanged.

Repro/verification (Arc Pro B70, Qwen3.8-27B-GSQ-RCO-IQ3_S-mtp, master
23deec0): every default-config generation turned to garbage; with this
patch the same runs are clean and the reordered MMVQ decode speedup is
retained.
@AdamN1

AdamN1 commented Oct 15, 2026

Copy link
Copy Markdown

@anantshri work nice, I don't have speedup on pp but tg looks great

Master from 20261010


2.13.754.465 I slot print_timing: id  0 | task 0 | prompt processing, n_tokens =   4096, progress = 0.02, t =   4.25 s / 963.04 tokens per second
2.18.092.379 I slot print_timing: id  0 | task 0 | prompt processing, n_tokens =   8192, progress = 0.04, t =   8.61 s / 951.24 tokens per second
2.27.175.765 I slot print_timing: id  0 | task 0 | prompt processing, n_tokens =  16384, progress = 0.09, t =  17.65 s / 928.05 tokens per second
2.49.282.842 I slot print_timing: id  0 | task 0 | prompt processing, n_tokens =  34673, progress = 0.18, t =  39.71 s / 873.21 tokens per second
3.33.672.204 I slot print_timing: id  0 | task 0 | prompt processing, n_tokens =  65173, progress = 0.34, t =  83.94 s / 776.38 tokens per second
5.22.951.390 I slot print_timing: id  0 | task 0 | prompt processing, n_tokens = 127422, progress = 0.67, t = 193.06 s / 660.01 tokens per second
7.48.912.113 I slot print_timing: id  0 | task 0 | prompt processing, n_tokens = 190440, progress = 1.00, t = 338.60 s / 562.44 tokens per second
7.54.087.779 I slot print_timing: id  0 | task 0 | n_gen =    103, tg =  20.83 t/s, tg_3s =  21.03 t/s
7.57.322.858 I slot print_timing: id  0 | task 0 | n_gen =    163, tg =  19.92 t/s, tg_3s =  18.55 t/s
8.00.551.512 I slot print_timing: id  0 | task 0 | n_gen =    224, tg =  19.63 t/s, tg_3s =  18.89 t/s
8.03.656.840 I slot print_timing: id  0 | task 0 | n_gen =    285, tg =  19.63 t/s, tg_3s =  19.64 t/s
8.06.919.053 I slot print_timing: id  0 | task 0 | n_gen =    354, tg =  19.91 t/s, tg_3s =  21.15 t/s
8.09.958.704 I slot print_timing: id  0 | task 0 | n_gen =    419, tg =  20.13 t/s, tg_3s =  21.38 t/s

Your branch

0.21.240.392 I slot print_timing: id  1 | task 0 | prompt processing, n_tokens =   4096, progress = 0.02, t =   4.36 s / 940.37 tokens per second
0.25.683.799 I slot print_timing: id  1 | task 0 | prompt processing, n_tokens =   8192, progress = 0.04, t =   8.84 s / 926.98 tokens per second
0.34.923.873 I slot print_timing: id  1 | task 0 | prompt processing, n_tokens =  16384, progress = 0.09, t =  18.05 s / 907.75 tokens per second
0.57.466.779 I slot print_timing: id  1 | task 0 | prompt processing, n_tokens =  34673, progress = 0.18, t =  40.53 s / 855.46 tokens per second
1.42.832.944 I slot print_timing: id  1 | task 0 | prompt processing, n_tokens =  65173, progress = 0.34, t =  85.74 s / 760.09 tokens per second
3.34.419.955 I slot print_timing: id  1 | task 0 | prompt processing, n_tokens = 127422, progress = 0.67, t = 197.19 s / 646.20 tokens per second
6.00.968.501 I slot print_timing: id  1 | task 0 | prompt processing, n_tokens = 190455, progress = 1.00, t = 343.61 s / 554.27 tokens per second
6.08.677.528 I slot print_timing: id  1 | task 0 | n_gen =    100, tg =  13.93 t/s, tg_3s =  14.07 t/s
6.11.886.419 I slot print_timing: id  1 | task 0 | n_gen =    141, tg =  13.57 t/s, tg_3s =  12.78 t/s
6.14.931.369 I slot print_timing: id  1 | task 0 | n_gen =    183, tg =  13.62 t/s, tg_3s =  13.79 t/s
6.18.159.670 I slot print_timing: id  1 | task 0 | n_gen =    209, tg =  12.54 t/s, tg_3s =   8.05 t/s
6.21.383.735 I slot print_timing: id  1 | task 0 | n_gen =    255, tg =  12.82 t/s, tg_3s =  14.27 t/s
6.24.448.580 I slot print_timing: id  1 | task 0 | n_gen =    289, tg =  12.59 t/s, tg_3s =  11.09 t/s
6.27.547.852 I slot print_timing: id  1 | task 0 | n_gen =    332, tg =  12.74 t/s, tg_3s =  13.87 t/s

It's prompt from work

iki007 added a commit to iki007/llama.cpp that referenced this pull request Oct 21, 2026
…own copy of our work

Upstream added an IQ3_S / IQ3_XXS weight reorder (ggml-org#29107), a Q8_0 MoE reorder (ggml-org#29337) and wide
q4_K / q5_K dequant stores (ggml-org#29696), all of which this branch already carries. The replay kept our
side of each conflicting hunk but left upstream's copies next to ours; this removes them.

- IQ3: our reorder, MMVQ, MoE GEMV and dequant stay, upstream's go. Upstream's IQ3_S layout puts d
  before the scales and ours after, so the two must not mix.
- Q8_0 MoE: one reorder_qw_q8_0_moe (upstream's, same layout); our MoE reorder GEMV is kept.
- dequant: our wide K-quant and q8_0 reorder dequant are kept (they also cover the reordered
  layouts); upstream's q4_0 reorder fix (ggml-org#30374) stays.

It also restores upstream's side where the replay took ours: the f16 src1 pointer in
ggml_sycl_op_mul_mat_sycl (ggml-org#29889), SET_ROWS on all threads (ggml-org#30454), and the lilicorr block size
and top_k in the DFlash draft (ggml-org#30506).

Assisted-by: Claude Opus 5.5
iki007 added a commit to iki007/llama.cpp that referenced this pull request Oct 22, 2026
…own copy of our work

Upstream added an IQ3_S / IQ3_XXS weight reorder (ggml-org#29107), a Q8_0 MoE reorder (ggml-org#29337) and wide
q4_K / q5_K dequant stores (ggml-org#29696), all of which this branch already carries. The replay kept our
side of each conflicting hunk but left upstream's copies next to ours; this removes them.

- IQ3: our reorder, MMVQ, MoE GEMV and dequant stay, upstream's go. Upstream's IQ3_S layout puts d
  before the scales and ours after, so the two must not mix.
- Q8_0 MoE: one reorder_qw_q8_0_moe (upstream's, same layout); our MoE reorder GEMV is kept.
- dequant: our wide K-quant and q8_0 reorder dequant are kept (they also cover the reordered
  layouts); upstream's q4_0 reorder fix (ggml-org#30374) stays.

It also restores upstream's side where the replay took ours: the f16 src1 pointer in
ggml_sycl_op_mul_mat_sycl (ggml-org#29889), SET_ROWS on all threads (ggml-org#30454), and the lilicorr block size
and top_k in the DFlash draft (ggml-org#30506).

Assisted-by: Claude Opus 5.5
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 24, 2026
* sycl: persistent IQ3_S/IQ3_XXS weight reorder for SYCL decode and prefill

Add persistent reordered weight layouts for IQ3_S and IQ3_XXS. Weights
are reordered once at load time; the reordered MMVQ dot products then
walk dense super-blocks with dp4a and SWAR sign expansion instead of
gathering bits from the interleaved standard layout. Reorder-aware
dequantization feeds the batched prefill GEMMs so prompt processing
sees the same benefit.

Also harden the oneDNN build check: a missing DNNL package or a
CPU-only DNNL build now fails at configure time instead of silently
producing a degraded backend.

Measured on Intel Arc Pro B70 with Qwen3.8-27B-GSQ-RCO-IQ3_S (MTP),
-ngl 999 -b 4096 -ub 1024 -fa on:

tg256 @ 0 ctx      12.92 -> 23.54 tok/s (+82%)
tg256 @ 9,216      12.33 -> 21.69 tok/s (+76%)
tg256 @ 64,000      9.76 -> 14.91 tok/s (+53%)
pp8192             833.9  -> 833.6 tok/s (flat)

Qwen3.5-9B Q4_K_M / Q3_K_M are unchanged within noise (largest delta
-0.5% pp, tg flat), so standard quants are not affected.

The MMVQ GLU fusion widening and rms_norm+scale fusion are
intentionally not part of this change; master already carries them
via ggml-org#28931.

* removing wait as per review request

* sycl : fix fusion.cpp line ending
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
* sycl: persistent IQ3_S/IQ3_XXS weight reorder for SYCL decode and prefill

Add persistent reordered weight layouts for IQ3_S and IQ3_XXS. Weights
are reordered once at load time; the reordered MMVQ dot products then
walk dense super-blocks with dp4a and SWAR sign expansion instead of
gathering bits from the interleaved standard layout. Reorder-aware
dequantization feeds the batched prefill GEMMs so prompt processing
sees the same benefit.

Also harden the oneDNN build check: a missing DNNL package or a
CPU-only DNNL build now fails at configure time instead of silently
producing a degraded backend.

Measured on Intel Arc Pro B70 with Qwen3.8-27B-GSQ-RCO-IQ3_S (MTP),
-ngl 999 -b 4096 -ub 1024 -fa on:

tg256 @ 0 ctx      12.92 -> 23.54 tok/s (+82%)
tg256 @ 9,216      12.33 -> 21.69 tok/s (+76%)
tg256 @ 64,000      9.76 -> 14.91 tok/s (+53%)
pp8192             833.9  -> 833.6 tok/s (flat)

Qwen3.5-9B Q4_K_M / Q3_K_M are unchanged within noise (largest delta
-0.5% pp, tg flat), so standard quants are not affected.

The MMVQ GLU fusion widening and rms_norm+scale fusion are
intentionally not part of this change; master already carries them
via ggml-org#28931.

* removing wait as per review request

* sycl : fix fusion.cpp line ending
iki007 added a commit to iki007/llama.cpp that referenced this pull request Oct 29, 2026
…own copy of our work

Upstream added an IQ3_S / IQ3_XXS weight reorder (ggml-org#29107), a Q8_0 MoE reorder (ggml-org#29337) and wide
q4_K / q5_K dequant stores (ggml-org#29696), all of which this branch already carries. The replay kept our
side of each conflicting hunk but left upstream's copies next to ours; this removes them.

- IQ3: our reorder, MMVQ, MoE GEMV and dequant stay, upstream's go. Upstream's IQ3_S layout puts d
  before the scales and ours after, so the two must not mix.
- Q8_0 MoE: one reorder_qw_q8_0_moe (upstream's, same layout); our MoE reorder GEMV is kept.
- dequant: our wide K-quant and q8_0 reorder dequant are kept (they also cover the reordered
  layouts); upstream's q4_0 reorder fix (ggml-org#30374) stays.

It also restores upstream's side where the replay took ours: the f16 src1 pointer in
ggml_sycl_op_mul_mat_sycl (ggml-org#29889), SET_ROWS on all threads (ggml-org#30454), and the lilicorr block size
and top_k in the DFlash draft (ggml-org#30506).

Assisted-by: Claude Opus 5.5
iki007 added a commit to iki007/llama.cpp that referenced this pull request Nov 4, 2026
…own copy of our work

Upstream added an IQ3_S / IQ3_XXS weight reorder (ggml-org#29107), a Q8_0 MoE reorder (ggml-org#29337) and wide
q4_K / q5_K dequant stores (ggml-org#29696), all of which this branch already carries. The replay kept our
side of each conflicting hunk but left upstream's copies next to ours; this removes them.

- IQ3: our reorder, MMVQ, MoE GEMV and dequant stay, upstream's go. Upstream's IQ3_S layout puts d
  before the scales and ours after, so the two must not mix.
- Q8_0 MoE: one reorder_qw_q8_0_moe (upstream's, same layout); our MoE reorder GEMV is kept.
- dequant: our wide K-quant and q8_0 reorder dequant are kept (they also cover the reordered
  layouts); upstream's q4_0 reorder fix (ggml-org#30374) stays.

It also restores upstream's side where the replay took ours: the f16 src1 pointer in
ggml_sycl_op_mul_mat_sycl (ggml-org#29889), SET_ROWS on all threads (ggml-org#30454), and the lilicorr block size
and top_k in the DFlash draft (ggml-org#30506).

Assisted-by: Claude Opus 5.5
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 testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants