Skip to content

Commit 2f5dae2

Browse files
ikawrakowIwan Kawrakow
andauthored
Change --n-cpu-moe to not keep expert biases on CPU (ikawrakow#841)
* Change --n-cpu-moe to not keep expert biases ion CPU * Also for --cpu-moe --------- Co-authored-by: Iwan Kawrakow <[email protected]>
1 parent 28d3e63 commit 2f5dae2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/common.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
11521152
return true;
11531153
}
11541154
if (arg == "--cpu-moe" || arg == "-cmoe") {
1155-
params.tensor_buft_overrides.push_back({strdup("\\.ffn_(up|down|gate)_exps"), ggml_backend_cpu_buffer_type()});
1155+
params.tensor_buft_overrides.push_back({strdup("\\.ffn_(up|down|gate)_exps\\.weight"), ggml_backend_cpu_buffer_type()});
11561156
return true;
11571157
}
11581158
if (arg == "--n-cpu-moe" || arg == "-ncmoe") {
@@ -1164,7 +1164,7 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
11641164
return true;
11651165
}
11661166
for (int32_t l = 0; l < n_layers; ++l) {
1167-
std::string pattern = "blk\\." + std::to_string(l) + "\\.(ffn_(up|down|gate)_exps)";
1167+
std::string pattern = "blk\\." + std::to_string(l) + "\\.(ffn_(up|down|gate)_exps\\.weight)";
11681168
params.tensor_buft_overrides.push_back({strdup(pattern.c_str()), ggml_backend_cpu_buffer_type()});
11691169
}
11701170
return true;

0 commit comments

Comments
 (0)