]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Keep Minimax's indexer tensors at F32 for speed and accuracy (#26144)
authorBartowski <redacted>
Sun, 26 Jul 2026 22:02:56 +0000 (18:02 -0400)
committerGitHub <redacted>
Sun, 26 Jul 2026 22:02:56 +0000 (18:02 -0400)
* Keep Minimax's indexer tensors at F32 for speed and accuracy

* name -> new_name

conversion/minimax.py
src/llama-quant.cpp

index cbbdfe3ae82d2f539480a0ea6c886b62a6fb5149..e82e393a382912e843a29df77d8313fb4a9db84e 100644 (file)
@@ -58,6 +58,11 @@ class MiniMaxM2Model(TextModel):
 class MiniMaxM3Model(MiniMaxM2Model):
     model_arch = gguf.MODEL_ARCH.MINIMAXM3
 
+    def tensor_force_quant(self, name, new_name, bid, n_dims):
+        if ".indexer." in new_name:
+            return gguf.GGMLQuantizationType.F32
+        return super().tensor_force_quant(name, new_name, bid, n_dims)
+
     def set_gguf_parameters(self):
         super().set_gguf_parameters()
 
index caf7733a5bff1475588319e61cb1d18a00898679..7c0bac07d09614ddc0d941599e8a5864af3c5ace 100644 (file)
@@ -326,6 +326,10 @@ static bool tensor_allows_quantization(const llama_model_quantize_params * param
     quantize &= name.find("ssm_conv1d") == std::string::npos;
     quantize &= name.find("shortconv.conv.weight") == std::string::npos;
 
+    // do not quantize MiniMax's indexer projection weights, they are tiny
+    quantize &= name.find("indexer.k_proj.weight") == std::string::npos;
+    quantize &= name.find("indexer.q_proj.weight") == std::string::npos;
+
     // do not quantize RWKV's small yet 2D weights
     quantize &= name.find("time_mix_first.weight") == std::string::npos;
     quantize &= name.find("time_mix_w0.weight") == std::string::npos;