Skip to content

Conversation

@CISC
Copy link
Collaborator

@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
Collaborator

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
Collaborator 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
Collaborator

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
Collaborator 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
basnijholt pushed a commit to basnijholt/llama.cpp that referenced this pull request Nov 16, 2025
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.

3 participants