Skip to content

Commit e5c32f2

Browse files
authored
skip group selection when there are no tokens
1 parent f82f050 commit e5c32f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama-graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ ggml_tensor * llm_graph_context::build_moe_ffn(
929929
}
930930

931931
// select top n_group_used expert groups
932-
if (arch == LLM_ARCH_BAILINGMOE2) {
932+
if (arch == LLM_ARCH_BAILINGMOE2 && n_tokens > 0) {
933933
const int64_t n_exp_per_group = n_expert / hparams.n_expert_groups;
934934

935935
// organize experts into n_expert_groups

0 commit comments

Comments
 (0)