Skip to content

CUDA: faster MMVQ for low-bit types - #30517

Merged
thelittlefireman merged 2 commits into
masterfrom
aman/vecdot-opt
Oct 17, 2026
Merged

thelittlefireman merged 2 commits into
masterfrom
aman/vecdot-opt

Conversation

@am17an

@am17an am17an commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Additional information

Kernel speedup, test-backend-ops perf on a chain of 60 distinct 4096x14336 matrices (weights not in L2), base vs PR interleaved, 2-3 rounds. q4_K and q8_0 are unchanged and show the noise floor.

ne11 = 1

type RTX PRO 6000 RTX 5090 RTX 4090 RTX 3090 A16 (GA107) GB10 gfx1151
q2_K 1.06 1.13 1.01 1.59 1.71 1.08 1.16
q3_K 1.01 1.06 1.01 1.67 1.59 1.01 1.08
q6_K 1.00 1.01 1.00 1.06 1.19 0.99 1.02
iq1_s 1.09 1.10 1.03 1.27 1.25 1.00 1.00
iq1_m 1.05 1.10 1.00 1.15 1.20 1.00 -
q1_0 1.07 1.12 1.06 1.17 1.21 1.00 -
iq2_s 0.98 1.00 0.98 0.99 1.00 1.15 -
iq3_s 0.99 1.00 1.00 0.99 1.00 1.11 -
q4_K 1.00 1.00 1.00 1.04 1.00 1.00 1.00
q8_0 1.00 1.00 1.00 1.00 1.00 1.00 1.00

ne11 = 2

type RTX PRO 6000 RTX 5090 RTX 4090 RTX 3090 A16 (GA107) GB10 gfx1151
q2_K 1.08 1.12 1.02 1.41 1.37 1.37 1.37
q3_K 1.02 1.05 1.04 1.31 1.36 0.95 1.23
q6_K 1.02 1.03 1.00 1.07 1.22 1.01 1.04
iq1_s 1.00 1.00 0.99 1.03 1.00 1.00 1.00
iq1_m 1.00 1.00 1.00 1.04 1.00 1.00 -
q1_0 0.99 1.02 1.00 0.91 1.00 1.00 -
iq2_s 0.99 0.99 1.00 0.99 1.00 1.00 -
iq3_s 1.00 1.00 1.00 0.99 1.00 1.00 -
q4_K 0.99 1.00 1.00 1.12 1.00 1.00 1.00
q8_0 1.00 1.00 1.00 1.00 1.00 1.00 1.00

ne11 = 4

type RTX PRO 6000 RTX 5090 RTX 4090 RTX 3090 A16 (GA107) GB10 gfx1151
q2_K 1.26 1.26 1.25 1.38 1.40 1.22 1.36
q3_K 1.12 1.12 1.24 1.52 1.33 1.00 1.29
q6_K 1.02 1.05 1.01 1.19 1.21 1.02 1.14
iq1_s 1.00 0.99 0.99 1.02 1.00 1.00 1.00
iq1_m 0.99 1.00 1.00 1.00 1.00 1.00 -
q1_0 0.98 1.00 0.99 1.00 1.00 0.99 -
iq2_s 0.99 0.99 1.00 1.01 1.00 1.00 -
iq3_s 0.99 1.00 1.00 0.98 1.00 1.00 -
q4_K 0.99 0.99 1.00 1.02 1.00 1.00 1.00
q8_0 1.00 1.00 1.00 1.00 0.99 1.00 1.00

ne11 = 8

type RTX PRO 6000 RTX 5090 RTX 4090 RTX 3090 A16 (GA107) GB10 gfx1151
q2_K 0.99 1.00 1.00 1.36 1.22 1.00 1.31
q3_K 0.99 1.00 1.00 1.22 1.22 1.02 1.37
q6_K 0.99 1.00 1.01 1.17 1.27 1.03 1.32
iq1_s 0.99 1.00 1.00 1.00 1.00 0.99 1.00
iq1_m 0.99 1.00 1.00 0.99 1.00 0.99 -
q1_0 0.99 1.00 1.00 1.00 1.00 0.99 -
iq2_s 0.99 1.00 1.00 0.98 1.00 1.00 -
iq3_s 0.98 1.00 0.99 0.95 1.00 1.00 -
q4_K 0.99 1.00 0.99 1.02 1.00 1.00 0.99
q8_0 1.01 0.99 1.00 1.00 0.99 1.00 1.01

llama-bench, -fa 1 -ngl 99 -p 256 -n 128 -ub 1,2,4, base vs PR interleaved, 2 rounds x 3 reps (GB10 and A16: 1 round).

GPU model tg128 base t/s tg128 PR t/s speedup pp256 @ ub2 pp256 @ ub4
RTX PRO 6000 Qwen3.8-27B Q2_K 101.18 103.18 1.02 1.03 1.14
RTX PRO 6000 Qwen3.8-27B Q3_K_S 92.01 93.24 1.01 1.04 1.11
RTX 5090 Qwen3.5-9B Q2_K 269.25 279.27 1.04 1.05 1.15
RTX 5090 Qwen3.5-9B Q3_K_S 251.66 262.23 1.04 1.05 1.11
RTX 5090 Qwen3.5-9B IQ1_S 307.43 313.06 1.02 1.00 1.01
RTX 5090 Qwen3.5-9B IQ2_XXS 308.64 309.10 1.00 1.00 1.01
RTX 5090 Qwen3-30B-A3B Q2_K 361.85 363.36 1.00 1.04 1.08
RTX 5090 Qwen3.5-35B-A3B UD-IQ3_S 246.91 249.26 1.01 1.02 1.01
RTX 4090 Qwen3.5-9B Q2_K 181.37 186.79 1.03 1.02 1.13
RTX 4090 Qwen3.5-9B Q3_K_S 162.65 174.93 1.08 1.02 1.17
RTX 4090 Qwen3.5-9B IQ1_S 231.41 235.04 1.02 1.00 1.00
RTX 4090 Qwen3.5-9B IQ2_XXS 216.63 216.79 1.00 1.01 1.00
RTX 4090 Qwen3-30B-A3B Q2_K 284.61 289.35 1.02 1.07 1.13
RTX 4090 Qwen3.5-35B-A3B UD-IQ3_S 193.08 193.08 1.00 1.00 1.00
RTX 3090 Qwen3.5-9B Q2_K 102.67 141.02 1.37 1.24 1.26
RTX 3090 Qwen3.5-9B Q3_K_S 81.04 126.22 1.56 1.32 1.31
RTX 3090 Qwen3.5-9B IQ1_S 135.43 149.70 1.11 1.01 1.01
RTX 3090 Qwen3.5-9B IQ2_XXS 127.06 128.97 1.01 1.00 1.01
RTX 3090 Qwen3-30B-A3B Q2_K 165.28 191.53 1.16 1.24 1.30
RTX 3090 Qwen3.5-35B-A3B UD-IQ3_S 132.06 136.50 1.03 1.02 1.03
A16 (GA107) Qwen3.5-9B Q2_K 19.98 29.48 1.48 1.26 1.29
A16 (GA107) Qwen3.5-9B Q3_K_S 14.43 24.95 1.73 1.35 1.35
A16 (GA107) Qwen3.5-9B IQ1_S 26.74 30.44 1.14 1.01 1.01
A16 (GA107) Qwen3.5-9B IQ2_XXS 24.99 25.01 1.00 1.01 1.01
GB10 DeepSeek-V4-Flash IQ2_XXS + Q2_K 19.13 19.24 1.01 1.01 1.01
gfx1151 Qwen3.5-4B Q2_K 72.42 75.07 1.04 1.09 1.12
gfx1151 Qwen3.5-4B Q3_K_S 69.70 72.58 1.04 1.06 1.12

Requirements

@am17an
am17an marked this pull request as ready for review October 14, 2026 12:43
@am17an
am17an requested a review from a team as a code owner October 14, 2026 12:43
@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning CUDA Related to the CUDA backend labels Oct 14, 2026
@pwilkin

pwilkin commented Oct 14, 2026

Copy link
Copy Markdown
Member

R9700 (gtx1201) on Windows:

type n=1 n=2 n=3 n=4 n=5 n=8
q2_K 42.3 → 31.1 (1.36×) 58.0 → 41.5 (1.40×) 77.7 → 56.9 (1.37×) 97.1 → 70.9 (1.37×) 118.0 → 86.0 (1.37×) 181.3 → 136.1 (1.33×)
q3_K 40.7 → 28.2 (1.44×) 55.6 → 39.5 (1.41×) 70.7 → 52.3 (1.35×) 84.9 → 64.5 (1.32×) 100.5 → 78.1 (1.29×) 160.6 → 123.5 (1.30×)
q6_K 48.0 → 42.1 (1.14×) 63.0 → 43.2 (1.46×) 78.5 → 57.3 (1.37×) 97.8 → 75.4 (1.30×) 115.2 → 94.4 (1.22×) 174.6 → 142.2 (1.23×)

llama-bench, Qwen3.5-4B (-fa 1 -ngl 99 -p 256 -n 128)

model ub test master t/s PR t/s speedup
Q2_K 1 pp256 158.4 ± 0.6 168.8 ± 0.7 1.066
Q2_K 1 tg128 129.6 ± 1.1 138.0 ± 1.1 1.065
Q2_K 2 pp256 298.6 ± 0.8 303.7 ± 4.3 1.017
Q2_K 2 tg128 129.3 ± 1.0 138.7 ± 1.5 1.073
Q2_K 4 pp256 454.9 ± 2.1 496.2 ± 3.6 1.091
Q2_K 4 tg128 129.1 ± 1.0 136.6 ± 0.7 1.058
Q3_K_S 1 pp256 166.3 ± 0.3 173.7 ± 0.6 1.044
Q3_K_S 1 tg128 135.2 ± 0.8 142.1 ± 0.8 1.051
Q3_K_S 2 pp256 293.5 ± 1.4 301.3 ± 5.1 1.027
Q3_K_S 2 tg128 135.3 ± 0.8 141.5 ± 2.3 1.046
Q3_K_S 4 pp256 478.6 ± 1.5 512.4 ± 5.0 1.071
Q3_K_S 4 tg128 135.5 ± 0.6 141.6 ± 0.9 1.045

@thelittlefireman

thelittlefireman commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

I've got good improvement but also some regressions on Mi50 with Q3_k and Q6_K.

ROCm 7.2.4

Quantization N Master (µs) PR #30517 (µs) Speedup
Q2_K 1 72.88 72.89 -0.01%
Q2_K 2 95.58 94.62 +1.01%
Q2_K 4 180.69 137.95 +30.97%
Q3_K 1 90.81 77.53 +17.12%
Q3_K 2 119.43 129.12 -7.50%
Q3_K 4 184.47 140.16 +31.61%
Q6_K 1 103.34 93.85 +10.10%
Q6_K 2 116.94 115.06 +1.64%
Q6_K 4 175.58 198.66 -11.62%

@am17an

am17an commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@thelittlefireman thanks for testing! I would still consider this acceptable in the interest of keeping things simple.

@thelittlefireman

thelittlefireman commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

@thelittlefireman thanks for testing! I would still consider this acceptable in the interest of keeping things simple.

Sure. I Will try to see if there is a quick fix for regressions.

More bench :
MUL_MAT

Quantization N Master (µs) PR #30517 (µs) Speedup Worst speedup
Q2_K 1 72.08 72.56 -0.66% —
Q2_K 2 94.95 94.25 +0.74% —
Q2_K 3 206.12 150.48 +36.98% —
Q2_K 4 180.39 137.81 +30.90% —
Q2_K 5 205.02 147.54 +38.96% —
Q2_K 8 319.89 214.62 +49.05% —
Q3_K 1 89.84 77.25 +16.30% —
Q3_K 2 118.38 129.02 -8.25% —
Q3_K 3 155.53 185.13 -15.99% —
Q3_K 4 184.23 139.94 +31.65% —
Q3_K 5 272.65 145.36 +87.57% —
Q3_K 8 343.92 203.53 +68.98% —
Q6_K 1 103.06 93.72 +9.97% —
Q6_K 2 116.40 114.84 +1.36% —
Q6_K 3 141.92 128.40 +10.53% —
Q6_K 4 175.11 198.21 -11.65% —
Q6_K 5 180.67 170.33 +6.07% —
Q6_K 8 356.21 262.65 +35.62% —
IQ1_S 1,2,3,4,5,8 — — -0.10% (median) -0.19%
IQ1_M 1,2,3,4,5,8 — — -0.24% (median) -0.73%
IQ2_XXS 1,2,3,4,5,8 — — -0.12% (median) -0.38%
IQ2_XS 1,2,3,4,5,8 — — -0.14% (median) -0.41%
IQ2_S 1,2,3,4,5,8 — — -0.13% (median) -0.37%
IQ3_XXS 1,2,3,4,5,8 — — 0.00% (median) -0.17%
IQ3_S 1,2,3,4,5,8 — — 0.00% (median) -0.17%
IQ4_NL 1,2,3,4,5,8 — — -0.17% (median) -0.24%
IQ4_XS 1,2,3,4,5,8 — — -0.04% (median) -0.09%

@thelittlefireman

Copy link
Copy Markdown
Contributor

@am17an
This small (ugly) patch fix the regression on GCN.

@@ -465,7 +471,12 @@ static constexpr __host__ __device__ int calc_nwarps(ggml_type type, int ncols_d
             default:
                 return 1;
         }
    } else if (table_id == MMVQ_PARAMETERS_GCN) {
+        if (((type == GGML_TYPE_Q3_K && (ncols_dst == 2 || ncols_dst == 3)) ||
+             (type == GGML_TYPE_Q6_K && ncols_dst == 4))) {
+            return 1;
+        }
Quantization N Master (µs) PR + nwarps=1 (µs) Speedup
Q2_K 1 72.69 72.92 -0.3%
Q2_K 2 95.43 94.57 +0.9%
Q2_K 3 206.59 150.69 +37.1%
Q2_K 4 180.56 137.88 +31.0%
Q2_K 5 204.91 147.60 +38.8%
Q2_K 8 319.89 214.73 +49.0%
Q3_K 1 90.53 77.61 +16.6%
Q3_K 2 119.17 93.29 +27.7%
Q3_K 3 155.92 102.97 +51.4%
Q3_K 4 184.47 140.13 +31.6%
Q3_K 5 272.69 145.59 +87.3%
Q3_K 8 344.32 204.04 +68.8%
Q6_K 1 103.28 93.90 +10.0%
Q6_K 2 116.77 114.94 +1.6%
Q6_K 3 142.51 128.52 +10.9%
Q6_K 4 175.44 158.77 +10.5%
Q6_K 5 180.76 170.42 +6.1%
Q6_K 8 356.05 262.74 +35.5%

@am17an

am17an commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@thelittlefireman feel free to push this change to this branch (you should have access)

@thelittlefireman

Copy link
Copy Markdown
Contributor

Done more test on others AMD arch CDNA and RDNA2

| AMD Instinct MI100
AMD Radeon RX 6800

Quant n MI100 Master (µs) MI100 Opt (µs) MI100 Speedup RX 6800 Master (µs) RX 6800 Opt (µs) RX 6800 Speedup
Q2_K 1 46.68 48.75 -4.25% 107.27 69.21 +54.99%
Q2_K 2 80.70 62.56 +29.00% 157.56 105.52 +49.32%
Q2_K 3 102.43 100.10 +2.33% 211.94 142.24 +49.00%
Q2_K 4 123.74 87.86 +40.84% 260.86 180.43 +44.58%
Q2_K 5 110.55 111.38 -0.75% 318.59 306.71 +3.87%
Q2_K 8 111.22 111.91 -0.62% 464.68 587.22 -20.87%
Q3_K 1 62.07 51.50 +20.52% 110.60 69.98 +58.05%
Q3_K 2 83.41 68.02 +22.63% 145.58 101.93 +42.82%
Q3_K 3 139.87 74.24 +88.40% 182.08 171.63 +6.09%
Q3_K 4 97.93 98.87 -0.95% 266.70 185.03 +44.14%
Q3_K 5 99.10 99.77 -0.67% 297.72 229.09 +29.96%
Q3_K 8 99.39 100.09 -0.70% 474.80 375.26 +26.53%
Q6_K 1 69.61 63.84 +9.04% 105.74 76.98 +37.36%
Q6_K 2 80.81 78.60 +2.81% 145.48 110.38 +31.80%
Q6_K 3 96.13 101.31 -5.11% 189.25 150.87 +25.44%
Q6_K 4 137.71 105.17 +30.94% 230.08 189.88 +21.17%
Q6_K 5 130.33 131.84 -1.15% 277.39 215.49 +28.73%
Q6_K 8 130.38 131.74 -1.03% 403.17 321.54 +25.39%

I will try to suggest a fix for regressions tomorrow.

@am17an

am17an commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Any slowdown less than 5% seems like noise to me. At this point it is bike-shedding.

@thelittlefireman

thelittlefireman commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

@am17an I agree.

For RX 6800 the main issue is that there is no specific config for RDNA2 on ggml_cuda_should_use_mmvq and it's fallback to de default return ne11 <= MMVQ_MAX_BATCH_SIZE;

We could add this fix (Specially for Q2_K with n ==8) for the PR

 427     if (GGML_CUDA_CC_IS_RDNA2(cc)) {
 428         switch (type) { // tuned for RDNA2
 429             // TODO Add and bench other types of quants
 430             case GGML_TYPE_Q2_K:
 431                 return ne11 == 8;
 432             default:
 433                 return ne11 <= MMVQ_MAX_BATCH_SIZE;
 434         }
 435     }

But it like put a band-aid on a bullet wound and will need futher bench/fix/PR for other quants.

Also Mi100/CDNA use the same tableid => MMVQ_PARAMETERS_GCN and then have the same specialization on calc_nwarps and calc_rows_per_block
we should split and make specific tables for each arch. Another PR to do 😿

@IMbackK we could merge the PR as if and then make others PR for thoses specific issues, what do you think ?

@IMbackK IMbackK 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.

Fine with me.
FYI the "GCN" tables where tuned by me on CDNA, i dont expect mutch movement between the two on this kernel but i did tune them a long time ago so things may have shifted for other reasons.

@thelittlefireman
thelittlefireman merged commit 2744e48 into master Oct 17, 2026
17 checks passed

@JohannesGaessler JohannesGaessler 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.

Thank you, longer-term we should look to refactor the MMVQ kernel with explicit re-use of data more generally.

smalinin pushed a commit to smalinin/llama.cpp that referenced this pull request Oct 23, 2026
Port the upstream low-bit dot products, two-row MMVQ launches, and GCN
warp adjustments while preserving the fork's fusion and MoE launch paths.
The upstream DGX-prefetch distance hunk is inapplicable: this branch does
not have that prefetch path.

Pass the true output row count to generic MMVQ and guard odd tail rows
before loads and writes. Using the output token stride as the row bound
could write into another expert when two rows share a block. Guard the
specialized MoE tail loads as well.

Validated on Ada and Ampere: 1764 exact-Q8-input operator checks,
432 fusion checks, and 72 memcheck cases with no CUDA memory errors.
Existing numerical tolerances are unchanged. Full-model speed was not
measured.

(cherry picked from commit 2744e48)

Co-authored-by: thelittlefireman <[email protected]>
Assisted-by: Codex
edwardyoon added a commit to edwardyoon/focus-llama that referenced this pull request Oct 25, 2026
…pstream

ggml-org#29435: prefer whole tiles over stream-K on DGX Spark when async KV
preload + mask scan with >=75% tile efficiency.
ggml-org#30517: Q2_K/Q3_K/Q6_K VDR 1->2, two rows per block (low-bit, GB10
IQ2_S/IQ3_S, per-type GCN nwarps, Q3_K/Q6_K prefetch distance 1.

Cherry-pick conflicts resolved manually: local master already has later
upstream commits on these files (HIP calc_max_nwarps rename,
need_f16_KV), so hunks were adapted to the local state.
EOF
)
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
* CUDA: faster MMVQ for low-bit types

* ggml-cuda: hip: small nwarps GCN fix on Q3_K(ncols=2,3), Q6_K(ncols=4)

---------

Co-authored-by: thelittlefireman <[email protected]>
@BrewTestBot BrewTestBot mentioned this pull request Oct 28, 2026
1 task done
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Oct 29, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Oct 29, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Oct 29, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Oct 31, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 9, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 10, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 11, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 11, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 12, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 12, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 13, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 14, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 14, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 15, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 16, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 18, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
dzannotti added a commit to rcfa/strix-llama.cpp that referenced this pull request Nov 18, 2026
Step 10 (ggml-org#30517): Q6_K MMVQ now reads VDR_Q6_K_Q8_1_MMVQ = 2 ints per thread and the impl takes arrays; the fork's 4-column RDNA3.5 kernel steps kqs by get_vdr_mmvq() and now loads both ints, as upstream's vec_dot_q6_K_q8_1 does (it read only the first of the two before this fix, which would drop half of each block).
Step 100 (ggml-org#32018): quantize_row_q8_1_cuda lost its unused ids and type_src0 arguments.

Assisted-by: Claude Opus 5.5

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YKmjzcT1LTvKtbw9EzBVGE
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 18, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 18, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 18, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 18, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 19, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 19, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 19, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 20, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 21, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 21, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 21, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 21, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 22, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 25, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 25, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
stew675 pushed a commit to stew675/llama.cpp that referenced this pull request Nov 27, 2026
… pad)

- old-10: per-type mmvq VDR/nwarps for Q4_K/Q5_K/Q6_K/Q8_0, dense Q6_K VDR=2
  and the MoE-expert VDR split.
- old-04 MMQ: GGML_CUDA_MMQ_J_MAX and the mmq-vec-dot x_scale/x_df hoist.
- old-15: the Q1_0 ggml_cuda_byte_perm port (vecdotq.cuh + mmq-load-tiles.cuh),
  the gfx1201 grid-stall pad (common.cuh + mmvf.cu), the mmvf multi-token
  cross-warp reduction and the mmq-vec-dot #pragma unroll 1 for gfx12.
- old-04's MUL_MAT Q6_K/Q8_0 test shapes.
- r169: dense Q6_K keeps upstream ggml-org#30517's VDR=2 on every arch (measured on
  gfx1151: within noise of VDR=1 at B=1/B=4 and d16384, +1.2 % at batched B=8,
  width-pure against draft-mtp).  -DGGML_HIP_Q6K_DENSE_VDR1 restores the
  pre-ggml-org#30517 VDR=1 association order for a consumer that gates on output
  identity; the MoE-expert VDR is per kernel and unaffected.

NOTE: the mmvq multi-row/row-loop decode hunks (old-15 PR ggml-org#57) are NOT here --
they are interleaved with the fused-MoE item-split in the same function and are
deferred to 09 (see PHASE1-STATUS.md).

Re-based onto a691b23 (mmvq.cu conflicted, 2 hunks: the per-architecture MMVQ table
id).  The block splits the old combined mapping -- RDNA3_5 (gfx1151) gets its own table
(nwarps swept), real RDNA2 (gfx103x) gets the Navi21 table -- where upstream maps all of
RDNA2 || RDNA3_5 to the RDNA2 table.  The delivery's split is kept and upstream's new
RDNA4_M family is folded into it (RDNA4_M -> the RDNA2 table) on both the device and the
host table-id paths.  Build green; same-seed greedy text byte-identical with MMVQ on/off
(33 chars, sha 3de206c8878b) on Qwen3-Coder-30B-A3B.

r290 amendment -- the VERIFY-band WMMA iu8 matvec family (contributor burnoutIA, PR ggml-org#317; folded here
because this block is the delivery's decode-numerics block: it owns vecdotq.cuh's vec_dot_* family and
the mmvq K-split loop, and its contract is already "same real-number result, different addition order").

  * mmvq-wmma.cu/.cuh (new) + a fall-through in ggml_cuda_mul_mat_vec_q: for a dense, unfused MUL_MAT at
    N..8 columns on RDNA4, compute the product with wmma_i32_16x16x16_iu8, dequantizing each weight ONCE
    for all the verified columns.  Q4_K, Q5_K, Q6_K and IQ4_XS in their GGUF layout on the existing q8_1
    activations, plus Q8_0 (r290, ours: no dequantization, no min term, no table -- and its own per-format
    stride unit, because a Q8_0 block is 32 elements where the K-quants' is 256).  Q5_K's min term is
    d.SUM(q) through a ones matrix, as vec_dot_q5_K_q8_1 does (ds.y moves the outputs ~1 % and drops the
    DFlash2 acceptance).  Numerics against the K-split kernel: ~3.2e-7 relative (max 4.2e-5 on a 130 scale)
    at widths 2..8 for every covered type, i.e. rounding order only.
  * --wmma-verify off|auto|N (common), alias GGML_CUDA_WMMA_MMVQ=N, applied per device through the backend
    registry's proc-address table (no new cross-backend interface member in this block).
  * OPT-IN and WIDTH-SPLIT BY DESIGN: 1 column always keeps the K-split kernel, so while the option is ON
    the byte-identical greedy/verify contract (GREEDY-PURITY.md invariant 1) does NOT hold.  Default is
    OFF, and with it off nothing on the default path is reached -- this block's own contract is unchanged.
  * Measured (r289, 27B UD-Q4_K_M and Q8_0, 1 and 2 GPUs, finite work): width 8 +9.0 % (1 GPU) / +10.6 %
    (2 GPU tensor split) for the K-quants and +4.2 % for Q8_0; width 7 +2..7.1 %; width 6 -4.4..+1.9 %
    (split-dependent); widths 2..5 -0.5..-5.7 %.  Hence `auto` = 7, the first width it wins.  End to end
    (DFlash2 n=7, recall): cycle 37.0 -> 33.5 ms on the 2-GPU Q4_K_M split (+10.4 % tokens/s at identical
    acceptance), 43.6 -> 41.8 ms on Q8_0 (+4.2 %).  Not where the width is >8: those rounds are MMQ, so
    adaptive MTP n12 is neutral.  Gate: coherence (off == the r289 build, byte for byte) plus the four-axis
    A/B and llama-batched-bench with it on; ENVIRONMENT.md, GREEDY-PURITY.md and patches/README.md carry
    the numbers.

Co-authored-by: burnoutIA <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CUDA Related to the CUDA backend ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants