Overriding the number of experts in Gemma 4 26B-A4B

#3106
by SubMaroon - opened

Hi! I'm currently preparing an experimental Gemma 4 26B-A4B model that will run with 12 active experts by default.

The use of 12 experts will be specified in config.json (text_config.top_k_experts = 12), and as far as I know, llama.cpp's convert_hf_to_gguf.py takes this value from the config.

I wanted to ask if your scripts override these values ​​to the default 8 experts?

SubMaroon changed discussion title from Overriding the number of experts in Gemma 26B-A4B to Overriding the number of experts in Gemma 4 26B-A4B

we are using the main llamacpp always, I dont think it will override unless main llamacpp does it. we can try to do a run if you upload a model

P.S. 16 experts

mainline llama.cpp will write it from config.json:

conversion/base.py 1940-1942:

 if (n_experts_used := self.find_hparam(["num_experts_per_tok", "num_experts_per_token", "top_k_experts"], optional=True)) is not None:
            self.gguf_writer.add_expert_used_count(n_experts_used)
            logger.info(f"gguf: experts used count = {n_experts_used}")

Sign up or log in to comment