graph : use fill instead of scale_bias in grouped expert selection (#17867)
* use fill instead of scale_bias in grouped expert selection * do not explicitly use _inplace
This commit is contained in:
parent
2fa51c19b0
commit
c8554b66e0
|
|
@ -973,7 +973,7 @@ ggml_tensor * llm_graph_context::build_moe_ffn(
|
||||||
|
|
||||||
// mask out the other groups
|
// mask out the other groups
|
||||||
selection_probs = ggml_get_rows(ctx0, selection_groups, expert_groups); // [n_exp_per_group, n_group_used, n_tokens]
|
selection_probs = ggml_get_rows(ctx0, selection_groups, expert_groups); // [n_exp_per_group, n_group_used, n_tokens]
|
||||||
selection_probs = ggml_set_rows(ctx0, ggml_scale_bias(ctx0, selection_groups, 0.0f, -INFINITY), selection_probs, expert_groups); // [n_exp_per_group, n_expert_groups, n_tokens]
|
selection_probs = ggml_set_rows(ctx0, ggml_fill(ctx0, selection_groups, -INFINITY), selection_probs, expert_groups); // [n_exp_per_group, n_expert_groups, n_tokens]
|
||||||
selection_probs = ggml_reshape_2d(ctx0, selection_probs, n_expert, n_tokens); // [n_expert, n_tokens]
|
selection_probs = ggml_reshape_2d(ctx0, selection_probs, n_expert, n_tokens); // [n_expert, n_tokens]
|
||||||
cb(selection_probs, "ffn_moe_probs_masked", il);
|
cb(selection_probs, "ffn_moe_probs_masked", il);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue