Fix the fix (#1433)
This commit is contained in:
parent
edf54621d2
commit
56f4e9e673
|
|
@ -4679,8 +4679,7 @@ static void llama_repack_up_gate_exps(llama_context & lctx) {
|
||||||
bool needs_repack = false;
|
bool needs_repack = false;
|
||||||
for (auto & l : model.layers) {
|
for (auto & l : model.layers) {
|
||||||
if (l.ffn_up_gate_exps && l.ffn_up_exps && l.ffn_gate_exps &&
|
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) &&
|
!l.ffn_up_gate_exps->extra) {
|
||||||
ggml_backend_buffer_is_host(l.ffn_up_exps->buffer) && ggml_backend_buffer_is_host(l.ffn_gate_exps->buffer)) {
|
|
||||||
needs_repack = true; break;
|
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) {
|
for (int il = 0; il < int(model.layers.size()); ++il) {
|
||||||
auto & l = model.layers[il];
|
auto & l = model.layers[il];
|
||||||
if (l.ffn_up_gate_exps && l.ffn_up_exps && l.ffn_gate_exps &&
|
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) &&
|
!l.ffn_up_gate_exps->extra) {
|
||||||
ggml_backend_buffer_is_host(l.ffn_up_exps->buffer) && ggml_backend_buffer_is_host(l.ffn_gate_exps->buffer)) {
|
|
||||||
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->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[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]);
|
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]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue