imatrix: use data for ffn_up when data for ffn_gate is missing

This commit is contained in:
Kawrakow 2026-05-15 04:24:07 +00:00
parent ba72890076
commit 25ab82abd3

View File

@ -1477,6 +1477,9 @@ static void llama_model_quantize_internal(const std::string & fname_inp, const s
} else if (auto pos = name.find("ffn_gate_up_exps.weight"); pos != std::string::npos) {
auto not_merged_name = name.substr(0, pos) + "ffn_up_exps.weight";
it = imatrix_data->find(not_merged_name);
} else if (auto pos2 = name.find("ffn_gate.weight"); pos2 != std::string::npos) {
auto up_name = name.substr(0, pos2) + "ffn_up.weight";
it = imatrix_data->find(up_name);
} else {
// MLA hack: most imatrix files floating around the Internet have been computed with standard attention.
// This means that the imatrix file does not contain data for the *.attn_k_b.weight and *.attn_v_b.weight