Commit a8ed77891 for llama.cpp
commit a8ed7789149479dbf2abf0367c8fe8d10d73be82
Author: thelittlefireman <5165783+thelittlefireman@users.noreply.github.com>
Date: Tue Nov 24 12:36:32 2026 +0100
hip: use MMQ over MMVQ for Q4_K,N8 and NVFP4,N7-8 on VEGA20 (#32805)
diff --git a/ggml/src/ggml-cuda/mmvq.cu b/ggml/src/ggml-cuda/mmvq.cu
index 6f10428e6..3549fbe32 100644
--- a/ggml/src/ggml-cuda/mmvq.cu
+++ b/ggml/src/ggml-cuda/mmvq.cu
@@ -441,6 +441,17 @@ bool ggml_cuda_should_use_mmvq(enum ggml_type type, int cc, int64_t ne11) {
return ne11 <= MMVQ_MAX_BATCH_SIZE;
}
}
+ // VEGA20 devices are the only devices with dense MMQ -> ggml_cuda_should_use_mmq()
+ if (cc == GGML_CUDA_CC_VEGA20) {
+ switch (type) { // tuned on MI50 (gfx906)
+ case GGML_TYPE_Q4_K:
+ return ne11 <= 7;
+ case GGML_TYPE_NVFP4:
+ return ne11 <= 6;
+ default:
+ return ne11 <= MMVQ_MAX_BATCH_SIZE;
+ }
+ }
return ne11 <= MMVQ_MAX_BATCH_SIZE;
}