Skip to content

Commit 4d37adf

Browse files
committed
fix reported active params number
1 parent 2dee2b5 commit 4d37adf

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

models/megrez.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ namespace chatllm::megrez::moe
187187
GenericGroupedSparseMoE(ctx, hidden_size, BlockParams::MoE::num_experts, BlockParams::MoE::experts_per_tok, true, false, false, false)
188188
{
189189
}
190+
int64_t get_param_num(bool effective_only) const override
191+
{
192+
int64_t r = GenericSparseMLP::get_param_num(effective_only);
193+
if (effective_only)
194+
r += p_experts->get_param_num(effective_only);
195+
return r;
196+
}
190197
};
191198

192199
class Prelude

src/layers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2465,7 +2465,7 @@ namespace chatllm
24652465
ggml::tensor *weights);
24662466
virtual ggml::tensor *calc_experts_outputs(ComputeContext *ctx, ggml::tensor *hidden_states,
24672467
ggml::tensor *selected_experts);
2468-
private:
2468+
protected:
24692469
MultiMLP *p_experts; // shared pointer, not owned!
24702470
};
24712471

0 commit comments

Comments
 (0)