Fix the fix (#1433)

This commit is contained in:
Kawrakow 2026-03-15 17:33:10 +01:00 committed by GitHub
parent edf54621d2
commit 56f4e9e673
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -4679,8 +4679,7 @@ static void llama_repack_up_gate_exps(llama_context & lctx) {
bool needs_repack = false;
for (auto & l : model.layers) {
if (l.ffn_up_gate_exps && l.ffn_up_exps && l.ffn_gate_exps &&
ggml_backend_buffer_is_host(l.ffn_up_gate_exps->buffer) &&
ggml_backend_buffer_is_host(l.ffn_up_exps->buffer) && ggml_backend_buffer_is_host(l.ffn_gate_exps->buffer)) {
!l.ffn_up_gate_exps->extra) {
needs_repack = true; break;
}
}
@ -4690,8 +4689,7 @@ static void llama_repack_up_gate_exps(llama_context & lctx) {
for (int il = 0; il < int(model.layers.size()); ++il) {
auto & l = model.layers[il];
if (l.ffn_up_gate_exps && l.ffn_up_exps && l.ffn_gate_exps &&
ggml_backend_buffer_is_host(l.ffn_up_gate_exps->buffer) &&
ggml_backend_buffer_is_host(l.ffn_up_exps->buffer) && ggml_backend_buffer_is_host(l.ffn_gate_exps->buffer)) {
!l.ffn_up_gate_exps->extra) {
GGML_ASSERT(l.ffn_up_gate_exps->type == l.ffn_up_exps->type && l.ffn_up_gate_exps->type == l.ffn_gate_exps->type);
GGML_ASSERT(l.ffn_up_gate_exps->ne[0] == l.ffn_up_exps->ne[0] && l.ffn_up_gate_exps->ne[0] == l.ffn_gate_exps->ne[0]);
GGML_ASSERT(l.ffn_up_gate_exps->ne[2] == l.ffn_up_exps->ne[2] && l.ffn_up_gate_exps->ne[2] == l.ffn_gate_exps->ne[2]);