Support Gemma4 MoE NVFP4 (#25054)

This commit is contained in:
Charles Chen
2026-05-20 22:45:15 -07:00
committed by GitHub
parent 888a8794ef
commit 847cbada9c
9 changed files with 271 additions and 118 deletions
+8 -1
View File
@@ -826,7 +826,14 @@ class Scheduler(
self.model_config.hf_config, "text_config", self.model_config.hf_config
)
if hasattr(config_to_check, "num_experts_per_tok"):
# Different MoE architectures expose the per-token expert count under
# different attribute names (e.g. Gemma4 uses ``top_k_experts``).
moe_topk_attrs = (
"num_experts_per_tok",
"num_experts_per_token",
"top_k_experts",
)
if any(hasattr(config_to_check, attr) for attr in moe_topk_attrs):
initialize_moe_config(self.server_args)
# Initialize GEMM-related configuration for FP8 and FP4 backends.