Skip to content

vulkan: Allow non-pow2 n_experts in topk_moe - #17872

Merged
0cc4m merged 1 commit into
ggml-org:masterfrom
jeffbolznv:topk_moe_np2
Dec 13, 2025
Merged

vulkan: Allow non-pow2 n_experts in topk_moe#17872
0cc4m merged 1 commit into
ggml-org:masterfrom
jeffbolznv:topk_moe_np2

Conversation

@jeffbolznv

Copy link
Copy Markdown
Contributor

Saw granite-3.0-3b-a800m-instruct-Q8_0.gguf being used at https://www.phoronix.com/review/llama-cpp-vulkan-eoy2025/3, with lower than expected scaling for 5090.

before:

Z:\github\jeffbolznv\llama.cpp\build\bin\RelWithDebInfo>llama-bench -fa 1 -p 512 -n 128 --prio 1 -r 10 -m c:\models\granite-3.0-3b-a800m-instruct-Q8_0.gguf
ggml_vulkan: 0 = NVIDIA GeForce RTX 4070 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: NV_coopmat2
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           pp512 |    11545.75 ± 199.63 |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           tg128 |        305.26 ± 3.35 |

ggml_vulkan: 0 = NVIDIA GeForce RTX 5090 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: NV_coopmat2
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           pp512 |   26586.25 ± 3416.45 |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           tg128 |        455.17 ± 6.23 |

after:

Z:\github\jeffbolznv\llama.cpp\build\bin\RelWithDebInfo>llama-bench -fa 1 -p 512 -n 128 --prio 1 -r 10 -m c:\models\granite-3.0-3b-a800m-instruct-Q8_0.gguf
ggml_vulkan: 0 = NVIDIA GeForce RTX 4070 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: NV_coopmat2
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           pp512 |    11704.54 ± 179.34 |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           tg128 |        325.64 ± 1.62 |

ggml_vulkan: 0 = NVIDIA GeForce RTX 5090 (NVIDIA) | uma: 0 | fp16: 1 | bf16: 1 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: NV_coopmat2
| model                          |       size |     params | backend    | ngl | fa |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | -: | --------------: | -------------------: |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           pp512 |    28154.26 ± 504.16 |
| granitemoe 3B Q8_0             |   3.34 GiB |     3.37 B | Vulkan     |  99 |  1 |           tg128 |       521.35 ± 10.23 |

@github-actions github-actions Bot added testing Everything test related Vulkan Issues specific to the Vulkan backend ggml changes relating to the ggml tensor library for machine learning labels Dec 9, 2025
@0cc4m
0cc4m merged commit 07a10c1 into ggml-org:master Dec 13, 2025
77 of 78 checks passed
Anico2 added a commit to Anico2/llama.cpp that referenced this pull request Jan 15, 2026
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
phibya pushed a commit to ziee-ai/llama.cpp that referenced this pull request May 29, 2026
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
MrLordCat referenced this pull request in MrLordCat/llama.cpp-with-GUI Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning testing Everything test related Vulkan Issues specific to the Vulkan backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants