Speedup shared expert weight construction by avoid cloning (#5188)

This commit is contained in:
fzyzcjy
2025-04-21 09:12:01 +08:00
committed by GitHub
parent f08154193c
commit 5239d79568

View File

@@ -1628,7 +1628,7 @@ class DeepseekV2ForCausalLM(nn.Module):
f"mlp.experts."
f"{self.config.n_routed_experts + num_repeat}"
f".{suffix}",
weights_dict[shared_expert_weight_name].clone(),
weights_dict[shared_expert_weight_name],
)
)
names_to_remove += [shared_expert_weight_name]