Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions python/sglang/srt/models/deepseek_nextn.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
"up_proj.weight_scale_inv",
]
names_to_remove = []
for num_repeat in range(self.n_share_experts_fusion):
for suffix in suffix_list:
shared_expert_weight_name = (
f"model.layers.0.mlp.shared_experts.{suffix}"
)
for suffix in suffix_list:
shared_expert_weight_name = (
f"model.layers.0.mlp.shared_experts.{suffix}"
)
for num_repeat in range(self.n_share_experts_fusion):
weights_list.append(
(
f"model.layers.0."
Expand All @@ -229,7 +229,7 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
weights_dict[shared_expert_weight_name],
)
)
names_to_remove += [shared_expert_weight_name]
names_to_remove += [shared_expert_weight_name]
weights = [w for w in weights_list if w[0] not in names_to_remove]

# Params for weights, fp8 weight scales, fp8 activation scales
Expand Down
12 changes: 6 additions & 6 deletions python/sglang/srt/models/deepseek_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,11 +1650,11 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
desc=f"Cloning {self.n_share_experts_fusion} "
"replicas of the shared expert into MoE",
):
for num_repeat in range(self.n_share_experts_fusion):
for suffix in suffix_list:
shared_expert_weight_name = (
f"model.layers.{moe_layer}.mlp.shared_experts.{suffix}"
)
for suffix in suffix_list:
shared_expert_weight_name = (
f"model.layers.{moe_layer}.mlp.shared_experts.{suffix}"
)
for num_repeat in range(self.n_share_experts_fusion):
weights_list.append(
(
f"model.layers.{moe_layer}."
Expand All @@ -1664,7 +1664,7 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
weights_dict[shared_expert_weight_name],
)
)
names_to_remove += [shared_expert_weight_name]
names_to_remove += [shared_expert_weight_name]
weights = [w for w in weights_list if w[0] not in names_to_remove]

# Params for weights, fp8 weight scales, fp8 activation scales
Expand Down
Loading