Skip to content

convert : set expert gating func in base class#17279

Merged
CISC merged 1 commit intomasterfrom
cisc/convert-common-expert-gating-func
Nov 15, 2025
Merged

convert : set expert gating func in base class#17279
CISC merged 1 commit intomasterfrom
cisc/convert-common-expert-gating-func

Conversation

@CISC
Copy link
Member

@CISC CISC commented Nov 14, 2025

Move add_expert_gating_func call to base class, no point in duplicating this.

Also fixes conversion failure for dots1 since the following fixes to the model:

self.gguf_writer.add_expert_weights_scale(self.hparams["routed_scaling_factor"])
self.gguf_writer.add_expert_weights_norm(self.hparams["norm_topk_prob"])

if self.hparams["scoring_func"] == "noaux_tc":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This noaux_tc is probably not handled now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's on purpose, as mentioned in OP, this was incorrectly set in dots1, and fixed shortly after release, but never here.

self.gguf_writer.add_expert_group_used_count(n_group_used)
logger.info(f"gguf: expert groups used count = {n_group_used}")

if (score_func := self.find_hparam(["score_function", "scoring_func", "score_func"], optional=True)) is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if there is a way to mark this as required (optional=False) for certain model

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you'd have to maintain a list, not very practical, besides if your model requires this it will throw at graph build.

@CISC CISC merged commit 9d3ef48 into master Nov 15, 2025
10 checks passed
@CISC CISC deleted the cisc/convert-common-expert-gating-func branch November 15, 2025 13:06
Anico2 added a commit to Anico2/llama.cpp that referenced this pull request Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants