Update rollout_model.py (#4349)
Some checks failed
CE Compile Job / ce_job_pre_check (push) Has been cancelled
CE Compile Job / print_ce_job_pre_check_outputs (push) Has been cancelled
CE Compile Job / FD-Clone-Linux (push) Has been cancelled
CE Compile Job / Show Code Archive Output (push) Has been cancelled
CE Compile Job / BUILD_SM8090 (push) Has been cancelled
CE Compile Job / BUILD_SM8689 (push) Has been cancelled
CE Compile Job / CE_UPLOAD (push) Has been cancelled

This commit is contained in:
gaoziyuan
2025-10-11 11:30:05 +08:00
committed by GitHub
parent 5035dd82ed
commit 0c4c28d799

View File

@@ -391,7 +391,6 @@ class Qwen3MoeForCausalLMRL(Qwen3MoeForCausalLM, BaseRLModel):
# Initialize mapping dictionary # Initialize mapping dictionary
self._update_base_mappings("model") self._update_base_mappings("model")
self.infer_to_train_mapping = {}
base_name = "model.layers" base_name = "model.layers"
@@ -402,13 +401,13 @@ class Qwen3MoeForCausalLMRL(Qwen3MoeForCausalLM, BaseRLModel):
f"{base_name}.{layer_idx}.mlp.gate.weight" f"{base_name}.{layer_idx}.mlp.gate.weight"
) )
if self.fd_config.moe_config.moe_use_aux_free: if self.fd_config.model_config.moe_use_aux_free:
self.infer_to_train_mapping[f"{base_name}.{layer_idx}.mlp.experts.gate_correction_bias"] = ( self.infer_to_train_mapping[f"{base_name}.{layer_idx}.mlp.experts.gate_correction_bias"] = (
f"{base_name}.{layer_idx}.mlp.moe_statics.e_score_correction_bias" f"{base_name}.{layer_idx}.mlp.moe_statics.e_score_correction_bias"
) )
# MoE experts mappings # MoE experts mappings
for expert_idx in range(self.fd_config.moe_config.num_experts): for expert_idx in range(self.fd_config.model_config.num_experts):
for ph in place_holders: for ph in place_holders:
# up_gate_proj (up_gate_proj) # up_gate_proj (up_gate_proj)
up_gate_proj_key = f"{base_name}.{layer_idx}.mlp.experts.up_gate_proj_weight" up_gate_proj_key = f"{base_name}.{layer_idx}.mlp.experts.up_gate_proj_weight"