Skip to content

ggml-cuda: widen Q4_K MMVQ weight loads to global_load_b128 - #88

Open
Annieren wants to merge 1 commit into
gfx11from
annier.q4_k-mmvq-b128
Open

ggml-cuda: widen Q4_K MMVQ weight loads to global_load_b128#88
Annieren wants to merge 1 commit into
gfx11from
annier.q4_k-mmvq-b128

Conversation

@Annieren

@Annieren Annieren commented Aug 17, 2026

Copy link
Copy Markdown

Set VDR_Q4_K_Q8_1_MMVQ to 8 so each thread owns a full 32-byte Q4_K group and loads its weights as two int4 (lowered to global_load_b128), cutting weight-load instructions on the bandwidth-dominant side. Activations stay scalar b32 (block_q8_1 is 36B, not 16B-aligned). Numerically equivalent to the VDR=2 path. Measured +1-2% typical decode on the MMVQ path (gfx1151,GGML_CUDA_DQ_MMV=0), up to +6-7% on some models; Q4_K-only, no effect on the
default DQ path.

Q4_K MMVQ b128 sweep — DQ0 results

Decode throughput (tg128 t/s), baseline VDR=2 → new VDR=8

Model Quant DQ0 base DQ0 new DQ0 Δ%
gemma-4-E2B Q4_K 93.36 99.69 +6.8
gemma-4-26B-A4B Q4_K 44.51 47.39 +6.5
SmolLM2-1.7B Q4_K 130.71 136.76 +4.6
Qwen2.5-3B Q4_K 84.49 87.94 +4.1
Llama-2-7B Q4_K 43.24 44.91 +3.9
gemma-4-31B Q4_K 10.37 10.76 +3.7
Qwen2.5-7B Q4_K 44.78 45.87 +2.4
Qwen3.5-9B Q4_K 36.40 37.23 +2.3
Qwen3-30B-A3B Q4_K 69.39 70.95 +2.2
Llama-3.1-8B Q4_K 40.54 41.31 +1.9
Qwen3-1.7B Q4_K 128.89 131.13 +1.7
Qwen3.5-4B Q4_K 60.46 61.21 +1.2
gemma-4-12b Q4_K 26.09 26.34 +1.0
Qwen3-4B Q4_K 64.54 65.18 +1.0
Qwen3-8B Q4_K 39.29 39.65 +0.9
Qwen3.6-35B Q4_K_M 58.53 59.00 +0.8
Qwen3.5-35B-A3B Q4_K 57.82 58.17 +0.6
gemma-2-2b Q4_K 93.61 94.11 +0.5
Qwen3.6-35B Q4_K_XL 56.75 57.03 +0.5
Qwen2.5-0.5B Q4_K 303.48 304.03 +0.2
DeepSeek-R1-Qwen-7B Q4_K 44.75 44.82 +0.2
Qwen3.5-4B Q4_0 65.42 65.41 +0.0
Qwen3.5-9B Q4_0 39.37 38.90 +0.0
Qwen3.6-35B Q5_K_XL 55.42 55.11 +0.0

Set VDR_Q4_K_Q8_1_MMVQ to 8 so each thread owns a full 32-byte Q4_K group
and loads its weights as two int4 (lowered to global_load_b128), cutting
weight-load instructions on the bandwidth-dominant side. Activations stay
scalar b32 (block_q8_1 is 36B, not 16B-aligned). Numerically equivalent to
the VDR=2 path. Measured +1-2% typical decode on the MMVQ path (gfx1151,
GGML_CUDA_DQ_MMV=0), up to +6-7% on some models; Q4_K-only, no effect on the
default DQ path.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@Annieren
Annieren requested a review from jimw567 August 17, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant