Repository navigation
ggml-zendnn : group matmul direct API for mul_mat_id - #25918
Merged
ggerganov merged 2 commits intoJul 31, 2026
Merged
Conversation
Member
|
cc: @z-vishal |
avinashcpandey
approved these changes
Jul 30, 2026
taronaeo
approved these changes
Jul 30, 2026
huaxel
pushed a commit
to huaxel/strix-llama.cpp
that referenced
this pull request
Aug 2, 2026
* ggml-zendnn : group matmul API for mul_mat_id * ggml-zendnn : scale MUL_MAT_ID fallback threshold by expert count
satindergrewal
pushed a commit
to satindergrewal/llama.cpp
that referenced
this pull request
Aug 12, 2026
* ggml-zendnn : group matmul API for mul_mat_id * ggml-zendnn : scale MUL_MAT_ID fallback threshold by expert count
thecodacus
pushed a commit
to thecodacus/llama.cpp
that referenced
this pull request
Sep 7, 2026
* ggml-zendnn : group matmul API for mul_mat_id * ggml-zendnn : scale MUL_MAT_ID fallback threshold by expert count
zbrad
pushed a commit
to zbrad/llama.cpp
that referenced
this pull request
Sep 10, 2026
* ggml-zendnn : group matmul API for mul_mat_id * ggml-zendnn : scale MUL_MAT_ID fallback threshold by expert count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR updates the vendored ZenDNN dependency to the latest WW28 release and switches the ZenDNN mul_mat_id implementation to use grouped GEMM, allowing all active experts to be processed in a single backend call.
Changes
Add
ggml_zendnn_group_matmul()andggml_zendnn_group_gemm()wrappers that batch all active experts' GEMMs into a single ZenDNN grouped GEMM call instead of issuing one call per expert.Rework
ggml_zendnn_compute_forward_mul_mat_id()to support grouped execution:total_rowsinstead ofmax_rows, since data for all active experts must coexist for a single grouped GEMM.src1→vec_dot_typeconversion into the gather step, eliminating the separate conversion pass.Restructure the execution flow from
for each expert: gather → GEMM → scattertogather all experts → one grouped GEMM → scatter all experts.Remove the outdated comment in
device_supports_op()that described grouped GEMM as future work. The existing 32-expert limit remains unchanged.Requirements